index
int64
0
20.3k
text
stringlengths
0
1.3M
year
stringdate
1987-01-01 00:00:00
2024-01-01 00:00:00
No
stringlengths
1
4
6,500
Learning to learn by gradient descent by gradient descent Marcin Andrychowicz1, Misha Denil1, Sergio Gómez Colmenarejo1, Matthew W. Hoffman1, David Pfau1, Tom Schaul1, Brendan Shillingford1,2, Nando de Freitas1,2,3 1Google DeepMind 2University of Oxford 3Canadian Institute for Advanced Research marcin.andrychowicz@gmail.com {mdenil,sergomez,mwhoffman,pfau,schaul}@google.com brendan.shillingford@cs.ox.ac.uk, nandodefreitas@google.com Abstract The move from hand-designed features to learned features in machine learning has been wildly successful. In spite of this, optimization algorithms are still designed by hand. In this paper we show how the design of an optimization algorithm can be cast as a learning problem, allowing the algorithm to learn to exploit structure in the problems of interest in an automatic way. Our learned algorithms, implemented by LSTMs, outperform generic, hand-designed competitors on the tasks for which they are trained, and also generalize well to new tasks with similar structure. We demonstrate this on a number of tasks, including simple convex problems, training neural networks, and styling images with neural art. 1 Introduction Frequently, tasks in machine learning can be expressed as the problem of optimizing an objective function f(✓) defined over some domain ✓2 ⇥. The goal in this case is to find the minimizer ✓⇤= arg min✓2⇥f(✓). While any method capable of minimizing this objective function can be applied, the standard approach for differentiable functions is some form of gradient descent, resulting in a sequence of updates ✓t+1 = ✓t −↵trf(✓t) . The performance of vanilla gradient descent, however, is hampered by the fact that it only makes use of gradients and ignores second-order information. Classical optimization techniques correct this behavior by rescaling the gradient step using curvature information, typically via the Hessian matrix of second-order partial derivatives—although other choices such as the generalized Gauss-Newton matrix or Fisher information matrix are possible. Much of the modern work in optimization is based around designing update rules tailored to specific classes of problems, with the types of problems of interest differing between different research communities. For example, in the deep learning community we have seen a proliferation of optimization methods specialized for high-dimensional, non-convex optimization problems. These include momentum [Nesterov, 1983, Tseng, 1998], Rprop [Riedmiller and Braun, 1993], Adagrad [Duchi et al., 2011], RMSprop [Tieleman and Hinton, 2012], and ADAM [Kingma and Ba, 2015]. More focused methods can also be applied when more structure of the optimization problem is known [Martens and Grosse, 2015]. In contrast, communities who focus on sparsity tend to favor very different approaches [Donoho, 2006, Bach et al., 2012]. This is even more the case for combinatorial optimization for which relaxations are often the norm [Nemhauser and Wolsey, 1988]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. optimizer optimizee p a ra m e t e r u p d a te s e rr o r s ig n a l Figure 1: The optimizer (left) is provided with performance of the optimizee (right) and proposes updates to increase the optimizee’s performance. [photos: Bobolas, 2009, Maley, 2011] This industry of optimizer design allows different communities to create optimization methods which exploit structure in their problems of interest at the expense of potentially poor performance on problems outside of that scope. Moreover the No Free Lunch Theorems for Optimization [Wolpert and Macready, 1997] show that in the setting of combinatorial optimization, no algorithm is able to do better than a random strategy in expectation. This suggests that specialization to a subclass of problems is in fact the only way that improved performance can be achieved in general. In this work we take a different tack and instead propose to replace hand-designed update rules with a learned update rule, which we call the optimizer g, specified by its own set of parameters φ. This results in updates to the optimizee f of the form ✓t+1 = ✓t + gt(rf(✓t), φ) . (1) A high level view of this process is shown in Figure 1. In what follows we will explicitly model the update rule g using a recurrent neural network (RNN) which maintains its own state and hence dynamically updates as a function of its iterates. 1.1 Transfer learning and generalization The goal of this work is to develop a procedure for constructing a learning algorithm which performs well on a particular class of optimization problems. Casting algorithm design as a learning problem allows us to specify the class of problems we are interested in through example problem instances. This is in contrast to the ordinary approach of characterizing properties of interesting problems analytically and using these analytical insights to design learning algorithms by hand. It is informative to consider the meaning of generalization in this framework. In ordinary statistical learning we have a particular function of interest, whose behavior is constrained through a data set of example function evaluations. In choosing a model we specify a set of inductive biases about how we think the function of interest should behave at points we have not observed, and generalization corresponds to the capacity to make predictions about the behavior of the target function at novel points. In our setting the examples are themselves problem instances, which means generalization corresponds to the ability to transfer knowledge between different problems. This reuse of problem structure is commonly known as transfer learning, and is often treated as a subject in its own right. However, by taking a meta-learning perspective, we can cast the problem of transfer learning as one of generalization, which is much better studied in the machine learning community. One of the great success stories of deep-learning is that we can rely on the ability of deep networks to generalize to new examples by learning interesting sub-structures. In this work we aim to leverage this generalization power, but also to lift it from simple supervised learning to the more general setting of optimization. 1.2 A brief history and related work The idea of using learning to learn or meta-learning to acquire knowledge or inductive biases has a long history [Thrun and Pratt, 1998]. More recently, Lake et al. [2016] have argued forcefully for its importance as a building block in artificial intelligence. Similarly, Santoro et al. [2016] frame multi-task learning as generalization, however unlike our approach they directly train a base learner rather than a training algorithm. In general these ideas involve learning which occurs at two different time scales: rapid learning within tasks and more gradual, meta learning across many different tasks. Perhaps the most general approach to meta-learning is that of Schmidhuber [1992, 1993]—building on work from [Schmidhuber, 1987]—which considers networks that are able to modify their own weights. Such a system is differentiable end-to-end, allowing both the network and the learning 2 algorithm to be trained jointly by gradient descent with few restrictions. However this generality comes at the expense of making the learning rules very difficult to train. Alternatively, the work of Schmidhuber et al. [1997] uses the Success Story Algorithm to modify its search strategy rather than gradient descent; a similar approach has been recently taken in Daniel et al. [2016] which uses reinforcement learning to train a controller for selecting step-sizes. Bengio et al. [1990, 1995] propose to learn updates which avoid back-propagation by using simple parametric rules. In relation to the focus of this paper the work of Bengio et al. could be characterized as learning to learn without gradient descent by gradient descent. The work of Runarsson and Jonsson [2000] builds upon this work by replacing the simple rule with a neural network. Cotter and Conwell [1990], and later Younger et al. [1999], also show fixed-weight recurrent neural networks can exhibit dynamic behavior without need to modify their network weights. Similarly this has been shown in a filtering context [e.g. Feldkamp and Puskorius, 1998], which is directly related to simple multi-timescale optimizers [Sutton, 1992, Schraudolph, 1999]. Finally, the work of Younger et al. [2001] and Hochreiter et al. [2001] connects these different threads of research by allowing for the output of backpropagation from one network to feed into an additional learning network, with both networks trained jointly. Our approach to meta-learning builds on this work by modifying the network architecture of the optimizer in order to scale this approach to larger neural-network optimization problems. 2 Learning to learn with recurrent neural networks In this work we consider directly parameterizing the optimizer. As a result, in a slight abuse of notation we will write the final optimizee parameters ✓⇤(f, φ) as a function of the optimizer parameters φ and the function in question. We can then ask the question: What does it mean for an optimizer to be good? Given a distribution of functions f we will write the expected loss as L(φ) = Ef h f " ✓⇤(f, φ) #i . (2) As noted earlier, we will take the update steps gt to be the output of a recurrent neural network m, parameterized by φ, whose state we will denote explicitly with ht. Next, while the objective function in (2) depends only on the final parameter value, for training the optimizer it will be convenient to have an objective that depends on the entire trajectory of optimization, for some horizon T, L(φ) = Ef " T X t=1 wtf(✓t) # where ✓t+1 = ✓t + gt ,  gt ht+1 ) = m(rt, ht, φ) . (3) Here wt 2 R≥0 are arbitrary weights associated with each time-step and we will also use the notation rt = r✓f(✓t). This formulation is equivalent to (2) when wt = 1[t = T], but later we will describe why using different weights can prove useful. We can minimize the value of L(φ) using gradient descent on φ. The gradient estimate @L(φ)/@φ can be computed by sampling a random function f and applying backpropagation to the computational graph in Figure 2. We allow gradients to flow along the solid edges in the graph, but gradients along the dashed edges are dropped. Ignoring gradients along the dashed edges amounts to making the assumption that the gradients of the optimizee do not depend on the optimizer parameters, i.e. @rt * @φ = 0. This assumption allows us to avoid computing second derivatives of f. Examining the objective in (3) we see that the gradient is non-zero only for terms where wt 6= 0. If we use wt = 1[t = T] to match the original problem, then gradients of trajectory prefixes are zero and only the final optimization step provides information for training the optimizer. This renders Backpropagation Through Time (BPTT) inefficient. We solve this problem by relaxing the objective such that wt > 0 at intermediate points along the trajectory. This changes the objective function, but allows us to train the optimizer on partial trajectories. For simplicity, in all our experiments we use wt = 1 for every t. 3 Optimizee Optimizer t-2 t-1 t m m m + + + ft-1 ft ft-2 ∇t-2 ∇t-1 ∇t ht-2 ht-1 ht ht+1 gt-1 gt θt-2 θt-1 θt θt+1 gt-2 Figure 2: Computational graph used for computing the gradient of the optimizer. 2.1 Coordinatewise LSTM optimizer One challenge in applying RNNs in our setting is that we want to be able to optimize at least tens of thousands of parameters. Optimizing at this scale with a fully connected RNN is not feasible as it would require a huge hidden state and an enormous number of parameters. To avoid this difficulty we will use an optimizer m which operates coordinatewise on the parameters of the objective function, similar to other common update rules like RMSprop and ADAM. This coordinatewise network architecture allows us to use a very small network that only looks at a single coordinate to define the optimizer and share optimizer parameters across different parameters of the optimizee. Different behavior on each coordinate is achieved by using separate activations for each objective function parameter. In addition to allowing us to use a small network for this optimizer, this setup has the nice effect of making the optimizer invariant to the order of parameters in the network, since the same update rule is used independently on each coordinate. LSTM1 f LSTMn ∇1 θ1 θn + + … ∇n … … … … Figure 3: One step of an LSTM optimizer. All LSTMs have shared parameters, but separate hidden states. We implement the update rule for each coordinate using a two-layer Long Short Term Memory (LSTM) network [Hochreiter and Schmidhuber, 1997], using the now-standard forget gate architecture. The network takes as input the optimizee gradient for a single coordinate as well as the previous hidden state and outputs the update for the corresponding optimizee parameter. We will refer to this architecture, illustrated in Figure 3, as an LSTM optimizer. The use of recurrence allows the LSTM to learn dynamic update rules which integrate information from the history of gradients, similar to momentum. This is known to have many desirable properties in convex optimization [see e.g. Nesterov, 1983] and in fact many recent learning procedures—such as ADAM—use momentum in their updates. Preprocessing and postprocessing Optimizer inputs and outputs can have very different magnitudes depending on the class of function being optimized, but neural networks usually work robustly only for inputs and outputs which are neither very small nor very large. In practice rescaling inputs and outputs of an LSTM optimizer using suitable constants (shared across all timesteps and functions f) is sufficient to avoid this problem. In Appendix A we propose a different method of preprocessing inputs to the optimizer inputs which is more robust and gives slightly better performance. 4 Figure 4: Comparisons between learned and hand-crafted optimizers performance. Learned optimizers are shown with solid lines and hand-crafted optimizers are shown with dashed lines. Units for the y axis in the MNIST plots are logits. Left: Performance of different optimizers on randomly sampled 10-dimensional quadratic functions. Center: the LSTM optimizer outperforms standard methods training the base network on MNIST. Right: Learning curves for steps 100-200 by an optimizer trained to optimize for 100 steps (continuation of center plot). 3 Experiments In all experiments the trained optimizers use two-layer LSTMs with 20 hidden units in each layer. Each optimizer is trained by minimizing Equation 3 using truncated BPTT as described in Section 2. The minimization is performed using ADAM with a learning rate chosen by random search. We use early stopping when training the optimizer in order to avoid overfitting the optimizer. After each epoch (some fixed number of learning steps) we freeze the optimizer parameters and evaluate its performance. We pick the best optimizer (according to the final validation loss) and report its average performance on a number of freshly sampled test problems. We compare our trained optimizers with standard optimizers used in Deep Learning: SGD, RMSprop, ADAM, and Nesterov’s accelerated gradient (NAG). For each of these optimizer and each problem we tuned the learning rate, and report results with the rate that gives the best final error for each problem. When an optimizer has more parameters than just a learning rate (e.g. decay coefficients for ADAM) we use the default values from the optim package in Torch7. Initial values of all optimizee parameters were sampled from an IID Gaussian distribution. 3.1 Quadratic functions In this experiment we consider training an optimizer on a simple class of synthetic 10-dimensional quadratic functions. In particular we consider minimizing functions of the form f(✓) = kW✓−yk2 2 for different 10x10 matrices W and 10-dimensional vectors y whose elements are drawn from an IID Gaussian distribution. Optimizers were trained by optimizing random functions from this family and tested on newly sampled functions from the same distribution. Each function was optimized for 100 steps and the trained optimizers were unrolled for 20 steps. We have not used any preprocessing, nor postprocessing. Learning curves for different optimizers, averaged over many functions, are shown in the left plot of Figure 4. Each curve corresponds to the average performance of one optimization algorithm on many test functions; the solid curve shows the learned optimizer performance and dashed curves show the performance of the standard baseline optimizers. It is clear the learned optimizers substantially outperform the baselines in this setting. 3.2 Training a small neural network on MNIST In this experiment we test whether trainable optimizers can learn to optimize a small neural network on MNIST, and also explore how the trained optimizers generalize to functions beyond those they were trained on. To this end, we train the optimizer to optimize a base network and explore a series of modifications to the network architecture and training procedure at test time. 5 Figure 5: Comparisons between learned and hand-crafted optimizers performance. Units for the y axis are logits. Left: Generalization to the different number of hidden units (40 instead of 20). Center: Generalization to the different number of hidden layers (2 instead of 1). This optimization problem is very hard, because the hidden layers are very narrow. Right: Training curves for an MLP with 20 hidden units using ReLU activations. The LSTM optimizer was trained on an MLP with sigmoid activations. Figure 6: Systematic study of final MNIST performance as the optimizee architecture is varied, using sigmoid non-linearities. The vertical dashed line in the left-most plot denotes the architecture at which the LSTM is trained and the horizontal line shows the final performance of the trained optimizer in this setting. In this setting the objective function f(✓) is the cross entropy of a small MLP with parameters ✓. The values of f as well as the gradients @f(✓)/@✓are estimated using random minibatches of 128 examples. The base network is an MLP with one hidden layer of 20 units using a sigmoid activation function. The only source of variability between different runs is the initial value ✓0 and randomness in minibatch selection. Each optimization was run for 100 steps and the trained optimizers were unrolled for 20 steps. We used input preprocessing described in Appendix A and rescaled the outputs of the LSTM by the factor 0.1. Learning curves for the base network using different optimizers are displayed in the center plot of Figure 4. In this experiment NAG, ADAM, and RMSprop exhibit roughly equivalent performance the LSTM optimizer outperforms them by a significant margin. The right plot in Figure 4 compares the performance of the LSTM optimizer if it is allowed to run for 200 steps, despite having been trained to optimize for 100 steps. In this comparison we re-used the LSTM optimizer from the previous experiment, and here we see that the LSTM optimizer continues to outperform the baseline optimizers on this task. Generalization to different architectures Figure 5 shows three examples of applying the LSTM optimizer to train networks with different architectures than the base network on which it was trained. The modifications are (from left to right) (1) an MLP with 40 hidden units instead of 20, (2) a network with two hidden layers instead of one, and (3) a network using ReLU activations instead of sigmoid. In the first two cases the LSTM optimizer generalizes well, and continues to outperform the hand-designed baselines despite operating outside of its training regime. However, changing the activation function to ReLU makes the dynamics of the learning procedure sufficiently different that the learned optimizer is no longer able to generalize. Finally, in Figure 6 we show the results of systematically varying the tested architecture; for the LSTM results we again used the optimizer trained using 1 layer of 20 units and sigmoid non-linearities. Note that in this setting where the 6 Figure 7: Optimization performance on the CIFAR-10 dataset and subsets. Shown on the left is the LSTM optimizer versus various baselines trained on CIFAR-10 and tested on a held-out test set. The two plots on the right are the performance of these optimizers on subsets of the CIFAR labels. The additional optimizer LSTM-sub has been trained only on the heldout labels and is hence transferring to a completely novel dataset. test-set problems are similar enough to those in the training set we see even better generalization than the baseline optimizers. 3.3 Training a convolutional network on CIFAR-10 Next we test the performance of the trained neural optimizers on optimizing classification performance for the CIFAR-10 dataset [Krizhevsky, 2009]. In these experiments we used a model with both convolutional and feed-forward layers. In particular, the model used for these experiments includes three convolutional layers with max pooling followed by a fully-connected layer with 32 hidden units; all non-linearities were ReLU activations with batch normalization. The coordinatewise network decomposition introduced in Section 2.1—and used in the previous experiment—utilizes a single LSTM architecture with shared weights, but separate hidden states, for each optimizee parameter. We found that this decomposition was not sufficient for the model architecture introduced in this section due to the differences between the fully connected and convolutional layers. Instead we modify the optimizer by introducing two LSTMs: one proposes parameter updates for the fully connected layers and the other updates the convolutional layer parameters. Like the previous LSTM optimizer we still utilize a coordinatewise decomposition with shared weights and individual hidden states, however LSTM weights are now shared only between parameters of the same type (i.e. fully-connected vs. convolutional). The performance of this trained optimizer compared against the baseline techniques is shown in Figure 7. The left-most plot displays the results of using the optimizer to fit a classifier on a held-out test set. The additional two plots on the right display the performance of the trained optimizer on modified datasets which only contain a subset of the labels, i.e. the CIFAR-2 dataset only contains data corresponding to 2 of the 10 labels. Additionally we include an optimizer LSTM-sub which was only trained on the held-out labels. In all these examples we can see that the LSTM optimizer learns much more quickly than the baseline optimizers, with significant boosts in performance for the CIFAR-5 and especially CIFAR-2 datsets. We also see that the optimizers trained only on a disjoint subset of the data is hardly effected by this difference and transfers well to the additional dataset. 3.4 Neural Art The recent work on artistic style transfer using convolutional networks, or Neural Art [Gatys et al., 2015], gives a natural testbed for our method, since each content and style image pair gives rise to a different optimization problem. Each Neural Art problem starts from a content image, c, and a style image, s, and is given by f(✓) = ↵Lcontent(c, ✓) + βLstyle(s, ✓) + γLreg(✓) The minimizer of f is the styled image. The first two terms try to match the content and style of the styled image to that of their first argument, and the third term is a regularizer that encourages smoothness in the styled image. Details can be found in [Gatys et al., 2015]. 7 Figure 8: Optimization curves for Neural Art. Content images come from the test set, which was not used during the LSTM optimizer training. Note: the y-axis is in log scale and we zoom in on the interesting portion of this plot. Left: Applying the training style at the training resolution. Right: Applying the test style at double the training resolution. Figure 9: Examples of images styled using the LSTM optimizer. Each triple consists of the content image (left), style (right) and image generated by the LSTM optimizer (center). Left: The result of applying the training style at the training resolution to a test image. Right: The result of applying a new style to a test image at double the resolution on which the optimizer was trained. We train optimizers using only 1 style and 1800 content images taken from ImageNet [Deng et al., 2009]. We randomly select 100 content images for testing and 20 content images for validation of trained optimizers. We train the optimizer on 64x64 content images from ImageNet and one fixed style image. We then test how well it generalizes to a different style image and higher resolution (128x128). Each image was optimized for 128 steps and trained optimizers were unrolled for 32 steps. Figure 9 shows the result of styling two different images using the LSTM optimizer. The LSTM optimizer uses inputs preprocessing described in Appendix A and no postprocessing. See Appendix C for additional images. Figure 8 compares the performance of the LSTM optimizer to standard optimization algorithms. The LSTM optimizer outperforms all standard optimizers if the resolution and style image are the same as the ones on which it was trained. Moreover, it continues to perform very well when both the resolution and style are changed at test time. Finally, in Appendix B we qualitatively examine the behavior of the step directions generated by the learned optimizer. 4 Conclusion We have shown how to cast the design of optimization algorithms as a learning problem, which enables us to train optimizers that are specialized to particular classes of functions. Our experiments have confirmed that learned neural optimizers compare favorably against state-of-the-art optimization methods used in deep learning. We witnessed a remarkable degree of transfer, with for example the LSTM optimizer trained on 12,288 parameter neural art tasks being able to generalize to tasks with 49,152 parameters, different styles, and different content images all at the same time. We observed similar impressive results when transferring to different architectures in the MNIST task. The results on the CIFAR image labeling task show that the LSTM optimizers outperform handengineered optimizers when transferring to datasets drawn from the same data distribution. References F. Bach, R. Jenatton, J. Mairal, and G. Obozinski. Optimization with sparsity-inducing penalties. Foundations and Trends in Machine Learning, 4(1):1–106, 2012. 8 S. Bengio, Y. Bengio, and J. Cloutier. On the search for new learning rules for ANNs. Neural Processing Letters, 2(4):26–30, 1995. Y. Bengio, S. Bengio, and J. Cloutier. Learning a synaptic learning rule. Université de Montréal, Département d’informatique et de recherche opérationnelle, 1990. F. Bobolas. brain-neurons, 2009. URL https://www.flickr.com/photos/fbobolas/3822222947. Creative Commons Attribution-ShareAlike 2.0 Generic. N. E. Cotter and P. R. Conwell. Fixed-weight networks can learn. In International Joint Conference on Neural Networks, pages 553–559, 1990. C. Daniel, J. Taylor, and S. Nowozin. Learning step size controllers for robust neural network training. In Association for the Advancement of Artificial Intelligence, 2016. J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, pages 248–255. IEEE, 2009. D. L. Donoho. Compressed sensing. Transactions on Information Theory, 52(4):1289–1306, 2006. J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121–2159, 2011. L. A. Feldkamp and G. V. Puskorius. A signal processing framework based on dynamic neural networks with application to problems in adaptation, filtering, and classification. Proceedings of the IEEE, 86(11): 2259–2277, 1998. L. A. Gatys, A. S. Ecker, and M. Bethge. A neural algorithm of artistic style. arXiv Report 1508.06576, 2015. S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. S. Hochreiter, A. S. Younger, and P. R. Conwell. Learning to learn using gradient descent. In International Conference on Artificial Neural Networks, pages 87–94. Springer, 2001. D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. B. M. Lake, T. D. Ullman, J. B. Tenenbaum, and S. J. Gershman. Building machines that learn and think like people. arXiv Report 1604.00289, 2016. T. Maley. neuron, 2011. URL https://www.flickr.com/photos/taylortotz101/6280077898. Creative Commons Attribution 2.0 Generic. J. Martens and R. Grosse. Optimizing neural networks with Kronecker-factored approximate curvature. In International Conference on Machine Learning, pages 2408–2417, 2015. G. L. Nemhauser and L. A. Wolsey. Integer and combinatorial optimization. John Wiley & Sons, 1988. Y. Nesterov. A method of solving a convex programming problem with convergence rate o (1/k2). In Soviet Mathematics Doklady, volume 27, pages 372–376, 1983. M. Riedmiller and H. Braun. A direct adaptive method for faster backpropagation learning: The RPROP algorithm. In International Conference on Neural Networks, pages 586–591, 1993. T. P. Runarsson and M. T. Jonsson. Evolution and design of distributed learning rules. In IEEE Symposium on Combinations of Evolutionary Computation and Neural Networks, pages 59–63. IEEE, 2000. A. Santoro, S. Bartunov, M. Botvinick, D. Wierstra, and T. Lillicrap. Meta-learning with memory-augmented neural networks. In International Conference on Machine Learning, 2016. J. Schmidhuber. Evolutionary principles in self-referential learning; On learning how to learn: The meta-meta-... hook. PhD thesis, Institut f. Informatik, Tech. Univ. Munich, 1987. J. Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 4(1):131–139, 1992. J. Schmidhuber. A neural network that embeds its own meta-levels. In International Conference on Neural Networks, pages 407–412. IEEE, 1993. J. Schmidhuber, J. Zhao, and M. Wiering. Shifting inductive bias with success-story algorithm, adaptive levin search, and incremental self-improvement. Machine Learning, 28(1):105–130, 1997. N. N. Schraudolph. Local gain adaptation in stochastic gradient descent. In International Conference on Artificial Neural Networks, volume 2, pages 569–574, 1999. R. S. Sutton. Adapting bias by gradient descent: An incremental version of delta-bar-delta. In Association for the Advancement of Artificial Intelligence, pages 171–176, 1992. S. Thrun and L. Pratt. Learning to learn. Springer Science & Business Media, 1998. T. Tieleman and G. Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4:2, 2012. P. Tseng. An incremental gradient (-projection) method with momentum term and adaptive stepsize rule. Journal on Optimization, 8(2):506–531, 1998. D. H. Wolpert and W. G. Macready. No free lunch theorems for optimization. Transactions on Evolutionary Computation, 1(1):67–82, 1997. A. S. Younger, P. R. Conwell, and N. E. Cotter. Fixed-weight on-line learning. Transactions on Neural Networks, 10(2):272–283, 1999. A. S. Younger, S. Hochreiter, and P. R. Conwell. Meta-learning with backpropagation. In International Joint Conference on Neural Networks, 2001. 9
2016
556
6,501
Mixed vine copulas as joint models of spike counts and local field potentials Arno Onken Istituto Italiano di Tecnologia 38068 Rovereto (TN), Italy arno.onken@iit.it Stefano Panzeri Istituto Italiano di Tecnologia 38068 Rovereto (TN), Italy stefano.panzeri@iit.it Abstract Concurrent measurements of neural activity at multiple scales, sometimes performed with multimodal techniques, become increasingly important for studying brain function. However, statistical methods for their concurrent analysis are currently lacking. Here we introduce such techniques in a framework based on vine copulas with mixed margins to construct multivariate stochastic models. These models can describe detailed mixed interactions between discrete variables such as neural spike counts, and continuous variables such as local field potentials. We propose efficient methods for likelihood calculation, inference, sampling and mutual information estimation within this framework. We test our methods on simulated data and demonstrate applicability on mixed data generated by a biologically realistic neural network. Our methods hold the promise to considerably improve statistical analysis of neural data recorded simultaneously at different scales. 1 Introduction The functions of the brain likely rely on the concerted interaction of its microscopic, mesoscopic and macroscopic systems. Concurrent recordings of signals at different scales, such as simultaneous measurements of field potential and single-cell spiking activity or other multimodal measures such as concurrent electrophysiological and fMRI measures, are leading to rapid advances in understanding brain dynamics [16]. Analysis of these concurrent data is complicated by the great difference in nature (e.g. discrete vs. continuous) and signal-to-noise ratio of each type of neural signal. To take full advantage of these data, flexible statistical models that take into account many variables with different statistics and their dependencies are needed. Recently, construction of multivariate statistical models based on the concept of copulas has attracted a lot of attention [9]. Intuitively, a copula represents a particular relationship between a set of random variables that, together with separate margin models of the individual elements can be used to construct a joint statistical model. This approach has become an indispensable tool in economics, finance and risk management in both theoretical and practical applications [9, 13, 11]. Yet, despite their promise, application to neuroscience has been limited [10, 14, 19]. The copula approach is general and, in principle, applicable to model mixed discrete and continuous statistics. Specific cases of mixed discrete and continuous copula-based models with parametric distributions were recently applied in clinical applications [24, 7]. Racine [17] proposed nonparametric mixed copula distributions based on kernel density estimators. In most studies, however, the elements of the copula-based multivariate distributions are all continuous [9, 13, 11]. A reason for this is that in the general case, likelihood calculation has exponential complexity in the number of discrete elements, limiting the usefulness of the models. In particular, these methods are impractical for likelihood-based estimation of information-theoretic quantities which requires many likelihood evaluations. Smith and Khaled [23] recently proposed a copula-based framework with quadratic complexity, but limited to fully discrete distributions. For valuable applications in neuroscience settings, however, we need a framework 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. that can overcome these limitations and cope with elements (i.e. number of neurons, activity sites) that have different statistical properties - some continuous and others discrete - while still allowing efficient likelihood calculation. Here, we develop a framework to accomplish these goals by means of vine copulas with mixed discrete and continuous margins. We describe methods to make numeric model selection, parameter fitting and sampling scale efficiently with the number of elements and apply these methods to estimate information-theoretic quantities. To demonstrate our framework, we draw samples from mixed models and simulate mixed activity in a biologically realistic neural network. We then apply our methods to these data and show that our methods outperform corresponding mixed independent and fully continuous models. 2 Mixed vine copulas Our goal is to construct multivariate distributions with arbitrary mixed margins and a wide range of possible dependence structures. To accomplish this goal, we apply an approach that individuates the margin part and the dependence part. The dependence is represented by a copula. Briefly, a copula is defined as a multivariate distribution function with support on the unit hypercube and uniform margins [13]. We will denote multivariate random variables by X with elements Xi. We denote the cumulative distribution function (CDF) of X by FX with margin CDFs Fi. For consistency of notation, we will denote probability density functions as well as probability mass functions by fX with margins fi. 2.1 Mixed copula-based models The great strength of copulas is their utility for constructing and decomposing multivariate distributions. Sklar’s Theorem [21, 13] lays out the theoretical foundations for this. According to this theorem, every CDF FX can be decomposed into margins F1, . . . , Fd and a copula C such that FX(x1, . . . , xd) = C(F1(x1), . . . , Fd(xd)) (1) and, conversely, margins F1, . . . , Fd, a copula C and Eq. 1 can be used to construct a CDF FX. In this decomposition, C is unique on the range of X. Sklar’s Theorem holds for mixed discrete and continuous distributions and thus provides a method to construct multivariate mixed distributions based on CDFs of copulas and margins. The important point here is that the approach yields a cumulative distribution function FX of a multivariate random variable X, not its likelihood fX which we need for inference and other tasks (c.f. Section 2.5). Thus, we need to calculate the likelihood fX based on the cumulative distribution function FX. W.l.o.g., let X1, . . . , Xn be discrete and Xn+1, . . . , Xd be continuous. By calculating the mixed derivative of Eq. 1, we obtain the probability density function of the mixed distribution of X: fX(x1, . . . , xd) = X m1=0,1 · · · X mn=0,1 (−1)m1+···+mn ∂d−nC ∂un+1 . . . ∂ud (F1(x1 −m1), . . . , Fn(xn −mn), Fn+1(xn+1), . . . , Fd(xd)) d Y i=n+1 fi(xi). (2) Note that the number of terms in the sum grows exponentially with the number of discrete variables. In general, the exponential number of terms prevents us from a direct evaluation of this equation. Nevertheless, we will see in the next section that we need to calculate the probability density function for likelihood-based estimation of differential entropy and mutual information. Therefore, we need an efficient way to calculate the probability density function that is tractable for many discrete variables. We will introduce methods to accomplish this in Section 2.5. 2.2 Information estimation with copulas and mixed margins For continuous as well as mixed multivariate distributions, differential entropy h(X) is defined as h(X) = − R fX(x) log2 fX(x)dx, where fX is a multivariate density which can also have mixed margins like the one in Eq. 2 [6, 20]. With this, the mutual information I(X; Y ) between two 2 multivariate random variables X and Y with potentially mixed margins is given by I(X; Y ) = h(X) + h(Y ) −h(X, Y ), where h(X, Y ) is the joint differential entropy of the joint distribution (X, Y ) with joint density fX,Y [6, 20]. For high dimensional distributions, evaluation of the integral over the support of fX is unfeasible. However, we can estimate the differential entropy and thereby the mutual information by means of classical Monte Carlo (MC) estimation [18]. We express the entropy as an expectation over fX and approximate the expectation by the empirical average by producing a large number of samples x1, . . . , xk from X: h(X) = EfX [−log2 fX(X)] ≈c hk := −1 k k X j=1 log2(fX(xj)) (3) By the strong law of large numbers, c hk converges almost surely to h(X). Moreover, we can assess the convergence of c hk by estimating the sample variance of c hk: Var h c hk i ≈ 1 k+1 Pk j=1  −log2(fX(xj)) −c hk 2 . With this estimate, the term c hk−h(X) q Var[c hk] is approximately standard normal distributed, allowing us to obtain confidence intervals for our differential entropy estimate [18]. This shows that there are two requisites for the MC procedure to estimate entropy and mutual information for a mixed distribution: 1) an efficient sampling procedure to produce samples xj from X, and 2) a tractable method for calculating the density fX(xj). We will introduce the former in Section 2.4 and the latter in Section 2.5. In the next section we will describe a copula decomposition that makes these efficient methods possible. 2.3 Pair copula constructions The number of available high-dimensional copula families is quite limited while there are an abundant number of bivariate copula families. The pair copula construction provides a flexible way to construct higher-dimensional copulas from bivariate copulas [1]. The idea of pair copula models is to factorize the multivariate distribution into conditional distributions and to describe these conditional distributions by means of bivariate copulas modeling dependence of two variables at a time. Special pair copula constructions, called regular vine copula structures, assume conditional independence between specific elements of the distribution, allowing us to circumvent the curse of dimensionality in likelihood evaluation and sampling. More specifically, a vine can be represented as a hierarchical set of trees where each node corresponds to a conditional distribution function and each edge corresponds to a pair copula. The nodes of the lowest tree are the unconditional distribution margins with empty conditioning sets. Each tree in the hierarchy incorporates additional variables into the conditioning sets by means of its pair copulas. The results of these couplings then form the nodes of the next tree in the hierarchy, thus extending the conditioning sets from tree to tree. Here we focus on the canonical vine or C-vine in which each tree in the hierarchy has a unique node that is connected to all other nodes [1]. In this section, F(xi|xj1, . . . , xjk) denotes the conditional cumulative distribution function of Xi given Xj1, . . . , Xjk. In the C-vine, the multivariate model likelihood is factorized as follows [1]: fX(x1, . . . , xd) = d Y k=1 f(xk) d−1 Y j=1 d−j Y i=1 cj,i+j|1,...,j−1(F(xj|x1, . . . , xj−1), F(xi+j|x1, . . . , xj−1)) (4) The C-vine is a good choice if there are outstanding variables with important dependencies to many other variables [2]. Such situations are commonly encountered in electrophysiology recordings where the same electrode might record a local field potential (LFP, acting as the outstanding variable) and statistically dependent spikes from nearby neurons. 2.4 Sampling from mixed canonical vines For a vine with mixed margins, we sample from the corresponding continuous vine and apply the inversion method with the inverse of the margin cumulative distribution function to obtain mixed discrete and continuous samples. In the following, ∂C ∂u1 denotes the partial derivative of the copula C with respect to its first argument and ∂C ∂u2 denotes the partial derivative with respect to the second argument. For mixed C-vine 3 sampling, we take the algorithm for sampling from a continuous C-vine copula with uniform margins [1] and extend it by means of the inversion method to attach arbitrary continuous and discrete margins. The algorithm requires (d −2)(d −1)/2 + d cumulative distribution function evaluations: 1. Sample w1, . . . , wd i.i.d. uniform on [0, 1]. 2. v1,1 = w1. 3. x1 = F −1 1 (v1,1). 4. For i = 2, . . . , d: (a) vi,1 = wi. (b) For k = i −1, i −2, . . . , 1 : vi,1 ←F −1 i|1,...,k(vi,1, vk,k), where Fi|1,...,k = ∂Ck,i|1,...,k−1 ∂u1 . (c) xi = F −1 i (vi,1). (d) If i < d then for j = 1, . . . , i −1 : vi,j+1 ←Fi|1,...,j(vi,j, vj,j), where Fi|1,...,j = ∂Cj,i|1,...,j−1 ∂u1 . 5. The result is x1, . . . , xd. The algorithm has quadratic complexity and is thus applicable to estimate information-theoretic quantities following the scheme outlined in Section 2.2. 2.5 Tractable algorithm for calculating mixed canonical vine densities Panagiotelis et al. [15] introduced an algorithm for calculating the likelihood of specific discrete pair-copula decompositions. Notably, this algorithm has quadratic complexity in the number of elements in the multivariate distribution. Here, we generalize this algorithm to the mixed margins case and apply it to the C-vine. We apply a dynamic programming approach and build the likelihood in a bottom up fashion from vine level T0 to level Td. The algorithm has quadratic complexity and computes the density of a C-vine with mixed discrete and continuous margins. We abbreviate F + i|A := F c i|A := P(Xi ≤xi|XA = xA) and F − i|A := P(Xi ≤xi −1|XA = xA). We write fi|A := f(Xi = xi|XA = xA) if Xi is continuous and fi|A := P(Xi = xi|XA = xA) if Xi is discrete. Moreover ∀a, b ∈{+, −, c} : Cab i,j|A := Ci,j|A(F a i|A, F b j|A). ∂C ∂u1 is the partial derivative of the copula C with respect to its first argument and ∂C ∂u2 is the partial derivative with respect to C’s second argument. Consequently, for w ∈{u, v} we write ∂Cab i,j|A ∂w := ∂Ci,j|A ∂w (F a i|A, F b j|A). 1. Level T0: For i = 1, . . . , d: evaluate fi = F + i −F − i if Xi is discrete and fi = fi(xi) if Xi is continuous. 2. Levels T1, T2, . . . , Td−1: For t = 1, . . . , d −1 and i = t + 1, . . . , d: Let It = {1, . . . , t}. Let Lt = {1, . . . , t −1} if t > 1, and Lt = ∅if t = 1. (a) Evaluate              ∀a, b ∈{+, −} : Cab t,i|Lt if Xt and Xi discrete, ∀a ∈{+, −} : Cac t,i|Lt and ∂Cac t,i|Lt ∂u2 if Xt discrete and Xi continuous, ∀b ∈{+, −} : Ccb t,i|Lt and ∂Ccb t,i|Lt ∂u1 if Xt continuous and Xi discrete, ∂Ccc t,i|Lt ∂u1 , ∂Cc t,i|Lt ∂u2 and ∂2Cc t,i|Lt ∂u1∂u2 if Xt and Xi continuous. (5) (b) Evaluate • if Xi discrete: fi|It = F + i|It −F − i|It, (6) where – if Xt discrete: F + i|It = C++ t,i|Lt −C−+ t,i|Lt ft|Lt , F − i|It = C+− t,i|Lt −C−− t,i|Lt ft|Lt . (7) 4 – if Xt continuous: F + i|It = ∂Cc+ t,i|Lt ∂u2 , F − i|It = ∂Cc− t,i|Lt ∂u2 . (8) • if Xt discrete and Xi continuous: F c i|It = C+c t,i|Lt −C−c t,i|Lt ft|Lt , fi|It = ∂F c i|It ∂xi = ∂C+c t,i|Lt ∂u1 − ∂C−c t,i|Lt ∂u1 ! fi|Lt ft|Lt , (9) • if Xt continuous and Xi continuous: F c i|It = ∂Ccc t,i|Lt ∂u2 , fi|It = ∂F c i|It ∂xi = ∂2Ccc t,i|Lt ∂u1∂u2 fi|Lt, (10) 3. The result is f1,...,d = f1 Qd i=2 fi|1,...,i−1. Like the sampling algorithm in Section 2.4, the likelihood algorithm has quadratic complexity and is thus applicable to estimate information-theoretic quantities following the scheme outlined in Section 2.2. 2.6 Inference We can apply maximum likelihood methods to estimate model parameters, because we can directly calculate the full likelihood of the model - even for high dimensions - following the procedure outlined in Section 2.5. Let L(θ, λ1, . . . , λd) = Pk j=1 log fX(xj; θ, λ1, . . . , λd) denote the log likelihood of the joint probability density function, where θ denotes the parameters of the chosen copula family. We can now apply the so-called inference for margins (IFM) method to estimate the parameters [11]. The idea of this method is to break the joint optimization of all parameters up into smaller optimization problems. For i = 1, . . . , d, let Li(λi) = Pk j=1 log fi(xi,j; λi) denote the sum of log likelihoods of the marginal distribution fi(xi,j; λi), where λ1, . . . , λd are the parameters of the chosen family of margins. The method proceeds in two steps. In the first step, the margin likelihoods are maximized separately: ∀i = 1, . . . , d : c λi = argmax λi {Li(λi)}. In the second step, the full likelihood is maximized given the estimated margin parameters as bθ = argmax θ {L(θ, c λ1, . . . , c λd)}. Each of the individual optimization problems can be solved by means of a general multivariate optimization algorithm such as the trust-region-reflective algorithm [4]. Joe and Xu [11] showed that the IFM estimator is asymptotically efficient. The method is particularly attractive if the ratio of margin parameters to copula parameters is big. If the number of copula parameters is too big to be estimated in a single joint optimization, then the complexity of the copula model can be reduced by truncating the vine tree of the C-vine (truncated vine [1]). This corresponds to an independence assumption for higher vine levels and the validity of this simplification should be confirmed [22]. The families of margin and copula distributions can be selected using the Akaike information criterion (AIC) [3]: Each combination of family selections is scored by means of its AIC value and then the best combination is chosen. 3 Validation on artificial data We validated our framework by sampling from mixed vine-based models of different dimensionality and by evaluating performance of various alternative models. Fig. 1 illustrates a 3-dimensional example vine-based model with two continuous margins and one discrete margin. In the top row, we show the probability density functions of the 2-dimensional margins obtained by integrating over one margin each. One can appreciate the mixed distribution from the step-wise changes in probability density in margin 2 and the smooth changes in margins 1 and 3. The bottom row shows scatter plots of 3-dimensional samples projected onto each pair of margins. The distributions of samples nicely reflect the corresponding densities. We drew samples from this and other mixed vine distributions and fitted various models to these samples. For model selection, we used normal and gamma distributions as options for continuous 5 Margin 2 −2 0 2 0 5 10 Margin 3 −2 0 2 5 10 15 20 25 Margin 3 0 5 10 5 10 15 20 25 −2 0 2 0 5 10 Margin 1 Margin 2 −2 0 2 5 10 15 20 25 Margin 1 Margin 3 0 5 10 5 10 15 20 25 Margin 2 Margin 3 Figure 1: Characteristics of a 3D mixed vine example. Margin 1 is standard normal distributed, margin 2 is Poisson distributed with mean 5 and margin 3 is gamma distributed with shape 2 and scale 4. The pairwise copulas are Gaussian with parameter 0.5, Student with correlation 0.5 and 2 degrees of freedom and Clayton with parameter 5 for margin pairs (1,2), (1,3) and (2,3) respectively. Top row: Probability density functions of 2D margins. The lighter the color the higher is the density. Bottom row: 2D margin scatter plots of 300 samples. margins, Poisson, binomial and negative binomial distributions as options for discrete margins, and Gaussian, Student, Clayton and rotated (90◦, 180◦, 270◦) Clayton copula families as options for pair copula constructions. To quantify the gain of using a vine-based mixed model instead of a mixed independent model, we drew samples from the vine-based mixed model and calculated the cross-validated likelihood ratio (LR) statistic for nested models as D = 2(log(Lvine) −log(Lind)), where Lvine denotes the likelihood of separate test-set samples under the vine-based model and Lind denotes the likelihood of the samples under the corresponding independent model. Figure 2: Model fit and entropy of simulated vine samples. Ground truth models are mixed vines of different dimensionality (range 2 to 6 shown as dark brown to light brown lines) with margins and copulas up to the respective dimension. Margins 1 to 3 and associated pairwise copulas are the same as in Fig. 1. Margin 4 is binomial distributed with N = 6 and p = 0.4, margin 5 is negative binomial distributed with N = 6 and p = 0.4 and margin 6 is standard normal distributed. The pairwise copulas are Clayton survival, independent and Clayton rotated 90◦for margin pairs (1,4), (2,4) and (3,4) respectively, and Clayton rotated 270◦, independent, Gaussian with parameter 0.5 and independent for margin pairs (1,5), (2,5), (3,5) and (4,5) respectively and independent, independent, Gaussian with parameter 0.5, independent and Student with parameters 0.5 and 2 for margin pairs (1,6), (2,6), (3,6), (4,6) and (5,6) respectively and with parameter 5 for all Clayton based copulas. (AC) Cross-validated LR statistic between the ground truth model and the mixed vine-based model (A), independent model (B) or mixed Gaussian model (C). (D,E) Normalized entropy difference between the ground truth model and the independent model (D) or fully continuous vine-based model (E). Lines denote averages over 30 repetitions as a function of the number of samples. Shaded areas denote standard error. Fig. 2A shows the LR statistic between the ground truth and the best-fitting mixed vine-based model as a function of the number of samples for different dimensionality. The statistics were low in all cases but increased with increasing dimensionality. The gain as quantified by the LR statistic of using the full mixed vine-based model instead of the independent model, on the other hand, was moderate for the bivariate model (D < 0.5) while being substantial for the 6-dimensional model (D ≈7). Wilks’ LR test on non-cross-validated data was highly significant whenever we used at least 32 samples 6 (p < 0.01). We also evaluated the fit of the multivariate Gaussian copula with mixed margins which is nested in our mixed vine-based models and obtained by restricting all pairwise copula families to be Gaussian. The LR statistics indicated substantially better fit than for the independent model but the statistics were below those of the mixed vine-based model for most tested dimensions (Fig. 2C). Unfortunately, a vine-based mixed model and the corresponding best-fitting fully continuous vinebased model are not directly comparable in this way due to the different weighting of discrete and continuous elements (i.e. mass vs. density). Nevertheless, in an actual application it is easy to determine which margins are discrete and which margins are continuous. Appropriate discrete or continuous margins can therefore be selected easily. To extend our comparison to fully continuous vine-based models, we estimated entropies of the mixed vine-based model, the corresponding independent model and of the best-fitting fully continuous model. We calculated the entropy differences between these models and normalized with the entropy of the mixed vine-based model. Fig. 2D shows the normalized entropy difference between the mixed vine-based model and the independent model. The relative results are similar to those of the likelihood ratio statistic (Fig. 2B) suggesting that in this case the entropy comparison is indicative of the performance gain. In Fig. 2E, we plot the normalized entropy difference between the mixed vine-based model and the best-fitting fully continuous model. Overall, the normalized differences of these models were smaller than for the independent model. Similarly to the independent model, though, we found increasing differences for increasing dimensionality of the models. All in all, our results suggest that our framework can yield substantial advantages in terms of goodness of fit and in terms of estimated entropy in particular for high-dimensional problems. 4 Application to simulated network activity To evaluate our framework in a typical neuroscience setting, we applied our mixed vine-based model to a biologically realistic neural network model. We simulated network activity with the Virtual Electrode Recording Tool for EXtracellular potentials (VERTEX) [25] with network parameters as in VERTEX tutorial 2. Briefly, the model contained a total of 5000 neurons with 85% of those cell models representing layer 2/3 pyramidal neurons and 15% representing basket interneurons. The spiking dynamics followed an adaptive exponential model. To simulate two different stimulus conditions, we used random input currents with different means. We presented each stimulus condition an equal number of times (corresponding to 1/2 probability of occurrence of either stimulus). The network generated network oscillations in both conditions. To simulate a typical recording situation, we recorded LFPs with two randomly placed electrodes and collected spike counts from the four neurons closest to those electrodes. For each input condition, we ran the network 128 times and collected one 6-dimensional mixed vector with the LFPs (continuous) and spike counts (discrete) collected in a 100 ms interval from each network run. We then fitted the full mixed vine-based model, the mixed independent model and the fully continuous vine-based model to these data. Importantly, we fitted separate models for each stimulus condition and varied the number of samples per stimulus condition between 8 and 128. This allowed us to estimate mutual information following the procedure outlined in Section 2.2. Similarly to Figs. 2B,C, Fig. 3A depicts the LR statistic between the best-fitting mixed vine-based model and the corresponding independent model or mixed Gaussian model. We found relatively small statistics for all sample sizes (D < 1). Nevertheless, Wilks’ LR test indicated highly significant improvement whenever we used at least 64 samples (p < 0.01). To evaluate the importance of the mixed vine-based model when performing an information-theoretic analysis of the network activity, we estimated mutual information between the modeled network activity (LFP and spike counts) and the two stimulus conditions. Fig. 3B shows mutual information estimates that we obtained based on the mixed independent, mixed Gaussian, continuous vine-based and mixed vine-based models. The mixed Gaussian model yielded information estimates that were close to those of the mixed-vine based models. Estimates based on the independent model and fully continuous model, on the other hand, were both substantially different (overestimating and underestimating information, respectively) from estimates that we obtained from the mixed vine-based model. The latter model is the most faithful one with the most accurate information estimates. The overestimation of the independent model suggests that spike counts and LFPs carry partly redundant information. The big differences in information estimates further indicate that it can be important to take mixed margins and dependencies into account for estimating mutual information, even if the LR statistic is low. 7 Figure 3: Analysis of simulated neural network activity obtained from the VERTEX tool [25]. Data samples are formed by the average LFP within 200 −300 ms after simulation onset from two randomly chosen electrodes and spike counts from the four neurons in closest proximity to those electrodes. One simulation run provided one sample only. The network was simulated with two different input conditions: Input currents following an Ornstein-Uhlenbeck process had a mean value of 330 pA for the excitatory population and 190 pA for the inhibitory population in condition 1, and 300 pA for the excitatory population and 40 pA for the inhibitory population in condition 2. In both conditions, standard deviation was 90 pA for the excitatory population and 50 pA for the inhibitory population. (A) LR statistic between the best-fitting mixed vine-based model and the best-fitting mixed independent model (blue) or mixed Gaussian model (red) as a function of the number of samples (i.e. number of simulations in each condition) averaged over stimulus conditions. (B) Mutual information between the neural activity and the two input conditions estimated from the mixed independent model (blue), mixed Gaussian model (red), continuous vine-based model (green) or mixed vine-based model (black) as a function of the number of samples. Lines denote averages over 30 repetitions. Shaded areas denote standard error. 5 Discussion We developed a complete framework based on vine copulas for modeling multivariate data that are partly discrete and partly continuous. Our framework includes methods for sampling, likelihood calculation and inference. We combined these procedures to estimate entropy and mutual information by means of MC integration. In particular, our methods provide the possibility to construct joint statistical models of LFPs and spike counts. In a biologically realistic network simulation we demonstrated that our mixed vine-based model provides a fit that is better than that of the corresponding independent model and showed that mutual information estimates of fully continuous and mixed independent models can strongly differ even if the likelihood ratio statistic suggests otherwise. For LFP and spike count data, a mixed model with detailed dependence structures can make full use of all available statistical data. This also makes it possible to construct optimal Bayesian decoders for inferring the presented stimulus from both LFPs and spike counts. Moreover, our model provides the possibility to investigate the statistical dependencies between LFPs and spike counts. Contrary to other analysis methods for analyzing mixed LFPs and spiking [12, 5] our framework follows a purely data-driven approach. Even high-dimensional distributions can be fitted, because all inference operations have quadratic complexity. However, entropy and MI estimation can be problematic, because MC integration can become unfeasible for very high-dimensional problems. One possible remedy is to use our models for maximum likelihood decoding and then estimate information based on decoding performance [8]. We note that our models are based on pair-constructions and thus cannot model arbitrary higher-order dependencies. We stress, however, that higher-order correlations do occur in the vine tree and depend on both the vine-tree selection and the copula families. Thus, selecting the right vine-tree and copula families can - to a limited extent - account for higher-order correlations. In general, however, limited sample numbers make it difficult to reliably estimate higherorder correlations in real neuroscience applications. The parametric nature of our model framework also makes it possible to introduce dependencies on external variables. Directions for future research include applications to experimentally recorded data and detailed evaluation of observed dependency structures. Acknowledgments. This work was supported by the European Commission’s Horizon 2020 Programme (H2020-MSCA-IF-2014) under grant agreement number 659227 (“STOMMAC”). 8 References [1] K. Aas, C. Czado, A. Frigessi, and H. Bakken. Pair-copula constructions of multiple dependence. Insurance: Mathematics and Economics, 44(2):182–198, 2009. [2] E. F. Acar, C. Genest, and J. NešLehová. Beyond simplified pair-copula constructions. Journal of Multivariate Analysis, 110:74–90, 2012. [3] H. Akaike. A new look at the statistical model identification. Automatic Control, IEEE Transactions on, 19(6):716–723, 1974. [4] R. H. Byrd, M. E. Hribar, and J. Nocedal. An interior point algorithm for large-scale nonlinear programming. SIAM Journal on Optimization, 9(4):877–900, 1999. [5] D. E. Carlson, J. S. Borg, K. Dzirasa, and L. Carin. On the relations of LFPs & neural spike trains. In Advances in Neural Information Processing Systems, pages 2060–2068, 2014. [6] T. M. Cover and J. A. Thomas. Elements of Information Theory. New York: Wiley, second edition, 2006. [7] A. R. de Leon and B. Wu. Copula-based regression models for a bivariate mixed discrete and continuous outcome. Statistics in Medicine, 30(2):175–185, 2011. [8] R. A. A. Ince, S. Panzeri, and C. Kayser. Neural codes formed by small and temporally precise populations in auditory cortex. The Journal of Neuroscience, 33(46):18277–18287, 2013. [9] P. Jaworski, F. Durante, and W. K. Härdle. Copulae in mathematical and quantitative finance. Lecture Notes in Statistics, Proceedings, 213, 2013. [10] R. L. Jenison and R. A. Reale. The shape of neural dependence. Neural Computation, 16:665–672, 2004. [11] H. Joe and J. J. Xu. The estimation method of inference functions for margins for multivariate models. Technical Report 166, Department of Statistics, University of British Colombia, 1996. [12] R. C. Kelly, M. A. Smith, R. E. Kass, and T. S. Lee. Local field potentials indicate network state and account for neuronal response variability. Journal of Computational Neuroscience, 29(3):567–579, 2010. [13] R. B. Nelsen. An Introduction to Copulas. Springer, New York, second edition, 2006. [14] A. Onken, S. Grünewälder, M. H. J. Munk, and K. Obermayer. Analyzing short-term noise dependencies of spike-counts in macaque prefrontal cortex using copulas and the flashlight transformation. PLoS Computational Biology, 5(11):e1000577, 11 2009. [15] A. Panagiotelis, C. Czado, and H. Joe. Pair copula constructions for multivariate discrete data. Journal of the American Statistical Association, 107(499):1063–1072, 2012. [16] S. Panzeri, J. H. Macke, J. Gross, and C. Kayser. Neural population coding: combining insights from microscopic and mass signals. Trends in Cognitive Sciences, 19(3):162–172, 2015. [17] J. S. Racine. Mixed data kernel copulas. Empirical Economics, 48(1):37–59, 2015. [18] C. P. Robert and G. Casella. Monte Carlo Statistical Methods. New York: Springer, second edition, 2004. [19] L. Sacerdote, M. Tamborrino, and C. Zucca. Detecting dependencies between spike trains of pairs of neurons through copulas. Brain Research, 1434:243–256, 2012. [20] C. E. Shannon. A mathematical theory of communication. Bell System Technical Journal, 27:379–423, 1948. [21] A. Sklar. Fonctions de répartition à n dimensions et leurs marges. Publications de l’Institut de Statistique de L’Université de Paris, 8:229–231, 1959. [22] M. Smith, A. Min, C. Almeida, and C. Czado. Modeling longitudinal data using a pair-copula decomposition of serial dependence. Journal of the American Statistical Association, 105(492), 2010. [23] M. S. Smith and M. A. Khaled. Estimation of copula models with discrete margins via Bayesian data augmentation. Journal of the American Statistical Association, 107(497):290–303, 2012. [24] P. X. K. Song, M. Li, and Y. Yuan. Joint regression analysis of correlated data using Gaussian copulas. Biometrics, 65(1):60–68, 2009. [25] R. J. Tomsett, M. Ainsworth, A. Thiele, M. Sanayei, X. Chen, M. A. Gieselmann, M. A. Whittington, M. O. Cunningham, and M. Kaiser. Virtual Electrode Recording Tool for EXtracellular potentials (VERTEX): comparing multi-electrode recordings from simulated and biological mammalian cortical tissue. Brain Structure and Function, 220(4):2333–2353, 2015. 9
2016
557
6,502
Can Active Memory Replace Attention? Łukasz Kaiser Google Brain lukaszkaiser@google.com Samy Bengio Google Brain bengio@google.com Abstract Several mechanisms to focus attention of a neural network on selected parts of its input or memory have been used successfully in deep learning models in recent years. Attention has improved image classification, image captioning, speech recognition, generative models, and learning algorithmic tasks, but it had probably the largest impact on neural machine translation. Recently, similar improvements have been obtained using alternative mechanisms that do not focus on a single part of a memory but operate on all of it in parallel, in a uniform way. Such mechanism, which we call active memory, improved over attention in algorithmic tasks, image processing, and in generative modelling. So far, however, active memory has not improved over attention for most natural language processing tasks, in particular for machine translation. We analyze this shortcoming in this paper and propose an extended model of active memory that matches existing attention models on neural machine translation and generalizes better to longer sentences. We investigate this model and explain why previous active memory models did not succeed. Finally, we discuss when active memory brings most benefits and where attention can be a better choice. 1 Introduction Recent successes of deep neural networks have spanned many domains, from computer vision [1] to speech recognition [2] and many other tasks. In particular, sequence-to-sequence recurrent neural networks (RNNs) with long short-term memory (LSTM) cells [3] have proven especially successful at natural language processing (NLP) tasks, including machine translation [4, 5, 6]. The basic sequence-to-sequence architecture for machine translation is composed of an RNN encoder which reads the source sentence one token at a time and transforms it into a fixed-sized state vector. This is followed by an RNN decoder, which generates the target sentence, one token at a time, from the state vector. While a pure sequence-to-sequence recurrent neural network can already obtain good translation results [4, 6], it suffers from the fact that the whole sentence to be translated needs to be encoded into a single fixed-size vector. This clearly manifests itself in the degradation of translation quality on longer sentences (see Figure 6) and hurts even more when there is less training data [7]. In [5], a successful mechanism to overcome this problem was presented: a neural model of attention. In a sequence-to-sequence model with attention, one retains the outputs of all steps of the encoder and concatenates them to a memory tensor. At each step of the decoder, a probability distribution over this memory is computed and used to estimate a weighted average encoder representation to be used as input to the next decoder step. The decoder can hence focus on different parts of the encoder representation while producing tokens. Figure 1 illustrates a single step of this process. The attention mechanism has proven useful well beyond the machine translation task. Image models can benefit from attention too; for instance, image captioning models can focus on the relevant parts of the image when describing it [8]; generative models for images yield especially good results with attention, as was demonstrated by the DRAW model [9], where the network focuses on a part of the 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. state memory mask over memory new state new memory = memory Figure 1: Attention model. The state vector is used to compute a probability distribution over memory. Weighted average of memory elements, with focus on one of them, is used to compute the new state. image to produce at a given time. Another interesting use-case for the attention mechanism is the Neural Turing Machine [10], which can learn basic algorithms and generalize beyond the length of the training instances. While the attention mechanism is very successful, one important limitation is built into its definition. Since the attention mask is computed using a Softmax, it by definition tries to focus on a single element of the memory it is attending to. In the extreme case, also known as hard attention [8], one of the memory elements is selected and the selection is trained using the REINFORCE algorithm (since this is not differentiable) [11]. It is easy to demonstrate that this restriction can make some tasks almost unlearnable for an attention model. For example, consider the task of adding two decimal numbers, presented one after another like this: Input 1 2 5 0 + 2 3 1 5 Output 3 5 6 5 A recurrent neural network can have the carry-over in its state and could learn to shift its attention to subsequent digits. But that is only possible if there are two attention heads, attending to the first and to the second number. If only a single attention mechanism is present, the model will have a hard time learning this task and will not generalize properly, as was demonstrated in [12, 13]. A solution to this problem, already proposed in the recent literature (for instance, the Neural GPU from [12]), is to allow the model to access and change all its memory at each decoding step. We will call this mechanism an active memory. While it might seem more expensive than attention models, it is actually not, since the attention mechanism needs to compute an attention score for all its memory as well in order to focus on the most appropriate part. The approximate complexity of an attention mechanism is therefore the same as the complexity of the active memory. In practice, we get step-times around 1.7 second for an active memory model, the Extended Neural GPU introduced below, and 1.2 second for a comparable model with an attention mechanism. But active memory can potentially make parallel computations on the whole memory, as depicted in Figure 2. memory new memory Figure 2: Active memory model. The whole memory takes part in the computation at every step. Each element of memory is active and changes in a uniform way, e.g., using a convolution. 2 Active memory is a natural choice for image models as they usually operate on a canvas. And indeed, recent works have shown that actively updating the canvas that will be used to produce the final results can be beneficial. Residual networks [14], the currently best performing model on the ImageNet task, falls into this category. In [15] it was shown that the weights of different layers of a residual network can be tied (so it becomes recurrent), without degrading performance. Other models that operate on the whole canvas at each step were presented in [16, 17]. Both of these models are generative and show very good performance, yielding better results than the original DRAW model. Thus, the active memory approach seems to be a better choice for image models. But what about non-image models? The Neural GPUs [12] demonstrated that active memory yields superior results on algorithmic tasks. But can it be applied to real-world problems? In particular, the original attention model brought a great success to natural language processing, esp. to neural machine translation. Can active memory be applied to this task on a large scale? We answer this question positively, by presenting an extension of the Neural GPU model that yields good results for neural machine translation. This model allows us to investigate in depth a number of questions about the relationship between attention and active memory. We clarify why the previous active memory model did not succeed on machine translation by showing how it is related to the inherent dependencies in the target distributions, and we study a few variants of the model that show how a recurrent structure on the output side is necessary to obtain good results. 2 Active Memory Models In the previous section, we used the term active memory broadly, referring to any model where every part of the memory undergoes active change at every step. This is in contrast to attention models where only a small part of the memory changes at every step, or where the memory remains constant. The exact implementation of an active change of the memory might vary from model to model. In the present paper, we will focus on the most common ways this change is implemented that all rely on the convolution operator. The convolution acts on a kernel bank and a 3-dimensional tensor. Our kernel banks are 4-dimensional tensors of shape [kw, kh, m, m], i.e., they contain kw · kh · m2 parameters, where kw and kh are kernel width and height. A kernel bank U can be convolved with a 3-dimensional tensor s of shape [w, h, m] which results in the tensor U ∗s of the same shape as s defined by: U ∗s[x, y, i] = ⌊kw/2⌋ X u=⌊−kw/2⌋ ⌊kh/2⌋ X v=⌊−kh/2⌋ m X c=1 s[x + u, y + v, c] · U[u, v, c, i]. In the equation above the index x + u might sometimes be negative or larger than the size of s, and in such cases we assume the value is 0. This corresponds to the standard convolution operator used in many deep learning toolkits, with zero padding on both sides and stride 1. Using the standard operator has the advantage that it is heavily optimized and can directly benefit from any new work (e.g., [18]) on optimizing convolutions. Given a memory tensor s, an active memory model will produce the next memory s′ by using a number of convolutions on s and combining them. In the most basic setting, a residual active memory model will be defined as: s′ = s + U ∗s, i.e., it will only add to an already existing state. While residual models have been successful in image analysis [14] and generation [16], they might suffer from the vanishing gradient problem in the same way as recurrent neural networks do. Therefore, in the same spirit as LSTM gates [3] and GRU gates [19] improve over pure RNNs, one can introduce convolutional LSTM and GRU operators. Let us focus on the convolutional GRU, which we define in the same way as in [12], namely: CGRU(s) = u ⊙s + (1 −u) ⊙tanh(U ∗(r ⊙s) + B), where u = σ(U ′ ∗s + B′) and r = σ(U ′′ ∗s + B′′). (1) As a baseline for our investigation of active memory models, we will use the Neural GPU model from [12], depicted in Figure 3, and defined as follows. The given sequence i = (i1, . . . , in) of n discrete 3 i1 ... in s0 CGRU1 CGRU2 s1 . . . sn−1 CGRU1 CGRU2 sn o1 ... on Figure 3: Neural GPU with 2 layers and width w = 3 unfolded in time. symbols from {0, . . . , I} is first embedded into the tensor s0 by concatenating the vectors obtained from an embedding lookup of the input symbols into its first column. More precisely, we create the starting tensor s0 of shape [w, n, m] by using an embedding matrix E of shape [I, m] and setting s0[0, k, :] = E[ik] (in python notation) for all k = 1 . . . n (here i1, . . . , in is the input). All other elements of s0 are set to 0. Then, we apply l different CGRU gates in turn for n steps to produce the final tensor sfin: st+1 = CGRUl(CGRUl−1 . . . CGRU1(st) . . . ) and sfin = sn. The result of a Neural GPU is produced by multiplying each item in the first column of sfin by an output matrix O to obtain the logits lk = Osfin[0, k, :] and then selecting the largest one: ok = argmax(lk). During training we use the standard loss function, i.e., we compute a Softmax over the logits lk and use the negative log probability of the target as the loss. 2.1 The Markovian Neural GPU The baseline Neural GPU model yields very poor results on neural machine translation: its per-word perplexity on WMT1 does not go below 30 (good models on this task go below 4), and its BLEU scores are also very bad (below 5, while good models are higher than 20). Which part of the model is responsible for such bad results? It turns out that the main culprit is the output generator. As one can see in Figure 3 above, every output symbol is generated independently of all other output symbols, conditionally only on the state sfin. This is fine for learning purely deterministic functions, like the toy tasks the Neural GPU was designed for. But it does not work for harder real-world problems, where there could be multiple possible outputs for each input. The most basic way to mitigate this problem is to make every output symbol depend on the previous output. This only changes the output generation, not the state, so the definition of the model is the same as above until sfin. The result is then obtained by multiplying by an output matrix O each item from the first column of sfin concatenated with the embedding of the previous output generated by another embedding matrix E′: lk = O concat(sfin[0, k, :], E′ok−1). For k = 0 we use a special symbol ok−1 = GO and, to get the output, we select ok = argmax(lk). During training we use the standard loss function, i.e., we compute a Softmax over the logits lk and use the negative log probability of the target as the loss. Also, as is standard in recurrent networks [4], we use teacher forcing, i.e., during training we provide the true output label as ok−1 instead of using the previous output generated by the model. This means that the loss incurred from generating ok does not directly influence the value of ok−1. We depict this model in Figure 4. 2.2 The Extended Neural GPU The Markovian Neural GPU yields much better results on neural machine translation than the baseline model: its per-word perplexity reaches about 12 and its BLEU scores improve a bit. But these results are still far from those achieved by models with attention. 1See Section 3 for more details on the experimental setting. 4 i1 ... in s0 CGRU1 CGRU2 s1 . . . sn−1 CGRU1 CGRU2 sn o1o2o3 ... on Figure 4: Markovian Neural GPU. Each output ok is conditionally dependent on the final tensor sfin = sn and the previous output symbol ok−1. i1 ... in s0 CGRU CGRU s1 CGRU . . . CGRUd sn = d0 CGRUd d1 CGRUd d2 CGRUd . . . dn o1 o2 . . . on p0 p1 p2 pn−1 Figure 5: Extended Neural GPU with active memory decoder. See the text below for definition. Could it be that the Markovian dependence of the outputs is too weak for this problem, that a full recurrent dependence of the state is needed for good performance? We test this by extending the baseline model with an active memory decoder, as depicted in Figure 5. The definition of the Extended Neural GPU follows the baseline model until sfin = sn. We consider sn as the starting point for the active memory decoder, i.e., we set d0 = sn. In the active memory decoder we will also use a separate output tape tensor p of the same shape as d0, i.e., p is of shape [w, n, m]. We start with p0 set to all 0 and define the decoder states by dt+1 = CGRUd l (CGRUd l−1(. . . CGRUd 1(dt, pt) . . . , pt), pt), where CGRUdis defined just like CGRU in Equation (1) but with additional input as highlighted below in bold: CGRUd(s, p) = u ⊙s + (1 −u) ⊙tanh(U ∗(r ⊙s) + W ∗p + B), where u = σ(U ′ ∗s + W ′ ∗p + B′) and r = σ(U ′′ ∗s + W ′′ ∗p + B′′). (2) We generate the k-th output by multiplying the k-th vector in the first column of dk by the output matrix O, i.e., lk = O dk[0, k, :]. We then select ok = argmax(lk). The symbol ok is then embedded back into a dense representation using another embedding matrix E′ and we put it into the k-th place on the output tape p, i.e., we define pk+1 = pk with pk[0, k, :] ←E′ok. In this way, we accumulate (embedded) outputs step-by-step on the output tape p. Each step pt has access to all outputs produced in all steps before t. Again, it is important to note that during training we use teacher forcing, i.e., we provide the true output labels for ok instead of using the outputs generated by the model. 5 2.3 Related Models A convolutional architecture has already been used to obtain good results in word-level neural machine translation in [20] and more recently in [21]. These model use a standard RNN on top of the convolution to generate the output and avoid the output dependence problem in this way. But the state of this RNN has a fixed size, and in the first one the sentence representation generated by the convolutional network is also a fixed-size vector. Therefore, while superficially similar to active memory, these models are more similar to fixed-size memory models. The first one suffers from all the limitations of sequence-to-sequence models without attention [4, 6] that we discussed before. Another recently introduced model, the Grid LSTM [22], might look less related to active memory, as it does not use convolutions at all. But in fact it is to a large extend an active memory model – the memory is on the diagonal of the grid of the running LSTM cells. The Reencoder architecture for neural machine translation introduced in that paper is therefore related to the Extended Neural GPU. But it differs in a number of ways. For one, the input is provided step-wise, so the network cannot start processing the whole input in parallel, as in our model. The diagonal memory changes in size and the model is a 3-dimensional grid, which might not be necessary for language processing. The Reencoder also does not use convolutions and this is crucial for performance. The experiments from [22] are only performed on a very small dataset of 44K short sentences. This is almost 1000 times smaller than the dataset we are experimenting with and makes is unclear whether Grid LSTMs can be applied to large-scale real-world tasks. In image processing, in addition to the captioning [8] and generative models [16, 17] that we mentioned before, there are several other active memory models. They use convolutional LSTMs, an architecture similar to CGRU, and have recently been used for weather prediction [23] and image compression [24], in both cases surpassing the state-of-the-art. 3 Experiments Since all components of our models (defined above) are differentiable, we can train them using any stochastic gradient descent optimizer. For the results presented in this paper we used the Adam optimizer [25] with ε = 10−4 and gradients norm clipped to 1. The number of layers was set to l = 2, the width of the state tensors was constant at w = 4, the number of maps was m = 512, and the convolution kernels width and height was always kw = kh = 3.2 As our main test, we train the models discussed above and a baseline attention model on the WMT’14 English-French translation task. This is the same task that was used to introduce attention [5], but – to avoid the problem with the UNK token – we spell-out each word that is not in the vocabulary. More precisely, we use a 32K vocabulary that includes all characters and the most common words, and every word that is not in the vocabulary is spelled-out letter-by-letter. We also include a special SPACE symbol, which is used to mark spaces between characters (we assume spaces between words). We train without any data filtering on the WMT’14 corpus and test on the WMT’14 test set (newstest’14). As a baseline, we use a GRU model with attention that is almost identical to the original one from [5], except that it has 2 layers of GRU cells, each with 1024 units. Tokens from the vocabulary are embedded into vectors of size 512, and attention is put on the top layer. This model is identical as the one in [7], except that is uses GRU cells instead of LSTM cells. It has about 120M parameters, while our Extended Neural GPU model has about 110M parameters. Better results have been reported on this task with attention models with more parameters, but we aim at a baseline similar in size to the active memory model we are using. When decoding from the Extendend Neural GPU model, one has to provide the expected size of the output, as it determines the size of the memory. We test all sizes between input size and double the input size using a greedy decoder and pick the result with smallest log-perplexity (highest likelihood). This is expensive, so we only use a very basic beam-search with beam of size 2 and no length normalization. It is possible to reduce the cost by predicting the output length: we tried a basic estimator based just on input sentence length and it decreased the BLEU score by 0.3. Better training and decoding could remove the need to predict output length, but we leave this for future work. 2Our model was implemented using TensorFlow [26]. Its code is available as open-source at https: //github.com/tensorflow/models/tree/master/neural_gpu/. 6 Model Perplexity (log) BLEU Neural GPU 30.1 (3.5) < 5 Markovian Neural GPU 11.8 (2.5) < 5 Extended Neural GPU 3.3 (1.19) 29.6 GRU+Attention 3.4 (1.22) 26.4 Table 1: Results on the WMT English->French translation task. We provide the average per-word perplexity (and its logarithm in parenthesis) and the BLEU score. Perplexity is computed on the test set with the ground truth provided, so it do not depend on the decoder. For the baseline model, we use a full beam-search decoder with beam of size 12, length normalization and an attention coverage penalty in the decoder. This is a basic penalty that pushes the decoder to attend to all words in the source sentence. We experimented with more elaborate methods following [27] but it did not improve our results. The parameters for length normalization and coverage penalty are tuned on the development set (newstest’13). The final BLEU scores and per-word perplexities for these different models are presented in Table 1. Worse models have higher variance of their BLEU scores, so we only write < 5 for these models. One can see from Table 1 that an active memory model can indeed match an attention model on the machine translation task, even with slightly fewer parameters. It is interesting to note that the active memory model does not need the length normalization that is necessary for the attention model (esp. when rare words are spelled). We conjecture that active memory inherently generalizes better from shorter examples and makes decoding easier, a welcome news, since tuning decoders is a large problem in sequence-to-sequence models. In addition to the summary results from Table 1, we analyzed the performance of the models on sentences of different lengths. This was the key problem solved by the attention mechanism, so it is worth asking if active memory solves it as well. In Figure 6 we plot the BLEU scores on the test set for sentences in each length bucket, bucketing by 10, i.e., for lengths (0, 10], (10, 20] and so on. We plot the curves for the Extended Neural GPU model, the long baseline GRU model with attention, and – for comparison – we add the numbers for a non-attention model from Figure 2 of [5]. (Note that these numbers are for a model that uses different tokenization, so they are not fully comparable, but still provide a context.) As can be seen, our active memory model is less sensitive to sentence length than the attention baseline. It indeed solves the problem that the attention mechanism was designed to solve. Parsing. In addition to the main large-scale translation task, we tested the Extended Neural GPU on English constituency parsing, the same task as in [7]. We only used the standard WSJ dataset for training. It is small by neural network standards, as it contains only 40K sentences. We trained the Extended Neural GPU with the same settings as above, only with m = 256 (instead of m = 512) and dropout of 30% in each step. During decoding, we selected well-bracketed outputs with the right number of POS-tags from all lengths considered. Evaluated with the standard EVALB tool on the standard WSJ 23 test set, we got 85.1 F1 score. This is lower than 88.3 reported in [7], but we didn’t use any of their optimizations (no early stopping, no POS-tag substitution, no special tuning). Since a pure sequence-to-sequence model has F1 score well below 70, this shows that the Extended Neural GPU is versatile and can learn and generalize well even on small data-sets. 4 Discussion To better understand the main shortcoming of previous active memory models, let us look at the average log-perplexities of different attention models in Table 1. A pure Neural GPU model yields 3.5, a Markovian one yields 2.5, and only a model with full dependence, trained with teacher forcing, achieves 1.3. The recurrent dependence in generating the output distribution turns out to be the key to achieving good performance. We find it illuminating that the issue of dependencies in the output distribution can be disentangled from the particularities of the model or model class. In earlier works, such dependence (and training with teacher forcing) was always used in LSTM and GRU models, but very rarely in other kinds 7 0 10 20 30 40 50 60 15 18 21 24 27 30 Sentence length BLEU score Extended Neural GPU GRU+Attention No Attention Figure 6: BLEU score (the higher the better) vs source sentence length. models. We show that it can be beneficial to consider this issue separately from the model architecture. It allows us to create the Extended Neural GPU and this way of thinking might also prove fruitful for other classes of models. When the issue of recurrent output dependencies is addressed, as we do in the Extended Neural GPU, an active memory model can indeed match or exceed attention models on a large-scale real-world task. Does this mean we can always replace attention by active memory? The answer could be yes for the case of soft attention. Its cost is approximately the same as active memory, it performs much worse on some tasks like learning algorithms, and – with the introduction of the Extended Neural GPU – we do not know of a task where it performs clearly better. Still, an attention mask is a very natural concept, and it is probable that some tasks can benefit from a selector that focuses on single items by definition. This is especially obvious for hard attention: it can be used over large memories with potentially much less computational cost than an active memory, so it might be indispensable for devising long-term memory mechanisms. Luckily, active memory and attention are not exclusive, and we look forward to investigating models that combine these mechanisms. References [1] Alex Krizhevsky, Ilya Sutskever, and Geoffrey Hinton. Imagenet classification with deep convolutional neural network. In Advances in Neural Information Processing Systems, 2012. [2] George E. 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 & Language Processing, 20(1):30–42, 2012. [3] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [4] Ilya Sutskever, Oriol Vinyals, and Quoc VV Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems, pages 3104–3112, 2014. [5] Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014. 8 [6] Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. CoRR, abs/1406.1078, 2014. [7] Vinyals & Kaiser, Koo, Petrov, Sutskever, and Hinton. Grammar as a foreign language. In Advances in Neural Information Processing Systems, 2015. [8] Kelvin Xu, Jimmy Lei Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. [9] Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. CoRR, abs/1502.04623, 2015. [10] Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines. CoRR, abs/1410.5401, 2014. [11] Ronald J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine Learning, 8:229––256, 1992. [12] Łukasz Kaiser and Ilya Sutskever. Neural GPUs learn algorithms. In International Conference on Learning Representations (ICLR), 2016. [13] A. Joulin and T. Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Advances in Neural Information Processing Systems, (NIPS), 2015. [14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. [15] Qianli Liao and Tomaso Poggio. Bridging the gaps between residual learning, recurrent neural networks and visual cortex. CoRR, abs/1604.03640, 2016. [16] Danilo Jimenez Rezende, Shakir Mohamed, Ivo Danihelka, Karol Gregor, and Daan Wierstra. One-shot generalization in deep generative models. CoRR, abs/1603.05106, 2016. [17] Karol Gregor, Frederic Besse, Danilo Jimenez Rezende, Ivo Danihelka, and Daan Wierstra. Towards conceptual compression. CoRR, abs/1604.08772, 2016. [18] Andrew Lavin and Scott Gray. Fast algorithms for convolutional neural networks. CoRR, abs/1509.09308, 2015. [19] K. Cho, B. van Merrienboer, D. Bahdanau, and Y. Bengio. On the properties of neural machine translation: Encoder-decoder approaches. CoRR, abs/1409.1259, 2014. [20] Nal Kalchbrenner and Phil Blunsom. Recurrent continuous translation models. In Proceedings EMNLP 2013, pages 1700–1709, 2013. [21] Fandong Meng, Zhengdong Lu, Mingxuan Wang, Hang Li, Wenbin Jiang, and Qun Liu. Encoding source language with convolutional neural network for machine translation. In ACL, pages 20–30, 2015. [22] Nal Kalchbrenner, Ivo Danihelka, and Alex Graves. Grid long short-term memory. In International Conference on Learning Representations, 2016. [23] Xingjian Shi, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai kin Wong, and Wang chun Woo. Convolutional LSTM network: A machine learning approach for precipitation nowcasting. In Advances in Neural Information Processing Systems, 2015. [24] George Toderici, Sean M. O’Malley, Sung Jin Hwang, Damien Vincent, David Minnen, Shumeet Baluja, Michele Covell, and Rahul Sukthankar. Variable rate image compression with recurrent neural networks. In International Conference on Learning Representations, 2016. [25] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. [26] Martín Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mané, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viégas, Oriol Vinyals, Pete Warden, Martin Wattenberg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. Tensorflow: Large-scale machine learning on heterogeneous distributed systems, 2015. [27] Zhaopeng Tu, Zhengdong Lu, Yang Liu, Xiaohua Liu, and Hang Li. Modeling coverage for neural machine translation. CoRR, abs/1601.04811, 2016. 9
2016
558
6,503
Fast Active Set Methods for Online Spike Inference from Calcium Imaging Johannes Friedrich1,2, Liam Paninski1 1Grossman Center and Department of Statistics, Columbia University, New York, NY 2Janelia Research Campus, Ashburn, VA j.friedrich@columbia.edu, liam@stat.columbia.edu Abstract Fluorescent calcium indicators are a popular means for observing the spiking activity of large neuronal populations. Unfortunately, extracting the spike train of each neuron from raw fluorescence calcium imaging data is a nontrivial problem. We present a fast online active set method to solve this sparse nonnegative deconvolution problem. Importantly, the algorithm progresses through each time series sequentially from beginning to end, thus enabling real-time online spike inference during the imaging session. Our algorithm is a generalization of the pool adjacent violators algorithm (PAVA) for isotonic regression and inherits its linear-time computational complexity. We gain remarkable increases in processing speed: more than one order of magnitude compared to currently employed state of the art convex solvers relying on interior point methods. Our method can exploit warm starts; therefore optimizing model hyperparameters only requires a handful of passes through the data. The algorithm enables real-time simultaneous deconvolution of O(105) traces of whole-brain zebrafish imaging data on a laptop. 1 Introduction Calcium imaging has become one of the most widely used techniques for recording activity from neural populations in vivo [1]. The basic principle of calcium imaging is that neural action potentials (or spikes), the point process signal of interest, each induce an optically measurable transient response in calcium dynamics. The nontrivial problem to extract the spike train of each neuron from a raw fluorescence trace has been addressed with several different approaches, including template matching [2] and linear deconvolution [3, 4], which are outperformed by sparse nonnegative deconvolution [5]. The latter can be interpreted as the MAP estimate under a generative model (linear convolution plus noise; Fig. 1), whereas fully Bayesian methods [6, 7] can provide some further improvements, but are more computationally expensive. Supervised methods trained on simultaneously-recorded electrophysiological and imaging data [8, 9] have also recently achieved state of the art results, but are more black-box in nature. The methods above are typically applied to imaging data offline, after the experiment is complete; however, there is a need for accurate and fast real-time processing to enable closed-loop experiments, a powerful strategy for causal investigation of neural circuitry [10]. In particular, observing and feeding back the effects of circuit interventions on physiologically relevant timescales will be valuable for directly testing whether inferred models of dynamics, connectivity, and causation are accurate in vivo, and recent experimental advances [11, 12] are now enabling work in this direction. Brain-computer interfaces (BCIs) also rely on real-time estimates of neural activity. Whereas most BCI systems rely on electrical recordings, BCIs have been driven by optical signals too [13], providing new insight into how neurons change their activity during learning on a finer spatial scale than possible with intracortical electrodes. Finally, adaptive experimental design approaches [14, 15, 16] also rely on online estimates of neural activity. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 0 150 300 Time 0 1 2 Fluorescence s c y Figure 1: Generative autoregressive model for calcium dynamics. Spike train s gets filtered to produce calcium trace c; here we used p = 2 as order of the AR process. Added noise yields the observed fluorescence y. Even in cases where we do not require the strict timing/latency constraints of real-time processing, we still need methods that scale to large data sets as for example in whole-brain imaging of larval zebrafish [17, 18]. A further demand for scalability stems from the fact that the deconvolution problem is solved in the inner loop of constrained nonnegative matrix factorization (CNMF) [19], the current state of the art for simultaneous denoising, deconvolution, and demixing of spatiotemporal calcium imaging data. In this paper we address the pressing need for scalable online spike inference methods. We build on the success of framing spike inference as a sparse nonnegative deconvolution problem. Current algorithms employ interior point methods to solve the ensuing optimization problem and are fast enough to process hundreds of neurons in about the same time as the recording [5], but will not scale to currently obtained larger data sets such as whole-brain zebrafish imaging. Furthermore, these interior point methods scale linearly, but they cannot be warm started, i.e. be initialized with the solution from a previous iteration to gain speed-ups, and do not run online. We noted a close connection between the MAP problem and isotonic regression, which fits data by a monotone piecewise constant function. A classic isotonic regression algorithm is the pool adjacent violators algorithm (PAVA) [20, 21], which sweeps through the data looking for violations of the monotonicity constraint. When it finds one, it adjusts the estimate to the best possible fit with constraints, which amounts to pooling data points with the same fitted value. During the sweep adjacent pools that violate the constraints are merged. We generalized PAVA to derive an Online Active Set method to Infer Spikes (OASIS) that yields speed-ups in processing time by at least one order of magnitude compared to interior point methods on both simulated and real data. Further, OASIS can be warm-started, which is useful in the inner loop of CNMF, and also when adjusting model hyperparameters, as we show below. Importantly, OASIS is not only much faster, but operates in an online fashion, progressing through the fluorescence time series sequentially from beginning to end. The advances in speed paired with the inherently online fashion of the algorithm enable true real-time online spike inference during the imaging session, with the potential to significantly impact experimental paradigms. We expect our algorithm to be a useful tool for the neuroscience community, to enable new experiments that online access to spike timings affords and to be of interest in other fields, such as physics and quantitative finance, that deal with jump diffusion processes. The rest of this paper is organized as follows: Section 2 introduces the autoregressive model for calcium dynamics. In Section 3 we derive our active set method for the sparse nonnegative deconvolution problem for the simple case of AR(1) dynamics and generalize it to arbitrary AR(p) processes in the Supplementary Material. We further use the problem’s dual formulation to adjust the sparsity level in a principled way (following [19]), and describe methods for fitting model hyperparameters including the coefficients of the AR process. In Section 4 we show some results on simulated as well as real data. Finally, in Section 5 we conclude with possible further extensions. 2 Autoregressive model for calcium dynamics We assume we observe the fluorescence signal for T timesteps, and denote by st the number of spikes that the neuron fired at the t-th timestep, t = 1, ..., T, cf. Figure 1. We approximate the calcium concentration dynamics c using a stable autoregressive process of order p (AR(p)) where p is a small positive integer, usually p = 1 or 2, ct = p X i=1 γict−i + st. (1) The observed fluorescence y ∈RT is related to the calcium concentration as [5, 6, 7]: yt = a ct + ϵt, ϵt ∼N(0, σ2) (2) 2 where a is a nonnegative scalar and the noise is assumed to be i.i.d. zero mean Gaussian with variance σ2. For the remainder we assume units such that a = 1 without loss of generality. The parameters γi and σ can be estimated from the autocovariance function and the power spectral density (PSD) of y respectively [19]. The autocovariance approach assumes that the spiking signal s comes from a homogeneous Poisson process and in practice often gives a crude estimate of γi. We will improve on this below (Fig. 3) by fitting the AR coefficients directly, which leads to better estimates, particularly when the spikes have some significant autocorrelation. The goal of calcium deconvolution is to extract an estimate of the neural activity s from the vector of observations y. As discussed in [5, 19], this leads to the following nonnegative LASSO problem for estimating the calcium concentration: minimize c 1 2∥c −y∥2 + λ∥s∥1 subject to s = Gc ≥0 (3) where the ℓ1 penalty enforces sparsity of the neural activity and the lower triangular matrix G is defined as: G =     1 0 0 . . . 0 −γ1 1 0 . . . 0 −γ2 −γ1 1 . . . 0 ... ... ... ... ... 0 . . . −γ2 −γ1 1     (4) Following the approach in [5] the spike signal s is relaxed from nonnegative integers to arbitrary nonnegative values. 3 Derivation of the active set algorithm The optimization problem (3) could be solved using generic convex program solvers. Here we derive the much faster Online Active Set method to Infer Spikes (OASIS). 3.1 Online Active Set method to Infer Spikes (OASIS) For simplicity we consider first the AR(1) model and defer the cumbersome general case p > 1 to the Supplementary Material. We begin by inserting the definition of s (Eq. 3, skipping the index of γ for a single AR coefficient). Using that s is constrained to be nonnegative yields for the sparsity penalty λ∥s∥1 = λ1⊤s = λ T X t=1 T X k=1 Gk,tct = λ T X t=1 (1 −γ + γδtT )ct = T X t=1 µtct = µ⊤c (5) with µt := λ(1 −γ + γδtT ) (with δ denoting Kronecker’s delta) by noting that the sum of the last column of G is 1, whereas all other columns sum to (1 −γ). Now the problem minimize c 1 2 T X t=1 (ct −yt)2 + T X t=1 µtct subject to ct+1 ≥γct ≥0 ∀t (6) shares some similarity to isotonic regression with the constraint ct+1 ≥ct. However, our constraint ct+1 ≥γct bounds the rate of decay instead of enforcing monotonicity. We generalize PAVA to handle the additional factor γ. The algorithm is based on the following: For an optimal solution, if yt < γyt−1, then the constraint becomes active and holds with equality, ct = γct−1. (Supposing the opposite, i.e. ct > γct−1, we could move ct−1 and ct by some small ϵ to decreases the objective without violating the constraints, yielding a proof by contradiction.) We first present the algorithm in a way that conveys its core ideas, then improve the algorithm’s efficiency by introducing “pools” of variables (adjacent ct values) which are updated simultaneously. We introduce temporary values c′ and initialize them to the unconstrained least squares solution, c′ = y −µ. Initially all constraints are in the “passive set” and possible violations are fixed by subsequently adding the respective constraints to the “active set.” Starting at t = 2 one moves forward until a violation of the constraint c′ τ ≥γc′ τ−1 at some time τ is detected (Fig. 2A). Now the constraint is added to the active set and enforced by setting c′ τ = γc′ τ−1. Updating the two time steps by minimizing 1 2(yτ−1 −c′ τ−1)2 + 1 2(yτ −γc′ τ−1)2 + µτ−1c′ τ−1 + µτγc′ τ−1 yields an updated value c′ τ−1. However, this updated value can violate the constraint c′ τ−1 ≥γc′ τ−2 and we need to update c′ τ−2 as well, etc., until we have backtracked some ∆t steps to time ˆt = τ −∆t 3 A B C D E F G H I move forward  track back  move forward  move forward  move forward  track back  track back  move forward  track back  ... Figure 2: Illustration of OASIS for an AR(1) process (see Supplementary Video). Red lines depict true spike times. The shaded background shows how the time points are gathered in pools. The pool currently under consideration is indicated by the blue crosses. A constraint violation is encountered for the second time step (A) leading to backtracking and merging (B). The algorithm proceeds moving forward (C-E) until the next violation occurs (E) and triggers backtracking and merging (F-G) as long as constraints are violated. When the most recent spike time has been reached (G) the algorithm proceeds forward again (H). The process continues until the end of the series has been reached (I). The solution is obtained and pools span the inter-spike-intervals. where the constraint c′ ˆt ≥γc′ ˆt−1 is already valid. At most one needs to backtrack to the most recent spike, because c′ ˆt > γc′ ˆt−1 at spike times ˆt (Eq. 1). (Because such delays could be too long for some interesting closed loop experiments, we show in the Supplementary Material how well the method performs if backtracking is limited to just few frames.) Solving minimize c′ ˆt 1 2 ∆t X t=0 (γtc′ ˆt −yt+ˆt)2 + ∆t X t=0 µt+ˆtγtc′ ˆt (7) by setting the derivative to zero yields c′ ˆt = P∆t t=0(yt+ˆt −µt+ˆt)γt P∆t t=0 γ2t (8) and the next values are updated according to c′ ˆt+t = γtc′ ˆt for t = 1, ..., ∆t. (Along the way it is worth noting that, because a spike induces a calcium response described by kernel h with components h1+t = γt, c′ ˆt could be expressed in the more familiar regression form as h⊤ 1:∆t+1(y−µ)ˆt:τ h⊤ 1:∆t+1h1:∆t+1 , where we used the notation vi:j to describe a vector formed by components i to j of v.) Now one moves forward again (Fig. 2C-E) until detection of the next violation (Fig. 2E), backtracks again to the most recent spike (Fig. 2G), etc. Once the end of the time series is reached (Fig. 2I) we have found the optimal solution and set c = c′. In a worst case situation a constraint violation is encountered at every step of the forward sweep through the series. Updating all t values up to time t yields overall PT t=2 t = T (T +1) 2 −1 updates and an O(T 2) algorithm. In order to obtain a more efficient algorithm we introduce pools which are tuples of the form (vi, wi, ti, li) with value vi, weight wi, event time ti and pool length li. Initially there is a pool (yt −µt, 1, t, 1) for each time step t. During backtracking pools get combined and only the first value vi = c′ ti is explicitly considered, while the other values are merely defined implicitly via ct+1 = γct. The constraint ct+1 ≥γct translates to vi+1 ≥γlivi as the criterion determining whether pools need to be combined. The introduced weights allow efficient value updates whenever pools are merged by avoiding recalculating the sums in equation (8). Values are updated according to vi ←wivi + γliwi+1vi+1 wi + γ2liwi+1 (9) where the denominator is the new weight of the pool and the pool lengths are summed wi ←wi + γ2liwi+1 (10) li ←li + li+1. (11) 4 Whenever pools i and i + 1 are merged, former pool i + 1 is removed and the succeeding pool indices decreased by 1. It is easy to prove by induction that the updates according to equations (9-11) guarantee that equation (8) holds for all values (see Supplementary Material) without having to explicitly calculate it. The latter would be expensive for long pools, whereas merging two pools has O(1) complexity independent of the pool lengths. With pooling the considered worst case situation results in a single pool that is updated at every step forward, yielding O(T) complexity. Analogous to PAVA, the updates solve equation (6) not just greedily but optimally. The final algorithm is summarized in Algorithm 1 and illustrated in Figure 2 as well as in the Supplementary Video. Algorithm 1 Fast online deconvolution algorithm for AR(1) processes with positive jumps Require: data y, decay factor γ, regularization parameter λ 1: initialize pools as P = {(vi, wi, ti, li)}T i=1 ←{(yt −λ(1 −γ + γδtT ), 1, t, 1)}T t=1 and let i ←1 2: while i < |P| do ▷iterate until end 3: while i < |P| and vi+1 ≥γlivi do i ←i + 1 ▷move forward 4: if i == |P| then break 5: while i > 0 and vi+1 < γlivi do ▷track back 6: Pi ←  wivi+γli wi+1vi+1 wi+γ2li wi+1 , wi + γ2liwi+1, ti, li + li+1  ▷Eqs. (9-11) 7: remove Pi+1 8: i ←i −1 9: i ←i + 1 10: for (v, w, t, l) in P do ▷construct solution for all t 11: for τ = 0, ..., l −1 do ct+τ ←γτ max(0, v) ▷enforce ct ≥0 via max 12: return c 3.2 Dual formulation with hard noise constraint The formulation above contains a troublesome free sparsity parameter λ (implicit in µ). A more robust deconvolution approach eliminates it by inclusion of the residual sum of squares (RSS) as a hard constraint and not as a penalty term in the objective function [19]. The expected RSS satisfies ⟨∥c −y∥2⟩= σ2T and by the law of large numbers ∥c −y∥2 ≈σ2T with high probability, leading to the constrained problem minimize c ∥s∥1 subject to s = Gc ≥0 and ∥c −y∥2 ≤σ2T. (12) (As noted above, we estimate σ using the power spectral estimator described in [19].) We will solve this problem by increasing λ in the dual formulation until the noise constraint is tight. We start with some small λ, e.g. λ = 0, to obtain a first partitioning into pools P, cf. Figure 3A below. From equations (8-10) (and see also S11) along with the definition of µ (Eq. 5) it follows that given the solution (vi, wi, ti, li), where vi = Pli−1 t=0 (yti+t −µti+t)γt Pli−1 t=0 γ2t = Pli−1 t=0 (yti+t −λ(1 −γ + γδti+t,T ))γt wi for some λ, the solution (v′ i, w′ i, t′ i, l′ i) for λ + ∆λ is v′ i = vi −∆λ Pli−1 t=0 (1 −γ + γδti+t,T )γt wi = vi −∆λ1 −γli(1 −δiz) wi (13) where z = |P| is the index of the last pool and because pools are updated independently we make the approximation that no changes in the pool structure occur. Inserting equation (13) into the noise constraint (Eq. 12) results in z X i=1 li−1 X t=0  vi −∆λ1 −γli(1 −δiz) wi  γt −yti+t 2 = σ2T (14) and solving the quadratic equation yields ∆λ = −β+√ β2−4αϵ 2α with α = P i,t ξ2 it, β = 2 P i,t χitξit and ϵ = P i,t χ2 it −σ2T where ξit = 1−γli(1−δiz) wi γt and χit = yti+t −viγt. 5 0 2 Correlation: 0.734 Truth Estimate Data 0 λ∗λ σ2T RSS λ− 0 2 Correlation: 0.753 0 2 Fluorescence Correlation: 0.767 γ∗ γ σ2T RSS γ− 0 2 Correlation: 0.777 0 2 Correlation: 0.791 10 20 30 40 Time [s] 0 2 Correlation: 0.849 true γ γ from autocovariance A run Alg. 1 B C run Alg. 1 D E run Alg. 1 F Iterate B – E ∼3 iterations to converge ... Figure 3: Optimizing sparsity parameter λ and AR coefficient γ. (A) Running the active set method, with conservatively small estimate of γ, yields an initial denoised estimate (blue) of the data (yellow) roughly capturing the truth (red). We also report the correlation between the deconvolved estimate and true spike train as direct measure for the accuracy of spike train inference. (B) Updating sparsity parameter λ according to Eq. (14) such that RSS = σ2T (left) shifts the current estimate downward (right, blue). (C) Running the active set method enforces the constraints again and is fast due to warm-starting. (D) Updating γ by minimizing the polynomial function RSS(γ) and (E) running the warm-started active set method completes one iteration, which yields already a decent fit. (F) A few more iterations improve the solution further and the obtained estimate is hardly distinguishable from the one obtained with known true γ (turquoise dashed on top of blue solid line). Note that determining γ based on the autocovariance (purple) yields a crude solution that even misses spikes (at 24.6 s and 46.5 s). The solution ∆λ provides a good approximate proposal step for updating the pool values vi (using Eq. 13). Since this update proposal is only approximate it can give rise to violated constraints (e.g., negative values of vi). To satisfy all constraints Algorithm 1 is run to update the pool structure, cf. Figure 3C, but with a warm start: we initialize with the current set of merely z pools P′ instead of the T pools for a cold start (Alg. 1, line 1). This step returns a set of vi values that satisfy the constraints and may merge pools (i.e., delete spikes); then the procedure (update λ then rerun the warm-started Algorithm 1) can be iterated until no further pools need to be merged, at which point the procedure has converged. In practice this leads to an increasing sequence of λ values (corresponding to an increasingly sparse set of spikes), and no pool-split (i.e., add-spike) moves are necessary1. This warm-starting approach brings major speed benefits: after the residual is updated following a λ update, the computational cost of the algorithm is linear in the number of pools z, hence warm starting drastically reduces computational costs from k1T to k2z with proportionality constants k1 and k2: if no pool boundary updates are needed then after warm starting the algorithm only needs to pass once through all pools to verify that no constraint is violated, whereas a cold start might involve a couple passes over the data to update pools, so k2 is typically significantly smaller than k1, and z is typically much smaller than T (especially in sparsely-spiking regimes). 3.3 Optimizing the AR coefficient Thus far the parameter γ has been known or been estimated based on the autocovariance function. We can improve upon this estimate by optimizing γ as well, which is illustrated in Figure 3. After updating λ followed by running Algorithm 1, we perform a coordinate descent step in γ that minimizes the RSS, cf. Figure 3D. The RSS as a function of γ is a high order polynomial, cf. equation (8), and we need to settle for numerical solutions. We used Brent’s method [22] with bounds 0 ≤γ < 1. One iteration consists now of steps B-E in Figure 3, while for known γ only B-C were necessary. 1Note that it is possible to cheaply detect any violations of the KKT conditions in a candidate solution; if such a violation is detected, the corresponding pool could be split and the warm-started Algorithm 1 run locally near the detected violations. However, as we noted, due to the increasing λ sequence we did not find this step to be necessary in the examples examined here. 6 0 2 Fluor. OASIS CVXPY Truth Data 0 25 50 0 1 Activity A 0 6 Fluor. 0 30 Time [s] 0 1 Activity 0 30 Time [s] B C OASIS ECOS MOSEK SCS GUROBI 0 0.5 1.0 Time [s] O. E. M. S. G. 0.01 0.1 1 D OASIS ECOS MOSEK SCS GUROBI Solver 0 1 2 Time [s] O. E. M. S. G. 0.01 0.1 1 E Figure 4: OASIS produces the same high quality results as convex solvers at least an order of magnitude faster. (A) Raw and inferred traces for simulated AR(1) data, (B) simulated AR(2) and (C) real data from [29] modeled as AR(2) process. OASIS solves equation (3) exactly for AR(1) and just approximately for AR(2) processes, nevertheless well extracting spikes. (D) Computation time for simulated AR(1) data with given λ (blue circles, Eq. 3) or inference with hard noise constraint (green x, Eq. 12). GUROBI failed on the noise constrained problem. (E) Computation time for simulated AR(2) data. 4 Results 4.1 Benchmarking OASIS We generated datasets of 20 fluorescence traces each for p = 1 and 2 with a duration of 100 s at a framerate of 30 Hz, such that T = 3,000 frames. The spiking signal came from a homogeneous Poisson process. We used γ = 0.95, σ = 0.3 for the AR(1) model and γ1 = 1.7, γ2 = −0.712, σ = 1 for the AR(2) model. Figures 4A-C are reassuring that our suggested (dual) active set method yields indeed the same results as other convex solvers for an AR(1) process and that spikes are extracted well. For an AR(2) process OASIS is greedy and yields good results that are similar to the one obtained with convex solvers (lower panels in Fig. 4B and C), with virtually identical denoised fluorescence traces (upper panels). An exact fast (primal) active set method method for this case is presented in the extended journal version of this paper [23]. Figures 4D,E report the computation time (±SEM) averaged over all 20 traces and ten runs per trace on a MacBook Pro with Intel Core i5 2.7 GHz CPU. We compared the run time of our algorithm to a variety of state of the art convex solvers that can all be conveniently called from the convex optimization toolbox CVXPY [24]: embedded conic solver (ECOS, [25]), MOSEK [26], splitting conic solver (SCS, [27]) and GUROBI [28]. With given sparsity parameter λ (Eq. 3) OASIS is about two magnitudes faster than any other method for an AR(1) process (Fig. 4D, blue disks) and more than one magnitude for an AR(2) process (Fig. 4E). Whereas the other solvers take almost the same time for the noise constrained problem (Eq. 12, Fig. 4D,E, green x), our method takes about three times longer to find the value of the dual variable λ compared to the formulation where the residual is part of the objective; nevertheless it still outperforms the other algorithms by a huge margin. We also ran the algorithms on longer traces of length T = 30,000 frames, confirming that OASIS scales linearly with T. Our active set method maintained its lead by 1-2 orders of magnitude in computing time. Further, compared to our active set method the other algorithms required at least an order of magnitude more RAM, confirming that OASIS is not only faster but much more memory efficient. Indeed, because OASIS can run in online mode the memory footprint can be O(1), instead of O(T). We verified these results on real data as well. Running OASIS with the hard noise constraint and p = 2 on the GCaMP6s dataset collected at 60 Hz from [29] took 0.101 ± 0.005 s per trace, whereas the fastest other methods required 2.37 ± 0.12 s. Figure 4C shows the real data together with the inferred denoised and deconvolved traces as well as the true spike times, which were obtained by simultaneous electrophysiological recordings [29]. We also extracted each neuron’s fluorescence activity using CNMF from an unpublished whole-brain zebrafish imaging dataset from the M. Ahrens lab. Running OASIS with hard noise constraint and 7 p = 1 (chosen because the calcium onset was fast compared to the acquisition rate of 2 Hz) on 10,000 traces out of a total of 91,478 suspected neurons took 81.5 s whereas ECOS, the fastest competitor, needed 2,818.1 s. For all neurons we would hence expect 745 s for OASIS, which is below the 1,500 s recording duration, and over 25,780 s for ECOS and other candidates. 4.2 Hyperparameter optimization We have shown that we can solve equation (3) and equation (12) faster than interior point methods. The AR coeffient γ was either known or estimated based on the autocorrelation in the above analyses. The latter approach assumes that the spiking signal comes from a homogeneous Poisson process, which does not generally hold for realistic data. Therefore we were interested in optimizing not only the sparsity parameter λ, but also the AR(1) coeffient γ. To illustrate the optimization of both, we generated a fluorescence trace with spiking signal from an inhomogeneous Poisson process with sinusoidal instantaneous firing rate (Fig. 3), thus mimicking realistic data. We conservatively initialized γ to a small value of 0.9. The value obtained based on the autocorrelation was 0.9792 and larger than the true value of 0.95. The left panels in Figures 3B and D illustrate the update of λ from the previous value λ−to λ∗by solving a quadratic equation analytically (Eq. 14) and the update of γ by numerical minimization of a high order polynomial respectively. Note that after merely one iteration (Fig. 3E) a good solution is obtained and after three iterations the solution is virtually identical to the one obtained when the true value of γ has been provided (Fig. 3F). This holds not only visually, but also when judged by the correlation between deconvolved activity and ground truth spike train, which was 0.869 compared to merely 0.773 if γ was obtained based on the autocorrelation. The optimization was robust to the initial value of γ, as long as it was positive and not, or only marginally, greater than the true value. The value obtained based on the autocorrelation was considerably greater and partitioned the time series into pools in a way that missed entire spikes. A quantification of the computing time for hyperparameter optimization as well as means to reduce it are presented in the extended journal version [23]. 5 Conclusions We presented an online active set method for spike inference from calcium imaging data. We assumed that the forward model to generate a fluorescence trace from a spike train is linear-Gaussian. Future work will extend the method to nonlinear models [30] incorporating saturation effects and a noise variance that increases with the mean fluorescence to better resemble the Poissonian statistics of photon counts. In the Supplementary Material we already extend our mathematical formulation to include weights for each time point as a first step in this direction. Further development, contained in the extended journal version [23], includes and optimizes an explicit fluorescence baseline. It also provides means to speed up the optimization of model hyperparameters, including the added baseline. It presents an exact and fast (primal) active set method for AR(p > 1) processes and more general calcium response kernels. A further extension is to add the constraint that positive spikes need to be larger than some minimal value, which renders the problem non-convex. A minor modification to our algorithm enables it to find an (approximate) solution of this non-convex problem, which can be marginally better than the solution obtained with ℓ1 regularizer. Acknowledgments We would like to thank Misha Ahrens and Yu Mu for providing whole-brain imaging data of larval zebrafish. We thank John Cunningham for fruitful discussions and Scott Linderman as well as Daniel Soudry for valuable comments on the manuscript. Funding for this research was provided by Swiss National Science Foundation Research Award P300P2_158428, Simons Foundation Global Brain Research Awards 325171 and 365002, ARO MURI W911NF-12-1-0594, NIH BRAIN Initiative R01 EB22913 and R21 EY027592, DARPA N66001- 15-C-4032 (SIMPLEX), and a Google Faculty Research award; in addition, this work was supported by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/ Interior Business Center (DoI/IBC) contract number D16PC00003. 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. 8 References [1] C Grienberger and C Konnerth. Imaging calcium in neurons. Neuron, 73(5):862–885, 2012. [2] B F Grewe, D Langer, H Kasper, B M Kampa, and F Helmchen. High-speed in vivo calcium imaging reveals neuronal network activity with near-millisecond precision. Nat Methods, 7(5):399–405, 2010. [3] E Yaksi and R W Friedrich. Reconstruction of firing rate changes across neuronal populations by temporally deconvolved Ca2+ imaging. Nat Methods, 3(5):377–383, 2006. [4] T F Holekamp, D Turaga, and T E Holy. Fast three-dimensional fluorescence imaging of activity in neural populations by objective-coupled planar illumination microscopy. Neuron, 57(5):661–672, 2008. [5] J T Vogelstein et al. Fast nonnegative deconvolution for spike train inference from population calcium imaging. J Neurophysiol, 104(6):3691–3704, 2010. [6] J T Vogelstein, B O Watson, A M Packer, R Yuste, B Jedynak, and L Paninski. Spike inference from calcium imaging using sequential monte carlo methods. Biophys J, 97(2):636–655, 2009. [7] E A Pnevmatikakis, J Merel, A Pakman, and L Paninski. Bayesian spike inference from calcium imaging data. Asilomar Conference on Signals, Systems and Computers, 2013. [8] T Sasaki, N Takahashi, N Matsuki, and Y Ikegaya. Fast and accurate detection of action potentials from somatic calcium fluctuations. J Neurophysiol, 100(3):1668–1676, 2008. [9] L Theis et al. Benchmarking spike rate inference in population calcium imaging. Neuron, 90(3):471–482, 2016. [10] L Grosenick, J H Marshel, and K Deisseroth. Closed-loop and activity-guided optogenetic control. Neuron, 86(1):106–139, 2015. [11] J P Rickgauer, K Deisseroth, and D W Tank. Simultaneous cellular-resolution optical perturbation and imaging of place cell firing fields. Nat Neurosci, 17(12):1816–1824, 2014. [12] A M Packer, L E Russell, H WP Dalgleish, and M Häusser. Simultaneous all-optical manipulation and recording of neural circuit activity with cellular resolution in vivo. Nat Methods, 12(2):140–146, 2015. [13] K B Clancy, A C Koralek, R M Costa, D E Feldman, and J M Carmena. Volitional modulation of optically recorded calcium signals during neuroprosthetic learning. Nat Neurosci, 17(6):807–809, 2014. [14] J Lewi, R Butera, and L Paninski. Sequential optimal design of neurophysiology experiments. Neural Comput, 21(3):619–687, 2009. [15] M Park and J W Pillow. Bayesian active learning with localized priors for fast receptive field characterization. In Adv Neural Inf Process Syst, pages 2348–2356, 2012. [16] B Shababo, B Paige, A Pakman, and L Paninski. Bayesian inference and online experimental design for mapping neural microcircuits. In Adv Neural Inf Process Syst, pages 1304–1312, 2013. [17] M B Ahrens, M B Orger, D N Robson, J M Li, and P J Keller. Whole-brain functional imaging at cellular resolution using light-sheet microscopy. Nat Methods, 10(5):413–420, 2013. [18] N Vladimirov et al. Light-sheet functional imaging in fictively behaving zebrafish. Nat Methods, 2014. [19] E A Pnevmatikakis et al. Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron, 89(2):285–299, 2016. [20] M Ayer et al. An empirical distribution function for sampling with incomplete information. Ann Math Stat, 26(4):641–647, 1955. [21] R E Barlow, D J Bartholomew, JM Bremner, and H D Brunk. Statistical inference under order restrictions: The theory and application of isotonic regression. Wiley New York, 1972. [22] R P Brent. Algorithms for Minimization Without Derivatives. Courier Corporation, 1973. [23] J Friedrich, P Zhou, and L Paninski. Fast active set methods for online deconvolution of calcium imaging data. arXiv, 1609.00639, 2016. [24] S Diamond and S Boyd. CVXPY: A Python-embedded modeling language for convex optimization. J Mach Learn Res, 17(83):1–5, 2016. [25] A Domahidi, E Chu, and S Boyd. ECOS: An SOCP solver for embedded systems. In European Control Conference (ECC), pages 3071–3076, 2013. [26] E D Andersen and K D Andersen. The MOSEK interior point optimizer for linear programming: an implementation of the homogeneous algorithm. In High performance optimization, pages 197–232. Springer, 2000. [27] B O’Donoghue, E Chu, N Parikh, and S Boyd. Conic optimization via operator splitting and homogeneous self-dual embedding. J Optim Theory Appl, pages 1–27, 2016. [28] Gurobi Optimization Inc. Gurobi optimizer reference manual, 2015. [29] T-W Chen et al. Ultrasensitive fluorescent proteins for imaging neuronal activity. Nature, 499(7458):295– 300, 2013. [30] T A Pologruto, R Yasuda, and K Svoboda. Monitoring neural activity and [Ca2+] with genetically encoded Ca2+ indicators. J Neurosci, 24(43):9572–9579, 2004. 9
2016
559
6,504
Efficient Second Order Online Learning by Sketching Haipeng Luo Princeton University, Princeton, NJ USA haipengl@cs.princeton.edu Alekh Agarwal Microsoft Research, New York, NY USA alekha@microsoft.com Nicolò Cesa-Bianchi Università degli Studi di Milano, Italy nicolo.cesa-bianchi@unimi.it John Langford Microsoft Research, New York, NY USA jcl@microsoft.com Abstract We propose Sketched Online Newton (SON), an online second order learning algorithm that enjoys substantially improved regret guarantees for ill-conditioned data. SON is an enhanced version of the Online Newton Step, which, via sketching techniques enjoys a running time linear in the dimension and sketch size. We further develop sparse forms of the sketching methods (such as Oja’s rule), making the computation linear in the sparsity of features. Together, the algorithm eliminates all computational obstacles in previous second order online learning approaches. 1 Introduction Online learning methods are highly successful at rapidly reducing the test error on large, highdimensional datasets. First order methods are particularly attractive in such problems as they typically enjoy computational complexity linear in the input size. However, the convergence of these methods crucially depends on the geometry of the data; for instance, running the same algorithm on a rotated set of examples can return vastly inferior results. See Fig. 1 for an illustration. Second order algorithms such as Online Newton Step [18] have the attractive property of being invariant to linear transformations of the data, but typically require space and update time quadratic in the number of dimensions. Furthermore, the dependence on dimension is not improved even if the examples are sparse. These issues lead to the key question in our work: Can we develop (approximately) second order online learning algorithms with efficient updates? We show that the answer is “yes” by developing efficient sketched second order methods with regret guarantees. Specifically, the three main contributions of this work are: 1. Invariant learning setting and optimal algorithms (Section 2). The typical online regret minimization setting evaluates against a benchmark that is bounded in some fixed norm (such as the ℓ2-norm), implicitly putting the problem in a nice geometry. However, if all the features are scaled down, it is desirable to compare with accordingly larger weights, which is precluded by an apriori fixed norm bound. We study an invariant learning setting similar to the paper [33] which compares the learner to a benchmark only constrained to generate bounded predictions on the sequence of examples. We show that a variant of the Online Newton Step [18], while quadratic in computation, stays regret-optimal with a nearly matching lower bound in this more general setting. 2. Improved efficiency via sketching (Section 3). To overcome the quadratic running time, we next develop sketched variants of the Newton update, approximating the second order information using a small number of carefully chosen directions, called a sketch. While the idea of data sketching is widely studied [36], as far as we know our work is the first one to apply it to a general adversarial 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. online learning setting and provide rigorous regret guarantees. Three different sketching methods are considered: Random Projections [1, 19], Frequent Directions [12, 23], and Oja’s algorithm [28, 29], all of which allow linear running time per round. For the first two methods, we prove regret bounds similar to the full second order update whenever the sketch-size is large enough. Our analysis makes it easy to plug in other sketching and online PCA methods (e.g. [11]). 0 50 100 150 200 0.06 0.08 0.1 0.12 0.14 0.16 condition number error rate AdaGrad Oja−SON (m=0) Oja−SON (m=5) Oja−SON (m=10) Figure 1: Error rate of SON using Oja’s sketch, and ADAGRAD on a synthetic ill-conditioned problem. m is the sketch size (m = 0 is Online Gradient, m = d resembles Online Newton). SON is nearly invariant to condition number for m = 10. 3. Sparse updates (Section 4). For practical implementation, we further develop sparse versions of these updates with a running time linear in the sparsity of the examples. The main challenge here is that even if examples are sparse, the sketch matrix still quickly becomes dense. These are the first known sparse implementations of the Frequent Directions1 and Oja’s algorithm, and require new sparse eigen computation routines that may be of independent interest. Empirically, we evaluate our algorithm using the sparse Oja sketch (called Oja-SON) against first order methods such as diagonalized ADAGRAD [6, 25] on both ill-conditioned synthetic and a suite of real-world datasets. As Fig. 1 shows for a synthetic problem, we observe substantial performance gains as data conditioning worsens. On the real-world datasets, we find improvements in some instances, while observing no substantial second-order signal in the others. Related work Our online learning setting is closest to the one proposed in [33], which studies scale-invariant algorithms, a special case of the invariance property considered here (see also [31, Section 5]). Computational efficiency, a main concern in this work, is not a problem there since each coordinate is scaled independently. Orabona and Pál [30] study unrelated notions of invariance. Gao et al. [9] study a specific randomized sketching method for a special online learning setting. The L-BFGS algorithm [24] has recently been studied in the stochastic setting2 [3, 26, 27, 34, 35], but has strong assumptions with pessimistic rates in theory and reliance on the use of large mini-batches empirically. Recent works [7, 15, 14, 32] employ sketching in stochastic optimization, but do not provide sparse implementations or extend in an obvious manner to the online setting. The FrankWolfe algorithm [8, 20] is also invariant to linear transformations, but with worse regret bounds [17] without further assumptions and modifications [10]. Notation Vectors are represented by bold letters (e.g., x, w, ...) and matrices by capital letters (e.g., M, A, . . . ). Mi,j denotes the (i, j) entry of matrix M. Id represents the d × d identity matrix, 0m×d represents the m × d matrix of zeroes, and diag{x} represents a diagonal matrix with x on the diagonal. λi(A) denotes the i-th largest eigenvalue of A, ∥w∥A denotes √ w⊤Aw, |A| is the determinant of A, TR(A) is the trace of A, ⟨A, B⟩denotes P i,j Ai,jBi,j, and A ⪯B means that B −A is positive semidefinite. The sign function SGN(a) is 1 if a ≥0 and −1 otherwise. 2 Setup and an Optimal Algorithm We consider the following setting. On each round t = 1, 2 . . . , T: (1) the adversary first presents an example xt ∈Rd, (2) the learner chooses wt ∈Rd and predicts w⊤ t xt, (3) the adversary reveals a loss function ft(w) = ℓt(w⊤xt) for some convex, differentiable ℓt : R →R+, and (4) the learner suffers loss ft(wt) for this round. The learner’s regret to a comparator w is defined as RT (w) = PT t=1 ft(wt) −PT t=1 ft(w). Typical results study RT (w) against all w with a bounded norm in some geometry. For an invariant update, 1Recent work by [13] also studies sparse updates for a more complicated variant of Frequent Directions which is randomized and incurs extra approximation error. 2Stochastic setting assumes that the examples are drawn i.i.d. from a distribution. 2 we relax this requirement and only put bounds on the predictions w⊤xt. Specifically, for some pre-chosen constant C we define Kt def =  w : |w⊤xt| ≤C . We seek to minimize regret to all comparators that generate bounded predictions on every data point, that is: RT = sup w∈K RT (w) where K def = T\ t=1 Kt =  w : ∀t = 1, 2, . . . T, |w⊤xt| ≤C . Under this setup, if the data are transformed to Mxt for all t and some invertible matrix M ∈Rd×d, the optimal w∗simply moves to (M −1)⊤w∗, which still has bounded predictions but might have significantly larger norm. This relaxation is similar to the comparator set considered in [33]. We make two structural assumptions on the loss functions. Assumption 1. (Scalar Lipschitz) The loss function ℓt satisfies |ℓ ′ t(z)| ≤L whenever |z| ≤C. Assumption 2. (Curvature) There exists σt ≥0 such that for all u, w ∈K, ft(w) is lower bounded by ft(u) + ∇ft(u)⊤(w −u) + σt 2 ∇ft(u)⊤(u −w) 2 . Note that when σt = 0, Assumption 2 merely imposes convexity. More generally, it is satisfied by squared loss ft(w) = (w⊤xt −yt)2 with σt = 1 8C2 whenever |w⊤xt| and |yt| are bounded by C, as well as for all exp-concave functions (see [18, Lemma 3]). Enlarging the comparator set might result in worse regret. We next show matching upper and lower bounds qualitatively similar to the standard setting, but with an extra unavoidable √ d factor. 3 Theorem 1. For any online algorithm generating wt ∈Rd and all T ≥d, there exists a sequence of T examples xt ∈Rd and loss functions ℓt satisfying Assumptions 1 and 2 (with σt = 0) such that the regret RT is at least CL p dT/2. We now give an algorithm that matches the lower bound up to logarithmic constants in the worst case but enjoys much smaller regret when σt ̸= 0. At round t + 1 with some invertible matrix At specified later and gradient gt = ∇ft(wt), the algorithm performs the following update before making the prediction on the example xt+1: ut+1 = wt −A−1 t gt, and wt+1 = argmin w∈Kt+1 ∥w −ut+1∥At . (1) The projection onto the set Kt+1 differs from typical norm-based projections as it only enforces boundedness on xt+1 at round t + 1. Moreover, this projection step can be performed in closed form. Lemma 1. For any x ̸= 0, u ∈Rd and positive definite matrix A ∈Rd×d, we have argmin w : |w⊤x|≤C ∥w −u∥A = u −τC(u⊤x) x⊤A−1x A−1x, where τC(y) = SGN(y) max{|y| −C, 0}. If At is a diagonal matrix, updates similar to those of Ross et al. [33] are recovered. We study a choice of At that is similar to the Online Newton Step (ONS) [18] (though with different projections): At = αId + t X s=1 (σs + ηs)gsg⊤ s (2) for some parameters α > 0 and ηt ≥0. The regret guarantee of this algorithm is shown below: Theorem 2. Under Assumptions 1 and 2, suppose that σt ≥σ ≥0 for all t, and ηt is non-increasing. Then using the matrices (2) in the updates (1) yields for all w ∈K, RT (w) ≤α 2 ∥w∥2 2 + 2(CL)2 T X t=1 ηt + d 2(σ + ηT ) ln 1 + (σ + ηT ) PT t=1 ∥gt∥2 2 dα ! . 3In the standard setting where wt and xt are restricted such that ∥wt∥≤D and ∥xt∥≤X, the minimax regret is O(DXL √ T). This is clearly a special case of our setting with C = DX. 3 Algorithm 1 Sketched Online Newton (SON) Input: Parameters C, α and m. 1: Initialize u1 = 0d×1. 2: Initialize sketch (S, H) ←SketchInit(α, m). 3: for t = 1 to T do 4: Receive example xt. 5: Projection step: compute bx = Sxt, γ = τC(u⊤ t xt) x⊤ t xt−bx⊤Hbx and set wt = ut −γ(xt −S⊤Hbx). 6: Predict label yt = w⊤ t xt and suffer loss ℓt(yt). 7: Compute gradient gt = ℓ′ t(yt)xt and the to-sketch vector bg = √σt + ηtgt. 8: (S, H) ←SketchUpdate(bg). 9: Update weight: ut+1 = wt −1 α(gt −S⊤HSgt). 10: end for The dependence on ∥w∥2 2 implies that the method is not completely invariant to transformations of the data. This is due to the part αId in At. However, this is not critical since α is fixed and small while the other part of the bound grows to eventually become the dominating term. Moreover, we can even set α = 0 and replace the inverse with the Moore-Penrose pseudoinverse to obtain a truly invariant algorithm, as discussed in Appendix D. We use α > 0 in the remainder for simplicity. The implication of this regret bound is the following: in the worst case where σ = 0, we set ηt = p d/C2L2t and the bound simplifies to RT (w) ≤α 2 ∥w∥2 2 + CL 2 √ Td ln 1 + PT t=1 ∥gt∥2 2 αCL √ Td ! + 4CL √ Td , essentially only losing a logarithmic factor compared to the lower bound in Theorem 1. On the other hand, if σt ≥σ > 0 for all t, then we set ηt = 0 and the regret simplifies to RT (w) ≤α 2 ∥w∥2 2 + d 2σ ln 1 + σ PT t=1 ∥gt∥2 2 dα ! , (3) extending the O(d ln T) results in [18] to the weaker Assumption 2 and a larger comparator set K. 3 Efficiency via Sketching Our algorithm so far requires Ω(d2) time and space just as ONS. In this section we show how to achieve regret guarantees nearly as good as the above bounds, while keeping computation within a constant factor of first order methods. Let Gt ∈Rt×d be a matrix such that the t-th row is bg⊤ t where we define bgt = √σt + ηtgt to be the to-sketch vector. Our previous choice of At (Eq. (2)) can be written as αId + G⊤ t Gt. The idea of sketching is to maintain an approximation of Gt, denoted by St ∈Rm×d where m ≪d is a small constant called the sketch size. If m is chosen so that S⊤ t St approximates G⊤ t Gt well, we can redefine At as αId + S⊤ t St for the algorithm. To see why this admits an efficient algorithm, notice that by the Woodbury formula one has A−1 t = 1 α Id −S⊤ t (αIm + StS⊤ t )−1St  . With the notation Ht = (αIm + StS⊤ t )−1 ∈Rm×m and γt = τC(u⊤ t+1xt+1)/(x⊤ t+1xt+1 −x⊤ t+1S⊤ t HtStxt+1), update (1) becomes: ut+1 = wt −1 α gt −S⊤ t HtStgt  , and wt+1 = ut+1 −γt xt+1 −S⊤ t HtStxt+1  . The operations involving Stgt or Stxt+1 require only O(md) time, while matrix vector products with Ht require only O(m2). Altogether, these updates are at most m times more expensive than first order algorithms as long as St and Ht can be maintained efficiently. We call this algorithm Sketched Online Newton (SON) and summarize it in Algorithm 1. We now discuss three sketching techniques to maintain the matrices St and Ht efficiently, each requiring O(md) storage and time linear in d. 4 Algorithm 2 FD-Sketch for FD-SON Internal State: S and H. SketchInit(α, m) 1: Set S = 0m×d and H = 1 αIm. 2: Return (S, H). SketchUpdate(bg) 1: Insert bg into the last row of S. 2: Compute eigendecomposition: V ⊤ΣV = S⊤S and set S = (Σ −Σm,mIm) 1 2 V . 3: Set H = diag n 1 α+Σ1,1−Σm,m , · · · , 1 α o . 4: Return (S, H). Algorithm 3 Oja’s Sketch for Oja-SON Internal State: t, Λ, V and H. SketchInit(α, m) 1: Set t = 0, Λ = 0m×m, H = 1 αIm and V to any m×d matrix with orthonormal rows. 2: Return (0m×d, H). SketchUpdate(bg) 1: Update t ←t + 1, Λ and V as Eqn. 4. 2: Set S = (tΛ) 1 2 V . 3: Set H = diag n 1 α+tΛ1,1 , · · · , 1 α+tΛm,m o . 4: Return (S, H). Random Projection (RP). Random projections are classical methods for sketching [19, 1, 21]. Here we consider Gaussian Random Projection sketch: St = St−1 + rtbg⊤ t , where each entry of rt ∈Rm is an independent random Gaussian variable drawn from N(0, 1/√m). One can verify that the update of H−1 t can be realized by two rank-one updates: H−1 t = H−1 t−1 + qtr⊤ t + rtq⊤ t where qt = Stbgt −∥bgt∥2 2 2 rt. Using Woodbury formula, this results in O(md) update of S and H (see Algorithm 6 in Appendix E). We call this combination of SON with RP-sketch RP-SON. When α = 0 this algorithm is invariant to linear transformations for each fixed realization of the randomness. Using the existing guarantees for RP-sketch, in Appendix E we show a similar regret bound as Theorem 2 up to constants, provided m = ˜Ω(r) where r is the rank of GT . Therefore RP-SON is near invariant, and gives substantial computational gains when r ≪d with small regret overhead. Frequent Directions (FD). When GT is near full-rank, however, RP-SON may not perform well. To address this, we consider Frequent Directions (FD) sketch [12, 23], a deterministic sketching method. FD maintains the invariant that the last row of St is always 0. On each round, the vector bg⊤ t is inserted into the last row of St−1, then the covariance of the resulting matrix is eigendecomposed into V ⊤ t ΣtVt and St is set to (Σt −ρtIm) 1 2 Vt where ρt is the smallest eigenvalue. Since the rows of St are orthogonal to each other, Ht is a diagonal matrix and can be maintained efficiently (see Algorithm 2). The sketch update works in O(md) time (see [12] and Appendix G.2) so the total running time is O(md) per round. We call this combination FD-SON and prove the following regret bound with notation Ωk = Pd i=k+1 λi(G⊤ T GT ) for any k = 0, . . . , m −1. Theorem 3. Under Assumptions 1 and 2, suppose that σt ≥σ ≥0 for all t and ηt is non-increasing. FD-SON ensures that for any w ∈K and k = 0, . . . , m −1, we have RT (w) ≤α 2 ∥w∥2 2 + 2(CL)2 T X t=1 ηt + m 2(σ + ηT ) ln  1 + TR(S⊤ T ST ) mα  + mΩk 2(m −k)(σ + ηT )α . Instead of the rank, the bound depends on the spectral decay Ωk, which essentially is the only extra term compared to the bound in Theorem 2. Similarly to previous discussion, if σt ≥σ, we get the bound α 2 ∥w∥2 2 + m 2σ ln  1 + TR(S⊤ T ST ) mα  + mΩk 2(m−k)σα . With α tuned well, we pay logarithmic regret for the top m eigenvectors, but a square root regret O(√Ωk) for remaining directions not controlled by our sketch. This is expected for deterministic sketching which focuses on the dominant part of the spectrum. When α is not tuned we still get sublinear regret as long as Ωk is sublinear. Oja’s Algorithm. Oja’s algorithm [28, 29] is not usually considered as a sketching algorithm but seems very natural here. This algorithm uses online gradient descent to find eigenvectors and eigenvalues of data in a streaming fashion, with the to-sketch vector bgt’s as the input. Specifically, let Vt ∈Rm×d denote the estimated eigenvectors and the diagonal matrix Λt ∈Rm×m contain the estimated eigenvalues at the end of round t. Oja’s algorithm updates as: Λt = (Im −Γt)Λt−1 + Γt diag{Vt−1bgt}2 , Vt orth ←−−Vt−1 + ΓtVt−1bgtbg⊤ t (4) 5 where Γt ∈Rm×m is a diagonal matrix with (possibly different) learning rates of order Θ(1/t) on the diagonal, and the “ orth ←−−” operator represents an orthonormalizing step.4 The sketch is then St = (tΛt) 1 2 Vt. The rows of St are orthogonal and thus Ht is an efficiently maintainable diagonal matrix (see Algorithm 3). We call this combination Oja-SON. The time complexity of Oja’s algorithm is O(m2d) per round due to the orthonormalizing step. To improve the running time to O(md), one can only update the sketch every m rounds (similar to the block power method [16, 22]). The regret guarantee of this algorithm is unclear since existing analysis for Oja’s algorithm is only for the stochastic setting (see e.g. [2, 22]). However, Oja-SON provides good performance experimentally. 4 Sparse Implementation In many applications, examples (and hence gradients) are sparse in the sense that ∥xt∥0 ≤s for all t and some small constant s ≪d. Most online first order methods enjoy a per-example running time depending on s instead of d in such settings. Achieving the same for second order methods is more difficult since A−1 t gt (or sketched versions) are typically dense even if gt is sparse. We show how to implement our algorithms in sparsity-dependent time, specifically, in O(m2 + ms) for RP-SON and FD-SON and in O(m3 + ms) for Oja-SON. We emphasize that since the sketch would still quickly become a dense matrix even if the examples are sparse, achieving purely sparsity-dependent time is highly non-trivial (especially for FD-SON and Oja-SON), and may be of independent interest. Due to space limit, below we only briefly mention how to do it for Oja-SON. Similar discussion for the other two sketches can be found in Appendix G. Note that mathematically these updates are equivalent to the non-sparse counterparts and regret guarantees are thus unchanged. There are two ingredients to doing this for Oja-SON: (1) The eigenvectors Vt are represented as Vt = FtZt, where Zt ∈Rm×d is a sparsely updatable direction (Step 3 in Algorithm 5) and Ft ∈Rm×m is a matrix such that FtZt is orthonormal. (2) The weights wt are split as ¯wt + Z⊤ t−1bt, where bt ∈Rm maintains the weights on the subspace captured by Vt−1 (same as Zt−1), and ¯wt captures the weights on the complementary subspace which are again updated sparsely. We describe the sparse updates for ¯wt and bt below with the details for Ft and Zt deferred to Appendix H. Since St = (tΛt) 1 2 Vt = (tΛt) 1 2 FtZt and wt = ¯wt + Z⊤ t−1bt, we know ut+1 is wt − Id −S⊤ t HtSt  gt α = ¯wt −gt α −(Zt −Zt−1)⊤bt | {z } def = ¯ut+1 +Z⊤ t (bt + 1 αF ⊤ t (tΛtHt)FtZtgt | {z } def = b′ t+1 ) . (5) Since Zt −Zt−1 is sparse by construction and the matrix operations defining b′ t+1 scale with m, overall the update can be done in O(m2 + ms). Using the update for wt+1 in terms of ut+1, wt+1 is equal to ut+1 −γt(Id −S⊤ t HtSt)xt+1 = ¯ut+1 −γtxt+1 | {z } def = ¯wt+1 +Z⊤ t (b′ t+1 + γtF ⊤ t (tΛtHt)FtZtxt+1 | {z } def = bt+1 ) . (6) Again, it is clear that all the computations scale with s and not d, so both ¯wt+1 and bt+1 require only O(m2 + ms) time to maintain. Furthermore, the prediction w⊤ t xt = ¯w⊤ t xt + b⊤ t Zt−1xt can also be computed in O(ms) time. The O(m3) in the overall complexity comes from a Gram-Schmidt step in maintaining Ft (details in Appendix H). The pseudocode is presented in Algorithms 4 and 5 with some details deferred to Appendix H. This is the first sparse implementation of online eigenvector computation to the best of our knowledge. 5 Experiments Preliminary experiments revealed that out of our three sketching options, Oja’s sketch generally has better performance (see Appendix I). For more thorough evaluation, we implemented the sparse 4For simplicity, we assume that Vt−1 + ΓtVt−1bgtbg⊤ t is always of full rank so that the orthonormalizing step does not reduce the dimension of Vt. 6 Algorithm 4 Sparse Sketched Online Newton with Oja’s Algorithm Input: Parameters C, α and m. 1: Initialize ¯u = 0d×1 and b = 0m×1. 2: (Λ, F, Z, H) ←SketchInit(α, m) (Algorithm 5). 3: for t = 1 to T do 4: Receive example xt. 5: Projection step: compute bx = FZxt and γ = τC(¯u⊤xt+b⊤Zxt) x⊤ t xt−(t−1)bx⊤ΛHbx. Obtain ¯w = ¯u −γxt and b ←b + γ(t −1)F ⊤ΛHbx (Equation 6). 6: Predict label yt = ¯w⊤xt + b⊤Zxt and suffer loss ℓt(yt). 7: Compute gradient gt = ℓ′ t(yt)xt and the to-sketch vector bg = √σt + ηtgt. 8: (Λ, F, Z, H, δ) ←SketchUpdate(bg) (Algorithm 5). 9: Update weight: ¯u = ¯w −1 αgt −(δ⊤b)bg and b ←b + 1 αtF ⊤ΛHFZgt (Equation 5). 10: end for Algorithm 5 Sparse Oja’s Sketch Internal State: t, Λ, F, Z, H and K. SketchInit(α, m) 1: Set t = 0, Λ = 0m×m, F = K = αH = Im and Z to any m × d matrix with orthonormal rows. 2: Return (Λ, F, Z, H). SketchUpdate(bg) 1: Update t ←t+1. Pick a diagonal stepsize matrix Γt to update Λ ←(I −Γt)Λ+Γt diag{FZbg}2. 2: Set δ = A−1ΓtFZbg and update K ←K + δbg⊤Z⊤+ Zbgδ⊤+ (bg⊤bg)δδ⊤. 3: Update Z ←Z + δbg⊤. 4: (L, Q) ←Decompose(F, K) (Algorithm 13), so that LQZ = FZ and QZ is orthogonal. Set F = Q. 5: Set H ←diag n 1 α+tΛ1,1 , · · · , 1 α+tΛm,m o . 6: Return (Λ, F, Z, H, δ). version of Oja-SON in Vowpal Wabbit.5 We compare it with ADAGRAD [6, 25] on both synthetic and real-world datasets. Each algorithm takes a stepsize parameter: 1 α serves as a stepsize for Oja-SON and a scaling constant on the gradient matrix for ADAGRAD. We try both methods with the parameter set to 2j for j = −3, −2, . . . , 6 and report the best results. We keep the stepsize matrix in Oja-SON fixed as Γt = 1 t Im throughout. All methods make one online pass over data minimizing square loss. 5.1 Synthetic Datasets To investigate Oja-SON’s performance in the setting it is really designed for, we generated a range of synthetic ill-conditioned datasets as follows. We picked a random Gaussian matrix Z ∼RT ×d (T = 10,000 and d = 100) and a random orthonormal basis V ∈Rd×d. We chose a specific spectrum λ ∈Rd where the first d −10 coordinates are 1 and the rest increase linearly to some fixed condition number parameter κ. We let X = Zdiag{λ} 1 2 V ⊤be our example matrix, and created a binary classification problem with labels y = sign(θ⊤x), where θ ∈Rd is a random vector. We generated 20 such datasets with the same Z, V and labels y but different values of κ ∈{10, 20, . . . , 200}. Note that if the algorithm is truly invariant, it would have the same behavior on these 20 datasets. Fig. 1 (in Section 1) shows the final progressive error (i.e. fraction of misclassified examples after one pass over data) for ADAGRAD and Oja-SON (with sketch size m = 0, 5, 10) as the condition number increases. As expected, the plot confirms the performance of first order methods such as ADAGRAD degrades when the data is ill-conditioned. The plot also shows that as the sketch size increases, Oja-SON becomes more accurate: when m = 0 (no sketch at all), Oja-SON is vanilla gradient descent and is worse than ADAGRAD as expected; when m = 5, the accuracy greatly improves; and finally when m = 10, the accuracy of Oja-SON is substantially better and hardly worsens with κ. 5An open source machine learning toolkit available at http://hunch.net/~vw 7 0 2000 4000 6000 8000 10000 0 0.2 0.4 0.6 0.8 1 number of examples relative eigenvalue difference κ = 50 κ = 100 κ = 150 κ = 200 Figure 2: Oja’s algorithm’s eigenvalue recovery error. 0 0.1 0.2 0.3 0.4 0 0.1 0.2 0.3 0.4 error rate of Oja−SON (m=0) error rate of Oja−SON (m=10) m = 0 vs m=10 0 0.1 0.2 0.3 0.4 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 error rate of AdaGrad error rate of Oja−SON AdaGrad vs Oja−SON (m=0) AdaGrad vs Oja−SON (m=10) Figure 3: (a) Comparison of two sketch sizes on real data, and (b) Comparison against ADAGRAD on real data. To further explain the effectiveness of Oja’s algorithm in identifying top eigenvalues and eigenvectors, the plot in Fig. 2 shows the largest relative difference between the true and estimated top 10 eigenvalues as Oja’s algorithm sees more data. This gap drops quickly after seeing just 500 examples. 5.2 Real-world Datasets Next we evaluated Oja-SON on 23 benchmark datasets from the UCI and LIBSVM repository (see Appendix I for description of these datasets). Note that some datasets are very high dimensional but very sparse (e.g. for 20news, d ≈102, 000 and s ≈94), and consequently methods with running time quadratic (such as ONS) or even linear in dimension rather than sparsity are prohibitive. In Fig. 3(a), we show the effect of using sketched second order information, by comparing sketch size m = 0 and m = 10 for Oja-SON (concrete error rates in Appendix I). We observe significant improvements in 5 datasets (acoustic, census, heart, ionosphere, letter), demonstrating the advantage of using second order information. However, we found that Oja-SON was outperformed by ADAGRAD on most datasets, mostly because the diagonal adaptation of ADAGRAD greatly reduces the condition number on these datasets. Moreover, one disadvantage of SON is that for the directions not in the sketch, it is essentially doing vanilla gradient descent. We expect better results using diagonal adaptation as in ADAGRAD in off-sketch directions. To incorporate this high level idea, we performed a simple modification to Oja-SON: upon seeing example xt, we feed D −1 2 t xt to our algorithm instead of xt, where Dt ∈Rd×d is the diagonal part of the matrix Pt−1 τ=1 gτg⊤ τ .6 The intuition is that this diagonal rescaling first homogenizes the scales of all dimensions. Any remaining ill-conditioning is further addressed by the sketching to some degree, while the complementary subspace is no worse-off than with ADAGRAD. We believe this flexibility in picking the right vectors to sketch is an attractive aspect of our sketching-based approach. With this modification, Oja-SON outperforms ADAGRAD on most of the datasets even for m = 0, as shown in Fig. 3(b) (concrete error rates in Appendix I). The improvement on ADAGRAD at m = 0 is surprising but not impossible as the updates are not identical–our update is scale invariant like Ross et al. [33]. However, the diagonal adaptation already greatly reduces the condition number on all datasets except splice (see Fig. 4 in Appendix I for detailed results on this dataset), so little improvement is seen for sketch size m = 10 over m = 0. For several datasets, we verified the accuracy of Oja’s method in computing the top-few eigenvalues (Appendix I), so the lack of difference between sketch sizes is due to the lack of second order information after the diagonal correction. The average running time of our algorithm when m = 10 is about 11 times slower than ADAGRAD, matching expectations. Overall, SON can significantly outperform baselines on ill-conditioned data, while maintaining a practical computational complexity. Acknowledgements This work was done when Haipeng Luo and Nicolò Cesa-Bianchi were at Microsoft Research, New York. 6D1 is defined as 0.1 × Id to avoid division by zero. 8 References [1] D. Achlioptas. Database-friendly random projections: Johnson-lindenstrauss with binary coins. Journal of Computer and System Sciences, 66(4):671–687, 2003. [2] A. Balsubramani, S. Dasgupta, and Y. Freund. The fast convergence of incremental pca. In NIPS, 2013. [3] R. H. Byrd, S. Hansen, J. Nocedal, and Y. Singer. A stochastic quasi-newton method for large-scale optimization. SIAM Journal on Optimization, 26:1008–1031, 2016. [4] N. Cesa-Bianchi and G. Lugosi. Prediction, Learning, and Games. Cambridge University Press, 2006. [5] N. Cesa-Bianchi, A. Conconi, and C. Gentile. A second-order perceptron algorithm. SIAM Journal on Computing, 34(3):640–668, 2005. [6] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. JMLR, 12:2121–2159, 2011. [7] M. A. Erdogdu and A. Montanari. Convergence rates of sub-sampled newton methods. In NIPS, 2015. [8] M. Frank and P. Wolfe. An algorithm for quadratic programming. Naval research logistics quarterly, 3 (1-2):95–110, 1956. [9] W. Gao, R. Jin, S. Zhu, and Z.-H. Zhou. One-pass auc optimization. In ICML, 2013. [10] D. Garber and E. Hazan. A linearly convergent conditional gradient algorithm with applications to online and stochastic optimization. SIAM Journal on Optimization, 26:1493–1528, 2016. [11] D. Garber, E. Hazan, and T. Ma. Online learning of eigenvectors. In ICML, 2015. [12] M. Ghashami, E. Liberty, J. M. Phillips, and D. P. Woodruff. Frequent directions: Simple and deterministic matrix sketching. SIAM Journal on Computing, 45:1762–1792, 2015. [13] M. Ghashami, E. Liberty, and J. M. Phillips. Efficient frequent directions algorithm for sparse matrices. In KDD, 2016. [14] A. Gonen and S. Shalev-Shwartz. Faster sgd using sketched conditioning. arXiv:1506.02649, 2015. [15] A. Gonen, F. Orabona, and S. Shalev-Shwartz. Solving ridge regression using sketched preconditioned svrg. In ICML, 2016. [16] M. Hardt and E. Price. The noisy power method: A meta algorithm with applications. In NIPS, 2014. [17] E. Hazan and S. Kale. Projection-free online learning. In ICML, 2012. [18] E. Hazan, A. Agarwal, and S. Kale. Logarithmic regret algorithms for online convex optimization. Machine Learning, 69(2-3):169–192, 2007. [19] P. Indyk and R. Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In STOC, 1998. [20] M. Jaggi. Revisiting frank-wolfe: Projection-free sparse convex optimization. In ICML, 2013. [21] D. M. Kane and J. Nelson. Sparser johnson-lindenstrauss transforms. Journal of the ACM, 61(1):4, 2014. [22] C.-L. Li, H.-T. Lin, and C.-J. Lu. Rivalry of two families of algorithms for memory-restricted streaming pca. arXiv:1506.01490, 2015. [23] E. Liberty. Simple and deterministic matrix sketching. In KDD, 2013. [24] D. C. Liu and J. Nocedal. On the limited memory bfgs method for large scale optimization. Mathematical programming, 45(1-3):503–528, 1989. [25] H. B. McMahan and M. Streeter. Adaptive bound optimization for online convex optimization. In COLT, 2010. [26] A. Mokhtari and A. Ribeiro. Global convergence of online limited memory bfgs. JMLR, 16:3151–3181, 2015. [27] P. Moritz, R. Nishihara, and M. I. Jordan. A linearly-convergent stochastic l-bfgs algorithm. In AISTATS, 2016. [28] E. Oja. Simplified neuron model as a principal component analyzer. Journal of mathematical biology, 15 (3):267–273, 1982. [29] E. Oja and J. Karhunen. On stochastic approximation of the eigenvectors and eigenvalues of the expectation of a random matrix. Journal of mathematical analysis and applications, 106(1):69–84, 1985. [30] F. Orabona and D. Pál. Scale-free algorithms for online linear optimization. In ALT, 2015. [31] F. Orabona, K. Crammer, and N. Cesa-Bianchi. A generalized online mirror descent with applications to classification and regression. Machine Learning, 99(3):411–435, 2015. [32] M. Pilanci and M. J. Wainwright. Newton sketch: A linear-time optimization algorithm with linearquadratic convergence. arXiv:1505.02250, 2015. [33] S. Ross, P. Mineiro, and J. Langford. Normalized online learning. In UAI, 2013. [34] N. N. Schraudolph, J. Yu, and S. Günter. A stochastic quasi-newton method for online convex optimization. In AISTATS, 2007. [35] J. Sohl-Dickstein, B. Poole, and S. Ganguli. Fast large-scale optimization by unifying stochastic gradient and quasi-newton methods. In ICML, 2014. [36] D. P. Woodruff. Sketching as a tool for numerical linear algebra. Foundations and Trends in Machine Learning, 10(1-2):1–157, 2014. 9
2016
56
6,505
Human Decision-Making under Limited Time Pedro A. Ortega Department of Psychology University of Pennsylvania Philadelphia, PA 19104 ope@seas.upenn.edu Alan A. Stocker Department of Psychology University of Pennsylvania Philadelphia, PA 19014 astocker@sas.upenn.edu Abstract Subjective expected utility theory assumes that decision-makers possess unlimited computational resources to reason about their choices; however, virtually all decisions in everyday life are made under resource constraints—i.e. decision-makers are bounded in their rationality. Here we experimentally tested the predictions made by a formalization of bounded rationality based on ideas from statistical mechanics and information-theory. We systematically tested human subjects in their ability to solve combinatorial puzzles under different time limitations. We found that our bounded-rational model accounts well for the data. The decomposition of the fitted model parameter into the subjects’ expected utility function and resource parameter provide interesting insight into the subjects’ information capacity limits. Our results confirm that humans gradually fall back on their learned prior choice patterns when confronted with increasing resource limitations. 1 Introduction Human decision-making is not perfectly rational. Most of our choices are constrained by many factors such as perceptual ambiguity, time, lack of knowledge, or computational effort [6]. Classical theories of rational choice do not apply in such cases because they ignore information-processing resources, assuming that decision-makers always pick the optimal choice [10]. However, it is well known that human choice patterns deviate qualitatively from the perfectly rational ideal with increasing resource limitations. It has been suggested that such limitations in decision-making can be formalized using ideas from statistical mechanics [9] and information theory [16]. These frameworks propose that decisionmakers act as if their choice probabilities were an optimal compromise between maximizing the expected utility and minimizing the KL-divergence from a set of prior choice probabilities, where the trade-off is determined by the amount of available resources. This optimization scheme reduces the decision-making problem to the inference of the optimal choice from a stimulus, where the likelihood function results from a combination of the decision-maker’s subjective preferences and the resource limitations. The aim of this paper is to systematically validate the model of bounded-rational decision-making on human choice data. We conducted an experiment in which subjects had to solve a sequence of combinatorial puzzles under time pressure. By manipulating the allotted time for solving each puzzle, we were able to record choice data under different resource conditions. We then fit the bounded-rational choice model to the dataset, obtaining a decomposition of the choice probabilities in terms of a resource parameter and a set of stimulus-dependent utility functions. Our results show that the model captures very well the gradual shifts due to increasing time constraints that are present in the subjects’ empirical choice patterns. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 2 A Probabilistic Model of Bounded-Rational Choices We model a bounded-rational decision maker as an expected utility maximizer that is subject to information constraints. Formally, let X and Y be two finite sets, the former corresponding to a set of stimuli and the latter to a set of choices; and let P(y) be a prior distribution over optimal choices y ∈Y that the decision-maker may have learned from experience. When presented with a stimulus x ∈X, a bounded-rational decision-maker transforms the prior choice probabilities P(y) into posterior choice probabilities P(y|x) and then generates a choice according to P(y|x). This transformation is modeled as the optimization of a regularized expected utility known as the free energy functional: F  Q(y|x)  := X y Q(y|x)Ux(y) | {z } Expected Utility −1 β X y Q(y|x) log Q(y|x) P(y) | {z } Regularization , (1) where the posterior is defined as the maximizer P(y|x) := arg maxQ(y|x) F[Q(y|x)]. Crucially, the optimization is determined by two factors. The first is the decision-maker’s subjective utility function Ux : Y →R encoding the desirability of a choice y given a stimulus x. The second is the inverse temperature β, which determines the resources of deliberation available for the decisiontask1, but which are neither known to, nor controllable by the decision-maker. The resulting posterior has an analytical expression given by the Gibbs distribution P(y|x) = 1 Zβ(x)P(y) exp  βUx(y) , (2) where Zβ(x) is a normalizing constant [9]. The expression (2) highlights a connection to inference: bounded-rational decisions can also be computed via Bayes’ rule in which the likelihood is determined by β and Ux as follows: P(y|x) = P(y)P(x|y) P y′ P(y′)P(x|y′), hence P(x|y) ∝exp  βUx(y) . (3) The objective function (1) can be motivated as a trade-off between maximizing expected utility and minimizing information cost [9, 16]. Near-zero values of β, which correspond to heavily-regularized decisions, yield posterior choice probabilities that are similar to the prior. Conversely, with growing values of β, the posterior choice probabilities approach the perfectly-rational limit. Connection to regret. Bounded-rational decision-making is related to regret theory [2, 4, 8]. To see this, define the certainty-equivalent as the maximum attainable value for (1): U ∗ x := max Q(y|x) n F  Q(y|x) o = 1 β log Zβ(x). (4) The certainty-equivalent quantifies the net worth of the stimulus x prior to making a choice. The decision process treats (4) as a reference utility used in the assessment of the alternatives. Specifically, the modulation of any choice is obtained by measuring up the utility against the certainty-equivalent: log P(y|x) P(y) | {z } Change of y = −β h U ∗ x −Ux(y) | {z } Regret of y i . (5) Accordingly, the difference in log-probability is proportional to the negative regret [3]. The decisionmaker’s utility function specifies a direction of change relative to the certainty-equivalent, whereas the strength of the modulation is determined by the inverse temperature. 1For simplicity, here we consider only strictly positive values for the inverse temperature β, but its domain can be extended to negative values to model other effects, e.g. risk-sensitive estimation [9]. 2 3 Experimental Methods We conducted a choice experiment where subjects had to solve puzzles under time pressure. Each puzzle consisted of Boolean formula in conjunctive normal form (CNF) that was disguised as an arrangement of circular patterns (see Fig. 1). The task was to find a truth assignment that satisfied the formula. Subjects could pick an assignment by setting the colors of a central pattern highlighted in gray. Formally, the puzzles and the assignments corresponded to the stimuli x ∈X and the choices y ∈Y respectively, and the duration of the puzzle was the resource parameter that we controlled (see equation 1). b) c) d) a) ? ? ? Figure 1: Example puzzle. a) Each puzzle is a set of six circularly arranged patches containing patterns of black (•) and white circles (◦). In each trial, the positions of the patches were randomly assigned to one of the six possible locations. Subjects had to choose the three center colors such that there was at least one (color and position) match for each patch. For instance, the choice in (b) only matches four out of six patches (in red), while (c) solves the puzzle. The puzzle is a visualization of the Boolean formula in (d). We restricted our puzzles to a set of five CNF formulas having 6 clauses, 2 literals per clause, and 3 variables. Subjects were trained only on the first four puzzles, whereas the last one was used as a control puzzle during the test phase. All the chosen puzzles had a single solution out of the 23 = 8 possible assignments. We chose CNF formulas because they provide a general2 and flexible platform for testing decisionmaking behavior. Crucially, unlike in an estimation task, finding the relation between a stimulus and a choice is non-trivial and requires solving a computational problem. 3.1 Data Collection Two symmetric versions of the experiment were conducted on Amazon Mechanical Turk. For each, we collected choice data from 15 anonymized participants living in the United States, totaling 30 subjects. Subjects were paid 10 dollars for completing the experiment. The typical runtime of the experiment ranged between 50 and 130 minutes. For each subject, we recorded a sequence of 90 training and 285 test trials. The puzzles were displayed throughout the whole trial, during which the subjects could modify their choice at will. The training trials allowed subjects to familiarize themselves with the task and the stimuli, whereas the test trials measured their adapted choice behavior as a function of the stimulus and the task duration. Training trials were presented in blocks of 18 for a long, fixed duration; the test trials, which were of variable duration, were presented in blocks of 19 (18 regular + 1 control trial). To avoid the collection of poor quality data, subjects had to repeat a block if they failed more than 6 trials within the same block, thereby setting a performance threshold that was well above chance level. Participants could initiate a block whenever they felt ready to proceed. Within a block, the inter-trial durations were drawn uniformly between 0.5 and 1.5s. Each trial consisted of one puzzle that had to be solved within a limited time. Training trials lasted 10s each, while test trials had durations of 1.25, 2.5, and 5s. Apart from a visual cue shown 1s before the end of each trial, there was no explicit feedback communicating the trial length. Therefore, subjects did not know the duration of individual test trials beforehand and thus could not use this information in their solution strategy. A trial was considered successful only if all the clauses of the puzzle were satisfied. 2More precisely, the 2-SAT and SAT problems are NL- and NP-complete respectively. This means that every other decision problem within the same complexity class can be reduced (i.e. rephrased) as a SAT problem. 3 4 Analysis The recorded data D consists of a set of tuples (x, r, y), where x ∈X is a stimulus, r ∈R is a resource parameter (i.e. duration), and y ∈Y a choice. In order to analyze the data, we made the following assumptions: 1. Transient regime: During the training trials, the subjects converged to a set of subjective preferences over the choices which depended only on the stimuli. 2. Permanent regime: During the test trials, subjects did not significantly change the preferences that they learned during the training trials. Specifically, choices in the same stimulusduration group were i.i.d. throughout the test phase. 3. Negligible noise: We assumed that the operation of the input device and the cue signaling the imminent end of the trial did not have a significant impact on the distribution over choices. Our analysis only focused only the test trials. Let P(x, r, y) denote the empirical probabilities3 of the tuples (x, r, y) estimated from the data. From these, we derived the probability distribution P(x, r) over the stimulus-resource context, the prior P(y) over choices, and the posterior P(y|x, r) over choices given the context through marginalization and conditioning. 4.1 Inferring Preferences By fitting the model, we decomposed the choice probabilities into: (a) an inverse temperature function β : R →R; and (b) a set of subjective utility functions Ux : Y →R, one for each stimulus x. We assumed that the sets X, R, and Y were finite, and we used vector representations for β and the Ux. To perform the decomposition, we minimized the average Kullback-Leibler divergence J = X x,r P(x, r) X y P(y|x, r) log P(y|x, r) Q(y|x, r)  , (6) w.r.t. the inverse temperatures β(r) and the utilities Ux(y) through the probabilities Q(y|x, r) of the choice y given the context (x, r) as derived from the Gibbs distribution Q(y|x, r) = 1 Zβ P(y) exp n β(r)Ux(y) o , (7) where Zβ is the normalizing constant. We used the objective function (6) because it is the Bregman divergence over the simplex of choice probabilities [1]. Thus, by minimizing the objective function (6) we were seeking a decomposition such that the Shannon information contents of P(y|x, r) and Q(y|x, r) were matched against each other in expectation. We minimized (6) using gradient descent. For this, we first rewrote (6) as J = X x,β,y P(x, r, y)  log P(y|x, r) P(y) −β(r)Ux(y) + log Zβ  to expose the coordinates of the exponential manifold and then calculated the gradient. The partial derivatives of J w.r.t. β(r) and Ux(y) are equal to ∂J ∂β(r) = X x,y P(x, r) X y h Q(y|x, r) −P(y|x, r) i Ux(y) (8) and ∂J ∂Ux(y) = X x,y P(x, r) h Q(y|x, r) −P(y|x, r) i β(r) (9) respectively. The Gibbs distribution (7) admits an infinite number of decompositions, and therefore we had to fix the scaling factor and the offset to obtain a unique solution. The scale was set by clamping the value of β(r0) = β0 for an arbitrarily chosen resource parameter r0 ∈R; we used 3More precisely, P(x, r, y) ∝N(x, r, y) + 1, where N(x, r, y) is the count of ocurrences of (x, r, y). 4 β(r0) = 1 for r0 = 1s. The offset was fixed by normalizing the utilities. A simple way to achieve this is by subtracting the certainty-equivalent from the utilities, i.e. for all (x, y), Ux(y) ←Ux(y) − 1 β(r0) log X y P(y) exp n β(r0)Ux(y) o . (10) Utilities normalized in this way are proportional to the negative regret (see Section 2) and thus have an intuitive interpretation as modulators of change of the choice distribution. The resulting decomposition algorithm repeats the following two steps until convergence: first it updates the inverse temperature and utility functions using gradient descent, i.e. β(r) ←−β(r) −ηt ∂J ∂β(r) and Ux(y) ←−Ux(y) −ηt ∂J ∂Ux(y) (11) for all (r, x, y) ∈R × X × Y ; and seconds it projects the parameters back onto a standard submanifold by setting r = r0 and normalizing the utilities in each iteration using (10). For the learning rate ηt > 0, we choose a simple schedule that satisfied the Robbins-Monro conditions P t ηt = ∞and P t η2 t < ∞. 4.2 Expected Utility and Decision Bandwidth The inferred model is useful for investigating the decision-maker’s performance under different settings of the resource parameter—in particular, to determine the asymptotic performance limits. Two quantities are of special interest: the expected utility averaged over the stimuli and the mutual information between the stimulus and the choice, both as functions of the inverse temperature β. Given β, we define these quantities as EUβ := X x,y P(x)Qβ(y|x)Ux(y) and Iβ := X x,y P(x)Qβ(y|x) log Qβ(y|x) Qβ(y) (12) respectively. Both definitions are based on the joint distribution P(x)Qβ(y|x) in which Qβ(y|x) ∝ P(y) exp{βUx(x)} is the Gibbs distribution derived from the prior P(y) and the utility functions Ux(y). The marginal over choices is given by Qβ(y) = P x P(x)Qβ(y|x). The mutual information Iβ is a measure of the decision bandwidth, because it quantifies the average amount of information that the subject has to extract from the stimulus in order to produce the choice. 5 Results 5.1 Decomposition into prior, utility, and inverse temperature For each one of the 30 subjects, we first calculated the empirical choice probabilities and then estimated their decomposition into an inverse temperature β and utility functions Ux using the procedure detailed in the previous section. The mean error of the fit was very low (0.0347 ± 0.0024 bits), implying that the choice probabilities are well explained by the model. As an example, Fig. 2 shows the decomposition for subject 1 (error 0.0469 bits, 83% percentile rank) along with a comparison between the empirical posterior and the model posterior calculated from the inferred components using equation (7). As durations become longer and β increases, the model captures the gradual shift from the prior towards the optimal choice distribution. As seen in Fig. 3, the resulting decomposition is stable and shows little variability across subjects. The stimuli of version B of the experiment differed from version A only in that they were colorinverted, leading to mirror-symmetric decompositions of the prior and the utility functions. The results suggest the following trends: • Prior: Compared to the true distribution over solutions, subjects tended to concentrate their choices slightly more on the most frequent optimal solution (i.e. either y = 2 or y = 7 for version A or B respectively) and on the all-black or all-white solution (either y = 1 or y = 8). 5 x = 2 Empirical Model Optimum Empirical True Time [s] Choice [id] Stimulus Utility Posterior x = 1 x = 4 x = 6 x = 7* Prior Inv. Temperature 9/19 3/19 3/19 3/19 1/19 Figure 2: Decomposition of subject 1’s posterior choice probabilities. Each row corresponds to a different puzzle. The left column shows each puzzle’s stimulus and optimal choice. The posterior distributions P(y|x, β) were decomposed into a prior P(y); a set of time-dependent inverse temperatures βr; and a set of stimulus-dependent utility functions Ux over choices, normalized relative to the certainty-equivalent (10). The plots compare the subject’s empirical frequencies against the model fit (in the posterior plots) or against the true optimal choice probabilities (in the prior plot). The stimuli are shown on the left (more specifically, one out of the 6! arrangement of patches) along with their probability. Note that the untrained stimulus x = 7 is the color-inverse of x = 2. • Inverse temperature: The inverse temperature increases monotonically with longer durations, and the dependency is approximately linear in log-time (Fig. 2 and 3). • Utility functions: In the case of the stimuli that subjects were trained in (namely, x ∈ {1, 2, 4, 6}), the maximum subjective utility coincides with the solution of the puzzle. Notice that some choices are enhanced while others are suppressed according to their subjective utility function. Especially the choice for the most frequent stimulus (x = 2) is suppressed when it is suboptimal. In the case of the untrained stimulus (x = 7), the utility function is comparatively flat and variable across subjects. Finally, as a comparison, we also computed the decomposition assuming a Softmax function (or Boltzmann distribution): Q(y|x, r) = 1 Zβ exp n β(r)Ux(y) o . (13) The mean error of the resulting fit was significantly worse (error 0.0498 ± 0.0032 bits) than the one based on (7), implying that the inclusion of the prior choice probabilities P(y) improves the explanation of the choice data. 6 x = 2 Time [s] Choice [id] Version A Utility x = 1 x = 4 x = 6 x = 7* Prior Inverse Temperature Choice [id] Version B Optimum Figure 3: Summary of inferred preferences across all subjects. The two rows depict the results for the two versions of the experiment, each one averaged over 15 subjects. The stimuli of both versions are the same but with their colors inverted, resulting in a mirror symmetry along the vertical axis. The figure shows the inferred utility functions (normalized to the certainty-equivalent); the inverse temperatures; and the prior over choices. Optimal choices are highlighted in gray. Error bars denote one standard deviation. 0.652 1.792 100.00 % Correct Mutual Information Expected Utility Subject 1 Average 0.688 1.783 95.68 Figure 4: Extrapolation of the performance measures. The panels show the expected utility EUβ, the mutual information Iβ, and the expected percentage of correct choices as a function of the inverse temperature β. The top and bottom rows correspond to subject 1 and the averaged subjects respectively. Each plot shows the performance measure obtained from the empirical choice probabilities (blue markers) and the choice probabilities derived from the model (red curve) together with the maximum attainable value (dotted red). 5.2 Extrapolation of performance measures We calculated the expected utility and the mutual information as a function of the inverse temperature using (12). The resulting curves for subject 1 and the average subject are shown in Fig. 4 together with the predicted percentage of correct choices. All the curves are monotonically increasing and upper bounded. The expected utility and the percentage of correct choices are concave in the inverse temperature, indicating marginally diminishing returns with longer durations. Similarly, the mutual information approaches asymptotically the upper bound set by the stimulus entropy H(X) ≈1.792 bits (excluding the untrained stimulus). 7 6 Discussion and Conclusion It has long been recognized that the model of perfect rationality does not adequately capture human decision-making because it neglects the numerous resource limitations that prevent the selection of the optimal choice [13]. In this work, we considered a model of bounded-rational decision-making inspired by ideas from statistical mechanics and information-theory. A distinctive feature of this model is the interplay between the decision-maker’s preferences, a prior distribution over choices, and a resource parameter. To test the model, we conducted an experiment in which participants had to solve puzzles under time pressure. The experimental results are very well predicted by the model, which allows us to draw the following conclusions: 1. Prior: When the decision-making resources decrease, people’s choices fall back on a prior distribution. This conclusion is supported by two observations. First, the bounded-rational model explains the gradual shift of the subjects’ choice probabilities towards the prior as the duration of the trial is reduced (e.g. Fig.2). Second, the model fit obtained by the Softmax rule (13), which differs from the bounded rational model (7) only by the lack of a prior distribution, has a significantly larger error. Thus, our results conflict with the predictions made by models that lack a prior choice distribution—most notably with expected utility theory [11, 17] and the choice models based on the Softmax function (typical in reinforcement learning, but also in e.g. the logit rule of quantal response equilibria [5] or in maximum entropy inverse reinforcement learning [18]). 2. Utility and Inverse Temperature: Posterior choice probabilities can be meaningfully parameterized in terms of utilities (which capture the decision-maker’s preferences) and inverse temperatures (which encode resource constraints). This is evidenced by the quality of the fit and the cogent operational role of the parameters. Utilities are stimulus-contingent enhancers/inhibitors that act upon the prior choice probabilities, consistent with the role of utility as a measure of relative desirability in regret theory [3] and also related to the cognitive functions attributed to the dorsal anterior cingulate cortex [12]. On the other hand, the inverse temperature captures a determinant factor of choice behavior that is independent of the preferences—mathematically embodied in the low-rank assumption of the log-likelihood function that we used for the decomposition in the analysis. This assumption does not comply with the necessary conditions for rational meta-reasoning, wherein decision-makers can utilize the knowledge about their own resources in their strategy [7]. 3. Preference Learning: Utilities are learned from experience. As is seen in the utility functions of Fig. 3, subjects did not learn the optimal choice of the untrained stimulus (i.e. x = 7) in spite of being just a simple color-inversion of the most frequent stimulus (i.e. x = 2). Our experiment did not address the mechanisms that underlie the acquisition of preferences. However, given that the information necessary to establish a link between the stimulus and the optimal choice is below two bits (that is, far below the 3 2  · 22 · 6 = 72 bits necessary to represent an arbitrary member of the considered class of puzzles), it is likely that the training phase had subjects synthesize perceptual features that allowed them to efficiently identify the optimal solution. Other avenues are explored in [14, 15] and references therein. 4. Diminishing returns: The decision-maker’s performance is marginally diminishing in the amount of resources. This is seen in the concavity of the expected utility curve (Fig. 4; similarly in the percentage of correct choices) combined with the sub-linear growth of the inverse temperature as a function of the duration (Fig. 3). For most subjects, the model predicts a perfectly-rational choice behavior in the limit of unbounded trial duration. In summary, in this work we have shown empirically that the model of bounded rationality provides an adequate explanatory framework for resource-constrained decision-making in humans. Using a challenging cognitive task in which we could control the time available to arrive at a choice, we have shown that human decision-making can be explained in terms of a trade-off between the gains of maximizing subjective utilities and the losses due to the deviation from a prior choice distribution. Acknowledgements This work was supported by the Office of Naval Research (Grant N000141110744) and the University of Pennsylvania. 8 References [1] A. Banerjee, S. Merugu, I. S. Dhillon, and J. Ghosh. Clustering with Bregman Divergences. Journal of Machine Learning Research, 6:1705–1749, 2005. [2] D.E. Bell. Regret in decision making under uncertainty. Operations Research, 33:961–981, 1982. [3] H. Bleichrodt and P. P. Wakker. Regret theory: A bold alternative to the alternatives. The Economic Journal, 125(583):493–532, 2015. [4] P.C. Fishburn. The Foundations of Expected Utility. D. Reidel Publishing, Dordrecht, 1982. [5] J.W. Friedman and C. Mezzetti. Random belief equilibrium in normal form games. Games and Economic Behavior, 51(2):296–323, 2005. [6] G. Gigerenzer and R. Selten. Bounded rationality: the adaptive toolbox. MIT Press, Cambridge, MA, 2001. [7] F. Lieder, D. Plunkett, J. B. Hamrick, S. J. Russell, N. Hay, and T. Griffiths. Algorithm selection by rational metareasoning as a model of human strategy selection. Advances in Neural Information Processing Systems, pages 2870–2878, 2014. [8] G. Loomes and R. Sugden. Regret theory: An alternative approach to rational choice under uncertainty. Economic Journal, 92:805–824, 1982. [9] P. A. Ortega and D. A. Braun. Thermodynamics as a theory of decision-making with informationprocessing costs. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Science, 469(2153), 2013. [10] A. Rubinstein. Modeling bounded rationality. MIT Press, 1998. [11] L.J. Savage. The Foundations of Statistics. John Wiley and Sons, New York, 1954. [12] A. Shenhav, M. M. Botvinick, and J. D. Cohen. The expected value of control: an integrative theory of anterior cingulate cortex function. Neuron, 79:217–240., 2013. [13] H. Simon. Models of Bounded Rationality. MIT Press, Cambridge, MA, 1984. [14] N. Srivastava and P. R. Schrater. Rational inference of relative preferences. Advances in neural information processing systems, 2012. [15] N. Srivastava, E. Vul, and P. R. Schrater. Magnitude-sensitive preference formation. Advances in neural information processing systems, 2014. [16] N. Tishby and D. Polani. Information Theory of Decisions and Actions. In Hussain Taylor Vassilis, editor, Perception-reason-action cycle: Models, algorithms and systems. Springer, Berlin, 2011. [17] J. Von Neumann and O. Morgenstern. Theory of Games and Economic Behavior. Princeton University Press, Princeton, 1944. [18] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey. Maximum Entropy Inverse Reinforcement Learning. In AAAI, pages 1433–1438, 2008. 9
2016
560
6,506
End-to-End Kernel Learning with Supervised Convolutional Kernel Networks Julien Mairal Inria∗ julien.mairal@inria.fr Abstract In this paper, we introduce a new image representation based on a multilayer kernel machine. Unlike traditional kernel methods where data representation is decoupled from the prediction task, we learn how to shape the kernel with supervision. We proceed by first proposing improvements of the recently-introduced convolutional kernel networks (CKNs) in the context of unsupervised learning; then, we derive backpropagation rules to take advantage of labeled training data. The resulting model is a new type of convolutional neural network, where optimizing the filters at each layer is equivalent to learning a linear subspace in a reproducing kernel Hilbert space (RKHS). We show that our method achieves reasonably competitive performance for image classification on some standard “deep learning” datasets such as CIFAR-10 and SVHN, and also for image super-resolution, demonstrating the applicability of our approach to a large variety of image-related tasks. 1 Introduction In the past years, deep neural networks such as convolutional or recurrent ones have become highly popular for solving various prediction problems, notably in computer vision and natural language processing. Conceptually close to approaches that were developed several decades ago (see, [13]), they greatly benefit from the large amounts of labeled data that have been made available recently, allowing to learn huge numbers of model parameters without worrying too much about overfitting. Among other reasons explaining their success, the engineering effort of the deep learning community and various methodological improvements have made it possible to learn in a day on a GPU complex models that would have required weeks of computations on a traditional CPU (see, e.g., [10, 12, 23]). Before the resurgence of neural networks, non-parametric models based on positive definite kernels were one of the most dominant topics in machine learning [22]. These approaches are still widely used today because of several attractive features. Kernel methods are indeed versatile; as long as a positive definite kernel is specified for the type of data considered—e.g., vectors, sequences, graphs, or sets—a large class of machine learning algorithms originally defined for linear models may be used. This family include supervised formulations such as support vector machines and unsupervised ones such as principal or canonical component analysis, or K-means and spectral clustering. The problem of data representation is thus decoupled from that of learning theory and algorithms. Kernel methods also admit natural mechanisms to control the learning capacity and reduce overfitting [22]. On the other hand, traditional kernel methods suffer from several drawbacks. The first one is their computational complexity, which grows quadratically with the sample size due to the computation of the Gram matrix. Fortunately, significant progress has been achieved to solve the scalability issue, either by exploiting low-rank approximations of the kernel matrix [28, 31], or with random sampling techniques for shift-invariant kernels [21]. The second disadvantage is more critical; by decoupling ∗Thoth team, Inria Grenoble, Laboratoire Jean Kuntzmann, CNRS, Univ. Grenoble Alpes, France. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. learning and data representation, kernel methods seem by nature incompatible with end-to-end learning—that is, the representation of data adapted to the task at hand, which is the cornerstone of deep neural networks and one of the main reason of their success. The main objective of this paper is precisely to tackle this issue in the context of image modeling. Specifically, our approach is based on convolutional kernel networks, which have been recently introduced in [18]. Similar to hierarchical kernel descriptors [3], local image neighborhoods are mapped to points in a reproducing kernel Hilbert space via the kernel trick. Then, hierarchical representations are built via kernel compositions, producing a sequence of “feature maps” akin to convolutional neural networks, but of infinite dimension. To make the image model computationally tractable, convolutional kernel networks provide an approximation scheme that can be interpreted as a particular type of convolutional neural network learned without supervision. To perform end-to-end learning given labeled data, we use a simple but effective principle consisting of learning discriminative subspaces in RKHSs, where we project data. We implement this idea in the context of convolutional kernel networks, where linear subspaces, one per layer, are jointly optimized by minimizing a supervised loss function. The formulation turns out to be a new type of convolutional neural network with a non-standard parametrization. The network also admits simple principles to learn without supervision: learning the subspaces may be indeed achieved efficiently with classical kernel approximation techniques [28, 31]. To demonstrate the effectiveness of our approach in various contexts, we consider image classification benchmarks such as CIFAR-10 [12] and SVHN [19], which are often used to evaluate deep neural networks; then, we adapt our model to perform image super-resolution, which is a challenging inverse problem. On the SVHN and CIFAR-10 datasets, we obtain a competitive accuracy, with about 2% and 10% error rates, respectively, without model averaging or data augmentation. For image up-scaling, we outperform recent approaches based on classical convolutional neural networks [7, 8]. We believe that these results are highly promising. Our image model achieves competitive performance in two different contexts, paving the way to many other applications. Moreover, our results are also subject to improvements. In particular, we did not use GPUs yet, which has limited our ability to exhaustively explore model hyper-parameters and evaluate the accuracy of large networks. We also did not investigate classical regularization/optimization techniques such as Dropout [12], batch normalization [11], or recent advances allowing to train very deep networks [10, 23]. To gain more scalability and start exploring these directions, we are currently working on a GPU implementation, which we plan to publicly release along with our current CPU implementation. Related Deep and Shallow Kernel Machines. One of our goals is to make a bridge between kernel methods and deep networks, and ideally reach the best of both worlds. Given the potentially attractive features of such a combination, several attempts have been made in the past to unify these two schools of thought. A first proof of concept was introduced in [5] with the arc-cosine kernel, which admits an integral representation that can be interpreted as a one-layer neural network with random weights and infinite number of rectified linear units. Besides, a multilayer kernel may be obtained by kernel compositions [5]. Then, hierarchical kernel descriptors [3] and convolutional kernel networks [18] extend a similar idea in the context of images leading to unsupervised representations [18]. Multiple kernel learning [24] is also related to our work since is it is a notable attempt to introduce supervision in the kernel design. It provides techniques to select a combination of kernels from a predefined collection, and typically requires to have already “good” kernels in the collection to perform well. More related to our work, the backpropagation algorithm for the Fisher kernel introduced in [25] learns the parameters of a Gaussian mixture model with supervision. In comparison, our approach does not require a probabilistic model and learns parameters at several layers. Finally, we note that a concurrent effort to ours is conducted in the Bayesian community with deep Gaussian processes [6], complementing the Frequentist approach that we follow in our paper. 2 Learning Hierarchies of Subspaces with Convolutional Kernel Networks In this section, we present the principles of convolutional kernel networks and a few generalizations and improvements of the original approach of [18]. Essentially, the model builds upon four ideas that are detailed below and that are illustrated in Figure 1 for a model with a single layer. 2 Idea 1: use the kernel trick to represent local image neighborhoods in a RKHS. Given a set X, a positive definite kernel K : X × X →R implicitly defines a Hilbert space H, called reproducing kernel Hilbert space (RKHS), along with a mapping ϕ : X →H. This embedding is such that the kernel value K(x, x′) corresponds to the inner product ⟨ϕ(x), ϕ(x′)⟩H. Called “kernel trick”, this approach can be used to obtain nonlinear representations of local image patches [3, 18]. More precisely, consider an image I0 : Ω0 →Rp0, where p0 is the number of channels, e.g., p0 = 3 for RGB, and Ω0 ⊂[0, 1]2 is a set of pixel coordinates, typically a two-dimensional grid. Given two image patches x, x′ of size e0 × e0, represented as vectors in Rp0e2 0, we define a kernel K1 as K1(x, x′) = ∥x∥∥x′∥κ1 D x ∥x∥, x′ ∥x′∥ E if x, x′ ̸= 0 and 0 otherwise, (1) where ∥.∥and ⟨., .⟩denote the usual Euclidean norm and inner-product, respectively, and κ1(⟨., .⟩) is a dot-product kernel on the sphere. Specifically, κ1 should be smooth and its Taylor expansion have non-negative coefficients to ensure positive definiteness [22]. For example, the arc-cosine [5] or the Gaussian (RBF) kernels may be used: given two vectors y, y′ with unit ℓ2-norm, choose for instance κ1(⟨y, y′⟩) = eα1(⟨y,y′⟩−1) = e−α1 2 ∥y−y′∥2 2. (2) Then, we have implicitly defined the RKHS H1 associated to K1 and a mapping ϕ1 : Rp0e2 0 →H1. Idea 2: project onto a finite-dimensional subspace of the RKHS with convolution layers. The representation of patches in a RKHS requires finite-dimensional approximations to be computationally manageable. The original model of [18] does that by exploiting an integral form of the RBF kernel. Specifically, given two patches x and x′, convolutional kernel networks provide two vectors ψ1(x), ψ1(x′) in Rp1 such that the kernel value ⟨ϕ1(x), ϕ1(x′)⟩H1 is close to the Euclidean inner product ⟨ψ1(x), ψ1(x′)⟩. After applying this transformation to all overlapping patches of the input image I0, a spatial map M1 : Ω0 →Rp1 may be obtained such that for all z in Ω0, M1(z) = ψ1(xz), where xz is the e0 × e0 patch from I0 centered at pixel location z.2 With the approximation scheme of [18], M1 can be interpreted as the output feature map of a one-layer convolutional neural network. A conceptual drawback of [18] is that data points ϕ1(x1), ϕ1(x2), . . . are approximated by vectors that do not live in the RKHS H1. This issue can be solved by using variants of the Nyström method [28], which consists of projecting data onto a subspace of H1 with finite dimension p1. For this task, we have adapted the approach of [31]: we build a database of n patches x1, . . . , xn randomly extracted from various images and normalized to have unit ℓ2-norm, and perform a spherical K-means algorithm to obtain p1 centroids z1, . . . , zp1 with unit ℓ2-norm. Then, a new patch x is approximated by its projection onto the p1-dimensional subspace F1 =Span(ϕ(z1), . . . , ϕ(zp1)). The projection of ϕ1(x) onto F1 admits a natural parametrization ψ1(x) in Rp1 . The explicit formula is classical (see [28, 31] and Appendix A), leading to ψ1(x) := ∥x∥κ1(Z⊤Z)−1/2κ1  Z⊤x ∥x∥  if x ̸= 0 and 0 otherwise, (3) where we have introduced the matrix Z = [z1, . . . , zp1], and, by an abuse of notation, the function κ1 is applied pointwise to its arguments. Then, the spatial map M1 : Ω0 →Rp1 introduced above can be obtained by (i) computing the quantities Z⊤x for all patches x of the image I (spatial convolution after mirroring the filters zj); (ii) contrast-normalization involving the norm ∥x∥; (iii) applying the pointwise non-linear function κ1; (iv) applying the linear transform κ1(Z⊤Z)−1/2 at every pixel location (which may be seen as 1×1 spatial convolution); (v) multiplying by the norm ∥x∥making ψ1 homogeneous. In other words, we obtain a particular convolutional neural network, with non-standard parametrization. Note that learning requires only performing a K-means algorithm and computing the inverse square-root matrix κ1(Z⊤Z)−1/2; therefore, the training procedure is very fast. Then, it is worth noting that the encoding function ψ1 with kernel (2) is reminiscent of radial basis function networks (RBFNs) [4], whose hidden layer resembles (3) without the matrix κ1(Z⊤Z)−1/2 and with no normalization. The difference between RBFNs and our model is nevertheless significant. The RKHS mapping, which is absent from RBFNs, is indeed a key to the multilayer construction that will be presented shortly: a network layer takes points from the RKHS’s previous layer as input and use the corresponding RKHS inner-product. To the best of our knowledge, there is no similar multilayer and/or convolutional construction in the radial basis function network literature. 2To simplify, we use zero-padding when patches are close to the image boundaries, but this is optional. 3 I0 x x′ kernel trick projection on F1 M1 ψ1(x) ψ1(x′) I1 linear pooling Hilbert space H1 F1 ϕ1(x) ϕ1(x′) Figure 1: Our variant of convolutional kernel networks, illustrated between layers 0 and 1. Local patches (receptive fields) are mapped to the RKHS H1 via the kernel trick and then projected to the finite-dimensional subspace F1 =Span(ϕ(z1), . . . , ϕ(zp1)). The small blue crosses on the right represent the points ϕ(z1), . . . , ϕ(zp1). With no supervision, optimizing F1 consists of minimizing projection residuals. With supervision, the subspace is optimized via back-propagation. Going from layer k to layer k + 1 is achieved by stacking the model described here and shifting indices. Idea 3: linear pooling in F1 is equivalent to linear pooling on the finite-dimensional map M1. The previous steps transform an image I0 : Ω0 →Rp0 into a map M1 : Ω0 →Rp1, where each vector M1(z) in Rp1 encodes a point in F1 representing information of a local image neighborhood centered at location z. Then, convolutional kernel networks involve a pooling step to gain invariance to small shifts, leading to another finite-dimensional map I1 : Ω1 →Rp1 with smaller resolution: I1(z) = X z′∈Ω0 M1(z′)e−β1∥z′−z∥2 2. (4) The Gaussian weights act as an anti-aliasing filter for downsampling the map M1 and β1 is set according to the desired subsampling factor (see [18]), which does not need to be integer. Then, every point I1(z) in Rp1 may be interpreted as a linear combination of points in F1, which is itself in F1 since F1 is a linear subspace. Note that the linear pooling step was originally motivated in [18] as an approximation scheme for a match kernel, but this point of view is not critically important here. Idea 4: build a multilayer image representation by stacking and composing kernels. By following the first three principles described above, the input image I0 : Ω0 →Rp0 is transformed into another one I1 : Ω1 →Rp1. It is then straightforward to apply again the same procedure to obtain another map I2 : Ω2 →Rp2, then I3 : Ω3 →Rp3, etc. By going up in the hierarchy, the vectors Ik(z) in Rpk represent larger and larger image neighborhoods (aka. receptive fields) with more invariance gained by the pooling layers, akin to classical convolutional neural networks. The multilayer scheme produces a sequence of maps (Ik)k≥0, where each vector Ik(z) encodes a point—say fk(z)—in the linear subspace Fk of Hk. Thus, we implicitly represent an image at layer k as a spatial map fk : Ωk →Hk such that ⟨Ik(z), I′ k(z′)⟩= ⟨fk(z), f ′ k(z′)⟩Hk for all z, z′. As mentioned previously, the mapping to the RKHS is a key to the multilayer construction. Given Ik, larger image neighborhoods are represented by patches of size ek × ek that can be mapped to a point in the Cartesian product space Hek×ek k endowed with its natural inner-product; finally, the kernel Kk+1 defined on these patches can be seen as a kernel on larger image neighborhoods than Kk. 3 End-to-End Kernel Learning with Supervised CKNs In the previous section, we have described a variant of convolutional kernel networks where linear subspaces are learned at every layer. This is achieved without supervision by a K-means algorithm leading to small projection residuals. It is thus natural to introduce also a discriminative approach. 4 3.1 Backpropagation Rules for Convolutional Kernel Networks We now consider a prediction task, where we are given a training set of images I1 0, I2 0, . . . , In 0 with respective scalar labels y1, . . . , yn living either in {−1; +1} for binary classification and R for regression. For simplicity, we only present these two settings here, but extensions to multiclass classification and multivariate regression are straightforward. We also assume that we are given a smooth convex loss function L : R × R →R that measures the fit of a prediction to the true label y. Given a positive definite kernel K on images, the classical empirical risk minimization formulation consists of finding a prediction function in the RKHS H associated to K by minimizing the objective min f∈H 1 n n X i=1 L(yi, f(Ii 0)) + λ 2 ∥f∥2 H, (5) where the parameter λ controls the smoothness of the prediction function f with respect to the geometry induced by the kernel, hence regularizing and reducing overfitting [22]. After training a convolutional kernel network with k layers, such a positive definite kernel may be defined as KZ(I0, I′ 0) = X z∈Ωk ⟨fk(z), f ′ k(z)⟩Hk = X z∈Ωk ⟨Ik(z), I′ k(z)⟩, (6) where Ik, I′ k are the k-th finite-dimensional feature maps of I0, I′ 0, respectively, and fk, f ′ k the corresponding maps in Ωk →Hk, which have been defined in the previous section. The kernel is also indexed by Z, which represents the network parameters—that is, the subspaces F1, . . . , Fk, or equivalently the set of filters Z1, . . . , Zk from Eq. (3). Then, formulation (5) becomes equivalent to min W∈Rpk×|Ωk| 1 n n X i=1 L(yi, ⟨W, Ii k⟩) + λ 2 ∥W∥2 F, (7) where ∥.∥F is the Frobenius norm that extends the Euclidean norm to matrices, and, with an abuse of notation, the maps Ii k are seen as matrices in Rpk×|Ωk|. Then, the supervised convolutional kernel network formulation consists of jointly minimizing (7) with respect to W in Rpk×|Ωk| and with respect to the set of filters Z1, . . . , Zk, whose columns are constrained to be on the Euclidean sphere. Computing the derivative with respect to the filters Z1, . . . , Zk. Since we consider a smooth loss function L, e.g., logistic, squared hinge, or square loss, optimizing (7) with respect to W can be achieved with any gradient-based method. Moreover, when L is convex, we may also use fast dedicated solvers, (see, e.g., [16], and references therein). Optimizing with respect to the filters Zj, j = 1, . . . , k is more involved because of the lack of convexity. Yet, the objective function is differentiable, and there is hope to find a “good” stationary point by using classical stochastic optimization techniques that have been successful for training deep networks. For that, we need to compute the gradient by using the chain rule—also called “backpropagation” [13]. We instantiate this rule in the next lemma, which we have found useful to simplify the calculation. Lemma 1 (Perturbation view of backpropagration.) Consider an image I0 represented here as a matrix in Rp0×|Ω0|, associated to a label y in R and call IZ k the k-th feature map obtained by encoding I0 with the network parameters Z. Then, consider a perturbation E = {ε1, . . . , εk} of the set of filters Z. Assume that we have for all j ≥0, IZ+E j = IZ j + ∆IZ,E j + o(∥E∥), (8) where ∥E∥is equal to Pk l=1 ∥εl∥F, and ∆IZ,E j is a matrix in Rpj×|Ωj| such that for all matrices U of the same size, ⟨∆IZ,E j , U⟩= ⟨εj, gj(U)⟩+ ⟨∆IZ,E j−1, hj(U)⟩, (9) where the inner-product is the Frobenius’s one and gj, hj are linear functions. Then, ∇ZjL(y, ⟨W, IZ k ⟩) = L′(y, ⟨W, IZ k ⟩) gj(hj+1(. . . hk(W)), (10) where L′ denote the derivative of the smooth function L with respect to its second argument. The proof of this lemma is straightforward and follows from the definition of the Fréchet derivative. Nevertheless, it is useful to derive the closed form of the gradient in the next proposition. 5 Proposition 1 (Gradient of the loss with respect to the the filters Z1, . . . , Zk.) Consider the quantities introduced in Lemma 1, but denote IZ j by Ij for simplicity. By construction, we have for all j ≥1, Ij = Ajκj(Z⊤ j Ej(Ij−1)S−1 j )SjPj, (11) where Ij is seen as a matrix in Rpj×|Ωj|; Ej is the linear operator that extracts all overlapping ej−1 × ej−1 patches from a map such that Ej(Ij−1) is a matrix of size pj−1e2 j−1 × |Ωj−1|; Sj is a diagonal matrix whose diagonal entries carry the ℓ2-norm of the columns of Ej(Ij−1); Aj is short for κj(Z⊤ j Zj)−1/2; and Pj is a matrix of size |Ωj−1|×|Ωj| performing the linear pooling operation. Then, the gradient of the loss with respect to the filters Zj, j = 1, . . . , k is given by (10) with gj(U) = Ej(Ij−1)B⊤ j −1 2Zj κ′ j(Z⊤ j Zj) ⊙(Cj + C⊤ j )  hj(U) = E⋆ j ZjBj + Ej(Ij−1) S−2 j ⊙ M ⊤ j UP⊤ j −Ej(Ij−1)⊤ZjBj  , (12) where U is any matrix of the same size as Ij, Mj = Ajκj(Z⊤ j Ej(Ij−1)S−1 j )Sj is the j-th feature map before the pooling step, ⊙is the Hadamart (elementwise) product, E⋆ j is the adjoint of Ej, and Bj = κ′ j Z⊤ j Ej(Ij−1)S−1 j  ⊙ AjUP⊤ j  and Cj = A1/2 j IjU⊤A3/2 j . (13) The proof is presented in Appendix B. Most quantities that appear above admit physical interpretations: multiplication by Pj performs downsampling; multiplication by P⊤ j performs upsampling; multiplication of Ej(Ij−1) on the right by S−1 j performs ℓ2-normalization of the columns; Z⊤ j Ej(Ij−1) can be seen as a spatial convolution of the map Ij−1 by the filters Zj; finally, E⋆ j “combines” a set of patches into a spatial map by adding to each pixel location the respective patch contributions. Computing the gradient requires a forward pass to obtain the maps Ij through (11) and a backward pass that composes the functions gj, hj as in (10). The complexity of the forward step is dominated by the convolutions Z⊤ j Ej(Ij−1), as in convolutional neural networks. The cost of the backward pass is the same as the forward one up to a constant factor. Assuming pj ≤|Ωj−1|, which is typical for lower layers that require more computation than upper ones, the most expensive cost is due to Ej(Ij−1)B⊤ j and ZjBj which is the same as Z⊤ j Ej(Ij−1). We also pre-compute A1/2 j and A3/2 j by eigenvalue decompositions, whose cost is reasonable when performed only once per minibatch. Off-diagonal elements of M ⊤ j UP⊤ j −Ej(Ij−1)⊤ZjBj are also not computed since they are set to zero after elementwise multiplication with a diagonal matrix. In practice, we also replace Aj by (κj(Z⊤ j Zj) + εI)−1/2 with ε = 0.001, which corresponds to performing a regularized projection onto Fj (see Appendix A). Finally, a small offset of 0.00001 is added to the diagonal entries of Sj. Optimizing hyper-parameters for RBF kernels. When using the kernel (2), the objective is differentiable with respect to the hyper-parameters αj. When large amounts of training data are available and overfitting is not a issue, optimizing the training loss by taking gradient steps with respect to these parameters seems appropriate instead of using a canonical parameter value. Otherwise, more involved techniques may be needed; we plan to investigate other strategies in future work. 3.2 Optimization and Practical Heuristics The backpropagation rules of the previous section have set up the stage for using a stochastic gradient descent method (SGD). We now present a few strategies to accelerate it in our context. Hybrid convex/non-convex optimization. Recently, many incremental optimization techniques have been proposed for solving convex optimization problems of the form (7) when n is large but finite (see [16] and references therein). These methods usually provide a great speed-up over the stochastic gradient descent algorithm without suffering from the burden of choosing a learning rate. The price to pay is that they rely on convexity, and they require storing into memory the full training set. For solving (7) with fixed network parameters Z, it means storing the n maps Ii k, which is often reasonable if we do not use data augmentation. To partially leverage these fast algorithms for our non-convex problem, we have adopted a minimization scheme that alternates between two steps: (i) fix Z, then make a forward pass on the data to compute the n maps Ii k and minimize the convex problem (7) with respect to W using the accelerated MISO algorithm [16]; (ii) fix W, then make one pass of a projected stochastic gradient algorithm to update the k set of filters Zj. The set of network parameters Z is initialized with the unsupervised learning method described in Section 2. 6 Preconditioning on the sphere. The kernels κj are defined on the sphere; therefore, it is natural to constrain the filters—that is, the columns of the matrices Zj—to have unit ℓ2-norm. As a result, a classical stochastic gradient descent algorithm updates at iteration t each filter z as follows z ← Proj∥.∥2=1[z−ηt∇zLt], where ∇zLt is an estimate of the gradient computed on a minibatch and ηt is a learning rate. In practice, we found that convergence could be accelerated by preconditioning, which consists of optimizing after a change of variable to reduce the correlation of gradient entries. For unconstrained optimization, this heuristic involves choosing a symmetric positive definite matrix Q and replacing the update direction ∇zLt by Q∇zLt, or, equivalently, performing the change of variable z = Q1/2z′ and optimizing over z′. When constraints are present, the case is not as simple since Q∇zLt may not be a descent direction. Fortunately, it is possible to exploit the manifold structure of the constraint set (here, the sphere) to perform an appropriate update [1]. Concretely, (i) we choose a matrix Q per layer that is equal to the inverse covariance matrix of the patches from the same layer computed after the initialization of the network parameters. (ii) We perform stochastic gradient descent steps on the sphere manifold after the change of variable z = Q1/2z′, leading to the update z ←Proj∥.∥2=1[z −ηt(I −(1/z⊤Qz)Qzz⊤)Q∇zLt]. Because this heuristic is not a critical component, but simply an improvement of SGD, we relegate mathematical details in Appendix C. Automatic learning rate tuning. Choosing the right learning rate in stochastic optimization is still an important issue despite the large amount of work existing on the topic, see, e.g., [13] and references therein. In our paper, we use the following basic heuristic: the initial learning rate ηt is chosen “large enough”; then, the training loss is evaluated after each update of the weights W. When the training loss increases between two epochs, we simply divide the learning rate by two, and perform “back-tracking” by replacing the current network parameters by the previous ones. Active-set heuristic. For classification tasks, “easy” samples have often negligible contribution to the gradient (see, e.g., [13]). For instance, for the squared hinge loss L(y, ˆy) = max(0, 1 −yˆy)2, the gradient vanishes when the margin yˆy is greater than one. This motivates the following heuristic: we consider a set of active samples, initially all of them, and remove a sample from the active set as soon as we obtain zero when computing its gradient. In the subsequent optimization steps, only active samples are considered, and after each epoch, we randomly reactivate 10% of the inactive ones. 4 Experiments We now present experiments on image classification and super-resolution. All experiments were conducted on 8-core and 10-core 2.4GHz Intel CPUs using C++ and Matlab. 4.1 Image Classification on “Deep Learning” Benchmarks We consider the datasets CIFAR-10 [12] and SVHN [19], which contain 32 × 32 images from 10 classes. CIFAR-10 is medium-sized with 50 000 training samples and 10 000 test ones. SVHN is larger with 604 388 training examples and 26 032 test ones. We evaluate the performance of a 9-layer network, designed with few hyper-parameters: for each layer, we learn 512 filters and choose the RBF kernels κj defined in (2) with initial parameters αj =1/(0.52). Layers 1, 3, 5, 7, 9 use 3×3 patches and a subsampling pooling factor of √ 2 except for layer 9 where the factor is 3; Layers 2, 4, 6, 8 use simply 1 × 1 patches and no subsampling. For CIFAR-10, the parameters αj are kept fixed during training, and for SVHN, they are updated in the same way as the filters. We use the squared hinge loss in a one vs all setting to perform multi-class classification (with shared filters Z between classes). The input of the network is pre-processed with the local whitening procedure described in [20]. We use the optimization heuristics from the previous section, notably the automatic learning rate scheme, and a gradient momentum with parameter 0.9, following [12]. The regularization parameter λ and the number of epochs are set by first running the algorithm on a 80/20 validation split of the training set. λ is chosen near the canonical parameter λ = 1/n, in the range 2i/n, with i = −4, . . . , 4, and the number of epochs is at most 100. The initial learning rate is 10 with a minibatch size of 128. We present our results in Table 1 along with the performance achieved by a few recent methods without data augmentation or model voting/averaging. In this context, the best published results are obtained by the generalized pooling scheme of [14]. We achieve about 2% test error on SVHN and about 10% on CIFAR-10, which positions our method as a reasonably “competitive” one, in the same ballpark as the deeply supervised nets of [15] or network in network of [17]. 7 Table 1: Test error in percents reported by a few recent publications on the CIFAR-10 and SVHN datasets without data augmentation or model voting/averaging. Stoch P. [29] MaxOut [9] NiN [17] DSN [15] Gen P. [14] SCKN (Ours) CIFAR-10 15.13 11.68 10.41 9.69 7.62 10.20 SVHN 2.80 2.47 2.35 1.92 1.69 2.04 Due to lack of space, the results reported here only include a single supervised model. Preliminary experiments with no supervision show also that one may obtain competitive accuracy with wide shallow architectures. For instance, a two-layer network with (1024-16384) filters achieves 14.2% error on CIFAR-10. Note also that our unsupervised model outperforms original CKNs [18]. The best single model from [18] gives indeed 21.7%. Training the same architecture with our approach is two orders of magnitude faster and gives 19.3%. Another aspect we did not study is model complexity. Here as well, preliminary experiments are encouraging. Reducing the number of filters to 128 per layer yields indeed 11.95% error on CIFAR-10 and 2.15% on SVHN. A more precise comparison with no supervision and with various network complexities will be presented in another venue. 4.2 Image Super-Resolution from a Single Image Image up-scaling is a challenging problem, where convolutional neural networks have obtained significant success [7, 8, 27]. Here, we follow [8] and replace traditional convolutional neural networks by our supervised kernel machine. Specifically, RGB images are converted to the YCbCr color space and the upscaling method is applied to the luminance channel only to make the comparison possible with previous work. Then, the problem is formulated as a multivariate regression one. We build a database of 200 000 patches of size 32 × 32 randomly extracted from the BSD500 dataset [2] after removing image 302003.jpg, which overlaps with one of the test images. 16 × 16 versions of the patches are build using the Matlab function imresize, and upscaled back to 32 × 32 by using bicubic interpolation; then, the goal is to predict high-resolution images from blurry bicubic interpolations. The blurry estimates are processed by a 9-layer network, with 3 × 3 patches and 128 filters at every layer without linear pooling and zero-padding. Pixel values are predicted with a linear model applied to the 128-dimensional vectors present at every pixel location of the last layer, and we use the square loss to measure the fit. The optimization procedure and the kernels κj are identical to the ones used for processing the SVHN dataset in the classification task. The pipeline also includes a pre-processing step, where we remove from input images a local mean component obtained by convolving the images with a 5 × 5 averaging box filter; the mean component is added back after up-scaling. For the evaluation, we consider three datasets: Set5 and Set14 are standard for super-resolution; Kodim is the Kodak Image database, available at http://r0k.us/graphics/kodak/, which contains high-quality images with no compression or demoisaicing artefacts. The evaluation procedure follows [7, 8, 26, 27] by using the code from the author’s web page. We present quantitative results in Table 2. For x3 upscaling, we simply used twice our model learned for x2 upscaling, followed by a 3/4 downsampling. This is clearly suboptimal since our model is not trained to up-scale by a factor 3, but this naive approach still outperforms other baselines [7, 8, 27] that are trained end-to-end. Note that [27] also proposes a data augmentation scheme at test time that slightly improves their results. In Appendix D, we also present a visual comparison between our approach and [8], whose pipeline is the closest to ours, up to the use of a supervised kernel machine instead of CNNs. Table 2: Reconstruction accuracy for super-resolution in PSNR (the higher, the better). All CNN approaches are without data augmentation at test time. See Appendix D for the SSIM quality measure. Fact. Dataset Bicubic SC [30] ANR [26] A+[26] CNN1 [7] CNN2 [8] CSCN [27] SCKN x2 Set5 33.66 35.78 35.83 36.54 36.34 36.66 36.93 37.07 Set14 30.23 31.80 31.79 32.28 32.18 32.45 32.56 32.76 Kodim 30.84 32.19 32.23 32.71 32.62 32.80 32.94 33.21 x3 Set5 30.39 31.90 31.92 32.58 32.39 32.75 33.10 33.08 Set14 27.54 28.67 28.65 29.13 29.00 29.29 29.41 29.50 Kodim 28.43 29.21 29.21 29.57 29.42 29.64 29.76 29.88 Acknowledgments This work was supported by ANR (MACARON project ANR-14-CE23-0003-01). 8 References [1] P.-A. Absil, R. Mahony, and R. Sepulchre. Optimization algorithms on matrix manifolds. Princeton University Press, 2009. [2] P. Arbelaez, M. Maire, C. Fowlkes, and J. Malik. Contour detection and hierarchical image segmentation. IEEE T. Pattern Anal., 33(5):898–916, 2011. [3] L. Bo, K. Lai, X. Ren, and D. Fox. Object recognition with hierarchical kernel descriptors. In CVPR, 2011. [4] D. S. Broomhead and D. Lowe. Radial basis functions, multi-variable functional interpolation and adaptive networks. Technical report, DTIC Document, 1988. [5] Y. Cho and L. K. Saul. Kernel methods for deep learning. In Adv. NIPS, 2009. [6] A. Damianou and N. Lawrence. Deep Gaussian processes. In Proc. AISTATS, 2013. [7] C. Dong, C. C. Loy, K. He, and X. Tang. Learning a deep convolutional network for image super-resolution. In Proc. ECCV. 2014. [8] C. Dong, C. C. Loy, K. He, and X. Tang. Image super-resolution using deep convolutional networks. IEEE T. Pattern Anal., 38(2):295–307, 2016. [9] I. J. Goodfellow, D. Warde-Farley, M. Mirza, A. Courville, and Y. Bengio. Maxout networks. In Proc. ICML, 2013. [10] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proc. CVPR, 2016. [11] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proc. ICML, 2015. [12] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Adv. NIPS, 2012. [13] Y. Le Cun, L. Bottou, G. B. Orr, and K.-R. Müller. Efficient backprop. In Neural Networks, Tricks of the Trade, Lecture Notes in Computer Science LNCS 1524. 1998. [14] C.-Y. Lee, P. W. Gallagher, and Z. Tu. Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree. In Proc. AISTATS, 2016. [15] C.-Y. Lee, S. Xie, P. W. Gallagher, Z. Zhang, and Z. Tu. Deeply-supervised nets. In Proc. AISTATS, 2015. [16] H. Lin, J. Mairal, and Z. Harchaoui. A universal catalyst for first-order optimization. In Adv. NIPS, 2015. [17] M. Lin, Q. Chen, and S. Yan. Network in network. In Proc. ICLR, 2013. [18] J. Mairal, P. Koniusz, Z. Harchaoui, and C. Schmid. Convolutional kernel networks. In Adv. NIPS, 2014. [19] 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, 2011. [20] M. Paulin, M. Douze, Z. Harchaoui, J. Mairal, F. Perronin, and C. Schmid. Local convolutional features with unsupervised training for image retrieval. In Proc. ICCV, 2015. [21] A. Rahimi and B. Recht. Random features for large-scale kernel machines. In Adv. NIPS, 2007. [22] B. Schölkopf and A. J. Smola. Learning with kernels: support vector machines, regularization, optimization, and beyond. MIT press, 2002. [23] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In Proc. ICLR, 2015. [24] S. Sonnenburg, G. Rätsch, C. Schäfer, and B. Schölkopf. Large scale multiple kernel learning. J. Mach. Learn. Res., 7:1531–1565, 2006. [25] V. Sydorov, M. Sakurada, and C. Lampert. Deep Fisher kernels — end to end learning of the Fisher kernel GMM parameters. In Proc. CVPR, 2014. [26] R. Timofte, V. Smet, and L. van Gool. Anchored neighborhood regression for fast example-based superresolution. In Proc. ICCV, 2013. [27] Z. Wang, D. Liu, J. Yang, W. Han, and T. Huang. Deep networks for image super-resolution with sparse prior. In Proc. ICCV, 2015. [28] C. Williams and M. Seeger. Using the Nyström method to speed up kernel machines. In Adv. NIPS, 2001. [29] M. D. Zeiler and R. Fergus. Stochastic pooling for regularization of deep convolutional neural networks. In Proc. ICLR, 2013. [30] R. Zeyde, M. Elad, and M. Protter. On single image scale-up using sparse-representations. In Curves and Surfaces, pages 711–730. 2010. [31] K. Zhang, I. W. Tsang, and J. T. Kwok. Improved Nyström low-rank approximation and error analysis. In Proc. ICML, 2008. 9
2016
561
6,507
Dueling Bandits: Beyond Condorcet Winners to General Tournament Solutions Siddartha Ramamohan Indian Institute of Science Bangalore 560012, India siddartha.yr@csa.iisc.ernet.in Arun Rajkumar Xerox Research Bangalore 560103, India arun_r@csa.iisc.ernet.in Shivani Agarwal University of Pennsylvania Philadelphia, PA 19104, USA ashivani@seas.upenn.edu Abstract Recent work on deriving O(log T) anytime regret bounds for stochastic dueling bandit problems has considered mostly Condorcet winners, which do not always exist, and more recently, winners defined by the Copeland set, which do always exist. In this work, we consider a broad notion of winners defined by tournament solutions in social choice theory, which include the Copeland set as a special case but also include several other notions of winners such as the top cycle, uncovered set, and Banks set, and which, like the Copeland set, always exist. We develop a family of UCB-style dueling bandit algorithms for such general tournament solutions, and show O(log T) anytime regret bounds for them. Experiments confirm the ability of our algorithms to achieve low regret relative to the target winning set of interest. 1 Introduction There has been significant interest and progress in recent years in developing algorithms for dueling bandit problems [1–11]. Here there are K arms; on each trial t, one selects a pair of arms (it, jt) for comparison, and receives a binary feedback signal yt ∈{0, 1} indicating which arm was preferred. Most work on dueling bandits is in the stochastic setting and assumes a stochastic model – a preference matrix P of pairwise comparison probabilities Pij – from which the feedback signals yt are drawn; as with standard stochastic multi-armed bandits, the target here is usually to design algorithms with O(ln T) regret bounds, and where possible, O(ln T) anytime (or ‘horizon-free’) regret bounds, for which the algorithm does not need to know the horizon or number of trials T in advance. Early work on dueling bandits often assumed strong conditions on the preference matrix P, such as existence of a total order, under which there is a natural notion of a ‘maximal’ element with respect to which regret is measured. Recent work has sought to design algorithms under weaker conditions on P; most work, however, has assumed the existence of a Condorcet winner, which is an arm i that beats every other arm j (Pij > 1 2 ∀j ̸= i), and which reduces to the maximal element when a total order exists. Unfortunately, the Condorcet winner does not always exist, and this has motivated a search for other natural notions of winners, such as Borda winners and the Copeland set (see Figure 1).1 Among these, the only work that offers anytime O(ln T) regret bounds is the recent work of Zoghi et al. [11] on Copeland sets. In this work, we consider defining winners in dueling bandits via the natural notion of tournament solutions used in social choice theory, of which the Copeland set is a special case. We develop general upper confidence bound (UCB) style dueling bandit algorithms for a number of tournament solutions including the top cycle, uncovered set, and Banks set, and prove O(ln T) anytime regret bounds for them, where the regret is measured relative to the tournament solution of interest. Our proof technique is modular and can be used to develop algorithms with similar bounds for any tournament solution for which a ‘selection procedure’ satisfying certain ‘safety conditions’ can be designed. Experiments confirm the ability of our algorithms to achieve low regret relative to the target winning set of interest. 1Recently, Dudik et al. [10] also studied von Neumann winners, although they did so in a different (contextual) setting, leading to O(T 1/2) and O(T 2/3) regret bounds. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Algorithm Condition on P Target Winner Anytime? MultiSBM [5] U-Lin Condorcet winner ✓ IF [1] TO+SST+STI Condorcet winner × BTMB [2] TO+RST+STI Condorcet winner × RUCB [6] CW Condorcet winner ✓ MergeRUCB [7] CW Condorcet winner ✓ RMED [9] CW Condorcet winner ✓ SECS [8] UBW Borda winner × PBR-SE [4] DBS Borda winner × PBR-CO [4] Any P without ties Copeland set × SAVAGE-BO [3] Any P without ties Borda winner × SAVAGE-CO [3] Any P without ties Copeland set × CCB, SCB [11] Any P without ties Copeland set ✓ UCB-TC Any P without ties Top cycle ✓ UCB-UC Any P without ties Uncovered set ✓ UCB-BA Any P without ties Banks set ✓ Figure 1: Summary of algorithms for stochastic dueling bandit problems that have O(ln T) regret bounds, together with corresponding conditions on the underlying preference matrix P, target winners used in defining regret, and whether the regret bounds are "anytime". The figure on the left shows relations between some of the commonly studied conditions on P (see Table 1 for definitions). The algorithms in the lower part of the table (shown in red) are proposed in this paper. 2 Dueling Bandits, Tournament Solutions, and Regret Measures Dueling Bandits. We denote by [K] = {1, . . . , K} the set of K arms. On each trial t, the learner selects a pair of arms (it, jt) ∈[K] × [K] (with it possibly equal to jt), and receives feedback in the form of a comparison outcome yt ∈{0, 1}, with yt = 1 indicating it was preferred over jt and yt = 0 indicating the reverse. The goal of the learner is to select as often as possible from a set of ‘good’ or ‘winning’ arms, which we formalize below as a tournament solution. The pairwise feedback on each trial is assumed to be generated stochastically according to a fixed but unknown pairwise preference model represented by a preference matrix P ∈[0, 1]K×K with Pij +Pji = 1 ∀i, j: whenever arms i and j are compared, i is preferred to j with probability Pij, and j to i with probability Pji = 1−Pij. Thus for each trial t, we have yt ∼Bernoulli(Pitjt). We assume throughout this paper that there are are no “ties” between distinct arms, i.e. that Pij ̸= 1 2 ∀i ̸= j.2 We denote by PK the set of all such preference matrices over K arms: PK =  P ∈[0, 1]K×K : Pij + Pji = 1 ∀i, j ; Pij ̸= 1 2 ∀i ̸= j . For any pair of arms (i, j), we will define the margin of (i, j) w.r.t. P as ∆P ij = |Pij −1 2| . Previous work on dueling bandits has considered a variety of conditions on P; see Table 1 and Figure 1. Our interest here is in designing algorithms that have regret guarantees under minimal restrictions on P. To this end, we will consider general notions of winners that are derived from a natural tournament associated with P, and that are always guaranteed to exist. We will say an arm i beats an arm j w.r.t. P if Pij > 1 2; we will express this as a binary relation ≻P on [K]: i ≻P j ⇐⇒Pij > 1 2 . The tournament associated with P is then simply TP = ([K], EP), where EP = {(i, j) : i ≻P j}. Two frequently studied notions of winners in previous work on dueling bandits, both of which are derived from the tournament TP (and which are the targets of previous anytime regret bounds), are the Condorcet winner when it exists, and the Copeland set in general: Definition 1 (Condorcet winner). Let P ∈PK. If there exists an arm i∗∈[K] such that i∗≻P j ∀j ̸= i∗, then i∗is said to be a Condorcet winner w.r.t. P. Definition 2 (Copeland set). Let P ∈PK. The Copeland set w.r.t. P, denoted CO(P), is defined as the set of all arms in [K] that beat the maximal number of arms w.r.t. P: CO(P) = arg max i∈[K] P j̸=i1 i ≻P j  . Here we are interested in more general notions of winning sets derived from the tournament TP. 2The assumption of no ties was also made in deriving regret bounds w.r.t. to the Copeland set in [3,4,11], and exists implicitly in [1,2] as well. 2 Table 1: Commonly studied conditions on the preference matrix P. Condition on P Property satisfied by P Utility-based with linear link (U-Lin) ∃u ∈[0, 1]K : Pij = 1−(ui−uj) 2 ∀i, j Total order (TO) ∃σ ∈Sn : Pij > 1 2 ⇐⇒σ(i) < σ(j) Strong stochastic transitivity (SST) Pij > 1 2, Pjk > 1 2 =⇒Pik ≥max(Pij, Pjk) Relaxed stochastic transitivity (RST) ∃γ ≥1 : Pij > 1 2, Pjk > 1 2 =⇒Pik−1 2 ≥1 γ max(Pij −1 2, Pjk−1 2) Stochastic triangle inequality (STI) Pij > 1 2, Pjk > 1 2 =⇒Pik ≤Pij + Pjk −1 2 Condorcet winner (CW) ∃i : Pij > 1 2 ∀j ̸= i Unique Borda winner (UBW) ∃i : P k̸=i Pik > P k̸=j Pjk ∀j ̸= i Distinct Borda scores (DBS) P k̸=i Pik ̸= P k̸=j Pjk ∀i ̸= j TC UC/BA 4 5 3 CO 2 1 P_5 TC  UC  BA  CO  5  6  7  4  1  2  3  8  9  10  11  12  13  Hudry  TC Tennis UC/BA 4 5 3 CO 7 1 6 2 8 Figure 2: Examples of various tournaments together with their corresponding tournament solutions. Edges that are not explicitly shown are directed from left to right; edges that are incident on subsets of nodes (rounded rectangles) apply to all nodes within. Left: A tournament on 5 nodes with gradually discriminating tournament solutions. Middle: The Hudry tournament on 13 nodes with disjoint Copeland and Banks sets. Right: A tournament on 8 nodes based on ATP tennis match records. Tournament Solutions. Tournament solutions have long been used in social choice and voting theory to define winners in general tournaments when no Condorcet winner exists [12,13]. Specifically, a tournament solution is any mapping that maps each tournament on K nodes to a subset of ‘winning’ nodes in [K]; for our purposes, we will define a tournament solution to be any mapping S : PK→2[K] that maps each preference matrix P (via the induced tournament TP) to a subset of winning arms S(P) ⊆[K].3 The Copeland set is one such tournament solution. We consider three additional tournament solutions in this paper: the top cycle, the uncovered set, and the Banks set, all of which offer other natural generalizations of the Condorcet winner. These tournament solutions are motivated by different considerations (ranging from dominance to covering to decomposition into acyclic subtournaments) and have graded discriminative power, and can therefore be used to match the needs of different applications; see [12] for a comprehensive survey. Definition 3 (Top cycle). Let P ∈PK. The top cycle w.r.t. P, denoted TC(P), is defined as the smallest set W ⊆[K] for which i ≻P j ∀i ∈W, j /∈W. Definition 4 (Uncovered set). Let P ∈PK. An arm i is said to cover an arm j w.r.t. P if i ≻P j and ∀k : j ≻P k =⇒i ≻P k. The uncovered set w.r.t. P, denoted UC(P), is defined as the set of all arms that are not covered by any other arm w.r.t. P: UC(P) =  i ∈[K] : ̸ ∃j ∈[K] s.t. j covers i w.r.t. P . Definition 5 (Banks set). Let P ∈PK. A subtournament T = (V, E) of TP, where V ⊆[K] and E = EP|V ×V , is said to be maximal acyclic if (i) T is acyclic, and (ii) no other subtournament containing T is acyclic. Denote by MAST(P) the set of all maximal acyclic subtournaments of TP, and for each T ∈MAST(P), denote by m∗(T ) the maximal element of T . Then the Banks set w.r.t. P, denoted BA(P), is defined as the set of maximal elements of all maximal acyclic subtournaments of TP: BA(P) =  m∗(T ) : T ∈MAST(P) . It is known that BA(P) ⊆UC(P) ⊆TC(P) and CO(P) ⊆UC(P) ⊆TC(P). In general, BA(P) and CO(P) may intersect, although they can also be disjoint. When P contains a Condorcet winner i∗, all four tournament solutions reduce to just the singleton set {i∗}. See Figure 2 for examples. 3Strictly speaking, the mapping S must be invariant under permutations of the node labels. 3 Regret Measures. When P admits a Condorcet winner i∗, the individual regret of an arm i is usually defined as rCW P (i) = ∆P i∗,i, and the cumulative regret over T trials of an algorithm A that selects arms (it, jt) on trial t is then generally defined as RCW T (A) = PT t=1 rCW P (it, jt), where the pairwise regret rCW P (i, j) is either the average regret 1 2 rCW P (i) + rCW P (j)  , the strong regret max rCW P (i), rCW P (j)  , or the weak regret min rCW P (i), rCW P (j)  [1, 2, 6, 7, 9].4 When the target winner is a tournament solution S, we can similarly define a suitable notion of individual regret of an arm i w.r.t. S, and then use this to define pairwise regrets as above. In particular, for the three tournament solutions discussed above, we will define the following natural notions of individual regret: rTC P (i) = ( max i∗∈TC(P)∆P i∗,i if i /∈TC(P) 0 if i ∈TC(P) ; rUC P (i) = ( max i∗∈UC(P):i∗covers i∆P i∗,i if i /∈UC(P) 0 if i ∈UC(P) ; rBA P (i) = ( max T ∈MAST(P):T contains i∆P m∗(T ),i if i /∈BA(P) 0 if i ∈BA(P). In the special case when P admits a Condorcet winner i∗, the three individual regrets above all reduce to the Condorcet individual regret, rCW P (i) = ∆P i∗,i. In each case above, the cumulative regret of an algorithm A over T trials will then be given by RS T (A) = PT t=1rS P(it, jt) , where the pairwise regret rS P(i, j) can be the average regret 1 2 rS P(i) + rS P(j)  , the strong regret max rS P(i), rS P(j)  , or the weak regret min rS P(i), rS P(j)  . Our regret bounds will hold for each of these forms of pairwise regret. In fact, our regret bounds hold for any measure of pairwise regret rS P(i, j) that satisfies the following three conditions: (i) rS P(·, ·) is normalized: rS P(i, j) ∈[0, 1] ∀i, j; (ii) rS P(·, ·) is symmetric: rS P(i, j) = rS P(j, i) ∀i, j; and (iii) rS P(·, ·) is proper w.r.t. S: i, j ∈S(P) =⇒rS P(i, j) = 0. It is easy to verify that for the three tournament solutions above, the average, strong and weak pairwise regrets above all satisfy these conditions.5,6 3 UCB-TS: Generic Dueling Bandit Algorithm for Tournament Solutions Algorithm. In Algorithm 1 we outline a generic dueling bandit algorithm, which we call UCB-TS, for identifying winners from a general tournament solution. The algorithm can be instantiated to specific tournament solutions by designing suitable selection procedures SELECTPROC-TS (more details below). The algorithm maintains a matrix Ut ∈RK×K + of upper confidence bounds (UCBs) U t ij on the unknown pairwise preference probabilities Pij. The UCBs are constructed by adding a confidence term to the current empirical estimate of Pij; the exploration parameter α > 1 2 controls the exploration rate of the algorithm via the size of the confidence terms used. On each trial t, the algorithm selects a pair of arms (it, jt) based on the current UCB matrix Ut using the selection procedure SELECTPROC-TS; on observing the preference feedback yt, the algorithm then updates the UCBs for all pairs of arms (i, j) (the UCBs of all pairs (i, j) grow slowly with t so that pairs that have not been selected for a while have an increasing chance of being explored). In order to instantiate the UCB-TS algorithm to a particular tournament solution S, the critical step is in designing the selection procedure SELECTPROC-TS in a manner that yields good regret bounds for a suitable regret measure w.r.t. S. Below we identify general conditions on SELECTPROC-TS that allow for O(ln T) anytime regret bounds to be obtained (we will design procedures satisfying these conditions for the three tournament solutions of interest in Section 4). 4The notion of regret used in [5] was slightly different. 5It is also easy to verify that defining the individual regrets as the minimum or average margin relative to all relevant arms in the tournament solution of interest (instead of the maximum margin as done above) also preserves these properties, and therefore our regret bounds hold for the resulting variants of regret as well. 6One can also consider defining the individual regrets simply in terms of mistakes relative to the target tournament solution of interest, e.g. rTC P (i) = 1(i /∈TC(P)), and define average/strong/weak pairwise regrets in terms of these; our bounds also apply in this case. 4 Algorithm 1 UCB-TS 1: Require: Selection procedure SELECTPROC-TS 2: Parameter: Exploration parameter α > 1 2 3: Initialize: ∀(i, j) ∈[K] × [K]: N 1 ij = 0 // # times (i, j) has been compared; W 1 ij = 0 // # times i has won against j; U 1 ij =  1 2 if i = j 1 otherwise // UCB for Pij. 4: For t = 1, 2, . . . do: 5: • Select (it, jt) ←SELECTPROC-TS(Ut) 6: • Receive preference feedback yt ∈{0, 1} 7: • Update counts: ∀(i, j) ∈[K] × [K]: N t+1 ij = N t ij + 1 if {i, j} = {it, jt} N t ij otherwise ; W t+1 ij =    W t ij + yt if (i, j) = (it, jt) W t ij + (1 −yt) if (i, j) = (jt, it) W t ij otherwise. 8: • Update UCBs: ∀(i, j) ∈[K] × [K]: U t+1 ij =        1 2 if i = j 1 if i ̸= j and N t+1 ij = 0 W t+1 ij N t+1 ij + q α ln t N t+1 ij otherwise. Regret Analysis. We show here that if the selection procedure SELECTPROC-TS satisfies two natural conditions w.r.t. a tournament solution S, namely the safe identical-arms condition w.r.t. S and the safe distinct-arms condition w.r.t. S, then the resulting instantiation of the UCB-TS algorithm has an O(ln T) regret bound for any regret measure that is normalized, symmetric, and proper w.r.t S. The first condition ensures that if the UCB matrix U given as input to SELECTPROC-TS in fact forms an element-wise upper bound on the true preference matrix P and SELECTPROC-TS returns two identical arms (i, i), then i must be in the winning set S(P). The second condition ensures that if U upper bounds P and SELECTPROC-TS returns two distinct arms (i, j), i ̸= j, then either both i, j are in the winning set S(P), or the UCBs Uij, Uji are still loose (and (i, j) should be explored further). Definition 6 (Safe identical-arms condition). Let S : PK→2[K] be a tournament solution. We will say a selection procedure SELECTPROC-TS : RK×K + →[K] × [K] satisfies the safe identical-arms condition w.r.t. S if for all P ∈PK, U ∈RK×K + such that Pij ≤Uij ∀i, j, we have SELECTPROC-TS(U) = (i, i) =⇒i ∈S(P) . Definition 7 (Safe distinct-arms condition). Let S : PK→2[K] be a tournament solution. We will say a selection procedure SELECTPROC-TS : RK×K + →[K] × [K] satisfies the safe distinct-arms condition w.r.t. S if for all P ∈PK, U ∈RK×K + such that Pij ≤Uij ∀i, j, we have SELECTPROC-TS(U) = (i, j), i ̸= j =⇒  (i, j) ∈S(P) × S(P) or  Uij + Uji ≥1 + ∆P ij . In what follows, for K ∈Z+, α > 1 2, and δ ∈(0, 1], we define C(K, α, δ) = (4α −1)K2 (2α −1)δ 1/(2α−1) . This quantity, which also appears in the analysis of RUCB [6], acts as an initial time period beyond which all the UCBs Uij upper bound Pij w.h.p. We have the following result (proof in Appendix A): Theorem 8 (Regret bound for UCB-TS algorithm). Let S : PK→2[K] be a tournament solution, and suppose the selection procedure SELECTPROC-TS used in the UCB-TS algorithm satisfies both the safe identical-arms condition w.r.t. S and the safe distinct-arms condition w.r.t. S. Let P ∈PK, and let rS P(i, j) be any normalized, symmetric, proper regret measure w.r.t. S. Let α > 1 2 and δ ∈(0, 1]. Then with probability at least 1 −δ (over the feedback yt drawn randomly from P and any internal randomness in SELECTPROC-TS), the cumulative regret of the UCB-TS algorithm with exploration parameter α is upper bounded as RS T UCB-TS(α)  ≤ C(K, α, δ) + 4α (ln T)  X i<j:(i,j)/∈S(P)×S(P) rS P(i, j) (∆P ij)2  . 5 Figure 3: Inferences about the direction of preference between arms i and j under the true preference matrix P based on the UCBs Uij, Uji, assuming that Pij, Pji are upper bounded by Uij, Uji. 4 Dueling Bandit Algorithms for Top Cycle, Uncovered Set, and Banks Set Below we give selection procedures satisfying both the safe identical-arms condition and the safe distinct-arms condition above w.r.t. the top cycle, uncovered set, and Banks set, which immediately yield dueling bandit algorithms with O(ln T) regret bounds w.r.t. these tournament solutions. An instantiation of our framework to the Copeland set is also discussed in Appendix E. The selection procedure for each tournament solution is closely related to the corresponding winner determination algorithm for that tournament solution; however, while a standard winner determination algorithm would have access to the actual tournament TP, the selection procedures we design can only guess (with high confidence) the preference directions between some pairs of arms based on the UCB matrix U. In particular, if the entries of U actually upper bound those of P, then for any pair of arms i and j, one of the following must be true (see also Figure 3): • Uij < 1 2, in which case Pij ≤Uij < 1 2 and therefore j ≻P i; • Uji < 1 2, in which case Pji ≤Uji < 1 2 and therefore i ≻P j; • Uij ≥1 2 and Uji ≥1 2, in which case the direction of preference between i and j in TP is unresolved. The selection procedures we design manage the exploration-exploitation tradeoff by adopting an optimism followed by pessimism approach, similar to that used in the design of the RUCB and CCB algorithms [6, 11]. Specifically, our selection procedures first optimistically identify a potential winning arm a based on the UCBs U (by optimistically setting directions of any unresolved edges in TP in favor of the arm being considered; see Figure 3). Once a putative winning arm a is identified, the selection procedures then pessimistically find an arm b that has the greatest chance of invalidating a as a winning arm, and select the pair (a, b) for comparison. 4.1 UCB-TC: Dueling Bandit Algorithm for Top Cycle The selection procedure SELECTPROC-TC (Algorithm 2), when instantiated in the UCB-TS template, yields the UCB-TC dueling bandit algorithm. Intuitively, SELECTPROC-TC constructs an optimistic estimate A of the top cycle based on the UCBs U (line 2), and selects a potential winning arm a from A (line 3); if there is no unresolved arm against a (line 5), then it returns (a, a) for comparison, else it selects the best-performing unresolved opponent b (line 8) and returns (a, b) for comparison. We have the following result (see Appendix B for a proof): Theorem 9 (SELECTPROC-TC satisfies safety conditions w.r.t. TC). SELECTPROC-TC satisfies both the safe identical-arms condition and the safe distinct-arms condition w.r.t. TC. By virtue of Theorem 8, this immediately yields the following regret bound for UCB-TC: Corollary 10 (Regret bound for UCB-TC algorithm). Let P ∈PK. Let α > 1 2 and δ ∈(0, 1]. Then with probability at least 1 −δ, the cumulative regret of UCB-TC w.r.t. the top cycle satisfies RTC T UCB-TC(α)  ≤ C(K, α, δ) + 4α (ln T)  X i<j:(i,j)/∈TC(P)×TC(P) rTC P (i, j) (∆P ij)2  . 4.2 UCB-UC: Dueling Bandit Algorithm for Uncovered Set The selection procedure SELECTPROC-UC (Algorithm 3), when instantiated in the UCB-TS template, yields the UCB-UC dueling bandit algorithm. SELECTPROC-UC relies on the property that an uncovered arm beats every other arm either directly or via an intermediary [12]. SELECTPROC-UC optimistically identifies such a potentially uncovered arm a based on the UCBs U (line 5); if it can be resolved that a is indeed uncovered (line 7), then it returns (a, a), else it selects the best-performing unresolved opponent b when available (line 11), or an arbitrary opponent b otherwise (line 13), and returns (a, b). We have the following result (see Appendix C for a proof): 6 Algorithm 2 SELECTPROC-TC 1: Input: UCB matrix U ∈RK×K + 2: Let A ⊆[K] be any minimal set satisfying Uij ≥1 2 ∀i ∈A, j /∈A 3: Select any a ∈argmaxi∈A minj̸∈A Uij 4: B ←{i ̸= a : Uai ≥1 2 ∧Uia ≥1 2} 5: if B = ∅then 6: Return (a, a) 7: else 8: Select any b ∈argmaxi∈B Uia 9: Return (a, b) 10: end if Algorithm 3 SELECTPROC-UC 1: Input: UCB matrix U ∈RK×K + 2: for i = 1 to K do 3: y(i) ←P j 1(Uij ≥1 2) + P j,k 1(Uij ≥1 2 ∧Ujk ≥1 2) 4: end for 5: Select any a ∈argmaxi y(i) 6: B ←{i ̸= a : Uai ≥1 2 ∧Uia ≥1 2} 7: if ∀i ̸= a : (Uia < 1 2) ∨ (∃j : Uij < 1 2 ∧Uja < 1 2)  then 8: Return (a, a) 9: else 10: if B ̸= ∅then 11: Select any b ∈argmaxi∈B Uia 12: else 13: Select any b ̸= a 14: end if 15: Return (a, b) 16: end if Algorithm 4 SELECTPROC-BA 1: Input: UCB matrix U ∈RK×K + 2: Select any j1 ∈[K] 3: J ←{j1} // Initialize candidate Banks trajectory 4: s ←1 // Initialize size of candidate Banks trajectory 5: traj_found = FALSE 6: while NOT(traj_found) do 7: C ←{i /∈J : Uij > 1 2 ∀j ∈J } 8: if C = ∅then 9: traj_found = TRUE 10: break 11: else 12: js+1 ∈argmaxi∈C(minj∈J Uij) 13: J ←J ∪{js+1} 14: s ←s + 1 15: end if 16: end while 17: if ∀1 ≤q < r ≤s: Ujq,jr < 1 2  then 18: a ←js 19: Return (a, a) 20: else 21: Select any (eq, er) ∈arg max (q,r):1≤q<r≤s Ujq,jr 22: (a, b) ←(jeq, jer) 23: Return (a, b) 24: end if Theorem 11 (SELECTPROC-UC satisfies safety conditions w.r.t. UC). SELECTPROC-UC satisfies both the safe identical-arms condition and the safe distinct-arms condition w.r.t. UC. Again, by virtue of Theorem 8, this immediately yields the following regret bound for UCB-UC: Corollary 12 (Regret bound for UCB-UC algorithm). Let P ∈PK. Let α > 1 2 and δ ∈(0, 1]. Then with probability at least 1−δ, the cumulative regret of UCB-UC w.r.t. the uncovered set satisfies RUC T UCB-UC(α)  ≤ C(K, α, δ) + 4α (ln T)  X i<j:(i,j)/∈UC(P)×UC(P) rUC P (i, j) (∆P ij)2  . 4.3 UCB-BA: Dueling Bandit Algorithm for Banks Set The selection procedure SELECTPROC-BA (Algorithm 4), when instantiated in the UCB-TS template, yields the UCB-BA dueling bandit algorithm. Intuitively, SELECTPROC-BA first constructs an optimistic candidate maximal acyclic subtournament (set J ; also called a Banks trajectory) based on the UCBs U (lines 2–16). If this subtournament is completely resolved (line 17), then its maximal arm a is picked and (a, a) is returned; if not, an unresolved pair (a, b) is returned that is most likely to fail the acyclicity/transitivity property. We have the following result (see Appendix D for a proof): Theorem 13 (SELECTPROC-BA satisfies safety conditions w.r.t. BA). SELECTPROC-BA satisfies both the safe identical-arms condition and the safe distinct-arms condition w.r.t. BA. Again, by virtue of Theorem 8, this immediately yields the following regret bound for UCB-BA: Corollary 14 (Regret bound for UCB-BA algorithm). Let P ∈PK. Let α > 1 2 and δ ∈(0, 1]. Then with probability at least 1 −δ, the cumulative regret of UCB-BA w.r.t. the Banks set satisfies RBA T UCB-BA(α)  ≤ C(K, α, δ) + 4α (ln T)  X i<j:(i,j)/∈BA(P)×BA(P) rBA P (i, j) (∆P ij)2  . 7 Figure 4: Regret performance of our algorithms compared to BTMB, RUCB, SAVAGE-CO, and CCB. Results are averaged over 10 independent runs; light colored bands represent one standard error. Left: Top cycle regret of UCB-TC on PMSLR. Middle: Uncovered set regret of UCB-UC on PTennis. Right: Banks set regret of UCB-BA on PHudry. See Appendix F.2 for additional results. 5 Experiments Here we provide an empirical evaluation of the performance of the proposed dueling bandit algorithms. We used the following three preference matrices in our experiments, one of which is synthetic and two real-world, and none of which posesses a Condorcet winner: • PHudry ∈P13: This is constructed from the Hudry tournament shown in Figure 2(b); as noted earlier, this is the smallest tournament whose Copeland set and Banks set are disjoint [14]. Details of this preference matrix can be found in Appendix F.1.1. • PTennis ∈P8: This is constructed from real data collected from the Association of Tennis Professionals’ (ATP’s) website on outcomes of tennis matches played among 8 well-known professional tennis players. The tournament associated with PTennis is shown in Figure 2(c); further details of this preference matrix can be found in Appendix F.1.2. • PMSLR ∈P16: This is constructed from real data from the Microsoft Learning to Rank (MSLR) Web10K data set. Further details can be found in Appendix F.1.3. We compared the performance of our algorithms, UCB-TC, UCB-BA, and UCB-UC, with four previous dueling bandit algorithms: BTMB [2], RUCB [6], SAVAGE-CO [3], and CCB [11].7 In each case, we assessed the algorithms in terms of average pairwise regret relative to the target tournament solution of interest (see Section 2), averaged over 10 independent runs. A sample of the results is shown in Figure 4; as can be seen, the proposed algorithms UCB-TC, UCB-UC, and UCB-BA generally outperform existing baselines in terms of minimizing regret relative to the top cycle, the uncovered set, and the Banks set, respectively. Additional results, including results with the Copeland set variant of our algorithm, UCB-CO, can be found in Appendix F.2. 6 Conclusion In this paper, we have proposed the use of general tournament solutions as sets of ‘winning’ arms in stochastic dueling bandit problems, with the advantage that these tournament solutions always exist and can be used to define winners according to criteria that are most relevant to a given dueling bandit setting. We have developed a UCB-style family of algorithms for such general tournament solutions, and have shown O(ln T) anytime regret bounds for the algorithm instantiated to the top cycle, uncovered set, and Banks set (as well as the Copeland set; see Appendix E). While our approach has an appealing modular structure both algorithmically and in our proofs, an open question concerns the optimality of our regret bounds in their dependence on the number of arms K. For the Condorcet winner, the MergeRUCB algorithm [7] has an anytime regret bound of the form O(K ln T); for the Copeland set, the SCB algorithm [11] has an anytime regret bound of the form O(K ln K ln T). In the worst case, our regret bounds are of the form O(K2 ln T). Is it possible that for the top cycle, uncovered set, and Banks set, one can also show an Ω(K2 ln T) lower bound on the regret? Or can our regret bounds or algorithms be improved? We leave a detailed investigation of this issue to future work. Acknowledgments. Thanks to the anonymous reviewers for helpful comments and suggestions. SR thanks Google for a travel grant to present this work at the conference. 7For all the UCB-based algorithms (including our algorithms, RUCB, and CCB), we set the exploration parameter α to 0.51; for SAVAGE-CO, we set the confidence parameter δ to 1/T; and for BTMB, we set δ to 1/T and chose γ to satisfy the γ-relaxed stochastic transitivity property for each preference matrix. 8 References [1] Yisong Yue, Josef Broder, Robert Kleinberg, and Thorsten Joachims. The K-armed dueling bandits problem. Journal of Computer and System Sciences, 78(5):1538–1556, 2012. [2] Yisong Yue and Thorsten Joachims. Beat the mean bandit. In Proceedings of the 28th International Conference on Machine Learning, 2011. [3] Tanguy Urvoy, Fabrice Clerot, Raphael Féraud, and Sami Naamane. Generic exploration and k-armed voting bandits. In Proceedings of the 30th International Conference on Machine Learning, 2013. [4] Róbert Busa-Fekete, Balazs Szorenyi, Weiwei Cheng, Paul Weng, and Eyke Hüllermeier. Top-k selection based on adaptive sampling of noisy preferences. In Proceedings of the 30th International Conference on Machine Learning, 2013. [5] Nir Ailon, Zohar Karnin, and Thorsten Joachims. Reducing dueling bandits to cardinal bandits. In Proceedings of the 31st International Conference on Machine Learning, 2014. [6] Masrour Zoghi, Shimon Whiteson, Remi Munos, and Maarten de Rijke. Relative upper confidence bound for the k-armed dueling bandit problem. In Proceedings of the 31st International Conference on Machine Learning, 2014. [7] Masrour Zoghi, Shimon Whiteson, and Maarten de Rijke. MergeRUCB: A method for largescale online ranker evaluation. In Proceedings of the 8th ACM International Conference on Web Search and Data Mining, 2015. [8] Kevin Jamieson, Sumeet Katariya, Atul Deshpande, and Robert Nowak. Sparse dueling bandits. In Proceedings of the 18th International Conference on Artificial Intelligence and Statistics, 2015. [9] Junpei Komiyama, Junya Honda, Hisashi Kashima, and Hiroshi Nakagawa. Regret lower bound and optimal algorithm in dueling bandit problem. In Proceedings of the 28th Conference on Learning Theory, 2015. [10] Miroslav Dudık, Katja Hofmann, Robert E Schapire, Aleksandrs Slivkins, and Masrour Zoghi. Contextual dueling bandits. In Proceedings of the 28th Conference on Learning Theory, 2015. [11] Masrour Zoghi, Zohar S. Karnin, Shimon Whiteson, and Maarten de Rijke. Copeland dueling bandits. In Advances in Neural Information Processing Systems 28, 2015. [12] Felix Brandt, Markus Brill, and Paul Harrenstein. Tournament solutions. In Handbook of Computational Social Choice. Cambridge University Press, 2016. [13] Felix Brandt, Andre Dau, and Hans Georg Seedig. Bounds on the disparity and separation of tournament solutions. Discrete Applied Mathematics, 187:41–49, 2015. [14] Olivier Hudry. A smallest tournament for which the Banks set and the Copeland set are disjoint. Social Choice and Welfare, 16(1):137–143, 1999. [15] Kenneth A Shepsle and Barry R Weingast. Uncovered sets and sophisticated voting outcomes with implications for agenda institutions. American Journal of Political Science, pages 49–74, 1984. [16] Kevin Jamieson and Robert Nowak. Active ranking using pairwise comparisons. In Advances in Neural Information Processing Systems, 2011. 9
2016
562
6,508
Visual Question Answering with Question Representation Update (QRU) Ruiyu Li Jiaya Jia The Chinese University of Hong Kong {ryli,leojia}@cse.cuhk.edu.hk Abstract Our method aims at reasoning over natural language questions and visual images. Given a natural language question about an image, our model updates the question representation iteratively by selecting image regions relevant to the query and learns to give the correct answer. Our model contains several reasoning layers, exploiting complex visual relations in the visual question answering (VQA) task. The proposed network is end-to-end trainable through back-propagation, where its weights are initialized using pre-trained convolutional neural network (CNN) and gated recurrent unit (GRU). Our method is evaluated on challenging datasets of COCO-QA [19] and VQA [2] and yields state-of-the-art performance. 1 Introduction Visual question answering (VQA) is a new research direction as intersection of computer vision and natural language processing. Developing stable systems for VQA attracts increasing interests in multiple communities. Possible applications include bidirectional image-sentence retrieval, human computer interaction, blind person assistance, etc. It is now still a difficult problem due to many challenges in visual object recognition and grounding, natural language representation, and common sense reasoning. Most recently proposed VQA models are based on image captioning [10, 24, 28]. These methods have been advanced by the great success of deep learning on building language models [23], image classification [12] and on visual object detection [6]. Compared with image captioning, where a plausible description is produced for a given image, VQA requires algorithms to give the correct answer to a specific human-raised question regarding the content of a given image. It is a more complex research problem since the method is required to answer different types of questions. An example related to image content is “What is the color of the dog?”. There are also questions requiring extra knowledge or commonsense reasoning, such as “Does it appear to be rainy?". Properly modeling questions is essential for solving the VQA problem. A commonly employed strategy is to use a CNN or an RNN to extract semantic vectors. The general issue is that the resulting question representation lacks detailed information from the given image, which however is vital for understanding visual content. We take the question and image in Figure 1 as an example. To answer the original question “What is sitting amongst things have been abandoned?", one needs to know the target object location. Thus the question can be more specific as “What is discarded on the side of a building near an old book shelf?". In this paper, we propose a neural network based reasoning model that is able to update the question representation iteratively by inferring image information. With this new system, it is now possible to make questions more specific than the original ones focusing on important image information automatically. Our approach is based on neural reasoner [18], which has recently shown remarkable 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. (a) (b) Question: What is sitting amongst things have been abandoned? Answer: Toilet. Before: What sits in the room that appears to be partially abandoned? Updated: What is discarded on the side of a building near an old book shelf? Figure 1: The questions asked by human can be ambiguous given an image containing various objects. The Before and Updated questions are the most similar ones based on the cosine similarity to the original Question before and after applying our algorithm to update representation. (b) shows the attention masks generated by our model. success in text question answering tasks. Neural reasoner updates the question by interacting it with supporting facts through multiple reasoning layers. We note applying this model to VQA is nontrivial since the facts are in the form of an image. Thus image region information is extracted in our model. To determine the relevance between question and each image region, we employ the attention mechanism to generate the attention distribution over regions of the image. Our contributions are as follows. • We present a reasoning network to iteratively update the question representation after each time the question interacts with image content. • Our model utilizes object proposals to obtain candidate image regions and has the ability to focus on image regions relevant to the question. We evaluate and compare the performance of our model on two challenging VQA datasets – i.e., COCO-QA [19] and VQA [2]. Experiments demonstrate the ability of our model to infer image regions relevant to the question. 2 Related Work Research on visual question answering is mostly driven by text question answering and image captioning methods. In natural language processing, question answering is a well-studied problem. In [22], an end-to-end memory network was used with a recurrent attention model over a large external memory. Compared with the original memory network, it has less supervision and shows comparable results on the QA task. The neural reasoning system proposed in [18], named neural reasoner, can utilize multiple supporting facts and find an answer. Decent performance was achieved on positional reasoning and path finding QA tasks. VQA is closely related to image captioning [10, 24, 28, 5]. In [5], a set of likely words are detected in several regions of the image and are combined together using a language model to generate image description. In [10], a structured max-margin objective was used for deep neural networks. It learns to embed both visual and language data into a common multi-modal space. Vinyals et al. [24] extracted high-level image feature vectors from CNN and took them as the first input to the recurrent network to generate caption. Xu et al. [28] integrated visual attention in the recurrent network. The proposed algorithm predicts one word at a time by looking at local image regions relevant to the currently generated word. Malinowski et al. [15] first introduced a solution addressing the VQA problem. It combines natural language processing with semantic segmentation in a Bayesian framework for automatic question answering. Since it, several neural network based models [16, 19, 2] were proposed to solve the VQA problem. These models use CNN to extract image features and recurrent neural networks to embed questions. The embedded image and question features are then fused by concatenation [16] 2 Image Question What are they playing? GRU CNN Region1 Region2 RegionM ...... Query 0 Query 1 1 Query 1 2 Query 1 M ...... Query 1 SoftMax Image Understanding Question Encoding Reasoning Answering Figure 2: The overall architecture of our model with single reasoning layer for VQA. or element-wise addition [29] to predict answers. Recently several models integrated the attention mechanism [29, 27, 3, 20] and showed the ability of their networks to focus on image regions related to the question. There also exist other approaches for VQA. For example, Xiong et al. [26] proposed an improved dynamic memory network to fuse the question and image region representations using bi-directional GRU. The algorithm of [1] learns to compose a network from a collection of composable modules. Ma et al. [14] made use of CNN and proposed a model with three CNNs to capture information of the image, question and multi-modal representation. 3 Our Model The overall architecture of our model is illustrated in Figure 2. The model is derived from the neural reasoner [18], which is able to update the representation of question recursively by inferring over multiple supporting facts. Our model yet contains a few inherently different components. Since VQA involves only one question and one image each time instead of a set of facts, we use object proposal to obtain candidate image regions serving as the facts in our model. Moreover, in the pooling step, we employ an attention mechanism to determine the relevance between representation of original questions and updated ones. Our network consists of four major components – i.e., image understanding, question encoding, reasoning and answering layers. 3.1 Image Understanding Layer The image understanding layer is designed for modeling image content into semantic vectors. We build this layer upon the VGG model with 19 weight layers [21]. It is pre-trained on ImageNet [4]. The network has sixteen convolutional layers and five max-pooling layers of kernel size 2 × 2 with stride 2, followed by two fully-connected layers with 4,096 neurons. Using a global representation of the image may fail to capture all necessary information for answering the question involving multiple objects and spatial configuration. Moreover, since most of the questions are related to objects [19, 2], we utilize object proposal generator to produce a set of candidate regions that are most likely to be an object. For each image, we choose candidate regions by extracting the top 19 detected edge boxes [31]. We choose intersection over union (IoU) value 0.3 when performing non-maximum suppression, which is a common setting in object detection. Additionally, the whole image region is added to capture the global information in the image understanding layer, resulting in 20 candidate regions per image. We extract features from each candidate region through the above mentioned CNN, bringing a dimension of 4,096 image region features. The extracted features, however, lack spatial information for object location. To remedy this issue, we follow the method of [8] to include an 8D representation [xmin, ymin, xmax, ymax, xcenter, ycenter, wbox, hbox], 3 where wbox and hbox are the width and height of the image region. We set the image center as the origin. The coordinates are normalized to range from −1 to 1. Then each image region is represented as a 4104D feature denoted as fi where i ∈[1, 20]. For modeling convenience, we use a single layer perceptron to transform the image representation into a common latent space shared with the question feature vi = φ(Wvf ∗fi + bvf), (1) where φ is the rectified activation function φ(x) = max(0, x). 3.2 Question Encoding Layer To encode the natural language question, we resort to the recurrent neural network, which has demonstrated great success on sentence embedding. The question encoding layer is composed of a word embedding layer and GRU cells. Given a question w = [w1, ..., wT ], where wt is the tth word in the question and T is the length of the question, we first embed each word wt to a vector space xt with an embedding matrix xt = Wewt. Then for each time step, we feed xt into GRU sequentially. At each step, the GRU takes one input vector xt, and updates and outputs a hidden state ht. The final hidden state hT is considered as the question representation. We also embed it into the common latent space same as image embedding through a single layer perceptron q = φ(Wqh ∗hT + bqh). (2) We utilize the pre-trained network with skip-thought vectors model [11] designed for general sentence embedding to initialize our question encoding layer as used in [17]. Note that the skip-thought vectors model is trained in an unsupervised manner on large language corpus. By fine-tuning the GRU, we transfer knowledge from natural language corpus to the VQA problem. 3.3 Reasoning Layer The reasoning layer includes question-image interaction and weighted pooling. Question-Image Interaction Given that multilayer perceptron (MLP) has the ability to determine the relationship between two input sentences according to supervision [7, 18]. We examine image region features and question representation to acquire a good understanding of the question. In a memory network [22], these image region features are akin to the input memory representation, which can be retrieved for multiple times according to the question. There are a total of L reasoning layers. In the lth reasoning layer, the ith interaction happens between ql−1 and vi through an MLP, resulting in updated question representation ql i as ql i = MLPl(ql−1, vi; θl), (3) with θl being the model parameter of interaction at the lth reasoning layer. In the simplest case with one single layer in MLPl, the updating process is given by ql i = φ(Wl ∗(ql−1 ⊗vi) + bl), (4) where ⊗indicates element-wise multiplication, which performs better in our experiments than other strategies, e.g., concatenation and element-wise addition. Generally speaking, ql i contains update of network focus towards answering the question after its interaction with image feature vi. This property is important for the reasoning process [18]. Weighted Pooling Pooling aims to fuse components of the question after its interaction with all image features to update representation. Two common strategies for pooling are max and mean pooling. However, when answering a specifical question, it is often the case the correct answer is only related to particular image regions. Therefore, using max pooling may lead to unsatisfying results since questions may involve interaction between human and object, while mean pooling may also cause inferior performance due to noise introduced by regions irrelevant to the question. To determine the relevance between question and each image region, we resort to the attention mechanism used in [28] to generate the attention distribution over image regions. For each updated 4 question ql i after interaction with the ith image region, it is chosen close to the original question representation ql−1. Hence, the attention weights take the following forms. Ci = tanh(WA ∗ql i ⊕(WB ∗ql−1 + bB)), P = softmax(WP ∗C + bP ), (5) where C is a matrix and its ith column is Ci. P ∈RM is a M dimensional vector representing the attention weights. M is the number of image regions, set to 20. Based on the attention distribution, we calculate weighted average of ql i, resulting in the updated question representation ql as ql = X i Piql i. (6) The updated question representation ql after weighted pooling serves as the question input to the next reasoning or answering layer. 3.4 Answering Layer Following [19, 2], we model VQA as a classification problem with pre-defined classes. Given the updated question representation at last reasoning layer qL, a softmax layer is employed to classify qL into one of the possible answers as pans = softmax(Wans ∗qL + bans). (7) Note instead of the softmax layer for predicting the correct answer, it is also possible to utilize LSTM or GRU decoder, taking qL as input, to generate free-form answers. 4 Experiments 4.1 Datasets and Evaluation Metrics We conduct experiments on COCO-QA [19] and VQA [2]. The COCO-QA dataset is based on Microsoft COCO image data [13]. There are 78,736 training questions and 38,948 test ones, based on a total of 123,287 images. Four types of questions are provided, including Object, Number, Color and Location. Each type takes 70%, 7%, 17% and 6% of the whole dataset respectively. In the VQA dataset, each image from the COCO data is annotated by Amazon Mechanical Turk (AMT) with three questions. It is the largest for VQA benchmark so far. There are 248,349, 121,512 and 244,302 questions for training, validation and testing, respectively. For each question, ten answers are provided to take consensus of annotators. Following [2], we choose the top 1,000 most frequent answers as candidate outputs, which constitutes 82.67% of the train+val answers. Since we formulate VQA as a classification problem, mean classification accuracy is used to evaluate the model on the COCO-QA dataset. Besides, Wu-Palmer similarity (WUPS) [25] measure is also reported on COCO-QA dataset. WUPS calculates similarity between two words based on their longest common subsequence in the taxonomy tree. Following [19], we use thresholds 0.9 and 0.0 in our evaluation. VQA dataset provides a different kind of evaluation metric. Since ten ground truth answers are given, a predicted answer is considered to be correct when three or more ground truth answers match it. Otherwise, partial score is given. 4.2 Implementation Details We implement our network using the public Torch computing framework. Before training, all question sentences are normalized to lower case where question marks are removed. These words are fed into GRU one by one. The whole answer with one or more words is regarded as a separate class. For extracting image features, each candidate region is cropped and resized to 224 × 224 before feeding into CNN. For the COCO-QA dataset, we set the dimension of common latent space to 1,024. Since VQA dataset is larger than COCO-QA, we double the dimension of common latent space to adapt the data and classes. On each reasoning layer, we use one single layer in MLP. We test up to two reasoning layers. No further improvement is observed when using three or more layers. 5 Methods ACC. Object Number Color Location Mean Pooling 58.15 60.61 45.34 55.37 52.74 Max Pooling 59.37 62.11 45.70 55.91 53.63 W/O Global 60.87 63.32 46.68 58.66 55.49 W/O Coord 61.33 63.76 46.24 59.35 56.66 Full Model 61.99 64.53 46.68 59.81 56.82 Table 1: Comparison of ablation models. Models are trained and tested on COCO-QA [19] with one reasoning layer. Methods ACC. Object Number Color Location WUPS 0.9 WUPS 0.0 IMG+BOW [19] 55.92 58.66 44.10 51.96 49.39 66.78 88.99 2VIS+BLSTM [19] 55.09 58.17 44.79 49.53 47.34 65.34 88.64 Ensemble [19] 57.84 61.08 47.66 51.48 50.28 67.90 89.52 ABC-CNN [3] 58.10 62.46 45.70 46.81 53.67 68.44 89.85 DPPnet [17] 61.19 70.84 90.61 SAN [29] 61.60 64.50 48.60 57.90 54.00 71.60 90.90 QRU (1) 61.99 64.53 46.68 59.81 56.82 71.83 91.11 QRU (2) 62.50 65.06 46.90 60.50 56.99 72.58 91.62 Table 2: Evaluation results on COCO-QA dataset [19]. “QRU (1)” and “QRU (2)” refer to 1 and 2 reasoning layers incorporated in the system. The network is trained in an end-to-end fashion using stochastic gradient descent with mini-batches of 100 samples and momentum 0.9. The learning rate starts from 10−3 and decreases by a factor of 10 when validation accuracy stops improving. We use dropout and gradient clipping to regularize the training process. Our model is denoted as QRU in following experiments. 4.3 Ablation Results We conduct experiments to exam the usefulness of each component in our model. Specifically, we compare different question representation pooling mechanisms, i.e., mean pooling and max pooling. We also train two controlled models devoid of global image feature and spatial coordinate, denoted as W/O Global and W/O Coord. Table 1 shows the results. The performance of mean and max pooling models are substantially worse than the full model, which uses weighted pooling. This indicates that our model benefits from the attention mechanism by looking at several image regions rather than only one or all of them. A drop of 1.12% in accuracy is observed if the global image feature is not modeled, confirming that inclusion of the whole image is important for capturing the global information. Without modeling spatial coordinates also leads to a drop in accuracy. Notably, the greatest deterioration is on the question type of Object. This is because the Object type seeks information around the object like “What is next to the stop sign?". Spatial coordinates help our model reason spatial relationship among objects. 4.4 Comparison with State-of-the-art We compare performance in Tables 2 and 3 with experimental results on COCO-QA and VQA respectively. Table 2 shows that our model with only one reasoning layer already outperforms state-of-the-art 2-layer stacked attention network (SAN) [29]. Two reasoning layers give the best performance. We also report the per-category accuracy to show the strength and weakness of our model in Table 2. Our best model outperforms SAN by 2.6% and 2.99% in the question types of Color and Location respectively, and by 0.56% in Object. Our analysis is that the SAN model puts its attention on coarser regions obtained from the activation of last convolutional layer, which may include cluttered and noisy background. In contrast, our model only deals with selected object proposal regions, which have the good chance to be objects. When answering questions involving objects, our model gives reasonable results. For the question type Number, since an object proposal may contain several objects, our counting ability is weakened. In fact, the counting task is a complete computer vision problem on its own. 6 Methods Open-Ended (test-dev) test-std Multiple-Choice (test-dev) test-std All Y/N Num Other All All Y/N Num Other All BOWIMG [2] 52.64 75.77 33.67 37.37 58.97 75.59 34.35 50.33 LSTMIMG [2] 53.74 78.94 35.24 36.42 54.06 57.17 78.95 35.80 43.41 57.57 iBOWIMG [30] 55.72 76.55 35.03 42.62 55.89 61.68 76.68 37.05 54.44 61.97 DPPnet [17] 57.22 80.71 37.24 41.71 57.36 62.48 80.79 38.94 52.16 62.69 SAN [29] 58.70 79.30 36.60 46.10 58.90 WR Sel [20] 62.44 77.62 34.28 55.84 62.43 FDA [9] 59.24 81.14 36.16 45.77 59.54 64.01 81.50 39.00 54.72 64.18 DMN+ [26] 60.37 80.75 37.00 48.25 60.36 QRU (1) 59.26 80.98 35.93 45.99 59.44 63.96 81.00 37.08 55.48 64.13 QRU (2) 60.72 82.29 37.02 47.67 60.76 65.43 82.24 38.69 57.12 65.43 Table 3: Evaluation results on VQA dataset [2]. “QRU (1)” and “QRU (2)” refer to 1 and 2 reasoning layers incorporated in the system. Original What next to two other open laptops? Before updating What next to each other dipicting smartphones? What next to two boys? What hooked up to two computers? What next to each other with visible piping? What next to two pair of shoes? After updating with one reasoning layer What are there laying down with two remotes? What next to each other depicting smartphones? What hooked up to two computers? What next to each other with monitors? What cubicle with four differnet types of computers? After updating with two reasoning layers What plugged with wires? What next to each other with monitors? What are open at the table with cell phones? What is next to the monitor? What sits on the desk along with 2 monitors? Figure 3: Retrieved questions before and after update from COCO-QA dataset [19]. Table 3 shows that our model yields prominent improvement on the Other type when compared with other models [2, 30, 17] that use global representation of the image. Object proposals in our model are useful since the Other type contains questions such as “What color · · · ", “What kind · · · ", “Where is · · · ", etc. Our model outperforms that of [20] by 3% where the latter also exploits object proposals. Compared with [20], we use less number of object proposals, demonstrating the effectiveness of our approach. This table also reveals that our model with two reasoning layers achieve state-of-the-art results for both open-ended and multiple-choice tasks. 4.5 Qualitative Analysis To understand the ability of our model in updating question representation, we show an image and several questions in Figure 3. The retrieved questions from the test set are based on the cosine similarities to the original question before and after our model updates the representation. It is notable that before update, 4 out of the top 5 similar questions begin with “What next". This is because GRU acts as the language model, making the obtained questions share similar language structure. After we update question representation, the resulting ones are more related to image content regarding objects computers and monitors while the originally retrieved questions contain irrelevant words like boys and shoes. The retrieved questions become even more informative using two reasoning layers. We visualize a few attention masks generated by our model in Figure 4. Visualization is created by soft masking the image with a mask created by summing weights of each region. The mask is normalized with maximum value 1 followed by small Gaussian blur. Our model is capable of putting attention on important regions closely relevant to the question. To answer the question “What is the color of the snowboard?", the proposed model finds the snowboard. For the other question “The man holding what on top of a snow covered hill?", it is required to infer the relation among person, snow covered hill, and snowboard. With these attention masks, it is possible to predict correct answers since irrelevant image regions are ruled out. More examples are shown in Figure 5. 7 (a) (b) Q: What is the color of the snowboard? A: Yellow. (c) Q: The man holding what on top of a snow covered hill? A: Snowboard. Figure 4: Visualization of attention masks. Our model learns to attend particular image regions that are relevant to the question. Q: What is the color of the sunflower? A: Yellow Q: What is sitting on top of table in a workshop? A: Boat Q: What is the man in stadium style seats using? A: Phone Q: What are hogging a bed by themselfs? A: Dogs Q: What next to a large building? A: Clock Figure 5: Visualization of more attention masks. 5 Conclusion We have proposed an end-to-end trainable neural network for VQA. Our model learns to answer questions by updating question representation and inferring over a set of image regions with multilayer perceptron. Visualization of attention masks demonstrates the ability of our model to focus on image regions highly related to questions. Experimental results are satisfying on the two challenging VQA datasets. Future work includes improving object counting ability and word-region relation. Acknowledgements This work is supported by a grant from the Research Grants Council of the Hong Kong SAR (project No. 2150760) and by the National Science Foundation China, under Grant 61133009. We thank NVIDIA for providing Ruiyu Li a Tesla K40 GPU accelerator for this work. 8 References [1] J. Andreas, M. Rohrbach, T. Darrell, and D. Klein. Learning to compose neural networks for question answering. arXiv preprint arXiv:1601.01705, 2016. [2] S. Antol, A. Agrawal, J. Lu, M. Mitchell, D. Batra, C. Lawrence Zitnick, and D. Parikh. Vqa: Visual question answering. In ICCV, pages 2425–2433, 2015. [3] K. Chen, J. Wang, L.-C. Chen, H. Gao, W. Xu, and R. Nevatia. Abc-cnn: An attention based convolutional neural network for visual question answering. arXiv preprint arXiv:1511.05960, 2015. [4] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255, 2009. [5] H. Fang, S. Gupta, F. Iandola, R. K. Srivastava, L. Deng, P. Dollár, J. Gao, X. He, M. Mitchell, J. C. Platt, et al. From captions to visual concepts and back. In CVPR, pages 1473–1482, 2015. [6] R. Girshick, J. Donahue, T. Darrell, and J. Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In CVPR, pages 580–587, 2014. [7] B. Hu, Z. Lu, H. Li, and Q. Chen. Convolutional neural network architectures for matching natural language sentences. In NIPS, pages 2042–2050, 2014. [8] R. Hu, H. Xu, M. Rohrbach, J. Feng, K. Saenko, and T. Darrell. Natural language object retrieval. arXiv preprint arXiv:1511.04164, 2015. [9] I. Ilija, Y. Shuicheng, and F. Jiashi. A focused dynamic attention model for visual question answering. arXiv preprint arXiv:1604.01485, 2016. [10] A. Karpathy and L. Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In CVPR, pages 3128–3137, 2015. [11] R. Kiros, Y. Zhu, R. R. Salakhutdinov, R. Zemel, R. Urtasun, A. Torralba, and S. Fidler. Skip-thought vectors. In NIPS, pages 3276–3284, 2015. [12] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, pages 1097–1105, 2012. [13] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft coco: Common objects in context. In ECCV, pages 740–755, 2014. [14] L. Ma, Z. Lu, and H. Li. Learning to answer questions from image using convolutional neural network. arXiv preprint arXiv:1506.00333, 2015. [15] M. Malinowski and M. Fritz. A multi-world approach to question answering about real-world scenes based on uncertain input. In NIPS, pages 1682–1690, 2014. [16] M. Malinowski, M. Rohrbach, and M. Fritz. Ask your neurons: A neural-based approach to answering questions about images. In ICCV, pages 1–9, 2015. [17] H. Noh, P. H. Seo, and B. Han. Image question answering using convolutional neural network with dynamic parameter prediction. arXiv preprint arXiv:1511.05756, 2015. [18] B. Peng, Z. Lu, H. Li, and K.-F. Wong. Towards neural network-based reasoning. arXiv preprint arXiv:1508.05508, 2015. [19] M. Ren, R. Kiros, and R. Zemel. Exploring models and data for image question answering. In NIPS, pages 2935–2943, 2015. [20] K. J. Shih, S. Singh, and D. Hoiem. Where to look: Focus regions for visual question answering. arXiv preprint arXiv:1511.07394, 2015. [21] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [22] S. Sukhbaatar, A. Szlam, J. Weston, and R. Fergus. Weakly supervised memory networks. arXiv preprint arXiv:1503.08895, 2015. [23] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. arXiv preprint arXiv:1409.3215, 2014. [24] O. Vinyals, A. Toshev, S. Bengio, and D. Erhan. Show and tell: A neural image caption generator. In CVPR, pages 3156–3164, 2015. [25] Z. Wu and M. Palmer. Verbs semantics and lexical selection. In ACL, pages 133–138, 1994. [26] C. Xiong, S. Merity, and R. Socher. Dynamic memory networks for visual and textual question answering. arXiv preprint arXiv:1603.01417, 2016. [27] H. Xu and K. Saenko. Ask, attend and answer: Exploring question-guided spatial attention for visual question answering. arXiv preprint arXiv:1511.05234, 2015. [28] K. Xu, J. Ba, R. Kiros, A. Courville, R. Salakhutdinov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. arXiv preprint arXiv:1502.03044, 2015. [29] Z. Yang, X. He, J. Gao, L. Deng, and A. Smola. Stacked attention networks for image question answering. arXiv preprint arXiv:1511.02274, 2015. [30] B. Zhou, Y. Tian, S. Sukhbaatar, A. Szlam, and R. Fergus. Simple baseline for visual question answering. arXiv preprint arXiv:1512.02167, 2015. [31] C. L. Zitnick and P. Dollár. Edge boxes: Locating object proposals from edges. In ECCV, pages 391–405, 2014. 9
2016
563
6,509
Optimal Learning for Multi-pass Stochastic Gradient Methods Junhong Lin LCSL, IIT-MIT, USA junhong.lin@iit.it Lorenzo Rosasco DIBRIS, Univ. Genova, ITALY LCSL, IIT-MIT, USA lrosasco@mit.edu Abstract We analyze the learning properties of the stochastic gradient method when multiple passes over the data and mini-batches are allowed. In particular, we consider the square loss and show that for a universal step-size choice, the number of passes acts as a regularization parameter, and optimal finite sample bounds can be achieved by early-stopping. Moreover, we show that larger step-sizes are allowed when considering mini-batches. Our analysis is based on a unifying approach, encompassing both batch and stochastic gradient methods as special cases. 1 Introduction Modern machine learning applications require computational approaches that are at the same time statistically accurate and numerically efficient [2]. This has motivated a recent interest in stochastic gradient methods (SGM), since on the one hand they enjoy good practical performances, especially in large scale scenarios, and on the other hand they are amenable to theoretical studies. In particular, unlike other learning approaches, such as empirical risk minimization or Tikhonov regularization, theoretical results on SGM naturally integrate statistical and computational aspects. Most generalization studies on SGM consider the case where only one pass over the data is allowed and the step-size is appropriately chosen, [5, 14, 29, 26, 9, 16] (possibly considering averaging [18]). In particular, recent works show how the step-size can be seen to play the role of a regularization parameter whose choice controls the bias and variance properties of the obtained solution [29, 26, 9]. These latter works show that balancing these contributions, it is possible to derive a step-size choice leading to optimal learning bounds. Such a choice typically depends on some unknown properties of the data generating distributions and in practice can be chosen by cross-validation. While processing each data point only once is natural in streaming/online scenarios, in practice SGM is often used as a tool for processing large data-sets and multiple passes over the data are typically considered. In this case, the number of passes over the data, as well as the step-size, need then to be determined. While the role of multiple passes is well understood if the goal is empirical risk minimization [3], its effect with respect to generalization is less clear and a few recent works have recently started to tackle this question. In particular, results in this direction have been derived in [10] and [11]. The former work considers a general stochastic optimization setting and studies stability properties of SGM allowing to derive convergence results as well as finite sample bounds. The latter work, restricted to supervised learning, further develops these results to compare the respective roles of step-size and number of passes, and show how different parameter settings can lead to optimal error bounds. In particular, it shows that there are two extreme cases: one between the step-size or the number of passes is fixed a priori, while the other one acts as a regularization parameter and needs to be chosen adaptively. The main shortcoming of these latter results is that they are in the worst case, in the sense that they do not consider the possible effect of capacity assumptions [30, 4] shown to lead to faster rates for other learning approaches such as Tikhonov regularization. Further, these results do not consider the possible effect of mini-batches, rather than a single point in each gradient 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. step [21, 8, 24, 15]. This latter strategy is often considered especially for parallel implementation of SGM. The study in this paper, fills in these gaps in the case where the loss function is the least squares loss. We consider a variant of SGM for least squares, where gradients are sampled uniformly at random and mini-batches are allowed. The number of passes, the step-size and the mini-batch size are then parameters to be determined. Our main results highlight the respective roles of these parameters and show how can they be chosen so that the corresponding solutions achieve optimal learning errors. In particular, we show for the first time that multi-pass SGM with early stopping and a universal step-size choice can achieve optimal learning rates, matching those of ridge regression [23, 4]. Further, our analysis shows how the mini-batch size and the step-size choice are tightly related. Indeed, larger mini-batch sizes allow to consider larger step-sizes while keeping the optimal learning bounds. This result could give an insight on how to exploit mini-batches for parallel computations while preserving optimal statistical accuracy. Finally we note that a recent work [19] is tightly related to the analysis in the paper. The generalization properties of a multi-pass incremental gradient are analyzed in [19], for a cyclic, rather than a stochastic, choice of the gradients and with no mini-batches. The analysis in this latter case appears to be harder and results in [19] give good learning bounds only in restricted setting and considering iterates rather than the excess risk. Compared to [19] our results show how stochasticity can be exploited to get faster capacity dependent rates and analyze the role of mini-batches. The basic idea of our proof is to approximate the SGM learning sequence in terms of the batch GM sequence, see Subsection 3.4 for further details. This thus allows one to study batch and stochastic gradient methods simultaneously, and may be also useful for analysing other learning algorithms. The rest of this paper is organized as follows. Section 2 introduces the learning setting and the SGM algorithm. Main results with discussions and proof sketches are presented in Section 3. Finally, simple numerical simulations are given in Section 4 to complement our theoretical results. Notation For any a, b ∈R, a ∨b denotes the maximum of a and b. N is the set of all positive integers. For any T ∈N, [T] denotes the set {1, · · · , T}. For any two positive sequences {at}t∈[T ] and {bt}t∈[T ], the notation at ≲bt for all t ∈[T] means that there exists a positive constant C ≥0 such that C is independent of t and that at ≤Cbt for all t ∈[T]. 2 Learning with SGM We begin by introducing the learning setting we consider, and then describe the SGM learning algorithm. Following [19], the formulation we consider is close to the setting of functional regression, and covers the reproducing kernel Hilbert space (RKHS) setting as a special case. In particular, it reduces to standard linear regression for finite dimensions. 2.1 Learning Problems Let H be a separable Hilbert space, with inner product and induced norm denoted by ⟨·, ·⟩H and ∥· ∥H, respectively. Let the input space X ⊆H and the output space Y ⊆R. Let ρ be an unknown probability measure on Z = X × Y, ρX(·) the induced marginal measure on X, and ρ(·|x) the conditional probability measure on Y with respect to x ∈X and ρ. Considering the square loss function, the problem under study is the minimization of the risk, inf ω∈H E(ω), E(ω) = Z X×Y (⟨ω, x⟩H −y)2dρ(x, y), (1) when the measure ρ is known only through a sample z = {zi = (xi, yi)}m i=1 of size m ∈N, independently and identically distributed (i.i.d.) according to ρ. In the following, we measure the quality of an approximate solution ˆω ∈H (an estimator) considering the excess risk, i.e., E(ˆω) −inf ω∈H E(ω). (2) Throughout this paper, we assume that there exists a constant κ ∈[1, ∞[, such that ⟨x, x′⟩H ≤κ2, ∀x, x′ ∈X. (3) 2.2 Stochastic Gradient Method We study the following SGM (with mini-batches, without penalization or constraints). 2 Algorithm 1. Let b ∈[m]. Given any sample z, the b-minibatch stochastic gradient method is defined by ω1 = 0 and ωt+1 = ωt −ηt 1 b bt X i=b(t−1)+1 (⟨ωt, xji⟩H −yji)xji, t = 1, . . . , T, (4) where {ηt > 0} is a step-size sequence. Here, j1, j2, · · · , jbT are independent and identically distributed (i.i.d.) random variables from the uniform distribution on [m] 1. Different choices for the (mini-)batch size b can lead to different algorithms. In particular, for b = 1, the above algorithm corresponds to a simple SGM, while for b = m, it is a stochastic version of the batch gradient descent. The aim of this paper is to derive excess risk bounds for the above algorithm under appropriate assumptions. Throughout this paper, we assume that {ηt}t is non-increasing, and T ∈N with T ≥3. We denote by Jt the set {jl : l = b(t −1) + 1, · · · , bt} and by J the set {jl : l = 1, · · · , bT}. 3 Main Results with Discussions In this section, we first state some basic assumptions. Then, we present and discuss our main results. 3.1 Assumptions The following assumption is related to a moment hypothesis on |y|2. It is weaker than the often considered bounded output assumption, and trivially verified in binary classification problems where Y = {−1, 1}. Assumption 1. There exists constants M ∈]0, ∞[ and v ∈]1, ∞[ such that Z Y y2ldρ(y|x) ≤l!M lv, ∀l ∈N, (5) ρX-almost surely. To present our next assumption, we introduce the operator L : L2(H, ρX) →L2(H, ρX), defined by L(f) = R X⟨x, ·⟩Hf(x)ρX(x). Under Assumption (3), L can be proved to be positive trace class operators, and hence Lζ with ζ ∈R can be defined by using the spectrum theory [7]. The Hilbert space of square integral functions from H to R with respect to ρX, with induced norm given by ∥f∥ρ = R X |f(x)|2dρX(x) 1/2, is denoted by (L2(H, ρX), ∥· ∥ρ). It is well known that the function minimizing R Z(f(x) −y)2dρ(z) over all measurable functions f : H →R is the regression function, which is given by fρ(x) = Z Y ydρ(y|x), x ∈X. (6) Define another Hilbert space Hρ = {f : X →R|∃ω ∈H with f(x) = ⟨ω, x⟩H, ρX-almost surely}. Under Assumption 3, it is easy to see that Hρ is a subspace of L2(H, ρX). Let fH be the projection of the regression function fρ onto the closure of Hρ in L2(H, ρX). It is easy to see that the search for a solution of Problem (1) is equivalent to the search of a linear function from Hρ to approximate fH. From this point of view, bounds on the excess risk of a learning algorithm naturally depend on the following assumption, which quantifies how well, the target function fH can be approximated by Hρ. Assumption 2. There exist ζ > 0 and R > 0, such that ∥L−ζfH∥ρ ≤R. The above assumption is fairly standard [7, 19] in non-parametric regression. The bigger ζ is, the more stringent the assumption is, since Lζ1(L2(H, ρX)) ⊆Lζ2(L2(H, ρX)) when ζ1 ≥ζ2. In particular, for ζ = 0, we are assuming ∥fH∥ρ < ∞, while for ζ = 1/2, we are requiring fH ∈Hρ, since [25, 19] Hρ = L1/2(L2(H, ρX)). Finally, the last assumption relates to the capacity of the hypothesis space. 1Note that, the random variables j1, · · · , jbT are conditionally independent given the sample z. 3 Assumption 3. For some γ ∈]0, 1] and cγ > 0, L satisfies tr(L(L + λI)−1) ≤cγλ−γ, for all λ > 0. (7) The LHS of (7) is called as the effective dimension, or the degrees of freedom [30, 4]. It can be related to covering/entropy number conditions, see [25] for further details. Assumption 3 is always true for γ = 1 and cγ = κ2, since L is a trace class operator which implies the eigenvalues of L, denoted as σi, satisfy tr(L) = P i σi ≤κ2. This is referred as the capacity independent setting. Assumption 3 with γ ∈]0, 1] allows to derive better error rates. It is satisfied, e.g., if the eigenvalues of L satisfy a polynomial decaying condition σi ∼i−1/γ, or with γ = 0 if L is finite rank. 3.2 Main Results We start with the following corollary, which is a simplified version of our main results stated next. Corollary 3.1. Under Assumptions 2 and 3, let ζ ≥1/2 and |y| ≤M ρX-almost surely for some M > 0. Consider the SGM with 1) p∗= ⌈m 1 2ζ+γ ⌉, b = 1, ηt ≃1 m for all t ∈[(p∗m)], and ˜ωp∗= ωp∗m+1. If m is large enough, with high probability2, there holds EJ[E(˜ωp∗)] −inf ω∈H E ≲m− 2ζ 2ζ+γ . Furthermore, the above also holds for the SGM with3 2) or p∗= ⌈m 1 2ζ+γ ⌉, b = √m, ηt ≃ 1 √m for all t ∈[(p∗ √m)], and ˜ωp∗= ωp∗ √m+1. In the above, p∗is the number of ‘passes’ over the data, which is defined as ⌈bt m⌉at t iterations. The above result asserts that, at p∗passes over the data, the simple SGM with fixed step-size achieves optimal learning error bounds, matching those of ridge regression [4]. Furthermore, using mini-batch allows to use a larger step-size while achieving the same optimal error bounds. Remark 3.2 (Finite Dimensional Case). With a simple modification of our proofs, we can derive similar results for the finite dimensional case, i.e., H = Rd, where in this case, γ = 0. In particular, letting ζ = 1/2, under the same assumptions of Corollary 3.1, if one considers the SGM with b = 1 and ηt ≃1 m for all t ∈m2, then with high probability, EJ[E(ωm2+1)] −infω∈H E ≲d/m, provided that m ≳d log d. Our main theorem of this paper is stated next, and provides error bounds for the studied algorithm. For the sake of readability, we only consider the case ζ ≥1/2 in a fixed step-size setting. General results in a more general setting (ηt = η1t−θ with 0 ≤θ < 1, and/or the case ζ ∈]0, 1/2]) can be found in the appendix. Theorem 3.3. Under Assumptions 1, 2 and 3, let ζ ≥1/2, δ ∈]0, 1[, ηt = ηκ−2 for all t ∈[T], with η ≤ 1 8(log T +1). If m ≥mδ, then the following holds with probability at least 1 −δ: for all t ∈[T], EJ[E(ωt+1)] −inf ω∈H E ≤q1(ηt)−2ζ + q2m− 2ζ 2ζ+γ (1 + m− 1 2ζ+γ ηt)2 log2 T log2 1 δ +q3ηb−1(1 ∨m− 1 2ζ+γ ηt) log T. (8) Here, mδ, q1, q2 and q3 are positive constants depending on κ2, ∥T ∥, M, v, ζ, R, cγ, γ, and mδ also on δ (which will be given explicitly in the proof). There are three terms in the upper bounds of (8). The first term depends on the regularity of the target function and it arises from bounding the bias, while the last two terms result from estimating the sample variance and the computational variance (due to the random choices of the points), respectively. To derive optimal rates, it is necessary to balance these three terms. Solving this trade-off problem leads to different choices on η, T, and b, corresponding to different regularization strategies, as shown in subsequent corollaries. The first corollary gives generalization error bounds for SGM, with a universal step-size depending on the number of sample points. 2Here, ‘high probability’ refers to the sample z. 3Here, we assume that √m is an integer. 4 Corollary 3.4. Under Assumptions 1, 2 and 3, let ζ ≥1/2 , δ ∈]0, 1[, b = 1 and ηt ≃ 1 m for all t ∈[T], where T ≤m2. If m ≥mδ, then with probability at least 1 −δ, there holds EJ[E(ωt+1)] −inf ω∈H E ≲ m t 2ζ + m−2ζ+2 2ζ+γ  t m 2 · log2 m log2 1 δ , ∀t ∈[T], (9) and in particular, EJ[E(ωT ∗+1)] −inf ω∈H E ≲m− 2ζ 2ζ+γ log2 m log2 1 δ , (10) where T ∗= ⌈m 2ζ+γ+1 2ζ+γ ⌉. Here, mδ is exactly the same as in Theorem 3.3. Remark 3.5. Ignoring the logarithmic term and letting t = pm, Eq. (9) becomes EJ[E(ωpm+1)] −inf ω∈H E ≲p−2ζ + m−2ζ+2 2ζ+γ p2. A smaller p may lead to a larger bias, while a larger p may lead to a larger sample error. From this point of view, p has a regularization effect. The second corollary provides error bounds for SGM with a fixed mini-batch size and a fixed step-size (which depend on the number of sample points). Corollary 3.6. Under Assumptions 1, 2 and 3, let ζ ≥1/2, δ ∈]0, 1[, b = ⌈√m⌉and ηt ≃ 1 √m for all t ∈[T], where T ≤m2. If m ≥mδ, then with probability at least 1 −δ, there holds EJ[E(ωt+1)] −inf ω∈H E ≲ √m t 2ζ + m−2ζ+2 2ζ+γ  t √m 2 log2 m log2 1 δ , ∀t ∈[T], (11) and particularly, EJ[E(ωT ∗+1)] −inf ω∈H E ≲m− 2ζ 2ζ+γ log2 m log2 1 δ , (12) where T ∗= ⌈m 1 2ζ+γ + 1 2 ⌉. The above two corollaries follow from Theorem 3.3 with the simple observation that the dominating terms in (8) are the terms related to the bias and the sample variance, when a small step-size is chosen. The only free parameter in (9) and (11) is the number of iterations/passes. The ideal stopping rule is achieved by balancing the two terms related to the bias and the sample variance, showing the regularization effect of the number of passes. Since the ideal stopping rule depends on the unknown parameters ζ and γ, a hold-out cross-validation procedure is often used to tune the stopping rule in practice. Using an argument similar to that in Chapter 6 from [25], it is possible to show that this procedure can achieve the same convergence rate. We give some further remarks. First, the upper bound in (10) is optimal up to a logarithmic factor, in the sense that it matches the minimax lower rate in [4]. Second, according to Corollaries 3.4 and 3.6, bT ∗ m ≃m 1 2ζ+γ passes over the data are needed to obtain optimal rates in both cases. Finally, in comparing the simple SGM and the mini-batch SGM, Corollaries 3.4 and 3.6 show that a larger step-size is allowed to use for the latter. In the next result, both the step-size and the stopping rule are tuned to obtain optimal rates for simple SGM with multiple passes. In this case, the step-size and the number of iterations are the regularization parameters. Corollary 3.7. Under Assumptions 1, 2 and 3, let ζ ≥1/2, δ ∈]0, 1[, b = 1 and ηt ≃m− 2ζ 2ζ+γ for all t ∈[T], where T ≤m2. If m ≥mδ, and T ∗= ⌈m 2ζ+1 2ζ+γ ⌉, then (10) holds with probability at least 1 −δ. Remark 3.8. If we make no assumption on the capacity, i.e., γ = 1, Corollary 3.7 recovers the result in [29] for one pass SGM. The next corollary shows that for some suitable mini-batch sizes, optimal rates can be achieved with a constant step-size (which is nearly independent of the number of sample points) by early stopping. Corollary 3.9. Under Assumptions 1, 2 and 3, let ζ ≥1/2, δ ∈]0, 1[, b = ⌈m 2ζ 2ζ+γ ⌉and ηt ≃ 1 log m for all t ∈[T], where T ≤m2. If m ≥mδ, and T ∗= ⌈m 1 2ζ+γ ⌉, then (10) holds with probability at least 1 −δ. 5 According to Corollaries 3.7 and 3.9, around m 1−γ 2ζ+γ passes over the data are needed to achieve the best performance in the above two strategies. In comparisons with Corollaries 3.4 and 3.6 where around m ζ+1 2ζ+γ passes are required, the latter seems to require fewer passes over the data. However, in this case, one might have to run the algorithms multiple times to tune the step-size, or the mini-batch size. Finally, the last result gives generalization error bounds for ‘batch’ SGM with a constant step-size (nearly independent of the number of sample points). Corollary 3.10. Under Assumptions 1, 2 and 3, let ζ ≥1/2, δ ∈]0, 1[, b = m and ηt ≃ 1 log m for all t ∈[T], where T ≤m2. If m ≥mδ, and T ∗= ⌈m 1 2ζ+γ ⌉, then (10) holds with probability at least 1 −δ. As will be seen in the proof from the appendix, the above result also holds when replacing the sequence {ωt} by the sequence {νt}t generated from batch GM in (14). In this sense, we study the gradient-based learning algorithms simultaneously. 3.3 Discussions We compare our results with previous works. For non-parametric regression with the square loss, one pass SGM has been studied in, e.g., [29, 22, 26, 9]. In particular, [29] proved capacity independent rate of order O(m− 2ζ 2ζ+1 log m) with a fixed step-size η ≃m− 2ζ 2ζ+1 , and [9] derived capacity dependent error bounds of order O(m− 2 min(ζ,1) 2 min(ζ,1)+γ ) (when 2ζ + γ > 1) for the average. Note also that a regularized version of SGM has been studied in [26], where the derived convergence rate there is of order O(m− 2ζ 2ζ+1 ) assuming that ζ ∈[ 1 2, 1]. In comparison with these existing convergence rates, our rates from (10) are comparable, either involving the capacity condition, or allowing a broader regularity parameter ζ (which thus improves the rates). More recently, [19] studied multiple passes SGM with a fixed ordering at each pass, also called incremental gradient method. Making no assumption on the capacity, rates of order O(m− ζ ζ+1 ) (in L2(H, ρX)-norm) with a universal step-size η ≃1/m are derived. In comparisons, Corollary 3.4 achieves better rates, while considering the capacity assumption. Note also that [19] proved sharp rate in H-norm for ζ ≥1/2 in the capacity independent case. In fact, we can extend our analysis to the H-norm for Algorithm 4. We postpone this extension to a longer version of this paper. The idea of using mini-batches (and parallel implements) to speed up SGM in a general stochastic optimization setting can be found, e.g., in [21, 8, 24, 15]. Our theoretical findings, especially the interplay between the mini-batch size and the step-size, can give further insights on parallelization learning. Besides, it has been shown in [6, 8] that for one pass mini-batch SGM with a fixed stepsize η ≃b/√m and a smooth loss function, assuming the existence of at least one solution in the hypothesis space for the expected risk minimization, the convergence rate is of order O( p 1/m+b/m) by considering an averaging scheme. When adapting to the learning setting we consider, this reads as that if fH ∈Hρ, i.e., ζ = 1/2, the convergence rate for the average is O( p 1/m + b/m). Note that, fH does not necessarily belong to Hρ in general. Also, our derived convergence rate from Corollary 3.6 is better, when the regularity parameter ζ is greater than 1/2, or γ is smaller than 1. 3.4 Proof Sketch (Error Decomposition) The key to our proof is a novel error decomposition, which may be also used in analysing other learning algorithms. One may also use the approach in [12, 11] which is based on the error decomposition, i.e., for some suitably intermediate element ˜ω ∈H, EE(ωt) −inf w∈H E = [E(E(ωt) −Ez(ωt)) + EEz(˜ω) −E(˜ω)] + E(Ez(ωt) −Ez(˜ω)) + E(˜ω) −inf ω∈H E, where Ez denotes the empirical risk. However, one can only derive a sub-optimal convergence rate, since the proof procedure involves upper bounding the learning sequence to estimate the sample error (the first term of RHS). In this case the ‘regularity’ of the regression function can not be fully adapted for bounding the bias (the last term). Thanks to the property of squares loss, we can exploit a different error decomposition leading to better results. We first introduce two sequences. The population iteration is defined by µ1 = 0 and µt+1 = µt −ηt Z X (⟨µt, x⟩H −fρ(x))xdρX(x), t = 1, . . . , T. (13) 6 The above iterated procedure is ideal and can not be implemented in practice, since the distribution ρX is unknown in general. Replacing ρX by the empirical measure and fρ(xi) by yi, we derive the sample iteration (associated with the sample z), i.e., ν1 = 0 and νt+1 = νt −ηt 1 m m X i=1 (⟨νt, xi⟩H −yi)xi, t = 1, . . . , T. (14) Clearly, µt is deterministic and νt is a H-valued random variable depending on z. Given the sample z, the sequence {νt}t has a natural relationship with the learning sequence {ωt}t, since EJ[ωt] = νt. (15) Indeed, taking the expectation with respect to Jt on both sides of (4), and noting that ωt depends only on J1, · · · , Jt−1 (given any z), one has EJt[ωt+1] = ωt −ηt 1 m Pm i=1(⟨ωt, xi⟩H −yi)xi, and thus, EJ[ωt+1] = EJ[ωt] −ηt 1 m Pm i=1(⟨EJ[ωt], xi⟩H −yi)xi, t = 1, . . . , T, which satisfies the iterative relationship given in (14). By an induction argument, (15) can then be proved. Let Sρ : H →L2(H, ρX) be the linear map defined by (Sρω)(x) = ⟨ω, x⟩H, ∀ω, x ∈H. We have the following error decomposition. Proposition 3.11. We have EJ[E(ωt)] −inf f∈H E(f) ≤2∥Sρµt −fH∥2 ρ + 2∥Sρνt −Sρµt∥2 ρ + EJ[∥Sρωt −Sρνt∥2]. (16) Proof. For any ω ∈H, we have [25, 19] E(ω) −inff∈H E(f) = ∥Sρω −fH∥2 ρ. Thus, E(ωt) − inff∈H E(f) = ∥Sρωt −fH∥2 ρ, and EJ[∥Sρωt −fH∥2 ρ] = EJ[∥Sρωt −Sρνt + Sρνt −fH∥2 ρ] = EJ[∥Sρωt −Sρνt∥2 ρ + ∥Sρνt −fH∥2 ρ] + 2EJ⟨Sρωt −Sρνt, Sρνt −fH⟩ρ. Using (15) to the above, we get EJ[∥Sρωt −fH∥2 ρ] = EJ[∥Sρωt −Sρνt∥2 ρ + ∥Sρνt −fH∥2 ρ]. Now the proof can be finished by considering ∥Sρνt −fH∥2 ρ = ∥Sρνt −Sρµt + Sρµt −fH∥2 ρ ≤2∥Sρνt −Sρµt∥2 ρ + 2∥Sρµt −SρfH∥2 ρ. There are three terms in the upper bound of the error decomposition (16). We refer to the deterministic term ∥Sρµt −fH∥2 ρ as the bias, the term ∥Sρνt −Sρµt∥2 ρ depending on z as the sample variance, and EJ[∥Sρωt −Sρνt∥2 ρ] as the computational variance. The bias term is deterministic and is well studied in the literature, see e.g., [28] and also [19]. The main novelties are the estimate of the sample and computational variances. The proof of these results is quite lengthy and makes use of some ideas from [28, 23, 1, 29, 26, 20]. These three error terms will be estimated in the appendix, see Lemma B.2, Theorem C.6 and Theorem D.9. The bound in Theorem 3.3 thus follows plugging these estimations in the error decomposition. 4 Numerical Simulations In order to illustrate our theoretical results and the error decomposition, we first performed some simulations on a simple problem. We constructed m = 100 i.i.d. training examples of the form y = fρ(xi) + ωi. Here, the regression function is fρ(x) = |x −1/2| −1/2, the input point xi is uniformly distributed in [0, 1], and ωi is a Gaussian noise with zero mean and standard deviation 1, for each i ∈[m]. We perform three experiments with the same H, a RKHS associated with a Gaussian kernel K(x, x′) = exp(−(x −x′)2/(2σ2)) where σ = 0.2. In the first experiment, we run mini-batch SGM, where the mini-batch size b = √m, and the step-size ηt = 1/(8√m). In the second experiment, we run simple SGM where the step-size is fixed as ηt = 1/(8m), while in the third experiment, we run batch GM using the fixed step-size ηt = 1/8. For mini-batch SGM and SGM, the total error ∥Sρωt −fρ∥2 L2 ˆ ρ, the bias ∥Sρˆµt −fρ∥2 L2 ˆ ρ, the sample variance ∥Sρνt −Sρˆµt∥2 L2 ˆ ρ and the computational variance ∥Sρωt −Sρνt∥2 L2 ˆ ρ, averaged over 50 trials, are depicted in Figures 1a and 1b, respectively. For batch GM, the total error ∥Sρνt −fρ∥2 L2 ˆ ρ, the bias ∥Sρˆµt −fρ∥2 L2 ˆ ρ and the 7 0 20 40 60 80 100 120 140 160 180 200 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 Pass Error Minibatch SGM Bias Sample Error Computational Error Total Error (a) Minibatch SGM 0 20 40 60 80 100 120 140 160 180 200 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 Pass Error SGM Bias Sample Error Computational Error Total Error (b) SGM 0 20 40 60 80 100 120 140 160 180 200 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 Pass Error Batch GM Bias Sample Error Total Error (c) Batch GM Figure 1: Error decompositions for gradient-based learning algorithms on synthesis data, where m = 100. 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 4 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 Pass Error Classification Errors of Minibatch SGM Training Error Validation Error (a) Minibatch SGM 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 4 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 Pass Error Classification Errors of SGM Training Error Validation Error (b) SGM 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 4 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 Pass Error Classification Errors of GM Training Error Validation Error (c) Batch GM Figure 2: Misclassification Errors for gradient-based learning algorithms on BreastCancer dataset. sample variance ∥Sρνt −ˆµt∥2 L2 ˆ ρ, averaged over 50 trials are depicted in Figure 1c. Here, we replace the unknown marginal distribution ρX by an empirical measure ˆρ = 1 2000 P2000 i=1 δˆxi, where each ˆxi is uniformly distributed in [0, 1]. From Figure 1a or 1b, we see that as the number of passes increases4, the bias decreases, while the sample error increases. Furthermore, we see that in comparisons with the bias and the sample error, the computational error is negligible. In all these experiments, the minimal total error is achieved when the bias and the sample error are balanced. These empirical results show the effects of the three terms from the error decomposition, and complement the derived bound (8), as well as the regularization effect of the number of passes over the data. Finally, we tested the simple SGM, mini-batch SGM, and batch GM, using similar step-sizes as those in the first simulation, on the BreastCancer data-set 5. The classification errors on the training set and the testing set of these three algorithms are depicted in Figure 2. We see that all of these algorithms perform similarly, which complement the bounds in Corollaries 3.4, 3.6 and 3.10. Acknowledgments This material is based upon work supported by the Center for Brains, Minds and Machines (CBMM), funded by NSF STC award CCF-1231216. L. R. acknowledges the financial support of the Italian Ministry of Education, University and Research FIRB project RBFR12M3AC. References [1] F. Bauer, S. Pereverzev, and L. Rosasco. On regularization algorithms in learning theory. Journal of Complexity, 23(1):52–72, 2007. [2] O. Bousquet and L. Bottou. The tradeoffs of large scale learning. In Advances in Neural Information Processing Systems, pages 161–168, 2008. [3] S. Boyd and A. Mutapcic. Stochastic subgradient methods. Notes for EE364b, Standford University, Winter 2007. 4Note that the terminology ‘running the algorithm with p passes’ means ‘running the algorithm with ⌈mp/b⌉ iterations’, where b is the mini-batch size. 5https://archive.ics.uci.edu/ml/datasets/ 8 [4] A. Caponnetto and E. De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368, 2007. [5] N. Cesa-Bianchi, A. Conconi, and C. Gentile. On the generalization ability of on-line learning algorithms. IEEE Transactions on Information Theory, 50(9):2050–2057, 2004. [6] A. Cotter, O. Shamir, N. Srebro, and K. Sridharan. Better mini-batch algorithms via accelerated gradient methods. In Advances in Neural Information Processing Systems, pages 1647–1655, 2011. [7] F. Cucker and D.-X. Zhou. Learning Theory: an Approximation Theory Viewpoint, volume 24. Cambridge University Press, 2007. [8] O. Dekel, R. Gilad-Bachrach, O. Shamir, and L. Xiao. Optimal distributed online prediction using mini-batches. Journal of Machine Learning Research, 13(1):165–202, 2012. [9] A. Dieuleveut and F. Bach. Non-parametric stochastic approximation with large step sizes. Annals of Statistics, 44(4):1363–1399, 2016. [10] M. Hardt, B. Recht, and Y. Singer. Train faster, generalize better: Stability of stochastic gradient descent. In International Conference on Machine Learning, 2016. [11] J. Lin, R. Camoriano, and L. Rosasco. Generalization properties and implicit regularization of multiple passes SGM. In International Conference on Machine Learning, 2016. [12] J. Lin, L. Rosasco, and D.-X. Zhou. Iterative regularization for learning with convex loss functions. Journal of Machine Learning Research, 17(77):1–38, 2016. [13] S. Minsker. On some extensions of bernstein’s inequality for self-adjoint operators. arXiv preprint arXiv:1112.5448, 2011. [14] A. Nemirovski, A. Juditsky, G. Lan, and A. Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009. [15] A. Ng. Machine learning. Coursera, Standford University, 2016. [16] F. Orabona. Simultaneous model selection and optimization through parameter-free stochastic learning. In Advances in Neural Information Processing Systems, pages 1116–1124, 2014. [17] I. Pinelis and A. Sakhanenko. Remarks on inequalities for large deviation probabilities. Theory of Probability & Its Applications, 30(1):143–148, 1986. [18] B. T. Poljak. Introduction to Optimization. Optimization Software, 1987. [19] L. Rosasco and S. Villa. Learning with incremental iterative regularization. In Advances in Neural Information Processing Systems, pages 1621–1629, 2015. [20] A. Rudi, R. Camoriano, and L. Rosasco. Less is more: Nyström computational regularization. In Advances in Neural Information Processing Systems, pages 1648–1656, 2015. [21] S. Shalev-Shwartz, Y. Singer, N. Srebro, and A. Cotter. Pegasos: Primal estimated sub-gradient solver for svm. Mathematical Programming, 127(1):3–30, 2011. [22] O. Shamir and T. Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In International Conference on Machine Learning, pages 71–79, 2013. [23] S. Smale and D.-X. Zhou. Learning theory estimates via integral operators and their approximations. Constructive Approximation, 26(2):153–172, 2007. [24] S. Sra, S. Nowozin, and S. J. Wright. Optimization for Machine Learning. MIT Press, 2012. [25] I. Steinwart and A. Christmann. Support Vector Machines. Springer Science Business Media, 2008. [26] P. Tarres and Y. Yao. Online learning as stochastic approximation of regularization paths: Optimality and almost-sure convergence. IEEE Transactions on Information Theory, 60(9):5716– 5735, 2014. [27] J. A. Tropp. User-friendly tools for random matrices: An introduction. Technical report, DTIC Document, 2012. [28] Y. Yao, L. Rosasco, and A. Caponnetto. On early stopping in gradient descent learning. Constructive Approximation, 26(2):289–315, 2007. [29] Y. Ying and M. Pontil. Online gradient descent learning algorithms. Foundations of Computational Mathematics, 8(5):561–596, 2008. [30] T. Zhang. Learning bounds for kernel regression using effective data dimensionality. Neural Computation, 17(9):2077–2098, 2005. 9
2016
564
6,510
General Tensor Spectral Co-clustering for Higher-Order Data Tao Wu Purdue University wu577@purdue.edu Austin R. Benson Stanford University arbenson@stanford.edu David F. Gleich Purdue University dgleich@purdue.edu Abstract Spectral clustering and co-clustering are well-known techniques in data analysis, and recent work has extended spectral clustering to square, symmetric tensors and hypermatrices derived from a network. We develop a new tensor spectral co-clustering method that simultaneously clusters the rows, columns, and slices of a nonnegative three-mode tensor and generalizes to tensors with any number of modes. The algorithm is based on a new random walk model which we call the super-spacey random surfer. We show that our method out-performs state-of-the-art co-clustering methods on several synthetic datasets with ground truth clusters and then use the algorithm to analyze several real-world datasets. 1 Introduction Clustering is a fundamental task in machine learning that aims to assign closely related entities to the same group. Traditional methods optimize some aggregate measure of the strength of pairwise relationships (e.g., similarities) between items. Spectral clustering is a particularly powerful technique for computing the clusters when the pairwise similarities are encoded into the adjacency matrix of a graph. However, many graph-like datasets are more naturally described by higher-order connections among several entities. For instance, multilayer or multiplex networks describe the interactions between several graphs simultaneously with node-node-layer relationships [17]. Nonnegative tensors are a common representation for many of these higher-order datasets. For instance the i, j, k entry in a third-order tensor might represent the similarity between items i and j in layer k. Here we develop the General Tensor Spectral Co-clustering (GTSC) framework for clustering tensor data. The algorithm takes as input a nonnegative tensor, which may be sparse, non-square, and asymmetric, and outputs subsets of indices from each dimension (co-clusters). Underlying our method is a new stochastic process that models higher-order Markov chains, which we call a superspacey random walk. This is used to generalize ideas from spectral clustering based on random walks. We introduce a variant on the well-known conductance measure from spectral graph partitioning [24] that we call biased conductance and describe how this provides a tensor partition quality metric; this is akin to Chung’s use of circulations to spectrally-partition directed graphs [7]. Essentially, biased conductance is the exit probability from a set following our new super-spacey random walk model. We use experiments on both synthetic and real-world problems to validate the effectiveness of our method1. For the synthetic experiments, we devise a “planted cluster” model for tensors and show that GTSC has superior performance compared to other state-of-the-art clustering methods in recovering the planted clusters. In real-world tensor data experiments, we find that our GTSC framework identifies stop-words and semantically independent sets in n-gram tensors as well as worldwide and regional airlines and airports in a flight multiplex network. 1Code and data for this paper are available at: https://github.com/wutao27/GtensorSC 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 1.1 Related work The Tensor Spectral Clustering (TSC) algorithm [4], another generalization of spectral methods to higher-order graph data [4], is closely related. Both the perspective and high-level view are similar, but the details differ in important ways. For instance, TSC was designed for the case when the higher-order tensor recorded the occurrences of small subgraph patterns within the network. This imposes limitations, including how, because the tensor arose based on some underlying graph that the partitioning metric was designed explicitly for a graph. Thus, the applications are limited in scope and cannot model, for example, the airplane-airplane-airport multiplex network we analyze in Section 3.2. Second, for sparse data, the model used by TSC required a correction term with magnitude proportional to the sparsity in the tensor. In sparse tensors, this makes it difficult to accurately identify clusters, which we show in Section 3.1. Most other approaches to tensor clustering proceed by using low-rank factorizations [15, 21]. or a k-means objective [16]. In contrast, our work is based on a stochastic interpretation (escape probabilities from a set), in the spirit of random walks in spectral clustering for graphs. There are also several methods specific to clustering multiplex networks [27, 20] and clustering graphs with multiple entities [11, 2]. Our method handles general tensor data, which includes these types of datasets as a special case. Hypergraphs clustering [14] can also model the higher-order structures of the data, and in the case of tensor data, it is approximated by a standard weighted graph. 1.2 Background on spectral clustering of graphs from the perspective of random walks We first review graph clustering methods from the view of graph cuts and random walks, and then review the standard spectral clustering method using sweep cuts. In Section 2, we generalize these notions to higher-order data in order to develop our GTSC framework. Let A ∈Rn×n + be the adjacency matrix of an undirected graph G = (V, E) and let n = |V | be the number of nodes in the graph. Define the diagonal matrix of degrees of vertices in V as D = diag(Ae), where e is the vector with all ones. The graph Laplacian is L = D −A and the transition matrix is P = AD−1 = AT D−1. The transition matrix represents the transition probabilities of a random walk on the graph. If a walker is at node j, it transitions to node i with probability Pij = Aji/Djj. Conductance. One of the most widely-used quality metrics for partitioning a graph’s vertices into two sets S and ¯S = V \S is conductance [24]. Intuitively, conductance measures the ratio of the number of edges in the graph that go between S and ¯S to the number of edges in S or ¯S. Formally, we define conductance as: φ(S) = cut(S)/min vol(S), vol( ¯S)  , (1) where cut(S) = X i∈S,j∈¯S Aij and vol(S) = X i∈S,j∈V Aij. (2) A set S with small conductance is a good partition (S, ¯S). The following well-known observation relates conductance to random walks on the graph. Observation 1 ([18]) Let G be undirected, connected, and not bipartite. Start a random walk (Zt)t∈N where the initial state X0 is randomly chosen following the stationary distribution of the random walk. Then for any set S ∈V , φ(S) = max  Pr(Z1 ∈¯S | Z0 ∈S), Pr(Z1 ∈S | Z0 ∈¯S) . This provides an alternative view of conductance—it measures the probability that one step of a random walk will traverse between S and ¯S. This random walk view, in concert with the super-spacey random walk, will serve as the basis for our biased conductance idea to partition tensors in Section 2.4. Partitioning with a sweep cut. Finding the set of minimum conductance is an NP-hard combinatorial optimization problem [26]. However, there are real-valued relaxations of the problem that are tractable to solve and provide a guaranteed approximation [19, 9]. The most well known computes an eigenvector called the Fiedler vector and then uses a sweep cut to identify a partition based on this eigenvector. 2 The Fiedler eigenvector z solves Lz = λDz where λ is the second smallest generalized eigenvalue. This can be equivalently formulated in terms of the random walk transition matrix P . Specifically, Lz = λDz ⇔ (I −D−1A)z = λz ⇔ zT P = (1 −λ)zT . The sweep cut procedure to identify a low-conductance set S from z is as follows: 1. Sort the vertices by z as zσ1 ≤zσ2 ≤· · · ≤zσn. 2. Consider the n −1 candidate sets Sk = {σ1, σ2, · · · , σk} for 1 ≤k ≤n −1 3. Choose S = argminSkφ(Sk) as the solution set. The solution set S from this algorithm satisfies the celebrated Cheeger inequality [19, 8]: φ(S) ≤ 2 p φopt, where φopt = minS⊂V φ(S) is the minimum conductance over any set of nodes. Computing φ(Sk) for all k only takes time linear in the number of edges in the graph because Sk+1 and Sk differ only in the vertex σk+1. To summarize, the spectral method requires two components: the second left eigenvector of P and the conductance criterion. We generalize these ideas to tensors in the following section. 2 A higher-order spectral method for tensor co-clustering We now generalize the ideas from spectral graph partitioning to nonnegative tensor data. We first review our notation for tensors and then show how tensor data can be interpreted as a higher-order Markov chain. We briefly review Tensor Spectral Clustering [4] before introducing the new superspacey random walk that we use here. This super-spacey random walk will allow us to compute a vector akin to the Fiedler vector for a tensor and to generalize conductance to tensors. Furthermore, we generalize the ideas from co-clustering in bipartite graph data [10] to rectangular tensors. 2.1 Preliminaries and tensor notation We use T to denote a tensor. As a generalization of a matrix, T has m indices (making T an mth-order or m-mode tensor), with the (i1, i2, ·, im) entry denoted Ti1,i2,··· ,im. We will work with non-negative tensors where Ti1,i2,··· ,im ≥0. We call a subset of the tensor entries with all but the first element fixed a column of the tensor. For instance, the j, k column of a three-mode tensor T is T:,j,k. A tensor is square if the dimension of all the modes is equal and rectangular if not, and a square tensor is symmetric if it is equal for any permutation of the indices. For simplicity in the remainder of our exposition, we will focus on three-mode tensors. However, all of or ideas generalize to an arbitrary number of modes. (See, e.g., the work of Gleich et al. [13] and Benson et al. [5] for representative examples of how these generalizations work.) Finally, we use two operations between a tensor and a vector. First, a tensor-vector product with a three-mode tensor can output a vector, which we denote by: y = T x2 ⇔ yi = P j,k Ti,j,kxjxk. Second, a tensor-vector product can also produce a matrix, which we denote by: A = T [x] ⇔ Ai,j = P k Ti,j,kxk. 2.2 Forming higher-order Markov chains from nonnegative tensor data Recall from Section 1.2 that we can form the transition matrix for a Markov chain from a square non-negative matrix A by normalizing the columns of the matrix AT . We can generalize this idea to define a higher-order Markov chain by normalizing a square tensor. This leads to a probability transition tensor P : Pi,j,k = Ti,j,k/ P i Ti,j,k (3) where we assume P i Ti,j,k > 0. In Section 2.3, we will discuss the sparse case where the column T:,j,k may be entirely zero. When that case does not arise, entries of P can be interpreted as the transition probabilities of a second-order Markov chain (Zt)t∈N: Pi,j,k = Pr(Zt+1 = i | Zt = j, Zt−1 = k). In other words, If the last two states were j and k, then the next state is i with probability Pi,j,k. 3 It is possible to turn any higher-order Markov chain into a first-order Markov chain on the product state space of all ordered pairs (i, j). The new Markov chain moves to the state-pair (i, j) from (j, k) with probability Pi,j,k. Computing the Fiedler vector associated with this chain would be one approach to tensor clustering. However, there are two immediate problems. First, the eigenvector is of size n2, which quickly becomes infeasible to store. Second, the eigenvector gives information about the product space—not the original state space. (In future work we plan to explore insights from marginals of this distribution.) Recent work uses the spacey random walk and spacey random surfer stochastic processes to circumvent these issues [5]. The process is non-Markovian and generates a sequence of states Xt as follows. After arriving at state Xt, the walker promptly “spaces out” and forgets the state Xt−1, yet it still wants to transition according to the higher-order transitions P . Thus, it invents a state Yt by drawing a random state from its history and then transitions to state Xt+1 with probability PXt+1,Xt,Yt. We denote Ind{·} as the indicator event and Ht as the history of the process up to time t,2 then Pr(Yt = j | Ht) = 1 t+n  1 + Pt r=1 Ind{Xr = j}  . (4) In this case, we assume that the process has a non-zero probability of picking any state by inflating its history count by 1 visit. The spacey random surfer is a generalization where the walk follows the above process with probability α and teleports at random following a stochastic vector v with probability 1 −α. This is akin to how the PageRank random walk includes teleportation. Limiting stationary distributions are solutions to the multilinear PageRank problem [13]: αP x2 + (1 −α)v = x, (5) and the limiting distribution x represents the stationary distribution of the transition matrix P [x] [5]. The transition matrix P [x] asymptotically approximates the spacey walk or spacey random surfer. Thus, it is feasible to compute an eigenvector of P [x] matrix and use it with the sweep cut procedure on a generalized notion of conductance. However, this derivation assumes that all n2 columns of T were non-zero, which does not occur in real-world datasets. The TSC method adjusted the tensor T and replaced any columns of all zeros with the uniform distribution vector [4]. Because the number of zero-columns may be large, this strategy dilutes the information in the eigenvector (see Appendix D.1). We deal with this issue more generally in the following section, and note that our new solution outperforms TSC in our experiments (Section 3). 2.3 A stochastic process for sparse tensors Here we consider another model of the random surfer that avoids the issue of undefined transitions— which correspond to columns of T that are all zero—entirely. If the surfer attempts to use an undefined transition, then the surfer moves to a random state drawn from history. Formally, define the set of feasible states by F = {(j, k) | X i Ti,j,k > 0}. (6) Here, the set F denotes all the columns in T that are non-zero. The transition probabilities of our proposed stochastic process are given by Pr(Xt+1 = i | Xt = j, Ht) (7) = (1 −α)vi + α P k Pr(Xt+1 = i | Xt = j, Yt = k, Ht)Pr(Yt = k | Ht) Pr(Xt+1 = i | Xt = j, Yt = k, Ht) = ( Ti,j,k/ P i Ti,j,k (j, k) ∈F 1 n+t(1 + Pt r=1 Ind{Xr = i}) (j, k) ̸∈F, (8) where vi is the teleportation probability. Again Yt is chosen according to Equation (4). We call this process the super-spacey random surfer because when the transitions are not defined it picks a random state from history. This process is a (generalized) vertex-reinforced random walk [3]. Let P be the normalized tensor Pi,j,k = Ti,j,k/ P i Ti,j,k only for the columns in F and where all other entries are zero. Stationary distributions of the stochastic process must satisfy the following equation: αP x2 + α(1 −∥P x2∥1)x + (1 −α)v = x, (9) 2Formally, this is the σ-algebra generated by the states X1, . . . , Xt. 4 where x is a probability distribution vector (see Appendix A.1 for a proof). At least one solution vector x must exist, which follows directly from Brouwer’s fixed-point theorem. Here we give a sufficient condition for it to be unique and easily computable. Theorem 2.1 If α < 1/(2m −1) then there is a unique solution x to (9) for the general m-mode tensor. Furthermore, the iterative fixed point algorithm xk+1 = αP x2 k + α(1 −∥P x2 k∥1)xk + (1 −α)vk (10) will converge at least linearly to this solution. This is a nonlinear setting and tighter convergence results are currently unknown, but these are unlikely to be tight on real-world data. For our experiments, we found that high values (e.g., 0.95) of α do not impede convergence. We use α = 0.8 for all our experiments. In the following section, we show how to form a Markov chain from x and then develop our spectral clustering technique by operating on the corresponding transition matrix. 2.4 First-order Markov approximations and biased conductance for tensor partitions From Observation 1 in Section 1.2, we know that conductance may be interpreted as the exit probability between two sets that form a partition of the nodes in the graph. In this section, we derive an equivalent first-order Markov chain from the stationary distribution of the super-spacey random surfer. If this Markov chain was guaranteed to be reversible, then we could apply the standard definitions of conductance and the Fiedler vector. This will not generally be the case, and so we introduce a biased conductance measure to partition this non-reversible Markov chain with respect to starting in the stationary distribution of the super-spacey random walk. We use the second largest, real-valued eigenvector of the Markov chain as an approximate Fiedler vector. Thus, we can use the sweep cut procedure described in Section 1.2 to identify the partition. Forming a first-order Markov chain approximation. In the following derivation, we use the property of the two tensor-vector products that P [x]x = P x2. The stationary distribution x for the super-spacey random surfer is equivalently the stationary distribution of the Markov chain with transition matrix α P [x] + x(eT −eT P [x])  + (1 −α)veT . (Here we have used the fact that x ≥0 and eT x = 1.) The above transition matrix denotes transitioning based on a first-order Markov chain with probability α, and based on a fixed vector v with probability 1 −α. We introduce this following first-order Markov chain ˜ P = P [x] + x(eT −eT P [x]), which represents a useful (but crude) approximation of the higher-order structure in the data. First, we determine how often we visit states using the super-spacey random surfer to get a vector x. Then the Markov chain ˜ P will tend to have a large probability of spending time in states where the higher-order information concentrates. This matrix represents a first-order Markov chain on which we can compute an eigenvector and run a sweep cut. Biased conductance. Consider a random walk (Zt)t∈N. We define the biased conductance φp(S) of a set S ⊂{1, . . . , n} to be φp(S) = max  Pr(Z1 ∈¯S | Z0 ∈S), Pr(Z1 ∈S | Z0 ∈¯S) , where Z0 is chosen according to a fixed distribution p. Just as with the standard definition of conductance, we can interpret biased conductance as an escape probability. However, the initial state Z0 is not chosen following the stationary distribution (as in the standard definition with a reversible chain) but following p instead. This is why we call it biased conductance. We apply this measure to ˜ P using p = x (the stationary distribution of the super-spacey walk). This choice emphasizes the higher-order information. Our idea of biased conductance is equivalent to how Chung defines a conductance score for a directed graph [7]. We use the eigenvector of ˜ P with the second-largest real eigenvalue as an analogue of the Fiedler vector. If the chain were reversible, this would be exactly the Fiedler vector. When it is not, then the vector coordinates still encode indications of state clustering [25]; hence, this vector serves as a principled heuristic. It is important to note that although ˜ P is a dense matrix, we can implement the two operations we need with ˜ P in time and space that depends only on the number of non-zeros of the sparse tensor P using standard iterative methods for eigenvalues of matrices (see Appendix B.1). 5 2.5 Handling rectangular tensor data So far, we have only considered square, symmetric tensor data. However, tensor data are often rectangular. This is usually the case when the different modes represent different types of data. For example, in Section 3.2, we examine a tensor T ∈Rp×n×n of airline flight data, where Ti,j,k represents that there is a flight from airport j to airport k on airline i. Our approach is to embed the rectangular tensor into a larger square tensor and then symmetrize this tensor, using approaches developed by Ragnarsson and Van Loan [23]. After the embedding, we can Figure 1: The tensor is first embedded into a larger square tensor (left) and then this square tensor is symmetrized (right). run our algorithm to simultaneously cluster rows, columns, and slices of the tensor. This approach is similar in style to the symmetrization of bipartite graphs for co-clustering proposed by Dhillon [10]. Let U be an n-by-m-by-ℓrectangular tensor. Then we embed U into a square three-mode tensor T with n + m + ℓdimensions and where Ui,j,k = Ti,j+n,k+n+m. This is illustrated in Figure 1 (left). Then we symmetrize the tensor by using all permutations of the indices Figure 1 (right). When viewed as a 3-by-3-by-3 block tensor, the tensor is T =  0 0 0 0 0 U (2,3,1) 0 U (3,2,1) 0 0 0 U (1,3,2) 0 0 0 U (3,1,2) 0 0 0 U (1,2,3) 0 U (2,1,3) 0 0 0 0 0  , where U (1,3,2) is a generalized transpose of U with the dimensions permuted. 2.6 Summary of the algorithm Our GTSC algorithm works by recursively applying the sweep cut procedure, similar to the recursive bisection procedures for clustering matrix-based data [6]. Formally for each cut, we: 1. Compute the super-spacey stationary vector x (Equation (9)) and form P [x]. 2. Compute second largest left, real-valued eigenvector z of ˜ P = P [x] + x(eT −eT P [x]). 3. Sort the vertices by the eigenvector z as zσ1 ≤zσ2 ≤· · · ≤zσn. 4. Find the set Sk = {σ1, . . . , σk} for which the biased conductance φx(Sk) on transition matrix ˜ P is minimized. We continue partitioning as long as the clusters are large enough or we can get good enough splits. Specifically, if a cluster has dimension less than a specified size minimum size, we do not consider it for splitting. Otherwise, the algorithm recursively splits the cluster if either (1) its dimension is above some threshold or (2) the biased conductance of a new split is less than a target value φ∗3. The overall algorithm is summarized in Appendix B as well as the algorithm complexity. Essentially, the algorithm scales linearly in the number of non-zeros of the tensor for each cluster that is produced. 3 Experiments We now demonstrate the efficacy of our method by clustering synthetic and real-world data. We find that our method is better at recovering planted cluster structure in synthetically generated tensor data compared to other state-of-the-art methods. Please refer to Appendix C for the parameter details. 3.1 Synthetic data We generate tensors with planted clusters and try to recover the clusters. For each dataset, we generate 20 groups of nodes that will serve as our planted clusters, where the number of nodes in each group from a truncated normal distribution with mean 20 and variance 5 so that each group has at least 4 nodes. For each group g we also assign a weight wg where the weight depends on the group number. For group i, the weight is (σ √ 2π)−1 exp(−(i −10.5)2/(2σ2)), where σ varies by experiment. Non-zeros correspond to interactions between three indices (triples). We generate tw triples whose indices are within a group and ta triples whose indices span across more than one group. 3We tested φ∗from 0.3 to 0.4, and we found the value of φ∗is not very sensitive to the experimental results. 6 Table 1: Adjusted Rand Index (ARI), Normalized Mutual Information (NMI), and F1 scores on various clustering methods for recovering synthetically generated tensor data with planted cluster structure. The ± entries are the standard deviation over 5 trials. ARI NMI F1 ARI NMI F1 Square tensor with σ = 4 Rectangular tensor with σ = 4 GTSC 0.99±0.01 0.99±0.00 0.99±0.01 0.97±0.06 0.98±0.03 0.97±0.05 TSC 0.42±0.05 0.60±0.04 0.45±0.04 0.38±0.17 0.53±0.15 0.41±0.16 PARAFAC 0.82±0.05 0.94±0.02 0.83±0.04 0.81±0.04 0.90±0.02 0.82±0.04 SC 0.99±0.01 0.99±0.01 0.99±0.01 0.91±0.06 0.94±0.04 0.91±0.06 MulDec 0.48±0.05 0.66±0.03 0.51±0.05 0.27±0.06 0.39±0.05 0.32±0.05 Square tensor with σ = 2 Rectangular tensor with σ = 2 GTSC 0.78±0.13 0.89±0.06 0.79±0.12 0.96±0.06 0.97±0.04 0.96±0.06 TSC 0.41±0.11 0.60±0.09 0.44±0.10 0.28±0.08 0.44±0.10 0.32±0.08 PARAFAC 0.48±0.08 0.67±0.04 0.50±0.07 0.10±0.04 0.24±0.05 0.15±0.04 SC 0.43±0.07 0.66±0.04 0.47±0.06 0.38±0.07 0.52±0.05 0.41±0.07 MulDec 0.19±0.01 0.37±0.01 0.24±0.01 0.08±0.01 0.19±0.02 0.14±0.01 The tw triples are chosen by first uniformly selecting a group g and then uniformly selecting three indices i, j, and k from group g and finally assigning a weight of wg. For the ta triples, the sampling procedure first selects an index i from group gi with a probability proportional to the weights of the group. In other words, indices in group g are chosen proportional to wg. Two indices j and k are then selected uniformly at random from groups gj and gk other than gi. Finally, the weight in the tensor is assigned to be the average of the three group weights. For rectangular data, we follow a similar procedure where we distinguish between the indices for each mode of the tensor. For our experiments, tw = 10, 000 and ta = 1, 000, and the variance σ that controls the group weights is 2 or 4. For each value of σ, we create 5 sample datasets. The value of σ affects the concentration of the weights and how certain groups of nodes interact with others. This skew reflects properties of the real-world networks we examine in the next section. Our GTSC method is compared with Tensor Spectral Clustering (TSC) [4], the Tensor Decomposition PARAFAC [1], Spectral Clustering (SC) via Multilinear SVD [12] and Multilinear Decomposition (MulDec) [21]. Table 1 depicts the performances of the four algorithms in recovering the planted clusters. In all cases, GTSC has the best performance. We note that the running time is a few seconds for GTSC, TSC and SC and nearly 30 minutes for PARAFAC and MulDec per trial. Note that the tensors have roughly 50, 000 non-zeros. The poor scalability prohibits the later two methods from being applied to the real-world tensors in the following section. 3.2 Case study in airline flight networks Figure 2: Visualization of the airline-airport data tensor. The x and y axes index airports and the z axis indexes airlines. A dot represents that an airline flies between those two airports. On the left, indices are sorted randomly. On the right, indices are sorted by the co-clusters found by our GTSC framework, which reveals structure in the tensor. We now turn to studying real-world tensor datasets. We first cluster an airline-airport multimodal network which consists of global air flight routes from 539 airlines and 2, 939 airports4. In this application, the entry Ti,j,k of the three-mode tensor T is 1 if airline i flies between airports j and k and 0 otherwise. Figure 2 illustrates the connectivity of the tensor with a random ordering of the indices (left) and the ordering given by the popularity of co-clusters (right). We can see that after the co-clustering, there is clear structure in the data tensor. One prominent cluster found by the method corresponds to large international airports in cities such as Beijing and New York City. This group only accounts for 8.5% of the total number of airports, but it is responsible for 59% of the total routes. Figure 2 illustrates this result—the airports with the highest 4Data were collected from http://openflights.org/data.html#route. 7 indices are connected to almost every other airport. This cluster is analogous to the “stop word” group we will see in the n-gram experiments. Most other clusters are organized geographically. Our GTSC framework finds large clusters for Europe, the United States, China/Taiwan, Oceania/SouthEast Asia, and Mexico/Americas. Interestingly, Cancún International Airport is included with the United States cluster, likely due to large amounts of tourism. 3.3 Case study on n-grams Next, we study data from n-grams (consective sequences of words in texts). We construct a square mode-n tensor where indices correspond to words. An entry in the tensor is the number of occurrences this n-gram. We form tensors from both English and Chinese corpora for n = 3, 4.5 The non-zeros in the tensor consist of the frequencies of the one million most frequent n-grams. English n-grams. We find several conclusions that hold for both tensor datasets. Two large groups in both datasets consist of stop words, i.e., frequently occuring connector words. In fact, 48% (3-gram) and 64% (4-gram) of words in one cluster are prepositions (e.g., in, of, as, to) and link verbs (e.g., is, get, does). In the another cluster, 64% (3-gram) and 57% (4-gram) of the words are pronouns (e.g., we, you, them) and link verbs. This result matches the structure of English language where link verbs can connect both prepositions and pronouns whereas prepositions and pronouns are unlikely to appear in close vicinity. Other groups consist of mostly semantically related English words, e.g., {cheese, cream, sour, low-fat, frosting, nonfat, fat-free} and {bag, plastic, garbage, grocery, trash, freezer}. The clustering of the 4-gram tensor contains some groups that the 3-gram tensor fails to find, e.g., {german, chancellor, angela, merkel, gerhard, schroeder, helmut, kohl}. In this case, Angela Merkel, Gerhard Schroeder, and Helmut Kohl have all been German chancellors, but it requires a 4-gram to make this connection strong. Likewise, some clusters only appear from clustering the 3-gram tensor. One such cluster is {church, bishop, catholic, priest, greek, orthodox, methodist, roman, episcopal}. In 3-grams, we may see phrases such as “catholic church bishop", but 4-grams containing these words likely also contain stop words, e.g., “bishop of the church". However, since stop words already form their own cluster, this connection is destoryed. Chinese n-grams. We find that many of the conclusions from the English n-gram datasets also hold for the Chinese n-gram datasets. This includes groups of stop words and semantically related words. For example, there are two clusters consisting of mostly stop words (200 most frequently occurring words) from the 3-gram and 4-gram tensors. In the 4-gram data, one cluster of 31 words consists entirely of stop words and another cluster contains 36 total words, of which 23 are stop words. There are some words from the two groups that are not typically considered as stop words, e.g., 社会society, 经济economy, 发展develop, 主义-ism, 国家nation, 政府government These words are also among the top 200 most common words according to the corpus. This is a consequence of the dataset coming from scanned Chinese-language books and is a known issue with the Google Books corpus [22]. In this case, it is a feature as we are illustrating the efficacy of our tensor clustering framework rather than making any linguistic claims. 4 CONCLUSION In this paper we developed the General Tensor Spectral Co-clustering (GTSC) method for coclustering the modes of nonnegative tensor data. Our method models higher-order data with a new stochastic process, the super-spacey random walk, which is a variant of a higher-order Markov chain. With the stationary distribution of this process, we can form a first-order Markov chain which captures properties of the higher-order data and then use tools from spectral graph partitioning to find co-clusters. In future work, we plan to create tensors that bridge information from multiple modes. For instance, clusters in the n-gram data depended on n, e.g., the names of various German chancellors only appeared as a 4-gram cluster. It would be useful to have a holistic tensor to jointly partition both 3- and 4-gram information. Acknowledgements. TW and DFG are supported by NSF IIS-1422918 and DARPA SIMPLEX. ARB is supported by a Stanford Graduate Fellowship. 5English n-gram data were collected from http://www.ngrams.info/intro.asp and Chinese n-gram data were collected from https://books.google.com/ngrams. 8 References [1] B. W. Bader, T. G. Kolda, et al. Matlab tensor toolbox version 2.6. Available online, February 2015. [2] B.-K. Bao, W. Min, K. Lu, and C. Xu. Social event detection with robust high-order co-clustering. In ICMR, pages 135–142, 2013. [3] M. Benaïm. Vertex-reinforced random walks and a conjecture of pemantle. Ann. Prob., 25(1):361–392, 1997. [4] A. R. Benson, D. F. Gleich, and J. Leskovec. Tensor spectral clustering for partitioning higher-order network structures. In SDM, pages 118–126, 2015. [5] A. R. Benson, D. F. Gleich, and L.-H. Lim. The spacey random walk: a stochastic process for higher-order data. arXiv, cs.NA:1602.02102, 2016. [6] D. Boley. Principal direction divisive partitioning. Data Mining and Knowledge Discovery, 2(4):325–344, 1998. [7] F. Chung. Laplacians and the Cheeger inequality for directed graphs. Annals of Combinatorics, 9(1):1–19, 2005. 10.1007/s00026-005-0237-z. [8] F. Chung. Four proofs for the Cheeger inequality and graph partition algorithms. In ICCM, 2007. [9] F. R. L. Chung. Spectral Graph Theory. AMS, 1992. [10] I. S. Dhillon. Co-clustering documents and words using bipartite spectral graph partitioning. In KDD, pages 269–274, 2001. [11] B. Gao, T.-Y. Liu, X. Zheng, Q.-S. Cheng, and W.-Y. Ma. Consistent bipartite graph co-partitioning for star-structured high-order heterogeneous data co-clustering. In KDD, pages 41–50, 2005. [12] D. Ghoshdastidar and A. Dukkipati. Spectral clustering using multilinear svd: Analysis, approximations and applications. In AAAI, pages 2610–2616, 2015. [13] D. F. Gleich, L.-H. Lim, and Y. Yu. Multilinear PageRank. SIAM J. Matrix Ann. Appl., 36(4):1507–1541, 2015. [14] M. Hein, S. Setzer, L. Jost, and S. S. Rangapuram. The total variation on hypergraphs-learning on hypergraphs revisited. In Advances in Neural Information Processing Systems, pages 2427–2435, 2013. [15] H. Huang, C. Ding, D. Luo, and T. Li. Simultaneous tensor subspace selection and clustering: the equivalence of high order SVD and k-means clustering. In KDD, pages 327–335, 2008. [16] S. Jegelka, S. Sra, and A. Banerjee. Approximation algorithms for tensor clustering. In Algorithmic learning theory, pages 368–383. Springer, 2009. [17] M. Kivelä, A. Arenas, M. Barthelemy, J. P. Gleeson, Y. Moreno, and M. A. Porter. Multilayer networks. Journal of Complex Networks, 2(3):203–271, 2014. [18] M. Meil˘a and J. Shi. A random walks view of spectral segmentation. In AISTATS, 2001. [19] M. Mihail. Conductance and convergence of markov chains—a combinatorial treatment of expanders. In FOCS, pages 526–531, 1989. [20] J. Ni, H. Tong, W. Fan, and X. Zhang. Flexible and robust multi-network clustering. In KDD, pages 835–844, 2015. [21] E. E. Papalexakis and N. D. Sidiropoulos. Co-clustering as multilinear decomposition with sparse latent factors. In ICASSP, pages 2064–2067. IEEE, 2011. [22] E. A. Pechenick, C. M. Danforth, and P. S. Dodds. Characterizing the Google Books corpus: strong limits to inferences of socio-cultural and linguistic evolution. PloS one, 10(10):e0137041, 2015. [23] S. Ragnarsson and C. F. Van Loan. Block tensors and symmetric embeddings. Linear Algebra Appl., 438(2):853–874, 2013. [24] S. E. Schaeffer. Graph clustering. Computer Science Review, 1(1):27–64, 2007. [25] W. J. Stewart. Introduction to the numerical solutions of Markov chains. Princeton Univ. Press, 1994. [26] D. Wagner and F. Wagner. Between min cut and graph bisection. In MFCS, pages 744–750, 1993. [27] D. Zhou and C. J. Burges. Spectral clustering and transductive learning with multiple views. In ICML, pages 1159–1166, 2007. 9
2016
565
6,511
Balancing Suspense and Surprise: Timely Decision Making with Endogenous Information Acquisition Ahmed M. Alaa Electrical Engineering Department University of California, Los Angeles Mihaela van der Schaar Electrical Engineering Department University of California, Los Angeles Abstract We develop a Bayesian model for decision-making under time pressure with endogenous information acquisition. In our model, the decision-maker decides when to observe (costly) information by sampling an underlying continuoustime stochastic process (time series) that conveys information about the potential occurrence/non-occurrence of an adverse event which will terminate the decisionmaking process. In her attempt to predict the occurrence of the adverse event, the decision-maker follows a policy that determines when to acquire information from the time series (continuation), and when to stop acquiring information and make a final prediction (stopping). We show that the optimal policy has a "rendezvous" structure, i.e. a structure in which whenever a new information sample is gathered from the time series, the optimal "date" for acquiring the next sample becomes computable. The optimal interval between two information samples balances a trade-off between the decision maker’s "surprise", i.e. the drift in her posterior belief after observing new information, and "suspense", i.e. the probability that the adverse event occurs in the time interval between two information samples. Moreover, we characterize the continuation and stopping regions in the decisionmaker’s state-space, and show that they depend not only on the decision-maker’s beliefs, but also on the "context", i.e. the current realization of the time series. 1 Introduction The problem of timely risk assessment and decision-making based on a sequentially observed time series is ubiquitous, with applications in finance, medicine, cognitive science and signal processing [1-7]. A common setting that arises in all these domains is that a decision-maker, provided with sequential observations of a time series, needs to decide whether or not an adverse event (e.g. financial crisis, clinical acuity for ward patients, etc) will take place in the future. The decision-maker’s recognition of a forthcoming adverse event needs to be timely, for that a delayed decision may hinder effective intervention (e.g. delayed admission of clinically acute patients to intensive care units can lead to mortality [5]). In the context of cognitive science, this decision-making task is known as the two-alternative forced choice (2AFC) task [15]. Insightful structural solutions for the optimal Bayesian 2AFC decision-making policies have been derived in [9-16], most of which are inspired by the classical work of Wald on sequential probability ratio tests (SPRT) [8]. In this paper, we present a Bayesian decision-making model in which a decision-maker adaptively decides when to gather (costly) information from an underlying time series in order to accumulate evidence on the occurrence/non-occurrence of an adverse event. The decision-maker operates under time pressure: occurrence of the adverse event terminates the decision-making process. Our abstract model is motivated and inspired by many practical decision-making tasks such as: constructing temporal patterns for gathering sensory information in perceptual decision-making [1], scheduling lab 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. tests for ward patients in order to predict clinical deterioration in a timely manner [3, 5], designing breast cancer screening programs for early tumor detection [7], etc. We characterize the structure of the optimal decision-making policy that prescribes when should the decision-maker acquire new information, and when should she stop acquiring information and issue a final prediction. We show that the decision-maker’s posterior belief process, based on which policies are prescribed, is a supermartingale that reflects the decision-maker’s tendency to deny the occurrence of an adverse event in the future as she observes the survival of the time series for longer time periods. Moreover, the information acquisition policy has a "rendezvous" structure; the optimal "date" for acquiring the next information sample can be computed given the current sample. The optimal schedule for gathering information over time balances the information gain (surprise) obtained from acquiring new samples, and the probability of survival for the underlying stochastic process (suspense). Finally, we characterize the continuation and stopping regions in the decision-maker’s state-space and show that, unlike previous models, they depend on the time series "context" and not just the decision-maker’s beliefs. Related Works Mathematical models and analyses for perceptual decision-making based on sequential hypothesis testing have been developed in [9-17]. Most of these models use tools from sequential analysis developed by Wald [8] and Shiryaev [21, 22]. In [9,13,14], optimal decision-making policies for the 2AFC task were computed by modelling the decision-maker’s sensory evidence using diffusion processes [20]. These models assume an infinite time horizon for the decision-making policy, and an exogenous supply of sensory information. The assumption of an infinite time horizon was relaxed in [10] and [15], where decision-making is assumed to be performed under the pressure of a stochastic deadline; however, these deadlines were considered to be drawn from known distributions that are independent of the hypothesis and the realized sensory evidence, and the assumption of an exogenous information supply was maintained. In practical settings, the deadlines would naturally be dependent on the realized sensory information (e.g. patients’ acuity events are correlated with their physiological information [5]), which induces more complex dynamics in the decision-making process. Context-based decision-making models were introduced in [17], but assuming an exogenous information supply and an infinite time horizon. The notions of “suspense" and “surprise" in Bayesian decision-making have also been recently introduced in the economics literature (see [18] and the references therein). These models use measures for Bayesian surprise, originally introduced in the context of sensory neuroscience [19], in order to model the explicit preference of a decision-maker to non-instrumental information. The goal there is to design information disclosure policies that are suspense-optimal or surprise-optimal. Unlike our model, such models impose suspense (and/or surprise) as a (behavioral) preference of the decision-maker, and hence they do not emerge endogenously by virtue of rational decision making. 2 Timely Decision Making with Endogenous Information Gathering Time Series Model The decision-maker has access to a time-series X(t) modeled as a continuoustime stochastic process that takes values in R, and is defined over the time domain t ∈R+, with an underlying filtered probability space (Ω, F, {Ft}t∈R+, P). The process X(t) is naturally adapted to {Ft}t∈R+, and hence the filtration Ft abstracts the information conveyed in the time series realization up to time t. The decision-maker extracts information from X(t) to guide her actions over time. We assume that X(t) is a stationary Markov process1, with a stationary transition kernel Pθ (X(t) ∈A|Fs) = Pθ (X(t) ∈A|X(s)) , ∀A ⊂R, ∀s < t ∈R+, where θ is a realization of a latent Bernoulli random variable Θ ∈{0, 1} (unobservable by the decision-maker), with P(Θ = 1) = p. The distributional properties of the paths of X(t) are determined by θ, since the realization of θ decides which Markov kernel (Po or P1) generates X(t). If the realization θ is equal to 1, then an adverse event occurs almost surely at a (finite) random time τ, the distribution of which is dependent on the realization of the path (X(t))0≤t≤τ. 1Most of the insights distilled from our results would hold for more general dependency structures. However, we keep this assumption to simplify the exposition and maintain the tractability and interpretability of the results. 2 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 −0.1 −0.05 0 0.05 0.1 Time t X(t) Pt = {0, 0.1, 0.15, 0.325, 0.4, 0.45, 0.475, 0.5, 0.65, 0.7} Continuous-path X(t) Partitioned path X(Pt) Information at t = 0.2: 1) σ(X(0), X(0.1), X(0.15)) 2) S0.2: survival up to t = 0.2 Adverse event Stopping time τ Figure 1: An exemplary stopped sample path for Xτ(t)|Θ = 1, with an exemplary partition Pt. The decision-maker’s ultimate goal is to sequentially observe X(t), and infer θ before the adverse event happens; inference is obsolete if it is declared after τ. Since Θ is latent, the decision-maker is unaware whether the adverse event will occur or not, i.e. whether her access to X(t) is temporary (τ < ∞for θ = 1) or permanent (τ = ∞for θ = 0). In order to model the occurrence of the adverse event; we define τ as an F-stopping time for the process X(t), for which we assume the following: • The stopping time τ |Θ = 1 is finite almost surely, whereas τ |Θ = 0 is infinite almost surely, i.e. P (τ < ∞|Θ = 1) = 1, and P (τ = ∞|Θ = 0) = 1. • The stopping time τ |Θ = 1 is accessible2, with a Markovian dependency on history, i.e. P (τ < t| Fs) = P (τ < t| X(s)) , ∀s < t, where P (τ < t| X(s)) is an injective map from R to [0, 1] and P (τ < t| X(s)) is non-decreasing in X(s). Thus, unlike the stochastic deadline models in [10] and [15], the decision deadline in our model (i.e. occurrence of the adverse event) is context-dependent as it depends on the time series realization (i.e. P (τ < t| X(s)) is not independent of X(t) as in [15]). We use the notation Xτ(t) = X(t∧τ), where t ∧τ = min{t, τ} to denote the stopped process to which the decision-maker has access. Throughout the paper, the measures Po and P1 assign probability measures to the paths Xτ(t)|Θ = 0 and Xτ(t)|Θ = 1 respectively, and we assume that Po << P13. Information The decision-maker can only observe a set of (costly) samples of Xτ(t) rather than the full continuous path. The samples observed by the decision-maker are captured by partitioning X(t) over specific time intervals: we define Pt = {to, t1, . . ., tN(Pt)−1}, with 0 ≤to < t1 < . . . < tN(Pt)−1 ≤t, as a size-N(Pt) partition of Xτ(t) over the interval [0, t], where N(Pt) is the total number of samples in the partition Pt. The decision-maker observes the values that Xτ(t) takes at the time instances in Pt; thus the sequence of observations is given by the process X(Pt) = PN(Pt)−1 i=0 X(ti)δti, where δti is the Dirac measure. The space of all partitions over the interval [0, t] is denoted by Pt = [0, t]N. We denote the probability measures for partitioned paths generated under Θ = 0 and 1 with a partition Pt as ˜Po(Pt) and ˜P1(Pt) respectively. Since the decision-maker observes Xτ(t) through the partition Pt, her information at time t is conveyed in the σ-algebra σ(Xτ(Pt)) ⊂Ft. The stopping event is observable by the decisionmaker even if τ /∈Pτ. We denote the σ-algebra generated by the stopping event as St = σ 1{t≥τ}  . Thus, the information that the decision-maker has at time t is expressed by the filtration ˜Ft = σ(Xτ(Pt)) ∨St. Hence, any decision-making policy needs to be ˜Ft-measurable. Figure 1 depicts a Brownian path (a sample path of a Wiener process, which satisfies all the assumptions of our model)4, with an exemplary partition Pt over the time interval [0, 1]. The decision-maker observes the samples in X(Pt) sequentially, and reasons about the realization of the latent variable Θ based on these samples and the process survival, i.e. at t = 0.2, the decisionmaker’s information resides in the σ-algebra σ(X(0), X(0.1), X(0.15)) generated by the samples 2Our analyses hold if the stopping time is totally inaccessible. 3The absolute continuity of Po with respect to P1 means that no sample path of Xτ(t)|Θ = 0 should be fully revealing of the realization of Θ. 4In Figure 1, the stopping event was simulated as a totally inaccessible first jump of a Poisson process. 3 in P0.2 = {0, 0.1, 0.15}, and the σ-algebra generated by the process’ survival S0.2 = σ(1{τ>0.2}). Policies and Risks The decision-maker’s goal is to come up with a (timely) decision ˆθ ∈{0, 1}, that reflects her prediction for whether the actual realization θ is 0 or 1, before the process Xτ(t) potentially stops at the unknown time τ. The decision-maker follows a policy: a (continuous-time) mapping from the observations gathered up to every time instance t to two types of actions: • A sensing action δt ∈{0, 1}: if δt = 1, then the decision-maker decides to observe a new sample from the running process Xτ(t) at time t. • A continuation/stopping action ˆθt ∈{∅, 0, 1}: if ˆθt ∈{0, 1}, then the decision-maker decides to stop gathering samples from Xτ(t), and declares a final decision (estimate) for θ. Whenever ˆθt = ∅, the decision-maker continues observing Xτ(t) and postpones her declaration for the estimate of θ. A policy π = (πt)t∈R+ is a ( ˜Ft-measurable) mapping rule that maps the information in ˜Ft to an action tuple πt = (δt, ˆθt) at every time instance t. We assume that every single observation that the decision-maker draws from Xτ(t) entails a fixed cost, hence the process (δt)t∈R+ has to be a point process under any optimal policy5. We denote the space of all such policies by Π. A policy π generates the following random quantities as a function of the paths Xτ(t) on the probability space (Ω, F, {Ft}t∈R+, P): 1- A stopping time Tπ: The first time at which the decision-maker declares its estimate for θ, i.e. Tπ = inf{t ∈R+ : ˆθt ∈{0, 1}}. 2- A decision (estimate of θ) ˆθπ: Given by ˆθπ = ˆθTπ∧τ. 3- A random partition P π Tπ: A realization of the point process (δt)t∈R+, comprising a finite set of strictly increasing F-stopping times at which the decision-maker decides to sample the path Xτ(t). A loss function is associated with every realization of the policy π, representing the overall cost incurred when following that policy for a specific path Xτ(t). The loss function is given by ℓ(π; Θ) ≜(C1 1{ˆθπ=0,θ=1} | {z } Type I error + Co 1{ˆθπ=1,θ=0} | {z } Type II error + Cd Tπ | {z } Delay ) 1{Tπ≤τ}+ Cr 1{Tπ>τ} | {z } Deadline missed + CsN(P π Tπ∧τ) | {z } Information , (1) where C1 is the cost of type I error (failure to anticipate the adverse event), Co is the cost of type II error (falsely predicting that an adverse event will occur), Cd is the cost of the delay in declaring the estimate ˆθπ, Cr is the cost incurred when the adverse event occurs before an estimate ˆθπ is declared (cost of missing the deadline), and Cs is the cost of every observation sample (cost of information). The risk of each policy π is defined as its expected loss R(π) ≜E [ℓ(π; Θ)] , (2) where the expectation is taken over the paths of Xτ(t). In the next section, we characterize the structure of the optimal policy π∗= arg infπ∈ΠR(π). 3 Structure of the Optimal Policy Since the decision-maker’s posterior belief at time t, defined as µt = P(Θ = 1| ˜Ft), is an important statistic for designing sequential policies [10, 21-22], we start our characterization for π∗by investigating the belief process (µt)t∈R+. 3.1 The Posterior Belief Process Recall that the decision-maker distills information from two types of observations: the realization of the partitioned time series Xτ(Pt) (i.e. the information in σ(Xτ(Pt))), and 2) the survival of the 5Note that the cost of observing any local continuous path is infinite, hence any optimal policy must have (δt)t∈R+ being a point process to keep the number of observed samples finite. 4 0 200 400 600 800 1000 1200 1400 1600 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 Time t Posterior belief process µt 500 600 700 800 0.5 0.55 0.6 0.65 Policy π1 with partition P π1 Policy π2, with P π1 ⊂P π2 Wait-and-watch policy Suspense phase (risk bearing) Information gain It1(t2 −t1) = µt2 −µt1 Surprise phase (risk assessment) Stopping time τ Figure 2: Depiction for exemplary belief paths of different policies under Θ = 1. process up to time t (i.e. the information in St). In the following Theorem, we study the evolution of the decision-maker’s beliefs as she integrates these pieces of information over time6. Theorem 1 (Information and beliefs). Every posterior belief trajectory (µt)t∈R+ associated with a policy π ∈Π that creates a partition P π t ∈Pt of Xτ(t) is a càdlàg path given by µt = 1{t≥τ} + 1{0≤t<τ} · 1 + 1 −p p · d˜Po(P π t ) d˜P1(P π t ) !−1 , where d˜Po(P π t ) d˜P1(P π t ) is the Radon–Nikodym derivative7 of the measure ˜Po(P π t ) with respect to ˜P1(P π t ), and is given by the following elementary predictable process 1 d˜Po(P π t ) d˜P1(P π t ) = N(P π t )−1 X k=1 P(X(P π t )|Θ = 1) P(X(P π t )|Θ = 0) | {z } Likelihood ratio P(τ > t|σ(X(P π t ), Θ = 1) | {z } Survival probability 1{P π t (k)≤t≤P π t (k+1)}, for t ≥P π t (1), and p P(τ > t|Θ = 1) for t < P π t (k). Moreover, the path (µt)t∈R+ has exactly N(P π Tπ∧τ) + 1{τ<∞} jumps at the time indexes in P π t∧τ ∪{τ}. □ Theorem 1 says that every belief path is right-continuous with left limits, and has jumps at the time indexes in the partition P π t , whereas between each two jumps, the paths (µt)t∈[t1,t2), t1, t2 ∈P π t are predictable (i.e. they are known ahead of time once we know the magnitudes of the jumps preceding them). This means that the decision-maker obtains "active" information by probing the time series to observe new samples (i.e. the information in σ(Xτ(Pt))), inducing jumps that revive her beliefs, whereas the progression of time without witnessing a stopping event offers the decision-maker "passive information" that is distilled just from the costless observation of process survival information. Both sources of information manifest themselves in terms of the likelihood ratio, and the survival probability in the expression of d˜Po(P π t ) d˜P1(P π t ) above. In Figure 2, we plot the càdlàg belief paths for policies π1 and π2, where P π1 ⊂P π2 (i.e. policy π1 observe a subset of the samples observed by π2). We also plot the (predictable) belief path of a wait-and-watch policy that observes no samples. We can see that π2, which has more jumps of "active information", copes faster with the truthful belief over time. Between each two jumps, the belief process exhibits a non-increasing predictable path until fed with a new piece of information. The wait-and-watch policy has its belief drifting away from the prior p = 0.5 towards the wrong belief µt = 0 since it only distills information from the process survival, which favors the hypothesis Θ = 0. This discussion motivates the introduction of the following key quantities. Information gain (surprise) It(∆t): The amount of drift in the decision-maker’s belief at time t + ∆t with respect to her belief at time t, given the information available up to time t, i.e. It(∆t) = (µt+∆t −µt) | ˜Ft. 6All proofs are provided in the supplementary material 7Since we impose the condition Po << P1 and fix a partition Pt, then the Radon–Nikodym derivative exists. 5 Posterior survival function (suspense) St(∆t): The probability that a process generated with Θ = 1 survives up to time t + ∆t given the information observed up to time t, i.e. St(∆t) = P(τ > t + ∆t| ˜Ft, Θ = 1). The function St(∆t) is a non-increasing function in ∆t, i.e. ∂St(∆t) ∂∆t ≤0. That is, the information gain is the amount of “surprise" that the decision-maker experiences in response to a new information sample expressed in terms of the change in here belief, i.e. the jumps in µt, whereas the survival probability (suspense) is her assessment for the risk of having the adverse event taking places in the next ∆t time interval. As we will see in the next subsection, the optimal policy would balance the two quantities when scheduling the times to sense Xτ(t). We conclude our analysis for the process µt by noting that lack of information samples creates bias towards the belief that Θ = 0 (e.g. see the belief path of the wait-and-watch policy in Figure 2). We formally express this behavior in the following Corollary. Corollary 1 (Leaning towards denial). For every policy π ∈Π, the posterior belief process µt is a supermartingale with respect to ˜Ft, where E[µt+∆t| ˜Ft] = µt −µ2 tSt(∆t)(1 −St(∆t)) ≤µt, ∀∆t ∈R+. □ Thus, unlike classical Bayesian learning models with a belief martingale [18, 21-23], the belief process in our model is a supermartingale that leans toward decreasing over time. The reason for this is that in our model, time conveys information. That is, unlike [10] and [15] where the decision deadline is hypothesis-independent and is almost surely occurring in finite time for any path, in our model the occurrence of the adverse event is itself a hypothesis, hence observing the survival of the process is informative and contributes to the evolution of the belief. The informativeness of both the acquired information samples and process survival can be disentangled using Doob decomposition, by writing µt as µt = ˜µt + A(µt, St(∆t)), where ˜µt is a martingale, capturing the information gain from the acquired samples, and A(µt, St(∆t)) is a predictable compensator process [23], capturing information extracted from the process survival. 3.2 The Optimal Policy The optimal policy π∗minimizes the expected risk as defined in (1) and (2) by generating the tuple of random processes (Tπ, ˆθπ, P π t ) in response to the paths of Xτ(t) on (Ω, F, {Ft}t∈R+, P) in a way that "shapes" a belief process µt that maximizes informativeness, maintains timeliness and controls cost. In the following, we introduce the notion of a "rendezvous policy", then in Theorem 2, we show that the optimal policy π∗complies with this definition. Rendezvous policies We say that a policy π is a rendezvous policy, if the random partition P π Tπ constructed by the sequence of sensing actions (δπ t )t∈[0,Tπ], is a point process with predictable jumps, where for every two consecutive jumps at times t and t ′, with t ′ > t and t, t ′ ∈P π Tπ, we have that t ′ is ˜Ft-measurable. That is, a rendezvous policy is a policy that constructs a sensing schedule (δπ t )t∈[0,Tπ], such that every time t ′ at which the decision-maker acquires information is actually computable using the information available up to time t, the previous time instance at which information was gathered. Hence, the decision-maker can decide the next "date" in which she will gather information directly after she senses a new information sample. This structure is a natural consequence of the information structure in Theorem 1, since the belief paths between every two jumps are predictable, then they convey no "actionable" information, i.e. if the decision-maker was to respond to a predictable belief path, say by sensing or making a stopping decision, then she should have taken that decision right before the predictable path starts, which leads her to better off by saving the delay cost Cd. We denote the space of all rendezvous policies by Πr. In the following Theorem, we establish that the rendezvous structure is optimal. Theorem 2 (Rendezvous). The optimal policy π∗is a rendezvous policy (π∗∈Πr). □ 6 A direct implication of Theorem 2 is that the time variable can now be viewed as a state variable, whereas the problem is virtually solved in "discrete-time" since the decision-maker effectively jumps from one time instance to another in a discrete manner. Hence, we alter the definition of the action δt from an indicator variable that indicates sensing the time series at time t, to a "rendezvous action" that takes real values, and specifies the time after which the decision-maker would sense a new sample, i.e. if δt = ∆t, then the decision-maker gathers the new sample at t+∆t. This transformation restricts our policy design problem to the space of rendezvous policies Πr, which we know from Theorem 2 that it contains the optimal policy (i.e. π∗= arg infπ∈ΠrR(π)). Having established the result in Theorem 2, in the following Theorem, we characterize the optimal policy π∗in terms of the random process (Tπ∗, ˆθπ∗, P π∗ t ) using discrete-time Bellman optimality conditions [24]. Theorem 3 (The optimal policy). The optimal policy π∗is a sequence of actions (ˆθπ∗ t , δπ∗ t )t∈R+, resulting in a random process (ˆθπ∗, Tπ∗, P π∗ Tπ∗) with the following properties: (Continuation and stopping) 1. The process (t, µt, ¯X(P π∗ t ))t∈R+ is a Markov sufficient statistic for the distribution of (ˆθπ∗, Tπ∗, P π∗ Tπ∗), where ¯X(P π∗ t ) is the most recent sample in the partition P π∗ t , i.e. ¯X(P π∗ t ) = X(t∗), t∗= max P π∗ t . 2. The policy π∗recommends continuation, i.e. ˆθπ∗ t = ∅, as long as the belief µt ∈ C(t, ¯X(P π∗ t )), where C(t, ¯X(P π∗ t )), is a time and context-dependent continuation set with the following properties: C(t ′, X) ⊂C(t, X), ∀t ′ > t, and C(t, X ′) ⊂C(t, X), ∀X ′ > X. (Rendezvous and decisions) 1. Whenever µt ∈C(t, ¯X(P π∗ t )), and t ∈P π∗ Tπ∗, then the rendezvous δπ∗ t is set as follows δπ∗ t = arg infδ∈R+f(E[It(δ)], St(δ)), where f(E[It(δ)], St(δ)) is decreasing in E[It(δ)] and St(δ). 2. Whenever µt /∈C(t, ¯X(P π∗ t )), then a decision ˆθπ∗ t = ˆθπ∗∈{0, 1} is issued, and is based on a belief threshold as follows: ˆθπ∗= 1n µt≥ C1 Co+C1 o. The stopping time is given by Tπ∗= inf{t ∈R+ : µt /∈C(t, ¯X(P π∗ t ))}. □ Theorem 3 establishes the structure of the optimal policy and its prescribed actions in the decisionmaker’s state-space. The first part of the Theorem says that in order to generate the random tuple (Tπ∗, ˆθπ∗, P π∗ t ) optimally, we only need to keep track of the realization of the process (t, µt, ¯X(Pt))t∈R+ in every time instance. That is, an optimal policy maps the current belief, the current time, and the most recently observed realization of the time series to an action tuple (ˆθπ t , δπ t ), i.e. a decision on whether to stop and declare an estimate for θ or sense a new sample. Hence, the process (t, µt, ¯X(Pt))t∈R+ represents the "state" of the decision-maker, and the decision-maker’s actions can partially influence the state through the belief process, i.e. a decision on when to acquire the next sample affects the distributional properties of the posterior belief. The remaining state variables t and X(t) are beyond the decision-maker’s control. We note that unlike the previous models in [9-16], with the exception of [17], a policy in our model is context-dependent. That is, since the state is (t, µt, ¯X(P π t )) and not just the time-belief tuple (t, µt), a policy π can recommend different actions for the same belief and at the same time but for a different context. This is because, while µt captures what the decision-maker learned from the history, ¯X(P π t ) captures her foresightedness into the future, i.e. it can be that the belief µt is not decisive (e.g. µt ≈p), but the context is "risky" (i.e. ¯X(P π t ) is large), which means that a potential forthcoming adverse event is likely to happen in the near future, hence the decision-maker would be more eager to make a stopping decision and declare an estimate ˆθπ. This is manifested through the dependence of the continuation set C(t, ¯X(P π t )) on both time and context; the continuation set is monotonically decreasing in time due to the deadline pressure, and is also monotonically decreasing in ¯X(P π t ) due to the dependence of the deadline on the time series realization. 7 Policy π: Stop and declare ˆθπ X(t) ˆθπ = 1 Policy π: Continue sampling Xτ(t) t µt Sample path 1 Sample path 2 ¯µ ¯t Figure 3: Context-dependence of the policy π. The context dependence of the optimal policy is pictorially depicted in Figure 3 where we show two exemplary trajectories for the decision-maker’s state, and the actions recommended by a policy π for the same time and belief, but a different context, i.e. a stopping action recommended when X(t) is large since it corresponds to a low survival probability, whereas for the same belief and time, a continuation action can be recommended if X(t) is low since it is safer to keep observing the process for that the survival probability is high. Such a prescription specifies optimal decisionmaking in context-driven settings such as clinical decision-making in critical care environment [3-5], where a combination of a patient’s length of hospital stay (i.e. t), clinical risk score (i.e. µt) and current physiological test measurements (i.e. ¯X(P π t )) determine the decision on whether or not a patient should be admitted to an intensive care unit. The second part of Theorem 3 says that whenever the optimal policy decides to stop gathering information and issue a conclusive decision, it imposes a threshold on the posterior belief, based on which it issues the estimate ˆθπ∗; the threshold is C1 Co+C1 , and hence weights the estimates by their respective risks. When the policy favors continuation, it issues a rendezvous action, i.e. the next time instance at which information will be gathered. This rendezvous balances surprise and suspense: the decision-maker prefers maximizing surprise in order to draw the maximum informativeness from the costly sample it will acquire; this is captured in terms of the expected information gain E[It(δ)]. Maximizing surprise may increase suspense, i.e. the probability of process termination, which is controlled by the survival function St(δ), and hence it can be that harvesting the maximum informativeness entails a survival risk when Cr is high. Therefore, the optimal policy selects a rendezvous δπ∗ t that optimizes a combination of the survival risk survival, captured by the cost Cr and the survival function St(∆t), and the value of information, captured by the costs Co, C1 and the expected information gain E[It(δ)]. 4 Conclusions We developed a model for decision-making with endogenous information acquisition under time pressure, where a decision-maker needs to issue a conclusive decision before an adverse event (potentially) takes place. We have shown that the optimal policy has a "rendezvous" structure, i.e. the optimal policy sets a "date" for gathering a new sample whenever the current information sample is observed. The optimal policy selects the time between two information samples such that it balances the information gain (surprise) with the survival probability (suspense). Moreover, we characterized the optimal policy’s continuation and stopping conditions, and showed that they depend on the context and not just on beliefs. Our model can help understanding the nature of optimal decision-making in settings where timely risk assessment and information gathering is essential. 5 Acknowledgments This work was supported by the ONR and the NSF (Grant number: ECCS 1462245). 8 References [1] Balci, F., Freestone, D., Simen, P., de Souza, L., Cohen, J. D., & Holmes, P. (2011) Optimal temporal risk assessment, Frontiers in Integrative Neuroscience, 5(56), 1-15. [2] Banerjee, T. & Veeravalli, V. V. (2012) Data-efficient quickest change detection with on–off observation control, Sequential Analysis, 31(1), 40-77. [3] Wiens, J., Horvitz, E., & Guttag, J. V. (2012) Patient risk stratification for hospital-associated c. diff as a time-series classification task, In Advances in Neural Information Processing Systems, pp. 467-475. [4] Schulam, P., & Saria, S. (2015) A Framework for Individualizing Predictions of Disease Trajectories by Exploiting Multi-resolution Structure, In Advances in Neural Information Processing Systems, pp. 748-756. [5] Chalfin, D. B., Trzeciak, S., Likourezos, A., Baumann, B. M., Dellinger, R. P., & DELAY-ED study group. (2007) Impact of delayed transfer of critically ill patients from the emergency department to the intensive care unit, Critical care medicine, 35(6), pp. 1477-1483. [6] Bortfeld, T., Ramakrishnan, J., Tsitsiklis, J. N., & Unkelbach, J. (2015) Optimization of radiation therapy fractionation schedules in the presence of tumor repopulation, INFORMS Journal on Computing, 27(4), pp. 788-803. [7] Shapiro, S., et al., (1998) Breast cancer screening programmes in 22 countries: current policies, administration and guidelines, International journal of epidemiology, 27(5), pp. 735-742. [8] Wald, A., Sequential analysis, Courier Corporation, 1973. [9] Khalvati, K., & Rao, R. P. (2015) A Bayesian Framework for Modeling Confidence in Perceptual Decision Making, In Advances in neural information processing systems, pp. 2404-2412. [10] Dayanik, S., & Angela, J. Y. (2013) Reward-Rate Maximization in Sequential Identification under a Stochastic Deadline, SIAM J. Control Optim., 51(4), pp. 2922–2948. [11] Zhang, S., & Angela, J.Y. (2013) Forgetful Bayes and myopic planning: Human learning and decisionmaking in a bandit setting, In Advances in neural information processing systems, pp. 2607-2615. [12] Shenoy, P., & Angela, J.Y. (2012) Strategic impatience in Go/NoGo versus forced-choice decision-making, In Advances in neural information processing systems, pp. 2123-2131. [13] Drugowitsch, J., Moreno-Bote, R., & Pouget, A. (2014) Optimal decision-making with time-varying evidence reliability, In Advances in neural information processing systems, pp. 748-756. [14] Yu, A. J., Dayan, P., & Cohen, J. D. (2009) Dynamics of attentional selection under conflict: toward a rational Bayesian account, Journal of Experimental Psychology: Human Perception and Performance, 35(3), 700. [15] Frazier, P. & Angela, J. Y. (2007) Sequential hypothesis testing under stochastic deadlines, In Advances in Neural Information Processing Systems, pp. 465-472. [16] Drugowitsch, J., Moreno-Bote, R., Churchland, A. K., Shadlen, M. N., & Pouget, A. (2012) The cost of accumulating evidence in perceptual decision making, The Journal of Neuroscience, 32(11), 3612-3628. [17] Shvartsman, M., Srivastava, V., & Cohen J. D. (2015) A Theory of Decision Making Under Dynamic Context, In Advances in Neural Information Processing Systems, pp. 2476-2484. 2015. [18] Ely, J., Frankel, A., & Kamenica, E. (2015) Suspense and surprise, Journal of Political Economy, 123(1), pp. 215-260. [19] Itti, L., & Baldi, P. (2005) Bayesian Surprise Attracts Human Attention, In Advances in Neural Information Processing Systems, pp. 547-554. [20] Bogacz, R., Brown, E., Moehlis, J., Holmes, P. J., & Cohen J. D. (2006) The physics of optimal decision making: A formal analysis of models of performance in two-alternative forced-choice tasks, Psychological Review, 113(4), pp. 700–765. [21] Peskir, G., & Shiryaev, A. (2006) Optimal stopping and free-boundary problems, Birkhäuser Basel. [22] Shiryaev, A. N. (2007) Optimal stopping rules (Vol. 8). Springer Science & Business Media. [23] Shreve, Steven E. (2004) Stochastic calculus for finance II: Continuous-time models (Vol. 11), Springer Science & Business Media, 2004. [24] Bertsekas, D. P., & Shreve, S. E. Stochastic optimal control: The discrete time case (Vol. 23), New York: Academic Press, 1978. 9
2016
566
6,512
Generating Long-term Trajectories Using Deep Hierarchical Networks Stephan Zheng Caltech stzheng@caltech.edu Yisong Yue Caltech yyue@caltech.edu Patrick Lucey STATS plucey@stats.com Abstract We study the problem of modeling spatiotemporal trajectories over long time horizons using expert demonstrations. For instance, in sports, agents often choose action sequences with long-term goals in mind, such as achieving a certain strategic position. Conventional policy learning approaches, such as those based on Markov decision processes, generally fail at learning cohesive long-term behavior in such high-dimensional state spaces, and are only effective when fairly myopic decisionmaking yields the desired behavior. The key difficulty is that conventional models are “single-scale” and only learn a single state-action policy. We instead propose a hierarchical policy class that automatically reasons about both long-term and shortterm goals, which we instantiate as a hierarchical neural network. We showcase our approach in a case study on learning to imitate demonstrated basketball trajectories, and show that it generates significantly more realistic trajectories compared to non-hierarchical baselines as judged by professional sports analysts. 1 Introduction Figure 1: The player (green) has two macro-goals: 1) pass the ball (orange) and 2) move to the basket. Modeling long-term behavior is a key challenge in many learning problems that require complex decision-making. Consider a sports player determining a movement trajectory to achieve a certain strategic position. The space of such trajectories is prohibitively large, and precludes conventional approaches, such as those based on simple Markovian dynamics. Many decision problems can be naturally modeled as requiring high-level, long-term macro-goals, which span time horizons much longer than the timescale of low-level micro-actions (cf. He et al. [8], Hausknecht and Stone [7]). A natural example for such macro-micro behavior occurs in spatiotemporal games, such as basketball where players execute complex trajectories. The micro-actions of each agent are to move around the court and, if they have the ball, dribble, pass or shoot the ball. These micro-actions operate at the centisecond scale, whereas their macro-goals, such as "maneuver behind these 2 defenders towards the basket", span multiple seconds. Figure 1 depicts an example from a professional basketball game, where the player must make a sequence of movements (micro-actions) in order to reach a specific location on the basketball court (macro-goal). Intuitively, agents need to trade-off between short-term and long-term behavior: often sequences of individually reasonable micro-actions do not form a cohesive trajectory towards a macro-goal. For instance, in Figure 1 the player (green) takes a highly non-linear trajectory towards his macro-goal of positioning near the basket. As such, conventional approaches are not well suited for these settings, as they generally use a single (low-level) state-action policy, which is only successful when myopic or short-term decision-making leads to the desired behavior. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. In this paper, we propose a novel class of hierarchical policy models, which we instantiate using recurrent neural networks, that can simultaneously reason about both macro-goals and micro-actions. Our model utilizes an attention mechanism through which the macro-policy guides the micro-policy. Our model is further distinguished from previous work on hierarchical policies by dynamically predicting macro-goals instead of following fixed goals, which gives additional flexibility to our model class that can be fitted to data (rather than having the macro-goals be specifically hand-crafted). We showcase our approach in a case study on learning to imitate demonstrated behavior in professional basketball. Our primary result is that our approach generates significantly more realistic player trajectories compared to non-hierarchical baselines, as judged by professional sports analysts. We also provide a comprehensive qualitative and quantitive analysis, e.g., showing that incorporating macro-goals can actually improve 1-step micro-action prediction accuracy. 2 Related Work The reinforcement learning community has largely focused on non-hierarchical policies such as those based on Markovian or linear dynamics (cf. Ziebart et al. [17], Mnih et al. [11], Hausknecht and Stone [7]). By and large, such policy classes are shown to be effective only when the optimal action can be found via short-term planning. Previous research has instead focused on issues such as how to perform effective exploration, plan over parameterized action spaces, or deal with non-convexity issues from using deep neural networks. In contrast, we focus on developing hierarchical policies that can effectively generate realistic long-term plans in complex settings such as basketball gameplay. The use of hierarchical models to decompose macro-goals from micro-actions is relatively common in the planning community (cf. Sutton et al. [14], He et al. [8], Bai et al. [1]). For instance, the winning team in 2015 RoboCup Simulation Challenge (Bai et al. [1]) used a manually constructed hierarchical policy to solve MDPs with a set of fixed sub-tasks, while Konidaris et al. [10] segmented demonstrations to construct a hierarchy of static macro-goals. In contrast, we study how one can learn a hierarchical policy from a large amount of expert demonstrations that can adapt its policy in non-Markovian environments with dynamic macro-goals. Our approach shares affinity with behavioral cloning. One difference with previous work is that we do not learn a reward function that induces such behavior (cf. Muelling et al. [12]). Another related line of research aims to develop efficient policies for factored MDPs (Guestrin et al. [6]), e.g. by learning value functions over factorized state spaces for multi-agent systems. It may be possible that such approaches are also applicable for learning our hierarchical policy. Attention models for deep networks have mainly been applied to natural language processing, image recognition and combinations thereof (Xu et al. [15]). In contrast to previous work which focuses on attention models of the input, our attention model is applied to the output by integrating control from both the macro-policy and the micro-policy. Recent work on generative models for sequential data (Chung et al. [4]), such as handwriting generation, have combined latent variables with an RNN’s hidden state to capture temporal variability in the input. In our work, we instead aim to learn semantically meaningful latent variables that are external to the RNN and reason about long-term behavior and goals. Our model shares conceptual similarities to the Dual Process framework (Evans and Stanovich [5]), which decomposes cognitive processes into fast, unconscious behavior (System 1) and slow, conscious behavior (System 2). This separation reflects our policy decomposition into a macro and micro part. Other related work in neuroscience and cognitive science include hierarchical models of learning by imitation (Byrne and Russon [2]). 3 Long-Term Trajectory Planning We are interested in learning policies that can produce high quality trajectories, where quality is some global measure of the trajectory (e.g., realistic trajectories as in Figure 1). We first set notation: • At time t, an agent i is in state si t ∈S and takes action ai t ∈A. The full state and action are st =  si t players i, at =  ai t players i. The history of events is ht = {(su, au)}0≤u<t. • Macro policies also use a goal space G, e.g. regions in the court that a player should reach. 2 raw action u micro-action a macro-goal g state s transfer ϕ raw micro-policy πraw macro-policy πmacro micro-policy πmicro Figure 3: The general structure of a 2-level hierarchical policy that consists of 1) a raw micro-policy πraw 2) a macro-policy πmacro and 3) a transfer function φ. For clarity, we suppressed the indices i, t in the image. The raw micro-policy learns optimal short-term policies, while the macro-policy is optimized to achieve long-term rewards. The macro-policy outputs a macro-goal gi t = πmacro(si t, hi t), which guides the raw micro-policy ui t = πraw(si t, hi t) in order for the hierarchical policy πmicro to achieve a long-term goal gi t. The hierarchical policy πmicro = ψ(ui t, φ(gi t)) uses a transfer function φ and synthesis functon ψ, see (3) and Section 4. • Let π(st, ht) denote a policy that maps state and history to a distribution over actions P(at|st, ht). If π is deterministic, the distribution is peaked around a specific action. We also abuse notation to sometimes refer to π as deterministically taking the most probable action π(st, ht) = argmaxa∈AP(a|st, ht) – this usage should be clear from context. Our main research question is how to design a policy class that can capture the salient properties of how expert agents execute trajectories. In particular, we present a general policy class that utilizes a goal space G to guide its actions to create such trajectory histories. We show in Section 4 how to instantiate this policy class as a hierarchical network that uses an attention mechanism to combine macro-goals and micro-actions. In our case study on modeling basketball behavior (Section 5.1), we train such a policy to imitate expert demonstrations using a large dataset of tracked basketball games. 3.1 Incorporating Macro-Goals Figure 2: Depicting two macro-goals (blue boxes) as an agent moves to the top left. Our main modeling assumption is that a policy should simultaneously optimize behavior hierarchically on multiple well-separated timescales. We consider two distinct timescales (macro and micro-level), although our approach could in principle be generalized to even more timescales. During an episode [t0, t1], an agent i executes a sequence of micro-actions ai t  t≥0 that leads to a macrogoal gi t ∈G. We do not assume that the start and end times of an episode are fixed. For instance, macro-goals can change before they are reached. We finally assume that macro-goals are relatively static on the timescale of the micro-actions, that is: dgi t/dt ≪1. Figure 2 depicts an example of an agent with two unique macro-goals over a 50-frame trajectory. At every timestep t, the agent executes a micro-action ai t, while the macro-goals gi t change more slowly. We model the interaction between a micro-action ai t and a macro-goal gi t through a raw micro-action ui t ∈A that is independent of the macro-goal. The micro-policy is then defined as: ai t = πmicro(st, ht) = argmaxaP micro(a|st, ht) (1) P micro(ai t|st, ht) = Z dudgP(ai t|u, g, st, ht)P(u, g|st, ht). (2) Here, we model the conditional distribution P(ai t|u, g, st, ht) as a non-linear function of u, g: P(ai t|ui t, gi t, st, ht) = ψ(ui t, φ(gi t)), (3) where φ, ψ are transfer and synthesis functions respectively that we make explicit in Section 4. Note that (3) does not explicitly depend on st, ht: although it is straightforward to generalize, this did not make a significant difference in our experiments. This decomposition is shown in Figure 3 and can be generalized to multiple scales l using multiple macro-goals gl and transfer functions φl. 4 Hierarchical Policy Network Figure 3 depicts a high-level overview of our hierarchical policy class for generating long-term spatiotemporal trajectories. Both the raw micro-policy and macro-policy are instantiated as recurrent 3 convolutional neural networks, and the raw action and macro-goals are combined via an attention mechanism, which we elaborate on below. Discretization and deep neural architecture. In general, when using continuous latent variables g, learning the model (1) is intractable, and one must resort to approximation methods. We choose to discretize the state-action and latent spaces. In the basketball setting, a state si t ∈S is naturally represented as a 1-hot occupancy vector of the basketball court. We then pose goal states gi t as sub-regions of the court that i wants to reach, defined at a coarser resolution than S. As such, we instantiate the macro and micro-policies as convolutional recurrent neural networks, which can capture both predictive spatial patterns and non-Markovian temporal dynamics. Attention mechanism for integrating macro-goals and micro-actions. We model (3) as an attention, i.e. φ computes a softmax density φ(gi t), over the output action space A and ψ is an element-wise (Hadamard) product. Suppressing indices i, t and s, h for clarity, the distribution (3) becomes φk(g) = exp hφ(g)k P j exp hφ(g)j , P(ak|u, g) ∝P raw(uk|s, h) · φk(g), k = 1 . . . |A|, (4) where hφ(g) is computed by a neural network that takes P macro(g) as an input. Intuitively, this structure captures the trade-off between the macro- and raw micro-policy. On the one hand, the raw micro-policy πraw aims for short-term optimality. On the other hand, the macro-policy πmacro can attend via φ to sequences of actions that lead to a macro-goal and bias the agent towards good long-term behavior. The difference between u and φ(g) thus reflects the trade-off that the hierarchical policy learns between actions that are good for either short-term or long-term goals. Multi-stage learning. Given a set D of sequences of state-action tuples (st, ˆat), where the ˆat are 1-hot labels (omitting the index i for clarity), the hierarchical policy network can be trained via θ∗= argmin θ X D T X t=1 Lt(st, ht, ˆat; θ). (5) Given the hierarchical structure of our model class, we decompose the loss Lt (omitting the index t): L(s, h, ˆa; θ) = Lmacro (s, h, g; θ) + Lmicro (s, h, ˆa; θ) + R(θ), (6) Lmicro(s, h, ˆa; θ) = A X k=1 ˆak log [P raw(uk|s, h; θ) · φk(g; θ)] , (7) where Rt(θ) regularizes the model weights θ and k indexes A discrete action-values. Although we have ground truths ˆat for the observable micro-actions, in general we may not have labels for the macro-goals gt that induce optimal long-term planning. As such, one would have to appeal to separate solution methods to compute the posterior P(gt|st, ht) which minimizes Lt,macro (st, ht, gt; θ). To reduce complexity and given the non-convexity of (7), we instead follow a multi-stage learning approach with a set of weak labels ˆgt, ˆφt for the macro-goals gt and attention masks φt = φ(gt). We assume access to such weak labels and only use them in the initial training phases. Here, we first train the raw micro-policy, macro-policy and attention individually, freezing the other parts of the network. The policies πmicro, πmacro and attention φ can be trained using standard cross-entropy minimization with the labels ˆat, ˆgt and ˆφt, respectively. In the final stage we fine-tune the entire network on objective (5), using only Lt,micro and R. We found this approach capable of finding a good initialization for fine-tuning and generating high-quality long-term trajectories.1 Another advantage of this approach is that the network can be trained using gradient descent during all stages. 5 Case Study on Modeling Basketball Behavior We applied our approach to modeling basketball behavior data. In particular, we focus on imitating the players’ movements, which is a challenging problem in the spatiotemporal planning setting. 1As ut and φ(gt) enter symmetrically into the objective (7), it is hypothetically possible that the network converges to a symmetric phase where the predictions ut and φ(gt) become identical along the entire trajectory. However, our experiments suggest that our multi-stage learning approach separates timescales well between the micro- and macro policy and prevents the network from settling in such a redundant symmetric phase. 4 289 conv a macro-policy πmacro s raw micro-policy πraw transfer ϕ gru conv conv fc u merge pool conv bn gru conv conv fc g gru fc ϕ pool pool pool bn bn bn bn bn bn bn 512 512 512 256 256 128 289 289 90 21, 7 21, 5 21, 5 21, 7 21, 5 21, 5 1, 1 2, 3 5, 5 10, 9 400x380 micro-policy πmicro Figure 4: Network architecture and hyperparameters of the hierarchical policy network. For clarity, we suppressed the indices i, t in the image. Max-pooling layers (numbers indicate kernel size) with unit stride upsample the sparse tracking data st. The policies πraw, πmacro use a convolutional (kernel size, stride) and GRU memory (number of cells) stack to predict ui t and gi t. Batch-normalization "bn" (Ioffe and Szegedy [9]) is applied to stabilize training. The output attention φ is implemented by 2 fully-connected layers (number of output units). Finally, the network predicts the final output πmicro(st, ht) = πraw(st, ht) ⊙φ(gi t). 5.1 Experimental Setup We validated the hierarchical policy network (HPN) by learning a movement policy of individual basketball players that predicts as the micro-action the instantaneous velocity vi t = πmicro(st, ht). Training data. We trained the HPN on a large dataset of tracking data from professional basketball games (Yue et al. [16]). The dataset consists of possessions of variable length: each possession is a sequence of tracking coordinates si t = xi t, yi t  for each player i, recorded at 25 Hz, where one team has continuous possession of the ball. Since possessions last between 50 and 300 frames, we sub-sampled every 4 frames and used a fixed input sequence length of 50 to make training feasible. Spatially, we discretized the left half court using 400×380 cells of size 0.25ft × 0.25ft. For simplicity, we modeled every player identically using a single policy network. The resulting input data for each possession is grouped into 4 channels: the ball, the player’s location, his teammates, and the opposing team. After this pre-processing, we extracted 130,000 tracks for training and 13,000 as a holdout set. Labels. We extracted micro-action labels ˆvi t = si t+1 −si t as 1-hot vectors in a grid of 17 × 17 unit cells. Additionally, we constructed a set of weak macro-labels ˆgt, ˆφt by heuristically segmenting each track using its stationary points. The labels ˆgt were defined as the next stationary point. For ˆφt, we used 1-hot velocity vectors vi t,straight along the straight path from the player’s location si t to the macro-goal gi t. We refer to the supplementary material for additional details. Model hyperparameters. To generate smooth rollouts while sub-sampling every 4 frames, we simultaneously predicted the next 4 micro-actions at, . . . , at+3. A more general approach would model the dependency between look-ahead predictions as well, e.g. P(πt+∆+1|πt+∆). However, we found that this variation did not outperform baseline models. We selected a network architecture to balance performance and feasible training-time. The macro and micro-policy use GRU memory cells Chung et al. [3] and a memory-less 2-layer fully-connected network as the transfer function φ, as depicted in Figure 4. We refer to the supplementary material for more details. Baselines. We compared the HPN against two natural baselines. 1. A policy with only a raw micro-policy and memory (GRU-CNN) and without memory (CNN). 2. A hierarchical policy network H-GRU-CNN-CC without an attention mechanism, which instead learns the final output from a concatenation of the raw micro- and macro-policy. Rollout evaluation. To evaluate the quality of our model, we generated rollouts (st; h0,r0) with burnin period r0, These are generated by 1) feeding a ground truth sequence of states h0,r0 = (s0, . . . , sr0) to the policy network and 2) for t > r0, predicting at as the mode of the network output (1) and updating the game-state st →st+1, using ground truth locations for the other agents. 5.2 How Realistic are the Generated Trajectories? The most holistic way to evaluate the trajectory rollouts is via visual analysis. Simply put, would a basketball expert find the rollouts by HPN more realistic than those by the baselines? We begin by first visually analyzing some rollouts, and then present our human preference study results. 5 (a) HPN rollouts (b) HPN rollouts (c) HPN rollouts (d) HPN (top) and failure case (bottom) (e) HPN (top), baseline (bottom) Figure 5: Rollouts generated by the HPN (columns a, b, c, d) and baselines (column e). Each frame shows an offensive player (dark green), a rollout (blue) track that extrapolates after 20 frames, the offensive team (light green) and defenders (red). Note we do not show the ball, as we did not use semantic basketball features (i.e “currently has the ball") during training. The HPN rollouts do not memorize training tracks (column a) and display a variety of natural behavior, such as curving, moving towards macro-goals and making sharp turns (c, bottom). We also show a failure case (d, bottom), where the HPN behaves unnaturally by moving along a straight line off the right side of the court – which may be fixable by adding semantic game state information. For comparison, a hierarchical baseline without an attention model, produces a straight-line rollout (column e, bottom), whereas the HPN produces a more natural movement curve (column e, top). Model comparison Experts Non-Experts All W/T/L Avg Gain W/T/L Avg Gain W/T/L Avg Gain VS-CNN 21 / 0 / 4 0.68 15 / 9 / 1 0.56 21 / 0 / 4 0.68 VS-GRU-CNN 21 / 0 / 4 0.68 18 / 2 / 5 0.52 21 / 0 / 4 0.68 VS-H-GRU-CNN-CC 22 / 0 / 3 0.76 21 / 0 / 4 0.68 21 / 0 / 4 0.68 VS-GROUND TRUTH 11 / 0 / 14 -0.12 10 / 4 / 11 -0.04 11 / 0 / 14 -0.12 Table 1: Preference study results. We asked basketball experts and knowledgeable non-experts to judge the relative quality of policy rollouts. We compare HPN with ground truth and 3 baselines: a memory-less (CNN ) and memory-full (GRU-CNN ) micro-policy and a hierarchical policy without attention (GRU-CNN -CC). For each of 25 test cases, HPN wins if more judges preferred the HPN rollout over a competitor. Average gain is the average signed vote (1 for always preferring HPN , and -1 for never preferring). We see that the HPN is preferred over all baselines (all results against baselines are significant at the 95% confidence level). Moreover, HPN is competitive with ground truth, indicating that HPN generates realistic trajectories within our rollout setting. Please see the supplementary material for more details. Visualization. Figure 5 depicts example rollouts for our HPN approach and one example rollout for a baseline. Every rollout consists of two parts: 1) an initial ground truth phase from the holdout set and 2) a continuation by either the HPN or ground truth. We note a few salient properties. First, the HPN does not memorize tracks, as the rollouts differ from the tracks it has trained on. Second, the HPN generates rollouts with a high dynamic range, e.g. they have realistic curves, sudden changes of directions and move over long distances across the court towards macro-goals. For instance, HPN tracks do not move towards macro-goals in unrealistic straight lines, but often take a curved route, indicating that the policy balances moving towards macro-goals with short-term responses to the current state (see also Figure 6b). In contrast, the baseline model often generates more constrained behavior, such as moving in straight lines or remaining stationary for long periods of time. Human preference study. Our primary empirical result is a preference study eliciting judgments on the relative quality of rollout trajectories between HPN and baselines or ground truth. We recruited seven experts (professional sports analysts) and eight knowledgeable non-experts (e.g., college basketball players) as judges. 6 (a) Predicted distributions for attention masks φ(g) (left column), velocity (micro-action) πmicro (middle) and weighted velocity φ(g) ⊙πmicro (right) for basketball players. The center corresponds to 0 velocity. (b) Rollout tracks and predicted macro-goals gt (blue boxes). The HPN starts the rollout after 20 frames. Macro-goal box intensity corresponds to relative prediction frequency during the trajectory. Figure 6: Left: Visualizing how the attention mask generated from the macro-policy interacts with the micropolicy πmicro. Row 1 and 2: the micro-policy πmicro decides to stay stationary, but the attention φ goes to the left. The weighted result φ ⊙πmicro is to move to the left, with a magnitude that is the average. Row 3) πmicro wants to go straight down, while φ boosts the velocity so the agent bends to the bottom-left. Row 4) πmicro goes straight up, while φ goes left: the agent goes to the top-left. Row 5) πmicro remains stationary, but φ prefers to move in any direction. As a result, the agent moves down. Right: The HPN dynamically predicts macro-goals and guides the micro-policy in order to reach them. The macro-goal predictions are stable over a large number of timesteps. The HPN sometimes predicts inconsistent macro-goals. For instance, in the bottom right frame, the agent moves to the top-left, but still predicts the macro-goal to be in the bottom-left sometimes. Because all the learned policies perform better with a “burn-in” period, we first animated with the ground truth for 20 frames (after subsampling), and then extrapolated with a policy for 30 frames. During extrapolation, the other nine players do not animate.2 For each test case, the judges were shown an animation of two rollout extrapolations of a specific player’s movement: one generated by the HPN, the other by a baseline or ground truth. The judges then chose which rollout looked more realistic. Please see the supplementary material for details of the study. Table 1 shows the preference study results. We tested 25 scenarios (some corresponding to scenarios in Figure 6b). HPN won the vast majority of comparisons against the baselines using expert judges, with slightly weaker but still very positive results using non-expert judgments. HPN was also competitive with ground truth. These results suggest that HPN can generate high-quality player trajectories that are significant improvements over baselines, and approach the ground truth quality in this comparison setting. 5.3 Analyzing Macro- and Micro-policy Integration Our model integrates the macro- and micro-policy by converting the macro-goal into an attention mask on the micro-action output space, which intuitively guides the micro-policy towards the macro-goal. We now inspect our macro-policy and attention mechanism to verify this behavior. Figure 6a depicts how the macro-policy πmacro guides the micro-policy πmicro through the attention φ, by attending to the direction in which the agent can reach the predicted macro-goal. The attention model and micro-policy differ in semantic behavior: the attention favors a wider range of velocities and larger magnitudes, while the micro-policy favors smaller velocities. 2We chose this preference study design to focus the qualitative comparison on the plausibility of individual movements (e.g. how players might practice alone), as opposed to strategically coordinated team movements. 7 Model ∆= 0 ∆= 1 ∆= 2 ∆= 3 Macro-goals g Attention φ CNN 21.8% 21.5% 21.7% 21.5% GRU-CNN 25.8% 25.0% 24.9% 24.4% H-GRU-CNN-CC 31.5% 29.9% 29.5% 29.1% 10.1% H-GRU-CNN-STACK 26.9% 25.7% 25.9% 24.9% 9.8% H-GRU-CNN-ATT 33.7% 31.6% 31.0% 30.5% 10.5% H-GRU-CNN-AUX 31.6% 30.7% 29.4% 28.0% 10.8% 19.2% Table 2: Benchmark Evaluations. ∆-step look-ahead prediction accuracy for micro-actions ai t+∆= π(st) on a holdout set, with ∆= 0, 1, 2, 3. H-GRU-CNN-STACK is an HPN where predictions are organized in a feed-forward stack, with π(st)t feeding into π(st)t+1. Using attention (H-GRU-CNN-ATT) improves on all baselines in micro-action prediction. All hierarchical models are pre-trained, but not fine-tuned, on macro-goals ˆg. We report prediction accuracy on the weak labels ˆg, ˆφ for hierarchical models.H-GRU-CNN-AUX is an HPN that was trained using ˆφ. As ˆφ optimizes for optimal long-term behavior, this lowers the micro-action accuracy. Figure 6b depicts predicted macro-goals by HPN along with rollout tracks. In general, we see that the rollouts are guided towards the predicted macro-goals. However, we also observe that the HPN makes some inconsistent macro-goal predictions, which suggests there is still room for improvement. 5.4 Benchmark Analysis We finally evaluated using a number of benchmark experiments, with results shown in Table 2. These experiments measure quantities that are related to overall quality, albeit not holistically. We first evaluated the 4-step look-ahead accuracy of the HPN for micro-actions ai t+∆, ∆= 0, 1, 2, 3. On this benchmark, the HPN outperforms all baseline policy networks when not using weak labels ˆφ to train the attention mechanism, which suggests that using a hierarchical model can noticeably improve the short-term prediction accuracy over non-hierarchical baselines. We also report the prediction accuracy on weak labels ˆg, ˆφ, although they were only used during pretraining, and we did not fine-tune for accuracy on them. Using weak labels one can tune the network for both long-term and short-term planning, whereas all non-hierarchical baselines are optimized for short-term planning only. Including the weak labels ˆφ can lower the accuracy on short-term prediction, but increases the quality of the on-policy rollouts. This trade-off can be empirically set by tuning the number of weak labels used during pre-training. 6 Limitations and Future Work We have presented a hierarchical memory network for generating long-term spatiotemporal trajectories. Our approach simultaneously models macro-goals and micro-actions and integrates them using a novel attention mechanism. We demonstrated significant improvement over non-hierarchical baselines in a case study on modeling basketball player behavior. There are several notable limitations to our HPN model. First, we did not consider all aspects of basketball gameplay, such as passing and shooting. We also modeled all players using a single policy whereas in reality player behaviors vary (although the variability can be low-dimensional (Yue et al. [16])). We only modeled offensive players: an interesting direction is modeling defensive players and integrating adversarial reinforcement learning (Panait and Luke [13]) into our approach. These issues limited the scope of our preference study, and it would be interesting to consider extended settings. In order to focus on the HPN model class, we only used the imitation learning setting. More broadly, many planning problems require collecting training data via exploration (Mnih et al. [11]), which can be more challenging. One interesting scenario is having two adversarial policies learn to be strategic against each other through repeatedly game-play in a basketball simulator. Furthermore, in general it can be difficult to acquire the appropriate weak labels to initialize the macro-policy training. From a technical perspective, using attention in the output space may be applicable to other architectures. More sophisticated applications may require multiple levels of output attention masking. Acknowledgments. This research was supported in part by NSF Award #1564330, and a GPU donation (Tesla K40 and Titan X) by NVIDIA. 8 References [1] Aijun Bai, Feng Wu, and Xiaoping Chen. Online planning for large markov decision processes with hierarchical decomposition. ACM Transactions on Intelligent Systems and Technology (TIST), 6(4):45, 2015. [2] Richard W Byrne and Anne E Russon. Learning by imitation: A hierarchical approach. Behavioral and brain sciences, 21(05):667–684, 1998. [3] Junyoung Chung, Çaglar Gülçehre, Kyunghyun Cho, and Yoshua Bengio. Gated feedback recurrent neural networks. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 2067–2075, 2015. [4] Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 2980–2988. Curran Associates, Inc., 2015. [5] Jonathan St B. T. Evans and Keith E. Stanovich. Dual-Process Theories of Higher Cognition Advancing the Debate. Perspectives on Psychological Science, 8(3):223–241, May 2013. ISSN 1745-6916, 1745-6924. doi: 10.1177/1745691612460685. [6] Carlos Guestrin, Daphne Koller, Ronald Parr, and Shobha Venkataraman. Efficient Solution Algorithms for Factored MDPs. J. Artif. Int. Res., 19(1):399–468, October 2003. ISSN 1076-9757. [7] Matthew Hausknecht and Peter Stone. Deep reinforcement learning in parameterized action space. In Proceedings of the International Conference on Learning Representations (ICLR), San Juan, Puerto Rico, May . [8] Ruijie He, Emma Brunskill, and Nicholas Roy. PUMA: Planning Under Uncertainty with Macro-Actions. In Twenty-Fourth AAAI Conference on Artificial Intelligence, July 2010. [9] Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. pages 448–456, 2015. [10] George Konidaris, Scott Kuindersma, Roderic Grupen, and Andrew Barto. Robot learning from demonstration by constructing skill trees. The International Journal of Robotics Research, 31(3):360–375, March 2012. ISSN 0278-3649, 1741-3176. doi: 10.1177/0278364911428653. [11] Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A. Rusu, Joel Veness, Marc G. Bellemare, Alex Graves, Martin Riedmiller, Andreas K. Fidjeland, Georg Ostrovski, Stig Petersen, Charles Beattie, Amir Sadik, Ioannis Antonoglou, Helen King, Dharshan Kumaran, Daan Wierstra, Shane Legg, and Demis Hassabis. Human-level control through deep reinforcement learning. Nature, 518(7540):529–533, February 2015. ISSN 0028-0836. doi: 10.1038/nature14236. [12] Katharina Muelling, Abdeslam Boularias, Betty Mohler, Bernhard Schölkopf, and Jan Peters. Learning strategies in table tennis using inverse reinforcement learning. Biological Cybernetics, 108(5):603–619, October 2014. ISSN 1432-0770. doi: 10.1007/s00422-014-0599-1. [13] Liviu Panait and Sean Luke. Cooperative multi-agent learning: The state of the art. Autonomous Agents and Multi-Agent Systems, 11(3):387–434, 2005. [14] Richard S. Sutton, Doina Precup, and Satinder Singh. Between MDPs and semi-MDPs: A framework for temporal abstraction in reinforcement learning. Artificial Intelligence, 112(1–2):181–211, August 1999. ISSN 0004-3702. doi: 10.1016/S0004-3702(99)00052-1. [15] Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, Attend and Tell: Neural Image Caption Generation with Visual Attention. arXiv:1502.03044 [cs], February 2015. arXiv: 1502.03044. [16] Yisong Yue, Patrick Lucey, Peter Carr, Alina Bialkowski, and Iain Matthews. Learning Fine-Grained Spatial Models for Dynamic Sports Play Prediction. In IEEE International Conference on Data Mining (ICDM). [17] Brian D Ziebart, Andrew L Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. In AAAI, pages 1433–1438, 2008. 9
2016
567
6,513
Natural-Parameter Networks: A Class of Probabilistic Neural Networks Hao Wang, Xingjian Shi, Dit-Yan Yeung Hong Kong University of Science and Technology {hwangaz,xshiab,dyyeung}@cse.ust.hk Abstract Neural networks (NN) have achieved state-of-the-art performance in various applications. Unfortunately in applications where training data is insufficient, they are often prone to overfitting. One effective way to alleviate this problem is to exploit the Bayesian approach by using Bayesian neural networks (BNN). Another shortcoming of NN is the lack of flexibility to customize different distributions for the weights and neurons according to the data, as is often done in probabilistic graphical models. To address these problems, we propose a class of probabilistic neural networks, dubbed natural-parameter networks (NPN), as a novel and lightweight Bayesian treatment of NN. NPN allows the usage of arbitrary exponential-family distributions to model the weights and neurons. Different from traditional NN and BNN, NPN takes distributions as input and goes through layers of transformation before producing distributions to match the target output distributions. As a Bayesian treatment, efficient backpropagation (BP) is performed to learn the natural parameters for the distributions over both the weights and neurons. The output distributions of each layer, as byproducts, may be used as second-order representations for the associated tasks such as link prediction. Experiments on real-world datasets show that NPN can achieve state-of-the-art performance. 1 Introduction Recently neural networks (NN) have achieved state-of-the-art performance in various applications ranging from computer vision [12] to natural language processing [20]. However, NN trained by stochastic gradient descent (SGD) or its variants is known to suffer from overfitting especially when training data is insufficient. Besides overfitting, another problem of NN comes from the underestimated uncertainty, which could lead to poor performance in applications like active learning. Bayesian neural networks (BNN) offer the promise of tackling these problems in a principled way. Early BNN works include methods based on Laplace approximation [16], variational inference (VI) [11], and Monte Carlo sampling [18], but they have not been widely adopted due to their lack of scalability. Some recent advances in this direction seem to shed light on the practical adoption of BNN. [8] proposed a method based on VI in which a Monte Carlo estimate of a lower bound on the marginal likelihood is used to infer the weights. Recently, [10] used an online version of expectation propagation (EP), called ‘probabilistic back propagation’ (PBP), for the Bayesian learning of NN, and [4] proposed ‘Bayes by Backprop’ (BBB), which can be viewed as an extension of [8] based on the ‘reparameterization trick’ [13]. More recently, an interesting Bayesian treatment called ‘Bayesian dark knowledge’ (BDK) was designed to approximate a teacher network with a simpler student network based on stochastic gradient Langevin dynamics (SGLD) [1]. Although these recent methods are more practical than earlier ones, several outstanding problems remain to be addressed: (1) most of these methods require sampling either at training time [8, 4, 1] or at test time [4], incurring much higher cost than a ‘vanilla’ NN; (2) as mentioned in [1], methods 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. based on online EP or VI do not involve sampling, but they need to compute the predictive density by integrating out the parameters, which is computationally inefficient; (3) these methods assume Gaussian distributions for the weights and neurons, allowing no flexibility to customize different distributions according to the data as is done in probabilistic graphical models (PGM). To address the problems, we propose natural-parameter networks (NPN) as a class of probabilistic neural networks where the input, target output, weights, and neurons can all be modeled by arbitrary exponential-family distributions (e.g., Poisson distributions for word counts) instead of being limited to Gaussian distributions. Input distributions go through layers of linear and nonlinear transformation deterministically before producing distributions to match the target output distributions (previous work [21] shows that providing distributions as input by corrupting the data with noise plays the role of regularization). As byproducts, output distributions of intermediate layers may be used as second-order representations for the associated tasks. Thanks to the properties of the exponential family [3, 19], distributions in NPN are defined by the corresponding natural parameters which can be learned efficiently by backpropagation. Unlike [4, 1], NPN explicitly propagates the estimates of uncertainty back and forth in deep networks. This way the uncertainty estimates for each layer of neurons are readily available for the associated tasks. Our experiments show that such information is helpful when neurons of intermediate layers are used as representations like in autoencoders (AE). In summary, our main contributions are: • We propose NPN as a class of probabilistic neural networks. Our model combines the merits of NN and PGM in terms of computational efficiency and flexibility to customize the types of distributions for different types of data. • Leveraging the properties of the exponential family, some sampling-free backpropagationcompatible algorithms are designed to efficiently learn the distributions over weights by learning the natural parameters. • Unlike most probabilistic NN models, NPN obtains the uncertainty of intermediate-layer neurons as byproducts, which provide valuable information to the learned representations. Experiments on real-world datasets show that NPN can achieve state-of-the-art performance on classification, regression, and unsupervised representation learning tasks. 2 Natural-Parameter Networks The exponential family refers to an important class of distributions with useful algebraic properties. Distributions in the exponential family have the form p(x|η) = h(x)g(η) exp{ηT u(x)}, where x is the random variable, η denotes the natural parameters, u(x) is a vector of sufficient statistics, and g(η) is the normalizer. For a given type of distributions, different choices of η lead to different shapes. For example, a univariate Gaussian distribution with η = (c, d)T corresponds to N(−c 2d, −1 2d). Motivated by this observation, in NPN, only the natural parameters need to be learned to model the distributions over the weights and neurons. Consider an NPN which takes a vector random distribution (e.g., a multivariate Gaussian distribution) as input, multiplies it by a matrix random distribution, goes through nonlinear transformation, and outputs another distribution. Since all three distributions in the process can be specified by their natural parameters (given the types of distributions), learning and prediction of the network can actually operate in the space of natural parameters. For example, if we use element-wise (factorized) gamma distributions for both the weights and neurons, the NPN counterpart of a vanilla network only needs twice the number of free parameters (weights) and neurons since there are two natural parameters for each univariate gamma distribution. 2.1 Notation and Conventions We use boldface uppercase letters like W to denote matrices and boldface lowercase letters like b for vectors. Similarly, a boldface number (e.g., 1 or 0) represents a row vector or a matrix with identical entries. In NPN, o(l) is used to denote the values of neurons in layer l before nonlinear transformation and a(l) is for the values after nonlinear transformation. As mentioned above, NPN tries to learn distributions over variables rather than variables themselves. Hence we use letters without subscripts c, d, m, and s (e.g., o(l) and a(l)) to denote ‘random variables’ with corresponding distributions. Subscripts c and d are used to denote natural parameter pairs, such as Wc and Wd. Similarly, subscripts m and s are for mean-variance pairs. Note that for clarity, many operations used below are implicitly element-wise, for example, the square z2, division z b, partial derivative ∂z ∂b, the 2 gamma function Γ(z), logarithm log z, factorial z!, 1 + z, and 1 z. For the data D = {(xi, yi)}N i=1, we set a(0) m = xi, a(0) s = 0 (Input distributions with a(0) s ̸= 0 resemble AE’s denoising effect.) as input of the network and yi denotes the output targets (e.g., labels and word counts). In the following text we drop the subscript i (and sometimes the superscript (l)) for clarity. The bracket (·, ·) denotes concatenation or pairs of vectors. 2.2 Linear Transformation in NPN Here we first introduce the linear form of a general NPN. For simplicity, we assume distributions with two natural parameters (e.g., gamma distributions, beta distributions, and Gaussian distributions), η = (c, d)T , in this section. Specifically, we have factorized distributions on the weight matrices, p(W(l)|W(l) c , W(l) d ) = Q i,j p(W(l) ij |W(l) c,ij, W(l) d,ij), where the pair (W(l) c,ij, W(l) d,ij) is the corresponding natural parameters. For b(l), o(l), and a(l) we assume similar factorized distributions. In a traditional NN, the linear transformation follows o(l) = a(l−1)W(l) + b(l) where a(l−1) is the output from the previous layer. In NN a(l−1), W(l), and b(l) are deterministic variables while in NPN they are exponential-family distributions, meaning that the result o(l) is also a distribution. For convenience of subsequent computation it is desirable to approximate o(l) using another exponentialfamily distribution. We can do this by matching the mean and variance. Specifically, after computing (W(l) m , W(l) s ) = f(W(l) c , W(l) d ) and (b(l) m , b(l) s ) = f(b(l) c , b(l) d ), we can get o(l) c and o(l) d through the mean o(l) m and variance o(l) s of o(l) as follows: (a(l−1) m , a(l−1) s ) = f(a(l−1) c , a(l−1) d ), o(l) m = a(l−1) m W(l) m + b(l) m , (1) o(l) s = a(l−1) s W(l) s + a(l−1) s (W(l) m ◦W(l) m ) + (a(l−1) m ◦a(l−1) m )W(l) s + b(l) s , (2) (o(l) c , o(l) d ) = f −1(o(l) m , o(l) s ), (3) where ◦denotes the element-wise product and the bijective function f(·, ·) maps the natural parameters of a distribution into its mean and variance (e.g., f(c, d) = ( c+1 −d , c+1 d2 ) in gamma distributions). Similarly we use f −1(·, ·) to denote the inverse transformation. W(l) m , W(l) s , b(l) m , and b(l) s are the mean and variance of W(l) and b(l) obtained from the natural parameters. The computed o(l) m and o(l) s can then be used to recover o(l) c and o(l) d , which will subsequently facilitate the feedforward computation of the nonlinear transformation described in Section 2.3. 2.3 Nonlinear Transformation in NPN After we obtain the linearly transformed distribution over o(l) defined by natural parameters o(l) c and o(l) d , an element-wise nonlinear transformation v(·) (with a well defined inverse function v−1(·)) will be imposed. The resulting activation distribution is pa(a(l)) = po(v−1(a(l)))|v−1′(a(l))|, where po is the factorized distribution over o(l) defined by (o(l) c , o(l) d ). Though pa(a(l)) may not be an exponential-family distribution, we can approximate it with one, p(a(l)|a(l) c , a(l) d ), by matching the first two moments. Once the mean a(l) m and variance a(l) s of pa(a(l)) are obtained, we can compute corresponding natural parameters with f −1(·, ·) (approximation accuracy is sufficient according to preliminary experiments). The feedforward computation is: am = Z po(o|oc, od)v(o)do, as = Z po(o|oc, od)v(o)2do −a2 m, (ac, ad) = f −1(am, as). (4) Here the key computational challenge is computing the integrals in Equation (4). Closed-form solutions are needed for their efficient computation. If po(o|oc, od) is a Gaussian distribution, closedform solutions exist for common activation functions like tanh(x) and max(0, x) (details are in Section 3.2). Unfortunately this is not the case for other distributions. Leveraging the convenient form of the exponential family, we find that it is possible to design activation functions so that the integrals for non-Gaussian distributions can also be expressed in closed form. Theorem 1. Assume an exponential-family distribution po(x|η) = h(x)g(η) exp{ηT u(x)}, where the vector u(x) = (u1(x), u2(x), . . . , uM(x))T (M is the number of natural parameters). If activation function v(x) = r −q exp(−τui(x)) is used, the first two moments of v(x), R po(x|η)v(x)dx 3 Table 1: Activation Functions for Exponential-Family Distributions Distribution Probability Density Function Activation Function Support Beta Distribution p(x) = Γ(c+d) Γ(c)Γ(d) xc−1(1 −x)d−1 qxτ , τ ∈(0, 1) [0, 1] Rayleigh Distribution p(x) = x σ2 exp{−x2 2σ2 } r −q exp{−τx2} (0, +∞) Gamma Distribution p(x) = 1 Γ(c) dcxc−1 exp{−dx} r −q exp{−τx} (0, +∞) Poisson Distribution p(x) = cx exp{−c} x! r −q exp{−τx} Nonnegative interger Gaussian Distribution p(x) = (2πσ2)−1 2 exp{− 1 2σ2 (x −µ)2} ReLU, tanh, and sigmoid (−∞, +∞) and R po(x|η)v(x)2dx, can be expressed in closed form. Here i ∈{1, 2, . . . , M} (different ui(x) corresponds to a different set of activation functions) and r, q, and τ are constants. Proof. We first let η = (η1, η2, . . . , ηM), eη = (η1, η2, . . . , ηi −τ, . . . , ηM), and bη = (η1, η2, . . . , ηi −2τ, . . . , ηM). The first moment of v(x) is E(v(x)) = r −q Z h(x)g(η) exp{ηT u(x) −τui(x)} dx = r −q Z h(x)g(η) g(eη)g(eη) exp{eηT u(x)} dx = r −q g(η) g(eη). Similarly the second moment can be computed as E(v(x)2) = r2 + q2 g(η) g(bη) −2rq g(η) g(eη). A more detailed proof is provided in the supplementary material. With Theorem 1, what remains is to find the constants that make v(x) strictly increasing and bounded (Table 1 shows some exponentialfamily distributions and their possible activation functions). For example in Equation (4), if v(x) = r −q exp(−τx), am = r −q( od od+τ )oc for the gamma distribution. In the backpropagation, for distributions with two natural parameters the gradient consists of two terms. For example, ∂E ∂oc = ∂E ∂am ◦∂am ∂oc + ∂E ∂as ◦∂as ∂oc , where E is the error term of the network. Algorithm 1 Deep Nonlinear NPN 1: Input: Data D = {(xi, yi)}N i=1, number of iterations T, learning rate ρt, number of layers L. 2: for t = 1 : T do 3: for l = 1 : L do 4: Apply Equation (1)-(4) to compute the linear and nonlinear transformation in layer l. 5: end for 6: Compute the error E from (o(L) c , o(L) d ) or (a(L) c , a(L) d ). 7: for l = L : 1 do 8: Compute ∂E ∂W(l) m , ∂E ∂W(l) s , ∂E ∂b(l) m , and ∂E ∂b(l) s . Compute ∂E ∂W(l) c , ∂E ∂W(l) d , ∂E ∂b(l) c , and ∂E ∂b(l) d . 9: end for 10: Update W(l) c , W(l) d , b(l) c , and b(l) d in all layers. 11: end for 2.4 Deep Nonlinear NPN Naturally layers of nonlinear NPN can be stacked to form a deep NPN1, as shown in Algorithm 12. A deep NPN is in some sense similar to a PGM with a chain structure. Unlike PGM in general, however, NPN does not need costly inference algorithms like variational inference or Markov chain Monte Carlo. For some chain-structured PGM (e.g, hidden Markov models), efficient inference algorithms also exist due to their special structure. Similarly, the Markov property enables NPN to be efficiently trained in an end-to-end backpropagation learning fashion in the space of natural parameters. PGM is known to be more flexible than NN in the sense that it can choose different distributions to depict different relationships among variables. A major drawback of PGM is its scalability especially 1Although the approximation accuracy may decrease as NPN gets deeper during feedforward computation, it can be automatically adjusted according to data during backpropagation. 2Note that since the first part of Equation (1) and the last part of Equation (4) are canceled out, we can directly use (a(l) m , a(l) s ) without computing (a(l) c , a(l) d ) here. 4 when the PGM is deep. Different from PGM, NN stacks relatively simple computational layers and learns the parameters using backpropagation, which is computationally more efficient than most algorithms for PGM. NPN has the potential to get the best of both worlds. In terms of flexibility, different types of exponential-family distributions can be chosen for the weights and neurons. Using gamma distributions for both the weights and neurons in NPN leads to a deep and nonlinear version of nonnegative matrix factorization [14] while an NPN with the Bernoulli distribution and sigmoid activation resembles a Bayesian treatment of sigmoid belief networks [17]. If Poisson distributions are chosen for the neurons, NPN becomes a neural analogue of deep Poisson factor analysis [26, 9]. Note that similar to the weight decay in NN, we may add the KL divergence between the prior distributions and the learned distributions on the weights to the error E for regularization (we use isotropic Gaussian priors in the experiments). In NPN, the chosen prior distributions correspond to priors in Bayesian models and the learned distributions correspond to the approximation of posterior distributions on weights. Note that the generative story assumed here is that weights are sampled from the prior, and then output is generated (given all data) from these weights. 3 Variants of NPN In this section, we introduce three NPN variants with different properties to demonstrate the flexibility and effectiveness of NPN. Note that in practice we use a transformed version of the natural parameters, referred to as proxy natural parameters here, instead of the original ones for computational efficiency. For example, in gamma distributions p(x|c, d) = Γ(c)−1dcxc−1 exp(−dx), we use proxy natural parameters (c, d) during computation rather than the natural parameters (c −1, −d). 3.1 Gamma NPN The gamma distribution with support over positive values is an important member of the exponential family. The corresponding probability density function is p(x|c, d) = Γ(c)−1dcxc−1 exp(−dx) with (c −1, −d) as its natural parameters (we use (c, d) as proxy natural parameters). If we assume gamma distributions for W(l), b(l), o(l), and a(l), an AE formed by NPN becomes a deep and nonlinear version of nonnegative matrix factorization [14]. To see this, note that this AE with activation v(x) = x and zero biases b(l) is equivalent to finding a factorization of matrix X such that X = H QL l= L 2 W(l) where H denotes the middle-layer neurons and W(l) has nonnegative entries from gamma distributions. In this gamma NPN, parameters W(l) c , W(l) d , b(l) c , and b(l) d can be learned following Algorithm 1. We detail the algorithm as follows: Linear Transformation: Since gamma distributions are assumed here, we can use the function f(c, d) = ( c d, c d2 ) to compute (W(l) m , W(l) s ) = f(W(l) c , W(l) d ), (b(l) m , b(l) s ) = f(b(l) c , b(l) d ), and (o(l) c , o(l) d ) = f −1(o(l) m , o(l) s ) during the probabilistic linear transformation in Equation (1)-(3). Nonlinear Transformation: With the proxy natural parameters for the gamma distributions over o(l), the mean a(l) m and variance a(l) s for the nonlinearly transformed distribution over a(l) would be obtained with Equation (4). Following Theorem 1, closed-form solutions are possible with v(x) = r(1 −exp(−τx)) (r = q and ui(x) = x) where r and τ are constants. Using this new activation function, we have (see Section 2.1 and 6.1 of the supplementary material for details on the function and derivation): am = Z po(o|oc, od)v(o)do = r(1 − ooc d Γ(oc) ◦Γ(oc) ◦(od + τ)−oc) = r(1 −( od od + τ )oc), as = r2(( od od + 2τ )oc −( od od + τ )2oc). Error: With o(L) c and o(L) d , we can compute the regression error E as the negative log-likelihood: E = (log Γ(o(L) c ) −o(L) c ◦log o(L) d −(o(L) c −1) ◦log y + o(L) d ◦y)1T , where y is the observed output corresponding to x. For classification, cross-entropy loss can be used as E. Following the computation flow above, BP can be used to learn W(l) c , W(l) d , b(l) c , and b(l) d . 5 −6 −4 −2 0 2 4 6 −100 −80 −60 −40 −20 0 20 40 60 80 100 Y X Figure 1: Predictive distributions for PBP, BDK, dropout NN, and NPN. The shaded regions correspond to ±3 standard deviations. The black curve is the data-generating function and blue curves show the mean of the predictive distributions. Red stars are the training data. 3.2 Gaussian NPN Different from the gamma distribution which has support over positive values only, the Gaussian distribution, also an exponential-family distribution, can describe real-valued random variables. This makes it a natural choice for NPN. We refer to this NPN variant with Gaussian distributions over both the weights and neurons as Gaussian NPN. Details of Algorithm 1 for Gaussian NPN are as follows: Linear Transformation: Besides support over real values, another property of Gaussian distributions is that the mean and variance can be used as proxy natural parameters, leading to an identity mapping function f(c, d) = (c, d) which cuts the computation cost. We can use this function to compute (W(l) m , W(l) s ) = f(W(l) c , W(l) d ), (b(l) m , b(l) s ) = f(b(l) c , b(l) d ), and (o(l) c , o(l) d ) = f −1(o(l) m , o(l) s ) during the probabilistic linear transformation in Equation (1)-(3). Nonlinear Transformation: If the sigmoid activation v(x) = σ(x) = 1 1+exp(−x) is used, am in Equation (4) would be (convolution of Gaussian with sigmoid is approximated by another sigmoid): am = Z N(o|oc, diag(od)) ◦σ(o)do ≈σ( oc (1 + ζ2od) 1 2 ), (5) as = Z N(o|oc, diag(od)) ◦σ(o)2do −a2 m ≈σ( α(oc + β) (1 + ζ2α2od)1/2 ) −a2 m, (6) where α = 4 −2 √ 2, β = −log( √ 2 + 1), and ζ2 = π/8. Similar approximation can be applied for activation v(x) = tanh(x) since tanh(x) = 2σ(2x) −1. If the ReLU activation v(x) = max(0, x) is used, we can use the techniques in [6] to obtain the first two moments of max(z1, z2) where z1 and z2 are Gaussian random variables. Full derivation for v(x) = σ(x), v(x) = tanh(x), and v(x) = max(0, x) is left to the supplementary material. Error: With o(L) c and o(L) d in the last layer, we can then compute the error E as the KL divergence KL(N(o(L) c , diag(o(L) d )) ∥N(ym, diag(ϵ))), where ϵ is a vector with all entries equal to a small value ϵ. Hence the error E = 1 2( ϵ o(L) d 1T + ( 1 o(L) d )(o(L) c −y)T −K + (log o(L) d )1T −K log ϵ). For classification tasks, cross-entropy loss is used. Following the computation flow above, BP can be used to learn W(l) c , W(l) d , b(l) c , and b(l) d . 3.3 Poisson NPN The Poisson distribution, as another member of the exponential family, is often used to model counts (e.g., counts of words, topics, or super topics in documents). Hence for text modeling, it is natural to assume Poisson distributions for neurons in NPN. Interestingly, this design of Poisson NPN can be seen as a neural analogue of some Poisson factor analysis models [26]. Besides closed-form nonlinear transformation, another challenge of Poisson NPN is to map the pair (o(l) m , o(l) s ) to the single parameter o(l) c of Poisson distributions. According to the central limit theorem, we have o(l) c = 1 4(2o(l) m −1 + q (2o(l) m −1)2 + 8o(l) s ) (see Section 3 and 6.3 of the supplementary material for proofs, justifications, and detailed derivation of Poisson NPN). 4 Experiments In this section we evaluate variants of NPN and other state-of-the-art methods on four real-world datasets. We use Matlab (with GPU) to implement NPN, AE variants, and the ‘vanilla’ NN trained with dropout SGD (dropout NN). For other baselines, we use the Theano library [2] and MXNet [5]. 6 Table 2: Test Error Rates on MNIST Method BDK BBB Dropout1 Dropout2 gamma NPN Gaussian NPN Error 1.38% 1.34% 1.33% 1.40% 1.27% 1.25% Table 3: Test Error Rates for Different Size of Training Data Size 100 500 2,000 10,000 NPN 29.97% 13.79% 7.89% 3.28% Dropout 32.58% 15.39% 8.78% 3.53% BDK 30.08% 14.34% 8.31% 3.55% 4.1 Toy Regression Task To gain some insights into NPN, we start with a toy 1d regression task so that the predicted mean and variance can be visualized. Following [1], we generate 20 points in one dimension from a uniform distribution in the interval [−4, 4]. The target outputs are sampled from the function y = x3 + ϵn, where ϵn ∼N(0, 9). We fit the data with the Gaussian NPN, BDK, and PBP (see the supplementary material for detailed hyperparameters). Figure 1 shows the predicted mean and variance of NPN, BDK, and PBP along with the mean provided by the dropout NN (for larger versions of figures please refer to the end of the supplementary materials). As we can see, the variance of PBP, BDK, and NPN diverges as x is farther away from the training data. Both NPN’s and BDK’s predictive distributions are accurate enough to keep most of the y = x3 curve inside the shaded regions with relatively low variance. An interesting observation is that the training data points become more scattered when x > 0. Ideally, the variance should start diverging from x = 0, which is what happens in NPN. However, PBP and BDK are not sensitive enough to capture this dispersion change. In another dataset, Boston Housing, the root mean square error for PBP, BDK, and NPN is 3.01, 2.82, and 2.57. 4.2 MNIST Classification The MNIST digit dataset consists of 60,000 training images and 10,000 test images. All images are labeled as one of the 10 digits. We train the models with 50,000 images and use 10,000 images for validation. Networks with a structure of 784-800-800-10 are used for all methods, since 800 works best for the dropout NN (denoted as Dropout1 in Table 2) and BDK (BDK with a structure of 784-400-400-10 achieves an error rate of 1.41%). We also try the dropout NN with twice the number of hidden neurons (Dropout2 in Table 2) for fair comparison. For BBB, we directly quote their results from [4]. We implement BDK and NPN using the same hyperparameters as in [1] whenever possible. Gaussian priors are used for NPN (see the supplementary material for detailed hyperparameters). 1 2 3 4 5 6 7 8 9 0 0.2 0.4 0.6 0.8 1 Variance Accuracy Figure 2: Classification accuracy for different variance (uncertainty). Note that ‘1’ in the x-axis means a(L) s 1T ∈[0, 0.04), ‘2’ means a(L) s 1T ∈[0.04, 0.08), etc. As shown in Table 2, BDK and BBB achieve comparable performance with dropout NN (similar to [1], PBP is not included in the comparison since it supports regression only), and gamma NPN slightly outperforms dropout NN. Gaussian NPN is able to achieve a lower error rate of 1.25%. Note that BBB with Gaussian priors can only achieve an error rate of 1.82%; 1.34% is the result of using Gaussian mixture priors. For reference, the error rate for dropout NN with 1600 neurons in each hidden layer is 1.40%. The time cost per epoch is 18.3s, 16.2s, and 6.4s for NPN, BDK, NN respectively. Note that BDK is in C++ and NPN is in Matlab. To evaluate NPN’s ability as a Bayesian treatment to avoid overfitting, we vary the size of the training set (from 100 to 10,000 data points) and compare the test error rates. As shown in Table 3, the margin between the Gaussian NPN and dropout NN increases as the training set shrinks. Besides, to verify the effectiveness of the estimated uncertainty, we split the test set into 9 subsets according NPN’s estimated variance (uncertainty) a(L) s 1T for each sample and show the accuracy for each subset in Figure 2. We can find that the more uncertain NPN is, the lower the accuracy, indicating that the estimated uncertainty is well calibrated. 4.3 Second-Order Representation Learning Besides classification and regression, we also consider the problem of unsupervised representation learning with a subsequent link prediction task. Three real-world datasets, Citeulike-a, Citeulike-t, and arXiv, are used. The first two datasets are from [22, 23], collected separately from CiteULike in different ways to mimic different real-world settings. The third one is from arXiv as one of the SNAP datasets [15]. Citeulike-a consists of 16,980 documents, 8,000 terms, and 44,709 links (citations). 7 Table 4: Link Rank on Three Datasets Method SAE SDAE VAE gamma NPN Gaussian NPN Poisson NPN Citeulike-a 1104.7 992.4 980.8 851.7 (935.8) 750.6 (823.9) 690.9 (5389.7) Citeulike-t 2109.8 1356.8 1599.6 1342.3 (1400.7) 1280.4 (1330.7) 1354.1 (9117.2) arXiv 4232.7 2916.1 3367.2 2796.4 (3038.8) 2687.9 (2923.8) 2684.1 (10791.3) Citeulike-t consists of 25,975 documents, 20,000 terms, and 32,565 links. The last dataset, arXiv, consists of 27,770 documents, 8,000 terms, and 352,807 links. The task is to perform unsupervised representation learning before feeding the extracted representations (middle-layer neurons) into a Bayesian LR algorithm [3]. We use the stacked autoencoder (SAE) [7], stacked denoising autoencoder (SDAE) [21], variational autoencoder (VAE) [13] as baselines (hyperparameters like weight decay and dropout rate are chosen by cross validation). As in SAE, we use different variants of NPN to form autoencoders where both the input and output targets are bag-of-words (BOW) vectors for the documents. The network structure for all models is B-100-50 (B is the number of terms). Please refer to the supplementary material for detailed hyperparameters. [!h] 0 5 10 15 20 0 50 100 150 200 250 300 350 Variance Reconstruction error Figure 3: Reconstruction error and estimated uncertainty for each data point in Citeulike-a. One major advantage of NPN over SAE and SDAE is that the learned representations are distributions instead of point estimates. Since representations from NPN contain both the mean and variance, we call them secondorder representations. Note that although VAE also produces second-order representations, the variance part is simply parameterized by multilayer perceptrons while NPN’s variance is naturally computed through propagation of distributions. These 50-dimensional representations with both mean and variance are fed into a Bayesian LR algorithm for link prediction (for deterministic AE the variance is set to 0). We use links among 80% of the nodes (documents) to train the Bayesian LR and use other links as the test set. link rank and AUC (area under the ROC curve) are used as evaluation metrics. The link rank is the average rank of the observed links from test nodes to training nodes. We compute the AUC for every test node and report the average values. By definition, lower link rank and higher AUC indicate better predictive performance and imply more powerful representations. Table 4 shows the link rank for different models. For fair comparison we also try all baselines with double budget (a structure of B-200-50) and report whichever has higher accuracy. As we can see, by treating representations as distributions rather than points in a vector space, NPN is able to achieve much lower link rank than all baselines, including VAE with variance information. The numbers in the brackets show the link rank of NPN if we discard the variance information. The performance gain from variance information verifies the effectiveness of the variance (uncertainty) estimated by NPN. Among different variants of NPN, the Gaussian NPN seems to perform better in datasets with fewer words like Citeulike-t (only 18.8 words per document). The Poisson NPN, as a more natural choice to model text, achieves the best performance in datasets with more words (Citeulike-a and arXiv). The performance in AUC is consistent with that in terms of the link rank (see Section 4 of the supplementary material). To further verify the effectiveness of the estimated uncertainty, we plot the reconstruction error and the variance o(L) s 1T for each data point of Citeulike-a in Figure 3. As we can see, higher uncertainty often indicates not only higher reconstruction error E but also higher variance in E. 5 Conclusion We have introduced a family of models, called natural-parameter networks, as a novel class of probabilistic NN to combine the merits of NN and PGM. NPN regards the weights and neurons as arbitrary exponential-family distributions rather than just point estimates or factorized Gaussian distributions. Such flexibility enables richer descriptions of hierarchical relationships among latent variables and adds another degree of freedom to customize NN for different types of data. Efficient sampling-free backpropagation-compatible algorithms are designed for the learning of NPN. Experiments show that NPN achieves state-of-the-art performance on classification, regression, and representation learning tasks. As possible extensions of NPN, it would be interesting to connect NPN to arbitrary PGM to form fully Bayesian deep learning models [24, 25], allowing even richer descriptions of relationships among latent variables. It is also worth noting that NPN cannot be defined as generative models and, unlike PGM, the same NPN model cannot be used to support multiple types of inference (with different observed and hidden variables). We will try to address these limitations in our future work. 8 References [1] A. K. Balan, V. Rathod, K. P. Murphy, and M. Welling. Bayesian dark knowledge. In NIPS, 2015. [2] F. Bastien, P. Lamblin, R. Pascanu, J. Bergstra, I. J. Goodfellow, A. Bergeron, N. Bouchard, and Y. Bengio. Theano: new features and speed improvements. Deep Learning and Unsupervised Feature Learning NIPS 2012 Workshop, 2012. [3] C. M. Bishop. Pattern Recognition and Machine Learning. Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2006. [4] C. Blundell, J. Cornebise, K. Kavukcuoglu, and D. Wierstra. Weight uncertainty in neural network. In ICML, 2015. [5] 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. [6] C. E. Clark. The greatest of a finite set of random variables. Operations Research, 9(2):145–162, 1961. [7] I. Goodfellow, Y. Bengio, and A. Courville. Deep Learning. Book in preparation for MIT Press, 2016. [8] A. Graves. Practical variational inference for neural networks. In NIPS, 2011. [9] R. Henao, Z. Gan, J. Lu, and L. Carin. Deep poisson factor modeling. In NIPS, 2015. [10] J. M. Hernández-Lobato and R. Adams. Probabilistic backpropagation for scalable learning of Bayesian neural networks. In ICML, 2015. [11] G. E. Hinton and D. Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In COLT, 1993. [12] A. Karpathy and F. Li. Deep visual-semantic alignments for generating image descriptions. In CVPR, 2015. [13] D. P. Kingma and M. Welling. Auto-encoding variational Bayes. CoRR, abs/1312.6114, 2013. [14] D. D. Lee and H. S. Seung. Algorithms for non-negative matrix factorization. In NIPS, 2001. [15] J. Leskovec and A. Krevl. SNAP Datasets: Stanford large network dataset collection. http://snap. stanford.edu/data, June 2014. [16] J. MacKay David. A practical Bayesian framework for backprop networks. Neural computation, 1992. [17] R. M. Neal. Learning stochastic feedforward networks. Department of Computer Science, University of Toronto, 1990. [18] R. M. Neal. Bayesian learning for neural networks. PhD thesis, University of Toronto, 1995. [19] R. Ranganath, L. Tang, L. Charlin, and D. M. Blei. Deep exponential families. In AISTATS, 2015. [20] R. Salakhutdinov and G. E. Hinton. Semantic hashing. Int. J. Approx. Reasoning, 50(7):969–978, 2009. [21] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.-A. Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. JMLR, 11:3371–3408, 2010. [22] C. Wang and D. M. Blei. Collaborative topic modeling for recommending scientific articles. In KDD, 2011. [23] H. Wang, B. Chen, and W.-J. Li. Collaborative topic regression with social regularization for tag recommendation. In IJCAI, 2013. [24] H. Wang, N. Wang, and D. Yeung. Collaborative deep learning for recommender systems. In KDD, 2015. [25] H. Wang and D. Yeung. Towards Bayesian deep learning: A framework and some existing methods. TKDE, 2016, to appear. [26] M. Zhou, L. Hannah, D. B. Dunson, and L. Carin. Beta-negative binomial process and poisson factor analysis. In AISTATS, 2012. 9
2016
568
6,514
Minimizing Quadratic Functions in Constant Time Kohei Hayashi National Institute of Advanced Industrial Science and Technology hayashi.kohei@gmail.com Yuichi Yoshida National Institute of Informatics and Preferred Infrastructure, Inc. yyoshida@nii.ac.jp Abstract A sampling-based optimization method for quadratic functions is proposed. Our method approximately solves the following n-dimensional quadratic minimization problem in constant time, which is independent of n: z∗ = minv∈Rn⟨v, Av⟩+ n⟨v, diag(d)v⟩+ n⟨b, v⟩, where A ∈Rn×n is a matrix and d, b ∈Rn are vectors. Our theoretical analysis specifies the number of samples k(δ, ϵ) such that the approximated solution z satisfies |z −z∗| = O(ϵn2) with probability 1−δ. The empirical performance (accuracy and runtime) is positively confirmed by numerical experiments. 1 Introduction A quadratic function is one of the most important function classes in machine learning, statistics, and data mining. Many fundamental problems such as linear regression, k-means clustering, principal component analysis, support vector machines, and kernel methods [14] can be formulated as a minimization problem of a quadratic function. In some applications, it is sufficient to compute the minimum value of a quadratic function rather than its solution. For example, Yamada et al. [21] proposed an efficient method for estimating the Pearson divergence, which provides useful information about data, such as the density ratio [18]. They formulated the estimation problem as the minimization of a squared loss and showed that the Pearson divergence can be estimated from the minimum value. The least-squares mutual information [19] is another example that can be computed in a similar manner. Despite its importance, the minimization of a quadratic function has the issue of scalability. Let n ∈N be the number of variables (the “dimension” of the problem). In general, such a minimization problem can be solved by quadratic programming (QP), which requires poly(n) time. If the problem is convex and there are no constraints, then the problem is reduced to solving a system of linear equations, which requires O(n3) time. Both methods easily become infeasible, even for mediumscale problems, say, n > 10000. Although several techniques have been proposed to accelerate quadratic function minimization, they require at least linear time in n. This is problematic when handling problems with an ultrahigh dimension, for which even linear time is slow or prohibitive. For example, stochastic gradient descent (SGD) is an optimization method that is widely used for large-scale problems. A nice property of this method is that, if the objective function is strongly convex, it outputs a point that is sufficiently close to an optimal solution after a constant number of iterations [5]. Nevertheless, in each iteration, we need at least O(n) time to access the variables. Another technique is lowrank approximation such as Nystr¨om’s method [20]. The underlying idea is the approximation of the problem by using a low-rank matrix, and by doing so, we can drastically reduce the time 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. complexity. However, we still need to compute the matrix–vector product of size n, which requires O(n) time. Clarkson et al. [7] proposed sublinear-time algorithms for special cases of quadratic function minimization. However, it is “sublinear” with respect to the number of pairwise interactions of the variables, which is O(n2), and their algorithms require O(n logc n) time for some c ≥1. Our contributions: Let A ∈Rn×n be a matrix and d, b ∈Rn be vectors. Then, we consider the following quadratic problem: minimize v∈Rn pn,A,d,b(v), where pn,A,d,b(v) = ⟨v, Av⟩+ n⟨v, diag(d)v⟩+ n⟨b, v⟩. (1) Here, ⟨·, ·⟩denotes the inner product and diag(d) denotes the matrix whose diagonal entries are specified by d. Note that a constant term can be included in (1); however, it is irrelevant when optimizing (1), and hence we ignore it. Let z∗∈R be the optimal value of (1) and let ϵ, δ ∈(0, 1) be parameters. Then, the main goal of this paper is the computation of z with |z −z∗| = O(ϵn2) with probability at least 1 −δ in constant time, that is, independent of n. Here, we assume the real RAM model [6], in which we can perform basic algebraic operations on real numbers in one step. Moreover, we assume that we have query accesses to A, b, and d, with which we can obtain an entry of them by specifying an index. We note that z∗is typically Θ(n2) because ⟨v, Av⟩consists of Θ(n2) terms, and ⟨v, diag(d)v⟩and ⟨b, v⟩ consist of Θ(n) terms. Hence, we can regard the error of Θ(ϵn2) as an error of Θ(ϵ) for each term, which is reasonably small in typical situations. Let ·|S be an operator that extracts a submatrix (or subvector) specified by an index set S ⊂N; then, our algorithm is defined as follows, where the parameter k := k(ϵ, δ) will be determined later. Algorithm 1 Input: An integer n ∈N, query accesses to the matrix A ∈Rn×n and to the vectors d, b ∈Rn, and ϵ, δ > 0 1: S ←a sequence of k = k(ϵ, δ) indices independently and uniformly sampled from {1, 2, . . . , n}. 2: return n2 k2 minv∈Rn pk,A|S,d|S,b|S(v). In other words, we sample a constant number of indices from the set {1, 2, . . . , n}, and then solve the problem (1) restricted to these indices. Note that the number of queries and the time complexity are O(k2) and poly(k), respectively. In order to analyze the difference between the optimal values of pn,A,d,b and pk,A|S,d|S,b|S, we want to measure the “distances” between A and A|S, d and d|S, and b and b|S, and want to show them small. To this end, we exploit graph limit theory, initiated by Lov´asz and Szegedy [11] (refer to [10] for a book), in which we measure the distance between two graphs on different number of vertices by considering continuous versions. Although the primary interest of graph limit theory is graphs, we can extend the argument to analyze matrices and vectors. Using synthetic and real settings, we demonstrate that our method is orders of magnitude faster than standard polynomial-time algorithms and that the accuracy of our method is sufficiently high. Related work: Several constant-time approximation algorithms are known for combinatorial optimization problems such as the max cut problem on dense graphs [8, 13], constraint satisfaction problems [1, 22], and the vertex cover problem [15, 16, 25]. However, as far as we know, no such algorithm is known for continuous optimization problems. A related notion is property testing [9, 17], which aims to design constant-time algorithms that distinguish inputs satisfying some predetermined property from inputs that are “far” from satisfying it. Characterizations of constant-time testable properties are known for the properties of a dense graph [2, 3] and the affine-invariant properties of a function on a finite field [23, 24]. 2 Preliminaries For an integer n, let [n] denote the set {1, 2, . . . , n}. The notation a = b ± c means that b −c ≤a ≤ b + c. In this paper, we only consider functions and sets that are measurable. 2 Let S = (x1, . . . , xk) be a sequence of k indices in [n]. For a vector v ∈Rn, we denote the restriction of v to S by v|S ∈Rk; that is, (v|S)i = vxi for every i ∈[k]. For the matrix A ∈Rn×n, we denote the restriction of A to S by A|S ∈Rk×k; that is, (A|S)ij = Axixj for every i, j ∈[k]. 2.1 Dikernels Following [12], we call a (measurable) function f : [0, 1]2 →R a dikernel. A dikernel is a generalization of a graphon [11], which is symmetric and whose range is bounded in [0, 1]. We can regard a dikernel as a matrix whose index is specified by a real value in [0, 1]. We stress that the term dikernel has nothing to do with kernel methods. For two functions f, g : [0, 1] →R, we define their inner product as ⟨f, g⟩= R 1 0 f(x)g(x)dx. For a dikernel W : [0, 1]2 →R and a function f : [0, 1] →R, we define a function Wf : [0, 1] →R as (Wf)(x) = ⟨W(x, ·), f⟩. Let W : [0, 1]2 →R be a dikernel. The Lp norm ∥W∥p for p ≥1 and the cut norm ∥W∥□of W are defined as ∥W∥p = R 1 0 R 1 0 |W(x, y)|pdxdy 1/p and ∥W∥□= supS,T ⊆[0,1] R S R T W(x, y)dxdy , respectively, where the supremum is over all pairs of subsets. We note that these norms satisfy the triangle inequalities and ∥W∥□≤∥W∥1. Let λ be a Lebesgue measure. A map π : [0, 1] →[0, 1] is said to be measure-preserving, if the pre-image π−1(X) is measurable for every measurable set X, and λ(π−1(X)) = λ(X). A measure-preserving bijection is a measure-preserving map whose inverse map exists and is also measurable (and then also measure-preserving). For a measure preserving bijection π : [0, 1] → [0, 1] and a dikernel W : [0, 1]2 →R, we define the dikernel π(W) : [0, 1]2 →R as π(W)(x, y) = W(π(x), π(y)). 2.2 Matrices and Dikernels Let W : [0, 1]2 →R be a dikernel and S = (x1, . . . , xk) be a sequence of elements in [0, 1]. Then, we define the matrix W|S ∈Rk×k so that (W|S)ij = W(xi, xj). We can construct the dikernel bA : [0, 1]2 →R from the matrix A ∈Rn×n as follows. Let I1 = [0, 1 n], I2 = ( 1 n, 2 n], . . . , In = ( n−1 n , . . . , 1]. For x ∈[0, 1], we define in(x) ∈[n] as a unique integer such that x ∈Ii. Then, we define bA(x, y) = Ain(x)in(y). The main motivation for creating a dikernel from a matrix is that, by doing so, we can define the distance between two matrices A and B of different sizes via the cut norm, that is, ∥bA −bB∥□. We note that the distribution of A|S, where S is a sequence of k indices that are uniformly and independently sampled from [n] exactly matches the distribution of bA|S, where S is a sequence of k elements that are uniformly and independently sampled from [0, 1]. 3 Sampling Theorem and the Properties of the Cut Norm In this section, we prove the following theorem, which states that, given a sequence of dikernels W 1, . . . , W T : [0, 1]2 →[−L, L], we can obtain a good approximation to them by sampling a sequence of a small number of elements in [0, 1]. Formally, we prove the following: Theorem 3.1. Let W 1, . . . , W T : [0, 1]2 →[−L, L] be dikernels. Let S be a sequence of k elements uniformly and independently sampled from [0, 1]. Then, with a probability of at least 1 −exp(−Ω(kT/ log2 k)), there exists a measure-preserving bijection π : [0, 1] →[0, 1] such that, for any functions f, g : [0, 1] →[−K, K] and t ∈[T], we have |⟨f, W tg⟩−⟨f, π( [ W t|S)g⟩| = O  LK2p T/ log2 k  . We start with the following lemma, which states that, if a dikernel W : [0, 1]2 →R has a small cut norm, then ⟨f, Wf⟩is negligible no matter what f is. Hence, we can focus on the cut norm when proving Theorem 3.1. 3 Lemma 3.2. Let ϵ ≥0 and W : [0, 1]2 →R be a dikernel with ∥W∥□≤ϵ. Then, for any functions f, g : [0, 1] →[−K, K], we have |⟨f, Wg⟩| ≤ϵK2. Proof. For τ ∈R and the function h : [0, 1] →R, let Lτ(h) := {x ∈[0, 1] | h(x) = τ} be the level set of h at τ. For f ′ = f/K and g′ = g/K, we have |⟨f, Wg⟩| = K2|⟨f ′, Wg′⟩| = K2 Z 1 −1 Z 1 −1 τ1τ2 Z Lτ1(f ′) Z Lτ2(g′) W(x, y)dxdydτ1dτ2 ≤K2 Z 1 −1 Z 1 −1 |τ1||τ2| Z Lτ1(f ′) Z Lτ2(g′) W(x, y)dxdy dτ1dτ2 ≤ϵK2 Z 1 −1 Z 1 −1 |τ1||τ2|dτ1dτ2 = ϵK2. To introduce the next technical tool, we need several definitions. We say that the partition Q is a refinement of the partition P = (V1, . . . , Vp) if Q is obtained by splitting each set Vi into one or more parts. The partition P = (V1, . . . , Vp) of the interval [0, 1] is called an equipartition if λ(Vi) = 1/p for every i ∈[p]. For the dikernel W : [0, 1]2 →R and the equipartition P = (V1, . . . , Vp) of [0, 1], we define WP : [0, 1]2 →R as the function obtained by averaging each Vi × Vj for i, j ∈[p]. More formally, we define WP(x, y) = 1 λ(Vi)λ(Vj) Z Vi×Vj W(x′, y′)dx′dy′ = p2 Z Vi×Vj W(x′, y′)dx′dy′, where i and j are unique indices such that x ∈Vi and y ∈Vj, respectively. The following lemma states that any function W : [0, 1]2 →R can be well approximated by WP for the equipartition P into a small number of parts. Lemma 3.3 (Weak regularity lemma for functions on [0, 1]2 [8]). Let P be an equipartition of [0, 1] into k sets. Then, for any dikernel W : [0, 1]2 →R and ϵ > 0, there exists a refinement Q of P with |Q| ≤k2C/ϵ2 for some constant C > 0 such that ∥W −WQ∥□≤ϵ∥W∥2. Corollary 3.4. Let W 1, . . . , W T : [0, 1]2 →R be dikernels. Then, for any ϵ > 0, there exists an equipartition P into |P| ≤2CT/ϵ2 parts for some constant C > 0 such that, for every t ∈[T], ∥W t −W t P∥□≤ϵ∥W t∥2. Proof. Let P0 be a trivial partition, that is, a partition consisting of a single part [n]. Then, for each t ∈[T], we iteratively apply Lemma 3.3 with Pt−1, W t, and ϵ, and we obtain the partition Pt into at most |Pt−1|2C/ϵ2 parts such that ∥W t −W t Pt∥□≤ϵ∥W t∥2. Since Pt is a refinement of Pt−1, we have ∥W i −W i Pt∥□≤∥W i −W i Pt−1∥□for every i ∈[t −1]. Then, PT satisfies the desired property with |PT | ≤(2C/ϵ2)T = 2CT/ϵ2. As long as S is sufficiently large, W and d W|S are close in the cut norm: Lemma 3.5 ((4.15) of [4]). Let W : [0, 1]2 →[−L, L] be a dikernel and S be a sequence of k elements uniformly and independently sampled from [0, 1]. Then, we have −2L k ≤ES∥d W|S∥□−∥W∥□< 8L k1/4 . Finally, we need the following concentration inequality. Lemma 3.6 (Azuma’s inequality). Let (Ω, A, P) be a probability space, k be a positive integer, and C > 0. Let z = (z1, . . . , zk), where z1, . . . , zk are independent random variables, and zi takes values in some measure space (Ωi, Ai). Let f : Ω1 × · · · × Ωk →R be a function. Suppose that |f(x) −f(y)| ≤C whenever x and y only differ in one coordinate. Then Pr h |f(z) −Ez[f(z)]| > λC i < 2e−λ2/2k. 4 Now we prove the counterpart of Theorem 3.1 for the cut norm. Lemma 3.7. Let W 1, . . . , W T : [0, 1]2 →[−L, L] be dikernels. Let S be a sequence of k elements uniformly and independently sampled from [0, 1]. Then, with a probability of at least 1 −exp(−Ω(kT/ log2 k)), there exists a measure-preserving bijection π : [0, 1] →[0, 1] such that, for every t ∈[T], we have ∥W t −π( [ W t|S)∥□= O  L p T/ log2 k  . Proof. First, we bound the expectations and then prove their concentrations. We apply Corollary 3.4 to W 1, . . . , W T and ϵ, and let P = (V1, . . . , Vp) be the obtained partition with p ≤2CT/ϵ2 parts such that ∥W t −W t P∥□≤ϵL. for every t ∈[T]. By Lemma 3.5, for every t ∈[T], we have ES∥\ W t P|S −[ W t|S∥□= ES∥(W t P −W t)|S \ ∥□≤ϵL + 8L k1/4 . Then, for any measure-preserving bijection π : [0, 1] →[0, 1] and t ∈[T], we have ES∥W t −π( [ W t|S)∥□≤∥W t −W t P∥□+ ES∥W t P −π(\ W t P|S)∥□+ ES∥π(\ W t P|S) −π( [ W t|S)∥□ ≤2ϵL + 8L k1/4 + ES∥W t P −π(\ W t P|S)∥□. (2) Thus, we are left with the problem of sampling from P. Let S = {x1, . . . , xk} be a sequence of independent random variables that are uniformly distributed in [0, 1], and let Zi be the number of points xj that fall into the set Vi. It is easy to compute that E[Zi] = k p and Var[Zi] = 1 p −1 p2  k < k p. The partition P′ of [0, 1] is constructed into the sets V ′ 1, . . . , V ′ p such that λ(V ′ i ) = Zi/k and λ(Vi ∩ V ′ i ) = min(1/p, Zi/k). For each t ∈[T], we construct the dikernel W t : [0, 1] →R such that the value of W t on V ′ i × V ′ j is the same as the value of W t P on Vi × Vj. Then, W t agrees with W t P on the set Q = S i,j∈[p](Vi∩V ′ i )×(Vj ∩V ′ j ). Then, there exists a bijection π such that π(\ W t P|S) = W t for each t ∈[T]. Then, for every t ∈[T], we have ∥W t P −π(\ W t P|S)∥□= ∥W t P −W t∥□≤∥W t P −W t∥1 ≤2L(1 −λ(Q)) = 2L  1 − X i∈[p] min 1 p, Zi k 2 ≤4L  1 − X i∈[p] min 1 p, Zi k  = 2L X i∈[p] 1 p −Zi k ≤2L  p X i∈[p] 1 p −Zi k 21/2 , which we rewrite as ∥W t P −π(\ W t P|S)∥2 □≤4L2p X i∈[p] 1 p −Zi k 2 . The expectation of the right hand side is (4L2p/k2) P i∈[p] Var(Zi) < 4L2p/k. By the CauchySchwartz inequality, E∥W t P −π(\ W t P|S)∥□≤2L p p/k. Inserted this into (2), we obtain E∥W t −π( [ W t|S)∥□≤2ϵL + 8L k1/4 + 2L rp k ≤2ϵL + 8L k1/4 + 2L k1/2 2CT/ϵ2. Choosing ϵ = p CT/(log2 k1/4) = p 4CT/(log2 k), we obtain the upper bound E∥W t −π( [ W t|S)∥□≤2L s 4CT log2 k + 8L k1/4 + 2L k1/4 = O  L s T log2 k  . 5 Observing that ∥W t −π( [ W t|S)∥□changes by at most O(L/k) if one element in S changes, we apply Azuma’s inequality with λ = k p T/ log2 k and the union bound to complete the proof. The proof of Theorem 3.1 is immediately follows from Lemmas 3.2 and 3.7. 4 Analysis of Algorithm 1 In this section, we analyze Algorithm 1. Because we want to use dikernels for the analysis, we introduce a continuous version of pn,A,d,b (recall (1)). The real-valued function Pn,A,d,b on the functions f : [0, 1] →R is defined as Pn,A,d,b(f) = ⟨f, bAf⟩+ ⟨f 2, d d1⊤1⟩+ ⟨f, d b1⊤1⟩, where f 2 : [0, 1] →R is a function such that f 2(x) = f(x)2 for every x ∈[0, 1] and 1 : [0, 1] →R is the constant function that has a value of 1 everywhere. The following lemma states that the minimizations of pn,A,d,b and Pn,A,d,b are equivalent: Lemma 4.1. Let A ∈Rn×n be a matrix and d, b ∈Rn×n be vectors. Then, we have min v∈[−K,K]n pn,A,d,b(v) = n2 · inf f:[0,1]→[−K,K] Pn,A,d,b(f). for any K > 0. Proof. First, we show that n2 · inff:[0,1]→[−K,K] Pn,A,d,b(f) ≤minv∈[−K,K]n pn,A,d,b(v). Given a vector v ∈[−K, K]n, we define f : [0, 1] →[−K, K] as f(x) = vin(x). Then, ⟨f, bAf⟩= X i,j∈[n] Z Ii Z Ij Aijf(x)f(y)dxdy = 1 n2 X i,j∈[n] Aijvivj = 1 n2 ⟨v, Av⟩, ⟨f 2, d d1⊤1⟩= X i,j∈[n] Z Ii Z Ij dif(x)2dxdy = X i∈[n] Z Ii dif(x)2dx = 1 n X i∈[n] div2 i = 1 n⟨v, diag(d)v⟩, ⟨f, d b1⊤1⟩= X i,j∈[n] Z Ii Z Ij bif(x)dxdy = X i∈[n] Z Ii bif(x)dx = 1 n X i∈[n] bivi = 1 n⟨v, b⟩. Then, we have n2Pn,A,d,b(f) ≤pn,A,d,b(v). Next, we show that minv∈[−K,K]n pn,A,d,b(v) ≤n2 · inff:[0,1]→[−K,K] Pn,A,d,b(f). Let f : [0, 1] →[−K, K] be a measurable function. Then, for x ∈[0, 1], we have ∂Pn,A,d,b(f(x)) ∂f(x) = X i∈[n] Z Ii Aiin(x)f(y)dy + X j∈[n] Z Ij Ain(x)jf(y)dy + 2din(x)f(x) + bin(x). Note that the form of this partial derivative only depends on in(x); hence, in the optimal solution f ∗: [0, 1] →[−K, K], we can assume f ∗(x) = f ∗(y) if in(x) = in(y). In other words, f ∗ is constant on each of the intervals I1, . . . , In. For such f ∗, we define the vector v ∈Rn as vi = f ∗(x), where x ∈[0, 1] is any element in Ii. Then, we have ⟨v, Av⟩= X i,j∈[n] Aijvivj = n2 X i,j∈[n] Z Ii Z Ij Aijf ∗(x)f ∗(y)dxdy = n2⟨f ∗, bAf ∗⟩, ⟨v, diag(d)v⟩= X i∈[n] div2 i = n X i∈[n] Z Ii dif ∗(x)2dx = n⟨(f ∗)2, d d1T 1⟩, ⟨v, b⟩= X i∈[n] bivi = n X i∈[n] Z Ii bif ∗(x)dx = n⟨f ∗, d b1T 1⟩. Finally, we have pn,A,d,b(v) ≤n2Pn,A,d,b(f ∗). Now we show that Algorithm 1 well-approximates the optimal value of (1) in the following sense: 6 Theorem 4.2. Let v∗and z∗be an optimal solution and the optimal value, respectively, of problem (1). By choosing k(ϵ, δ) = 2Θ(1/ϵ2) + Θ(log 1 δ log log 1 δ ), with a probability of at least 1 −δ, a sequence S of k indices independently and uniformly sampled from [n] satisfies the following: Let ˜v∗and ˜z∗be an optimal solution and the optimal value, respectively, of the problem minv∈Rk pk,A|S,d|S,b|S(v). Then, we have n2 k2 ˜z∗−z∗ ≤ϵLK2n2, where K = max{maxi∈[n] |v∗ i |, maxi∈[n] |˜v∗ i |} and L = max{maxi,j |Aij|, maxi |di|, maxi |bi|}. Proof. We instantiate Theorem 3.1 with k = 2Θ(1/ϵ2) + Θ(log 1 δ log log 1 δ ) and the dikernels bA, d d1⊤, and d b1⊤. Then, with a probability of at least 1 −δ, there exists a measure preserving bijection π : [0, 1] →[0, 1] such that max n |⟨f, ( bA −π(d A|S))f⟩|, |⟨f 2, ( d d1⊤−π( \ d1⊤|S))1⟩|, |⟨f, ( d b1⊤−π(\ b1⊤|S))1⟩| o ≤ϵLK2 3 for any function f : [0, 1] →[−K, K]. Then, we have ˜z∗= min v∈Rk pk,A|S,d|S,b|S(v) = min v∈[−K,K]k pk,A|S,d|S,b|S(v) = k2 · inf f:[0,1]→[−K,K] Pk,A|S,d|S,b|S(f) (By Lemma 4.1) = k2 · inf f:[0,1]→[−K,K]  ⟨f, (π(d A|S) −bA)f⟩+ ⟨f, bAf⟩+ ⟨f 2, (π( \ d1⊤|S) −d d1⊤)1⟩+ ⟨f 2, d d1⊤1⟩+ ⟨f, (π(\ b1⊤|S) −d b1⊤)1⟩+ ⟨f, d b1⊤1⟩  ≤k2 · inf f:[0,1]→[−K,K]  ⟨f, bAf⟩+ ⟨f 2, d d1⊤1⟩+ ⟨f, d b1⊤1⟩± ϵLK2 = k2 n2 · min v∈[−K,K]n pn,A,d,b(v) ± ϵLK2k2. (By Lemma 4.1) = k2 n2 · min v∈Rn pn,A,d,b(v) ± ϵLK2k2 = k2 n2 z∗± ϵLK2k2. Rearranging the inequality, we obtain the desired result. We can show that K is bounded when A is symmetric and full rank. To see this, we first note that we can assume A + ndiag(d) is positive-definite, as otherwise pn,A,d,b is not bounded and the problem is uninteresting. Then, for any set S ⊆[n] of k indices, (A + ndiag(d))|S is again positive-definite because it is a principal submatrix. Hence, we have v∗= (A + ndiag(d))−1nb/2 and ˜v∗= (A|S + ndiag(d|S))−1nb|S/2, which means that K is bounded. 5 Experiments In this section, we demonstrate the effectiveness of our method by experiment.1 All experiments were conducted on an Amazon EC2 c3.8xlarge instance. Error bars indicate the standard deviations over ten trials with different random seeds. Numerical simulation We investigated the actual relationships between n, k, and ϵ. To this end, we prepared synthetic data as follows. We randomly generated inputs as Aij ∼U[−1,1], di ∼U[0,1], and bi ∼U[−1,1] for i, j ∈[n], where U[a,b] denotes the uniform distribution with the support [a, b]. After that, we solved (1) by using Algorithm 1 and compared it with the exact solution obtained by QP.2 The result (Figure 1) show the approximation errors were evenly controlled regardless of n, which meets the error analysis (Theorem 4.2). 1The program codes are available at https://github.com/hayasick/CTOQ. 2We used GLPK (https://www.gnu.org/software/glpk/) for the QP solver. 7 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● 0.00 0.05 0.10 0.00 0.05 0.10 0.00 0.05 0.10 0.00 0.05 0.10 n=200 500 1000 2000 10 20 40 80 160 k |z −z∗| n2 Figure 1: Numerical simulation: absolute approximation error scaled by n2. Table 1: Pearson divergence: runtime (second). k n = 500 1000 2000 5000 Proposed 20 0.002 0.002 0.002 0.002 40 0.003 0.003 0.003 0.003 80 0.007 0.007 0.008 0.008 160 0.030 0.030 0.033 0.035 Nystr¨om 20 0.005 0.012 0.046 0.274 40 0.010 0.022 0.087 0.513 80 0.022 0.049 0.188 0.942 160 0.076 0.116 0.432 1.972 Table 2: Pearson divergence: absolute approximation error. k n = 500 1000 2000 5000 Proposed 20 0.0027 ± 0.0028 0.0012 ± 0.0012 0.0021 ± 0.0019 0.0016 ± 0.0022 40 0.0018 ± 0.0023 0.0006 ± 0.0007 0.0012 ± 0.0011 0.0011 ± 0.0020 80 0.0007 ± 0.0008 0.0004 ± 0.0003 0.0008 ± 0.0008 0.0007 ± 0.0017 160 0.0003 ± 0.0003 0.0002 ± 0.0001 0.0003 ± 0.0003 0.0002 ± 0.0003 Nystr¨om 20 0.3685 ± 0.9142 1.3006 ± 2.4504 3.1119 ± 6.1464 0.6989 ± 0.9644 40 0.3549 ± 0.6191 0.4207 ± 0.7018 0.9838 ± 1.5422 0.3744 ± 0.6655 80 0.0184 ± 0.0192 0.0398 ± 0.0472 0.2056 ± 0.2725 0.5705 ± 0.7918 160 0.0143 ± 0.0209 0.0348 ± 0.0541 0.0585 ± 0.1112 0.0254 ± 0.0285 Application to kernel methods Next, we considered the kernel approximation of the Pearson divergence [21]. The problem is defined as follows. Suppose we have the two different data sets x = (x1, . . . , xn) ∈Rn and x′ = (x′ 1, . . . , x′ n′) ∈Rn′ where n, n′ ∈N. Let H ∈Rn×n be a gram matrix such that Hl,m = α n Pn i=1 φ(xi, xl)φ(xi, xm) + 1−α n′ Pn′ j=1 φ(x′ j, xl)φ(x′ j, xm), where φ(·, ·) is a kernel function and α ∈(0, 1) is a parameter. Also, let h ∈Rn be a vector such that hl = 1 n Pn i=1 φ(xi, xl). Then, an estimator of the α-relative Pearson divergence between the distributions of x and x′ is obtained by −1 2 −minv∈Rn 1 2⟨v, Hv⟩−⟨h, v⟩+ λ 2 ⟨v, v⟩. Here, λ > 0 is a regularization parameter. In this experiment, we used the Gaussian kernel φ(x, y) = exp((x −y)2/2σ2) and set n′ = 200 and α = 0.5; σ2 and λ were chosen by 5-fold cross-validation as suggested in [21]. We randomly generated the data sets as xi ∼N(1, 0.5) for i ∈[n] and x′ j ∼N(1.5, 0.5) for j ∈[n′] where N(µ, σ2) denotes the Gaussian distribution with mean µ and variance σ2. We encoded this problem into (1) by setting A = 1 2H, b = −h, and d = λ 2n1n, where 1n denotes the n-dimensional vector whose elements are all one. After that, given k, we computed the second step of Algorithm 1 with the pseudoinverse of A|S+kdiag(d|S). Absolute approximation errors and runtimes were compared with Nystr¨om’s method whose approximated rank was set to k. In terms of accuracy, our method clearly outperformed Nystr¨om’s method (Table 2). In addition, the runtimes of our method were nearly constant, whereas the runtimes of Nystr¨om’s method grew linearly in k (Table 1). 6 Acknowledgments We would like to thank Makoto Yamada for suggesting a motivating problem of our method. K. H. is supported by MEXT KAKENHI 15K16055. Y. Y. is supported by MEXT Grant-in-Aid for Scientific Research on Innovative Areas (No. 24106001), JST, CREST, Foundations of Innovative Algorithms for Big Data, and JST, ERATO, Kawarabayashi Large Graph Project. 8 References [1] N. Alon, W. F. de la Vega, R. Kannan, and M. Karpinski. Random sampling and approximation of MAXCSP problems. In STOC, pages 232–239, 2002. [2] N. Alon, E. Fischer, I. Newman, and A. Shapira. A combinatorial characterization of the testable graph properties: It’s all about regularity. SIAM Journal on Computing, 39(1):143–167, 2009. [3] C. Borgs, J. Chayes, L. Lov´asz, V. T. S´os, B. Szegedy, and K. Vesztergombi. Graph limits and parameter testing. In STOC, pages 261–270, 2006. [4] C. Borgs, J. T. Chayes, L. Lov´asz, V. T. S´os, and K. Vesztergombi. Convergent sequences of dense graphs i: Subgraph frequencies, metric properties and testing. Advances in Mathematics, 219(6):1801–1851, 2008. [5] L. Bottou. Stochastic learning. In Advanced Lectures on Machine Learning, pages 146–168. 2004. [6] V. Brattka and P. Hertling. Feasible real random access machines. Journal of Complexity, 14(4):490–526, 1998. [7] K. L. Clarkson, E. Hazan, and D. P. Woodruff. Sublinear optimization for machine learning. Journal of the ACM, 59(5):23:1–23:49, 2012. [8] A. Frieze and R. Kannan. The regularity lemma and approximation schemes for dense problems. In FOCS, pages 12–20, 1996. [9] O. Goldreich, S. Goldwasser, and D. Ron. Property testing and its connection to learning and approximation. Journal of the ACM, 45(4):653–750, 1998. [10] L. Lov´asz. Large Networks and Graph Limits. American Mathematical Society, 2012. [11] L. Lov´asz and B. Szegedy. Limits of dense graph sequences. Journal of Combinatorial Theory, Series B, 96(6):933–957, 2006. [12] L. Lov´asz and K. Vesztergombi. Non-deterministic graph property testing. Combinatorics, Probability and Computing, 22(05):749–762, 2013. [13] C. Mathieu and W. Schudy. Yet another algorithm for dense max cut: go greedy. In SODA, pages 176–182, 2008. [14] K. P. Murphy. Machine learning: a probabilistic perspective. The MIT Press, 2012. [15] H. N. Nguyen and K. Onak. Constant-time approximation algorithms via local improvements. In FOCS, pages 327–336, 2008. [16] K. Onak, D. Ron, M. Rosen, and R. Rubinfeld. A near-optimal sublinear-time algorithm for approximating the minimum vertex cover size. In SODA, pages 1123–1131, 2012. [17] R. Rubinfeld and M. Sudan. Robust characterizations of polynomials with applications to program testing. SIAM Journal on Computing, 25(2):252–271, 1996. [18] M. Sugiyama, T. Suzuki, and T. Kanamori. Density Ratio Estimation in Machine Learning. Cambridge University Press, 2012. [19] T. Suzuki and M. Sugiyama. Least-Squares Independent Component Analysis. Neural Computation, 23(1):284–301, 2011. [20] C. K. I. Williams and M. Seeger. Using the nystr¨om method to speed up kernel machines. In NIPS, 2001. [21] M. Yamada, T. Suzuki, T. Kanamori, H. Hachiya, and M. Sugiyama. Relative density-ratio estimation for robust distribution comparison. In NIPS, 2011. [22] Y. Yoshida. Optimal constant-time approximation algorithms and (unconditional) inapproximability results for every bounded-degree CSP. In STOC, pages 665–674, 2011. [23] Y. Yoshida. A characterization of locally testable affine-invariant properties via decomposition theorems. In STOC, pages 154–163, 2014. [24] Y. Yoshida. Gowers norm, function limits, and parameter estimation. In SODA, pages 1391–1406, 2016. [25] Y. Yoshida, M. Yamamoto, and H. Ito. Improved constant-time approximation algorithms for maximum matchings and other optimization problems. SIAM Journal on Computing, 41(4):1074–1093, 2012. 9
2016
569
6,515
Professor Forcing: A New Algorithm for Training Recurrent Networks Anirudh Goyal∗, Alex Lamb∗, Ying Zhang, Saizheng Zhang, Aaron Courville and Yoshua Bengio1 MILA, Université de Montréal, 1CIFAR {anirudhgoyal9119, alex6200, ying.zhlisa, saizhenglisa, aaron.courville, yoshua.umontreal}@gmail.com Abstract The Teacher Forcing algorithm trains recurrent networks by supplying observed sequence values as inputs during training and using the network’s own one-stepahead predictions to do multi-step sampling. We introduce the Professor Forcing algorithm, which uses adversarial domain adaptation to encourage the dynamics of the recurrent network to be the same when training the network and when sampling from the network over multiple time steps. We apply Professor Forcing to language modeling, vocal synthesis on raw waveforms, handwriting generation, and image generation. Empirically we find that Professor Forcing acts as a regularizer, improving test likelihood on character level Penn Treebank and sequential MNIST. We also find that the model qualitatively improves samples, especially when sampling for a large number of time steps. This is supported by human evaluation of sample quality. Trade-offs between Professor Forcing and Scheduled Sampling are discussed. We produce T-SNEs showing that Professor Forcing successfully makes the dynamics of the network during training and sampling more similar. 1 Introduction Recurrent neural networks (RNNs) have become to be the generative models of choice for sequential data (Graves, 2012) with impressive results in language modeling (Mikolov, 2010; Mikolov and Zweig, 2012), speech recognition (Bahdanau et al., 2015; Chorowski et al., 2015), Machine Translation (Cho et al., 2014a; Sutskever et al., 2014; Bahdanau et al., 2014), handwriting generation (Graves, 2013), image caption generation (Xu et al., 2015; Chen and Lawrence Zitnick, 2015), etc. The RNN models the data via a fully-observed directed graphical model: it decomposes the distribution over the discrete time sequence y1, y2, . . . yT into an ordered product of conditional distributions over tokens P(y1, y2, . . . yT ) = P(y1) T Y t=1 P(yt | y1, . . . yt−1). By far the most popular training strategy is via the maximum likelihood principle. In the RNN literature, this form of training is also known as teacher forcing (Williams and Zipser, 1989), due to the use of the ground-truth samples yt being fed back into the model to be conditioned on for the prediction of later outputs. These fed back samples force the RNN to stay close to the ground-truth sequence. When using the RNN for prediction, the ground-truth sequence is not available conditioning and we sample from the joint distribution over the sequence by sampling each yt from its conditional ∗Indicates first authors. Ordering determined by coin flip. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. distribution given the previously generated samples. Unfortunately, this procedure can result in problems in generation as small prediction error compound in the conditioning context. This can lead to poor prediction performance as the RNN’s conditioning context (the sequence of previously generated samples) diverge from sequences seen during training. Recently, (Bengio et al., 2015) proposed to remedy that issue by mixing two kinds of inputs during training: those from the ground-truth training sequence and those generated from the model. However, when the model generates several consecutive yt’s, it is not clear anymore that the correct target (in terms of its distribution) remains the one in the ground truth sequence. This is mitigated in various ways, by making the self-generated subsequences short and annealing the probability of using self-generated vs ground truth samples. However, as remarked by Huszár (2015), scheduled sampling yields a biased estimator, in that even as the number of examples and the capacity go to infinity, this procedure may not converge to the correct model. It is however good to note that experiments with scheduled sampling clearly showed some improvements in terms of the robustness of the generated sequences, suggesting that something indeed needs to be fixed (or replaced) with maximum-likelihood (or teacher forcing) training of generative RNNs. In this paper, we propose an alternative way of training RNNs which explicitly seeks to make the generative behavior and the teacher-forced behavior match as closely as possible. This is particularly important to allow the RNN to continue generating robustly well beyond the length of the sequences it saw during training. More generally, we argue that this approach helps to better model long-term dependencies by using a training objective that is not solely focused on predicting the next observation, one step at a time. Our work provides the following contributions regarding this new training framework: • We introduce a novel method for training generative RNNs called Professor Forcing, meant to improve long-term sequence sampling from recurrent networks. We demonstrate this with human evaluation of sample quality by performing a study with human evaluators. • We find that Professor Forcing can act as a regularizer for recurrent networks. This is demonstrated by achieving improvements in test likelihood on character-level Penn Treebank, Sequential MNIST Generation, and speech synthesis. Interestingly, we also find that training performance can also be improved, and we conjecture that it is because longer-term dependencies can be more easily captured. • When running an RNN in sampling mode, the region occupied by the hidden states of the network diverges from the region occupied when doing teacher forcing. We empirically study this phenomenon using T-SNEs and show that it can be mitigated by using Professor Forcing. • In some domains the sequences available at training time are shorter than the sequences that we want to generate at test time. This is usually the case in long-term forecasting tasks (climate modeling, econometrics). We show how using Professor Forcing can be used to improve performance in this setting. Note that scheduled sampling cannot be used for this task, because it still uses the observed sequence as targets for the network. 2 Proposed Approach: Professor Forcing The basic idea of Professor Forcing is simple: while we do want the generative RNN to match the training data, we also want the behavior of the network (both in its outputs and in the dynamics of its hidden states) to be indistinguishable whether the network is trained with its inputs clamped to a training sequence (teacher forcing mode) or whether its inputs are self-generated (free-running generative mode). Because we can only compare the distribution of these sequences, it makes sense to take advantage of the generative adversarial networks (GANs) framework (Goodfellow et al., 2014) to achieve that second objective of matching the two distributions over sequences (the one observed in teacher forcing mode vs the one observed in free-running mode). Hence, in addition to the generative RNN, we will train a second model, which we call the discriminator, and that can also process variable length inputs. In the experiments we use a bidirectional RNN architecture for the discriminator, so that it can combine evidence at each time step t from the past of the behavior sequence as well as from the future of that sequence. 2 2.1 Definitions and Notation Let the training distribution provide (x, y) pairs of input and output sequences (possibly there are no inputs at all). An output sequence y can also be generated by the generator RNN when given an input sequence x, according to the sequence to sequence model distribution Pθg(y|x). Let θg be the parameters of the generative RNN and θd be the parameters of the discriminator. The discriminator is trained as a probabilistic classifier that takes as input a behavior sequence b derived from the generative RNN’s activity (hiddens and outputs) when it either generates or is constrained by a sequence y, possibly in the context of an input sequence x (often but not necessarily of the same length). The behavior sequence b is either the result of running the generative RNN in teacher forcing mode (with y from a training sequence with input x), or in free-running mode (with y self-generated according to Pθg(y|x), with x from the training sequence). The function B(x, y, θg) outputs the behavior sequence (chosen hidden states and output values) given the appropriate data (where x always comes from the training data but y either comes from the data or is self-generated). Let D(b) be the output of the discriminator, estimating the probability that b was produced in teacher-forcing mode, given that half of the examples seen by the discriminator are generated in teacher forcing mode and half are generated in the free-running mode. Note that in the case where the generator RNN does not have any conditioning input, the sequence x is empty. Note also that the generated output sequences could have a different length then the conditioning sequence, depending of the task at hand. 2.2 Training Objective The discriminator parameters θd are trained as one would expect, i.e., to maximize the likelihood of correctly classifying a behavior sequence: Cd(θd|θg) = E(x,y)∼data[−log D(B(x, y, θg), θd)+Ey∼Pθg (y|x)[−log(1−D(B(x, y, θg), θd)]]. (1) Practically, this is achieved with a variant of stochastic gradient descent with minibatches formed by combining N sequences obtained in teacher-forcing mode and N sequences obtained in free-running mode, with y sampled from Pθg(y|x). Note also that as θg changes, the task optimized by the discriminator changes too, and it has to track the generator, as in other GAN setups, hence the notation Cd(θd|θg). The generator RNN parameters θg are trained to (a) maximize the likelihood of the data and (b) fool the discriminator. We considered two variants of the latter. The negative log-likelihood objective (a) is the usual teacher-forced training criterion for RNNs: NLL(θg) = E(x,y)∼data[−log Pθg(y|x)]. (2) Regarding (b) we consider a training objective that only tries to change the free-running behavior so that it better matches the teacher-forced behavior, considering the latter fixed: Cf(θg|θd) = Ex∼data,y∼Pθg (y|x)[−log D(B(x, y, θg), θd)]. (3) In addition (and optionally), we can ask the teacher-forced behavior to be indistinguishable from the free-running behavior: Ct(θg|θd) = E(x,y)∼data[−log(1 −D(B(x, y, θg), θd))]. (4) In our experiments we either perform stochastic gradient steps on NLL + Cf or on NLL + Cf + Ct to update the generative RNN parameters, while we always do gradient steps on Cd to update the discriminator parameters. 3 Related Work Professor Forcing is an adversarial method for learning generative models that is closely related to Generative Adversarial Networks (Goodfellow et al., 2014) and Adversarial Domain Adaptation Ajakan et al. (2014); Ganin et al. (2015). Our approach is similar to generative adversarial networks (GANs) because both use a discriminative classifier to provide gradients for training a generative model. However, Professor Forcing is different because the classifier discriminates between hidden 3 ... ... Discriminator Teacher Forcing Free Running Distributions of hidden states are forced to be close to each other by Discriminator Share parameters Figure 1: Architecture of the Professor Forcing - Learn correct one-step predictions such as to to obtain the same kind of recurrent neural network dynamics whether in open loop (teacher forcing) mode or in closed loop (generative) mode. An open loop generator that does one-step-ahead prediction correctly. Recursively composing these outputs does multi-step prediction (closed-loop) and can generate new sequences. This is achieved by train a classifier to distinguish open loop (teacher forcing) vs. closed loop (free running) dynamics, as a function of the sequence of hidden states and outputs. Optimize the closed loop generator to fool the classifier. Optimize the open loop generator with teacher forcing. The closed loop and open loop generators share all parameters states from sampling mode and teacher forcing mode, whereas the GAN’s classifier discriminates between real samples and generated samples. One practical advantage of Professor Forcing over GANs is that Professor Forcing can be used to learn a generative model over discrete random variables without requiring to approximate backpropagation through discrete spaces Bengio et al. (2013). The Adversarial Domain Adaptation uses a classifier to discriminate between the hidden states of the network with inputs from the source domain and the hidden states of the network with inputs from the target domain. However this method was not applied in the context of generative models, more specifically, was not applied to the task of improving long-term generation from recurrent networks. Alternative non-adversarial methods have been explored for improving long-term generation from recurrent networks. The scheduled sampling method Bengio et al. (2015), which is closely related to SEARN (Daumé et al., 2009) and DAGGER Ross et al. (2010), involves randomly using the network’s predictions as its inputs (as in sampling mode) with some probability that increases over the course of training. This forces the network to be able to stay in a reasonable regime when receiving the network’s predictions as inputs instead of observed inputs. While Scheduled Sampling shows improvement on some tasks, it is not a consistent estimation strategy. This limitation arises because the outputs sampled from the network could correspond to a distribution that is not consistent with the sequence that the network is trained to generate. This issue is discussed in detail in Huszár (2015). A practical advantage of Scheduled Sampling over Professor Forcing is that Scheduled Sampling does not require the additional overhead of having to train a discriminator network. Finally, the idea of matching the behavior of the model when it is generating in a free-running way with its behavior when it is constrained by the observed data (being clamped on the "visible units") is precisely that which one obtains when zeroing the maximum likelihood gradient on undirected graphical models with latent variables such as the Boltzmann machine. Training Boltzmann machines amounts to matching the sufficient statistics (which summarize the behavior of the model) in both "teacher forced" (positive phase) and "free-running" (negative phase) modes. 4 Experiments 4.1 Networks Architecture and Professor Forcing Setup The neural networks and Professor Forcing setup used in the experiments is the following. The generative RNN has single hidden layer of gated recurrent units (GRU), previously introduced by (Cho et al., 2014b) as a computationally cheaper alternative to LSTM units (Hochreiter and Schmidhuber, 1997). At each time step, the generative RNN reads an element xt of the input 4 sequence (if any) and an element of the output sequence yt (which either comes from the training data or was generated at the previous step by the RNN). It then updates its state ht as a function of its previous state ht−1 and of the current input (xt, yt). It then computes a probability distribution Pθg(yt+1|ht) = Pθg(yt+1|x1, . . . , xt, y1, . . . , yt) over the next element of the output. For discrete outputs this is achieved by a softmax / affine layer on top of ht, with as many outputs as the size of the set of values that yt can take. In free-running mode, yt+1 is then sampled from this distribution and will be used as part of the input for the next time step. Otherwise, the ground truth yt is used. The behavior function B used in the experiments outputs the pre-tanh activation of the GRU states for the whole sequence considered, and optionally the softmax outputs for the next-step prediction, again for the whole sequence. The discriminator architecture we used for these experiments is based on a bidirectional recurrent neural network, which comprises two RNNs (again, two GRU networks), one running forward in time on top of the input sequence b, and one running backwards in time, with the same input. The hidden states of these two RNNs are concatenated at each time step and fed to a multi-layer neural network shared across time (the same network is used for all time steps). That MLP has three layers, each composing an affine transformation and a rectifier (ReLU). Finally, the output layer composes an affine transformation and a sigmoid that outputs D(b). When the discriminator is too poor, the gradient it propagates into the generator RNN could be detrimental. For this reason, we back-propagate from the discriminator into the generator RNN only when the discriminator classification accuracy is greater than 75%. On the other hand, when the discriminator is too successful at identifying fake inputs, we found that it would also hurt to continue training it. So when its accuracy is greater than 99%, we do not update the discriminator. Both networks are trained by minibatch stochastic gradient descent with adaptive learning rates and momentum determined by the Adam algorithm (Kingma and Ba, 2014). All of our experiments were implemented using the Theano framework (Al-Rfou et al., 2016). 4.2 Character-Level Language Modeling We evaluate Professor Forcing on character-level language modeling on Penn-Treebank corpus, which has an alphabet size of 50 and consists of 5059k characters for training, 396k characters for validation and 446k characters for test. We divide the training set into non-overlapping sequences with each length of 500. During training, we monitor the negative log-likelihood (NLL) of the output sequences. The final model are evaluated by bits-per-character (BPC) metric. The generative RNN Figure 2: Penn Treebank Likelihood Curves in terms of the number of iterations. Training Negative Log-Likelihood (left). Validation BPC (Right) implements an 1 hidden layer GRU with 1024 hidden units. We use Adam algorithm for optimization with a learning rate of 0.0001. We feed both the hidden states and char level embeddings into the discriminator. All the layers in the discriminator consists of 2048 hidden units. Output activation of the last layer is clipped between -10 and 10. We see that training cost of Professor Forcing network decreases faster compared to teacher forcing network. The training time of our model is 3 times more as compared to teacher forcing, since our model includes sampling phase, as well as passing the hidden distributions corresponding to free running and teacher forcing phase to the discriminator. The final BPC on validation set using our baseline was 1.50 while using professor forcing it is 1.48. On word level Penn Treebank we did not observe any difference between Teacher Forcing and Professor Forcing. One possible explanation for this difference is the increased importance of long-term dependencies in character-level language modeling. 5 Figure 3: T-SNE visualization of hidden states, left: with teacher forcing, right: with professor forcing. Red dots correspond to teacher forcing hidden states, while the gold dots correspond to free running mode. At t = 500, the closed-loop and open-loop hidden states clearly occupy distinct regions with teacher forcing, meaning that the network enters a region during sampling distinct from the region seen during teacher forcing training. With professor forcing, these regions now largely overlap. We computed 30 T-SNEs for Teacher Forcing and 30 T-SNEs for Professor Forcing and found that the mean centroid distance was reduced from 3000 to 1800 (40% relative reduction). The mean distance from a hidden state in the training network to a hidden state in the sampling network was reduced from 22.8 with Teacher Forcing to 16.4 with Professor Forcing (vocal synthesis). Method MNIST NLL DBN 2hl (Germain et al., 2015) ≈84.55 NADE (Larochelle and Murray, 2011) 88.33 EoNADE-5 2hl (Raiko et al., 2014) 84.68 DLGM 8 leapfrog steps (Salimans et al., 2014) ≈85.51 DARN 1hl (Gregor et al., 2015) ≈84.13 DRAW (Gregor et al., 2015) ≤80.97 Pixel RNN (van den Oord et al., 2016) 79.2 Professor Forcing (ours) 79.58 Table 1: Test set negative log-likelihood evaluations on Sequential MNIST. 4.3 Sequential MNIST We evaluated Professor Forcing on the task of sequentially generating the pixels in MNIST digits. We use the standard binarized MNIST dataset Murray and Salakhutdinov (2009). We selected hyperparameters for our model on the validation set and elected to use 512 hidden states and a learning rate of 0.0001. For all experiments we used a 3-layer GRU as our generator. Unlike our other experiments, we used a convolutional network for the discriminator instead of a bi-directional RNN, as the pixels have a 2D spatial structure. In Table 1, We note that our model achieves the second best reported likelihood on this task, after the PixelRNN, which used a significantly more complicated architecture for its generator van den Oord et al. (2016). Combining Professor Forcing with the PixelRNN would be an interesting area for future research. However, the PixelRNN parallelizes computation in the teacher forcing network in a way that doesn’t work in the sampling network. Because Professor Forcing requires running the sampling network during training, naively combining Professor Forcing with the PixelRNN would be very slow. Figure 4: Samples with Teacher Forcing (left) and Professor Forcing (right) on Sequential MNIST. 6 Response Percent Count Professor Forcing Much Better 19.7 151 Professor Forcing Slightly Better 57.2 439 Teacher Forcing Slightly Better 18.9 145 Teacher Forcing Much Better 4.3 33 Total 100.0 768 Table 2: Human Evaluation Study Results for Handwriting Generation. 4.4 Handwriting Generation With this task we wanted to investigate if Professor Forcing could be used to perform domain adaptation from a training set with short sequences to sampling much longer sequences. We train the Teacher Forcing model on only 50 steps of text-conditioned handwriting (corresponding to a few letters) and then sample for 1000 time steps . We let the model learn a sequence of (x, y) coordinates together with binary indicators of pen-up vs. pen-down, using the standard handwriting IAM-OnDB dataset, which consists of 13,040 handwritten lines written by 500 writers Liwicki and Bunke (2005). For our teacher forcing model, we use the open source implementation Brebisson (2016) and use their hyperparameters which is based on the model in Graves (2013). For the professor forcing model, we sample for 1000 time steps and run a separate discriminator on non-overlapping segments of length 50 (the number of steps used in the teacher forcing model). We performed a human evaluation study on handwriting samples. We gave 48 volunteers 16 randomly selected Prof. Forcing samples randomly paired with 16 Teacher Forcing samples and asked them to indicate which sample was higher quality and whether it was “much better” or “slightly better”. Both models had equal training time and samples were drawn using the same procedure. Volunteers were not aware of which samples came from which model, see Table 2 for results. 4.5 Music Synthesis on Raw Waveforms We considered the task of vocal synthesis on raw waveforms. For this task we used three hours of monk chanting audio scraped from YouTube (https://www.youtube.com/watch?v=9-pD28iSiTU). We sampled the audio at a rate of 1 kHz and took four seconds for each training and validation example. On each time step of the raw audio waveform we binned the signal’s value into 8000 bins with boundaries drawn uniformly between the smallest and largest signal values in the dataset. We then model the raw audio waveform as a 4000-length sequence with 8000 potential values on each time step. Figure 6: Music Synthesis. Left: training likelihood curves. Right: validation likelihood curves. We evaluated the quality of our vocal synthesis model using two criteria. First, we demonstrated a regularizing effect and improvement in negative log-likelihood. Second, we observed improvement in the quality of samples. We included a few randomly selected samples in the supplementary material and also performed human evaluation of the samples. Visual inspection of samples is known to be a flawed method for evaluating generative models, because a generative model could simply memorize a small number of examples from the training set (or slightly modified examples from the training set) and achieve high sample quality. This issue was discussed in Theis et al. (2015). However, this is unlikely to be an issue with our evaluation because our method also improved validation set likelihood, whereas a model that achieves quality samples by dropping coverage would have poorer validation set likelihood. 7 We performed human evaluation by asking 29 volunteers to listen to five randomly selected teacher forcing samples and five randomly selected professor forcing samples (included in supplementary materials and then rate each sample from 1-3 on the basis of quality. The annotators were given the samples in random order and were not told which samples came from which algorithm. The human annotators gave the Professor Forcing samples an average score of 2.20, whereas they gave the Teacher Forcing samples an average score of 1.30. Figure 7: Human evaluator ratings for vocal synthesis samples (higher is better). The height of the bar is the mean of the ratings and the error bar shows the spread of one standard deviation. 5 Conclusion The idea of matching behavior of a model when it is running on its own, making predictions, generating samples, etc. vs when it is forced to be consistent with observed data is an old and powerful one. In this paper we introduce Professor Forcing, a novel instance of this idea when the model of interest is a recurrent generative one, and which relies on training an auxiliary model, the discriminator to spot the differences in behavior between these two modes of behavior. A major motivation for this approach is that the discriminator can look at the statistics of the behavior and not just at the single-step predictions, forcing the generator to behave the same when it is constrained by the data and when it is left generating outputs by itself for sequences that can be much longer than the training sequences. This naturally produces better generalization over sequences that are much longer than the training sequences, as we have found. We have also found that it helped to generalize better in terms of one-step prediction (log-likelihood), even though we are adding a possibly conflicting term to the log-likelihood training objective. This suggests that it acts like a regularizer but a very interesting one because it can also greatly speed up convergence in terms of number of training updates. We validated the advantage of Professor Forcing over traditional teacher forcing on a variety of sequential learning and generative tasks, with particularly impressive results in acoustic generation, where the training sequences are much shorter (because of memory constraints) than the length of the sequences we actually want to generate. Acknowledgments We thank Martin Arjovsky, Dzmitry Bahdanau, Nan Rosemary Ke, José Manuel Rodríguez Sotelo, Alexandre de Brébisson, Olexa Bilaniuk, Hal Daumé III, Kari Torkkola, and David Krueger. References Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., and Marchand, M. (2014). Domain-Adversarial Neural Networks. ArXiv e-prints. Al-Rfou, R., Alain, G., Almahairi, A., and et al. (2016). Theano: A python framework for fast computation of mathematical expressions. CoRR, abs/1605.02688. Bahdanau, D., Cho, K., and Bengio, Y. (2014). Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473. Bahdanau, D., Chorowski, J., Serdyuk, D., Brakel, P., and Bengio, Y. (2015). End-to-end attention-based large vocabulary speech recognition. arXiv preprint arXiv:1508.04395. Bahdanau, D., Brakel, P., Xu, K., Goyal, A., Lowe, R., Pineau, J., Courville, A., and Bengio, Y. (2016). An Actor-Critic Algorithm for Sequence Prediction. ArXiv e-prints. Bengio, S., Vinyals, O., Jaitly, N., and Shazeer, N. (2015). Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems, pages 1171–1179. Bengio, Y., Léonard, N., and Courville, A. (2013). Estimating or Propagating Gradients Through Stochastic Neurons for Conditional Computation. ArXiv e-prints. 8 Brebisson, A. (2016). Conditional handwriting generation in theano. https://github.com/adbrebs/ handwriting. Chen, X. and Lawrence Zitnick, C. (2015). Mind’s eye: A recurrent visual representation for image caption generation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2422–2431. Cho, K., Van Merriënboer, B., Gülçehre, Ç., Bahdanau, D., Bougares, F., Schwenk, H., and Bengio, Y. (2014a). 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, Doha, Qatar. Association for Computational Linguistics. Cho, K., Van Merriënboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., and Bengio, Y. (2014b). Learning phrase representations using rnn encoder-decoder for statistical machine translation. arXiv preprint arXiv:1406.1078. Chorowski, J. K., Bahdanau, D., Serdyuk, D., Cho, K., and Bengio, Y. (2015). Attention-based models for speech recognition. In Advances in Neural Information Processing Systems, pages 577–585. Daumé, III, H., Langford, J., and Marcu, D. (2009). Search-based Structured Prediction. ArXiv e-prints. Ganin, Y., Ustinova, E., Ajakan, H., Germain, P., Larochelle, H., Laviolette, F., Marchand, M., and Lempitsky, V. (2015). Domain-Adversarial Training of Neural Networks. ArXiv e-prints. Germain, M., Gregor, K., Murray, I., and Larochelle, H. (2015). Made: Masked autoencoder for distribution estimation. arXiv preprint arXiv:1502.03509. Goodfellow, I. J., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial networks. In NIPS’2014. Graves, A. (2012). Supervised Sequence Labelling with Recurrent Neural Networks. Studies in Computational Intelligence. Springer. Graves, A. (2013). Generating sequences with recurrent neural networks. Technical report, arXiv:1308.0850. Graves, A. (2013). Generating Sequences With Recurrent Neural Networks. ArXiv e-prints. Gregor, K., Danihelka, I., Graves, A., and Wierstra, D. (2015). Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623. Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural Comput., 9(8), 1735–1780. Huszár, F. (2015). How (not) to Train your Generative Model: Scheduled Sampling, Likelihood, Adversary? ArXiv e-prints. Kingma, D. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980. Larochelle, H. and Murray, I. (2011). The neural autoregressive distribution estimator. Liwicki, M. and Bunke, H. (2005). Iam-ondb - an on-line english sentence database acquired from handwritten text on a whiteboard. In Eighth International Conference on Document Analysis and Recognition (ICDAR’05), pages 956–961 Vol. 2. Mikolov, T. (2010). Recurrent neural network based language model. Mikolov, T. and Zweig, G. (2012). Context dependent recurrent neural network language model. Murray, I. and Salakhutdinov, R. R. (2009). Evaluating probabilities under high-dimensional latent variable models. In D. Koller, D. Schuurmans, Y. Bengio, and L. Bottou, editors, Advances in Neural Information Processing Systems 21, pages 1137–1144. Curran Associates, Inc. Raiko, T., Yao, L., Cho, K., and Bengio, Y. (2014). Iterative neural autoregressive distribution estimator NADE-k. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 27 (NIPS 2014), pages 325–333. Curran Associates, Inc. Ross, S., Gordon, G. J., and Bagnell, J. A. (2010). A Reduction of Imitation Learning and Structured Prediction to No-Regret Online Learning. ArXiv e-prints. Salimans, T., Kingma, D. P., and Welling, M. (2014). Markov chain monte carlo and variational inference: Bridging the gap. arXiv preprint arXiv:1410.6460. Sutskever, I., Vinyals, O., and Le, Q. V. (2014). Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pages 3104–3112. Theis, L., van den Oord, A., and Bethge, M. (2015). A note on the evaluation of generative models. ArXiv e-prints. van den Oord, A., Kalchbrenner, N., and Kavukcuoglu, K. (2016). Pixel Recurrent Neural Networks. ArXiv e-prints. Williams, R. J. and Zipser, D. (1989). A learning algorithm for continually running fully recurrent neural networks. Neural computation, 1(2), 270–280. Xu, K., Ba, J., Kiros, R., Courville, A., Salakhutdinov, R., Zemel, R., and Bengio, Y. (2015). Show, attend and tell: Neural image caption generation with visual attention. arXiv preprint arXiv:1502.03044. 9
2016
57
6,516
Deep ADMM-Net for Compressive Sensing MRI Yan Yang Xi’an Jiaotong University yangyan92@stu.xjtu.edu.cn Jian Sun Xi’an Jiaotong University jiansun@mail.xjtu.edu.cn Huibin Li Xi’an Jiaotong University huibinli@mail.xjtu.edu.cn Zongben Xu Xi’an Jiaotong University zbxu@mail.xjtu.edu.cn Abstract Compressive Sensing (CS) is an effective approach for fast Magnetic Resonance Imaging (MRI). It aims at reconstructing MR image from a small number of undersampled data in k-space, and accelerating the data acquisition in MRI. To improve the current MRI system in reconstruction accuracy and computational speed, in this paper, we propose a novel deep architecture, dubbed ADMM-Net. ADMMNet is defined over a data flow graph, which is derived from the iterative procedures in Alternating Direction Method of Multipliers (ADMM) algorithm for optimizing a CS-based MRI model. In the training phase, all parameters of the net, e.g., image transforms, shrinkage functions, etc., are discriminatively trained end-to-end using L-BFGS algorithm. In the testing phase, it has computational overhead similar to ADMM but uses optimized parameters learned from the training data for CS-based reconstruction task. Experiments on MRI image reconstruction under different sampling ratios in k-space demonstrate that it significantly improves the baseline ADMM algorithm and achieves high reconstruction accuracies with fast computational speed. 1 Introduction Magnetic Resonance Imaging (MRI) is a non-invasive imaging technique providing both functional and anatomical information for clinical diagnosis. Imaging speed is a fundamental challenge. Fast MRI techniques are essentially demanded for accelerating data acquisition while still reconstructing high quality image. Compressive sensing MRI (CS-MRI) is an effective approach allowing for data sampling rate much lower than Nyquist rate without significantly degrading the image quality [1]. CS-MRI methods first sample data in k-space (i.e., Fourier space), then reconstruct image using compressive sensing theory. Regularization related to the data prior is a key component in a CSMRI model to reduce imaging artifacts and improve imaging precision. Sparse regularization can be explored in specific transform domain or general dictionary-based subspace [2]. Total Variation (TV) regularization in gradient domain has been widely utilized in MRI [3, 4]. Although it is easy and fast to optimize, it introduces staircase artifacts in reconstructed image. Methods in [5, 6] leverage sparse regularization in the wavelet domain. Dictionary learning methods rely on a dictionary of local patches to improve the reconstruction accuracy [7, 8]. The non-local method uses groups of similar local patches for joint patch-level reconstruction to better preserve image details [9, 10, 11]. In performance, the basic CS-MRI methods run fast but produce less accurate reconstruction results. The non-local and dictionary learning-based methods generally output higher quality MR images, but suffer from slow reconstruction speed. In a CS-MRI model, it is commonly challenging to choose an optimal image transform domain / subspace and the corresponding sparse regularization. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. To optimize the CS-MRI models, Alternating Direction Method of Multipliers (ADMM) has proven to be an efficient variable splitting algorithm with convergence guarantee [4, 12, 13]. It considers the augmented Lagrangian function of a given CS-MRI model, and splits variables into subgroups, which can be alternatively optimized by solving a few simply subproblems. Although ADMM is generally efficient, it is not trivial to determine the optimal parameters (e.g., update rates, penalty parameters) influencing accuracy in CS-MRI. In this work, we aim to design a fast yet accurate method to reconstruct high-quality MR images from under-sampled k-space data. We propose a novel deep architecture, dubbed ADMM-Net, inspired by the ADMM iterative procedures for optimizing a general CS-MRI model. This deep architecture consists of multiple stages, each of which corresponds to an iteration in ADMM algorithm. More specifically, we define a deep architecture represented by a data flow graph [14] for ADMM procedures. The operations in ADMM are represented as graph nodes, and the data flow between two operations in ADMM is represented by a directed edge. Therefore, the ADMM iterative procedures naturally determine a deep architecture over a data flow graph. Given an under-sampled data in k-space, it flows over the graph and generates a reconstructed image. All the parameters (e.g., transforms, shrinkage functions, penalty parameters, etc.) in the deep architecture can be discriminatively learned from training pairs of under-sampled data in k-space and reconstructed image using fully sampled data by backpropagation [15] over the data flow graph. Our experiments demonstrate that the proposed deep ADMM-Net is effective both in reconstruction accuracy and speed. Compared with the baseline methods using sparse regularization in transform domain, it achieves significantly higher accuracy and takes comparable computational time. Compared with the state-of-the-art methods using dictionary learning and non-local techniques, it achieves high accuracy in significantly faster computational speed. The main contributions of this paper can be summarized as follows. We propose a novel deep ADMM-Net by reformulating an ADMM algorithm to a deep network for CS-MRI. This is achieved by designing a data flow graph for ADMM to effectively build and train the ADMM-Net. ADMMNet achieves high accuracy in MR image reconstruction with fast computational speed justified in experiments. The discriminative parameter learning approach has been applied to sparse coding and Markov Random Filed [16, 17, 18, 19]. But, to the best of our knowledge, this is the first computational framework that maps an ADMM algorithm to a learnable deep architecture. 2 Deep ADMM-Net for Fast MRI 2.1 Compressive Sensing MRI Model and ADMM Algorithm General CS-MRI Model: Assume x ∈CN is an MRI image to be reconstructed, y ∈CN ′ (N ′ < N) is the under-sampled k-space data, according to the CS theory, the reconstructed image can be estimated by solving the following optimization problem: ˆx = arg min x { 1 2∥Ax −y∥2 2 + L ∑ l=1 λlg(Dlx) } , (1) where A = PF ∈RN ′×N is a measurement matrix, P ∈RN ′×N is a under-sampling matrix, and F is a Fourier transform. Dl denotes a transform matrix for a filtering operation, e.g., Discrete Wavelet Transform (DWT), Discrete Cosine Transform (DCT), etc. g(·) is a regularization function derived from the data prior, e.g., lq-norm (0 ≤q ≤1) for a sparse prior. λl is a regularization parameter. ADMM solver: [12] The above optimization problem can be solved efficiently using ADMM algorithm. By introducing auxiliary variables z = {z1, z2, · · · , zL}, Eqn. (1) is equivalent to: min x,z 1 2∥Ax −y∥2 2 + L ∑ l=1 λlg(zl) s.t. zl = Dlx, ∀l ∈[1, 2, · · · , L]. (2) Its augmented Lagrangian function is : Lρ(x, z, α) = 1 2 ∥Ax −y∥2 2 + L ∑ l=1 λlg(zl) − L ∑ l=1 ⟨αl, zl −Dlx⟩+ L ∑ l=1 ρl 2 ∥zl −Dlx∥2 2, (3) 2 Sampling data in k-space Reconstructed MR image stage n (1) X (n-1) C (n-1) Z (n) X (n-1) M (n) C (n) Z (n+1) X (n) M (n+1) C (n+1) Z s 1 (N ) X  (n+1) M (n-1) X Figure 1: The data flow graph for the ADMM optimization of a general CS-MRI model. This graph consists of four types of nodes: reconstruction (X), convolution (C), non-linear transform (Z), and multiplier update (M). An under-sampled data in k-space is successively processed over the graph, and finally generates a MR image. Our deep ADMM-Net is defined over this data flow graph. where α = {αl} are Lagrangian multipliers and ρ = {ρl} are penalty parameters. ADMM alternatively optimizes {x, z, α} by solving the following three subproblems:          x(n+1) = arg min x 1 2∥Ax −y∥2 2 −∑L l=1⟨α(n) l , z(n) l −Dlx⟩+ ∑L l=1 ρl 2 ∥z(n) l −Dlx∥2 2, z(n+1) = arg min z ∑L l=1 λlg(zl) −∑L l=1⟨α(n) l , zl −Dlx(n+1)⟩+ ∑L l=1 ρl 2 ∥zl −Dlx(n+1)∥2 2, α(n+1) = arg min α ∑L l=1⟨αl, Dlx(n+1) −z(n+1) l ⟩, (4) where n ∈[1, 2, · · · , Ns] denotes n-th iteration. For simplicity, let βl = αl ρl (l ∈[1, 2, · · · , L]), and substitute A = PF into Eqn. (4). Then the three subproblems have the following solutions:      X(n) : x(n) = F T [P T P + ∑L l=1 ρlFDT l DlF T ]−1[P T y + ∑L l=1 ρlFDT l (z(n−1) l −β(n−1) l )], Z(n) : z(n) l = S(Dlx(n) + β(n−1) l ; λl/ρl), M(n) : β(n) l = β(n−1) l + ηl(Dlx(n) −z(n) l ), (5) where x(n) can be efficiently computed by fast Fourier transform, S(·) is a nonlinear shrinkage function. It is usually a soft or hard thresholding function corresponding to the sparse regularization of l1-norm and l0-norm respectively [20]. The parameter ηl is an update rate. In CS-MRI, it commonly needs to run the ADMM algorithm in dozens of iterations to get a satisfactory reconstruction result. However, it is challenging to choose the transform Dl and shrinkage function S(·) for general regularization function g(·). Moreover, it is also not trivial to tune the parameters ρl and ηl for k-space data with different sampling ratios. To overcome these difficulties, we will design a data flow graph for the ADMM algorithm, over which we can define a deep ADMM-Net to discriminatively learn all the above transforms, functions, and parameters. 2.2 Data Flow Graph for the ADMM Algorithm To design our deep ADMM-Net, we first map the ADMM iterative procedures in Eqn. (5) to a data flow graph [14]. As shown in Fig. 1, this graph comprises of nodes corresponding to different operations in ADMM, and directed edges corresponding to the data flows between operations. In this case, the n-th iteration of ADMM algorithm corresponds to the n-th stage of the data flow graph. In the n-th stage of the graph, there are four types of nodes mapped from four types of operations in ADMM, i.e., reconstruction operation (X(n)), convolution operation (C(n)) defined by {Dlx(n)}L l=1, nonlinear transform operation (Z(n)) defined by S(·), and multiplier update operation (M(n)) in Eqn. (5). The whole data flow graph is a multiple repetition of the above stages corresponding to successive iterations in ADMM. Given an under-sampled data in k-space, it flows over the graph and finally generates a reconstructed image. In this way, we map the ADMM iterations to a data flow graph, which is useful to define and train our deep ADMM-Net in the following sections. 2.3 Deep ADMM-Net Our deep ADMM-Net is defined over the data flow graph. It keeps the graph structure but generalizes the four types of operations to have learnable parameters as network layers. These operations are now generalized as reconstruction layer, convolution layer, non-linear transform layer, and multiplier update layer. We next discuss them in details. 3 Reconstruction layer (X(n)): This layer reconstructs an MRI image following the reconstruction operation X(n) in Eqn. (5). Given z(n−1) l and β(n−1) l , the output of this layer is defined as: x(n) = F T (P T P + L ∑ l=1 ρ(n) l FH(n) l T H(n) l F T )−1[P T y+ L ∑ l=1 ρ(n) l FH(n) l T (z(n−1) l −β(n−1) l )], (6) where H(n) l is the l-th filter, ρ(n) l is the l-th penalty parameter, l = 1, · · · , L, and y is the input under-sampled data in k-space. In the first stage (n = 1), z(0) l and β(0) l are initialized to zeros, therefore x(1) = F T (P T P + ∑L l=1 ρ(1) l FH(1) l T H(1) l F T )−1(P T y). Convolution layer (C(n)): It performs convolution operation to transform an image into transform domain. Given an image x(n), i.e., a reconstructed image in stage n, the output is c(n) l = D(n) l x(n), (7) where D(n) l is a learnable filter matrix in stage n. Different from the original ADMM, we do not constrain the filters D(n) l and H(n) l to be the same to increase the network capacity. Nonlinear transform layer (Z(n)): This layer performs nonlinear transform inspired by the shrinkage function S(·) defined in Z(n) in Eqn. (5). Instead of setting it to be a shrinkage function determined by the regularization term g(·) in Eqn. (1), we aim to learn more general function using piecewise linear function. Given c(n) l and β(n−1) l , the output of this layer is defined as: z(n) l = SP LF (c(n) l + β(n−1) l ; {pi, q(n) l,i }Nc i=1), (8) where SP LF (·) is a piecewise linear function determined by a set of control points {pi, q(n) l,i }Nc i=1. i.e. SP LF (a; {pi, q(n) l,i }Nc i=1) =        a + q(n) l,1 −p1, a < p1, a + q(n) l,Nc −pNc, a > pNc, q(n) l,k + (a−pk)(q(n) l,k+1−q(n) l,k ) pk+1−pk , p1 ≤a ≤pNc, (9) where k = ⌊a−p1 p2−p1 ⌋, {pi}Nc i=1 are predefined positions uniformly located within [-1,1], and {q(n) l,i }Nc i=1 are the values at these positions for l-th filter in n-th stage. Figure 2 gives an illustrative example. Since a piecewise linear function can approximate any function, we can learn flexible nonlinear transform function from data beyond the off-the-shelf hard or soft thresholding functions. (𝑝𝑖,𝑞𝑙,𝑖 (𝑛)) … … -1 1 Figure 2: Illustration of a piecewise linear function determined by a set of control points. Multiplier update layer (M(n)): This layer is defined by the Lagrangian multiplier updating procedure M(n) in Eqn. (5). The output of this layer in stage n is defined as: β(n) l = β(n−1) l + η(n) l (c(n) l −z(n) l ), (10) where η(n) l are learnable parameters. Network Parameters: These layers are organized in a data flow graph shown in Fig. 1. In the deep architecture, we aim to learn the following parameters: H(n) l and ρ(n) l in reconstruction layer, filters D(n) l in convolution layer, {q(n) l,i }Nc i=1 in nonlinear transform layer, η(n) l in multiplier update layer, where l ∈[1, 2, · · · , L] and n ∈[1, 2, · · · , Ns] are the indexes for the filters and stages respectively. All of these parameters are taken as the network parameters to be learned. Figure 3 shows an example of a deep ADMM-Net with three stages. The under-sampled data in k-space flows over three stages in a order from circled number 1 to number 12, followed by a final reconstruction layer with circled number 13 and generates a reconstructed image. Immediate reconstruction result at each stage is shown under each reconstruction layer. 4 ① ④ (1) X ② (1) C ③ (1) Z ⑤ (2) X (1) M ⑧ ⑥ (2) C ⑦ (2) Z ⑨ (3) X (2) M ⑫ ⑩ (3) C ⑪ (3) Z ⑬ (4) X (3) M Sampling data in k-space Reconstructed MR image Figure 3: An example of deep ADMM-Net with three stages. The sampled data in k-space is successively processed by operations in a order from 1 to 12, followed by a reconstruction layer X(4) to output the final reconstructed image. The reconstructed image in each stage is shown under each reconstruction layer. 3 Network Training We take the reconstructed MR image using fully sampled data in k-space as the ground-truth MR image xgt, and under-sampled data y in k-space as the input. Then a training set Γ is constructed containing pairs of under-sampled data and ground-truth MR image. We choose normalized mean square error (NMSE) as the loss function in network training. Given pairs of training data, the loss between the network output and ground truth is defined as: E(Θ) = 1 |Γ| ∑ (y,xgt)∈Γ √ ∥ˆx(y, Θ) −xgt∥2 2 √ ∥xgt∥2 2 , (11) where ˆx(y, Θ) is the network output based on network parameter Θ and under-sampled data y in kspace. We learn the parameters Θ = {(q(n) l,i )Nc i=1, D(n) l , H(n) l , ρ(n) l , η(n) l }Ns n=1 ∪{H(Ns+1) l , ρ(Ns+1) l } (l = 1, · · · , L) by minimizing the loss w.r.t. them using L-BFGS1. In the following, we first discuss the initialization of these parameters and then compute the gradients of the loss function E(Θ) w.r.t. parameters Θ using backpropagation (BP) [21] over the data flow graph. 3.1 Initialization We initialize the network parameters Θ according to the ADMM solver of the following baseline CS-MRI model: arg min x { 1 2∥Ax −y∥2 2 + λ L ∑ l=1 ||Dlx||1 } . (12) In this model, we set Dl as a DCT basis and impose l1-norm regularization in the DCT transform space. The function S(·) in ADMM algorithm (Eqn. (5)) is a soft thresholding function: S(t; λ/ρl) = sgn(t)(|t| −λ/ρl) when |t| > λ/ρl, and 0 otherwise. For each n-th stage of deep ADMM-Net, filters D(n) l in convolution layers and H(n) l in reconstruction layers are initialized to be Dl in Eqn. (12). In the nonlinear transform layer, we uniformly choose 101 positions located within [-1,1], and each value q(n) l,i is initialized as S(pi; λ/ρl). Parameters λ, ρ(n) l , η(n) l are initialized to be the corresponding values in the ADMM algorithm. In this case, the initialized net is exactly a realization of ADMM optimizing Eqn. (12), therefore outputs the same reconstructed image as the ADMM algorithm. The optimization of the network parameters is expected to produce improved reconstruction result. 3.2 Gradient Computation by Backpropagation over Data Flow Graph It is challenging to compute the gradients of loss w.r.t. parameters using backpropagation over the deep architecture in Fig. 1, because it is a directed graph. In the forward pass, we process the data of n-th stage in the order of X(n), C(n), Z(n) and M(n). In the backward pass, the gradients are 1http://users.eecs.northwestern.edu/~nocedal/lbfgsb.html 5 ( ) n lc (n) Z ( 1) n x  (b) Non-linear transform layer ( ) n l (c) Convolution layer ( )n x (n) C ( ) n lz ( ) n l ( ) n lz ( 1) n l  (n) M ( 1) n lz  (a) Multiplier update layer ( 1) n l  (d) Reconstruction layer (n) X ( ) n lc ( ) n lc ( ) n l ( ) n l ( ) n l ( 1) n l  ( ) n lz ( 1) n lz  ( ) n lc ( ) n lc ( )n x ( 1) n l  ( 1) n x  ( ) n lz Figure 4: Illustration of four types of graph nodes (i.e., layers in network) and their data flows in stage n. The solid arrow indicates the data flow in forward pass and dashed arrow indicates the backward pass when computing gradients in backpropagation. computed in an inverse order. Figure 3 shows an example, where the gradient can be computed backwardly from the layers with circled number 13 to 1 successively. For a stage n, Fig. 4 shows four types of nodes (i.e., network layers) and the data flow over them. Each node has multiple inputs and (or) outputs. We next briefly introduce the gradients computation for each layer in a typical stage n (n < Ns). Please refer to supplementary material for details. Multiplier update layer (M(n)): As shown in Fig. 4(a), this layer has three sets of inputs: {β(n−1) l }, {c(n) l } and {z(n) l }. Its output {β(n) l } is the input to compute {β(n+1) l }, {z(n+1) l } and x(n+1). The parameters of this layer are η(n) l , l = 1, · · · , L. The gradients of loss w.r.t. the parameters can be computed as: ∂E ∂η(n) l = ∂E ∂β(n) l ∂β(n) l ∂η(n) l , where ∂E ∂β(n) l = ∂E ∂β(n+1) l ∂β(n+1) l ∂β(n) l + ∂E ∂z(n+1) l ∂z(n+1) l ∂β(n) l + ∂E ∂x(n+1) ∂x(n+1) ∂β(n) l . ∂E ∂β(n) l is the summation of gradients along the three dashed blue arrows in Fig. 4(a). We also compute gradients of the output in this layer w.r.t. its inputs: ∂β(n) l ∂β(n−1) l , ∂β(n) l ∂c(n) l , and ∂β(n) l ∂z(n) l . Nonlinear transform layer (Z(n)): As shown in Fig. 4(b), this layer has two sets of inputs: {β(n−1) l }, {c(n) l }, and its output {z(n) l } is the input for computing {β(n) l } and x(n+1) in next stage. The parameters of this layers are {q(n) l,i }Nc i=1, l = 1, · · · , L. The gradient of loss w.r.t. parameters can be computed as ∂E ∂q(n) l,i = ∂E ∂z(n) l ∂z(n) l ∂q(n) l,i , where ∂E ∂z(n) l = ∂E ∂β(n) l ∂β(n) l ∂z(n) l + ∂E ∂x(n+1) ∂x(n+1) ∂z(n) l . We also compute the gradients of layer output to its inputs: ∂z(n) l ∂β(n) l and ∂z(n) l ∂c(n) l . Convolution layer (C(n)): The parameters of this layer are D(n) l (l = 1, · · · , L). We represent the filter by D(n) l = ∑t m=1 ω(n) l,mBm, where Bm is a basis element, and {ω(n) l,m} is the set of filter coefficients to be learned. The gradients of loss w.r.t. filter coefficients are computed as ∂E ∂ω(n) l,m = ∂E ∂c(n) l ∂c(n) l ∂ω(n) l,m , where ∂E ∂c(n) l = ∂E ∂β(n) l ∂β(n) l ∂c(n) l + ∂E ∂z(n) l ∂z(n) l ∂c(n) l . The gradient of layer output w.r.t. input is computed as ∂c(n) l ∂x(n) . Reconstruction layer (X(n)): The parameters of this layer are H(n) l , ρ(n) l (l = 1, · · · , L). Similar to convolution layer, we represent the filter by H(n) l = ∑s m=1 γ(n) l,mBm, where {γ(n) l,m} is the set of filter coefficients to be learned. The gradients of loss w.r.t. parameters are computed as ∂E ∂γ(n) l,m = ∂E ∂x(n) ∂x(n) ∂γ(n) l,m , ∂E ∂ρ(n) l = ∂E ∂x(n) ∂x(n) ∂ρ(n) l , where ∂E ∂x(n) = ∂E ∂c(n) ∂c(n) ∂x(n) , if n ≤Ns, ∂E ∂x(n) = 1 |Γ| (x(n) −xgt) √ ∥xgt∥2 2 √ ∥x(n) −xgt∥2 2 , if n = Ns + 1. The gradients of layer output w.r.t. inputs are computed as ∂x(n) ∂β(n−1) l and ∂x(n) ∂z(n−1) l . 6 4 Experiments We train and test ADMM-Net on brain and chest MR images2. For each dataset, we randomly take 100 images for training and 50 images for testing. ADMM-Net is separately learned for each sampling ratio. The reconstruction accuracies are reported as the average NMSE and Peak Signalto-Noise Ratio (PSNR) over the test images. The sampling pattern in k-space is the commonly used pseudo radial sampling. All experiments are performed on a desktop with Intel core i7-4790k CPU. Table 1: Performance comparisons on brain data with different sampling ratios. Method 20% 30% 40% 50% Test time NMSE PSNR NMSE PSNR NMSE PSNR NMSE PSNR Zero-filling 0.1700 29.96 0.1247 32.59 0.0968 34.76 0.0770 36.73 0.0013s TV [2] 0.0929 35.20 0.0673 37.99 0.0534 40.00 0.0440 41.69 0.7391s RecPF [4] 0.0917 35.32 0.0668 38.06 0.0533 40.03 0.0440 41.71 0.3105s SIDWT 0.0885 35.66 0.0620 38.72 0.0484 40.88 0.0393 42.67 7.8637s PBDW [6] 0.0814 36.34 0.0627 38.64 0.0518 40.31 0.0437 41.81 35.3637s PANO [10] 0.0800 36.52 0.0592 39.13 0.0477 41.01 0.0390 42.76 53.4776s FDLCP [8] 0.0759 36.95 0.0592 39.13 0.0500 40.62 0.0428 42.00 52.2220s BM3D-MRI [11] 0.0674 37.98 0.0515 40.33 0.0426 41.99 0.0359 43.47 40.9114s Init-Net13 0.1394 31.58 0.1225 32.71 0.1128 33.44 0.1066 33.95 0.6914s ADMM-Net13 0.0752 37.01 0.0553 39.70 0.0456 41.37 0.0395 42.62 0.6964s ADMM-Net14 0.0742 37.13 0.0548 39.78 0.0448 41.54 0.0380 42.99 0.7400s ADMM-Net15 0.0739 37.17 0.0544 39.84 0.0447 41.56 0.0379 43.00 0.7911s In Tab. 1, we compare our method to conventional compressive sensing MRI methods on brain data. These methods include Zero-filling [22], TV [2], RecPF [4], SIDWT 3, and also the state-of-the-art methods such as PBDW [6], PANO [10], FDLCP [8] and BM3D-MRI [11]. For ADMM-Net, we initialize the filters in each stage to be eight 3 × 3 DCT basis (the average DCT basis is discarded). Compared with the baseline methods such as Zero-filling, TV, RecPF and SIDWT, our proposed method produces the best quality with comparable reconstruction speed. Compared with the stateof-the-art methods PBDW, PANO and FDLCP, our ADMM-Net has more accurate reconstruction results with fastest computational speed. For the sampling ratio of 30%, our method (ADMMNet15) outperforms the state-of-the-art methods PANO and FDLCP by 0.71 db. Moreover, our reconstruction speed is around 66 times faster. BM3D-MRI method relies on a well designed BM3D denoiser, it produces higher accuracy, but runs around 50 times slower in computational time than ours. The visual comparisons in Fig. 5 show that the proposed network can preserve the fine image details without obvious artifacts. In Fig. 6(a), we compare the NMSEs and the average test time for different methods using scatter plot. It is easy to observe that our method is the best considering the reconstruction accuracy and running time. Examples of the learned nonlinear functions and the filters are shown in Fig. 7. Table 2: Comparisons of NMSE and PSNR on chest data with 20% sampling ratio. Method TV RecPF PANO FDLCP ADMM-Net15-B ADMM-Net15 ADMM-Net17 NMSE 0.1019 0.1017 0.0858 0.0775 0.0790 0.0775 0.0768 PSNR 35.49 35.51 37.01 37.77 37.68 37.84 37.92 Network generalization ability: We test the generalization ability of ADMM-Net by applying the learned net from brain data to chest data. Table 2 shows that our net learned from brain data (ADMMNet15-B) still achieves competitive reconstruction accuracy on chest data, resulting in remarkable a generalization ability. This might be due to that the learned filters and nonlinear transforms are performed over local patches, which are repetitive across different organs. Moreover, the ADMMNet17 learned from chest data achieves the better reconstruction accuracy on test chest data. Effectiveness of network training: In Tab. 1, we also present the results of the initialized network for ADMM-Net13. As discussed in Section 3.1, this initialized network (Init-Net13) is a realization 2CAF Project: https://masi.vuse.vanderbilt.edu/workshop2013/index.php/Segmentation_Challenge_Details 3Rice Wavelet Toolbox: http://dsp.rice.edu/software/rice-wavelet-toolbox 7 NMSE:0.0564; PSNR:35.79 NMSE:0.0727; PSNR:33.62 NMSE:0.0489; PSNR:37.03 NMSE:0.0612; PSNR:35.10 NMSE:0.0660; PSNR:33.61 NMSE:0.0843; PSNR:31.51 NMSE:0.0726; PSNR:32.80 NMSE:0.0614; PSNR:34.22 Ground truth image Ground truth image Figure 5: Examples of reconstruction results with 20% (the first row) and 30% (the second row) sampling ratios. The left four columns show results of ADMM-Net15, RecPF, PANO, BM3D-MRI. Test time in seconds (a) (b) NMSE 15 Stage number Figure 6: (a) Scatter plot of NMSEs and average test time for different methods; (b) The NMSEs of ADMM-Net using different number of stages (20% sampling ratio for brain data). Figure 7: Examples of learned filters in convolution layer and the corresponding nonlinear transforms (the first stage of ADMM-Net15 with 20% sampling ratio for brain data). of the ADMM optimizing Eqn. (12). The network after training produces significantly improved accuracy, e.g., PNSR is increased from 32.71 db to 39.84 db with sampling ratio of 30%. Effect of the number of stages: To test the effect of the number of stages (i.e., Ns), we greedily train deeper network by adding one stage at each time. Fig. 6(b) shows the average testing NMSE values using different stages in ADMM-Net under the sampling ratio of 20%. The reconstruction error decreases fast when Ns < 8 and marginally decreases when further increasing the number of stages. Effect of the filter sizes: We also train ADMM-Net initialized by two gradient filters with size of 1×3 and 3 × 1 respectively for all convolution and reconstruction layers, the corresponding trained net with 13 stages under 20% sampling ratio achieves NMSE value of 0.0899 and PSNR value of 36.52 db on brain data, compared with 0.0752 and 37.01 db using eight 3 × 3 filters as shown in Tab. 1. We also learn ADMM-Net13 with 8 filters sized 5 × 5 initialized by DCT basis, the performance is not significantly improved, but the training and testing time are significantly longer. 5 Conclusions We proposed a novel deep network for compressive sensing MRI. It is a novel deep architecture defined over a data flow graph determined by an ADMM algorithm. Due to its flexibility in parameter learning, this deep net achieved high reconstruction accuracy while keeping the computational efficiency of the ADMM algorithm. As a general framework, the idea that models an ADMM algorithm as a deep network can be potentially applied to other applications in the future work. 8 References [1] Michael Lustig, David L Donoho, Juan M Santos, and John M Pauly. Compressed sensing mri. IEEE Journal of Signal Processing, 25(2):72–82, 2008. [2] Michael Lustig, David Donoho, and John M Pauly. Sparse mri: The application of compressed sensing for rapid mr imaging. Magnetic Resonance in Medicine, 58(6):1182–1195, 2007. [3] Kai Tobias Block, Martin Uecker, and Jens Frahm. Undersampled radial mri with multiple coils: Iterative image reconstruction using a total variation constraint. Magnetic Resonance in Medicine, 57(6):1086– 1098, 2007. [4] Junfeng Yang, Yin Zhang, and Wotao Yin. A fast alternating direction method for tvl1-l2 signal reconstruction from partial fourier data. IEEE Journal of Selected Topics in Signal Processing, 4(2):288–297, 2010. [5] Chen Chen and Junzhou Huang. Compressive sensing mri with wavelet tree sparsity. In Advances in Neural Information Processing Systems, pages 1115–1123, 2012. [6] Xiaobo Qu, Di Guo, Bende Ning, and et al. Undersampled mri reconstruction with patch-based directional wavelets. Magnetic resonance imaging, 30(7):964–977, 2012. [7] Saiprasad Ravishankar and Yoram Bresler. Mr image reconstruction from highly undersampled k-space data by dictionary learning. IEEE Transactions on Medical Imaging, 30(5):1028–1041, 2011. [8] Zhifang Zhan, Jian-Feng Cai, Di Guo, Yunsong Liu, Zhong Chen, and Xiaobo Qu. Fast multi-class dictionaries learning with geometrical directions in mri reconstruction. IEEE Transactions on Biomedical Engineering, 2016. [9] Sheng Fang, Kui Ying, Li Zhao, and Jianping Cheng. Coherence regularization for sense reconstruction with a nonlocal operator (cornol). Magnetic Resonance in Medicine, 64(5):1413–1425, 2010. [10] Xiaobo Qu, Yingkun Hou, Fan Lam, Di Guo, Jianhui Zhong, and Zhong Chen. Magnetic resonance image reconstruction from undersampled measurements using a patch-based nonlocal operator. Medical Image Analysis, 18(6):843–856, 2014. [11] Ender M Eksioglu. Decoupled algorithm for mri reconstruction using nonlocal block matching model: Bm3d-mri. Journal of Mathematical Imaging and Vision, pages 1–11, 2016. [12] Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, and Jonathan Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundation and Trends in Machine Learning, 3(1):1–122, 2011. [13] Huahua Wang, Arindam Banerjee, and Zhi-Quan Luo. Parallel direction method of multipliers. In Advances in Neural Information Processing Systems, pages 181–189, 2014. [14] Krishna M Kavi, Bill P Buckles, and U Narayan Bhat. A formal definition of data flow graph models. IEEE Transactions on Computers, 100(11):940–948, 1986. [15] Yann Lécun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. [16] Karol Gregor and Yann LeCun. Learning fast approximations of sparse coding. In Proceedings of the 27th International Conference on Machine Learning, pages 399–406, 2010. [17] Uwe Schmidt and Stefan Roth. Shrinkage fields for effective image restoration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2774–2781, 2014. [18] Sun Jian and Xu Zongben. Color image denoising via discriminatively learned iterative shrinkage. IEEE Transactions on Image Processing, 24(11):4148–4159, 2015. [19] John R Hershey, Jonathan Le Roux, and Felix Weninger. Deep unfolding: Model-based inspiration of novel deep architectures. arXiv preprint arXiv:1409.2574, 2014. [20] Francis Bach, Rodolphe Jenatton, Julien Mairal, and Guillaume Obozinski. Optimization with sparsityinducing penalties. Foundations and Trends in Machine Learning, 4(1):1–106, 2012. [21] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning representations by backpropagating errors. Cognitive modeling, 5(3):1, 1988. [22] Matt A Bernstein, Sean B Fain, and Stephen J Riederer. Effect of windowing and zero-filled reconstruction of mri data on spatial resolution and acquisition strategy. Magnetic Resonance Imaging, 14(3):270–280, 2001. 9
2016
58
6,517
Adaptive Averaging in Accelerated Descent Dynamics Walid Krichene ∗ UC Berkeley walid@eecs.berkeley.edu Alexandre M. Bayen UC Berkeley bayen@berkeley.edu Peter L. Bartlett UC Berkeley and QUT bartlett@cs.berkeley.edu Abstract We study accelerated descent dynamics for constrained convex optimization. This dynamics can be described naturally as a coupling of a dual variable accumulating gradients at a given rate η(t), and a primal variable obtained as the weighted average of the mirrored dual trajectory, with weights w(t). Using a Lyapunov argument, we give sufficient conditions on η and w to achieve a desired convergence rate. As an example, we show that the replicator dynamics (an example of mirror descent on the simplex) can be accelerated using a simple averaging scheme. We then propose an adaptive averaging heuristic which adaptively computes the weights to speed up the decrease of the Lyapunov function. We provide guarantees on adaptive averaging in continuous-time, prove that it preserves the quadratic convergence rate of accelerated first-order methods in discrete-time, and give numerical experiments to compare it with existing heuristics, such as adaptive restarting. The experiments indicate that adaptive averaging performs at least as well as adaptive restarting, with significant improvements in some cases. 1 Introduction We study the problem of minimizing a convex function f over a feasible set X, a closed convex subset of E = Rn. We will assume that f is differentiable, that its gradient ∇f is a Lipschitz function with Lipschitz constant L, and that the set of minimizers S = arg minx∈X f(x) is non-empty. We will focus on the study of continuous-time, first-order dynamics for optimization. First-order methods have seen a resurgence of interest due to the significant increase in both size and dimensionality of the data sets typically encountered in machine learning and other applications, which makes higher-order methods computationally intractable in most cases. Continuous-time dynamics for optimization have been studied for a long time, e.g. [6, 9, 5], and more recently [20, 2, 1, 3, 11, 23], in which a connection is made between Nesterov’s accelerated methods [14, 15] and a family of continuous-time ODEs. Many optimization algorithms can be interpreted as a discretization of a continuous-time process, and studying the continuous-time dynamics is useful for many reasons: The analysis is often simpler in continuous-time, it can help guide the design and analysis of new algorithms, and it provides intuition and insight into the discrete process. For example, Su et al. show in [20] that Nesterov’s original method [14] is a discretization of a second-order ODE, and use this interpretation to propose a restarting heuristic which empirically speeds up the convergence. In [11], we generalize this approach to the proximal version of Nesterov’s method [15] which applies to constrained convex problems, and show that the continuous-time ODE can be interpreted as coupled dynamics of a dual variable Z(t) which evolves in the dual space E∗, and a primal variable X(t) which is obtained as the weighted average of a non-linear transformation of the dual trajectory. More precisely,          ˙Z(t) = −t r ∇f(X(t)) X(t) = R t 0 τr−1∇ψ∗(Z(τ))dτ R t 0 τr−1dτ X(0) = ∇ψ∗(Z(0)) = x0, ∗Walid Krichene is currently affiliated with Google. walidk@google.com 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. where r ≥2 is a fixed parameter, the initial condition x0 is a point in the feasible set X, and ∇ψ∗is a Lipschitz function that maps from the dual space E∗to the feasible set X, which we refer to as the mirror map (such a function can be constructed using standard results from convex analysis, by taking the convex conjugate of a strongly convex function ψ with domain X; see the supplementary material for a brief review of the definition and basic properties of mirror maps). Using a Lyapunov argument, we show that the solution trajectories of this ODE exhibit a quadratic convergence rate, i.e. if f ⋆is the minimum of f over the feasible set, then f(X(t)) −f ⋆≤C/t2 for a constant C which depends on the initial conditions. This formalized an interesting connection between acceleration and averaging, which had been observed in [8] in the special case of unconstrained quadratic minimization. A natural question that arises is whether different averaging schemes can be used to achieve the same rate, or perhaps faster rates. In this article, we provide a positive answer. We study a broad family of Accelerated Mirror Descent (AMD) dynamics, given by AMDw,η          ˙Z(t) = −η(t)∇f(X(t)) X(t) = X(t0)W (t0)+ R t t0 w(τ)∇ψ∗(Z(τ))dτ W (t) , with W(t) = R t 0 w(τ)dτ X(t0) = ∇ψ∗(Z(t0)) = x0, (1) parameterized by two positive, continuous weight functions w and η, where w is used in the averaging and η determines the rate at which Z accumulates gradients. This is illustrated in Figure 1. In our formulation we choose to initialize the ODE at t0 > 0 instead of 0 (to guarantee existence and uniqueness of a solution, as discussed in Section 2). We give a unified study of this ODE using an appropriate Lyapunov function, given by Lr(X, Z, t) = r(t)(f(X) −f ⋆) + Dψ∗(Z, z⋆), (2) where Dψ∗is the Bregman divergence associated with ψ∗(a non-negative function defined on E∗× E∗), and r(t) is a desired convergence rate (a non-negative function defined on R+). By construction, Lr is a non-negative function on X × E∗× R+. If t 7→Lr(X(t), Z(t), t) is a non-increasing function for all solution trajectories (X(t), Z(t)), then Lr is said to be a Lyapunov function for the ODE, in reference to Aleksandr Mikhailovich Lyapunov [12]. We give in Theorem 2 a sufficient condition on η, w and r for Lr to be a Lyapunov function for AMDw,η, and show that under these conditions, f(X(t)) converges to f ⋆at the rate 1/r(t). E E∗ X ∇ψ∗ ∂ψ Z(t) −η(t)∇f(X(t)) X(t) ∇ψ∗(Z(t)) Figure 1: Illustration of AMDw,η. The dual variable Z evolves in the dual space E∗, and accumulates negative gradients at a rate η(t), and the primal variable X(t) (green solid line) is obtained by averaging the mirrored trajectory {∇ψ∗(Z(τ)), τ ∈[t0, t]} (green dashed line), with weights w(τ). In Section 3, we give an equivalent formulation of AMDw,η written purely in the primal space. We give several examples of these dynamics for simple constraint sets. In particular, when the feasible set is the probability simplex, we derive an accelerated version of the replicator dynamics, an ODE that plays an important role in evolutionary game theory [22] and viability theory [4]. Many heuristics have been developed to empirically speed up the convergence of accelerated methods. Most of these heuristics consist in restarting the ODE (or the algorithm in discrete time) whenever a simple condition is met. For example, a gradient restart heuristic is proposed in [17], in which the algorithm is restarted whenever the trajectory forms an acute angle with the gradient (which intuitively indicates that the trajectory is not making progress), and a speed restarting heuristic is proposed in [20], in which the ODE is restarted whenever the speed ∥˙X(t)∥decreases (which intuitively indicates that progress is slowing). These heuristics are known to empirically improve 2 the speed of convergence, but provide few guarantees. For example, the gradient restart in [17] is only studied for unconstrained quadratic problems, and the speed restart in [20] is only studied for unconstrained strongly convex problems. In particular, it is not guaranteed (to our knowledge) that these heuristics preserve the original convergence rate of the non-restarted method, when the objective function is not strongly convex. In Section 4, we propose a new heuristic that provides such guarantees, and that is based on a simple idea for adaptively computing the weights w(t) along the solution trajectories. The heuristic simply decreases the time derivative of the Lyapunov function Lr(X(t), Z(t), t) whenever possible. Thus it preserves the 1/r(t) convergence rate. Other adaptive methods have been applied to convex optimization, such as Adagrad [7] and Adam [10], which adapt the learning rate in first-order methods, by maintaining moment estimates of the observed gradients. They are particularly well suited to problems with sparse gradients. While these methods are similar in spirit to adaptive averaging, they are not designed for accelerated methods. In Section 5, we give numerical experiments in which we compare the performance of adaptive averaging and restarting. The experiments indicate that adaptive averaging compares favorably in all of the examples, and gives a significant improvement in some cases. We conclude with a brief discussion in Section 6. 2 Accelerated mirror descent with generalized averaging We start by giving an equivalent form of AMDw,η, which we use to briefly discuss existence and uniqueness of a solution. Writing the second equation as X(t)W(t) −X(t0)W(t0) = R t t0 w(τ)∇ψ∗(Z(τ))dτ, then taking the time-derivative, we have ˙X(t)W(t) + X(t)w(t) = w(t)∇ψ∗(Z(t)). Thus the ODE is equivalent to AMD′ w,η        ˙Z(t) = −η(t)∇f(X(t)) ˙X(t) = w(t) W (t)(∇ψ∗(Z(t)) −X(t)) X(t0) = ∇ψ∗(Z(t0)) = x0. The following theorem guarantees existence and uniqueness of the solution. Theorem 1. Suppose that W(t0) > 0. Then AMDw,η has a unique maximal (i.e. defined on a maximal interval) solution (X(t), Z(t)) that is C1([t0, +∞)). Furthermore, for all t ≥t0, X(t) belongs to the feasible set X. Proof. Recall that, by assumption, ∇f and ∇ψ∗are both Lipschitz, and w, η are continuous. Furthermore, W(t) is non-decreasing and continuous, as the integral of a non-negative function, thus w(t)/W(t) ≤w(t)/W(t0). This guarantees that on any finite interval [t0, T), the functions η(t) and w(t)/W(t) are bounded. Therefore, −η(t)∇f(X) and w(t) W (t)(∇ψ∗(Z) −X) are Lipschitz functions of (X, Z), uniformly in t ∈[t0, T). By the Cauchy-Lipschitz theorem (e.g. Theorem 2.5 in [21]), there exists a unique C1 solution defined on [t0, T). Since T is arbitrary, this defines a unique solution on all of [t0, +∞). Indeed, any two solutions defined on [t0, T1) and [t0, T2) with T2 > T1 coincide on [t0, T1). Finally, feasibility of the solution follows from the fact that X is convex and X(t) is the weighted average of points in X, specifically, x0 and the set {∇ψ∗(Z(τ)), τ ∈[t0, t]}. Note that in general, it is important to initialize the ODE at t0 and not 0, since W(0) = 0 and w(t)/W(t) can diverge at 0, in which case one cannot apply the Cauchy-Lipschitz theorem. It is possible however to prove existence and uniqueness with t0 = 0 for some choices of w, by taking a sequence of Lipschitz ODEs that approximate the original one, as is done in [20], but this is a technicality and does not matter for practical purposes. We now move to our main result for this section. Suppose that r is an increasing, positive differentiable function on [t0, +∞), and consider the candidate Lyapunov function Lr defined in (2), where the Bregman divergence term is given by Dψ∗(z, y) := ψ∗(z) −ψ∗(y) −⟨∇ψ∗(y), z −y⟩, and z⋆is a point in the dual space such that ∇ψ∗(z⋆) = x⋆belongs to the set of minimizers S. Let (X(t), Z(t)) be the unique maximal solution trajectory of AMDw,η. 3 Taking the derivative of t 7→Lr(X(t), Z(t), t) = r(t)(f(X(t)) −f ⋆) + Dψ∗(Z(t), z⋆), we have d dtLr(X(t), Z(t), t) = r′(t)(f(X(t)) −f ⋆) + r(t) D ∇f(X(t)), ˙X(t) E + D ˙Z(t), ∇ψ∗(Z(t)) −∇ψ∗(z⋆) E = r′(t)(f(X(t)) −f ⋆) + r(t) D ∇f(X(t)), ˙X(t) E +  −η(t)∇f(X(t)), X(t) + W(t) w(t) ˙X(t) −x⋆  ≤(f(X(t)) −f ⋆)(r′(t) −η(t)) + D ∇f(X(t)), ˙X(t) E  r(t) −η(t)W(t) w(t)  , (3) where we used the expressions for ˙Z and ∇ψ∗(Z) from AMD′ w,η in the second equality, and convexity of f in the last inequality. Equipped with this bound, it becomes straightforward to give sufficient conditions for Lr to be a Lyapunov function. Theorem 2. Suppose that for all t ∈[t0, +∞), 1. η(t) ≥r′(t) and 2. D ∇f(X(t)), ˙X(t) E  r(t) −η(t)W (t) w(t)  ≤0. Then Lr is a Lyapunov function for AMDw,η, and for all t ≥t0, f(X(t)) −f ⋆≤Lr(X(t0),Z(t0),t0) r(t) . Proof. The two conditions, combined with inequality (3), imply that d dtLr(X(t), Z(t), t) ≤0, thus Lr is a Lyapunov function. Finally, since Dψ∗is non-negative, and Lr is decreasing, we have f(X(t)) −f ⋆≤Lr(X(t), Z(t), t) r(t) ≤Lr(X(t0), Z(t0), t0) r(t) . which proves the claim. Note that the second condition depends on the solution trajectory X(t), and may be hard to check a priori. However, we give one special case in which the condition trivially holds. Corollary 1. Suppose that for all t ∈[t0, +∞), η(t) = w(t)r(t) W (t) , and w(t) W (t) ≥r′(t) r(t) . Then Lr is a Lyapunov function for AMDw,η, and for all t ≥t0, f(X(t)) −f ⋆≤Lr(X(t0),Z(t0),t0) r(t) . Next, we describe a method to construct weight functions w, η that satisfy the conditions of Corollary 1, given a desired rate r. Of course, it suffices to construct w that satisfies w(t) W (t) ≥r′(t) r(t) , then to set η(t) = w(t)r(t) W (t) . We can reparameterize the weight function by writing w(t) W (t) = a(t). Then integrating from t0 to t, we have W (t) W (t0) = e R t t0 a(τ)dτ, and w(t) = w(t0) a(t) a(t0)e R t t0 a(τ)dτ. (4) Therefore the conditions of the corollary are satisfied whenever w(t) is of the form (4) and a : R+ → R+ is a continuous, positive function with a(t) ≥r′(t) r(t) . Note that the expression of w is defined up to the constant w(t0), which reflects the fact that the condition of the corollary is scale-invariant (if the condition holds for a function w, then it holds for αw for all α > 0). Example 1. Let r(t) = t2. Then r′(t)/r(t) = 2/t, and we can take a(t) = β t with β ≥2. Then w(t) = a(t) a(t0)e R t t0 a(τ)dτ = β/t β/t0 eβ ln(t/t0) = (t/t0)β−1 and η(t) = w(t)r(t) W (t) = βt, and we recover the weighting scheme used in [11]. Example 2. More generally, if r(t) = tp, p ≥1, then r′(t)/r(t) = p/t, and we can take a(t) = β t with β ≥p. Then w(t) = (t/t0)β−1, and η(t) = w(t)r(t) W (t) = βtp−1. We also exhibit in the following a second energy function that is guaranteed to decrease under the same conditions. This energy function, unlike the Lyapunov function Lr, does not guarantee a specific convergence rate. However, it captures a natural measure of energy in the system. To define this energy function, we will use the following characterization of the inverse mirror map: By duality of the subdifferentials (e.g. Theorem 23.5 in [18]), we have for a pair of convex conjugate functions ψ and ψ∗that x ∈∂ψ∗(x∗) if and only if x∗∈∂ψ(x). To simplify the discussion, we will assume that ψ is also differentiable, so that (∇ψ∗)−1 = ∇ψ (this assumption can be relaxed). In what follows, we will denote by ˇX = ∇ψ(X) and ˇZ = ∇ψ∗(Z). 4 Theorem 3. Let (X(t), Z(t)) be the unique maximal solution of AMDw,η, and let ˇX = ∇ψ(X). Consider the energy function Er(t) = f(X(t)) + 1 r(t)Dψ∗(Z(t), ˇ X(t)). (5) Then if w, η satisfy condition (2) of Theorem 2, Er is a decreasing function of time. Proof. To make the notation more concise, we omit the explicit dependence on time in this proof. We have Dψ∗(Z, ˇX) = ψ∗(Z) −ψ∗( ˇX) − X, Z −ˇX . Taking the time-derivative , we have d dtDψ∗(Z, ˇ X) = D ∇ψ∗(Z), ˙Z E − D ∇ψ∗( ˇ X), ˙ˇ X E − D ˙X, Z −ˇ X E − D X, ˙Z −˙ˇ X E = D ∇ψ∗(Z) −X, ˙Z E − D ˙X, Z −ˇ X E . Using the second equation in AMD′ w,η, we have ∇ψ∗(Z) −X = 1 a ˙X, and D ˙X, Z −ˇX E = a ∇ψ∗(Z) −∇ψ∗( ˇX), Z −ˇX ≥ 0 by monotonicity of ∇ψ∗. Combining, we have d dtDψ∗(Z, ˇX) ≤−η a D ˙X, ∇f(X) E , and we can finally bound the derivative of Er: d dtEr(t) = D ∇f(X), ˙X E + 1 r d dtDψ∗(Z, ˇ X) −r′ r2 Dψ∗(Z, ˇ X) ≤ D ∇f(X), ˙X E  1 −η ar  . Therefore condition (2) of Theorem 2 implies that d dtEr(t) ≤0. This energy function can be interpreted, loosely speaking, as the sum of a potential energy given by f(X), and a kinetic energy given by 1 r(t)Dψ∗(Z, ˇX): Indeed, when the problem is unconstrained, then one can take ψ∗(z) = 1 2∥z∥2, in which case ∇ψ∗= ∇ψ = I, the identity, and Dψ∗(Z, ˇX) = 1 2∥ˇZ −X∥2 = 1 2∥ ˙X a ∥2, a quantity proportional to the kinetic energy. 3 Primal Representation and Example Dynamics An equivalent primal representation can be obtained by rewriting the equations in terms of ˇZ = ∇ψ∗(Z) and its derivatives ( ˇZ is a primal variable that remains in X, since ∇ψ∗maps into X). In this section, we assume that ψ∗is twice differentiable on E∗. Taking the time derivative of ˇZ(t) = ∇ψ∗(Z(t)), we have ˙ˇZ(t) = ∇2ψ∗(Z(t)) ˙Z(t) = −η(t)∇2ψ∗◦∇ψ( ˇZ(t))∇f(X(t)), where ∇2ψ∗(z) is the Hessian of ψ∗at z, defined as ∇2ψ∗(z)ij = ∂2ψ∗(z) ∂zj∂zi . Then using the averaging expression for X, we can write AMDw,η in the following primal form AMDp w,η    ˙ˇZ(t) = −η(t)∇2ψ∗◦∇ψ( ˇZ(t))∇f  x0W (t0)+ R t t0 w(τ) ˇ Z(τ)dτ W (t)  ˇZ(t0) = x0. (6) A similar derivation can be made for the mirror descent ODE without acceleration, which can be written as follows [11] (see also the original derivation of Nemirovski and Yudin in Chapter 3 in [13]) MD      ˙Z(t) = −∇f(X(t)) X(t) = ∇ψ∗(Z(t)) X(t0) = x0. Note that this can be interpreted as a limit case of AMDη,w with η(t) ≡1 and w(t) a Dirac function at t. Taking the time derivative of X(t) = ∇ψ∗(Z(t)), we have ˙X(t) = ∇2ψ∗(Z(t)) ˙Z(t), which leads to the primal form of the mirror descent ODE MDp ( ˙X(t) = −∇2ψ∗◦∇ψ(X(t))∇f(X(t)) X(t0) = x0. (7) 5 The operator ∇2ψ∗◦∇ψ appears in both primal representations (6) and (7), and multiplies the gradient of f. It can be thought of as a transformation of the gradient which ensures that the primal trajectory remains in the feasible set, this is illustrated in the supplementary material. For some choices of ψ, ∇2ψ∗◦∇ψ has a simple expression. We give two examples below. We also observe that in its primal form, AMDp w,η is a generalization of the ODE family studied in [23], which can be written as d dt∇ψ(X(t) + e−α(t) ˙X(t)) = −eα(t)+β(t)∇f(X(t)), for which they prove the convergence rate O(e−β(t)). This corresponds to setting, in our notation, a(t) = eα(t), r(t) = eβ(t) and taking η(t) = a(t)r(t) (which corresponds to the condition of Corollary 1). Positive-orthant-constrained dynamics Suppose that X is the positive orthant Rn +, and consider the negative entropy function ψ(x) = P i xi ln xi. Then its dual is ψ∗(z) = P i ezi−1, and we have ∇ψ(x)i = 1 + ln xi and ∇2ψ∗(z)i,j = δj i ezi−1, where δj i is 1 if i = j and 0 otherwise. Thus for all x ∈Rn +, ∇2ψ∗◦∇ψ(x) = diag(x). Therefore, the primal forms (7) and (6), reduce to, respectively, ∀i, ˙Xi = −Xi∇f(X)i X(0) = x0 ( ∀i, ˙ˇZi = −η(t) ˇZi∇f(X)i ˇZ(t0) = x0 where for the second ODE we write X compactly to denote the weighted average given by the second equation of AMDw,η. When f is affine, the mirror descent ODE lead to Lotka-Volterra equation which has applications in economics and ecology. For the mirror descent ODE, one can verify that the solution remains in the positive orthant since ˙X tends to 0 as Xi approaches the boundary of the feasible set. Similarly for the accelerated version, ˙ˇZ tends to 0 as ˇZ approaches the boundary, thus ˇZ remains feasible, and so does X by convexity. Simplex-constrained dynamics: the replicator equation. Now suppose that X is the n-simplex, X = ∆= {x ∈Rn + : Pn i=1 xi = 1}. Consider the distance-generating function ψ(x) = Pn i=1 xi ln xi + δX (x), where δX (·) is the convex indicator function of the feasible set. Then its conjugate is ψ∗(z) = ln (Pn i=1 ezi), defined on E∗, and we have ∇ψ(x)i = 1 + ln xi, ∇ψ∗(z)i = ezi P k ezk , and ∇2ψ∗(z)ij = δj i ezi P k ezk − eziezj ( P k ezk) 2 . Then it is simple to calculate ∇2ψ∗◦∇ψ(x)ij = δj i xi P k xk − xixj ( P k xk) 2 = δj i xi −xixj. Therefore, the primal forms (7) and (6) reduce to, respectively, ( ∀i, ˙Xi + Xi (∇f(X)i −⟨X, ∇f(X)⟩) = 0 X(0) = x0 ( ∀i, ˙ˇZi + η(t) ˇZi ∇f(X)i − ˇZ, ∇f(X)  = 0 ˇZ(0) = x0. The first ODE is known as the replicator dynamics [19], and has many applications in evolutionary game theory [22] and viability theory [4], among others. See the supplementary material for additional discussion on the interpretation and applications of the replicator dynamics. This example shows that the replicator dynamics can be accelerated simply by performing the original replicator update on the variable ˇZ, in which (i) the gradient of the objective function is scaled by η(t) at time t, and (ii) the gradient is evaluated at X(t), the weighted average of the ˇZ trajectory. 4 Adaptive Averaging Heuristic In this section, we propose an adaptive averaging heuristic for adaptively computing the weights w. Note that in Corollary 1, we simply set a(t) = η(t) r(t) so that D ∇f(X(t)), ˙X(t) E  r(t) −η(t) a(t)  is identically zero (thus trivially satisfying condition (2) of Theorem 2). However, from the bound (3), if this term is negative, then this helps further decrease the Lyapunov function Lr (as well as the energy function Er). A simple strategy is then to adaptively choose a(t) as follows ( a(t) = η(t) r(t) if D ∇f(X(t)), ˙X(t) E > 0, a(t) ≥η(t) r(t) otherwise. (8) If we further have η(t) ≥r′(t), then the conditions of Theorem 2 and Theorem 3 are satisfied, which guarantee that Lr is a Lyapunov function and that the energy Er decreases. In particular, such a heuristic would preserve the convergence rate r(t) by Theorem 2. 6 We now propose a discrete version of the heuristic when r(t) = t2. We consider the quadratic rate in particular since in this case the discretization proposed by [11] preserves the quadratic rate, and corresponds to a first-order accelerated method2 for which many heuristics have been developed, such as the restarting heuristics [17, 20] discussed in the introduction. To satisfy condition (1) of Theorem 2, we choose η(t) = βt with β ≥2. Note that in this case, η(t) r(t) = β t . In the supplementary material, we propose a discretization of the heuristic (8), using the correspondance t = k√s, for a step size s. The resulting algorithm is summarized in Algorithm 1, where ψ∗is a smooth distance generating function, and R is a regularizer assumed to be strongly convex and smooth. We give a bound on the convergence rate of Algorithm 1 in the supplementary material. The proof relies on a discrete counterpart of the Lyapunov function Lr. The algorithm keeps ak = ak−1 whenever f(˜x(k+1)) ≤f(˜x(k)), and sets ak to β k√s otherwise. This results in a non-increasing sequence ak. It is worth observing that in continuous time, from the expression (4), a constant a(t) over an interval [t1, t2] corresponds to an exponential increase in the weight w(t) over that interval, while a(t) = β t corresponds to a polynomial increase w(t) = (t/t0)β−1. Intuitively, adaptive averaging increases the weights w(t) on portions of the trajectory which make progress. Algorithm 1 Accelerated mirror descent with adaptive averaging 1: Initialize ˜x(0) = x0, ˇz(0) = x0, a1 = β √s 2: for k ∈N do 3: ˇz(k+1) = arg minˇz∈X βks D ∇f(x(k)), ˇz E + Dψ(ˇz, ˇz(k)). 4: ˜x(k+1) = arg min˜x∈X γs D ∇f(x(k)), ˜x E + R(˜x, x(k)) 5: x(k+1) = λk+1ˇz(k+1) + (1 −λk+1)˜x(k+1), with λk = √sak 1+√sak . 6: ak = min  ak−1, βmax k√s  7: if f(˜x(k+1)) −f(˜x(k)) > 0 then 8: ak = β k√s 5 Numerical Experiments In this section, we compare our adaptive averaging heuristic (in its discrete version given in Algorithm 1) to existing restarting heuristics. We consider simplex-constrained problems and take the distance generating function ψ to be the entropy function, so that the resulting algorithm is a discretization of the accelerated replicator ODE studied in Section 3. We perform the experiments in R3 so that we can visualize the solution trajectories (the supplementary material contains additional experiments in higher dimension). We consider different objective functions: A strongly convex quadratic given by f(x) = (x −s)T A(x −s) for a positive definite matrix A, a weakly convex quadratic, a linear function f(x) = cT x, and the Kullback-Leibler divergence, f(x) = DKL(x⋆, x). We compare the following methods: 1. The original accelerated mirror descent method (in which the weights follow a predetermined schedule given by ak = β k√s), 2. Our adaptive averaging, in which ak is computed adaptively following Algorithm 1, 3. The gradient restarting heuristic in [17], in which the algorithm is restarted from the current point whenever ∇f(x(k)), x(k+1) −x(k) > 0, 4. The speed restarting heuristic in [20], in which the algorithm is restarted from the current point whenever ∥x(k+1) −x(k)∥≤∥x(k) −x(k−1)∥. The results are shown in Figure 2. Each subfigure is divided into four plots: Clockwise from the top left, we show the value of the objective function, the trajectory on the simplex, the value of the energy function Er and the value of the Lyapunov function Lr. 2For faster rates r(t) = tp, p > 2, it is possible to discretize the ODE and preserve the convergence rate, as proposed by Wibisono et al. [23], however this discretization results in a higher-order method such as Nesterov’s cubic accelerated Newton method [16]. 7 The experiments show that adaptive averaging compares favorably to the restarting heuristics on all these examples, with a significant improvement in the strongly convex case. Additionally, the experiments confirm that under the adaptive averaging heuristic, the Lyapunov function is decreasing. This is not the case for the restarting heuristics as can be seen on the weakly convex example. It is interesting to observe, however, that the energy function Er is non-increasing for all the methods in our experiments. If we interpret the energy as the sum of a potential and a kinetic term, then this could be explained intuitively by the fact that restarting keeps the potential energy constant, and decreases the kinetic energy (since the velocity is reset to zero). It is also worth observing that even though the Lyapunov function Lr is non-decreasing, it will not necessarily converge to 0 when there is more than one minimizer (its limit will depend on the choice of z⋆in the definition of Lr). Finally, we observe that the methods have a different qualitative behavior: The original accelerated method typically exhibits oscillations around the set of minimizers. The heuristics alleviate these oscillations in different ways: Intuitively, adaptive averaging acts by increasing the weights on portions of the trajectory which make the most progress, while the restarting heuristics reset the velocity to zero whenever the algorithm detects that the trajectory is moving in a bad direction. The speed restarting heuristic seems to be more conservative in that it restarts more frequently. (a) Strongly convex quadratic. (b) Weakly convex function. (c) Linear function. (d) KL divergence. Figure 2: Examples of accelerated descent with adaptive averaging and restarting. 6 Conclusion Motivated by the averaging formulation of accelerated mirror descent, we studied a family of ODEs with a generalized averaging scheme, and gave simple sufficient conditions on the weight functions to guarantee a given convergence rate in continuous time. We showed as an example how the replicator ODE can be accelerated by averaging. Our adaptive averaging heuristic preserves the convergence rate (since it preserves the Lyapunov function), and it seems to perform at least as well as other heuristics for first-order accelerated methods, and in some cases considerably better. This encourages further investigation into the performance of this adaptive averaging, both theoretically (by attempting to prove faster rates, e.g. for strongly convex functions), and numerically, by testing it on other methods, such as the higher-order accelerated methods proposed in [23]. 8 References [1] H. Attouch and J. Peypouquet. The rate of convergence of nesterov’s accelerated forwardbackward method is actually faster than 1/k2. SIAM Journal on Optimization, 26(3):1824–1834, 2016. [2] H. Attouch, J. Peypouquet, and P. Redont. Fast convergence of an inertial gradient-like system with vanishing viscosity. CoRR, abs/1507.04782, 2015. [3] H. Attouch, J. Peypouquet, and P. Redont. Fast convex optimization via inertial dynamics with hessian driven damping. CoRR, abs/1601.07113, 2016. [4] J.-P. Aubin. Viability Theory. Birkhauser Boston Inc., Cambridge, MA, USA, 1991. [5] A. Bloch, editor. Hamiltonian and gradient flows, algorithms, and control. American Mathematical Society, 1994. [6] A. A. Brown and M. C. Bartholomew-Biggs. Some effective methods for unconstrained optimization based on the solution of systems of ordinary differential equations. Journal of Optimization Theory and Applications, 62(2):211–224, 1989. [7] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. J. Mach. Learn. Res., 12:2121–2159, July 2011. [8] N. Flammarion and F. R. Bach. From averaging to acceleration, there is only a step-size. In 28th Conference on Learning Theory, COLT, pages 658–695, 2015. [9] U. Helmke and J. Moore. Optimization and dynamical systems. Communications and control engineering series. Springer-Verlag, 1994. [10] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations (ICLR), 2014. [11] W. Krichene, A. Bayen, and P. Bartlett. Accelerated mirror descent in continuous and discrete time. In NIPS, 2015. [12] A. Lyapunov. General Problem of the Stability Of Motion. Control Theory and Applications Series. Taylor & Francis, 1992. [13] A. S. Nemirovsky and D. B. Yudin. Problem Complexity and Method Efficiency in Optimization. Wiley-Interscience series in discrete mathematics. Wiley, 1983. [14] Y. Nesterov. A method of solving a convex programming problem with convergence rate o(1/k2). Soviet Mathematics Doklady, 27(2):372–376, 1983. [15] Y. Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103 (1):127–152, 2005. [16] Y. Nesterov. Accelerating the cubic regularization of newton’s method on convex problems. Mathematical Programming, 112(1):159–181, 2008. [17] B. O’Donoghue and E. Candès. Adaptive restart for accelerated gradient schemes. Foundations of Computational Mathematics, 15(3):715–732, 2015. ISSN 1615-3375. [18] R. Rockafellar. Convex Analysis. Princeton University Press, 1970. [19] K. Sigmund. Complexity, Language, and Life: Mathematical Approaches, chapter A Survey of Replicator Equations, pages 88–104. Springer Berlin Heidelberg, Berlin, Heidelberg, 1986. [20] W. Su, S. Boyd, and E. Candès. A differential equation for modeling Nesterov’s accelerated gradient method: Theory and insights. In NIPS, 2014. [21] G. Teschl. Ordinary differential equations and dynamical systems, volume 140. American Mathematical Soc., 2012. [22] J. W. Weibull. Evolutionary game theory. MIT press, 1997. [23] A. Wibisono, A. C. Wilson, and M. I. Jordan. A variational perspective on accelerated methods in optimization. CoRR, abs/1603.04245, 2016. 9
2016
59
6,518
Collaborative Recurrent Autoencoder: Recommend while Learning to Fill in the Blanks Hao Wang, Xingjian Shi, Dit-Yan Yeung Hong Kong University of Science and Technology {hwangaz,xshiab,dyyeung}@cse.ust.hk Abstract Hybrid methods that utilize both content and rating information are commonly used in many recommender systems. However, most of them use either handcrafted features or the bag-of-words representation as a surrogate for the content information but they are neither effective nor natural enough. To address this problem, we develop a collaborative recurrent autoencoder (CRAE) which is a denoising recurrent autoencoder (DRAE) that models the generation of content sequences in the collaborative filtering (CF) setting. The model generalizes recent advances in recurrent deep learning from i.i.d. input to non-i.i.d. (CF-based) input and provides a new denoising scheme along with a novel learnable pooling scheme for the recurrent autoencoder. To do this, we first develop a hierarchical Bayesian model for the DRAE and then generalize it to the CF setting. The synergy between denoising and CF enables CRAE to make accurate recommendations while learning to fill in the blanks in sequences. Experiments on real-world datasets from different domains (CiteULike and Netflix) show that, by jointly modeling the order-aware generation of sequences for the content information and performing CF for the ratings, CRAE is able to significantly outperform the state of the art on both the recommendation task based on ratings and the sequence generation task based on content information. 1 Introduction With the high prevalence and abundance of Internet services, recommender systems are becoming increasingly important to attract users because they can help users make effective use of the information available. Companies like Netflix have been using recommender systems extensively to target users and promote products. Existing methods for recommender systems can be roughly categorized into three classes [13]: content-based methods that use the user profiles or product descriptions only, collaborative filtering (CF) based methods that use the ratings only, and hybrid methods that make use of both. Hybrid methods using both types of information can get the best of both worlds and, as a result, usually outperform content-based and CF-based methods. Among the hybrid methods, collaborative topic regression (CTR) [20] was proposed to integrate a topic model and probabilistic matrix factorization (PMF) [15]. CTR is an appealing method in that it produces both promising and interpretable results. However, CTR uses a bag-of-words representation and ignores the order of words and the local context around each word, which can provide valuable information when learning article representation and word embeddings. Deep learning models like convolutional neural networks (CNN) which use layers of sliding windows (kernels) have the potential of capturing the order and local context of words. However, the kernel size in a CNN is fixed during training. To achieve good enough performance, sometimes an ensemble of multiple CNNs with different kernel sizes has to be used. A more natural and adaptive way of modeling text sequences would be to use gated recurrent neural network (RNN) models [8, 3, 18]. A gated RNN takes in one 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. word (or multiple words) at a time and lets the learned gates decide whether to incorporate or to forget the word. Intuitively, if we can generalize gated RNNs to the CF setting (non-i.i.d.) to jointly model the generation of sequences and the relationship between items and users (rating matrices), the recommendation performance could be significantly boosted. Nevertheless, very few attempts have been made to develop feedforward deep learning models for CF, let alone recurrent ones. This is due partially to the fact that deep learning models, like many machine learning models, assume i.i.d. inputs. [16, 6, 7] use restricted Boltzmann machines and RNN instead of the conventional matrix factorization (MF) formulation to perform CF. Although these methods involve both deep learning and CF, they actually belong to CF-based methods because they do not incorporate the content information like CTR, which is crucial for accurate recommendation. [14] uses low-rank MF in the last weight layer of a deep network to reduce the number of parameters, but it is for classification instead of recommendation tasks. There have also been nice explorations on music recommendation [10, 25] in which a CNN or deep belief network (DBN) is directly used for content-based recommendation. However, the models are deterministic and less robust since the noise is not explicitly modeled. Besides, the CNN is directly linked to the ratings making the performance suffer greatly when the ratings are sparse, as will be shown later in our experiments. Very recently, collaborative deep learning (CDL) [23] is proposed as a probabilistic model for joint learning of a probabilistic stacked denoising autoencoder (SDAE) [19] and collaborative filtering. However, CDL is a feedforward model that uses bag-of-words as input and it does not model the order-aware generation of sequences. Consequently, the model would have inferior recommendation performance and is not capable of generating sequences at all, which will be shown in our experiments. Besides order-awareness, another drawback of CDL is its lack of robustness (see Section 3.1 and 3.5 for details). To address these problems, we propose a hierarchical Bayesian generative model called collaborative recurrent autoencoder (CRAE) to jointly model the order-aware generation of sequences (in the content information) and the rating information in a CF setting. Our main contributions are: • By exploiting recurrent deep learning collaboratively, CRAE is able to sophisticatedly model the generation of items (sequences) while extracting the implicit relationship between items (and users). We design a novel pooling scheme for pooling variable-length sequences into fixed-length vectors and also propose a new denoising scheme to effectively avoid overfitting. Besides for recommendation, CRAE can also be used to generate sequences on the fly. • To the best of our knowledge, CRAE is the first model that bridges the gap between RNN and CF, especially with respect to hybrid methods for recommender systems. Besides, the Bayesian nature also enables CRAE to seamlessly incorporate other auxiliary information to further boost the performance. • Extensive experiments on real-world datasets from different domains show that CRAE can substantially improve on the state of the art. 2 Problem Statement and Notation Similar to [20], the recommendation task considered in this paper takes implicit feedback [9] as the training and test data. There are J items (e.g., articles or movies) in the dataset. For item j, there is a corresponding sequence consisting of Tj words where the vector e(j) t specifies the t-th word using the 1-of-S representation, i.e., a vector of length S with the value 1 in only one element corresponding to the word and 0 in all other elements. Here S is the vocabulary size of the dataset. We define an I-by-J binary rating matrix R = [Rij]I×J where I denotes the number of users. For example, in the CiteULike dataset, Rij = 1 if user i has article j in his or her personal library and Rij = 0 otherwise. Given some of the ratings in R and the corresponding sequences of words e(j) t (e.g., titles of articles or plots of movies), the problem is to predict the other ratings in R. In the following sections, e′(j) t denotes the noise-corrupted version of e(j) t and (h(j) t ; s(j) t ) refers to the concatenation of the two KW -dimensional column vectors. All input weights (like Ye and Yi e) and recurrent weights (like We and Wi e) are of dimensionality KW -by-KW . The output state h(j) t , gate units (e.g., ho t (j)), and cell state s(j) t are of dimensionality KW . K is the dimensionality of the final representation γj, middle-layer units θj, and latent vectors vj and ui. IK or IKW denotes a K-by-K or KW -by-KW identity matrix. For convenience we use W+ to denote the collection of all weights and biases. Similarly h+ t is used to denote the collection of ht, hi t, hf t , and ho t. 2 h1 h1 h2 h2 h3 h3 h4 h4 h5 h5 s1s1 s2s2 s3s3 s4s4 s5s5 e0 1 e0 1 e0 2 e0 2 e1 e1 e2 e2 µ ° v J I R u ¸u ¸u ¸v ¸v J I E E0 E0 ¸w ¸w W+ W+ v R u ¸u ¸u µ A $ A B $ ¸v ¸v <?> Figure 1: On the left is the graphical model for an example CRAE where Tj = 2 for all j. To prevent clutter, the hyperparameters for beta-pooling, all weights, biases, and links between ht and γ are omitted. On the right is the graphical model for the degenerated CRAE. An example recurrent autoencoder with Tj = 3 is shown. ‘⟨?⟩’ is the ⟨wildcard⟩and ‘$’ marks the end of a sentence. E′ and E are used in place of [e′(j) t ]Tj t=1 and [e(j) t ]Tj t=1 respectively. 3 Collaborative Recurrent Autoencoder In this section we will first propose a generalization of the RNN called robust recurrent networks (RRN), followed by the introduction of two key concepts, wildcard denoising and beta-pooling, in our model. After that, the generative process of CRAE is provided to show how to generalize the RRN as a hierarchical Bayesian model from an i.i.d. setting to a CF (non-i.i.d.) setting. 3.1 Robust Recurrent Networks One problem with RNN models like long short-term memory networks (LSTM) is that the computation is deterministic without taking the noise into account, which means it is not robust especially with insufficient training data. To address this robustness problem, we propose RRN as a type of noisy gated RNN. In RRN, the gates and other latent variables are designed to incorporate noise, making the model more robust. Note that unlike [4, 5], the noise in RRN is directly propagated back and forth in the network, without the need for using separate neural networks to approximate the distributions of the latent variables. This is much more efficient and easier to implement. Here we provide the generative process of RRN. Using t = 1 . . . Tj to index the words in the sequence, we have (we drop the index j for items for notational simplicity): xt−1 ∼N(Wwet−1, λ−1 s IKW ), at−1 ∼N(Yxt−1 + Wht−1 + b, λ−1 s IKW ) (1) st ∼N(σ(hf t−1) ⊙st−1 + σ(hi t−1) ⊙σ(at−1), λ−1 s IKW ), (2) where xt is the word embedding of the t-th word, Ww is a KW -by-S word embedding matrix, et is the 1-of-S representation mentioned above, ⊙stands for the element-wise product operation between two vectors, σ(·) denotes the sigmoid function, st is the cell state of the t-th word, and b, Y, and W denote the biases, input weights, and recurrent weights respectively. The forget gate units hf t and the input gate units hi t in Equation (2) are drawn from Gaussian distributions depending on their corresponding weights and biases Yf, Wf, Yi, Wi, bf, and bi: hf t ∼N(Yfxt + Wfht + bf, λ−1 s IKW ), hi t ∼N(Yixt + Wiht + bi, λ−1 s IKW ). The output ht depends on the output gate ho t which has its own weights and biases Yo, Wo, and bo: ho t ∼N(Yoxt + Woht + bo, λ−1 s IKW ), ht ∼N(tanh(st) ⊙σ(ho t−1), λ−1 s IKW ). (3) In the RRN, information of the processed sequence is contained in the cell states st and the output states ht, both of which are column vectors of length KW . Note that RRN can be seen as a generalized and Bayesian version of LSTM [1]. Similar to [18, 3], two RRNs can be concatenated to form an encoder-decoder architecture. 3.2 Wildcard Denoising Since the input and output are identical here, unlike [18, 3] where the input is from the source language and the output is from the target language, this naive RRN autoencoder can suffer from serious overfitting, even after taking noise into account and reversing sequence order (we find that 3 reversing sequence order in the decoder [18] does not improve the recommendation performance). One natural way of handling it is to borrow ideas from the denoising autoencoder [19] by randomly dropping some of the words in the encoder. Unfortunately, directly dropping words may mislead the learning of transition between words. For example, if we drop the word ‘is’ in the sentence ‘this is a good idea’, the encoder will wrongly learn the subsequence ‘this a’, which never appears in a grammatically correct sentence. Here we propose another denoising scheme, called wildcard denoising, where a special word ‘⟨wildcard⟩’ is added to the vocabulary and we randomly select some of the words and replace them with ‘⟨wildcard⟩’. This way, the encoder RRN will take ‘this ⟨wildcard⟩a good idea’ as input and successfully avoid learning wrong subsequences. We call this denoising recurrent autoencoder (DRAE). Note that the word ‘⟨wildcard⟩’ also has a corresponding word embedding. Intuitively this wildcard denoising RRN autoencoder learns to fill in the blanks in sentences automatically. We find this denoising scheme much better than the naive one. For example, in dataset CiteULike wildcard denoising can provide a relative accuracy boost of about 20%. 3.3 Beta-Pooling The RRN autoencoders would produce a representation vector for each input word. In order to facilitate the factorization of the rating matrix, we need to pool the sequence of vectors into one single vector of fixed length 2KW before it is further encoded into a K-dimensional vector. A natural way is to use a weighted average of the vectors. Unfortunately different sequences may need weights of different size. For example, pooling a sequence of 8 vectors needs a weight vector with 8 entries while pooling a sequence of 50 vectors needs one with 50 entries. In other words, we need a weight vector of variable length for our pooling scheme. To tackle this problem, we propose to use a beta distribution. If six vectors are to be pooled into one single vector (using weighted average), we can use the area wp in the range ( p−1 6 , p 6) of the x-axis of the probability density function (PDF) for the beta distribution Beta(a, b) as the pooling weight. Then the resulting pooling weight vector becomes y = (w1, . . . , w6)T . Since the total area is always 1 and the x-axis is bounded, the beta distribution is perfect for this type of variable-length pooling (hence the name beta-pooling). If we set the hyperparameters a = b = 1, it will be equivalent to average pooling. If a is set large enough and b > a the PDF will peak slightly to the left of x = 0.5, which means that the last time step of the encoder RRN is directly used as the pooling result. With only two parameters, beta-pooling is able to pool vectors flexibly enough without having the risk of overfitting the data. 3.4 CRAE as a Hierarchical Bayesian Model Following the notation in Section 2 and using the DRAE in Section 3.2 as a component, we then provide the generative process of the CRAE (note that t indexes words or time steps, j indexes sentences or documents, and Tj is the number of words in document j): Encoding (t = 1, 2, . . . , Tj): Generate x′(j) t−1, a(j) t−1, and s(j) t according to Equation (1)-(2). Compression and decompression (t = Tj + 1): θj ∼N(W1(h(j) Tj ; s(j) Tj ) + b1, λ−1 s IK), (h(j) Tj+1; s(j) Tj+1) ∼N(W2 tanh(θj) + b2, λ−1 s I2KW ). (4) Decoding (t = Tj + 2, Tj + 3, . . . , 2Tj + 1): Generate a(j) t−1, s(j) t , and h(j) t according to Equation (1)-(3), after which generate: e(j) t−Tj−2 ∼Mult(softmax(Wgh(j) t + bg)). Beta-pooling and recommendation: γj ∼N(tanh(W1fa,b({(h(j) t ; s(j) t )}t) + b1), λ−1 s IK) (5) vj ∼N(γj, λ−1 v IK), ui ∼N(0, λ−1 u IK), Rij ∼N(uT i vj, C−1 ij ). Note that each column of the weights and biases in W+ is drawn from N(0, λ−1 w IKW ) or N(0, λ−1 w IK). In the generative process above, the input gate hi t−1 (j) and the forget gate hf t−1 (j) can be drawn as described in Section 3.1. e′(j) t denotes the corrupted word (with the embedding 4 x′(j) t ) and e(j) t denotes the original word (with the embedding x(j) t ). λw, λu, λs, and λv are hyperparameters and Cij is a confidence parameter (Cij = α if Rij = 1 and Cij = β otherwise). Note that if λs goes to infinity, the Gaussian distribution (e.g., in Equation (4)) will become a Dirac delta distribution centered at the mean. The compression and decompression act like a bottleneck between two Bayesian RRNs. The purpose is to reduce overfitting, provide necessary nonlinear transformation, and perform dimensionality reduction to obtain a more compact final representation γj for CF. The graphical model for an example CRAE where Tj = 2 for all j is shown in Figure 1(left). fa,b({(h(j) t ; s(j) t )}t) in Equation (5) is the result of beta-pooling with hyperparameters a and b. If we denote the cumulative distribution function of the beta distribution as F(x; a, b), φ(j) t = (h(j) t ; s(j) t ) for t = 1, . . . , Tj, and φ(j) t = (h(j) t+1; s(j) t+1) for t = Tj + 1, . . . , 2Tj, then we have fa,b({(h(j) t ; s(j) t )}t) = P2Tj t=1(F( t 2Tj , a, b) −F( t−1 2Tj , a, b))φt. Please see Section 3 of the supplementary materials for details (including hyperparameter learning) of beta-pooling. From the generative process, we can see that both CRAE and CDL are Bayesian deep learning (BDL) models (as described in [24]) with a perception component (DRAE in CRAE) and a task-specific component. 3.5 Learning According to the CRAE model above, all parameters like h(j) t and vj can be treated as random variables so that a full Bayesian treatment such as methods based on variational approximation can be used. However, due to the extreme nonlinearity and the CF setting, this kind of treatment is non-trivial. Besides, with CDL [23] and CTR [20] as our primary baselines, it would be fairer to use maximum a posteriori (MAP) estimates, which is what CDL and CTR do. End-to-end joint learning: Maximization of the posterior probability is equivalent to maximizing the joint log-likelihood of {ui}, {vj}, W+, {θj}, {γj}, {e(j) t }, {e′(j) t }, {h+ t (j)}, {s(j) t }, and R given λu, λv, λw, and λs: L = log p(DRAE|λs, λw) −λu 2 X i ∥ui∥2 2 −λv 2 X j ∥vj −γj∥2 2 − X i,j Cij 2 (Rij −uT i vj)2 −λs 2 X j ∥tanh(W1fa,b({(h(j) t ; s(j) t )}t) + b1) −γj∥2 2, where log p(DRAE|λs, λw) corresponds to the prior and likelihood terms for DRAE (including the encoding, compression, decompression, and decoding in Section 3.4) involving W+, {θj}, {e(j) t }, {e′(j) t }, {h+ t (j)}, and {s(j) t }. For simplicity and computational efficiency, we can fix the hyperparameters of beta-pooling so that Beta(a, b) peaks slightly to the left of x = 0.5 (e.g., a = 9.8 × 107, b = 1 × 108), which leads to γj = tanh(θj) (a treatment for the more general case with learnable a or b is provided in the supplementary materials). Further, if λs approaches infinity, the terms with λs in log p(DRAE|λs, λw) will vanish and γj will become tanh(W1(h(j) Tj , s(j) Tj )+b1). Figure 1(right) shows the graphical model of a degenerated CRAE when λs approaches positive infinity and b > a (with very large a and b). Learning this degenerated version of CRAE is equivalent to jointly training a wildcard denoising RRN and an encoding RRN coupled with the rating matrix. If λv ≪1, CRAE will further degenerate to a two-step model where the representation θj learned by the DRAE is directly used for CF. On the contrary if λv ≫1, the decoder RRN essentially vanishes. Both extreme cases can greatly degrade the predictive performance, as shown in the experiments. Robust nonlinearity on distributions: Different from [23, 22], nonlinear transformation is performed after adding the noise with precision λs (e.g. a(j) t in Equation (1)). In this case, the input of the nonlinear transformation is a distribution rather than a deterministic value, making the nonlinearity more robust than in [23, 22] and leading to more efficient and direct learning algorithms than CDL. Consider a univariate Gaussian distribution N(x|µ, λ−1 s ) and the sigmoid function σ(x) = 1 1+exp(−x), the expectation (see Section 6 of the supplementary materials for details): E(x) = Z N(x|µ, λ−1 s )σ(x)dx = σ(κ(λs)µ), (6) Equation (6) holds because the convolution of a sigmoid function with a Gaussian distribution can be approximated by another sigmoid function. Similarly, we can approximate σ(x)2 with σ(ρ1(x+ρ0)), 5 where ρ1 = 4 −2 √ 2 and ρ0 = −log( √ 2 + 1). Hence the variance D(x) ≈ Z N(x|µ, λ−1 s ) ◦Φ(ξρ1(x + ρ0))dx −E(x)2 = σ( ρ1(µ + ρ0) (1 + ξ2ρ2 1λ−1 s )1/2 ) −E(x)2 ≈λ−1 s , (7) where we use λ−1 s to approximate D(x) for computational efficiency. Using Equation (6) and (7), the Gaussian distribution in Equation (2) can be computed as: N(σ(hf t−1) ⊙st−1 + σ(hi t−1) ⊙σ(at−1), λ−1 s IKW ) ≈N(σ(κ(λs)h f t−1) ⊙st−1 + σ(κ(λs)h i t−1) ⊙σ(κ(λs)at−1), λ−1 s IKW ), (8) where the superscript (j) is dropped. We use overlines (e.g., at−1 = Yext−1 + Weht−1 + be) to denote the mean of the distribution from which a hidden variable is drawn. By applying Equation (8) recursively, we can compute st for any t. Similar approximation is used for tanh(x) in Equation (3) since tanh(x) = 2σ(2x) −1. This way the feedforward computation of DRAE would be seamlessly chained together, leading to more efficient learning algorithms than the layer-wise algorithms in [23, 22] (see Section 6 of the supplementary materials for more details). Learning parameters: To learn ui and vj, block coordinate ascent can be used. Given the current W+, we can compute γ as γ = tanh(W1fa,b({(h(j) t ; s(j) t )}t) + b1) and get the following update rules: ui ←(VCiVT + λuIK)−1VCiRi vj ←(UCiUT + λvIK)−1(UCjRj + λv tanh(W1fa,b({(h(j) t ; s(j) t )}t) + b1)T ), where U = (ui)I i=1, V = (vj)J j=1, Ci = diag(Ci1, . . . , CiJ) is a diagonal matrix, and Ri = (Ri1, . . . , RiJ)T is a column vector containing all the ratings of user i. Given U and V, W+ can be learned using the back-propagation algorithm according to Equation (6)-(8) and the generative process in Section 3.4. Alternating the update of U, V, and W+ gives a local optimum of L . After U and V are learned, we can predict the ratings as Rij = uT i vj. 4 Experiments In this section, we report some experiments on real-world datasets from different domains to evaluate the capabilities of recommendation and automatic generation of missing sequences. 4.1 Datasets We use two datasets from different real-world domains. CiteULike is from [20] with 5,551 users and 16,980 items (articles with text). Netflix consists of 407,261 users, 9,228 movies, and 15,348,808 ratings after removing users with less than 3 positive ratings (following [23], ratings larger than 3 are regarded as positive ratings). Please see Section 7 of the supplementary materials for details. 4.2 Evaluation Schemes Recommendation: For the recommendation task, similar to [21, 23], P items associated with each user are randomly selected to form the training set and the rest is used as the test set. We evaluate the models when the ratings are in different degrees of density (P ∈{1, 2, . . . , 5}). For each value of P, we repeat the evaluation five times with different training sets and report the average performance. Following [20, 21], we use recall as the performance measure since the ratings are in the form of implicit feedback [9, 12]. Specifically, a zero entry may be due to the fact that the user is not interested in the item, or that the user is not aware of its existence. Thus precision is not a suitable performance measure. We sort the predicted ratings of the candidate items and recommend the top M items for the target user. The recall@M for each user is then defined as: recall@M = # items that the user likes among the top M # items that the user likes . The average recall over all users is reported. 6 1 2 3 4 5 0.1 0.15 0.2 0.25 0.3 0.35 P Recall CRAE CDL CTR DeepMusic CMF SVDFeature 1 2 3 4 5 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 P Recall CRAE CDL CTR DeepMusic CMF SVDFeature 50 100 150 200 250 300 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 M Recall CRAE CDL CTR DeepMusic CMF SVDFeature 50 100 150 200 250 300 0.05 0.1 0.15 0.2 0.25 0.3 M Recall CRAE CDL CTR DeepMusic CMF SVDFeature Figure 2: Performance comparison of CRAE, CDL, CTR, DeepMusic, CMF, and SVDFeature based on recall@M for datasets CiteULike and Netflix. P is varied from 1 to 5 in the first two figures. We also use another evaluation metric, mean average precision (mAP), in the experiments. Exactly the same as [10], the cutoff point is set at 500 for each user. Sequence generation on the fly: For the sequence generation task, we set P = 5. In terms of content information (e.g., movie plots), we randomly select 80% of the items to include their content in the training set. The trained models are then used to predict (generate) the content sequences for the other 20% items. The BLEU score [11] is used to evaluate the quality of generation. To compute the BLEU score in CiteULike we use the titles as training sentences (sequences). Both the titles and sentences in the abstracts of the articles (items) are used as reference sentences. For Netflix, the first sentences of the plots are used as training sentences. The movie names and sentences in the plots are used as reference sentences. A higher BLEU score indicates higher quality of sequence generation. Since CDL, CTR, and PMF cannot generate sequences directly, a nearest neighborhood based approach is used with the resulting vj. Note that this task is extremely difficult because the sequences of the test set are unknown during both the training and testing phases. For this reason, this task is impossible for existing machine translation models like [18, 3]. 4.3 Baselines and Experimental Settings The models for comparison are listed as follows: • CMF: Collective Matrix Factorization [17] is a model incorporating different sources of information by simultaneously factorizing multiple matrices. • SVDFeature: SVDFeature [2] is a model for feature-based collaborative filtering. In this paper we use the bag-of-words as raw features to feed into SVDFeature. • DeepMusic: DeepMusic [10] is a feedforward model for music recommendation mentioned in Section 1. We use the best performing variant as our baseline. • CTR: Collaborative Topic Regression [20] is a model performing topic modeling and collaborative filtering simultaneously as mentioned in the previous section. • CDL: Collaborative Deep Learning (CDL) [23] is proposed as a probabilistic feedforward model for joint learning of a probabilistic SDAE [19] and CF. • CRAE: Collaborative Recurrent Autoencoder is our proposed recurrent model. It jointly performs collaborative filtering and learns the generation of content (sequences). In the experiments, we use 5-fold cross validation to find the optimal hyperparameters for CRAE and the baselines. For CRAE, we set α = 1, β = 0.01, K = 50, KW = 100. The wildcard denoising rate is set to 0.4. See Section 5.1 of the supplementary materials for details. 4.4 Quantitative Comparison Recommendation: The first two plots of Figure 2 show the recall@M for the two datasets when P is varied from 1 to 5. As we can see, CTR outperforms the other baselines except for CDL. Note that as previously mentioned, in both datasets DeepMusic suffers badly from overfitting when the rating matrix is extremely sparse (P = 1) and achieves comparable performance with CTR when the rating matrix is dense (P = 5). CDL as the strongest baseline consistently outperforms other baselines. By jointly learning the order-aware generation of content (sequences) and performing collaborative filtering, CRAE is able to outperform all the baselines by a margin of 0.7% ∼1.9% (a relative boost of 2.0% ∼16.7%) in CiteULike and 3.5% ∼6.0% (a relative boost of 5.7% ∼22.5%) in Netflix. Note that since the standard deviation is minimal (3.38 × 10−5 ∼2.56 × 10−3), it is not included in the figures and tables to avoid clutter. The last two plots of Figure 2 show the recall@M for CiteULike and Netflix when M varies from 50 to 300 and P = 1. As shown in the plots, the performance of DeepMusic, CMF, and SVDFeature is 7 0 0.5 1 0 50 100 150 200 250 (a) 0 0.5 1 0 5 10 15 20 25 (b) 0 0.5 1 0 2 4 6 8 10 (c) 0 0.5 1 0 0.5 1 1.5 2 (d) 0 0.5 1 0 5 10 15 (e) 0 0.5 1 0 2 4 6 8 10 (f) 0 0.5 1 0 5 10 15 20 25 (g) 0 0.5 1 0 50 100 150 200 250 (h) Figure 3: The shape of the beta distribution for different a and b (corresponding to Table 1). Table 1: Recall@300 for beta-pooling with different hyperparameters a 31112 311 1 1 0.4 10 400 40000 b 40000 400 10 1 0.4 1 311 31112 Recall 12.17 12.54 10.48 11.62 11.08 10.72 12.71 12.22 Table 2: mAP for two datasets CRAE CDL CTR DeepMusic CMF SVDFeature CiteULike 0.0123 0.0091 0.0071 0.0058 0.0061 0.0056 Netflix 0.0301 0.0275 0.0211 0.0156 0.0144 0.0173 Table 3: BLEU score for two datasets CRAE CDL CTR PMF CiteULike 46.60 21.14 31.47 17.85 Netflix 48.69 6.90 17.17 11.74 similar in this setting. Again CRAE is able to outperform the baselines by a large margin and the margin gets larger with the increase of M. As shown in Figure 3 and Table 1, we also investigate the effect of a and b in beta-pooling and find that in DRAE: (1) temporal average pooling performs poorly (a = b = 1); (2) most information concentrates near the bottleneck; (3) the right of the bottleneck contains more information than the left. Please see Section 4 of the supplementary materials for more details. As another evaluation metric, Table 2 compares different models based on mAP. As we can see, compared with CDL, CRAE can provide a relative boost of 35% and 10% for CiteULike and Netflix, respectively. Besides quantitative comparison, qualitative comparison of CRAE and CDL is provided in Section 2 of the supplementary materials. In terms of time cost, CDL needs 200 epochs (40s/epoch) while CRAE needs about 80 epochs (150s/epoch) for optimal performance. Sequence generation on the fly: To evaluate the ability of sequence generation, we compute the BLEU score of the sequences (titles for CiteULike and plots for Netflix) generated by different models. As mentioned in Section 4.2, this task is impossible for existing machine translation models like [18, 3] due to the lack of source sequences. As we can see in Table 3, CRAE achieves a BLEU score of 46.60 for CiteULike and 48.69 for Netflix, which is much higher than CDL, CTR and PMF. Incorporating the content information when learning user and item latent vectors, CTR is able to outperform other baselines and CRAE can further boost the BLEU score by sophisticatedly and jointly modeling the generation of sequences and ratings. Note that although CDL is able to outperform other baselines in the recommendation task, it performs poorly when generating sequences on the fly, which demonstrates the importance of modeling each sequence recurrently as a whole rather than as separate words. 5 Conclusions and Future Work We develop a collaborative recurrent autoencoder which can sophisticatedly model the generation of item sequences while extracting the implicit relationship between items (and users). We design a new pooling scheme for pooling variable-length sequences and propose a wildcard denoising scheme to effectively avoid overfitting. To the best of our knowledge, CRAE is the first model to bridge the gap between RNN and CF. Extensive experiments show that CRAE can significantly outperform the state-of-the-art methods on both the recommendation and sequence generation tasks. With its Bayesian nature, CRAE can easily be generalized to seamlessly incorporate auxiliary information (e.g., the citation network for CiteULike and the co-director network for Netflix) for further accuracy boost. Moreover, multiple Bayesian recurrent layers may be stacked together to increase its representation power. Besides making recommendations and guessing sequences on the fly, the wildcard denoising recurrent autoencoder also has potential to solve other challenging problems such as recovering the blurred words in ancient documents. 8 References [1] Y. Bengio, I. J. Goodfellow, and A. Courville. Deep learning. Book in preparation for MIT Press, 2015. [2] T. Chen, W. Zhang, Q. Lu, K. Chen, Z. Zheng, and Y. Yu. SVDFeature: a toolkit for feature-based collaborative filtering. JMLR, 13:3619–3622, 2012. [3] K. Cho, B. van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using RNN encoder-decoder for statistical machine translation. In EMNLP, 2014. [4] J. Chung, K. Kastner, L. Dinh, K. Goel, A. C. Courville, and Y. Bengio. A recurrent latent variable model for sequential data. In NIPS, 2015. [5] O. Fabius and J. R. van Amersfoort. Variational recurrent auto-encoders. arXiv preprint arXiv:1412.6581, 2014. [6] K. Georgiev and P. Nakov. A non-iid framework for collaborative filtering with restricted Boltzmann machines. In ICML, 2013. [7] B. Hidasi, A. Karatzoglou, L. Baltrunas, and D. Tikk. Session-based recommendations with recurrent neural networks. arXiv preprint arXiv:1511.06939, 2015. [8] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, 1997. [9] Y. Hu, Y. Koren, and C. Volinsky. Collaborative filtering for implicit feedback datasets. In ICDM, 2008. [10] A. V. D. Oord, S. Dieleman, and B. Schrauwen. Deep content-based music recommendation. In NIPS, 2013. [11] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. BLEU: a method for automatic evaluation of machine translation. In ACL, 2002. [12] S. Rendle, C. Freudenthaler, Z. Gantner, and L. Schmidt-Thieme. BPR: Bayesian personalized ranking from implicit feedback. In UAI, 2009. [13] F. Ricci, L. Rokach, and B. Shapira. Introduction to Recommender Systems Handbook. Springer, 2011. [14] T. N. Sainath, B. Kingsbury, V. Sindhwani, E. Arisoy, and B. Ramabhadran. Low-rank matrix factorization for deep neural network training with high-dimensional output targets. In ICASSP, 2013. [15] R. Salakhutdinov and A. Mnih. Probabilistic matrix factorization. In NIPS, 2007. [16] R. Salakhutdinov, A. Mnih, and G. E. Hinton. Restricted Boltzmann machines for collaborative filtering. In ICML, 2007. [17] A. P. Singh and G. J. Gordon. Relational learning via collective matrix factorization. In KDD, 2008. [18] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In NIPS, 2014. [19] P. Vincent, H. Larochelle, I. Lajoie, Y. Bengio, and P.-A. Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. JMLR, 11:3371–3408, 2010. [20] C. Wang and D. M. Blei. Collaborative topic modeling for recommending scientific articles. In KDD, 2011. [21] H. Wang, B. Chen, and W.-J. Li. Collaborative topic regression with social regularization for tag recommendation. In IJCAI, 2013. [22] H. Wang, X. Shi, and D. Yeung. Relational stacked denoising autoencoder for tag recommendation. In AAAI, 2015. [23] H. Wang, N. Wang, and D. Yeung. Collaborative deep learning for recommender systems. In KDD, 2015. [24] H. Wang and D. Yeung. Towards Bayesian deep learning: A framework and some existing methods. TKDE, 2016, to appear. [25] X. Wang and Y. Wang. Improving content-based and hybrid music recommendation using deep learning. In ACM MM, 2014. 9
2016
6
6,519
Dynamic Mode Decomposition with Reproducing Kernels for Koopman Spectral Analysis Yoshinobu Kawaharaab a The Institute of Scientific and Industrial Research, Osaka University b Center for Advanced Integrated Intelligence Research, RIKEN ykawahara@sanken.osaka-u.ac.jp Abstract A spectral analysis of the Koopman operator, which is an infinite dimensional linear operator on an observable, gives a (modal) description of the global behavior of a nonlinear dynamical system without any explicit prior knowledge of its governing equations. In this paper, we consider a spectral analysis of the Koopman operator in a reproducing kernel Hilbert space (RKHS). We propose a modal decomposition algorithm to perform the analysis using finite-length data sequences generated from a nonlinear system. The algorithm is in essence reduced to the calculation of a set of orthogonal bases for the Krylov matrix in RKHS and the eigendecomposition of the projection of the Koopman operator onto the subspace spanned by the bases. The algorithm returns a decomposition of the dynamics into a finite number of modes, and thus it can be thought of as a feature extraction procedure for a nonlinear dynamical system. Therefore, we further consider applications in machine learning using extracted features with the presented analysis. We illustrate the method on the applications using synthetic and real-world data. 1 Introduction Modeling nonlinear dynamical systems using data is fundamental in a variety of engineering and scientific fields. In machine learning, the problem of learning dynamical systems has been actively discussed, and several Bayesian approaches have been proposed [11, 34]. In the fields of physics, one popular approach for this purpose is the decomposition methods that factorize the dynamics into modes based on some criterion from the data. For example, proper orthogonal decomposition (POD) (see, for example, [12]), which generates orthogonal modes that optimally capture the vector energy of a given dataset, has been extensively applied to complex phenomena in physics [5, 22] even though this method is currently known to have several drawbacks. The so-called spectral method for dynamical systems [15, 31, 17], which is often discussed in machine learning, is closely related to this type of technique, where one aims to estimate a prediction model rather than understand the dynamics by examining the obtained modes. Among the decomposition techniques, dynamic mode decomposition (DMD) [25, 26] has recently attracted attention in the field of physics, such as flow mechanics, and in engineering, and has been applied to data obtained from complex phenomena [2, 4, 6, 10, 21, 25, 27, 32]. DMD approximates the spectra of the Koopman operator [16], which is an infinite-dimensional linear operator that represents nonlinear and finite-dimensional dynamics without linearization. While POD just finds the principal directions in a dataset, DMD can yield direct information concerning the dynamics such as growth rates and the frequencies of the dynamics. In this paper, we consider a spectral analysis of the Koopman operator in reproducing kernel Hilbert spaces (RKHSs) for a nonlinear dynamical system xt+1 = f(xt), (1) where x ∈M is the state vector on a finite-dimensional manifold M ⊆Rd, and f is a (possibly, nonlinear) state-transition function. We present a modal decomposition algorithm to perform this, 1 which is in principle reduced to the calculation of a set of orthogonal bases for the Krylov matrix in RKHS and the eigendecomposition of the projection of the Koopman operator onto the subspace spanned by the bases. Although existing DMD algorithms can conceptually be thought of as producing an approximation of the eigenfunctions of the Koopman operator using a set of linear monomials of observables (or the pre-determined functional maps of observables) as basis functions, which is analogous to a one-term Taylor expansion at each point, our algorithm gives an approximation with a set of nonlinear basis functions due to the expressiveness of kernel functions. The proposed algorithm provides a modal decomposition of the dynamics into a finite number of modes, and thus it could be considered as a feature extraction procedure for a nonlinear dynamical system. Therefore, we consider applications using extracted features from our analysis such as state prediction, sequential change-point detection, and dynamics recognition. We illustrate our method on the applications using synthetic and real-world data. The remainder of this paper is organized as follows. In Section 2, we briefly review the spectral analysis of nonlinear dynamical systems with the Koopman operator and DMD. In Section 3, we extend the analysis with reproducing kernels, and provide a modal decomposition algorithm to perform this analysis based on the equivalent principle of DMD. Although this method is mathematically correct, a practical implementation could yield an ill-conditioned algorithm. Therefore, in Section 4, we describe a way to robustly it by projecting data onto the POD directions. In Section 5, we describe related works. In Section 6, we show some empirical examples by the proposed algorithm and, in Section 7, we describe several applications using extracted features with empirical results. Finally, we conclude the paper in Section 8. 2 The Koopman Operator and Dynamic Mode Decomposition Consider a discrete-time nonlinear dynamical system (1). The Koopman operator [16], which we denote here by K, is an infinite-dimensional linear operator that acts on a scalar function gi : M →C, mapping gi to a new function Kgi given as follows: (Kgi)(x) = gi ◦f(x), (2) where ◦denotes the composition of gi with f. We see that K acts linearly on the function gi, even though the dynamics defined by f may be nonlinear. Since K is a linear operator, it has, in general, an eigendecomposition Kφj(x) = λjφj(x), (3) where λj ∈C is the j-th eigenvalue (called the Koopman eigenvalue) and φj is the corresponding eigenfunction (called the Koopman eigenfunction). We denote the concatenation of gi as g := [g1, . . . , gp]⊤. If each gi lies within the span of the eigenfunctions φj, we can expand the vectorvalued g in terms of these eigenfunctions as g(x) = ∑∞ j=1φj(x)uj, (4) where uj is a set of vector coefficients called Koopman modes. Then, by the iterative applications of Eqs. (2) and (3), we obtain g ◦f l(x) = ∑∞ j=1λl jφj(x)uj, (5) where f l is the l-time compositions of f. Therefore, λj characterizes the temporal behavior of the corresponding Koopman mode uj, i.e., the phase of λj determines its frequency, and the magnitude determines the growth rate of the dynamics. Note that, for a system evolving on an attractor, the Koopman eigenvalues always lie on a unit circle [20]. DMD [25, 26] (and its variants) is a popular approach for estimating the approximations of λj and uj from a finite-length data sequence y0, y1, . . . , yτ(∈Rp), where we denote yt := g(xt). DMD can fundamentally be considered as a special use of the Arnoldi method [1]. That is, using the empirical Ritz values ˜λj and vectors vj obtained by the Arnoldi method when regarding the subspace spanned by y0, . . . , yτ−1 as the Krylov subspace for y0 (and implicitly for some matrix A ∈Rp×p), it is shown that the observables are expressed as yt = ∑τ j=1˜λt jvj (t = 0, . . . , τ −1), and (6a) yτ = ∑τ j=1˜λτ j vj + r where r ⊥span{y0, . . . , yτ−1}. (6b) Comparing Eq. (6a) with Eq. (5) infers that the empirical Ritz values ˜λj and vectors vj behave in precisely the same manner as the Koopman eigenvalues λj and modes uj (φj(x0)uj), but for the 2 finite sum in Eq. (6a) instead of the infinite sum in Eq. (5). Note that, for r = 0 in Eq. (6b) (which could happen when the data are sufficiently large), the approximate modes are indistinguishable from the true Koopman eigenvalues and modes (as far as the data points are concerned), with the expansion (5) comprising only a finite number of terms. 3 Dynamic Mode Decomposition with Reproducing Kernels As described above, the estimation of the Koopman mode by DMD (and its variants) can capture the nonlinear dynamics from finite-length data sequences generated from a dynamical system. Conceptually, DMD can be considered as producing an approximation of the Koopman eigenfunctions using a set of linear monomials of observables as basis functions, which is analogous to a one-term Taylor expansion at each point. In situations where eigenfunctions can be accurately approximated using linear monomials (e.g., in a small neighborhood of a stable fixed point), DMD will produce an accurate local approximation of the Koopman eigenfunctions. However, this is certainly not applicable to all systems (in particular, beyond the region of validity for local linearization). Here, we extend the Koopman spectral analysis with reproducing kernels to approximate the Koopman eigenfunctions with richer basis functions. We provide a modal decomposition algorithm to perform this analysis based on the equivalent principle with DMD. Let H be the RKHS embedded with the dot product ⟨·, ·⟩H (we abbreviate ⟨·, ·⟩H as ⟨·, ·⟩for simplicity) and a positive definite kernel k. Additionally, let ϕ: M →H. Then, we define the Koopman operator on the feature map ϕ by (KHϕ)(x) = ϕ ◦f(x). (7) Thus, the Koopman operator KH is a linear operator in H. Note that almost of the theoretical claims in this and the next sections do not necessarily require ϕ to be in RKHS (it is sufficient that ϕ stays in a Hilbert space). However, this assumption should perform the calculation in practice (as described in the last parts of this and the next sections). Therefore, we proceed with this assumption in the following parts. We denote by φj the j-th eigenfunction of KH with the corresponding eigenvalue λj. Also, we define Φ := span{ϕ(x): x ∈M}. We first expand the notions, such as the Ritz values and vectors, that appear in DMD with reproducing kernels. Suppose we have a sequence x0, x1, . . . , xτ. The Krylov subspace for ϕ(x0) is defined as the subspace spanned by ϕ(x0), (KHϕ)(x0), . . . , (Kτ−1 H ϕ)(x0). Note that this is identical to the one spanned by ϕ(x0), . . . , ϕ(xτ−1), whose corresponding Krylov matrix is given by Mτ = [ϕ(x0) · · · ϕ(xτ−1)]. (8) Therefore, if we denote a set of τ orthogonal bases of the Krylov subspace by q1, . . . , qτ (∈H) (obtained from the Gram-Schmidt orthogonalization described below), then the orthogonal projection of KH onto Mτ is given by Pτ = Q∗ τKHQτ, where Qτ = [q1 · · · qτ] and Q∗ τ indicates the Hermitian transpose of Qτ. Consequently, the empirical Ritz values and vectors are defined as the eigenvalues and vectors of Pτ, respectively. Now, we have the following theorem: Theorem 1. Consider a sequence ϕ(x0), ϕ(x1), . . . , ϕ(xτ), and let ˜λj and ˜φj be the empirical Ritz values and vectors for this sequence. Assume that ˜λj’s are distinct. Then, we have ϕ(xt) = ∑τ j=1˜λt j ˜φj (t = 0, . . . , τ −1), and (9a) ϕ(xτ) = ∑τ j=1˜λτ j ˜φj + ψ where ψ ⊥span{ϕ(x0), . . . , ϕ(xτ−1)}. (9b) Proof. Let Mτ = QτR (R ∈Cτ×τ) be the Gram-Schmidt QR decomposition of Mτ. Then, the companion matrix (rational canonical form) of Pτ is given as F := R−1PτR. Note that the sets of eigenvalues of Pτ and F are equivalent. Since F is a companion matrix and ˜λj’s are distinct, F can be diagonalized in the form F = T −1˜ΛT, where ˜Λ is a diagonal matrix with ˜λ1, . . . , ˜λτ and T is a Vandermonde matrix defined by Tij = ˜λj−1 i . Therefore, the empirical Ritz vectors ˜φj are obtained as the columns of V = MτT −1. This proves Eq. (9a). Suppose a linear expansion of ϕ(xτ) is represented as ϕ(xτ) = Mτc + ψ where ψ ⊥span{ϕ(x0), . . . , ϕ(xτ−1)}. (10) Since F = R−1PτR = M−1 τ KHMτ (therefore, MτF = KHMτ), the first term is given by the last column of MτF = MτT −1˜ΛT = V ˜ΛT. This proves Eq. (9b). 3 This theorem gives an extension of DMD via the Gram-Schmidt QR decomposition in the feature space. Although in Step (2), the Gram-Schmidt QR orthogonalization is performed in RKHS, this calculation can be reduced to operations on a Gram matrix due to the reproducing property of kernel functions. (1) Define Mτ by Eq. (8) and M+ := [ϕ(x1), . . . , ϕ(xτ)]. (2) Calculate the Gram-Schmidt QR decomposition Mτ = QτR (e.g., refer to Section 5.2 of [29]). (3) Calculate the eigendecomposition of R−1Q∗ τM+(=F) = T −1˜ΛT, where each diagonal element of ˜Λ gives ˜λj. (4) Define ˜φj to be the columns of MτT −1. The original DMD algorithm (and its variants) produce an approximation of the eigenfunctions of the Koopman operator in Eq. (2) using the set of linear monomials of observables as basis functions. In contrast, because the above algorithm works with operations directly in the functional space, the Koopman operator defined in Eq. (7) is identical to the transition operator on an observable. Therefore, the eigenfunctions of the Koopman operator are fully recovered if the Krylov subspace is sufficiently large, i.e., ϕ(xτ) is also in span{ϕ(x0), . . . , ϕ(xτ−1)} (or ψ = 0). 4 Robustifying with POD Bases Although the above decomposition based on the Gram-Schmidt orthogonalization is mathematically correct, a practical implementation could yield an ill-conditioned algorithm that is often incapable of extracting multiple modes. A similar issue has been well known for DMD [26], where one needs to adopt a way to robustify DMD by projecting data onto the (truncated) POD directions [8, 33]. Here, we discuss a similar modification of our principle with the POD basis. First, consider kernel PCA [28] on x0, x1, . . . , xτ−1: Let ¯G = BSB∗be the eigen-decomposition of the centered Gram matrix ¯G = HGH = G −1τG −G1τ + 1τG1τ, where G = M∗ τMτ is the Gram matrix for the data, H = I −1τ and 1τ is a τ-by-τ matrix for which each element takes the value 1/τ. Suppose the eigenvalues and eigenvectors can be truncated accordingly based on the magnitudes of the eigenvalues, which results in ¯G ≈¯B ¯S ¯B∗where p (≤τ) eigenvalues are adopted. Denote the j-th column of ¯B by βj and let ¯ϕ(xi)=ϕ(xi)−ϕc, where ϕc= ∑τ−1 j=0 ϕ(xj). A principal orthogonal direction in the feature space is then given by νj = ∑τ−1 i=0 αj,i ¯ϕ(xi) = MτHαj (j = 1, . . . , p), where αj = ¯S−1/2 jj βj. Let U = [ν1, . . . , νp] (= MτH ¯B ¯S−1/2). Since M+ = KHMτ, the projection of KH onto the space spanned by νj is given as ˆF := U∗KHU = ¯S−1/2 ¯B∗H(M∗ τM+)H ¯B ¯S−1/2. (11) Note that the (i, j)-the element of the matrix (M∗ τM+) is given by k(xi−1, xj). Then, if we let ˆF = ˆT −1ˆΛ ˆT be the eigendecomposition of ˆF, then ¯φj = Ubj = MτH ¯B ¯S−1/2bj, where bj is the j-th column of ˆT −1, can be used as an alternative to the empirical Ritz vector ˜φj. That is, we have the following theorem: Theorem 2. Assume that φj ∈Φ, so that φj(x) = ⟨ϕ(x), κj⟩for some κj ∈H and ∀x ∈M. If κj is in the subspace spanned by the columns of U, so that κj = Uaj for some aj ∈Cp, then aj is a left eigenvector of ˆF with eigenvalue λj, and also we have ϕ(x) = ∑p j=1φj(x) ¯φj. (12) Proof. Since KHφj = λjφj, we have ⟨ϕ(f(x)), κj⟩= λj ⟨ϕ(x), κj⟩. Thus, from the assumption, ⟨ϕ(f(x)), Uaj⟩= λj ⟨ϕ(x), Uaj⟩. By evaluating at x0, x1, . . . , xτ−1 and then stacking into matrices, we have (Uaj)∗M+ = λj(Uaj)∗Mτ. If we multiply H ¯G−1HM∗ τU from the righthand side, this gives a∗ jU∗M+H ¯G−1HM∗ τU = λja∗ jU∗MτH ¯G−1HM∗ τU = λja∗ j. 4 Since U∗M+H ¯G−1HM∗ τU = U∗KHU(= ˆF), this means aj is a left eigenvector of ˆF with eigenvalue λj. Let bj be a (right) eigenvector of ˆF with eigenvalue λj and the corresponding left eigenvector aj.Assuming these have been normalized so that a∗ jbj = δij, then any vector h ∈Cp can be written as h = ∑p j=1(a∗ jh)bj. Applying this to U∗ϕ(x) gives U∗ϕ(x) = ∑p j=1(a∗ jU∗ϕ(x))bj. = ∑p j=1φj(x)bj Since bj = (U∗U)bj = U∗¯φj, this proves Eq. (12). This theorem clearly gives the connection between the eigenvalues/eigenvectors found by the above procedure and the Koopman eigenvalues/eigenfunctions. The assumptions in the theorem means that the data are sufficiently rich and thus a set of the kernel principal components gives a good approximation of the representation with the Koopman eigenfunctions. As in the case of Eq. (5), by the iterative applications of Eq. (3), we obtain ϕ(xt) = ∑p j=1λt jφj(x0) ¯φj. (13) The procedure for the robustified variant of the DMD is summarized as follows.1 (1) Define Mτ and calculate the centered Gram matrix ¯G = HM∗ τMτH. (2) Calculate the eigendecomposition ¯G ≈¯B ¯S ¯B∗, which gives the kernel principal directions U. (3) Calculate ˆF as in Eq. (11) and its eigendecomposition ˆF = ˆT −1ˆΛ ˆT, where each diagonal element of ˆΛ gives λj. (4) Define ¯φj to be the columns of MτH ¯B ¯S−1/2 ˆT −1. Unlike the procedure described in Section 3, the above procedure can perform the truncation of eigenvectors corresponding to small singular values. As well as DMD, this step becomes beneficial in practice when the Gram matrix G, in our case, is rank-deficient or nearly so. Remark: Although we assumed that data is a consecutive sequence for demonstrating the correctness of the algorithm, as evident from the above steps, the estimation procedure itself does not necessarily require a sequence but rather a collection of pairs of consecutive observables {(x(i) 1 , x(i) 2 )}τ i=1, where each pair is supposed to be x(i) 2 = f(x(i) 1 ), with the appropriate definitions of Mτ and M+. 5 Related Works Spectral analysis (or, referred as the decomposition technique) for dynamical systems is a popular approach aimed at extracting information concerning (low-dimensional) dynamics from data. Common techniques include global eigenmodes for linearized dynamics (see, e.g., [3]), discrete Fourier transforms, POD for nonlinear dynamics [30, 12], and balancing modes for linear systems [24] as well as multiple variants of these techniques, such as those using shift modes [22] in conjunction with POD modes. In particular, POD, which is in principle equivalent to principal component analysis, has been extensively applied to the analysis of physical phenomena [5, 22] even though it suffers from numerous known issues, including the possibility of principal directions in a set of data may not necessarily correspond to the dynamically important ones. DMD has recently attracted considerable attention in physics such as fluid mechanics [2, 10, 21, 25, 27] and in engineering fields [4, 6, 32]. Unlike POD (and its variants), DMD yields direct information about the dynamics such as growth rates and frequencies associated with each mode, which can be obtained from the magnitude and phase of each corresponding eigenvalue of the Koopman operator. However, the original DMD has several numerical disadvantages related to the accuracy of the approximate expressions of the Koopman eigenfunctions from data. Therefore, several variants of DMD have been proposed to rectify this point, including exact DMD [33] and optimized DMD [8]. Jovanovi´c et al. proposed sparsity-promoting DMD [13], which provides a framework for the approximation of the Koopman eigenfunctions with fewer bases. Williams et al. proposed extended DMD [35], which works on pre-determined basis functions instead of the monomials of observables. Although in extended DMD the Koopman mode is defined as the eigenvector of the corresponding operator of coefficients on basis functions, the resulting procedure is similar to the robust-version of our algorithm. 1The Matlab code is available at http://en.44nobu.net/codes/kdmd.zip 5 1 2 3 4 5 6 7 0 0.2 0.4 0.6 0.8 1 kernel DMD True Index Eigenvalue 8 -3 -2 -1 0 -1 0.5 0 0.5 1 kernel DMD Equilibrium DMD 1 2 3 Real Image Figure 1: Estimated eigenvalues with the data from the toy system (left) and the H´enon map (right). 0 50 100 150 200 -4 -2 0 2 4 x1 True Predicted value time 0 20 40 60 80 100 -1.5 -1 -0.5 0 0.5 1 1.5 True Predicted value x1 time Figure 2: Examples of the true versus (1-step) predicted values via the proposed method for the toy system (left) and the H´enon map (right). In system control, subspace identification [23, 14], or called the eigensystem realization method, has been a popular approach to modeling of dynamical systems. This method basically identifies low-dimensional (hidden) states as canonical vectors determined by canonical correlation analysis, and estimates parameters in the governing system using the state estimates. This type of method is known as a spectral method for dynamical systems in the machine learning community and has recently been applied to several types of systems such as variants of hidden Markov models [31, 19], nonlinear dynamical systems [15], and predictive state-representation [17]. The relation between DMD and other methods, particularly the eigensystem realization method, is an interesting open problem. This is briefly mentioned in [33] but it would require further investigation in future studies. 6 Empirical Example To illustrate how our algorithm works, we here consider two examples: a toy nonlinear system given by xt+1= 0.9xt, yt+1= 0.5yt+(0.92−0.5)x2 t, and one of the well-known chaotic maps, called the H´enon map (xt+1 = 1 −ax2 t + yt, yt+1 = bxt), which was originally presented by H´enon as a simplified model of the Poincar´e section of the Lorenz attractor. As for the toy one, the two eigenvalues are 0.5 and 0.9 with the corresponding eigenfunctions φ0.9 = xt and φ0.5 = yt −x2 t, respectively. And as for the H´enon map, we set the parameters as a = 1.4, b = 0.3. It is known that this map has two equilibrium points (−1.13135, −0.339406) and (0.631354, 0.189406), whose corresponding eigenvalues are 2.25982 and −1.09203, and −2.92374 and −0.844054. We generated samples according to these systems with several initial conditions and then applied the presented procedure to estimate the Koopman modes. We used the polynomial kernel of degree three for the toy system, and the Gaussian kernel with width 1 for the H´enon map, respectively. The graphs in Fig. 1 show the estimated eigenvalues for two cases. As seen from the left graph, the eigenvalues for the toy system were precisely estimated. Meanwhile, from the right graph, the part of the eigenvalues of the equilibrium points seem to be approximately estimated by the algorithm. 7 Applications The above algorithm provides a decomposition of the dynamics into a finite number of modes, and therefore, could be considered as a feature extraction procedure for a nonlinear dynamical system. This would be useful to directly understand dominant characteristics of the dynamics, as done in scientific fields with DMD [2, 10, 21, 25, 27]. However, here we consider some examples of applications using extracted features with the proposed analysis; prediction, sequential change detection, and the recognition of dynamic patterns, with some empirical examples. Prediction via Preimage: As is known in physics (nonlinear science), long-term predictions in a nonlinear dynamical system are, in principle, impossible if at least one of its Lyapunov exponents is positive, which would be typically the case of interests. This is true even if the dimension of the system is low because uncertainty involved in the evolution of the system exponentially increases over time. However, it may be possible to predict an observable in the near future (i.e., shortterm prediction) if we could formulate a precise predictive model. Therefore, we here consider a prediction based on estimated Koopman spectra as in Eq. (13). Since Eq. (13) is represented as the linear combination of ϕ(xi) (i = 0, . . . , τ −1), a prediction can be obtained by considering the pre-image of the predicted observables in the feature space. Even though any method for finding a pre-image of a vector in the feature space can be used for this purpose, here we describe an approach 6 -1 -0.5 0 0.5 1 1.5 -0.4 0 0.4 0.8 1.2 jump walk run varied walk, then turn run, then stop run, then turn slow walk, then stop Figure 3: MDS embedding with the distance matrix from kernel principal angle between subspaces of the estimated Koopman eigenfunctions for locomotion data. Each point is colored according to its assigned motion (jump, walk, run, and varied). 0 500 1000 1500 2000 -20 -10 0 10 20 30 40 50 x1 x2 x3 1 0 kDMD 1 0 1-SVM Figure 4: Sample sequence (top) and change scores by our method (green) and the kernel change detection method (blue). based on a similar idea with multidimensional scaling (MDS), as describe in [18], where a pre-image is recovered to preserve the distance between it and other data points in the input space as well as the feature space. The basic steps are (i) find n-neighbors of a new point ˆϕ(xτ+l) in the feature space, (ii) calculate the corresponding distance between the preimage ˆxτ+l and each data point xt based on the relation between the feature- and input-space distances, and (iii) calculate the pre-image in order to preserve the input distances. For step (i), we need the distance between the estimated feature and each data point in the feature space, which is calculated as ∥ˆϕ(xτ+l) −ϕ(xt)∥2 = ∥ˆϕ(xτ+l)∥2 + ∥ϕ(xt)∥2 −2ˆϕ(xτ+l)∗ϕ(xt) = c∗(M∗ τMτ)c + k(xt, xt) −2c∗(M∗ τϕ(xt)), where c is from Eq. (10). Note that the first and third terms in the above equation can be calculated using the values in the Gram matrix for the data. Once we obtain n-neighbors based on the feature distances, we can construct the corresponding local coordinate by calculating a set of orthogonal bases (via, for example, singular value decomposition of the data matrix for the neighbors) based on the distances in the input spaces, which are analytically obtained from the feature distances [18]. The graphs in Fig. 2 show empirical examples of the true versus predicted values as described above for the toy nonlinear system and the H´enon map. The setups for the data generation and the kernels etc. are same with the previous section. Embedding and Recognition of Dynamics: A direct but important application of the presented analysis is the embedding and recognition of dynamics with the extracted features. Like (kernel) PCA, a set of Koopman eigenfunctions estimated via the analysis can be used as the bases of a low dimensional subspace that represents the dynamics. For example, the recognition of dynamics based on this representation can be performed as follows. Suppose we are given m collection of data sequences {xt}τi t=0 (i=1,. . . ,m) each of which is generated from some known dynamics C (e.g., walks, runs, jumps etc.). Then, a set of estimated Koopman eigenfunctions for each known dynamics, which we denote by Ac = Mτwc for the corresponding complex vector wc, can be regarded as the bases of a low-dimensional embedding of the sequences. Hence, if we let A be a set of the estimated Koopman eigenfunctions for a new sequence, its category of dynamics can be estimated as ˆi = argmin c∈C dist(A, Ac), where dist(A, Ac) is a distance between two subspaces spanned by A and Ac. For example, such a distance can be given via the kernel principal angles between two subspaces in the feature space [36]. Fig. 3 shows an empirical example of this application using the locomotion data from CMU Graphics Lab Motion Capture Database.2 We used the RBF Gaussian kernel, where the kernel width was set as the median of the distances from a data matrix. The figure shows an embedding of the sequences via MDS with the distance matrix, which was calculated with kernel principal angles [36] between subspaces spanned by the Koopman eigenfunctions. Each point is colored according to its motion (jump, walk, run, and varied). 2Available at http://mocap.cs.cmu.edu. 7 Sequential Change-Point Detection: Another possible application is the sequential detection of change-points in a nonlinear dynamical system based on the prediction via the presented analysis. Here, we give a criterion for this problem based on the so-called cumulative-sum (CUSUM) of likelihood-ratios (see, for example, [9]). Let x0, x1, x2, . . . be a sequence of random vectors distributed according to some distribution ph (h = 0, 1). Then, change-point detection is defined as the sequential decision between hypotheses; H0 : p(xi) = p0(xi) for i = 1, . . . , T, and H1 : p(xi) = p0(xi) for i = 1, . . . , τ and p(xi) = p1(xi) for i = τ + 1, . . . , T, where 1 ≤τ ≤T(≤∞). In CUSUM, the stopping rule is given as T ∗= inf { T : max1≤τ<T ∑T t=τ+1 log (p1(xt)/p0(xt)) ≥c } , where c > 0 (T ∗is the stopping time). Although the Koopman operator is, in general, defined for a deterministic system, it is known to be extended to a stochastic system xt+1 = f(xt, vt), where vt is a stochastic disturbance [20]. In that case, the operator works on the expectation. Hence, let us define the distribution of xt as a nonparametric exponential family [7], given by p(xt) = exp (⟨θ(·), ψ(xt)⟩H −g(θ)) = exp (⟨ϕ ◦f(xt−1), ϕ(xt)⟩H −g(ϕ ◦f(xt−1))) , where g is the log-partition function. Then, the log-likelihood ratio score is given as log Λτ(x1:T ) := ∑T i=τ+1 log (p1(xt)/p0(xt)) ∝−∑T i=τ+1 (∑τ j=1α(0) i k(xj, xi) −∑τ j=1α(1) i k(xj, xi) ) , where α(0) i and α(1) i are the coefficients obtained by the proposed algorithm with the data for i = 1, . . . , τ and i = τ + 1, . . . , T, respectively. Here, since the variation of the second term is much smaller than the first one (cf. [7]), the decision rule, log Λ∗≥c, can be simplified by ignoring the second term. As a result, we have the following decision rule with some critical value ˜c ≤0: −log Λτ(x1:T ) ≈∑T i=τ+1 ∑τ j=1α(0) i k(xj, xi) ≤˜c, A change-point is detected if the above rule is satisfied. Otherwise, the procedure will be repeated until a change-point is detected by updating the coefficients using new samples. Fig. 4 shows an empirical example of the (normalized) change score calculated with the proposed algorithm, with comparison with the one by the kernel change detection method (cf. [7]), for the shown data generated from the Lorenz map. We used the RBF Gaussian kernel as in the same way. In the simulation, the parameter of the map changes at 800 and 1200 although the ranges of the data values dramatically change in other areas (where the score by the comparative method has changed correspondingly). 8 Conclusions We presented a spectral analysis method with the Koopman operator in RKHSs, and developed algorithms to perform the analysis using a finite-length data sequence from a nonlinear dynamical system, that is essentially reduced to the calculation of a set of orthogonal bases of the Krylov matrix in RKHSs and the eigendecomposition of the projection of the Koopman operator onto the subspace spanned by the bases. We further considered applications using estimated Koopman spectra with the proposed analysis, which were empirically illustrated using synthetic and real-world data. Acknowledgments This work was supported by JSPS KAKENHI Grant Number JP16H01548. References [1] W.E. Arnoldi. The principle of minimized iterations in the solution of the matrix eigenvalue problem. Quarterly of Applied Mathematics, 9:17–29, 1951. [2] S. Bagheri. Koopman-mode decomposition of the cylinder wake. Journal of Fluid Mechanics, 726:596– 623, 2013. [3] S. Bagheri, P. Schlatter, P.J. Schmid, and D.S. Henningson. Global stability of a jet in cross flow. Journal of Fluid Mechanics, 624:33–44, 2009. [4] E. Berger, M. Satsuma, D. Vogt, B. Jung, and H. Ben Amor. Dynamic mode decomposition for perturbation estimation in human robot interaction. In Proc. of the 23rd IEEE Int’l Symp. on Robot and Human Interactive Communication, pages 593–600, 2014. 8 [5] J.-P. Bonnet, C.R. Cole, J. Delville, M.N. Glauser, and L.S. Ukeiley. Stochastic estimation and proper orthogonal decomposition: Complementary techniques for identifying structure. Experiments in Fluids, 17:307–314, 1994. [6] B. Brunton, L. Aohnson, J. Ojemann, and J. Nathan Kutz. Extracting spatial-temporal coherent patterns in large-scale neural recordings using dynamic mode decomposition. Journal of Neuroscience Methods, 258:1–15, 2016. [7] S. Canu and A. Smola. Kernel methods and the exponential family. Neurocomputing, 69:714–720, 2006. [8] K.K. Chen, J.H. Tu, and C.W. Rowley. Variants of dynamic mode decomposition: Boundary condition, Koopman, and Fourier analyses. Journal of Nonlinear Science, 22(6):887–915, 2012. [9] M. Cs¨org¨o and L. Horv´ath. Limit Theorems in Change-Point Analysis. Wiley, 1988. [10] D. Duke, D. Honnery, and J. Soria. Experimental investigation of nonlinear instabilities in annular liquid sheets. Journal of Fluid Mechanics, 691:594–604, 2012. [11] Z. Ghahramani and S.T. Roweis. Learning nonlinear dynamical systems using an EM algorithm. In Proc. of the 1998 Conf. on Advances in Neural Information Processing Systems II, pages 431–437. [12] P. Holmes, J.L. Lumley, and G. Berkooz. Turbulence, Coherent Structures, Dynamical Systems and Symmetry. Cambridge University Press, 1996. [13] M.R. Jovanovi´c, P.J. Schmid, and J.W. Nichols. Sparsity-promoting dynamic mode decomposition. Physics of Fluids, 26:024103, 2014. [14] T. Katayama. Subspace Methods for System Identification. Springer, 2005. [15] Y. Kawahara, T. Yairi, and K. Machida. A kernel subspace method by stochastic realization for learning nonlinear dynamical systems. In Adv. in Neural Infor. Processing Systems 19, pages 665–672. 2007. [16] B.O. Koopman. Hamiltonian systems and transformation in Hilbert space. Proc. of the National Academy of Sciences of the United States of America, 17(5):315–318, 1931. [17] A. Kulesza, N. Jiang, and S. Singh. Spectral learning of predictive state representations with insufficient statistics. In Proc. of the 29th AAAI Conf. on Artificial Intelligence (AAAI’15), pages 2715–2721. [18] James Tin-Yau Kwok and Ivor Wai-Hung Tsang. The pre-image problem in kernel methods. IEEE Trans. on Neural Networks, 15(6):1517–1525, 2004. [19] I. Melnyk and A. Banerjee. A spectral algorithm for inference in hidden semi-markov models. In Proc. of the 18th Int’l Conf. on Artificial Intelligence and Statistics (AISTATS’15), pages 690–698, 2015. [20] I. Mezi´c. Spectral properties of dynamical systems, model reduction and decompositions. Nonlinear Dynamics, 41:309–325, 2005. [21] T.W. Muld, G. Efraimsson, and D.S. Henningson. Flow structures around a high-speed train extracted using proper orthogonal decomposition and dynamic mode decomposition. Computers and Fluids, 57:87– 97, 2012. [22] B.R. Noack, K. Afanasiev, M. Morzynski, G. Tadmor, and F. Thiele. A hierarchy of low-dimensional models for the transient and post-transient cylinder wake. J. of Fluid Mechanics, 497:335–363, 2003. [23] P. Van Overschee and B. De Moor. Subspace Identification for Linear Systems: Theory, Implementation, Applications. Kluwer Academic Publishers, 1996. [24] C.W. Rowley. Model reduction for fluids using balanced proper orthogonal decomposition. International Journal of Bifurcation Chaos, 15(3):997–1013, 2005. [25] C.W. Rowley, I. Mezi´c, S. Bagheri, P. Schlatter, and D.S. Henningson. Spectral analysis of nonlinear flows. Journal of Fluid Mechanics, 641:115–127, 2009. [26] P.J. Schmid. Dynamic mode decomposition of numerical and experimental data. Journal of Fluid Mechanics, 656:5–28, 2010. [27] P.J. Schmid and J. Sesterhenn. Dynamic mode decomposition of turbulent cavity flows for self-sustained oscillations. Int’l J. of Heat and Fluid Flow, 32(6):1098–1110, 2010. [28] B. Sch¨olkopf, A. Smola, and K.-R. M¨uller. Nonlinear component analysis as a kernel eigenvalue problem. Neural Computation, 10:1299–1319, 1998. [29] J. Shawe-Taylor and N. Cristianini. Kernel Methods for Pattern Analysis. Cambridge Univ. Press, 2004. [30] L. Sirovich. Turbulence and the dynamics of coherent structures. Quarterly of applied mathematics, 45:561–590, 1987. [31] L. Song, B. Boots, S.M. Siddiqi, G. Gordon, and A. Smola. Hilbert space embeddings of hidden markov models. In Proc. of the 27th Int’l Conf. on Machine Learning (ICML’10), pages 991–998. [32] Y. Suzuki and I. Mezi´c. Nonlinear koopman modes and power system stability assessment without models. IEEE Trans. on Power Systems, 29:899–907, 2013. [33] J.H. Tu, C.W. Rowley, D.M. Luchtenburg, S.L. Brunton, and J.N. Kutz. On dynamic mode decomposition: Theory and applications. Journal of Computational Dynamics, 1(2):391–421, 2014. [34] J. Wang, A. Hertzmann, and D.M. Blei. Gaussian process dynamical models. In Advances in Neural Information Processing Systems 18, pages 1441–1448. 2006. [35] M.O. Williams, I.G. Kevrekidis, and C.W. Rowley. A data-driven approximation of the Koopman operator: Extending dynamic mode decomposition. Journal of Nonlinear Science, 25:1307–1346, 2015. [36] L. Wolf and A. Shashua. Learning over sets using kernel principal angles. Journal of Machine Learning Research, 4:913–931, 2003. 9
2016
60
6,520
Total Variation Classes Beyond 1d: Minimax Rates, and the Limitations of Linear Smoothers Veeranjaneyulu Sadhanala Machine Learning Department Carnegie Mellon University Pittsburgh, PA 15213 vsadhana@cs.cmu.edu Yu-Xiang Wang Machine Learning Department Carnegie Mellon University Pittsburgh, PA 15213 yuxiangw@cs.cmu.edu Ryan J. Tibshirani Department of Statistics Carnegie Mellon University Pittsburgh, PA 15213 ryantibs@stat.cmu.edu Abstract We consider the problem of estimating a function defined over n locations on a d-dimensional grid (having all side lengths equal to n1/d). When the function is constrained to have discrete total variation bounded by Cn, we derive the minimax optimal (squared) ℓ2 estimation error rate, parametrized by n, Cn. Total variation denoising, also known as the fused lasso, is seen to be rate optimal. Several simpler estimators exist, such as Laplacian smoothing and Laplacian eigenmaps. A natural question is: can these simpler estimators perform just as well? We prove that these estimators, and more broadly all estimators given by linear transformations of the input data, are suboptimal over the class of functions with bounded variation. This extends fundamental findings of Donoho and Johnstone [12] on 1-dimensional total variation spaces to higher dimensions. The implication is that the computationally simpler methods cannot be used for such sophisticated denoising tasks, without sacrificing statistical accuracy. We also derive minimax rates for discrete Sobolev spaces over d-dimensional grids, which are, in some sense, smaller than the total variation function spaces. Indeed, these are small enough spaces that linear estimators can be optimal—and a few well-known ones are, such as Laplacian smoothing and Laplacian eigenmaps, as we show. Lastly, we investigate the adaptivity of the total variation denoiser to these smaller Sobolev function spaces. 1 Introduction Let G = (V, E) be a d-dimensional grid graph, i.e., lattice graph, with equal side lengths. Label the nodes as V = {1, . . . , n}, and edges as E = {e1, . . . , em}. Consider data y = (y1, . . . , yn) ∈Rn observed over the nodes, from a model yi ∼N(θ0,i, σ2), i.i.d., for i = 1, . . . , n, (1) where θ0 = (θ0,1, . . . , θ0,n) ∈Rn is an unknown mean parameter to be estimated, and σ2 > 0 is the marginal noise variance. It is assumed that θ0 displays some kind of regularity over the grid G, e.g., θ0 ∈Td(Cn) for some Cn > 0, where Td(Cn) =  θ : ∥Dθ∥1 ≤Cn , (2) and D ∈Rm×n is the edge incidence matrix of G. This has ℓth row Dℓ= (0, . . . , −1, . . . , 1, . . . , 0), with a −1 in the ith location, and 1 in the jth location, provided that the ℓth edge is eℓ= (i, j) with i < j. Equivalently, L = DT D is the graph Laplacian matrix of G, and thus ∥Dθ∥1 = X (i,j)∈E |θi −θj|, and ∥Dθ∥2 2 = θT Lθ = X (i,j)∈E (θi −θj)2. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. We will refer to the class in (2) as a discrete total variation (TV) class, and to the quantity ∥Dθ0∥1 as the discrete total variation of θ0, though for simplicity we will often drop the word “discrete”. The problem of estimating θ0 given a total variation bound as in (2) is of great importance in both nonparametric statistics and signal processing, and has many applications, e.g., changepoint detection for 1d grids, and image denoising for 2d and 3d grids. There has been much methodological and computational work devoted to this problem, resulting in practically efficient estimators in dimensions 1, 2, 3, and beyond. However, theoretical performance, and in particularly optimality, is only really well-understood in the 1-dimensional setting. This paper seeks to change that, and offers theory in d-dimensions that parallel more classical results known in the 1-dimensional case. Estimators under consideration. Central role to our work is the total variation (TV) denoising or fused lasso estimator (e.g., [21, 25, 7, 15, 27, 23, 2]), defined by the convex optimization problem ˆθTV = argmin θ∈Rn ∥y −θ∥2 2 + λ∥Dθ∥1, (3) where λ ≥0 is a tuning parameter. Another pair of methods that we study carefully are Laplacian smoothing and Laplacian eigenmaps, which are most commonly seen in the context of clustering, dimensionality reduction, and semi-supervised learning, but are also useful tools for estimation in a regression setting like ours (e.g., [3, 4, 24, 30, 5, 22]). The Laplacian smoothing estimator is given by ˆθLS = argmin θ∈Rn ∥y −θ∥2 2 + λ∥Dθ∥2 2, i.e., ˆθLS = (I + λL)−1y, (4) for a tuning parameter λ ≥0, where in the second expression we have written ˆθLS in closed-form (this is possible since it is the minimizer of a convex quadratic). For Laplacian eigenmaps, we must introduce the eigendecomposition of the graph Laplacian, L = V ΣV T , where Σ = diag(ρ1, . . . , ρn) with 0 = ρ1 < ρ2 ≤. . . ≤ρn, and where V = [V1, V2, . . . , Vn] ∈Rn×n has orthonormal columns. The Laplacian eigenmaps estimator is ˆθLE = V[k]V T [k]y, where V[k] = [V1, V2, . . . , Vk] ∈Rn×k, (5) where now k ∈{1, . . . , n} acts as a tuning parameter. Laplacian smoothing and Laplacian eigenmaps are appealing because they are (relatively) simple: they are just linear transformations of the data y. Indeed, as we are considering G to be a grid, both estimators in (4), (5) can be computed very quickly, in nearly O(n) time, since the columns of V here are discrete cosine transform (DCT) basis vectors when d = 1, or Kronecker products thereof, when d ≥2 (e.g., [9, 17, 20, 28]). The TV denoising estimator in (3), on the other hand, cannot be expressed in closed-form, and is much more difficult to compute, especially when d ≥2, though several advances have been made over the years (see the references above, and in particular [2] for an efficient operator-splitting algorithm and nice literature survey). Importantly, these computational difficulties are often worth it: TV denoising often practically outperforms ℓ2-regularized estimators like Laplacian smoothing (and also Laplacian eigenmaps) in image denoising tasks, as it is able to better preserve sharp edges and object boundaries (this is now widely accepted, early references are, e.g., [1, 10, 8]). See Figure 1 for an example, using the often-studied “cameraman” image. In the 1d setting, classical theory from nonparametric statistics draws a clear distinction between the performance of TV denoising and estimators like Laplacian smoothing and Laplacian eigenmaps. Perhaps surprisingly, this theory has not yet been fully developed in dimensions d ≥2. Arguably, the comparison between TV denoising and Laplacian smoothing and Laplacian eigenmaps is even more interesting in higher dimensions, because the computational gap between the methods is even larger (the former method being much more expensive, say in 2d and 3d, than the latter two). Shortly, we review the 1d theory, and what is known in d-dimensions, for d ≥2. First, we introduce notation. Notation. For deterministic (nonrandom) sequences an, bn we write an = O(bn) to denote that an/bn is upper bounded for all n large enough, and an ≍bn to denote that both an = O(bn) and a−1 n = O(b−1 n ). Also, for random sequences An, Bn, we write An = OP(Bn) to denote that An/Bn is bounded in probability. We abbreviate a ∧b = min{a, b} and a ∨b = max{a, b}. For an estimator ˆθ of the parameter θ0 in (1), we define its mean squared error (MSE) to be MSE(ˆθ, θ0) = 1 n∥ˆθ −θ0∥2 2. 2 Noisy image Laplacian smoothing TV denoising Figure 1: Comparison of Laplacian smoothing and TV denoising for the common “cameraman” image. TV denoising provides a more visually appealing result, and also achieves aboutx a 35% reduction in MSE compared to Laplacian smoothing (MSE being measured to the original image). Both methods were tuned optimally. The risk of ˆθ is the expectation of its MSE, and for a set K ⊆Rn, we define the minimax risk and minimax linear risk to be R(K) = inf ˆθ sup θ0∈K E  MSE(ˆθ, θ0)  and RL(K) = inf ˆθ linear sup θ0∈K E  MSE(ˆθ, θ0)  , respectively, where the infimum on in the first expression is over all estimators ˆθ, and in the second expression over all linear estimators ˆθ, meaning that ˆθ = Sy for a matrix S ∈Rn×n. We will also refer to linear estimators as linear smoothers. Note that both Laplacian smoothing in (4) and Laplacian eigenmaps in (5) are linear smoothers, but TV denoising in (3) is not. Lastly, in somewhat of an abuse of nomenclature, we will often call the parameter θ0 in (1) a function, and a set of possible values for θ0 as in (2) a function space; this comes from thinking of the components of θ0 as the evaluations of an underlying function over n locations on the grid. This embedding has no formal importance, but it is convenient notationally, and matches the notation in nonparametric statistics. Review: TV denoising in 1d. The classical nonparametric statistics literature [13, 12, 18] provides a more or less complete story for estimation under total variation constraints in 1d. See also [26] for a translation of these results to a setting more consistent (notationally) to that in the current paper. Assume that d = 1 and Cn = C > 0, a constant (not growing with n). The results in [12] imply that R(T1(C)) ≍n−2/3. (6) Furthermore, [18] proved that the TV denoiser ˆθTV in (3), with λ ≍n1/3, satisfies MSE(ˆθTV, θ0) = OP(n−2/3), (7) for all θ0 ∈T1(C), and is thus minimax rate optimal over T1(C). (In assessing rates here and throughout, we do not distinguish between convergence in expectation versus convergence in probability.) Wavelet denoising, under various choices of wavelet bases, also achieves the minimax rate. However, many simpler estimators do not. To be more precise, it is shown in [12] that RL(T1(C)) ≍n−1/2. (8) Therefore, a substantial number of commonly used nonparametric estimators—such as running mean estimators, smoothing splines, kernel smoothing, Laplacian smoothing, and Laplacian eigenmaps, which are all linear smoothers—have a major deficiency when it comes to estimating functions of bounded variation. Roughly speaking, they will require many more samples to estimate θ0 within the same degree of accuracy as an optimal method like TV or wavelet denoising (on the order of ϵ−1/2 times more samples to achieve an MSE of ϵ). Further theory and empirical examples (e.g., [11, 12, 26]) offer the following perspective: linear smoothers cannot cope with functions in T(C) that have spatially inhomogeneous smoothness, i.e., that vary smoothly at some locations and vary wildly at others. Linear smoothers can only produce estimates that are smooth throughout, or wiggly throughout, but not a mix of the two. They can hence perform well over smaller, more homogeneous function classes like Sobolev or Holder classes, but not larger ones like total variation classes (or more generally, Besov and Triebel classes), and for these, one must use more sophisticated, nonlinear techniques. A motivating question: does such a gap persist in higher dimensions, between optimal nonlinear and linear estimators, and if so, how big is it? 3 Review: TV denoising in multiple dimensions. Recently, [29] established rates for TV denoising over various graph models, including grids, and [16] made improvements, particularly in the case of d-dimensional grids with d ≥2. We can combine Propositions 4 and 6 of [16] with Theorem 3 of [29] to give the following result: if d ≥2, and Cn is an arbitrary sequence (potentially unbounded with n), then the TV denoiser ˆθTV in (3) satisfies, over all θ0 ∈Td(Cn), MSE(ˆθTV, θ0) = OP Cn log n n  for d = 2, and MSE(ˆθTV, θ0) = OP Cn √log n n  for d ≥3, (9) with λ ≍log n for d = 2, and λ ≍√log n for d ≥3. Note that, at first glance, this is a very different result from the 1d case. We expand on this next. 2 Summary of results A gap in multiple dimensions. For estimation of θ0 in (1) when d ≥2, consider, e.g., the simplest possible linear smoother: the mean estimator, ˆθmean = ¯y1 (where 1 = (1, . . . , 1) ∈Rn, the vector of all 1s). Lemma 4, given below, implies that over θ0 ∈Td(Cn), the MSE of the mean estimator is bounded in probability by C2 n log n/n for d = 2, and C2 n/n for d ≥3. Compare this to (9). When Cn = C > 0 is a constant, i.e., when the TV of θ0 is assumed to be bounded (which is assumed for the 1d results in (6), (7), (8)), this means that the TV denoiser and the mean estimator converge to θ0 at the same rate, basically (ignoring log terms), the “parametric rate” of 1/n, for estimating a finitedimensional parameter! That TV denoising and such a trivial linear smoother perform comparably over 2d and 3d grids could not be farther from the story in 1d, where TV denoising is separated by an unbridgeable gap from all linear smoothers, as shown in (6), (7), (8). Our results in Section 3 clarify this conundrum, and can be summarized by three points. • We argue in Section 3.1 that there is a proper “canonical” scaling for the TV class defined in (2). E.g., when d = 1, this yields Cn ≍1, a constant, but when d = 2, this yields Cn ≍√n, and Cn also diverges with n for all d ≥3. Sticking with d = 2 as an interesting example, we see that under such a scaling, the MSE rates achieved by TV denoising and the mean estimator respectively, are drastically different; ignoring log terms, these are Cn n ≍ 1 √n and C2 n n ≍1, (10) respectively. Hence, TV denoising has an MSE rate of 1/√n, in a setting where the mean estimator has a constant rate, i.e., a setting where it is not even known to be consistent. • We show in Section 3.3 that our choice to study the mean estimator here is not somehow “unlucky” (it is not a particularly bad linear smoother, nor is the upper bound on its MSE loose): the minimax linear risk over Td(Cn) is on the order C2 n/n, for all d ≥2. Thus, even the best linear smoothers have the same poor performance as the mean over Td(Cn). • We show in Section 3.2 that the TV estimator is (essentially) minimax optimal over Td(Cn), as the minimax risk over this class scales as Cn/n (ignoring log terms). To summarize, these results reveal a significant gap between linear smoothers and optimal estimators like TV denoising, for estimation over Td(Cn) in d dimensions, with d ≥2, as long as Cn scales appropriately. Roughly speaking, the TV classes encompass a challenging setting for estimation because they are very broad, containing a wide array of functions—both globally smooth functions, said to have homogeneous smoothness, and functions with vastly different levels of smoothness at different grid locations, said to have heterogeneous smoothness. Linear smoothers cannot handle heterogeneous smoothness, and only nonlinear methods can enjoy good estimation properties over the entirety of Td(Cn). To reiterate, a telling example is d = 2 with the canonical scaling Cn ≍√n, where we see that TV denoising achieves the optimal 1/√n rate (up to log factors), meanwhile, the best linear smoothers have max risk that is constant over T2(√n). See Figure 2 for an illustration. Minimax rates over smaller function spaces, and adaptivity. Sections 4 and 5 are focused on different function spaces, discrete Sobolev spaces, which are ℓ2 analogs of discrete TV spaces as we have defined them in (2). Under the canonical scaling of Section 3.1, Sobolev spaces are contained in 4 Trivial scaling, Cn ≍1 Canonical scaling, Cn ≍√n n 102 103 104 105 MSE 10-4 10-3 10-2 10-1 100 TV denoising (-tted slope -0.88) Laplacian smoothing (-tted slope -0.99) Mean estimator (-tted slope -1.01) Trivial rate: n!1 n 102 103 104 105 MSE 10-4 10-3 10-2 10-1 100 TV denoising (-tted slope -0.84) Laplacian smoothing (-tted slope -0.01) Mean estimator (-tted slope 0.00) Minimax rate: n!1=2 Figure 2: MSE curves for estimation over a 2d grid, under two very different scalings of Cn: constant and √n. The parameter θ0 was a “one-hot” signal, with all but one component equal to 0. For each n, the results were averaged over 5 repetitions, and Laplacian smoothing and TV denoising were tuned for optimal average MSE. TV spaces, and the former can be roughly thought of as containing functions of more homogeneous smoothness. The story now is more optimistic for linear smoothers, and the following is a summary. • In Section 4, we derive minimax rates for Sobolev spaces, and prove that linear smoothers— in particular, Laplacian smoothing and Laplacian eigenmaps—are optimal over these spaces. • In Section 5, we discuss an interesting phenomenon, a phase transition of sorts, at d = 3 dimensions. When d = 1 or 2, the minimax rates for a TV space and its inscribed Sobolev space match; when d ≥3, they do not, and the inscribed Sobolev space has a faster minimax rate. Aside from being an interesting statement about the TV and Sobolev function spaces in high dimensions, this raises an important question of adaptivity over the smaller Sobolev function spaces. As the minimax rates match for d = 1 and 2, any method optimal over TV spaces in these dimensions, such as TV denoising, is automatically optimal over the inscribed Sobolev spaces. But the question remains open for d ≥3—does, e.g., TV denoising adapt to the faster minimax rate over Sobolev spaces? We present empirical evidence to suggest that this may be true, and leave a formal study to future work. Other considerations and extensions. There are many problems related to the one that we study in this paper. Clearly, minimax rates for the TV and Sobolev classes over general graphs, not just d-dimensional grids, are of interest. Our minimax lower bounds for TV classes actually apply to generic graphs with bounded max degree, though it is unclear whether to what extent they are sharp beyond grids; a detailed study will be left to future work. Another related topic is that of higher-order smoothness classes, e.g., classes containing functions whose derivatives are of bounded variation. The natural extension of TV denoising here is called trend filtering, defined via the regularization of discrete higher-order derivatives. In the 1d setting, minimax rates, the optimality of trend filtering, and the suboptimality of linear smoothers is already well-understood [26]. Trend filtering has been defined and studied to some extent on general graphs [29], but no notions of optimality have been investigated beyond 1d. This will also be left to future work. Lastly, it is worth mentioning that there are other estimators (i.e., other than the ones we study in detail) that attain or nearly attain minimax rates over various classes we consider in this paper. E.g., wavelet denoising is known to be optimal over TV classes in 1d [12]; and comparing recent upper bounds from [19, 16] with the lower bounds in this work, we see that wavelet denoising is also nearly minimax in 2d (ignoring log terms). 3 Analysis over TV classes 3.1 Canonical scalings for TV and Sobolev classes We start by establishing what we call a “canonical” scaling for the radius Cn of the TV ball Td(Cn) in (2), as well as the radius C′ n of the Sobolev ball Sd(C′ n), defined as Sd(C′ n) =  θ : ∥Dθ∥2 ≤C′ n . (11) 5 Proper scalings for Cn, C′ n will be critical for properly interpreting our new results in d dimensions, in a way that is comparable to known results for d = 1 (which are usually stated in terms of the 1d scalings Cn ≍1, C′ n ≍1/√n). To study (2), (11), it helps to introduce a third function space, Hd(1) = n θ : θi = f(i1/ℓ. . . , id/ℓ), i = 1, . . . , n, for some f ∈Hcont d (1) o . (12) Above, we have mapped each location i on the grid to a multi-index (i1, . . . , id) ∈{1, . . . , ℓ}d, where ℓ= n1/d, and Hcont d (1) denotes the (usual) continuous Holder space on [0, 1]d, i.e., functions that are 1-Lipschitz with respect to the ℓ∞norm. We seek an embedding that is analogous to the embedding of continuous Holder, Sobolev, and total variation spaces in 1d functional analysis, namely, Hd(1) ⊆Sd(C′ n) ⊆Td(Cn). (13) Our first lemma provides a choice of Cn, C′ n that makes the above true. Its proof, as with all proofs in this paper, can be found in the supplementary document. Lemma 1. For d ≥1, the embedding in (13) holds with choices Cn ≍n1−1/d and C′ n ≍n1/2−1/d. Such choices are called the canonical scalings for the function classes in (2), (11). As a sanity check, both the (usual) continuous Holder and Sobolev function spaces in d dimensions are known to have minimax risks that scale as n−2/(2+d), in a standard nonparametric regression setup (e.g., [14]). Under the canonical scaling C′ n ≍n1/2−1/d, our results in Section 4 show that the discrete Sobolev class Sd(n1/2−1/d) also admits a minimax rate of n−2/(2+d). 3.2 Minimax rates over TV classes The following is a lower bound for the minimax risk of the TV class Td(Cn) in (2). Theorem 2. Assume n ≥2, and denote dmax = 2d. Then, for constants c > 0, ρ1 ∈(2.34, 2.35), R(Td(Cn)) ≥c ·        σCn p 1 + log(σdmaxn/Cn) dmaxn if Cn ∈[σdmax √log n, σdmaxn/√ρ1] C2 n/(d2 maxn) ∨σ2/n if Cn < σdmax √log n σ2/ρ1 if Cn > σdmaxn/√ρ1 . (14) The proof uses a simplifying reduction of the TV class, via Td(Cn) ⊇B1(Cn/dmax), the latter set denoting the ℓ1 ball of radius Cn/dmax in Rn. It then invokes a sharp characterization of the minimax risk in normal means problems over ℓp balls due to [6]. Several remarks are in order. Remark 1. The first line on the right-hand side in (14) often provides the most useful lower bound. To see this, recall that under the canonical scaling for TV classes, we have Cn = n1−1/d. For all d ≥2, this certainly implies Cn ∈[σdmax √log n, σdmaxn/√ρ1], for large n. Remark 2. Even though its construction is very simple, the lower bound on the minimax risk in (14) is sharp or nearly sharp in many interesting cases. Assume that Cn ∈[σdmax √log n, σdmaxn/√ρ1]. The lower bound rate is Cn p log(n/Cn)/n. When d = 2, we see that this is very close to the upper bound rate of Cn log n/n achieved by the TV denoiser, as stated in (9). These two differ by at most a log n factor (achieved when Cn ≍n). When d ≥3, we see that the lower bound rate is even closer to the upper bound rate of Cn √log n/n achieved by the TV denoiser, as in (9). These two now differ by at most a √log n factor (again achieved when Cn ≍n). We hence conclude that the TV denoiser is essentially minimax optimal in all dimensions d ≥2. Remark 3. When d = 1, and (say) Cn ≍1, the lower bound rate of √log n/n given by Theorem 2 is not sharp; we know from [12] (recall (6)) that the minimax rate over T1(1) is n−2/3. The result in the theorem (and also Theorem 3) in fact holds more generally, beyond grids: for an arbitrary graph G, its edge incidence matrix D, and Td(Cn) as defined in (2), the result holds for dmax equal to the max degree of G. It is unclear to what extent this is sharp, for different graph models. 3.3 Minimax linear rates over TV classes We now turn to a lower bound on the minimax linear risk of the TV class Td(Cn) in (2). Theorem 3. Recall the notation dmax = 2d. Then RL(Td(Cn)) ≥ σ2C2 n C2n + σ2d2maxn ∨σ2 n ≥1 2 C2 n d2maxn ∧σ2 ! ∨σ2 n . (15) 6 The proof relies on an elegant meta-theorem on minimax rates from [13], which uses the concept of a “quadratically convex” set, whose minimax linear risk is the same as that of its hardest rectangular subproblem. An alternative proof can be given entirely from first principles. Remark 4. When C2 n grows with n, but not too fast (scales as √n, at most), the lower bound rate in (15) will be C2 n/n. Compared to the Cn/n minimax rate from Theorem 2 (ignoring log terms), we see a clear gap between optimal nonlinear and linear estimators. In fact, under the canonical scaling Cn ≍n1−1/d, for any d ≥2, this gap is seemingly huge: the lower bound for the minimax linear rate will be a constant, whereas the minimax rate from Theorem 2 (ignoring log terms) will be n−1/d. We now show that the lower bound in Theorem 3 is essentially tight, and remarkably, it is certified by analyzing two trivial linear estimators: the mean estimator and the identity estimator. Lemma 4. Let Mn denote the largest column norm of D†. For the mean estimator ˆθmean = ¯y1, sup θ0∈Td(Cn) E  MSE(ˆθmean, θ0)  ≤σ2 + C2 nM 2 n n , From Proposition 4 in [16], we have Mn = O(√log n) when d = 2 and Mn = O(1) when d ≥3. The risk of the identity estimator ˆθid = y is clearly σ2. Combining this logic with Lemma 4 gives the upper bound RL(Td(Cn)) ≤(σ2 + C2 nM 2 n)/n ∧σ2. Comparing this with the lower bound described in Remark 4, we see that the two rates basically match, modulo the M 2 n factor in the upper bound, which only provides an extra log n factor when d = 2. The takeaway message: in the sense of max risk, the best linear smoother does not perform much better than the trivial estimators. Additional empirical experiments, similar to those shown in Figure 2, are given in the supplement. 4 Analysis over Sobolev classes Our first result here is a lower bound on the minimax risk of the Sobolev class Sd(C′ n) in (11). Theorem 5. For a universal constant c > 0, R(Sd(C′ n)) ≥c n  (nσ2) 2 d+2 (C′ n) 2d d+2 ∧nσ2 ∧n2/d(C′ n)2 + σ2 n . Elegant tools for minimax analysis from [13], which leverage the fact that the ellipsoid Sd(C′ n) is orthosymmetric and quadratically convex (after a rotation), are used to prove the result. The next theorem gives upper bounds, certifying that the above lower bound is tight, and showing that Laplacian eigenmaps and Laplacian smoothing, both linear smoothers, are optimal over Sd(C′ n). Theorem 6. For Laplacian eigenmaps, ˆθLE in (5), with k ≍((n(C′ n)d)2/(d+2) ∨1) ∧n, we have sup θ0∈Sd(C′n) E  MSE(ˆθLE, θ0)  ≤c n  (nσ2) 2 d+2 (C′ n) 2d d+2 ∧nσ2 ∧n2/d(C′ n)2 + cσ2 n , for a universal constant c > 0, and n large enough. When d = 1, 2, or 3, the same bound holds for Laplacian smoothing ˆθLS in (5), with λ ≍(n/(C′ n)2)2/(d+2) (and a possibly different constant c). 5 A phase transition, and adaptivity The TV and Sobolev classes in (2) and (11), respectively, display a curious relationship. We reflect on Theorems 2 and 5, using, for concreteness, the canonical scalings Cn ≍n1−1/d and C′ n ≍n1/2−1/d (that, recall, guarantee Sd(C′ n) ⊆Td(Cn))). When d = 1, both the TV and Sobolev classes have a minimax rate of n−2/3 (this TV result is actually due to [12], as stated in (6), not Theorem 2). When d = 2, both the TV and Sobolev classes again have the same minimax rate of n−1/2, the caveat being that the rate for TV class has an extra √log n factor. But for all d ≥3, the rates for the canonical TV and Sobolev classes differ, and the smaller Sobolev spaces have faster rates than their inscribing TV spaces. This may be viewed as a phase transition at d = 3; see Table 1. We may paraphrase to say that 2d is just like 1d, in that expanding the Sobolev ball into a larger TV ball does not hurt the minimax rate, and methods like TV denoising are automatically adaptive, i.e., 7 Function class Dimension 1 Dimension 2 Dimension d ≥3 TV ball Td(n1−1/d) n−2/3 n−1/2√log n n−1/d√log n Sobolev ball Sd(n1/2−1/d) n−2/3 n−1/2 n− 2 2+d Table 1: Summary of rates for canonically-scaled TV and Sobolev spaces. Linear signal in 2d Linear signal in 3d n 102 103 104 105 MSE 10-3 10-2 10-1 100 TV denoising (-tted slope -0.54) Laplacian smoothing (-tted slope -0.62) TV-ball minimax rate: n!1=2 Sobolev-ball minimax rate: n!1=2 n 102 103 104 105 MSE 10-3 10-2 10-1 100 TV denoising (-tted slope -0.44) Laplacian smoothing (-tted slope -0.50) TV-ball minimax rate: n!1=3 Sobolev-ball minimax rate: n!2=5 Figure 3: MSE curves for estimating a “linear” signal, a very smooth signal, over 2d and 3d grids. For each n, the results were averaged over 5 repetitions, and Laplacian smoothing and TV denoising were tuned for best average MSE performance. The signal was set to satisfy ∥Dθ0∥2 ≍n1/2−1/d, matching the canonical scaling. optimal over both the bigger and smaller classes. However, as soon as we enter the 3d world, it is no longer clear whether TV denoising can adapt to the smaller, inscribed Sobolev ball, whose minimax rate is faster, n−2/5 versus n−1/3 (ignoring log factors). Theoretically, this is an interesting open problem that we do not approach in this paper and leave to future work. We do, however, investigate the matter empirically: see Figure 3, where we run Laplacian smoothing and TV denoising on a highly smooth “linear” signal θ0. This is constructed so that each component θi is proportional to i1 + i2 + . . . + id (using the multi-index notation (i1, . . . , id) of (12) for grid location i), and the Sobolev norm is ∥Dθ0∥2 ≍n1/2−1/d. Arguably, these are among the “hardest” types of functions for TV denoising to handle. The left panel, in 2d, is a case in which we know that TV denoising attains the minimax rate; the right panel, in 3d, is a case in which we do not, though empirically, TV denoising surely seems to be doing better than the slower minimax rate of n−1/3 (ignoring log terms) that is associated with the larger TV ball. Even if TV denoising is shown to be minimax optimal over the inscribed Sobolev balls when d ≥3, note that this does not necessarily mean that we should scrap Laplacian smoothing in favor of TV denoising, in all problems. Laplacian smoothing is the unique Bayes estimator in a normal means model under a certain Markov random field prior (e.g., [22]); statistical decision theory therefore tells that it is admissible, i.e., no other estimator—TV denoising included—can uniformly dominate it. 6 Discussion We conclude with a quote from Albert Einstein: “Everything should be made as simple as possible, but no simpler”. In characterizing the minimax rates for TV classes, defined over d-dimensional grids, we have shown that simple methods like Laplacian smoothing and Laplacian eigenmaps—or even in fact, all linear estimators—must be passed up in favor of more sophisticated, nonlinear estimators, like TV denoising, if one wants to attain the optimal max risk. Such a result was previously known when d = 1; our work has extended it to all dimensions d ≥2. We also characterized the minimax rates over discrete Sobolev classes, revealing an interesting phase transition where the optimal rates over TV and Sobolev spaces, suitably scaled, match when d = 1 and 2 but diverge for d ≥3. It is an open question as to whether an estimator like TV denoising can be optimal over both spaces, for all d. Acknolwedgements. We thank Jan-Christian Hutter and Philippe Rigollet, whose paper [16] inspired us to think carefully about problem scalings (i.e., radii of TV and Sobolev classes) in the first place. YW was supported by NSF Award BCS-0941518 to CMU Statistics, a grant by Singapore NRF under its International Research Centre @ Singapore Funding Initiative, and a Baidu Scholarship. RT was supported by NSF Grants DMS-1309174 and DMS-1554123. 8 References [1] Robert Acar and Curtis R. Vogel. Analysis of total variation penalty methods. Inverse Problems, 10: 1217–1229, 1994. [2] Alvero Barbero and Suvrit Sra. Modular proximal optimization for multidimensional total-variation regularization. arXiv: 1411.0589, 2014. [3] Mikhail Belkin and Partha Niyogi. Using manifold structure for partially labelled classification. Advances in Neural Information Processing Systems, 15, 2002. [4] Mikhail Belkin and Partha Niyogi. Laplacian eigenmaps for dimensionality reduction and data representation. Neural Computation, 15(6):1373–1396, 2003. [5] Mikhail Belkin and Partha Niyogi. Towards a theoretical foundation for Laplacian-based manifold methods. Conference on Learning Theory (COLT-05), 18, 2005. [6] Lucien Birge and Pascal Massart. Gaussian model selection. Journal of the European Mathematical Society, 3(3):203–268, 2001. [7] Antonin Chambolle and Jerome Darbon. On total variation minimization and surface evolution using parametric maximum flows. International Journal of Computer Vision, 84:288–307, 2009. [8] Antonin Chambolle and Pierre-Louis Lions. Image recovery via total variation minimization and related problems. Numerische Mathematik, 76(2):167–188, 1997. [9] Samuel Conte and Carl de Boor. Elementary Numerical Analysis: An Algorithmic Approach. McGraw-Hill, New York, 1980. International Series in Pure and Applied Mathematics. [10] David Dobson and Fadil Santosa. Recovery of blocky images from noisy and blurred data. SIAM Journal on Applied Mathematics, 56(4):1181–1198, 1996. [11] David Donoho and Iain Johnstone. Ideal spatial adaptation by wavelet shrinkage. Biometrika, 81(3): 425–455, 1994. [12] David Donoho and Iain Johnstone. Minimax estimation via wavelet shrinkage. Annals of Statistics, 26(8): 879–921, 1998. [13] David Donoho, Richard Liu, and Brenda MacGibbon. Minimax risk over hyperrectangles, and implications. Annals of Statistics, 18(3):1416–1437, 1990. [14] Laszlo Gyorfi, Michael Kohler, Adam Krzyzak, and Harro Walk. A Distribution-Free Theory of Nonparametric Regression. Springer, New York, 2002. [15] Holger Hoefling. A path algorithm for the fused lasso signal approximator. Journal of Computational and Graphical Statistics, 19(4):984–1006, 2010. [16] Jan-Christian Hutter and Philippe Rigollet. Optimal rates for total variation denoising. In Conference on Learning Theory (COLT-16), 2016. to appear. [17] Hans Kunsch. Robust priors for smoothing and image restoration. Annals of the Institute of Statistical Mathematics, 46(1):1–19, 1994. [18] Enno Mammen and Sara van de Geer. Locally apadtive regression splines. Annals of Statistics, 25(1): 387–413, 1997. [19] Deanna Needell and Rachel Ward. Stable image reconstruction using total variation minimization. SIAM Journal on Imaging Sciences, 6(2):1035–1058, 2013. [20] Michael Ng, Raymond Chan, and Wun-Cheung Tang. A fast algorithm for deblurring models with Neumann boundary conditions. SIAM Journal on Scientific Computing, 21(3):851–866, 1999. [21] Leonid Rudin, Stanley Osher, and Emad Faterni. Nonlinear total variation based noise removal algorithms. Physica D: Nonlinear Phenomena, 60:259–268, 1992. [22] James Sharpnack and Aarti Singh. Identifying graph-structured activation patterns in networks. Advances in Neural Information Processing Systems, 13, 2010. [23] James Sharpnack, Alessandro Rinaldo, and Aarti Singh. Sparsistency of the edge lasso over graphs. Proceedings of the International Conference on Artificial Intelligence and Statistics, 15:1028–1036, 2012. [24] Alexander Smola and Risi Kondor. Kernels and regularization on graphs. Proceedings of the Annual Conference on Learning Theory, 16, 2003. [25] Robert Tibshirani, Michael Saunders, Saharon Rosset, Ji Zhu, and Keith Knight. Sparsity and smoothness via the fused lasso. Journal of the Royal Statistical Society: Series B, 67(1):91–108, 2005. [26] Ryan J. Tibshirani. Adaptive piecewise polynomial estimation via trend filtering. Annals of Statistics, 42 (1):285–323, 2014. [27] Ryan J. Tibshirani and Jonathan Taylor. The solution path of the generalized lasso. Annals of Statistics, 39 (3):1335–1371, 2011. [28] Yilun Wang, Junfeng Yang, Wotao Yin, and Yin Zhang. A new alternating minimization algorithm for total variation image reconstruction. SIAM Journal on Imaging Sciences, 1(3):248–272, 2008. [29] Yu-Xiang Wang, James Sharpnack, Alex Smola, and Ryan J. Tibshirani. Trend filtering on graphs. Journal of Machine Learning Research, 2016. To appear. [30] Xiaojin Zhu, Zoubin Ghahramani, and John Lafferty. Semi-supervised learning using Gaussian fields and harmonic functions. International Conference on Machine Learning (ICML-03), 20, 2003. 9
2016
61
6,521
Hardness of Online Sleeping Combinatorial Optimization Problems Satyen Kale∗† Yahoo Research satyen@satyenkale.com Chansoo Lee† Univ. of Michigan, Ann Arbor chansool@umich.edu D´avid P´al Yahoo Research dpal@yahoo-inc.com Abstract We show that several online combinatorial optimization problems that admit efficient no-regret algorithms become computationally hard in the sleeping setting where a subset of actions becomes unavailable in each round. Specifically, we show that the sleeping versions of these problems are at least as hard as PAC learning DNF expressions, a long standing open problem. We show hardness for the sleeping versions of ONLINE SHORTEST PATHS, ONLINE MINIMUM SPANNING TREE, ONLINE k-SUBSETS, ONLINE k-TRUNCATED PERMUTATIONS, ONLINE MINIMUM CUT, and ONLINE BIPARTITE MATCHING. The hardness result for the sleeping version of the Online Shortest Paths problem resolves an open problem presented at COLT 2015 [Koolen et al., 2015]. 1 Introduction Online learning is a sequential decision-making problem where learner repeatedly chooses an action in response to adversarially chosen losses for the available actions. The goal of the learner is to minimize the regret, defined as the difference between the total loss of the algorithm and the loss of the best fixed action in hindsight. In online combinatorial optimization, the actions are subsets of a ground set of elements (also called components) with some combinatorial structure. The loss of an action is the sum of the losses of its elements. A particular well-studied instance is the ONLINE SHORTEST PATH problem [Takimoto and Warmuth, 2003] on a graph, in which the actions are the paths between two fixed vertices and the elements are the edges. We study a sleeping variant of online combinatorial optimization where the adversary not only chooses losses but availability of the elements every round. The unavailable elements are called sleeping or sabotaged. In ONLINE SABOTAGED SHORTEST PATH problem, for example, the adversary specifies unavailable edges every round, and consequently the learner cannot choose any path using those edges. A straightforward application of the sleeping experts algorithm proposed by Freund et al. [1997] gives a no-regret learner, but it takes exponential time (in the input graph size) every round. The design of a computationally efficient no-regret algorithm for ONLINE SABOTAGED SHORTEST PATH problem was presented as an open problem at COLT 2015 by Koolen et al. [2015]. In this paper, we resolve this open problem and prove that ONLINE SABOTAGED SHORTEST PATH problem is computationally hard. Specifically, we show that a polynomial-time low-regret algorithm for this problem implies a polynomial-time algorithm for PAC learning DNF expressions, which is a long-standing open problem. The best known algorithm for PAC learning DNF expressions on n variables has time complexity 2 e O(n1/3) [Klivans and Servedio, 2001]. ∗Current affiliation: Google Research. †This work was done while the authors were at Yahoo Research. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Our reduction framework (Section 4) in fact shows a general result that any online sleeping combinatorial optimization problem with two simple structural properties is as hard as PAC learning DNF expressions. Leveraging this result, we obtain hardness results for the sleeping variant of wellstudied online combinatorial optimization problems for which a polynomial-time no-regret algorithm exists: ONLINE MINIMUM SPANNING TREE, ONLINE k-SUBSETS, ONLINE k-TRUNCATED PERMUTATIONS, ONLINE MINIMUM CUT, and ONLINE BIPARTITE MATCHING (Section 5). Our hardness result applies to the worst-case adversary as well as a stochastic adversary, who draws an i.i.d. sample every round from a fixed (but unknown to the learner) joint distribution over availabilities and losses. This implies that no-regret algorithms would require even stronger restrictions on the adversary. 1.1 Related Work Online Combinatorial Optimization. The standard problem of online linear optimization with d actions (Experts setting) admits algorithms with O(d) running time per round and O(√T log d) regret after T rounds [Littlestone and Warmuth, 1994, Freund and Schapire, 1997], which is minimax optimal [Cesa-Bianchi and Lugosi, 2006, Chapter 2]. A naive application of such algorithms to online combinatorial optimization problem (precise definitions to be given momentarily) over a ground set of d elements will result in exp(O(d)) running time per round and O( √ Td) regret. Despite this, many online combinatorial optimization problems, such as the ones considered in this paper, admit algorithms with3 poly(d) running time per round and O(poly(d) √ T) regret [Takimoto and Warmuth, 2003, Kalai and Vempala, 2005, Koolen et al., 2010, Audibert et al., 2013]. In fact, Kalai and Vempala [2005] shows that the existence of a polynomial-time algorithm for an offline combinatorial problem implies the existence of an algorithm for the corresponding online optimization problem with the same per-round running time and O(poly(d) √ T) regret. Online Sleeping Optimization. In studying online sleeping optimization, three different notions of regret have been used: (a) policy regret, (b) ranking regret, and (c) per-action regret, in decreasing order of computational hardness to achieve no-regret. Policy regret is the total difference between the loss of the algorithm and the loss of the best policy, which maps a set of available actions and the observed loss sequence to an available action [Neu and Valko, 2014]. Ranking regret is the total difference between the loss of the algorithm and the loss of the best ranking of actions, which corresponds to a policy that chooses in each round the highest-ranked available action [Kleinberg et al., 2010, Kanade and Steinke, 2014, Kanade et al., 2009]. Per-action regret is the difference between the loss of the algorithm and the loss of an action, summed over only the rounds in which the action is available [Freund et al., 1997, Koolen et al., 2015]. Note that policy regret upper bounds ranking regret, and while ranking regret and per-action regret are generally incomparable, per-action regret is usually the smallest of the three notions. The sleeping Experts (also known as Specialists) setting has been extensively studied in the literature [Freund et al., 1997, Kanade and Steinke, 2014]. In this paper we focus on the more general online sleeping combinatorial optimization problem, and in particular, the per-action notion of regret. A summary of known results for online sleeping optimization problems is given in Figure 1. Note in particular that an efficient algorithm was known for minimizing per-action regret in the sleeping Experts problem [Freund et al., 1997]. We show in this paper that a similar efficient algorithm for minimizing per-action regret in online sleeping combinatorial optimization problems cannot exist, unless there is an efficient algorithm for learning DNFs. Our reduction technique is closely related to that of Kanade and Steinke [2014], who reduced agnostic learning of disjunctions to ranking regret minimization in the sleeping Experts setting. 2 Preliminaries An instance of online combinatorial optimization is defined by a ground set U of d elements, and a decision set D of actions, each of which is a subset of U. In each round t, the online learner is required to choose an action Vt ∈D, while simultaneously an adversary chooses a loss function 3In this paper, we use the poly(·) notation to indicate a polynomially bounded function of the arguments. 2 Regret notion Bound Sleeping Experts Sleeping Combinatorial Opt. Policy Upper O(√T log d), under ILA [Kanade et al., 2009] O(poly(d) √ T), under ILA [Neu and Valko, 2014, AbbasiYadkori et al., 2013] Lower Ω(poly(d)T 1−δ), under SLA [Abbasi-Yadkori et al., 2013] Ranking Lower Ω(poly(d)T 1−δ), under SLA Ω(exp(Ω(d)) √ T), under SLA [Kanade and Steinke, 2014] [Easy construction, omitted] Per-action Upper O(√T log d), adversarial setting [Freund et al., 1997] Lower Ω(poly(d)T 1−δ), under SLA [This paper] Figure 1: Summary of known results. Stochastic Losses and Availabilities (SLA) assumption is where adversary chooses a joint distribution over loss and availability before the first round, and takes an i.i.d. sample every round. Independent Losses and Availabilities (ILA) assumption is where adversary chooses losses and availabilities independently of each other (one of the two may be adversarially chosen; the other one is then chosen i.i.d in each round). Policy regret upper bounds ranking regret which in turn upper bounds per-action regret for the problems of interest; hence some bounds shown in some cells of the table carry over to other cells by implication and are not shown for clarity. The lower bound on ranking regret in online sleeping combinatorial optimization is unconditional and holds for any algorithm, efficient or not. All other lower bounds are computational, i.e. for polynomial time algorithms, assuming intractability of certain well-studied learning problems, such as learning DNFs or learning noisy parities. ℓt : U →[−1, 1]. The loss of any V ∈D is given by (with some abuse of notation) ℓt(V ) := P e∈V ℓt(e). The learner suffers loss ℓt(Vt) and obtains ℓt as feedback. The regret of the learner with respect to an action V ∈D is defined to be RegretT (V ) := PT t=1 ℓt(Vt) −ℓt(V ). We say that an online optimization algorithm has a regret bound of f(d, T) if RegretT (V ) ≤f(d, T) for all V ∈D. We say that the algorithm has no regret if f(d, T) = poly(d)T 1−δ for some δ ∈(0, 1), and it is computationally efficient if it has a per-round running time of order poly(d, T). We now define an instance of the online sleeping combinatorial optimization. In this setting, at the start of each round t, the adversary selects a set of sleeping elements St ⊆U and reveals it to the learner. Define At = {V ∈D | V ∩St = ∅}, the set of awake actions at round t; the remaining actions in D, called sleeping actions, are unavailable to the learner for that round. If At is empty, i.e., there are no awake actions, then the learner is not required to do anything for that round and the round is discarded from computation of the regret. For the rest of the paper, unless noted otherwise, we use per-action regret as our performance measure. Per-action regret with respect to V ∈D is defined as: RegretT (V ) := X t: V ∈At ℓt(Vt) −ℓt(V ). (1) In other words, our notion of regret considers only the rounds in which V is awake. For clarity, we define an online combinatorial optimization problem as a family of instances of online combinatorial optimization (and correspondingly for online sleeping combinatorial optimization). For example, ONLINE SHORTEST PATH problem is the family of all instances of all graphs with designated source and sink vertices, where the decision set D is a set of paths from the source to sink, and the elements are edges of the graph. Our main result is that many natural online sleeping combinatorial optimization problems are unlikely to admit a computationally efficient no-regret algorithm, although their non-sleeping versions (i.e., At = D for all t) do. More precisely, we show that these online sleeping combinatorial optimization problems are at least as hard as PAC learning DNF expressions, a long-standing open problem. 3 3 Online Agnostic Learning of Disjunctions Instead of directly reducing PAC learning DNF expressions to no-regret learning for online sleeping combinatorial optimization problems, we use an intermediate problem, online agnostic learning of disjunctions. By a standard online-to-batch conversion argument [Kanade and Steinke, 2014], online agnostic learning of disjunctions is at least as hard as agnostic improper PAC-learning of disjunctions [Kearns et al., 1994], which in turn is at least as hard as PAC-learning of DNF expressions [Kalai et al., 2012]. The online-to-batch conversion argument allows us to assume the stochastic adversary (i.i.d. input sequence) for online agnostic learning of disjunctions, which in turn implies that our reduction applies to online sleeping combinatorial optimization with a stochastic adversary. Online agnostic learning of disjunctions is a repeated game between the adversary and a learning algorithm. Let n denote the number of variables in the disjunction. In each round t, the adversary chooses a vector xt ∈{0, 1}n, the algorithm predicts a label byt ∈{0, 1} and then the adversary reveals the correct label yt ∈{0, 1}. If byt ̸= yt, we say that algorithm makes an error. For any predictor φ : {0, 1}n →{0, 1}, we define the regret with respect to φ after T rounds as RegretT (φ) = PT t=1 1[byt ̸= yt] −1[φ(xt) ̸= yt]. Our goal is to design an algorithm that is competitive with any disjunction, i.e. for any disjunction φ over n variables, the regret is bounded by poly(n) · T 1−δ for some δ ∈(0, 1). Recall that a disjunction over n variables is a boolean function φ : {0, 1}n →{0, 1} that on an input x = (x(1), x(2), . . . , x(n)) outputs φ(x) = _ i∈P x(i) ! ∨ _ i∈N x(i) ! where P and N are disjoint subsets of {1, 2, . . . , n}. We allow either P or N to be empty, and the empty disjunction is interpreted as the constant 0 function. For any index i ∈{1, 2, . . . , n}, we call it a relevant index for φ if i ∈P ∪N and irrelevant index for φ otherwise. For any relevant index i, we call it positive if i ∈P and negative if i ∈N. 4 General Hardness Result In this section, we identify two combinatorial properties of online sleeping combinatorial optimization problems that are computationally hard. Definition 1. Let n be a positive integer. Consider an instance of online sleeping combinatorial optimization where the ground set U has d elements with 3n + 2 ≤d ≤poly(n). This instance is called a hard instance with parameter n, if there exists a subset Us ⊆U of size 3n + 2 and a bijection between Us and the set (i.e., labeling of elements in Us by the set) n [ i=1 {(i, 0), (i, 1), (i, ⋆)} ∪{0, 1}, such that the decision set D satisfies the following properties: 1. (Heaviness) Any action V ∈D has at least n + 1 elements in Us. 2. (Richness) For all (s1, . . . , sn+1) ∈ {0, 1, ⋆}n × {0, 1}, the action {(1, s1), (2, s2), . . . , (n, sn), sn+1} ∈Us is in D. We now show how to use the above definition of hard instances to prove the hardness of an online sleeping combinatorial optimization (OSCO) problem by reducing from the online agnostic learning of disjunction (OALD) problem. At a high level, the reduction works as follows. Given an instance of the OALD problem, we construct a specific instance of the the OSCO and a sequence of losses and availabilities based on the input to the OALD problem. This reduction has the property that for any disjunction, there is a special set of actions of size n + 1 such that (a) exactly one action is available in any round and (b) the loss of this action exactly equals the loss of the disjunction on the current input example. Furthermore, the action chosen by the OSCO can be converted into a prediction in the OALD problem with only lesser or equal loss. These two facts imply that the regret of the OALD algorithm is at most n + 1 times the per-action regret of the OSCO algorithm. 4 Algorithm 1 ALGORITHM ALGDISJ FOR LEARNING DISJUNCTIONS Require: An algorithm Algosco for the online sleeping combinatorial optimization problem, and the input size n for the disjunction learning problem. 1: Construct a hard instance (U, D) with parameter n of the online sleeping combinatorial optimization problem, and run Algosco on it. 2: for t = 1, 2, . . . , T do 3: Receive xt ∈{0, 1}n. 4: Set the set of sleeping elements for Algosco to be St = {(i, 1 −xt(i)) | i = 1, 2, . . . , n}. 5: Obtain an action Vt ∈D by running Algosco such that Vt ∩St = ∅. 6: Set byt = 1[0 /∈Vt]. 7: Predict byt, and receive true label yt. 8: In algorithm Algosco, set the loss of the awake elements e ∈U \ St as follows: ℓt(e) = ( 1−yt n+1 if e ̸= 0 yt −n(1−yt) n+1 if e = 0. 9: end for Theorem 1. Consider an online sleeping combinatorial optimization problem such that for any positive integer n, there is a hard instance with parameter n of the problem. Suppose there is an algorithm Algosco that for any instance of the problem with ground set U of size d, runs in time poly(T, d) and has regret bounded by poly(d) · T 1−δ for some δ ∈(0, 1). Then, there exists an algorithm Algdisj for online agnostic learning of disjunctions over n variables with running time poly(T, n) and regret poly(n) · T 1−δ. Proof. Algdisj is given in Algorithm 1. First, we note that in each round t, we have ℓt(Vt) ≥1[yt ̸= byt]. (2) We prove this separately for two different cases; in both cases, the inequality follows from the heaviness property, i.e., the fact that |Vt| ≥n + 1. 1. If 0 /∈Vt, then the prediction of Algdisj is byt = 1, and thus ℓt(Vt) = |Vt| · 1 −yt n + 1 ≥1 −yt = 1[yt ̸= byt]. 2. If 0 ∈Vt, then the prediction of Algdisj is byt = 0, and thus ℓt(Vt) = (|Vt| −1) · 1 −yt n + 1 +  yt −n(1 −yt) n + 1  ≥yt = 1[yt ̸= byt]. Note that if Vt satisfies the equality |Vt| = n + 1, then we have an equality ℓt(Vt) = 1[yt ̸= byt]; this property will be useful later. Next, let φ be an arbitrary disjunction, and let i1 < i2 < · · · < im be its relevant indices sorted in increasing order. Define fφ : {1, 2, . . . , m} →{0, 1} as fφ(j) := 1[ij is a positive index for φ], and define the set of elements Wφ := {(i, ⋆) | i is an irrelevant index for φ}. Finally, let Dφ = {V 1 φ , V 2 φ , . . . , V m+1 φ } be the set of m + 1 actions where for j = 1, 2, . . . , m, we define V j φ := {(iℓ, 1 −fφ(ℓ)) | 1 ≤ℓ< j} ∪{(ij, fφ(j))} ∪{(iℓ, ⋆) | j < ℓ≤m} ∪Wφ ∪{1}, and V m+1 φ := {(iℓ, 1 −fφ(ℓ)) | 1 ≤ℓ≤m} ∪Wφ ∪{0}. The actions in Dφ are indeed in the decision set D due to the richness property. We claim that Dφ contains exactly one awake action in every round and the awake action contains the element 1 if and only if φ(xt) = 1. First, we prove uniqueness: if V j φ and V k φ (where j < k) are both awake in the same round, then (ij, fφ(j)) ∈V j φ and (ij, 1 −fφ(j)) ∈V k φ are both awake elements, contradicting our choice of St. To prove the rest of the claim, we consider two cases: 5 1. If φ(xt) = 1, then there is at least one j ∈{1, 2, . . . , m} such that xt(ij) = fφ(j). Let j′ be the smallest such j. Then, by construction, the set V j′ φ is awake at time t, and 1 ∈V j′ φ , as required. 2. If φ(xt) = 0, then for all j ∈{1, 2, . . . , m} we must have xt(ij) = 1 −fφ(j). Then, by construction, the set V m+1 φ is awake at time t, and 0 ∈V m+1 φ , as required. Since every action in Dφ has exactly n + 1 elements, and if V is awake action in Dφ at time t, we just showed that 1 ∈V if and only if φ(xt) = 1, exactly the same argument as in the beginning of this proof implies that ℓt(V ) = 1[yt ̸= φ(xt)]. (3) Furthermore, since exactly one action in Dφ is awake every round, we have T X t=1 1[yt ̸= φ(xt)] = X V ∈Dφ X t: V ∈At ℓt(V ). (4) Finally, we can bound the regret of algorithm Algdisj (denoted Regretdisj T ) in terms of the regret of algorithm Algosco (denoted Regretosco T ) as follows: Regretdisj T (φ) = T X t=1 1[byt ̸= yt] −1[φ(xt) ̸= yt] ≤ X V ∈Dφ X t: V ∈At ℓt(Vt) −ℓt(V ) = X V ∈Dφ Regretosco T (V ) ≤|Dφ| · poly(d) · T 1−δ = poly(n) · T 1−δ, The first inequality follows by (2) and (4), and the last equation since |Dφ| ≤n + 1 and d ≤ poly(n). 4.1 Hardness results for Policy Regret and Ranking Regret It is easy to see that our technique for proving hardness easily extends to ranking regret (and therefore, policy regret). The reduction simply uses any algorithm for minimizing ranking regret in Algorithm 1 as Algosco. This is because in the proof of Theorem 1, the set Dφ has the property that exactly one action Vt ∈Dφ is awake in any round t, and ℓt(Vt) = 1[yt ̸= byt]. Thus, if we consider a ranking where the actions in Dφ are ranked at the top positions (in arbitrary order), the loss of this ranking exactly equals the number of errors made by the disjunction φ on the input sequence. The same arguments as in the proof of Theorem 1 then imply that the regret of Algdisj is bounded by that of Algosco, implying the hardness result. 5 Hard Instances for Specific Problems Now we apply Theorem 1 to prove that many online sleeping combinatorial optimization problems are as hard as PAC learning DNF expressions by constructing hard instances for them. Note that all these problems admit efficient no-regret algorithms in the non-sleeping setting. 5.1 Online Shortest Path Problem In the ONLINE SHORTEST PATH problem, the learner is given a directed graph G = (V, E) and designated source and sink vertices s and t. The ground set is the set of edges, i.e. U = E, and the decision set D is the set of all paths from s to t. The sleeping version of this problem has been called the ONLINE SABOTAGED SHORTEST PATH problem by Koolen et al. [2015], who posed the open question of whether it admits an efficient no-regret algorithm. For any n ∈N, a hard instance is the graph G(n) shown in Figure 2. It has 3n + 2 edges that are labeled by the elements of ground set U = Sn i=1{(i, 0), (i, 1), (i, ⋆)} ∪{0, 1}, as required. Now note that any s-t path in this graph has length exactly n + 1, so D satisfies the heaviness property. Furthermore, the richness property is clearly satisfied, since for any s ∈{0, 1, ⋆}n × {0, 1}, the set of edges {(1, s1), (2, s2), . . . , (n, sn), sn+1} is an s-t path and therefore in D. 6 (2, 1) (2, 0) v2 s v1 vn−1 vn t (1, 0) (n, 0) (1, 1) (n, 1) (1, ⋆) (2, ⋆) (n, ⋆) 1 0 Figure 2: Graph G(n). u1 v1,1 (1, 0) (1, 1) (1, ⋆) v1,⋆ v1,0 u2 v2,1 (2, 0) (2, 1) (2, ⋆) v2,⋆ v2,0 un vn,1 (n, 0) (n, 1) (n, ⋆) vn,⋆ vn,0 1 0 un+1 1 0 Figure 3: Graph P (n). This is a complete bipartite graph as described in the text, but only the special labeled edges shown for clarity. 5.2 Online Minimum Spanning Tree Problem In the ONLINE MINIMUM SPANNING TREE problem, the learner is given a fixed graph G = (V, E). The ground set here is the set of edges, i.e. U = E, and the decision set D is the set of spanning trees in the graph. For any n ∈N, a hard instance is the same graph G(n) shown in Figure 2, except that the edges are undirected. Note that the spanning trees in G(n) are exactly the paths from s to t. The hardness of this problem immediately follows from the hardness of the ONLINE SHORTEST PATHS problem. 5.3 Online k-Subsets Problem In the ONLINE k-SUBSETS problem, the learner is given a fixed ground set of elements U. The decision set D is the set of subsets of U of size k. For any n ∈N, we construct a hard instance with parameter n of the ONLINE k-SUBSETS problem with k = n + 1 and d = 3n + 2. The set D of all subsets of size k = n + 1 of a ground set U of size d = 3n + 2 clearly satisfies both the heaviness and richness properties. 5.4 Online k-Truncated Permutations Problem In the ONLINE k-TRUNCATED PERMUTATIONS problem (also called the ONLINE k-RANKING problem), the learner is given a complete bipartite graph with k nodes on one side and m ≥k nodes on the other, and the ground set U is the set of all edges; thus d = km. The decision set D is the set of all maximal matchings, which can be interpreted as truncated permutations of k out of m objects. For any n ∈N, we construct a hard instance with parameter n of the ONLINE k-TRUNCATED PERMUTATIONS problem with k = n + 1, m = 3n + 2 and d = km = (n + 1)(3n + 2). Let L = {u1, u2, . . . , un+1} be the nodes on the left side of the bipartite graph, and since m = 3n + 2, let R = {vi,0, vi,1, vi,⋆| i = 1, 2, . . . , n} ∪{v0, v1} denote the nodes on the right side of the graph. The ground set U consists of all d = km = (n + 1)(3n + 2) edges joining nodes in L to nodes in R. We now specify the special 3n + 2 elements of the ground set U: for i = 1, 2, . . . , n, label the edges (ui, vi,0), (ui, vi,1), (ui, vi,⋆) by (i, 0), (i, 1), (i, ⋆) respectively. Finally, label the edges (un+1, v0), (un+1, v1) by 0 and 1 respectively. The resulting bipartite graph P (n) is shown in Figure 3, where only the special labeled edges are shown for clarity. Now note that any maximal matching in this graph has exactly n+1 edges, so the heaviness condition is satisfied. Furthermore, the richness property is satisfied, since for any s ∈{0, 1, ⋆}n × {0, 1}, the set of edges {(1, s1), (2, s2), . . . , (n, sn), sn+1} is a maximal matching and therefore in D. 7 u1 v1 un+1 vn+1 (1, 0) (1, 1) (1, ⋆) 1 0 u2 v2 (2, 0) (2, 1) (2, ⋆) un vn (n, 0) (n, 1) (n, ⋆) Figure 4: Graph M (n) for the ONLINE BIPARTITE MATCHING problem. u1 v1 (1, 0) (1, 1) (1, ⋆) 1 0 u2 v2 (2, 0) (2, 1) (2, ⋆) un vn (n, 0) (n, 1) (n, ⋆) s t w Figure 5: Graph C(n) for the ONLINE MINIMUM CUT problem. 5.5 Online Bipartite Matching Problem In the ONLINE BIPARTITE MATCHING problem, the learner is given a fixed bipartite graph G = (V, E). The ground set here is the set of edges, i.e. U = E, and the decision set D is the set of maximal matchings in G. For any n ∈N, a hard instance with parameter n is the graph M (n) shown in Figure 4. It has 3n + 2 edges that are labeled by the elements of ground set U = Sn i=1{(i, 0), (i, 1), (i, ⋆)} ∪{0, 1}, as required. Now note that any maximal matching in this graph has size exactly n + 1, so D satisfies the heaviness property. Furthermore, the richness property is clearly satisfied, since for any s ∈{0, 1, ⋆}n × {0, 1}, the set of edges {(1, s1), (2, s2), . . . , (n, sn), sn+1} is a maximal matching and therefore in D. 5.6 Online Minimum Cut Problem In the ONLINE MINIMUM CUT problem the learner is given a fixed graph G = (V, E) with a designated pair of vertices s and t. The ground set here is the set of edges, i.e. U = E, and the decision set D is the set of cuts separating s and t: a cut here is a set of edges that when removed from the graph disconnects s from t. For any n ∈N, a hard instance is the graph C(n) shown in Figure 5. It has 3n + 2 edges that are labeled by the elements of ground set U = Sn i=1{(i, 0), (i, 1), (i, ⋆)} ∪ {0, 1}, as required. Now note that any cut in this graph has size at least n + 1, so D satisfies the heaviness property. Furthermore, the richness property is clearly satisfied, since for any s ∈ {0, 1, ⋆}n × {0, 1}, the set of edges {(1, s1), (2, s2), . . . , (n, sn), sn+1} is a cut and therefore in D. 6 Conclusion In this paper we showed that obtaining an efficient no-regret algorithm for sleeping versions of several natural online combinatorial optimization problems is as hard as efficiently PAC learning DNF expressions, a long-standing open problem. Our reduction technique requires only very modest conditions for hard instances of the problem of interest, and in fact is considerably more flexible than the specific form presented in this paper. We believe that almost any natural combinatorial optimization problem that includes instances with exponentially many solutions will be a hard problem in its online sleeping variant. Furthermore, our hardness result is via stochastic i.i.d. availabilities and losses, a rather benign form of adversary. This suggests that obtaining sublinear per-action regret is perhaps a rather hard objective, and suggests that to obtain efficient algorithms we might need to either (a) make suitable simplifications of the regret criterion or (b) restrict the adversary’s power. 8 References Yasin Abbasi-Yadkori, Peter L. Bartlett, Varun Kanade, Yevgeny Seldin, and Csaba Szepesv´ari. Online learning in markov decision processes with adversarially chosen transition probability distributions. In Advances in Neural Information Processing Systems (NIPS), pages 2508–2516, 2013. Jean-Yves Audibert, Bubeck S´ebastien, and G´abor Lugosi. Regret in online combinatorial optimization. Mathematics of Operations Research, 39(1):31–45, 2013. Nicol`o Cesa-Bianchi and G´abor Lugosi. Prediction, Learning and Games. Cambridge University Press, New York, NY, 2006. 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. Yoav Freund, Robert E. Schapire, Yoram Singer, and Warmuth K. Manfred. Using and combining predictors that specialize. In Proceedings of the 29th Annual ACM symposium on Theory of Computing, pages 334–343. ACM, 1997. Adam Kalai and Santosh Vempala. Efficient algorithms for online decision problems. Journal of Computer and System Sciences, 71(3):291–307, 2005. Adam Tauman Kalai, Varun Kanade, and Yishay Mansour. Reliable agnostic learning. Journal of Computer and System Sciences, 78(5):1481–1495, 2012. Varun Kanade and Thomas Steinke. Learning hurdles for sleeping experts. ACM Transactions on Computation Theory (TOCT), 6(3):11, 2014. Varun Kanade, H. Brendan McMahan, and Brent Bryan. Sleeping experts and bandits with stochastic action availability and adversarial rewards. In Proceedings of the 12th International Conference on Artificial Intelligence and Statistics (AISTATS), pages 272–279, 2009. Michael J. Kearns, Robert E. Schapire, and Linda M. Sellie. Toward efficient agnostic learning. Machine Learning, 17(2–3):115–141, 1994. Robert Kleinberg, Alexandru Niculescu-Mizil, and Yogeshwer Sharma. Regret bounds for sleeping experts and bandits. Machine learning, 80(2-3):245–272, 2010. Adam R. Klivans and Rocco Servedio. Learning DNF in Time 2 ˜ O(n1/3). In Proceedings of the 33rd Annual ACM Symposium on Theory of Computing (STOC), pages 258–265. ACM, 2001. Wouter M. Koolen, Manfred K. Warmuth, and Jyrki Kivinen. Hedging structured concepts. In Adam Tauman Kalai and Mehryar Mohri, editors, Proceedings of the 23th Conference on Learning Theory (COLT), pages 93–105, 2010. Wouter M. Koolen, Manfred K. Warmuth, and Dmitry Adamskiy. Open problem: Online sabotaged shortest path. In Proceedings of the 28th Conference on Learning Theory (COLT), 2015. Nick Littlestone and Manfred K. Warmuth. The weighted majority algorithm. Information and computation, 108(2):212–261, 1994. Gergely Neu and Michal Valko. Online combinatorial optimization with stochastic decision sets and adversarial losses. In Advances in Neural Information Processing Systems, pages 2780–2788, 2014. Eiji Takimoto and Manfred K. Warmuth. Path kernels and multiplicative updates. The Journal of Machine Learning Research, 4:773–818, 2003. 9
2016
62
6,522
Density Estimation via Discrepancy Based Adaptive Sequential Partition Dangna Li ICME, Stanford University Stanford, CA 94305 dangna@stanford.edu Kun Yang Google Mountain View, CA 94043 kunyang@stanford.edu Wing Hung Wong Department of Statistics Stanford University Stanford, CA 94305 whwong@stanford.edu Abstract Given iid observations from an unknown absolute continuous distribution defined on some domain Ω, we propose a nonparametric method to learn a piecewise constant function to approximate the underlying probability density function. Our density estimate is a piecewise constant function defined on a binary partition of Ω. The key ingredient of the algorithm is to use discrepancy, a concept originates from Quasi Monte Carlo analysis, to control the partition process. The resulting algorithm is simple, efficient, and has a provable convergence rate. We empirically demonstrate its efficiency as a density estimation method. We also show how it can be utilized to find good initializations for k-means. 1 Introduction Density estimation is one of the fundamental problems in statistics. Once an explicit estimate of the density function is constructed, various kinds of statistical inference tasks follow naturally. Given iid observations, our goal in this paper is to construct an estimate of their common density function via a nonparametric domain partition approach. As pointed out in [1], for density estimation, the bias due to the limited approximation power of a parametric family will become dominant in the over all error as the sample size grows. Hence it is necessary to adopt a nonparametric approach to handle this bias. The kernel density estimation [2] is a popular nonparametric density estimation method. Although in theory it can achieve optimal convergence rate when the kernel and the bandwidth are appropriately chosen, its result can be sensitive to the choice of bandwidth, especially in high dimension. In practice, kernel density estimation is typically not applicable to problems of dimension higher than 6. Another widely used nonparametric density estimation method in low dimension is the histogram. But similarly with kernel density estimation, it can not be scaled easily to higher dimensions. Motivated by the usefulness of histogram and the need for a method to handle higher dimensional cases, we propose a novel nonparametric density estimation method which learns a piecewise constant density function defined on a binary partition of domain Ω. A key ingredient for any partition based method is the decision for stopping. Based on the observation that for any piecewise constant density, the distribution conditioned on each sub-region is uniform, we propose to use star discrepancy, which originates from analysis of Quasi-Monte Carlo methods, to formally measure the degree of uniformity. We will see in section 4 that this allows our density estimator to have near optimal convergence rate. In summary, we highlight our contribution as follows: • To the best of our knowledge, our method is the first density estimation method that utilizes Quasi-Monte Carlo technique in density estimation. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. • We provide an error analysis on binary partition based density estimation method. We establish an O(n−1 2 ) error bound for the density estimator. The result is optimal in the sense that essentially all Monte Carlo methods have the same convergence rate. Our simulation results support the tightness of this bound. • One of the advantage of our method over existing ones is its efficiency. We demonstrate in section 5 that our method has comparable accuracy with other methods in terms of Hellinger distance while achieving an approximately 102-fold speed up. • Our method is a general data exploration tool and is readily applicable to many important learning tasks. Specifically, we demonstrate in section 5.3 how it can be used to find good initializations for k-means. 2 Related work Existing domain partition based density estimators can be divided into two categories: the first category belongs to the Bayesian nonparametric framework. Optional Pólya Tree (OPT) [3] is a class of nonparametric conjugate priors on the set of piecewise constant density functions defined on some partition of Ω. Bayesian Sequential Partitioning (BSP) [1] is introduced as a computationally more attractive alternative to OPT. Inferences for both methods are performed by sampling from the posterior distribution of density functions. Our improvement over these two methods is two-fold. First, we no longer restrict the binary partition to be always at the middle. By introducing a new statistic called the “gap”, we allow the partitions to be adaptive to the data. Second, our method does not stem from a Bayesian origin and proceeds in a top down, greedy fashion. This makes our method computationally much more attractive than OPT and BSP, whose inference can be quite computationally intensive. The second category is tree based density estimators [4] [5]. As an example, Density Estimation Trees [5] is generalization of classification trees and regression trees for the task of density estimation. Its tree based origin has led to a loss minimization perspective: the learning of the tree is done by minimizing the integrated squared error. However, the true loss function can only be approximated by a surrogate and the optimization problem is difficult to solve. The objective of our method is much simpler and leads to an intuitive and efficient algorithm. 3 Main algorithm 3.1 Notations and definitions In this paper we consider the problem of estimating a joint density function f from a given set of observations. Without loss of generality, we assume the data domain Ω= [0, 1]d, a hyper-rectangle in Rd. We use the short hand notation [a, b] = Qd j=1[aj, bj] to denote a hyper-rectangle in Rd, where a = (a1, · · · , ad), b = (b1, · · · , bd) ∈[0, 1]d. Each (aj, bj) pair specifies the lower and upper bound of the hyper-rectangle along dimension j. We restrict our attention to the class of piecewise constant functions after balancing the trade-off between simplicity and representational power: Ideally, we would like the function class to have concise representation while at the same time allowing for efficient evaluation. On the other hand, we would like to be able to approximate any continuous density function arbitrarily well (at least as the sample size goes to infinity). This trade-off has led us to choose the set of piecewise constant functions supported on binary partitions: First, we only need 2d + 1 floating point numbers to uniquely define a sub-rectangle (2d for its location and 1 for its density value). Second, it is well known that the set of positive, integrable, piesewise constant functions is dense in Lp for p ∈[1, ∞). The binary partition we consider can be defined in the following recursive way: starting with P0 = Ω. Suppose we have a binary partition Pt = {Ω(1), · · · , Ω(t)} at level t, where ∪t i=1Ω(i) = Ω, Ω(i) ∩Ω(j) = ∅, i ̸= j, a level t + 1 partition Pt+1 is obtained by dividing one sub-rectangle Ω(i) in Pt along one of its coordinates, parallel to one of the dimension. See Figure 1 for an illustration. 3.2 Adaptive partition and discrepancy control The above recursive build up has two key steps. The first is to decide whether to further split a subrectangle. One helpful intuition is that for piecewise constant densities, the distribution conditioned on each sub-rectangle is uniform. Therefore the partition should stop when the points inside a subrectangle are approximatly uniformly scattered. In other words, we stop the partition when further 2 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● A:1/60 B:1/60 C:2/60 D:7/60 ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Figure 1: Left: a sequence of binary partition and the corresponding tree representation; if we encode partitioning information (e.g., the location where the split occurs) in the nodes, there is a one to one mapping between the tree representations and the partitions. Right: the gaps with m = 3, we split the rectangle at location D, which corresponds to the largest gap (Assuming it does not satisfy (2), see the text for more details) . partitioning does not reveal much additional information about the underlying density landscape. We propose to use star discrepancy, which is a concept originates from the analysis of Quasi-Monte Carlo methods, to formally measure the degree of uniformity of points in a sub-rectangle. Star discrepancy is defined as: Definition 1. Given n points Xn = {x1, ..., xn} in [0, 1]d. The star discrepancy D∗(Xn) is defined as: D∗(Xn) = sup a∈[0,1]d 1 n n X i=1 1{xi ∈[0, a)} − d Y j=1 aj (1) The supremum is taken over all d-dimensional sub-rectangles [0, a). Given star discrepancy D∗(Xn), we have the following error bound for Monte Carlo integration (See [6] for a proof): Theorem 2. (Koksma-Hlawka inequality) Let Xn = {x1, x2, ..., xn} be a set of points in [0, 1]d with discrepancy D∗(Xn); Let f be a function on [0, 1]d of bounded variation V(f). Then, Z [0,1]d f(x)dx −1 n n X i=1 f(xi) ≤V(f)D∗(Xn) where V(f) is the total variation in the sense of Hardy and Krause (See [7] for its precise definition). The above theorem implies if the star discrepancy D∗(Xn) is under control, the empirical distribution will be a good approximation to the true distribution. Therefore, we may decide to keep partitioning a sub-rectangle until its discrepancy is lower than some threshold. We shall see in section 4 that this provably guarantees our density estimate is a good approximation to the true density function. Another important ingredient of all partition based methods is the choice of splitting point. In order to find a good location to split for [a, b] = Qd j=1[aj, bj], we divide jth dimension into m equal-sized bins: [aj, aj + (bj −aj)/m], ..., [aj + (bj −aj)(m −2)/m, aj + (bj −aj)(m −1)/m] and keep track of the gaps at aj + (bj −aj)/m, ..., aj + (bj −aj)(m −1)/m, where the gap gjk is defined as |(1/n) Pn i=1 1(xij < aj + (bj −aj)k/m) −k/m| for k = 1, ..., (m −1), there are total (m −1)d gaps recorded (Figure 1). Here m is a hyper-parameter chosen by the user. [a, b] is split into two sub-rectangles along the dimension and location corresponding to maximum gap (Figure 1). The pseudocode for the complete algorithm is given in Algorithm 1. We refer to this algorithm as DSP in the sequel. One distinct feature of DSP is it only requires the user to specify two parameters: m, θ, where m is the number of bins along each dimension; θ is the parameter for discrepancy control (See theorem 2 for more details). In some applications, the user may prefer putting an upper bound on the number of total partitions. In that case, there is typically no need to specify θ. Choices for these parameters are discussed in Section 5. The resulting density estimates ˆp is a piecewise constant function defined on a binary partition of Ω: ˆp(x) = PL i=1 d(ri)1{x ∈ri} where 1 is the indicator function; L is the total number of sub-rectangles in the final partition; {ri, d(ri)}L i=1 are the sub-rectangle and density pairs. We demonstrate in section 5 how ˆp(x) can be leveraged to find good initializations for k-means. In the following section, we establish a convergence result of our density estimator. 3 Algorithm 1 Density Estimation via Discrepancy Based Sequential Partition (DSP) Input: XN, m, θ Output: A piecewise constant function Pr(·) defined on a binary partition R Let Pr(r) denote the probability mass of region r ⊂Ω; let XN(r) denote the points in XN that lie within r, where r ⊂Ω. ni denotes the size of set X(i). 1: procedure DSP(XN, m, θ) 2: B = {[0, 1]d}, Pr([0, 1]d) = 1 3: while true do 4: R′ = ∅ 5: for each ri = [a(i), b(i)] in R do 6: Calculate gaps {gjk}j=1,...,d,k=1,...,m−1 7: Scale X(ri) = {xil}ni l=1 to ˜ X(i) = {˜xil = ( xil,1−a(i) 1 b(i) 1 , ..., xil,d−a(i) d b(i) d )}ni l=1 8: if X(ri) ̸= ∅and D∗( ˜ X(i)) > θ √ N/ni then ▷Condition (2) in Theorem 4 9: Split ri into ri1 = [a(i1), b(i1)] and ri2 = [a(i2), b(i2)] along the max gap (Figure 1). 10: Pr(ri1) = Pr(ri) |P (ri1 )| ni , Pr(ri2) = Pr(ri) −Pr(ri1) 11: R′ = R′ ∪{ri1, ri2} 12: else R′ = R′ ∪{ri} 13: if R′ ̸= R then R = R′ 14: else return R, Pr(·) 4 Theoretical results Before we establish our main theorem, we need the following lemma:1 Lemma 3. Let D∗ n = inf{x1,...,xn}∈[0,1]d D∗(x1, ..., xn), then we have D∗ n ≤c r d n for all n, d ∈R+, where c is some positive constant. We now state our main theorem: Theorem 4. Let f be a function defined on Ω= [0, 1]d with bounded variation. Let XN = {x1, ..., xN ∈Ω} and {[a(i), b(i)], i = 1, · · · , L} be a level L binary partition of Ω. Further denote by X(i) = {xj = (xj1, ..., xjd), xj ∈[a(i), b(i)] and } ∩XN, i.e. the part of XN in sub-rectangle i. ni = |X(i)|. Suppose in each sub-rectangle [a(i), b(i)], X(i) satisfies D∗( ˜ X(i)) ≤α(i)D∗ ni (2) where ˜X(i) = {˜xj = ( xj1−a(i) 1 b(i) 1 , ..., xjd−a(i) d b(i) d ), xj ∈X(i)} , α(i) = q N nid θ c for some positive constant θ, D∗ ni is defined as in lemma 3. Then Z [0,1]d f(x)ˆp(x)dx −1 N N X i=1 f(xi) ≤ θ √ N V(f) (3) where ˆp(x) is a piecewise constant density estimator given by ˆp(x) = L X i=1 di1{x ∈[a(i), b(i)]} with di = (Qd j=1(b(i) j −a(i) j ))−1ni/N, i.e., the empirical density. In the above theorem, α(i) controls the relative uniformity of the points and is adaptive to X(i). It imposes more restrictive constraints on regions containing larget proportion of the sample (ni/N). Although our density estimate is not the only estimator which satisfies (3), (for example, both the empirical distribution in the asymptotic limit and kernel density estimator with sufficiently small bandwidth meet the criterion), one advantage of our density estimator is that it provides a very concise 1The proof for Lemma 3 can be found in [8]. Theorem 4 and Corollary 5 are proved in the supplementary material. 4 summary of the data while at the same time capturing the landscape of the underlying distribution. In addition, the piecewise constant function does not suffer from having too many “local bumps”, which is a common problem for kernel density estimator. Moreover, under certain regularity conditions (e.g. bounded second moments), the convergence rate of Monte Carlo methods for 1 N PN i=1 f(xi) to R [0,1]d f(x)p(x)dx is of order O(N −1 2 ). Our density estimate is optimal in the sense that it achieves the same rate of convergence. Given theorem 4, we have the following convergence result: Corollary 5. Let ˆp(x) be the estimated density function as in theorem 4. For any hyper-rectangle A = [a, b] ⊂[0, 1]d, let ˆP(A) = R A ˆp(x)dx and P(A) = R A p(x)dx, then sup A⊂[0,1]d | ˆP(A) −P(A)| →0 at the order O(n−1 2 ). Remark 4.1. It is worth pointing out that the total variation distance between two probability measures ˆP and P is defined as δ( ˆP, P) = supA∈B | ˆP(A) −P(A)|, where B is the Borel σ-algebra of [0, 1]d. In contrast, Corollary 5 restricts A to be hyper-rectangles. 5 Experimental results 5.1 Implementation details In some applications, we find it helpful to first estimate the marginal densities for each component variables x.j (j = 1, ..., d), then make a copula transformation z.j= ˆFj(x.j), where ˆFj is the estimated cdf of x.j. After such a transformation, we can take the domain to be [0, 1]d. Also we find this can save the number of partition needed by DSP. Unless otherwise stated, we use copula transform in our experiments whenever the dimension exceeds 3. We make the following observations to improve the efficiency of DSP: 1) First observe that maxj=1,...,d D∗({xij}n i=1) ≤D∗({xi}n i=1). Let x(i)j be the ith smallest element in {xij}n i=1, then D∗({xij}n i=1) = 1 2n + maxi |x(i)j −2i−1 2n | [9], which has complexity O(n log n). Hence maxj=1,...,d D∗({xij}n i=1) can be used to compare against θ √ L/n first before calculating D∗({xi}n i=1); 2) θ √ N/n is large when n is small, but D∗({xi}n i=1) is bounded above by 1; 3) θ √ N/n is tiny when n is large and D∗({xi}n i=1) is bounded below by cd log(d−1)/2 n−1 with some constant cd depending on d [10]; thus we can keep splitting without checking (2) when θ √ N/n ≤ϵ, where ϵ is a small positive constant (say 0.001) specified by the user. This strategy has proved to be effective in decreasing the runtime significantly at the cost of introducing a few more sub-rectangles. Another approximation works well in practice is by replacing star discrepancy with computationally attractive L2 star discrepancy, i.e., D(2)(Xn) = ( R [0,1]d | 1 n Pn i=1 1xi∈[0,a) −Qd i=1 ai|2da) 1 2 ; in fact, several statistics to test uniformity hypothesis based on D(2) are proposed in [11]; however, the theoretical guarantee in Theorem 4 no longer holds. By Warnock’s formula [9], [D(2)(Xn)]2 = 1 3d −21−d n n X i=1 d Y j=1 (1 −x2 ij) + 1 n2 n X i,l=1 d Y j=1 min{1 −xij, 1 −xlj} D(2) can be computed in O(n logd−1 n) by K. Frank and S. Heinrich’s algorithm [9]. At each scan of R in Algorithm 1, the total complexity is at most PL i=1 O(ni logd−1 ni) ≤PL i=1 O(ni logd−1 N) ≤ O(N logd−1 N). There are no closed form formulas for calculating D∗(Xn) and D∗ n except for low dimensions. If we replace α(i) in (2) and apply Lemma 3, what we are actually trying to do is to control D∗( ˜X(i)) by θ √ N/ni. There are many existing work on ways to approximate D∗(Xn). In particular, a new randomized algorithm based on threshold accepting is developed in [12]. Comprehensive numerical tests indicate that it improves upon other algorithms, especially in when 20 ≤d ≤50. We used this algorithm in our experiments. The interested readers are referred to the original paper for more details. 5 5.2 DSP as a density estimate 1) To demonstrate the method and visualize the results, we apply it on several 2-dimensional data sets simulated from 3 distributions with different geometry: 1. Gaussian: x ∼N(µ, Σ)1{x ∈[0, 1]2}, with µ = (.5, .5)T , Σ = [0.08, 0.02; 0.02, 0.02] 2. Mixture of Gaussians: x ∼1 2 P2 i=1 N(µi, Σi)1{x ∈[0, 1]2} with µ1 = (.50, .25)T , and µ2 = (.50, .75)T , Σ1 = Σ2 = [0.04, 0.01; 0.01, 0.01]; 3. Mixture of Betas: x ∼1 3(beta(2, 5)beta(5, 2)+beta(4, 2)beta(2, 4)+beta(1, 3)beta(3, 1)); where N(µ, Σ) denotes multivariate Gaussian distribution and beta(α, β) denotes beta distribution. We simulated 105 points for each distribution. See the first row of Figure 2 for visualizations of the estimated densities. The figure shows DSP accurately estimates the true density landscape in these three toy examples. 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 f1 f2 f3 f1 f2 f3 f1 f2 f3 * * * * * 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 f1 f2 f3 f1 f2 f3 f1 f2 f3 * * * * * 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 f1 f2 f3 f1 f2 f3 f1 f2 f3 * * * * * 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 f1 f2 f3 f1 f2 f3 f1 f2 f3 * * * * * 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 f1 f2 f3 f1 f2 f3 f1 f2 f3 * * * * * 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 10 2 10 3 10 4 10 5 10 6 10 -4 10 -3 10 -2 10 -1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 f1 f2 f3 f1 f2 f3 f1 f2 f3 * * * * * Figure 2: First row: estimated densities for 3 simulated 2D datasets. The modes are marked with stars. The corresponding contours of true densities are embedded for comparison. Second row: simulation of 2, 5 and 10 dimensional cases (from left to right) with reference functions f1, f2, f3. x-axis: sample size n. y-axis: error between the true integral and the estimated integral. The vertical bars are standard error bars obtained from 10 replications. See section 5.2 2) for more details. 2) To evaluate the theoretical bound (3), we choose the following three 3 reference functions with dimension d = 2, 5 and 10 respectively: f1(x) = Pn i=1 Pd j=1 x 1 2 ij, f2(x) = Pn i=1 Pd j=1 xij, f3(x) = (Pn i=1 Pd j=1 x 1 2 ij)2. We generate n ∈{102, 103, 104, 105, 106} samples from p(x) = 1 2  Qd j=1 beta(xj, 15, 5) + Qd j=1 beta(xj, 5, 15)  , where beta(·, α, β) is the density function of beta distribution. The error | R [0,1]d fk(x)p(x)dx − R [0,1]d fk(x)ˆp(x)dx| is bounded by | R [0,1]d fk(x)p(x)dx − 1 n Pn j=1 fk(xj)| + | R [0,1]d fk(x)ˆp(x)dx −1 n Pn j=1 fk(xj)| where ˆp(x) is the estimated density; For almost all Monte Carlo methods, the first term is of order O(n−1 2 ). The second term is controlled by (3). Thus in total the error is of order O(n−1 2 ). We have plot the error against the sample size on log-log scale for each dimension in the second row of Figure 2. The linear trends in the plots corroborate the bound in (3). 3) To show the efficiency and scalability of DSP, we compare it with KDE, OPT and BSP in terms of estimation error and running time. We simulate samples from x ∼(P4 i=1 πiN(µi, Σi))1{x ∈ [0, 1]d} with d = {2, 3, · · · , 6} and N = {103, 104, 105} respectively. The estimation error measured in terms of Hellinger Distance is summarized in Table 1. We set m = 10, θ = 0.01 in our experiments. We found the resulting Hellinger distance to be quite robust as m ranges from 3 to 20 (equally 6 spaced). The supplementary material includes the exact details about the parameters of the simulating distributions, estimation of Hellinger distance and other implementation details for the algorithms. The table shows DSP achieves comparable accuracy with the best of the other three methods. As mentioned at the beginning of this paper, one major advantage of DSP’s is its speed. Table 2 shows our method achieves a significant speed up over all other three algorithms. Table 1: Error in Hellinger Distance between the true density and KDE, OPT, BSP, our method for each (d, n) pair. The numbers in parentheses are standard errors from 20 replicas. The best of the four method is highlighted in bold. Note that the simulations, being based on mixtures of Gaussians, is unfavorable for methods based on domain partitions. Hellinger Distance (n = 103) Hellinger Distance (n = 104) Hellinger Distance (n = 105) d KDE OPT BSP DSP KDE OPT BSP DSP KDE OPT BSP DSP 2 0.2331 0.2147 0.2533 0.2634 0.1104 0.0957 0.1222 0.0803 0.0305 0.0376 0.0345 0.0312 (0.0421) (0.0172) (0.0163) (0.0207) (0.0102) (0.0036) (0.0043) (0.0013) (0.0021) (0.0021) (0.0025) (0.0027) 3 0.2893 0.3279 0.2983 0.3072 0.2003 0.1722 0.1717 0.1721 0.1466 0.1117 0.1323 0.1020 (0.0227) (0.0128) (0.0133) (0.0265) (0.0199) (0.0028) (0.0083) (0.0073) (0.0047) (0.0008) (0.0009) (0.004) 4 0.3913 0.3839 0.3872 0.3895 0.2466 0.2726 0.2882 0.2955 0.1900 0.1880 0.2100 0.1827 (0.0325) (0.0136) (0.0117) (0.0191) (0.0113) (0.0031) (0.0047) (0.0065) (0.0057) (0.0006) (0.0006) (0.0059) 5 0.4522 0.4748 0.4435 0.4307 0.3599 0.3562 0.3987 0.3563 0.2817 0.2822 0.2916 0.2910 (0.0317) (0.009) (0.0167) (0.0302) (0.0199) (0.0025) (0.0022) (0.0031) (0.0088) (0.0005) (0.0003) (0.0002) 6 0.5511 0.5508 0.5515 0.5527 0.4833 0.4015 0.4093 0.3911 0.3697 0.3409 0.3693 0.3701 (0.0318) (0.0307) (0.0354) (0.0381) (0.0255) (0.0023) (0.0046) (0.0037) (0.0122) (0.0005) (0.0004) (0.0002) Table 2: Average CPU time in seconds of KDE, OPT, BSP and our method for each (d, n) pair. The numbers in parentheses are standard errors from 20 replicas. The speed-up is the fold speed-up computed as the ratio between the minimum run time of the other three methods and the run time of DSP. All methods are implemented in C++. See the supplementary material for more details. Running time (n = 103) Running time (n = 104) Running time (n = 105) d KDE OPT BSP DSP speed-up KDE OPT BSP DSP speed-up KDE OPT BSP DSP speed-up 2 2.445 9.484 0.833 0.020 41 21.903 31.561 1.445 0.033 43 230.179 44.561 7.750 0.242 33 (0.191) (0.029) (0.006) (0.002) (1.905) (0.079) (0.014) (0.002) (130.572) (0.639) (0.178) (0.015) 3 2.655 25.073 1.054 0.019 55 26.964 36.683 2.819 0.044 64 278.075 56.329 21.104 0.378 55 (0.085) (0.056) (0.010) (0.002) (1.089) (0.076) 0.036) (0.001) (10.576) (0.911) (0.576) (0.011) 4 3.540 32.112 1.314 0.019 69 37.141 39.219 5.861 0.049 119 347.501 67.366 53.620 0.485 108 (0.116) (0.072) (0.014) (0.002) (2.244) (0.221) (0.076) (0.002) (14.676) (3.018) (2.917) (0.018) 5 4.107 37.599 1.713 0.020 85 45.580 44.520 12.220 0.078 157 412.828 77.776 115.869 0.706 110 (0.110) (0.088) (0.019) (0.002) (2.124) (0.587) (0.154) (0.002) (16.252) (2.215) (6.872) (0.051) 6 4.986 41.565 2.749 0.020 137 53.291 43.032 21.696 0.127 170 519.298 81.023 218.999 0.896 90 (0.214) (0.147) (0.024) (0.001) (2.767) (0.413) (0.213) (0.004) (29.276) (3.703) (6.046) (0.071) 5.3 DSP-kmeans In addition to being a competitive density estimator, we demonstrate in this section how DSP can be used to get good initializations for k-means. The resulting algorithm is referred to as DSP-kmeans. Recall that given a fixed number of clusters K, the goal of k-means is to minimize the following objective function: JK ∆= K X k=1 X i∈Ck ∥xi −mk∥2 2 (4) where Ck denote the set of points in cluster k; {mk}K k=1 denote the cluster means. The original k-means algorithms proceeds by alternating between assigning points to centers and recomputing the means. As a result, the final clustering is usually only a local optima and can be sensitive to the initializations. Finding a good initialization has attracted a lot of attention over the past decade and now there is a descent number existing methods, each with their own perspectives. Below we review a few representative types. One type of methods look for good initial centers sequentially. The idea is once the first center is picked, the second should be far away from the one that is already chosen. A similar argument applies to the rest of the centers. [13] [14] fall under this category. Several studies [15] [16] borrow ideas from hierarchical agglomerative clustering (HAC) to look for good initializations. In our experiments we used the algorithm described in [15]. One essential ingredient of this type of algorithms is the inter cluster distance, which could be problem dependent. Last but not least, there is a class of methods that attempt to utilize the relationship between PCA and k-means. [17] proposes a PCA-guided search for initial centers. [18] combines the relationship between PCA and k-means to look for good initialization. The general idea is to recursively splitting a cluster according the first principal component. We refer to this algorithm as PCA-REC. 7 DSP-kmeans is different from previous methods in that it tackles the initialization problem from a density estimation point of view. The idea behind DSP-kmeans is that cluster centers should be close to the modes of underlying probability density function. If a density estimator can accurately locate the modes of the underlying true density function, it should also be able to find good cluster centers. Due to its concise representation, DSP can be used for finding initializations for k-means in the following way: Suppose we are trying to cluster a dataset Y with K clusters. We first apply DSP on Y to find a partition with K non-empty sub-rectangles, i.e. sub-rectangles that have at least one point from Y . The output of DSP will be K sub-rectangles. Denote the set of indices for the points in sub-rectangle j by Sj, j = 1, . . . , K, let Ij = 1 |Sj| P i∈Sj Yi, i.e. Ij is the sample average of points fall into sub-rectangle j. We then use {I1, · · · , IK} to initialize k-means. We also explored the following two-phase procedure: first over partition the space to build a more accurate density estimate. Points in different sub-rectangles are considered to be in different clusters. Then we merge the sub-rectangles hierarchically based on some measure of between cluster distance. We have found this to be helpful when the number of clusters K is relatively small. For completeness, we have included the details of this two-phase DSP-kmeans in the supplementary material. We test DSP-kmeans on 4 real world datasets of various number of data points and dimensions. Two of them are taken from the UCI machine learning repository [19]; the stem cell data set is taken from the FlowCAP challenges [20]; the mouse bone marrow data set is a recently published single-cell dataset measured using mass cytometry [21]. We use random initialization as the base case and compare it with DSP-kmeans, k-means++, PCA-REC and HAC. The numbers in Table 3 are the improvements in k-means objective function of a method over random initialization. The result shows when the number of clusters is relatively large DSP-kmeans achieves lower objective value in these four datasets. Although in theory almost all density estimator could be used to find good Table 3: Comparison of different initialization methods. The number for method j is relative to random initialization: JK,j−JK,0 JK,0 , where JK,j is the k-means objective value of method j at convergence. Here we use 0 as index for random initialization. Negative number means the method perform worse than random initialization. Improvement over random init. Improvement over random init. Road network k k-means++ PCA-REC HAC DSP-kmeans Mouse bone marrow k k-means++ PCA-REC HAC DSP-kmeans n 4.3e+04 4 0.0 -0.02 0.01 0.0 n 8.7e+04 4 1.51 0.03 1.25 0.4 d 3 10 0.0 -0.12 0.25 0.08 d 39 10 0.45 0.24 0.77 0.83 20 0.43 -0.46 1.68 2.04 20 0.63 -1.2 0.68 0.79 40 11.7 -2.52 2.27 13.62 40 1.99 -3.56 2.06 2.55 60 19.78 -3.45 18.69 20.91 60 2.48 -5.25 2.57 2.65 Stem cell k k-means++ PCA-REC HAC DSP-kmeans US census k k-means++ PCA-REC HAC DSP-kmeans n 9.9e+03 4 3.45 -2.1 3.67 3.96 n 2.4e+06 4 47.44 -2.33 46.72 40.44 d 6 10 3.82 -4.2 3.79 3.6 d 68 10 40.52 -1.9 41.48 39.52 20 9.96 -3.59 9.91 9.39 20 32.63 -1.97 29.49 32.55 40 9.95 -6.39 10.11 12.49 40 32.66 -5.15 33.41 34.61 60 6.12 -7.29 8.19 13.7 60 21.7 -1.19 16.28 21.68 initializations. Based on the comparison of Hellinger distance in Table 1, we would expect them to have similar performances. However, for OPT and BSP, their runtime would be a major bottleneck for their applicability The situation for KDE is slightly more complicated: not only it is computationally quite intensive, its output can not be represented as concisely as partition based methods. Here we see that the efficiency of DSP makes it possible to utilize it for other machine learning tasks. 6 Conclusion In this paper we propose a novel density estimation method based on ideas from Quasi-Monte Carlo analysis. We prove it achieves a O(n−1 2 ) error rate. By comparing it with other density estimation methods, we show DSP has comparable performance in terms of Hellinger distance while achieving a significant speed-up. We also show how DSP can be used to find good initializations for k-means. Due to space limitation, we were unable to include other interesting applications including mode seeking, data visualization via level set tree and data compression [22]. Acknowledgements. This work was supported by NIH-R01GM109836, NSF-DMS1330132 and NSF-DMS1407557. The second author’s work was done when the author was a graduate student at Stanford University. 8 References [1] Luo Lu, Hui Jiang, and Wing H Wong. Multivariate density estimation by bayesian sequential partitioning. Journal of the American Statistical Association, 108(504):1402–1410, 2013. [2] Emanuel Parzen. On estimation of a probability density function and mode. The annals of mathematical statistics, 33(3):1065–1076, 1962. [3] Wing H Wong and Li Ma. Optional pólya tree and bayesian inference. The Annals of Statistics, 38(3):1433– 1459, 2010. [4] Han Liu, Min Xu, Haijie Gu, Anupam Gupta, John Lafferty, and Larry Wasserman. Forest density estimation. The Journal of Machine Learning Research, 12:907–951, 2011. [5] Parikshit Ram and Alexander G Gray. Density estimation trees. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 627–635. ACM, 2011. [6] Lauwerens Kuipers and Harald Niederreiter. Uniform distribution of sequences. Courier Dover Publications, 2012. [7] Art B Owen. Multidimensional variation for quasi-monte carlo. In International Conference on Statistics in honour of Professor Kai-Tai Fang’s 65th birthday, pages 49–74, 2005. [8] Stefan Heinrich, Erich Novak, Grzegorz W Wasilkowski, and Henryk Wozniakowski. The inverse of the star-discrepancy depends linearly on the dimension. ACTA ARITHMETICA-WARSZAWA-, 96(3):279–302, 2000. [9] Carola Doerr, Michael Gnewuch, and Magnus Wahlstróm. Calculation of discrepancy measures and applications. Preprint, 2013. [10] Michael Gnewuch. Entropy, randomization, derandomization, and discrepancy. In Monte Carlo and quasi-Monte Carlo methods 2010, pages 43–78. Springer, 2012. [11] Jia-Juan Liang, Kai-Tai Fang, Fred Hickernell, and Runze Li. Testing multivariate uniformity and its applications. Mathematics of Computation, 70(233):337–355, 2001. [12] Michael Gnewuch, Magnus Wahlstróm, and Carola Winzen. A new randomized algorithm to approximate the star discrepancy based on threshold accepting. SIAM Journal on Numerical Analysis, 50(2):781–807, 2012. [13] 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. [14] Ioannis Katsavounidis, C-C Jay Kuo, and Zhen Zhang. A new initialization technique for generalized lloyd iteration. Signal Processing Letters, IEEE, 1(10):144–146, 1994. [15] Chris Fraley. Algorithms for model-based gaussian hierarchical clustering. SIAM Journal on Scientific Computing, 20(1):270–281, 1998. [16] Stephen J Redmond and Conor Heneghan. A method for initialising the k-means clustering algorithm using kd-trees. Pattern recognition letters, 28(8):965–973, 2007. [17] Qin Xu, Chris Ding, Jinpei Liu, and Bin Luo. Pca-guided search for k-means. Pattern Recognition Letters, 54:50–55, 2015. [18] Ting Su and Jennifer G Dy. In search of deterministic methods for initializing k-means and gaussian mixture clustering. Intelligent Data Analysis, 11(4):319–338, 2007. [19] Manohar Kaul, Bin Yang, and Christian S Jensen. Building accurate 3d spatial networks to enable next generation intelligent transportation systems. In Mobile Data Management (MDM), 2013 IEEE 14th International Conference on, volume 1, pages 137–146. IEEE, 2013. [20] Nima Aghaeepour, Greg Finak, Holger Hoos, Tim R Mosmann, Ryan Brinkman, Raphael Gottardo, Richard H Scheuermann, FlowCAP Consortium, DREAM Consortium, et al. Critical assessment of automated flow cytometry data analysis techniques. Nature methods, 10(3):228–238, 2013. [21] Matthew H Spitzer, Pier Federico Gherardini, Gabriela K Fragiadakis, Nupur Bhattacharya, Robert T Yuan, Andrew N Hotson, Rachel Finck, Yaron Carmi, Eli R Zunder, Wendy J Fantl, et al. An interactive reference framework for modeling a dynamic immune system. Science, 349(6244):1259425, 2015. [22] Robert M Gray and Richard A Olshen. Vector quantization and density estimation. In Compression and Complexity of Sequences 1997. Proceedings, pages 172–193. IEEE, 1997. 9
2016
63
6,523
Quantized Random Projections and Non-Linear Estimation of Cosine Similarity Ping Li Rutgers University pingli@stat.rutgers.edu Michael Mitzenmacher Harvard University michaelm@eecs.harvard.edu Martin Slawski Rutgers University martin.slawski@rutgers.edu Abstract Random projections constitute a simple, yet effective technique for dimensionality reduction with applications in learning and search problems. In the present paper, we consider the problem of estimating cosine similarities when the projected data undergo scalar quantization to b bits. We here argue that the maximum likelihood estimator (MLE) is a principled approach to deal with the non-linearity resulting from quantization, and subsequently study its computational and statistical properties. A specific focus is on the on the trade-off between bit depth and the number of projections given a fixed budget of bits for storage or transmission. Along the way, we also touch upon the existence of a qualitative counterpart to the Johnson-Lindenstrauss lemma in the presence of quantization. 1 Introduction The method of random projections (RPs) is an important approach to linear dimensionality reduction [23]. RPs have established themselves as an alternative to principal components analysis which is computationally more demanding. Instead of determining an optimal low-dimensional subspace via a singular value decomposition, the data are projected on a subspace spanned by a set of directions picked at random (e.g. by sampling from the Gaussian distribution). Despite its simplicity, this approach comes with a theoretical guarantee: as asserted by the celebrated Johnson-Lindenstrauss (J-L) lemma [6, 12], k = O(log n/ε2) random directions are enough to preserve the squared distances between all pairs from a data set of size n up to a relative error of ε, irrespective of the dimension d the data set resides in originally. Inner products are preserved similarly. As a consequence, procedures only requiring distances or inner products can be approximated in the lower-dimensional space, thereby achieving substantial reductions in terms of computation and storage, or mitigating the curse of dimensionality. The idea of RPs has thus been employed in linear learning [7, 19], fast matrix factorization [24], similarity search [1, 9], clustering [2, 5], statistical testing [18, 22], etc. The idea of data compression by RPs has been extended to the case where the projected data are additionally quantized to b bits so as to achieve further reductions in data storage and transmission. The extreme case of b = 1 is well-studied in the context of locality sensitive hashing [4]. More recently, b-bit quantized random projections for b ≥1 have been considered from different perspectives. The paper [17] studies Hamming distance-based estimation of cosine similarity and linear classification when using a coding scheme that maps a real value to a binary vector of length 2b. It is demonstrated that for similarity estimation, taking b > 1 may yield improvements if the target similarity is high. The paper [10] is dedicated to J-L-type results for quantized RPs, considerably improving over an earlier result of the same flavor in [15]. The work [15] also discusses the trade-off between the number of projections k and number of bits b per projection under a given budget of bits as it also appears in the literature on quantized compressed sensing [11, 14]. In the present paper, all of these aspects and some more are studied for an approach that can be substantially more accurate for small b (specifically, we focus on 1 ≤b ≤6) than those in [10, 17, 15]. In [10, 15] the non-linearity of quantization is ignored by treating the quantized data as if they had been observed directly. Such “linear” approach benefits from its simplicity, but it is geared towards fine quantization, whereas for small b the bias resulting from quantization dominates. By contrast, the approach proposed herein makes full use of the knowledge about the quantizer. As in [17] we suppose that the original data set is contained in the unit sphere of Rd, or at least that the Euclidean 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. norms of the data points are given. In this case, approximating distances boils down to estimating inner products (or cosine similarity) which can be done by maximum likelihood (ML) estimation based on the quantized data. Several questions of interest can be addressed by considering the Fisher information of the maximum likelihood estimator (MLE). With regard to the aforementioned trade-off between k and b, it turns out that the choice b = 1 is optimal (in the sense of yielding maximum Fisher information) as long as the underlying similarity is smaller than 0.2; as the latter increases, the more effective it becomes to increase b. By considering the rate of growth of the Fisher information near the maximum similarity of one, we discover a gap between the finite bit and infinite bit case with rates of Θ((1 −ρ∗)−3/2) and Θ((1 −ρ∗)−2), respectively, where ρ∗denotes the target similarity. As an implication, an exact equivalent of the J-L lemma does not exist in the finite bit case. The MLE under study does not have a closed form solution. We show that it is possible to approximate the MLE by a non-iterative scheme only requiring pre-computed look-up tables. Derivation of this scheme lets us draw connections to alternatives like the Hamming distance-based estimator in [17]. We present experimental results concerning applications of the proposed approach in nearest neighbor search and linear classification. In nearest neighbor search, we focus on the high similarity regime and confirm theoretical insights into the trade-off between k and b. For linear classification, we observe empirically that intermediate values of b can yield better trade-offs than single-bit quantization. Notation. We let [d] = {1, . . . , d}. I(P) denotes the indicator function of expression P. For a function f(ρ), we use ˙f(ρ) and ¨f(ρ) for its first resp. second derivative. Pρ and Eρ denote probability/expectation w.r.t. a zero mean, unit variance bivariate normal distribution with correlation ρ. Supplement: Proofs and additional experimental results can be found in the supplement. 2 Quantized random projections, properties of the MLE, and implications We start by formally introducing the setup, the problem and the approach that is taken before discussing properties of the MLE in this specific case, along with important implications. Setup. Let X = {x1, . . . , xn} ⊂Sd−1, where Sd−1 := {x ∈Rd : ∥x∥2 = 1} denotes the unit sphere in Rd, be a set of data points. We think of d being large. As discussed below, the requirement of having all data points normalized to unit norm is not necessary, but it simplifies our exposition considerably. Let x, x′ be a generic pair of elements from X and let ρ∗= ⟨x, x′⟩denote their inner product. Alternatively, we may refer to ρ∗as (cosine) similarity or correlation. Again for simplicity, we assume that 0 ≤ρ∗< 1; the case of negative ρ∗is a trivial extension because of symmetry. We aim at reducing the dimensionality of the given data set by means of a random projection, which is realized by sampling a random matrix A of dimension k by d whose entries are i.i.d. N(0, 1) (i.e., zero-mean Gaussian with unit variance). Applying A to X yields Z = {zi}n i=1 ⊂Rk with zi = Axi, i ∈[n]. Subsequently, the projected data points {zi}n i=1 are subject to scalar quantization. A b-bit scalar quantizer is parameterized by 1) thresholds t = (t1, . . . , tK−1) with 0 = t0 < t1 < . . . < tK−1 < tK = +∞inducing a partitioning of the positive real line into K = 2b−1 intervals {[tr−1, tr), r ∈[K]} and 2) a codebook M = {µ1, . . . , µK} with code µr representing interval [tr−1, tr), r ∈[K]. Given t and M, the scalar quantizer (or quantization map) is defined by Q : R →M± := −M ∪M, z 7→Q(z) = sign(z) K X r=1 µrI(|z| ∈[tr−1, tr)) (1) The projected, b-bit quantized data result as Q = {qi}n i=1 ⊂(M±)k, qi = ( Q(zij) )k j=1, i ∈[n]. Problem statement. Let z, z′ and q, q′ denote the pairs corresponding to x, x′ in Z respectively Q. The goal is to estimate ρ∗= ⟨x, x′⟩from q, q′ which automatically yields an estimate of ∥x −x′∥2 2 = 2(1 −ρ∗). If z, z′ were given, it would be standard to use 1 k ⟨z, z′⟩as an unbiased estimator of ρ∗. This "linear" approach is commonly adopted when the data undergo uniform quantization with saturation level T (i.e., tr = T · r/(K −1), µr = (tr −tr−1)/2, r ∈[K −1], µK = T), based on the rationale that as b →∞, 1 k ⟨q, q′⟩→ 1 k ⟨z, z′⟩which in turn is sharply concentrated around its expectation ρ∗. There are two major concerns about this approach. First, for finite b the estimator 1 k ⟨q, q′⟩has a bias resulting from the non-linearity of Q that does not vanish as k →∞. For small b, the effect of this bias is particularly pronounced. Lloyd-Max quantization (see Proposition 1 below) in place of 2 p1 p2 p2 p4 p5 p5 p4 p5 p5 p1 p2 p2 p3 p3 p6 p6 p1 = Pρ(Z ∈(0, t1], Z′ ∈(0, t1]) p2 = Pρ(Z ∈(0, t1], Z′ ∈(t1, ∞)) p3 = Pρ(Z ∈(t1, ∞), Z′ ∈(t1, ∞)) p4 = P−ρ(Z ∈(0, t1], Z′ ∈(0, t1]) p5 = P−ρ(Z ∈(0, t1], Z′ ∈(t1, ∞)) p6 = P−ρ(Z ∈(t1, ∞), Z′ ∈(t1, ∞)) 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 ρ empirical MSE I−1(ρ) b = 3 Figure 1: (L, M): Partitioning into cells for b = 2 and cell probabilities. (R): Empirical MSE k(bρMLE −ρ∗)2 for b = 3 (averaged over 104 i.i.d. data sets with k = 100) compared to the inverse information. The disagreement for ρ ≤0.2 results from positive truncation of the MLE at zero. uniform quantization provides some remedy, but the issue of non-vanishing bias remains. Second, even for infinite b, the approach is statistically not efficient. In order to see this, note that {(zj, z′ j)}k j=1 i.i.d. ∼(Z, Z′), where (Z, Z′) ∼N2  0,  1 ρ∗ ρ∗ 1  . (2) It is shown in [16] that the MLE of ρ∗under the above bivariate normal model has a variance of (1 −ρ2 ∗)2/{k (1 + ρ2 ∗)}, while Var(⟨z, z′⟩/k) = (1 + ρ2 ∗)/k which is a substantial difference for large ρ∗. The higher variance results from not using the information that the components of z and z′ have unit variance [16]. In conclusion, the linear approach as outlined above suffers from noticeable bias/and or high variance if the similarity ρ∗is high, and it thus makes sense to study alternatives. Maximum likelihood estimation of ρ∗. We here propose the MLE in place of the linear approach. The advantage of the MLE is that it can have substantially better statistical performance as the quantization map is explicitly taken into account. The MLE is based on bivariate normality according to (2). The effect of quantization is identical to that of what is known as interval censoring in statistics, i.e., in place of observing a specific value, one only observes that the datum is contained in an interval. The concept is easiest to understand in the case of one-bit quantization. For any j ∈[k], each of the four possible outcomes of (qj, q′ j) corresponds to one of the four orthants of R2. By symmetry, the probability of (qj, q′ j) falling into the positive or into the negative orthant are identical; both correspond to a “collision”, i.e., to the event {qj = q′ j}. Likewise, the probability of (qj, q′ j) falling into one of the remaining two orthants are identical, corresponding to a disagreement {qj ̸= q′ j}. Accordingly, the likelihood function in ρ is given by k Y j=1 {π(ρ)I(qj=q′ j)(1 −π(ρ))I(qj̸=q′ j)}, π(ρ) := Pρ(sign(Z) = sign(Z′)), where π(ρ) denotes the probability of a collision after quantization for (Z, Z′) as in (2) with ρ∗ replaced by ρ. It is straightforward to show that the MLE is given by bρMLE = cos(π(1 −bπ)), where π is the circle constant and bπ = k−1 Pk j=1 I(qj = q′ j) is the empirical counterpart to π(ρ). We note that the expression for bρMLE follows the same rationale as used for the simhash in [4]. With these preparations, it is not hard to see how the MLE generalizes to cases with more than one bit. For b = 2, there is a single non-trivial threshold t1 that yields a partitioning of the real axis into four bins and accordingly a component (qj, q′ j) of a quantized pair can fall into 16 possible cells (rectangles), cf. Figure 1. By orthant symmetry and symmetries within each orthant, one ends up with six distinct probabilities p1, . . . , p6 for (qj, q′ j) falling into one of those cells depending on ρ. Weighting those probabilities according to the number of their occurrences in the left part of Figure 1, we end up with probabilities π1 = π1(ρ), . . . , π6 = π6(ρ) that sum up to one. The corresponding relative cell frequencies bπ1, . . . , bπ6 resulting from (qj, q′ j)k j=1 form a sufficient statistic for ρ. For general b, we have 22bcells and L = K(K + 1) (recall that K = 2b−1) distinct probabilities, so that L = 20, 72, 272, 1056 for b = 3, . . . , 6. This yields the following compact expressions for the 3 0 0.2 0.4 0.6 0.8 1 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 b = 2 ρ b ∗I−1 b (ρ)/I−1 1 (ρ) Lloyd-Max T0.9 T0.95 T0.99 0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 b = 4 ρ b ∗I−1 b (ρ)/I−1 1 (ρ) Lloyd-Max T0.9 T0.95 T0.99 0 0.2 0.4 0.6 0.8 1 0 0.5 1 1.5 2 2.5 b = 6 ρ b ∗I−1 b (ρ)/I−1 1 (ρ) Lloyd-Max T0.9 T0.95 T0.99 Figure 2: b · I−1 b (ρ)/I−1 1 (ρ) vs. ρ for different choices of t: Lloyd-Max and uniform quantization with saturation levels T0.9, T0.95, T0.99, cf. §4.1 for a definition. The latter are better suited for high similarity. The differences become smaller as b increases. Note that for b = 6, ρ > 0.7 is required for either quantization scheme to achieve a better trade-off than the one-bit MLE. negative log-likelihood l(ρ) and the Fisher information I(ρ) = Eρ[¨l(ρ)] (up to a factor of k) l(ρ) = L X ℓ=1 bπℓlog(πℓ(ρ)), I(ρ) = L X ℓ=1 ( ˙πℓ(ρ))2 πℓ(ρ) . (3) The information I(ρ) is of particular interest. By classical statistical theory [21], {E[bρMLE] −ρ∗}2 = O(1/k2), Var(bρMLE) = I−1(ρ)/k, E[(bρMLE −ρ∗)2] = I−1(ρ)/k + O(1/k2) as k →∞. While this is an asymptotic result, it agrees to a good extent with what one observes for finite, but not too small samples, cf. Figure 1. We therefore treat the inverse information as a proxy for the accuracy of bρMLE in subsequent analysis. Remark. We here briefly address the case of known, but possibly non-unit norms, i.e., ∥x∥2 = σx, ∥x′∥2 = σx′. This can be handled by re-scaling the thresholds of the quantizer (1) by σx resp. σx′, estimating ρ∗based on q, q′ as in the unit norm case, and subsequently re-scaling the estimate by σxσx′ to obtain an estimate of ⟨x, x′⟩. The assumption that the norms are known is not hard to satisfy in practice as they can be computed by one linear scan during data collection. With a limited bit budget, the norms additionally need to be quantized. It is unclear how to accurately estimate them from quantized data (for b = 1, it is definitely impossible). Choice of the quantizer. Equipped with the Fisher information (3), one of the questions that can be addressed is quantizer design. Note that as opposed to the linear approach, the specific choice of the {µr}K r=1 in (1) is not important as ML estimation only depends on cell frequencies but not on the values associated with the intervals {(tr−1, tr]}K r=1. The thresholds t, however, turn out to have a considerable impact, at least for small b. An optimal set of thresholds can be determined by minimizing the inverse information I−1(ρ; t) w.r.t. t for fixed ρ. As the underlying similarity is not known, this may not seem practical. On the other hand, prior knowledge about the range of ρ may be available, or the closed form one-bit estimator can be used as pilot estimator. For ρ = 0, the optimal set of thresholds coincide with those of Lloyd-Max quantization [20]. Proposition 1. Let g ∼N(0, 1) and consider Lloyd-Max quantization given by (t∗, {µ∗ r}K r=1) = argmin t,{µr}K r=1 E[{g −Q(g; t, {µr}K r=1)}2]. We also have t∗= argmin t I−1(0; t). The Lloyd-Max problem can be solved numerically by means of an alternating scheme which can be shown to converge to a global optimum [13]. For ρ > 0, an optimal set of thresholds can be determined by general procedures for nonlinear optimization. Evaluation of I−1(ρ; t) requires computation of the probabilities {πℓ(ρ; t)}L ℓ=1 and their derivatives { ˙πℓ(ρ; t)}L ℓ=1. The latter are available in closed form (cf. supplement), while for the former specialized numerical integration procedures [8] can be used. In order to avoid multi-dimensional optimization, it makes sense to confine oneself to thresholds of the form tr = T · r/(K −1), r ∈[K −1], so that only T needs to be optimized. Even though the Lloyd-Max scheme performs reasonably also for large values of ρ, the one-parameter scheme may still yield significant improvements in that case, cf. Figure 2. Once b ≥5, the differences between the two schemes become marginal. Trade-off between k and b. Suppose we are given a fixed budget of bits B = k · b for transmission or storage, and we are in free choosing b. The optimal choice of b can be determined by comparing 4 0 0.2 0.4 0.6 0.8 1 ρ 0 1 2 3 4 5 6 7 b ∗I−1 b (ρ) all ρ b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 0.9 0.92 0.94 0.96 0.98 1 ρ 0 0.05 0.1 0.15 0.2 0.25 b ∗I−1 b (ρ) ρ ≥0.9 b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 0 0.2 0.4 0.6 0.8 1 1 2 3 4 5 6 ρ optimal b Figure 3: Trade-off between k and b. (L): b · I−1 b (ρ) vs. ρ for 1 ≤b ≤6 with t chosen by Lloyd-Max. (M): Zoom into the range 0.9 ≤ρ ≤1. (R): choice of b minimizing b · I−1 b (ρ) vs. ρ. the inverse Fisher information I−1 b (ρ) for changing b with t chosen according to either of the two schemes above. Since the mean squared error of bρMLE decays with 1/k for any b, for b′ with b′ > b to be more efficient than b at the bit scale it, is required that Ib′(ρ)/Ib(ρ) > b′/b as with the smaller choice b one would be allowed to increase k by a factor of b′/b. Again, this comparison is dependent on a specific ρ. From Figure 3, however, one can draw general conclusions: for ρ < 0.2, it does not pay off to increase b beyond one; as ρ increases, higher values of b achieve a better trade-off with even b = 6 being the optimal choice for ρ > 0.98. The intuition is that two points of high similarity agree on their first significant bit for most coordinates, in which case increasing the number of bits becomes beneficial. This finding is particularly relevant to (near-)duplicate detection/nearest neighbor search where high similarities prevail, an application investigated in §4. Rate of growth of the Fisher information near ρ = 1. Interestingly, we do not observe a “saturation” even for b = 6 in the sense that for ρ close enough to 1, one can still achieve an improvement at the bit scale compared to 1 ≤b ≤5. This raises the question about the rate of growth of the Fisher information near one relative to the full precision case (b →∞). As shown in [16] I∞(ρ) = (1 + ρ2)/(1 −ρ2)2 = Θ((1 −ρ)−2) as ρ →1. As stated below, in the finite bit case, the exponent is only 3/2 for all b. This is a noticeable gap. Theorem 1. For 1 ≤b < ∞, we have I(ρ) = Θ((1 −ρ)−3/2) as ρ →1. The theorem has an interesting implication with regard to the existence of a Johnson-Lindenstrauss (J-L)-type result for quantized random projections. In a nutshell, the J-L lemma states that as long as k = Ω(log n/ε2), with high probability we have that (1 −ε)∥xi −xj∥2 2 ≤∥zi −zj∥2 2/k ≤(1 + ε)∥xi −xj∥2 2 for all pairs (i, j), i.e., the distances of the data in X are preserved in Z up to a relative error of ε. In our setting, one would hope for an equivalent of the form (1 −ε)2(1 −ρij) ≤2(1 −bρij MLE) ≤(1 + ε)2(1 −ρij) ∀(i, j) as long as k = Ω(log n/ε2), (4) where ρij = ⟨xi, xj⟩, i, j ∈[n], and bρij MLE denotes the MLE for ρij given quantized RPs. The standard proof of the J-L lemma [6] combines norm preservation for each individual pair of the form P((1 −ε)∥xi −xj∥2 2 ≤∥zi −zj∥2 2/k ≤(1 + ε)∥xi −xj∥2 2) ≤2 exp(−kΘ(ε2)) with a union bound. Such a concentration result does not appear to be attainable for bρMLE −ρ∗, not even asymptotically as k →∞in which case bρMLE −ρ∗is asymptotically normal with mean zero and variance I−1(ρ∗)/k. This yields an asymptotic tail bound of the form P(|bρMLE −ρ∗| > δ) ≤2 exp(−δ2k/{2I−1(ρ∗)}). (5) For a result of the form (4), which is about relative distance preservation, one would need to choose δ proportional to ε(1 −ρ∗). In virtue of Theorem 1, I−1(ρ∗) = Θ((1 −ρ∗)3/2) as ρ∗→1 so that with δ chosen in that way the exponent in (5) would vanish as ρ∗→1. By constrast, the required rate of decay of I−1(ρ∗) is achieved in the full precision case. Given the asymptotic optimality of the MLE according to the Cramer-Rao lower bound suggests that a qualitative counterpart to the J-L lemma (4) is out of reach. Weaker versions in which the required lower bound on k would depend inversely on the minimum distance of points in X are still possible. Similarly, a weaker result of the form 2(1 −ρij) −ε ≤2(1 −bρij MLE) ≤2(1 −ρij) + ε ∀(i, j) as long as k = Ω(log n/ε2), is known to hold already in the one-bit case and follows immediately from the closed form expression of the MLE, Hoeffdings’s inequality, and the union bound; cf. e.g. [10]. 5 3 A general class of estimators and approximate MLE computation A natural concern about the MLE relative to the linear approach is that it requires optimization via an iterative scheme. The optimization problem is smooth, one-dimensional and over the unit interval, hence not challenging for modern solvers. However, in applications it is typically required to compute the MLE many times, hence avoiding an iterative scheme for optimization is worthwhile. In this section, we introduce an approximation to the MLE that only requires at most two table look-ups. A general class of estimators. Let π(ρ) = (π1(ρ), . . . , πL(ρ))⊤, PL ℓ=1 πℓ(ρ) = 1, be the normalized cell frequencies depending on ρ as defined in §2, let further w ∈RL be a fixed vector of weights, and consider the map ρ 7→θ(ρ; w) := ⟨π(ρ), w⟩. If ⟨˙π(ρ), w⟩> 0 uniformly in ρ (such w always exist), θ(·; w) is increasing and has an inverse θ−1(· ; w). We can then consider the estimator bρw = θ−1(⟨bπ, w⟩; w), (6) where we recall that bπ = (bπ, . . . , bπL)⊤are the empirical cell frequencies given quantized data q, q′. It is easy to see that bρw is a consistent estimator of ρ∗: we have bπ →π(ρ∗) in probability by the law of large numbers, and θ−1(⟨bπ, w⟩; w) →θ−1(⟨π(ρ∗), w⟩; w) = θ−1(θ(ρ∗; w); w) = ρ∗by two-fold application of the continuous mapping theorem. By choosing w such that wℓ= 1 for ℓ corresponding to cells contained in the positive/negative orthant and wℓ= −1 otherwise, bρw becomes the one-bit MLE. By choosing wℓ= 1 for diagonal cells (cf. Figure 1) corresponding to a collision event {qj = q′ j} and wℓ= 0 otherwise, we obtain the Hamming distance-based estimator in [17]. Alternatively, we may choose w such that the asymptotic variance of bρw is minimized. Theorem 2. For any w s.t. ˙π(ρ∗)⊤w ̸= 0, we have Var(bρw) = V (w; ρ∗)/k + O(1/k2) as k →∞, V (w; ρ∗) = (w⊤Σ(ρ∗)w)/{ ˙π(ρ∗)⊤w}2, Σ(ρ∗) := Π(ρ∗) −π(ρ∗)π(ρ∗)⊤, and Π(ρ∗) := diag( (πℓ(ρ∗))L ℓ=1 ). Moreover, let w∗= Π−1(ρ∗) ˙π(ρ∗). Then: argminw V (w; ρ∗) = {α(w∗+ c1), α ̸= 0, c ∈R}, V (w∗; ρ∗) = I−1(ρ∗), and E[(bρw∗−ρ∗)2] = E[(bρMLE −ρ∗)2] + O(1/k2). Theorem 2 yields an expression for the optimal weights w∗= Π−1(ρ∗) ˙π(ρ∗). This optimal choice is unique up to translation by a multiple of the constant vector 1 and scaling. The estimator bρw∗based on the choice w = w∗achieves asymptotically the same statistical performance as the MLE. Approximate computation. The estimator bρw∗is not operational as the optimal choice of the weights depends on the estimand itself. This issue can be dealt with by using a pilot estimator bρ0 like the one-bit MLE, the Hamming distance-based estimator in [17] or bρ0 = bρw, where w = R 1 0 w(ρ) dρ averages the expression w(ρ) = Π−1(ρ) ˙π(ρ) for the optimal weights over ρ. Given the pilot estimator, we may then replace w∗by w(bρ0) and use bρw(bρ0) as a proxy for bρw∗which achieves the same statistical performance asymptotically. A second issue is that computation of bρw (6) entails inversion of the function θ(·; w). The inverse may not be defined in general, but for the choices of w that we have in mind, this is not a concern (cf. supplement). Inversion of θ(·; w) can be carried out with tolerance ε by tabulating the function values on a uniform grid of cardinality ⌈1/ε⌉and performing a table lookup for each query. When computing bρw(bρ0), the weights depends on the data via the pilot estimator. We thus need to tabulate w(ρ) on a grid, too. Accordingly, a whole set of look-up tables is required for function inversion, one for each set of weights. Given parameters ε, δ > 0, a formal description of our scheme is as follows. 1. Set R = ⌈1/ε⌉, ρr = r/R, r ∈[R], and B = ⌈1/δ⌉, ρb = b/B, b ∈[B]. 2. Tabulate w(ρb), b ∈[B], and function values θ(ρr; w(ρb)) = ⟨w(ρb), π(ρr)⟩, r ∈[R], b ∈[B]. Steps 1. and 2. constitute a one-time pre-processing. Given data q, q′, we proceed as follows. 3. Obtain bπ and the pilot estimator bρ0 = θ−1(⟨bπ, w⟩; w), with w defined in the previous paragraph. 4. Return bρ = θ−1(⟨bπ, w(eρ0)⟩; w(eρ0)), where eρ0 is the value closest to bρ0 among the {ρb}. Step 2. requires about C = ⌈1/ε⌉· ⌈1/δ⌉· L computations/storage. From experimental results we find that ε = 10−4 and δ = .02 appear sufficient for practical purposes, which is still manageable even for b = 6 with L = 1056 cells in which case C ≈5 × 108. Again, this cost is occurred only once independent of the data. The function inversions in steps 3. and 4. are replaced by table lookups. By organizing computations efficiently, the frequencies bπ can be obtained from one pass over (qj · q′ j), j ∈[k]. Equipped with the look-up tables, estimating the similarity of two points requires O(k + L + log(1/ε)) flops which is only slightly more than a linear scheme with O(k). 6 6 7 8 9 10 11 12 13 log2(bits) 0.5 0.6 0.7 0.8 0.9 1 fraction retrieved synthetic, K = 10 b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 b = ∞ oracle 6 7 8 9 10 11 12 13 log2(bits) 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 fraction retrieved farm, K = 10 b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 b = ∞ oracle 6 7 8 9 10 11 12 13 log2(bits) 0.7 0.75 0.8 0.85 0.9 0.95 1 fraction retrieved rcv1, K = 10 b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 b = ∞ oracle Figure 4: Average fraction of K = 10 nearest neighbors retrieved vs. total # of bits (log2 scale) for 1 ≤b ≤6. b = ∞(dashed) represents the MLE based on unquantized data, with k as for b = 6. The oracle curve (dotted) corresponds to b = ∞with maximum k (i.e., as for b = 1). 4 Experiments We here illustrate the approach outlined above in nearest neighbor search and linear classification. The focus is on the trade-off between b and k, in particular in the presence of high similarity. 4.1 Nearest Neighbor Search Finding the most similar data points for a given query is a standard task in information retrieval. Another application is nearest neighbor classification. We here investigate how the performance of our approach is affected by the choice of k, b and the quantization scheme. Moreover, we compare to two baseline competitors, the Hamming distance-based approach in [17] and the linear approach in which the quantized data are treated like the original unquantized data. For the approach in [17], similarity of the quantized data is measured in terms of their Hamming distance Pk j=1 I(qj ̸= q′ j). Synthetic data. We generate k i.i.d. samples of Gaussian data, where each sample X = (X0, X1, . . . , X96) is generated as X0 ∼N(0, 1), Xj = ρjX0 + (1 −ρ2 j)1/2Zj, 1 ≤j ≤96, where the {Zj}96 j=1 are i.i.d. N(0, 1) and independent of X0. We have E[(X0 −Xj)2] = 2(1 −ρj), where ρj = min{0.8+(j−1)0.002, 0.99}, 1 ≤j ≤96. The thus generated data subsequently undergo b-bit quantization, for 1 ≤b ≤6. Regarding the number of samples, we let k ∈{26/b, 27/b, . . . , 213/b} which yields bit budgets between 26 and 213 for all b. The goal is to recover the K nearest neighbors of X0 according to the {ρj}, i.e., X96 is the nearest neighbor etc. The purpose of this specific setting is to mimic the use of quantized random projections in the situation of a query x0 and data points X = {x1, . . . , x96} having cosine similarities {ρj}96 j=1 with the query. Real data. We consider the Farm Ads data set (n = 4, 143, d = 54, 877) from the UCI repository and the RCV1 data set (n = 20, 242, d = 47, 236) from the LIBSVM webpage [3]. For both data sets, each instance is normalized to unit norm. As queries we select all data points whose first neighbor has (cosine) similarity less than 0.999, whose tenth neighbor has similarity at least 0.8 and whose hundredth neighbor has similarity less than 0.5. These restrictions allow for a more clear presentation of our results. Prior to nearest neighbor search, b-bit quantized random projections are applied to the data, where the ranges for b and for the number of projections k is as for the synthetic data. Quantization. Four different quantization schemes are considered: Lloyd-Max quantization and thresholds tr = Tρ · r/(K −1), r ∈[K −1], where Tρ is chosen to minimize I−1(ρ); we consider ρ ∈{0.9, 0.95, 0.99}. For the linear approach, we choose µr = E[g|g ∈(tr−1, tr)], r ∈[K], where g ∼N(0, 1). For our approach and that in [17] the specific choice of the {µr} is not important. Evaluation. We perform 100 respectively 20 independent replications for synthetic respectively real data. We then inspect the top K neighbors for K ∈{3, 5, 10} returned by the methods under consideration, and for each K we report the average fraction of true K neighbors that have been retrieved over 100 respectively 20 replications, where for the real data, we also average over the chosen queries (366 for farm and 160 for RCV1). The results of our experiments point to several conclusions that can be summarized as follows. One-bit quantization is consistently outperformed by higher-bit quantization. The optimal choice of b depends on the underlying similarities, and interacts with the choice of t. It is an encouraging result that the performance based on full precision data (with k as for b = 6) can essentially be matched 7 6 7 8 9 10 11 12 13 log2(bits) 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 fraction retrieved farm, b = 2, K = 10 MLE Hamming Linear 6 7 8 9 10 11 12 13 log2(bits) 0.4 0.5 0.6 0.7 0.8 0.9 1 fraction retrieved farm, b = 4, K = 10 MLE Hamming Linear 6 7 8 9 10 11 12 13 log2(bits) 0.75 0.8 0.85 0.9 0.95 1 fraction retrieved rcv1, b = 2, K = 10 MLE Hamming Linear 6 7 8 9 10 11 12 13 log2(bits) 0.4 0.5 0.6 0.7 0.8 0.9 1 fraction retrieved rcv1, b = 4, K = 10 MLE Hamming Linear Figure 5: Average fraction of K = 10 nearest neighbors retrieved vs. total # of bits (log2 scale) of our approach (MLE) relative to that based on the Hamming distance and the linear approach for b = 2, 4. when quantized data is used. For b = 2, the performance of the MLE is only marginally better than the approach based on the Hamming distance. The superiority of the former becomes apparent once b ≥4 which is expected since for increasing b the Hamming distance is statistically inefficient as it only uses the information whether a pair of quantized data agrees/disagrees. Some of these findings are reflected in Figures 4 and 5. We refer to the supplement for additional figures. 4.2 Linear Classification We here outline an application to linear classification given features generated by (quantized) random projections. We aim at reconstructing the original Gram matrix G = (⟨xi, x′ i⟩)1≤i,i′≤n from bG = (bgii′), where for i ̸= i′, bgii′ = bρMLE(qi, qi′) equals the MLE of ⟨xi, x′ i⟩given a quantized data pair qi, q′ i, and bgii′ = 1 else (assuming normalized data). The matrix bG is subsequently fed into LIBSVM. For testing, the inner products between test and training pairs are approximated accordingly. Setup. We work with the farm data set using the first 3,000 samples for training, and the Arcene data set from the UCI repository with 100 training and 100 test samples in dimension d = 104. The choice of k and b is as in §4.1; for arcene, the total bit budget is lowered by a factor of 2. We perform 20 independent replications for each combination of k and b. For SVM classification, we consider logarithmically spaced grids between 10−3 and 103 for the parameter C (cf. LIBSVM manual). 8 9 10 11 12 13 log2(bits) 0.7 0.75 0.8 0.85 0.9 accuracy on test set farm b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 b = ∞ oracle 7 8 9 10 11 12 log2(bits) 0.7 0.75 0.8 0.85 accuracy on test set arcene b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 b = ∞ oracle 0 0.5 1 1.5 2 2.5 log10(C parameter) 0.65 0.7 0.75 0.8 0.85 accuracy on test set arcene, total #bits = 210 b = 1 b = 2 b = 3 b = 4 b = 5 b = 6 b = ∞ oracle Figure 6: (L, M): accuracy vs. bits, optimized over the SVM parameter C. (R) accuracy vs. C for a fixed # bits. b = ∞indicates the performance based on unquantized data with k as for b = 6. The oracle curve (dotted) corresponds to b = ∞with maximum k (i.e., as for b = 1). Figure 6 (L, M) displays the average accuracy on the test data (after optimizing over C) in dependence of the bit budget. For the farm Ads data set, b = 2 achieves the best trade-off, followed by b = 1 and b = 3. For the Arcene data set, b = 3, 4 is optimal. In both cases, it does not pay off to go for b ≥5. 5 Conclusion In this paper, we bridge the gap between random projections with full precision and random projections quantized to a single bit. While Theorem 1 indicates that an exact counterpart to the J-L lemma is not attainable, other theoretical and empirical results herein point to the usefulness of the intermediate cases which give rise to an interesting trade-off that deserves further study in contexts where random projections can naturally be applied e.g. linear learning, nearest neighbor classification or clustering. The optimal choice of b eventually depends on the application: increasing b puts an emphasis on local rather than global similarity preservation. 8 Acknowledgement The work of Ping Li and Martin Slawski is supported by NSF-Bigdata-1419210 and NSF-III-1360971. The work of Michael Mitzenmacher is supported by NSF CCF-1535795 and NSF CCF-1320231. References [1] E. Bingham and H. Mannila. Random projection in dimensionality reduction: applications to image and text data. In Conference on Knowledge discovery and Data mining (KDD), pages 245–250, 2001. [2] C. Boutsidis, A. Zouzias, and P. Drineas. Random Projections for k-means Clustering. In Advances in Neural Information Processing Systems (NIPS), pages 298–306. 2010. [3] C-C. Chang and C-J. Lin. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1–27:27, 2011. http://www.csie.ntu.edu.tw/~cjlin/libsvm. [4] M. Charikar. Similarity estimation techniques from rounding algorithms. In Proceedings of the Symposium on Theory of Computing (STOC), pages 380–388, 2002. [5] S. Dasgupta. Learning mixtures of Gaussians. In FOCS, pages 634–644, 1999. [6] S. Dasgupta. An elementary proof of a theorem of Johnson and Lindenstrauss. Random Structures and Algorithms, 22:60–65, 2003. [7] D. Fradkin and D. Madigan. Experiments with random projections for machine learning. In Conference on Knowledge discovery and Data mining (KDD), pages 517–522, 2003. [8] A. Genz. BVN: A function for computing bivariate normal probabilities. http://www.math.wsu.edu/ faculty/genz/homepage. [9] P. Indyk and R. Motwani. Approximate nearest neighbors: towards removing the curse of dimensionality. In Proceedings of the Symposium on Theory of Computing (STOC), pages 604–613, 1998. [10] L. Jacques. A Quantized Johnson-Lindenstrauss Lemma: The Finding of Buffon’s needle. IEEE Transactions on Information Theory, 61:5012–5027, 2015. [11] L. Jacques, K. Degraux, and C. De Vleeschouwer. Quantized iterative hard thresholding: Bridging 1-bit and high-resolution quantized compressed sensing. arXiv:1305.1786, 2013. [12] W. Johnson and J. Lindenstrauss. Extensions of Lipschitz mappings into a Hilbert space. Contemporary Mathematics, pages 189–206, 1984. [13] J. Kieffer. Uniqueness of locally optimal quantizer for log-concave density and convex error weighting function. IEEE Transactions on Information Theory, 29:42–47, 1983. [14] J. Laska and R. Baraniuk. Regime change: Bit-depth versus measurement-rate in compressive sensing. IEEE Transactions on Signal Processing, 60:3496–3505, 2012. [15] M. Li, S. Rane, and P. Boufounos. Quantized embeddings of scale-invariant image features for mobile augmented reality. In International Workshop on Multimedia Signal Processing (MMSP), pages 1–6, 2012. [16] P. Li, T. Hastie, and K. Church. Improving Random Projections Using Marginal Information. In Annual Conference on Learning Theory (COLT), pages 635–649, 2006. [17] P. Li, M. Mitzenmacher, and A. Shrivastava. Coding for Random Projections. In Proceedings of the International Conference on Machine Learning (ICML), 2014. [18] M. Lopes, L. Jacob, and M. Wainwright. A More Powerful Two-Sample Test in High Dimensions using Random Projection. In Advances in Neural Information Processing Systems 24, pages 1206–1214. 2011. [19] O. Maillard and R. Munos. Compressed least-squares regression. In Advances in Neural Information Processing Systems (NIPS), pages 1213–1221. 2009. [20] J. Max. Quantizing for Minimum Distortion. IRE Transactions on Information Theory, 6:7–12, 1960. [21] L. Shenton and K. Bowman. Higher Moments of a Maximum-likelihood Estimate. Journal of the Royal Statistical Society, Series B, pages 305–317, 1963. [22] R. Srivastava, P. Li, and D. Ruppert. RAPTT: An exact two-sample test in high dimensions using random projections. Journal of Computational and Graphical Statistics, 25(3):954–970, 2016. [23] S. Vempala. The Random Projection Method. American Mathematical Society, 2005. [24] F. Wang and P. Li. Efficient nonnegative matrix factorization with random projections. In SDM, pages 281–292, Columbus, Ohio, 2010. 9
2016
64
6,524
Algorithms and matching lower bounds for approximately-convex optimization Yuanzhi Li Department of Computer Science Princeton University Princeton, NJ, 08450 yuanzhil@cs.princeton.edu Andrej Risteski Department of Computer Science Princeton University Princeton, NJ, 08450 risteski@cs.princeton.edu Abstract In recent years, a rapidly increasing number of applications in practice requires optimizing non-convex objectives, like training neural networks, learning graphical models, maximum likelihood estimation. Though simple heuristics such as gradient descent with very few modifications tend to work well, theoretical understanding is very weak. We consider possibly the most natural class of non-convex functions where one could hope to obtain provable guarantees: functions that are “approximately convex”, i.e. functions ˜f : Rd →R for which there exists a convex function f such that for all x, | ˜f(x) −f(x)| ≤∆for a fixed value ∆. We then want to minimize ˜f, i.e. output a point ˜x such that ˜f(˜x) ≤minx ˜f(x) + ϵ. It is quite natural to conjecture that for fixed ϵ, the problem gets harder for larger ∆, however, the exact dependency of ϵ and ∆is not known. In this paper, we significantly improve the known lower bound on ∆as a function of ϵ and an algorithm matching this lower bound for a natural class of convex bodies. More precisely, we identify a function T : R+ →R+ such that when ∆= O(T(ϵ)), we can give an algorithm that outputs a point ˜x such that ˜f(˜x) ≤minx ˜f(x) + ϵ within time poly d, 1 ϵ  . On the other hand, when ∆= Ω(T(ϵ)), we also prove an information theoretic lower bound that any algorithm that outputs such a ˜x must use super polynomial number of evaluations of ˜f. 1 Introduction Optimization of convex functions over a convex domain is a well studied problem in machine learning, where a variety of algorithms exist to solve the problem efficiently. However, in recent years, practitioners face ever more often non-convex objectives – e.g. training neural networks, learning graphical models, clustering data, maximum likelihood estimation etc. Albeit simple heuristics such as gradient descent with few modifications usually work very well, theoretical understanding in these settings are still largely open. The most natural class of non-convex functions where one could hope to obtain provable guarantees is functions that are “approximately convex”: functions ˜f : Rd →R for which there exists a convex function f such that for all x, | ˜f(x) −f(x)| ≤∆for a fixed value ∆. In this paper, we focus on zero order optimization of ˜f: an algorithm that outputs a point ˜x such that ˜f(˜x) ≤minx ˜f(x) + ϵ, where the algorithm in the course of its execution is allowed to pick points x ∈Rd and query the value of ˜f(x). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Trivially, one can solve the problem by constructing a ϵ-net and search through all the net points. However, such an algorithm requires Ω 1 ϵ d evaluations of ˜f, which is highly inefficient in high dimension. In this paper, we are interested in efficient algorithms: algorithms that run in time poly d, 1 ϵ  (in particular, this implies the algorithm makes poly d, 1 ϵ  evaluations of ˜f). One extreme case of the problem is ∆= 0, which is just standard convex optimization, where algorithms exist to solve it in polynomial time for every ϵ > 0. However, even when ∆is any quantity > 0, none of these algorithms extend without modification. (Indeed, we are not imposing any structure on ˜f −f like stochasticity.) Of course, when ∆= +∞, the problem includes any non-convex optimization, where we cannot hope for an efficient solution for any finite ϵ. Therefore, the crucial quantity to study is the optimal tradeoff of ϵ and ∆: For which ϵ, ∆the problem can be solved in polynomial time, and for which it can not. In this paper, we study the rate of ∆as a function of ϵ: We identify a function T : R+ →R+ such that when ∆= O(T(ϵ)), we can give an algorithm that outputs a point ˜x such that ˜f(˜x) ≤minx ˜f(x)+ϵ within time poly d, 1 ϵ  over a natural class of well-conditioned convex bodies. On the other hand, when ∆= ˜Ω(T(ϵ))1, we also prove an information theoretic lower bound that any algorithm outputs such ˜x must use super polynomial number of evaluations of ˜f. Our result can be summarized as the following two theorems: Theorem (Algorithmic upper bound, informal). There exists an algorithm A that for any function ˜f over a well-conditioned convex set in Rd of diameter 1 which is ∆close to an 1-Lipschitz convex function 2 f, and ∆= O  max  ϵ2 √ d , ϵ d  A finds a point ˜x such that ˜f(˜x) ≤minx ˜f(x) + ϵ within time poly d, 1 ϵ  The notion of well-conditioning will formally be defined in section 3, but intuitively captures the notion that the convex body “curves” in all directions to a good extent. Theorem (Information theoretic lower bound, informal). For every algorithm A, every d, ∆, ϵ with ∆= ˜Ω  max  ϵ2 √ d , ϵ d  there exists a function ˜f on a convex set in Rd of diameter 1, and ˜f is ∆close to an 1-Lipschitz convex function f, such that A can not find a point ˜x with ˜f(˜x) ≤minx ˜f(x) + ϵ in poly d, 1 ϵ  evaluations of ˜f. 2 Prior work To the best of our knowledge, there are three works on the problem of approximately convex optimization, which we summarize briefly below. On the algorithmic side, the classical paper by [DKS14] considered optimizing smooth convex functions over convex bodies with smooth boundaries. More precisely, they assume a bound on both the gradient and the Hessian of F. Furthermore, they assume that for every small ball centered at a point in the body, a large proportion of the volume of the ball lies in the body. Their algorithm is local search: they show that for a sufficiently small r, in a ball of radius r there is with high probability a point which has a smaller value than the current one, as long as the current value is sufficiently larger than the optimum. For constant-smooth functions only, their algorithm applies when ∆= O( ϵ √ d). Also on the algorithmic side, the work by [BLNR15] considers 1-Lipschitz functions, but their algorithm only applies to the case where ∆= O( ϵ d) (so not optimal unless ϵ = O( 1 √ d)). Their methods rely on sampling log-concave distribution via hit and run walks. The crucial idea is to show that for approximately convex functions, one needs to sample from “approximately log-concave” 1The ˜Ωnotation hides polylog(d/ϵ) factors. 2The assumptions on the diameter of K and the Lipschitz condition are for convenience of stating the results. (See Section ?? to extend to arbitrary diameter and Lipschitz constant) 2 distributions, which they show can be done by a form of rejection sampling together with classical methods for sampling log-concave distributions. Finally, [SV15] consider information theoretic lower bounds. They show that when ∆= 1/d1/2−δ no algorithm can, in polynomial time, achieve achieve ϵ = 1 2 −δ, when optimizing a convex function over the hypercube. This translates to a super polynomial information theoretic lower bound when ∆= Ω( ϵ √ d). They additionally give lower bounds when the approximately convex function is multiplicatively, rather than additively, close to a convex function. 3 We also note a related problem is zero-order optimization, where the goal is to minimize a function we only have value oracle access to. The algorithmic motivations here come from various applications where we only have black-box access to the function we are optimizing, and there is a classical line of work on characterizing the oracle complexity of convex optimization.[NY83, NS, DJWW15]. In all of these settings however, the oracles are either noiseless, or the noise is stochastic, usually because the target application is in bandit optimization. [AD10, AFH+11, Sha12] 3 Overview of results Formally, we will consider the following scenario. Definition 3.1. A function ˜f : K →Rd will be called ∆-approximately convex if there exists a 1-Lipschitz convex function f : K →Rd, s.t. ∀x ∈K, | ˜f(x) −f(x)| ≤∆. For ease of exposition, we also assume that K has diameter 14. We consider the problem of optimizing ˜f, more precisely, we are interesting in finding a point ˜x ∈K, such that ˜f(˜x) ≤min x∈K ˜f(x) + ϵ We give the following results: Theorem 3.1 (Information theoretic lower bound). For very constant c ≥1, there exists a constant dc such that for every algorithm A, every d ≥dc, there exists a convex set K ⊆Rd with diameter 1, an ∆-approximate convex function ˜f : K →R and ϵ ∈[0, 1/64) 5 such that ∆≥max  ϵ2 √ d , ϵ d  ×  13c log d ϵ 2 Such that A fails to output, with probability ≥1/2, a point ˜x ∈K with ˜f(˜x) ≤minx∈K{ ˜f(x)} + ϵ in o(( d ϵ )c) time. In order to state the upper bounds, we will need the definition of a well-conditioned body: Definition 3.2 (µ-well-conditioned). A convex body K is said to be µ-well-conditioned for µ ≥1, if there exists a function F : Rd →R such that K = {x|F(x) ≤0} and for every x ∈∂K: ∥∇2F (x)∥2 ∥∇F (x)∥2 ≤µ. This notion of well-conditioning of a convex body to the best of our knowledge has not been defined before, but it intuitively captures the notion that the convex body should “curve” in all directions to a certain extent. In particular, the unit ball has µ = 1. Theorem 3.2 (Algorithmic upper bound). Let d be a positive integer, δ > 0 be a positive real number, ϵ, ∆be two positive real number such that ∆≤max  ϵ2 µ √ d , ϵ d  × 1 16348 Then there exists an algorithm A such that on given any ∆-approximate convex function ˜f over a µ-rounded convex set K ⊆Rd of diameter 1, A returns a point ˜x ∈K with probability 1 −δ in time poly d, 1 ϵ , log 1 δ  such that ˜f(˜x) ≤min x∈K ˜f(x) + ϵ 3Though these are not too difficult to derive from the additive ones, considering the convex body has diameter bounded by 1. 4Generalizing to arbitrary Lipschitz constants and diameters is discussed in Section 6. 5Since we normalize f to be 1-Lipschitz and K to have diameter 1, the problem is only interesting for ϵ ≤1 3 For the reader wishing to digest a condition-free version of the above result, the following weaker result is also true (and much easier to prove): Theorem 3.3 (Algorithmic upper bound (condition-free)). Let d be a positive integer, δ > 0 be a positive real number, ϵ, ∆be two positive real number such that ∆≤max  ϵ2 √ d , ϵ d  × 1 16348 Then there exists an algorithm A such that on given any ∆-approximate convex function ˜f over a µ-rounded convex set K ⊆Rd of diameter 1, A returns a point ˜x ∈K with probability 1 −δ in time poly d, 1 ϵ , log 1 δ  such that ˜f(˜x) ≤ min x∈S(K,−ϵ) ˜f(x) + ϵ Where S(K, −ϵ) = {x ∈K|Bϵ(x) ⊆K} The result merely states that we can output a value that competes with points “well-inside” the convex body – around which a ball of radius of ϵ still lies inside the body. The assumptions on the diameter of K and the Lipschitz condition are for convenience of stating the results. It’s quite easy to extend both the lower and upper bounds to an arbitrary diameter and Lipschitz constant, as we discuss in Section 6. 3.1 Proof techniques We briefly outline the proof techniques we use. We proceed with the information theoretic lower bound first. The idea behind the proof is the following. We will construct a function G(x) and a family of convex functions {fw(x)} depending on a direction w ∈Sd (Sd is the unit sphere in Rd). On one hand, the minimal value of G and fw are quite different: minx G(x) ≥0, and minx fw(x) ≤−2ϵ. On the other hand, the approximately convex function ˜fw(x) for fw(x) we consider will be such that ˜fw(x) = G(x) except in a very small cone around w. Picking w at random, no algorithm with small number of queries will, with high probability, every query a point in this cone. Therefore, the algorithm will proceed as if the function is G(x) and fail to optimize ˜fw. Proceeding to the algorithmic result, since [BLNR15] already shows the existence of an efficient algorithm when ∆= O( ϵ d), we only need to give an algorithm that solves the problem when ∆= Ω( ϵ d) and ∆= O( ϵ2 √ d) (i.e. when ϵ, ∆are large). There are two main ideas for the algorithm. First, we show that the gradient of a smoothed version of ˜fw (in the spirit of [FKM05]) at any point x will be correlated with x∗−x, where x∗= argminx∈K ˜fw(x). The above strategy will however require averaging the value of ˜fw along a ball of radius ϵ, which in many cases will not be contained in K (especially when ϵ is large). Therefore, we come up with a way to extend ˜fw outside of K in a manner that maintains the correlation with x∗−x. 4 Information-theoretic lower bound In this section, we present the proof of Theorem 3.1. The idea is to construct a function G(x), a family of convex functions {fw(x)} depending on a direction w ∈Sd, such that minx G(x) ≥0, minx fw(x) ≤−2ϵ, and an approximately convex ˜fw(x) for fw(x) such that ˜fw(x) = G(x) except in a very small “critical” region depending on w. Picking w at random, we want to argue that the algorithm will with high probability not query the critical region. The convex body K used in the lower bound will be arguably the simplest convex body imaginable: the unit ball B1(0). We might hope to prove a lower bound for even a linear function fw for a start, similarly as in [SV15]. A reasonable candidate construction is the following: we set fw(x) = −ϵ⟨w, x⟩for some random chosen unit vector w and define ˜f(x) = 0 when |⟨x, w⟩| ≤log d ϵ √ d ∥x∥2 and ˜f(x) = fw(x) otherwise.6 6For the proof sketch only, to maintain ease of reading all of the inequalities we state will be only correct up to constants. In the actual proofs we will be completely formal. 4 Observe, this translates to ∆= log d ϵ √ d ϵ. It’s a standard concentration of measure fact that for “most” of the points x in the unit ball, |⟨x, w⟩| ≤log d ϵ √ d ∥x∥2. This implies that any algorithm that makes a polynomial number of queries to ˜f will with high probability see 0 in all of the queries, but clearly min ˜f(x) = −ϵ. However, this idea fails to generalize to optimal range as ∆= 1 √ dϵ is tight for linear, even smooth functions.7 In order to obtain the optimal bound, we need to modify the construction to a non-linear, non-smooth function. We will, in a certain sense, “hide” a random linear function inside a non-linear function. For a random unit vector w, we consider two regions inside the unit ball: a core C = Br(0) for r = max{ϵ, 1 √ d}, and a “critical angle” A = {x | |⟨x, w⟩| ≥log d ϵ √ d ∥x∥2}. The convex function f will look like ∥x∥1+α 2 for some α > 0 outside C ∪A and −ϵ⟨w, x⟩for x ∈C ∪A. We construct ˜f as ˜f = f when f(x) is sufficiently large (e.g. |f(x)| > ∆ 2 ) and ∆ 2 otherwise. Clearly, such ˜f obtain its minimal at point w, with ˜f(w) = −ϵ. However, since ˜f = ∥x∥1+α 2 outside C or A, the algorithm needs either query A or query C ∩Ac to detect w. The former happens with exponentially small probability in high dimensions, and for any x ∈C ∩Ac, |f(x)| = ϵ|⟨w, x⟩| ≤ϵ log d ϵ √ d ∥x∥2 ≤ ϵ log d ϵ √ d r ≤max{ ϵ2 √ d, ϵ d} × log d ϵ ≤∆ 2 , which implies that ˜f(x) = ∆ 2 . Therefore, the algorithm will fail with high probability. Now, we move on to the detailed of the constructions. We will consider K = B 1 2 (0): the ball of radius 1 2 in Rd centered at 0. 8 4.1 The family {fw(x)} Before delving into the construction we need the following definition: Definition 4.1 (Lower Convex Envelope (LCE)). Given a set S ⊆Rd, a function F : S →R, define the lower convex envelope FLCE = LCE(F) as a function FLCE : Rd →R such that for every x ∈Rd, FLCE(x) = max y∈S {⟨x −y, ∇F(y)⟩+ F(y)} Proposition 4.1. LCE(F) is convex. Proof. LCE(F) is the pointwise maximum of linear functions, so the claim follows. Remark : The LCE of a function F is a function defined over the entire Rd, while the input function F is only defined in a set S (not necessarily convex set). When the input function F is convex, LCE(F) can be considered as an extension of F to the entire Rd. To define the family fw(x), we will need four parameters: a power factor α > 0, a shrinking factor β, and a radius factor γ > 0, and a vector w ∈Rd such that ∥w∥2 = 1 2, which we specify in a short bit. Construction 4.1. Given w, α, β, γ, define the core C = Bγ(0), the critical angle A = {x | |⟨x, w⟩| ≥β∥x∥2} and let H = K ∩C ∩A. Let ˜h : H →R be defined as ˜h(x) = 1 2 ∥x∥1+α 2 and define lw(x) = −8ϵ⟨x, w⟩. Finally let fw : K →Rd as fw(x) = max n ˜hLCE(x), lw(x) o Where ˜hLCE = LCE(˜h) as in Definition 4.1. We then construct the “hard” function ˜fw as the following: Construction 4.2. Consider the function ˜fw : K →R: ˜fw(x) =  fw(x) if x ∈K ∩ C ∪A  ; max{fw(x), 1 2∆} otherwise. 7This follows from the results in [DKS14] 8We pick B 1 2 (0) instead of the unit ball in order to ensure the diameter is 1. 5 Consider the following settings of the parameters β, γ, α (depending on the magnitude of ϵ): • Case 1, 1 √ d ≤ϵ ≤ 1 (log d)2 : β = √ c log d ϵ √ d , γ = 10cϵ(log d ϵ )1.5, α = 1 log(1/γ). • Case 2, ϵ ≤ 1 √ d: β = √ c log d/ϵ √ d , γ = 10c √ d (log d/ϵ)3/2, α = 1 log(1/γ). • Case 3, 1 64 ≥ϵ ≥ 1 (log d)2 : β = √c log d √ d , γ = 1 2, α = 1. Then, the we formalize the proof intuition from the previous section with the following claims. Following the the proof outline, we first show the minimum of fw is small, in particular we will show fw(w) ≤−2ϵ. Lemma 4.1. fw(w) = −2ϵ Finally, we show that ˜fw is indeed a ∆-approximately convex, by showing ∀x ∈K, |fw −˜fw| ≤∆ and fw is 1-Lipschitz and convex. Proposition 4.2. ˜fw is a ∆-approximately convex. Next, we construct G(x), which does not depend on w, we want to show that for an algorithm with small number of queries of ˜fw, it can not distinguish fw from this function. Construction 4.3. Let G : K →R be defined as: G(x) =  max  1+α 4 ∥x∥2 −α 4 γ, 1 2∆ if x ∈K ∩C ; 1 2∥x∥1+α 2 otherwise. The following is true: Lemma 4.2. G(x) ≥0 and {x ∈K | G(x) ̸= ˜fw(x)} ⊆A We show how Theorem 3.1 is implied given these statements: Proof of Theorem 3.1. With everything prior to this set up, the final claim is somewhat standard. We want to show that no algorithm can, with probability ≥ 1 2, output a point x, s.t. ˜fw(x) ≤ minx ˜fw(x) + ϵ. Since we know that ˜fw(x) agrees with G(x) everywhere except in K ∩A, and G(x) satisfies minx G(x) ≥minx ˜fw(x) + ϵ, we only need to show that with high probability, any polynomial time algorithm will not query any point in K ∩A. Consider a (potentially) randomized algorithm A, making random choices R1, R2, . . . , Rm. Conditioned on a particular choice of randomness r1, r2, . . . , rm, for a random choice of w, each ri lies in A with probability at most exp(−c log(d/ϵ)), by a standard Gaussian tail bound. Union bounding, since m = o(( d ϵ )c) for an algorithm that runs in time o(( d ϵ )c), the probability that at least of the queries of A lies in A is at most 1 2. But the claim is true for any choice r1, r2, . . . , rm of the randomness, by averaging, the claim holds for r1, r2, . . . , rm being sampled according to the randomness of the algorithm. The proofs of all of the lemmas above have been ommited due to space constraints, and are included in the appendix in full. 5 Algorithmic upper bound As mentioned before, the algorithm in [BLNR15] covers the case when ∆= O( ϵ d), so we only need to give an algorithm when ∆= Ω( ϵ d) and ∆= O( ϵ2 d ). Our approach will not be making use of simulated annealing, but a more robust version of gradient descent. The intuition comes from [FKM05] who use estimates of the gradient of a convex function derived from Stokes’ formula: Ew∼Sd d r f(x + rw)w  = Z B ∇f(x)dx 6 where w ∼Sd denotes w being a uniform sample from the sphere Sd. Our observation is the gradient estimation is robust to noise if we instead use ˜f in the left hand side. Crucially, robust is not in the sense that it approximates the gradient of f, but it preserves the crucial property of the gradient of f we need: ⟨−∇f(x), x∗−x⟩≥f(x) −f(x∗). In words, this means if we move x at direction −∇f(x) for a small step, then x will be closer to x∗, and we will show the property is preserved by ˜f when ∆≤ ϵ2 √ d. Indeed, we have that:  −Ew∼Sd d r ˜f(x + rw)w  , x∗−x  ≥−Ew∼Sd d r f(x + rw)w, x∗−x  −d∆ r Ew∼Sd [|⟨w, x∗−x⟩|] The usual [FKM05] calculation shows that Ew∼Sd) d r f(x + rw)w, x∗−x  = Ω(f(x) −f(x∗) −2r) and d r ∆Ew∼U(Sd) [|⟨w, x∗−x⟩|] is bounded by O( ∆ √ d r ), since Ew∼U(Sd) [|⟨w, x∗−x⟩|] = O( 1 √ d). Therefore, we want f(x) −f(x∗) −2r ≥∆ √ d r whenever f(x) −f(x∗) ≥ϵ. Choosing the optimal parameter leads to r = ϵ 4 and ∆≤ ϵ2 √ d. This intuitive calculation basically proves the simple upper bound guarantee (Theorem 3.3). On the other hand, the argument requires sampling from a ball of radius Ω(ϵ) around point x. This is problematic when ϵ > 1 √ d: many convex bodies (e.g. the simplex, L1 ball after rescaling to diameter one) will not contain a ball of radius even 1 √ d. The idea is then to make the sampling possible by “extending” ˜f outside of K. Namely, we define a new function g : Rd →R such that (ΠK(x) is the projection of x to K) g(x) = ˜f(ΠK(x)) + d(x, K) g(x) will not be in general convex, but we instead directly bound ⟨Ew∼  1 rg(x + rw)w  , x −x∗⟩ for x ∈K and show that it behaves like ⟨−∇f(x), x∗−x⟩≥f(x) −f(x∗). Algorithm 1 Noisy Convex Optimization 1: Input: A convex set K ⊂Rd with diam(K) = 1 and 0 ∈K. A ∆-approximate convex function ˜f 2: Define: g : R →R as: ˜g(x) = ˜f(ΠK(x)) + d(x, K) where ΠK is the projection to K and d(x, K) is the Euclidean distance from x to K. 3: Initial: x1 = 0, r = ϵ 128µ, η = ϵ3 4194304d2 , T = 8388608d2 ϵ4 . 4: for t = 1, 2, ...., T do 5: Let vt = ˜f(xt). 6: Estimate up to accuracy ϵ 4194304 in l2 norm (by uniformly randomly sample w): gt = Ew∼Sd d r ˜g(xt + rw)w  where w ∼Sd means w is uniform sample from the unit sphere. 7: Update xt+1 = ΠK(xt −ηgt) 8: end for 9: Output mint∈[T ]{vt} The rest of this section will be dedicated to showing the following main lemma for Algorithm 1. Lemma 5.1 (Main, algorithm). Suppose ∆< ϵ2 16348 √ d, we have: For every t ∈[T], if there exists x∗∈K such that ˜f(x∗) < ˜f(xt) −2ϵ, then ⟨−gt, x∗−xt⟩≥ϵ 64 7 Assuming this Lemma, we can prove Theorem 3.2. Proof of Theorem 3.2. We first focus on the number of iterations: For every t ≥1, suppose ˜f(x∗) < ˜f(xt) −2ϵ, then we have: (since ∥gt∥≤2d/r ≤256d ϵ ) ∥x∗−xt+1∥2 2 ≤ ∥x∗−(xt −ηgt)∥2 2 = ∥x∗−xt∥2 2 −2η⟨x∗−xt, gt⟩+ η2∥gt∥2 2 ≤ ∥x∗−xt∥2 2 −ηϵ 64 + η2 65536d2 ϵ2 ≤ ∥x∗−xt∥2 2 − ϵ4 8388608d2 + ϵ4 4194304d2 = ∥x∗−xt∥2 2 − ϵ4 8388608d2 Since originally ∥x∗−x1∥≤1, the algorithm ends in poly(d, 1 ϵ ) iterations. Now we consider the sample complexity. Since we know that d r ˜g(xt + rw)w 2 ≤64d ϵ By standard concentration bound we know that we need poly(d, 1 ϵ ) samples to estimate the expectation up to error ϵ 2097152 per iteration. Due to space constraints, we forward the proof of Lemma 5.1 to the appendix. 6 Discussion and open problems 6.1 Arbitrary Lipschitz constants and diameter We assumed throughout the paper that the convex function f is 1-Lipschitz and the convex set K has diameter 1. Our results can be easily extended to arbitrary functions and convex sets through a simple linear transformation. For f with Lipschitz constant ∥f∥Lip and K with diameter D, and the corresponding approximately convex ˜f, define ˜g : K D →R as ˜g(x) = 1 D∥f∥Lip ˜f(rx). (Where K D is the rescaling of K by a factor of 1 D.) This translates to ∥˜g(x) −g(x)∥2 ≤ ∆ R∥f∥Lip . But g(x) = f(Rx) R∥f∥Lip is 1-Lipschitz over a set K R of diameter 1. Therefore, for general functions over a general convex sets, our result trivially implies the rate for being able to optimize approximately-convex functions is ∆ R∥f∥Lip = max ( 1 √ d  ϵ R∥f∥Lip 2 , 1 d ϵ R∥f∥Lip ) which simplifies to ∆= max n ϵ2 √ dR∥f∥Lip , ϵ d o . 6.2 Body specific bounds Our algorithmic result matches the lower bound on well-conditioned bodies. The natural open problem is to resolve the problem for arbitrary bodies. 9 Also note the lower bound can not hold for any convex body K in Rd: for example, if K is just a one dimensional line in Rd, then the threshold should not depend on d at all. But even when the “inherent dimension” of K is d, the result is still body specific: one can show that for ˜f over the simplex in Rd, when ϵ ≥ 1 √ d, it is possible to optimize ˜f in polynomial time even when ∆is as large as ϵ. 10 Finally, while our algorithm made use of the well-conditioning – what is the correct property/parameter of the convex body that governs the rate of T(ϵ) is a tantalizing question to explore in future work. 9We do not show it here, but one can prove the upp/lower bound still holds over the hypercube and when one can find a ball of radius ϵ that has most of the mass in the convex body K. 10Again, we do not show that here, but essentially one can search through the d + 1 lines from the center to the d + 1 corners. 8 References [AD10] Alekh Agarwal and Ofer Dekel. Optimal algorithms for online convex optimization with multi-point bandit feedback. In COLT, pages 28–40. Citeseer, 2010. [AFH+11] Alekh Agarwal, Dean P Foster, Daniel J Hsu, Sham M Kakade, and Alexander Rakhlin. Stochastic convex optimization with bandit feedback. In Advances in Neural Information Processing Systems, pages 1035–1043, 2011. [BLNR15] Alexandre Belloni, Tengyuan Liang, Hariharan Narayanan, and Alexander Rakhlin. Escaping the local minima via simulated annealing: Optimization of approximately convex functions. In Proceedings of The 28th Conference on Learning Theory, pages 240–265, 2015. [DJWW15] John C Duchi, Michael I Jordan, Martin J Wainwright, and Andre Wibisono. Optimal rates for zero-order convex optimization: The power of two function evaluations. Information Theory, IEEE Transactions on, 61(5):2788–2806, 2015. [DKS14] Martin Dyer, Ravi Kannan, and Leen Stougie. A simple randomised algorithm for convex optimisation. Mathematical Programming, 147(1-2):207–229, 2014. [FKM05] 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. [NS] Yurii Nesterov and Vladimir Spokoiny. Random gradient-free minimization of convex functions. Foundations of Computational Mathematics, pages 1–40. [NY83] Arkadii Nemirovskii and David Borisovich Yudin. Problem complexity and method efficiency in optimization. Wiley-Interscience series in discrete mathematics. Wiley, Chichester, New York, 1983. A Wiley-Interscience publication. [Sha12] Ohad Shamir. On the complexity of bandit and derivative-free stochastic convex optimization. arXiv preprint arXiv:1209.2388, 2012. [SV15] Yaron Singer and Jan Vondrák. Information-theoretic lower bounds for convex optimization with erroneous oracles. In Advances in Neural Information Processing Systems, pages 3186–3194, 2015. 9
2016
65
6,525
The Parallel Knowledge Gradient Method for Batch Bayesian Optimization Jian Wu, Peter I. Frazier Cornell University Ithaca, NY, 14853 {jw926, pf98}@cornell.edu Abstract In many applications of black-box optimization, one can evaluate multiple points simultaneously, e.g. when evaluating the performances of several different neural networks in a parallel computing environment. In this paper, we develop a novel batch Bayesian optimization algorithm — the parallel knowledge gradient method. By construction, this method provides the one-step Bayes optimal batch of points to sample. We provide an efficient strategy for computing this Bayes-optimal batch of points, and we demonstrate that the parallel knowledge gradient method finds global optima significantly faster than previous batch Bayesian optimization algorithms on both synthetic test functions and when tuning hyperparameters of practical machine learning algorithms, especially when function evaluations are noisy. 1 Introduction In Bayesian optimization [19] (BO), we wish to optimize a derivative-free expensive-to-evaluate function f with feasible domain A ⊆Rd, min x∈A f(x), with as few function evaluations as possible. In this paper, we assume that membership in the domain A is easy to evaluate and we can evaluate f only at points in A. We assume that evaluations of f are either noise-free, or have additive independent normally distributed noise. We consider the parallel setting, in which we perform more than one simultaneous evaluation of f. BO typically puts a Gaussian process prior distribution on the function f, updating this prior distribution with each new observation of f, and choosing the next point or points to evaluate by maximizing an acquisition function that quantifies the benefit of evaluating the objective as a function of where it is evaluated. In comparison with other global optimization algorithms, BO often finds “near optimal” function values with fewer evaluations [19]. As a consequence, BO is useful when function evaluation is time-consuming, such as when training and testing complex machine learning algorithms (e.g. deep neural networks) or tuning algorithms on large-scale dataset (e.g. ImageNet) [4]. Recently, BO has become popular in machine learning as it is highly effective in tuning hyperparameters of machine learning algorithms [8, 9, 19, 22]. Most previous work in BO assumes that we evaluate the objective function sequentially [13], though a few recent papers have considered parallel evaluations [3, 5, 18, 25]. While in practice, we can often evaluate several different choices in parallel, such as multiple machines can simultaneously train the machine learning algorithm with different sets of hyperparameters. In this paper, we assume that we can access q ≥1 evaluations simultaneously at each iteration. Then we develop a new parallel acquisition function to guide where to evaluate next based on the decision-theoretical analysis. Our Contributions. We propose a novel batch BO method which measures the information gain of evaluating q points via a new acquisition function, the parallel knowledge gradient (q-KG). This 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. method is derived using a decision-theoretic analysis that chooses the set of points to evaluate next that is optimal in the average-case with respect to the posterior when there is only one batch of points remaining. Naively maximizing q-KG would be extremely computationally intensive, especially when q is large, and so, in this paper, we develop a method based on infinitesimal perturbation analysis (IPA) [25] to evaluate q-KG’s gradient efficiently, allowing its efficient optimization. In our experiments on both synthetic functions and tuning practical machine learning algorithms, q-KG consistently finds better function values than other parallel BO algorithms, such as parallel EI [2, 19, 25], batch UCB [5] and parallel UCB with exploration [3]. q-KG provides especially large value when function evaluations are noisy. The code in this paper is available at https://github.com/wujian16/qKG. The rest of the paper is organized as follows. Section 2 reviews related work. Section 3 gives background on Gaussian processes and defines notation used later. Section 4 proposes our new acquisition function q-KG for batch BO. Section 5 provides our computationally efficient approach to maximizing q-KG. Section 6 presents the empirical performance of q-KG and several benchmarks on synthetic functions and real problems. Finally, Section 7 concludes the paper. 2 Related work Within the past several years, the machine learning community has revisited BO [8, 9, 18, 19, 20, 22] due to its huge success in tuning hyperparameters of complex machine learning algorithms. BO algorithms consist of two components: a statistical model describing the function and an acquisition function guiding evaluations. In practice, Gaussian Process (GP) [16] is the mostly widely used statistical model due to its flexibility and tractability. Much of the literature in BO focuses on designing good acquisition functions that reach optima with as few evaluations as possible. Maximizing this acquisition function usually provides a single point to evaluate next, with common acquisition functions for sequential Bayesian optimization including probability of improvement (PI)[23], expected improvement (EI) [13], upper confidence bound (UCB) [21], entropy search (ES) [11], and knowledge gradient (KG) [17]. Recently, a few papers have extended BO to the parallel setting, aiming to choose a batch of points to evaluate next in each iteration, rather than just a single point. [10, 19] suggests parallelizing EI by iteratively constructing a batch, in each iteration adding the point with maximal single-evaluation EI averaged over the posterior distribution of previously selected points. [10] also proposes an algorithm called “constant liar", which iteratively constructs a batch of points to sample by maximizing singleevaluation while pretending that points previously added to the batch have already returned values. There are also work extending UCB to the parallel setting. [5] proposes the GP-BUCB policy, which selects points sequentially by a UCB criterion until filling the batch. Each time one point is selected, the algorithm updates the kernel function while keeping the mean function fixed. [3] proposes an algorithm combining UCB with pure exploration, called GP-UCB-PE. In this algorithm, the first point is selected according to a UCB criterion; then the remaining points are selected to encourage the diversity of the batch. These two algorithms extending UCB do not require Monte Carlo sampling, making them fast and scalable. However, UCB criteria are usually designed to minimize cumulative regret rather than immediate regret, causing these methods to underperform in BO, where we wish to minimize simple regret. The parallel methods above construct the batch of points in an iterative greedy fashion, optimizing some single-evaluation acquisition function while holding the other points in the batch fixed. The acquisition function we propose considers the batch of points collectively, and we choose the batch to jointly optimize this acquisition function. Other recent papers that value points collectively include [2] which optimizes the parallel EI by a closed-form formula, [15, 25], in which gradient-based methods are proposed to jointly optimize a parallel EI criterion, and [18], which proposes a parallel version of the ES algorithm and uses Monte Carlo Sampling to optimize the parallel ES acquisition function. We compare against methods from a number of these previous papers in our numerical experiments, and demonstrate that we provide an improvement, especially in problems with noisy evaluations. Our method is also closely related to the knowledge gradient (KG) method [7, 17] for the non-batch (sequential) setting, which chooses the Bayes-optimal point to evaluate if only one iteration is left [17], and the final solution that we choose is not restricted to be one of the points we evaluate. (Expected improvement is Bayes-optimal if the solution is restricted to be one of the points we evaluate.) We go beyond this previous work in two aspects. First, we generalize to the parallel setting. 2 Second, while the sequential setting allows evaluating the KG acquisition function exactly, evaluation requires Monte Carlo in the parallel setting, and so we develop more sophisticated computational techniques to optimize our acquisition function. Recently, [26] studies a nested batch knowledge gradient policy. However, they optimize over a finite discrete feasible set, where the gradient of KG does not exist. As a result, their computation of KG is much less efficient than ours. Moreover, they focus on a nesting structure from materials science not present in our setting. 3 Background on Gaussian processes In this section, we state our prior on f, briefly discuss well known results about Gaussian processes (GP), and introduce notation used later. We put a Gaussian process prior over the function f : A →R, which is specified by its mean function µ(x) : A →R and kernel function K(x1, x2) : A × A →R. We assume either exact or independent normally distributed measurement errors, i.e. the evaluation y(xi) at point xi satisfies y(xi) | f(xi) ∼N(f(xi), σ2(xi)), where σ2 : A →R+ is a known function describing the variance of the measurement errors. If σ2 is not known, we can also estimate it as we do in Section 6. Supposing we have measured f at n points x(1:n) := {x(1), x(2), · · · , x(n)} and obtained corresponding measurements y(1:n), we can then combine these observed function values with our prior to obtain a posterior distribution on f. This posterior distribution is still a Gaussian process with the mean function µ(n) and the kernel function K(n) as follows µ(n)(x) = µ(x) + K(x, x(1:n))  K(x(1:n), x(1:n)) + diag{σ2(x(1)), · · · , σ2(x(n))} −1 (y(1:n) −µ(x(1:n))), K(n)(x1, x2) = K(x1, x2) −K(x1, x(1:n))  K(x(1:n), x(1:n)) + diag{σ2(x(1)), · · · , σ2(x(n))} −1 K(x(1:n), x2). (3.1) 4 Parallel knowledge gradient (q-KG) In this section, we propose a novel parallel Bayesian optimization algorithm by generalizing the concept of the knowledge gradient from [7] to the parallel setting. The knowledge gradient policy in [7] for discrete A chooses the next sampling decision by maximizing the expected incremental value of a measurement, without assuming (as expected improvement does) that the point returned as the optimum must be a previously sampled point. We now show how to compute this expected incremental value of an additional iteration in the parallel setting. Suppose that we have observed n function values. If we were to stop measuring now, minx∈A µ(n)(x) would be the minimum of the predictor of the GP. If instead we took one more batch of samples, minx∈A µ(n+q)(x) would be the minimum of the predictor of the GP. The difference between these quantities, minx∈A µ(n)(x)−minx∈A µ(n+q)(x), is the increment in expected solution quality (given the posterior after n + q samples) that results from the additional batch of samples. This increment in solution quality is random given the posterior after n samples, because minx∈A µ(n+q)(x) is itself a random vector due to its dependence on the outcome of the samples. We can compute the probability distribution of this difference (with more details given below), and the q-KG algorithm values the sampling decision z(1:q) := {z1, z2, · · · , zq} according to its expected value, which we call the parallel knowledge gradient factor, and indicate it using the notation q-KG. Formally, we define the q-KG factor for a set of candidate points to sample z(1:q) as q-KG(z(1:q), A) = min x∈A µ(n)(x) −En  min x∈A µ(n+q)(x)|y(z(1:q))  , (4.1) where En [·] := E  ·|x(1:n), y(1:n) is the expectation taken with respect to the posterior distribution after n evaluations. Then we choose to evaluate the next batch of q points that maximizes the parallel knowledge gradient, max z(1:q)⊂A q-KG(z(1:q), A). (4.2) 3 By construction, the parallel knowledge gradient policy is Bayes-optimal for minimizing the minimum of the predictor of the GP if only one decision is remaining. The q-KG algorithm will reduce to the parallel EI algorithm if function evaluations are noise-free and the final recommendation is restricted to the previous sampling decisions. Because under the two conditions above, the increment in expected solution quality will become min x∈x(1:n) µ(n)(x) − min x∈x(1:n)∪z(1:q) µ(n+q)(x) = min y(1:n) −min  y(1:n), min x∈z(1:q) µ(n+q)(x)  =  min y(1:n) − min x∈z(1:q) µ(n+q)(x) + , which is exactly the parallel EI acquisition function. However, computing q-KG and its gradient is very expensive. We will address the computational issues in Section 5. The full description of the q-KG algorithm is summarized as follows. Algorithm 1 The q-KG algorithm Require: the number of initial stage samples I, and the number of main stage sampling iterations N. 1: Initial Stage: draw I initial samples from a latin hypercube design in A, x(i) for i = 1, . . . , I . 2: Main Stange: 3: for s = 1 to N do 4: Solve (4.2), i.e. get (z∗ 1, z∗ 2, · · · , z∗ q) = argmaxz(1:q)⊂Aq-KG(z(1:q), A) 5: Sample these points (z∗ 1, z∗ 2, · · · , z∗ q), re-train the hyperparameters of the GP by MLE, and update the posterior distribution of f. 6: end for 7: return x∗= argminx∈Aµ(I+Nq)(x). 5 Computation of q-KG In this section, we provide the strategy to maximize q-KG by a gradient-based optimizer. In Section 5.1 and Section 5.2, we describe how to compute q-KG and its gradient when A is finite in (4.1). Section 5.3 describes an effective way to discretize A in (4.1). The readers should note that there are two As here, one is in (4.1) which is used to compute the q-KG factor given a sampling decision z(1:q). The other is the feasible domain in (4.2) (z(1:q) ⊂A) that we optimize over. We are discretizing the first A. 5.1 Estimating q-KG when A is finite in (4.1) Following [7], we express µ(n+q)(x) as µ(n+q)(x) = µ(n)(x) + K(n)(x, z(1:q))  K(n)(z(1:q), z(1:q)) +diag{σ2(z(1)), · · · , σ2(z(q))} −1  y(z(1:q)) −µ(n)(z(1:q))  . Because y(z(1:q)) −µ(n)(z(1:q)) is normally distributed with zero mean and covariance matrix K(n)(z(1:q), z(1:q))+diag{σ2(z(1)), · · · , σ2(z(q))} with respect to the posterior after n observations, we can rewrite µ(n+q)(x) as µ(n+q)(x) = µ(n)(x) + ˜σn(x, z(1:q))Zq, (5.1) where Zq is a standard q-dimensional normal random vector, and ˜σn(x, z(1:q)) = K(n)(x, z(1:q))(D(n)(z(1:q))T )−1, where D(n)(z(1:q)) is the Cholesky factor of the covariance matrix K(n)(z(1:q), z(1:q)) + diag{σ2(z(1)), · · · , σ2(z(q))}. Now we can compute the q-KG factor using Monte Carlo sampling when A is finite: we can sample Zq, compute (5.1), then plug in (4.1), repeat many times and take average. 4 5.2 Estimating the gradient of q-KG when A is finite in (4.1) In this section, we propose an unbiased estimator of the gradient of q-KG using IPA when A is finite. Accessing a stochastic gradient makes optimization much easier. By (5.1), we express q-KG as q-KG(z(1:q), A) = EZq  g(z(1:q), A, Zq)  , (5.2) where g = minx∈A µ(n)(x) −minx∈A µ(n)(x) + ˜σn(x, z(1:q))Zq  . Under the condition that µ and K are continuously differentiable, one can show that (please see the details in the supplementary materials) ∂ ∂zij q-KG(z(1:q), A) = EZq  ∂ ∂zij g(z(1:q), A, Zq)  , (5.3) where zij is the jth dimension of the ith point in z(1:q). By the formula of g, ∂ ∂zij g(z(1:q), A, Zq) = ∂ ∂zij µ(n)(x∗(before)) − ∂ ∂zij µ(n)(x∗(after)) −∂ ∂zij ˜σn(x∗(after), z(1:q))Zq where x∗(before) = argminx∈Aµ(n)(x), x∗(after) = argminx∈A µ(n)(x) + ˜σn(x, z(1:q))Zq  , and ∂ ∂zij ˜σn(x∗(after), z(1:q)) =  ∂ ∂zij K(n)(x∗(after), z(1:q))  (D(n)(z(1:q))T )−1 −K(n)(x∗(after), z(1:q))(D(n)(z(1:q))T )−1  ∂ ∂zij D(n)(z(1:q))T  (D(n)(z(1:q))T )−1. Now we can sample many times and take average to estimate the gradient of q-KG via (5.3). This technique is called infinitesimal perturbation analysis (IPA) in gradient estimation [14]. Since we can estimate the gradient of q-KG efficiently when A is finite, we will apply some standard gradient-based optimization algorithms, such as multi-start stochastic gradient ascent to maximize q-KG. 5.3 Approximating q-KG when A is infinite in (4.1) through discretization We have specified how to maximize q-KG when A is finite in (4.1), but usually A is infinite. In this case, we will discretize A to approximate q-KG, and then maximize over the approximate q-KG. The discretization itself is an interesting research topic [17]. In this paper, the discrete set An is not chosen statically, but evolves over time: specifically, we suggest drawing M samples from the global optima of the posterior distribution of the Gaussian process (please refer to [11, 18] for a description of this technique). This sample set, denoted by AM n , is then extended by the locations of previously sampled points x(1:n) and the set of candidate points z(1:q). Then (4.1) can be restated as q-KG(z(1:q), An) = min x∈An µ(n)(x) −En  min x∈An µ(n+q)(x)|y(z(1:q))  , (5.4) where An = AM n ∪x(1:n) ∪z(1:q). For the experimental evaluation we recompute AM n in every iteration after updating the posterior of the Gaussian process. 6 Numerical experiments We conduct experiments in two different settings: the noise-free setting and the noisy setting. In both settings, we test the algorithms on well-known synthetic functions chosen from [1] and practical problems. Following previous literature [19], we use a constant mean prior and the ARD Mat´ern 5/2 kernel. In the noisy setting, we assume that σ2(x) is constant across the domain A, and we estimate it together with other hyperparameters in the GP using maximum likelihood estimation (MLE). We set M = 1000 to discretize the domain following the strategy in Section 5.3. In general, the q-KG 5 0 20 40 60 80 100 120 140 160 function evaluations −3.0 −2.5 −2.0 −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 the log10 scale of the immediate regret 2d BraninNoNoise function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG 0 20 40 60 80 100 120 140 160 function evaluations −3 −2 −1 0 1 2 3 the log10 scale of the immediate regret 3d RosenbrockNoNoise function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG 0 50 100 150 200 250 function evaluations −0.4 −0.2 0.0 0.2 0.4 0.6 0.8 the log10 scale of the immediate regret 5d AckleyNoNoise function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG 0 20 40 60 80 100 120 140 160 180 function evaluations −1.5 −1.0 −0.5 0.0 0.5 the log10 scale of the immediate regret 6d HartmannNoNoise function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG Figure 1: Performances on noise-free synthetic functions with q = 4. We report the mean and the standard deviation of the log10 scale of the immediate regret vs. the number of function evaluations. algorithm performs as well or better than state-of-art benchmark algorithms on both synthetic and real problems. It performs especially well in the noisy setting. Before describing the details of the empirical results, we highlight the implementation details of our method and the open-source implementations of the benchmark methods. Our implementation inherits the open-source implementation of parallel EI from the Metrics Optimization Engine [24], which is fully implemented in C++ with a python interface. We reuse their GP regression and GP hyperparameter fitting methods and implement the q-KG method in C++. Besides comparing to parallel EI in [24], we also compare our method to a well-known heuristic parallel EI implemented in Spearmint [12], the parallel UCB algorithm (GP-BUCB) and parallel UCB with pure exploration (GP-UCB-PE) both implemented in Gpoptimization [6]. 6.1 Noise-free problems In this section, we focus our attention on the noise-free setting, in which we can evaluate the objective exactly. We show that parallel knowledge gradient outperforms or is competitive with state-of-art benchmarks on several well-known test functions and tuning practical machine learning algorithms. 6.1.1 Synthetic functions First, we test our algorithm along with the benchmarks on 4 well-known synthetic test functions: Branin2 on the domain [−15, 15]2, Rosenbrock3 on the domain [−2, 2]3, Ackley5 on the domain [−2, 2]5, and Hartmann6 on the domain [0, 1]6. We initiate our algorithms by randomly sampling 2d + 2 points from a Latin hypercube design, where d is the dimension of the problem. Figure 3 reports the mean and the standard deviation of the base 10 logarithm of the immediate regret by running 100 random initializations with batch size q = 4. The results show that q-KG is significantly better on Rosenbrock3, Ackley5 and Hartmann6, and is slightly worse than the best of the other benchmarks on Branin2. Especially on Rosenbrock3 and Ackley5, q-KG makes dramatic progress in early iterations. 6.1.2 Tuning logistic regression and convolutional neural networks (CNN) In this section, we test the algorithms on two practical problems: tuning logistic regression on the MNIST dataset and tuning CNN on the CIFAR10 dataset. We set the batch size to q = 4. 6 First, we tune logistic regression on the MNIST dataset. This task is to classify handwritten digits from images, and is a 10-class classification problem. We train logistic regression on a training set with 60000 instances with a given set of hyperparameters and test it on a test set with 10000 instances. We tune 4 hyperparameters: mini batch size from 10 to 2000, training iterations from 100 to 10000, the ℓ2 regularization parameter from 0 to 1, and learning rate from 0 to 1. We report the mean and standard deviation of the test error for 20 independent runs. From the results, one can see that both algorithms are making progress at the initial stage while q-KG can maintain this progress for longer and results in a better algorithm configuration in general. 0 10 20 30 40 50 60 70 function evaluations 0.05 0.10 0.15 0.20 0.25 0.30 test error Logistic Regression on MNIST MOE-qEI Spearmint-qEI qKG 10 20 30 40 50 60 70 80 90 function evaluations 0.10 0.15 0.20 0.25 0.30 0.35 CNN on CIFAR10 Spearmint-qEI qKG Figure 2: Performances on tuning machine learning algorithms with q = 4 In the second experiment, we tune a CNN on CIFAR10 dataset. This is also a 10-class classification problem. We train the CNN on the 50000 training data with certain hyperparameters and test it on the test set with 10000 instances. For the network architecture, we choose the one in tensorflow tutorial. It consists of 2 convolutional layers, 2 fully connected layers, and on top of them is a softmax layer for final classification. We tune totally 8 hyperparameters: the mini batch size from 10 to 1000, training epoch from 1 to 10, the ℓ2 regularization parameter from 0 to 1, learning rate from 0 to 1, the kernel size from 2 to 10, the number of channels in convolutional layers from 10 to 1000, the number of hidden units in fully connected layers from 100 to 1000, and the dropout rate from 0 to 1. We report the mean and standard deviation of the test error for 5 independent runs. In this example, the q-KG is making better (more aggressive) progress than parallel EI even in the initial stage and maintain this advantage to the end. This architecture has been carefully tuned by the human expert, and achieve a test error around 14%, and our automatic algorithm improves it to around 11%. 6.2 Noisy problems In this section, we study problems with noisy function evaluations. Our results show that the performance gains over benchmark algorithms from q-KG evident in the noise-free setting are even larger in the noisy setting. 6.2.1 Noisy synthetic functions We test on the same 4 synthetic functions from the noise-free setting, and add independent gaussian noise with standard deviation σ = 0.5 to the function evaluation. The algorithms are not given this standard deviation, and must learn it from data. The results in Figure 4 show that q-KG is consistently better than or at least competitive with all competing methods. Also observe that the performance advantage of q-KG is larger than for noise-free problems. 6.2.2 Noisy logistic regression with small test sets Testing on a large test set such as ImageNet is slow, especially when we must test many times for different hyperparameters. To speed up hyperparameter tuning, we may instead test the algorithm on a subset of the testing data to approximate the test error on the full set. We study the performance of our algorithm and benchmarks in this scenario, focusing on tuning logistic regression on MNIST. We train logistic regression on the full training set of 60, 000, but we test the algorithm by testing on 1, 000 randomly selected samples from the test set, which provides a noisy approximation of the test error on the full test set. 7 0 20 40 60 80 100 120 140 160 function evaluations −2.5 −2.0 −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 the log10 scale of the immediate regret 2d Branin function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG 0 50 100 150 200 250 300 350 function evaluations −2.0 −1.5 −1.0 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 the log10 scale of the immediate regret 3d Rosenbrock function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG 0 50 100 150 200 250 function evaluations −0.2 0.0 0.2 0.4 0.6 0.8 the log10 scale of the immediate regret 5d Ackley function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG 0 20 40 60 80 100 120 140 160 180 function evaluations −0.6 −0.4 −0.2 0.0 0.2 0.4 0.6 the log10 scale of the immediate regret 6d Hartmann function with batch size 4 GP-BUCB GP-UCB-PE MOE-qEI Spearmint-qEI qKG Figure 3: Performances on noisy synthetic functions with q = 4. We report the mean and the standard deviation of the log10 scale of the immediate regret vs. the number of function evaluations. 0 10 20 30 40 50 60 70 function evaluations 0.05 0.10 0.15 0.20 0.25 0.30 0.35 test error Logistic Regression on MNIST with Smaller Test Sets MOE-qEI Spearmint-qEI qKG Figure 4: Tuning logistic regression on smaller test sets with q = 4 We report the mean and standard deviation of the test error on the full set using the hyperparameters recommended by each parallel BO algorithm for 20 independent runs. The result shows that q-KG is better than both versions of parallel EI, and its final test error is close to the noise-free test error (which is substantially more expensive to obtain). As we saw with synthetic test functions, q-KG’s performance advantage in the noisy setting is wider than in the noise-free setting. Acknowledgments The authors were partially supported by NSF CAREER CMMI-1254298, NSF CMMI-1536895, NSF IIS-1247696, AFOSR FA9550-12-1-0200, AFOSR FA9550-15-1-0038, and AFOSR FA9550-16-10046. 7 Conclusions In this paper, we introduce a novel batch Bayesian optimization method q-KG, derived from a decision-theoretical perspective, and develop a computational method to implement it efficiently. We show that q-KG outperforms or is competitive with the state-of-art benchmark algorithms on several synthetic functions and in tuning practical machine learning algorithms. 8 References [1] Bingham, D. (2015). Optimization test problems. http://www.sfu.ca/~ssurjano/optimization. html. [2] Chevalier, C. and Ginsbourger, D. (2013). Fast computation of the multi-points expected improvement with applications in batch selection. In Learning and Intelligent Optimization, pages 59–69. Springer. [3] Contal, E., Buffoni, D., Robicquet, A., and Vayatis, N. (2013). Parallel gaussian process optimization with upper confidence bound and pure exploration. In Machine Learning and Knowledge Discovery in Databases, pages 225–240. Springer. [4] Deng, L. and Yu, D. (2014). Deep learning: Methods and applications. Foundations and Trends in Signal Processing, 7(3–4):197–387. [5] Desautels, T., Krause, A., and Burdick, J. W. (2014). Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization. The Journal of Machine Learning Research, 15(1):3873–3923. [6] etal, E. C. (2015). Gpoptimization. https://reine.cmla.ens-cachan.fr/e.contal/ gpoptimization. [7] Frazier, P., Powell, W., and Dayanik, S. (2009). The knowledge-gradient policy for correlated normal beliefs. INFORMS journal on Computing, 21(4):599–613. [8] Gardner, J. R., Kusner, M. J., Xu, Z. E., Weinberger, K. Q., and Cunningham, J. (2014). Bayesian optimization with inequality constraints. In ICML, pages 937–945. [9] Gelbart, M., Snoek, J., and Adams, R. (2014). Bayesian optimization with unknown constraints. In Proceedings of the Thirtieth Conference Annual Conference on Uncertainty in Artificial Intelligence (UAI-14), pages 250–259, Corvallis, Oregon. AUAI Press. [10] Ginsbourger, D., Le Riche, R., and Carraro, L. (2010). Kriging is well-suited to parallelize optimization. In Computational Intelligence in Expensive Optimization Problems, pages 131–162. Springer. [11] Hernández-Lobato, J. M., Hoffman, M. W., and Ghahramani, Z. (2014). Predictive entropy search for efficient global optimization of black-box functions. In Advances in Neural Information Processing Systems, pages 918–926. [12] Jasper Snoek, Hugo Larochelle, R. P. A. e. (2015). Spearmint. https://github.com/HIPS/Spearmint. [13] Jones, D. R., Schonlau, M., and Welch, W. J. (1998). Efficient global optimization of expensive black-box functions. Journal of Global optimization, 13(4):455–492. [14] L’Ecuyer, P. (1990). A unified view of the IPA, SF, and LR gradient estimation techniques. Management Science, 36(11):1364–1383. [15] Marmin, S., Chevalier, C., and Ginsbourger, D. (2015). Differentiating the multipoint expected improvement for optimal batch design. In International Workshop on Machine Learning, Optimization and Big Data, pages 37–48. Springer. [16] Rasmussen, C. E. (2006). Gaussian processes for machine learning. [17] Scott, W., Frazier, P., and Powell, W. (2011). The correlated knowledge gradient for simulation optimization of continuous parameters using gaussian process regression. SIAM Journal on Optimization, 21(3):996–1026. [18] Shah, A. and Ghahramani, Z. (2015). Parallel predictive entropy search for batch global optimization of expensive objective functions. In Advances in Neural Information Processing Systems, pages 3312–3320. [19] Snoek, J., Larochelle, H., and Adams, R. P. (2012). Practical bayesian optimization of machine learning algorithms. In Advances in neural information processing systems, pages 2951–2959. [20] Snoek, J., Swersky, K., Zemel, R., and Adams, R. (2014). Input warping for bayesian optimization of non-stationary functions. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1674–1682. [21] Srinivas, N., Krause, A., Seeger, M., and Kakade, S. M. (2010). Gaussian process optimization in the bandit setting: No regret and experimental design. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 1015–1022. [22] Swersky, K., Snoek, J., and Adams, R. P. (2013). Multi-task bayesian optimization. In Advances in neural information processing systems, pages 2004–2012. [23] Törn, A. and Zilinskas, A. (1989). Global optimization, volume 350 of lecture notes in computer science. [24] Wang, J., Clark, S. C., Liu, E., and Frazier, P. I. (2014). Metrics optimization engine. http://yelp. github.io/MOE/. Last accessed on 2016-01-21. [25] Wang, J., Clark, S. C., Liu, E., and Frazier, P. I. (2015a). Parallel bayesian global optimization of expensive functions. [26] Wang, Y., Reyes, K. G., Brown, K. A., Mirkin, C. A., and Powell, W. B. (2015b). Nested-batch-mode learning and stochastic optimization with an application to sequential multistage testing in materials science. SIAM Journal on Scientific Computing, 37(3):B361–B381. 9
2016
66
6,526
Edge-exchangeable graphs and sparsity Diana Cai Dept. of Statistics, U. Chicago Chicago, IL 60637 dcai@uchicago.edu Trevor Campbell CSAIL, MIT Cambridge, MA 02139 tdjc@mit.edu Tamara Broderick CSAIL, MIT Cambridge, MA 02139 tbroderick@csail.mit.edu Abstract Many popular network models rely on the assumption of (vertex) exchangeability, in which the distribution of the graph is invariant to relabelings of the vertices. However, the Aldous-Hoover theorem guarantees that these graphs are dense or empty with probability one, whereas many real-world graphs are sparse. We present an alternative notion of exchangeability for random graphs, which we call edge exchangeability, in which the distribution of a graph sequence is invariant to the order of the edges. We demonstrate that edge-exchangeable models, unlike models that are traditionally vertex exchangeable, can exhibit sparsity. To do so, we outline a general framework for graph generative models; by contrast to the pioneering work of Caron and Fox [12], models within our framework are stationary across steps of the graph sequence. In particular, our model grows the graph by instantiating more latent atoms of a single random measure as the dataset size increases, rather than adding new atoms to the measure. 1 Introduction In recent years, network data have appeared in a growing number of applications, such as online social networks, biological networks, and networks representing communication patterns. As a result, there is growing interest in developing models for such data and studying their properties. Crucially, individual network data sets also continue to increase in size; we typically assume that the number of vertices is unbounded as time progresses. We say a graph sequence is dense if the number of edges grows quadratically in the number of vertices, and a graph sequence is sparse if the number of edges grows sub-quadratically as a function of the number of vertices. Sparse graph sequences are more representative of real-world graph behavior. However, many popular network models (see, e.g., Lloyd et al. [19] for an extensive list) share the undesirable scaling property that they yield dense sequences of graphs with probability one. The poor scaling properties of these models can be traced back to a seemingly innocent assumption: that the vertices in the model are exchangeable, that is, any finite permutation of the rows and columns of the graph adjacency matrix does not change the distribution of the graph. Under this assumption, the Aldous-Hoover theorem [1, 16] implies that such models generate dense or empty graphs with probability one [20]. This fundamental model misspecification motivates the development of new models that can achieve sparsity. One recent focus has been on models in which an additional parameter is employed to uniformly decrease the probabilities of edges as the network grows (e.g., Bollobás et al. [3], Borgs et al. [4, 5], Wolfe and Olhede [24]). While these models allow sparse graph sequences, the sequences are no longer projective. In projective sequences, vertices and edges are added to a graph as a graph sequence progresses—whereas in the models above, there is not generally any strict subgraph relationship between earlier graphs and later graphs in the sequence. Projectivity is natural in streaming modeling. For instance, we may wish to capture new users joining a social network and new connections being made among existing users—or new employees joining a company and new communications between existing employees. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Caron and Fox [12] have pioneered initial work on sparse, projective graph sequences. Instead of the vertex exchangeability that yields the Aldous-Hoover theorem, they consider a notion of graph exchangeability based on the idea of independent increments of subordinators [18], explored in depth by Veitch and Roy [22]. However, since this Kallenberg-style exchangeability introduces a new countable infinity of latent vertices at every step in the graph sequence, its generative mechanism seems particularly suited to the non-stationary domain. By contrast, we are here interested in exploring stationary models that grow in complexity with the size of the data set. Consider classic Bayesian nonparametric models as the Chinese restaurant process (CRP) and Indian buffet process (IBP); these engender growth by using a single infinite latent collection of parameters to generate a finite but growing set of instantiated parameters. Similarly, we propose a framework that uses a single infinite latent collection of vertices to generate a finite but growing set of vertices that participate in edges and thereby in the network. We believe our framework will be a useful component in more complex, non-stationary graphical models—just as the CRP and IBP are often combined with hidden Markov models or other explicit non-stationary mechanisms. Additionally, Kallenberg exchangeability is intimately tied to continuous-valued labels of the vertices, and here we are interested in providing a characterization of the graph sequence based solely on its topology. In this work, we introduce a new form of exchangeability, distinct from both vertex exchangeability and Kallenberg exchangeability. In particular, we say that a graph sequence is edge exchangeable if the distribution of any graph in the sequence is invariant to the order in which edges arrive—rather than the order of the vertices. We will demonstrate that edge exchangeability admits a large family of sparse, projective graph sequences. In the remainder of the paper, we start by defining dense and sparse graph sequences rigorously. We review vertex exchangeability before introducing our new notion of edge exchangeability in Section 2, which we also contrast with Kallenberg exchangeability in more detail in Section 4. We define a family of models, which we call graph frequency models, based on random measures in Section 3. We use these models to show that edge-exchangeable models can yield sparse, projective graph sequences via theoretical analysis in Section 5 and via simulations in Section 6. Along the way, we highlight other benefits of the edge exchangeability and graph frequency model frameworks. 2 Exchangeability in graphs: old and new Let (Gn)n := G1, G2, . . . be a sequence of graphs, where each graph Gn = (Vn, En) consists of a (finite) set of vertices Vn and a (finite) multiset of edges En. Each edge e ∈En is a set of two vertices in Vn. We assume the sequence is projective—or growing—so that Vn ⊆Vn+1 and En ⊆En+1. Consider, e.g., a social network with more users joining the network and making new connections with existing users. We say that a graph sequence is dense if |En| = Ω(|Vn|2), i.e., the number of edges is asymptotically lower bounded by c · |Vn|2 for some constant c. Conversely, a sequence is sparse if |En| = o(|Vn|2), i.e., the number of edges is asymptotically upper bounded by c · |Vn|2 for all constants c. In what follows, we consider random graph sequences, and we focus on the case where |Vn| →∞almost surely. 2.1 Vertex-exchangeable graph sequences If the number of vertices in the graph sequence grows to infinity, the graphs in the sequence can be thought of as subgraphs of an “infinite” graph with infinitely many vertices and a correspondingly infinite adjacency matrix. Traditionally, exchangeability in random graphs is defined as the invariance of the distribution of any finite submatrix of this adjacency matrix—corresponding to any finite collection of vertices—under finite permutation. Equivalently, we can express this form of exchangeability, which we henceforth call vertex exchangeability, by considering a random sequence of graphs (Gn)n with Vn = [n], where [n] := {1, . . . , n}. In this case, only the edge sequence is random. Let π be any permutation of the integers [n]. If e = {v, w}, let π(e) := {π(v), π(w)}. If En = {e1, . . . , em}, let π(En) := {π(e1), . . . , π(em)}. Definition 2.1. Consider the random graph sequence (Gn)n, where Gn has vertices Vn = [n] and edges En. (Gn)n is (infinitely) vertex exchangeable if for every n ∈N and for every permutation π of the vertices [n], Gn d= ˜Gn, where ˜Gn has vertices [n] and edges π(En). 2 1 1 2 2 1 2 3 2 1 2 3 4 2 4 4 4 3 2 4 1 3 3 2 4 2 5 1 1 2 5 1 1 2 5 1 3 1 2 5 1 6 1 3 1 4 2 5 1 6 4 2 4 1 Figure 1: Upper, left four: Step-augmented graph sequence from Ex. 2.2. At each step n, the step value is always at least the maximum vertex index. Upper, right two: Two graphs with the same probability under vertex exchangeability. Lower, left four: Step-augmented graph sequence from Ex. 2.3. Lower, right two: Two graphs with the same probability under edge exchangeability. A great many popular models for graphs are vertex exchangeable; see Appendix B and Lloyd et al. [19] for a list. However, it follows from the Aldous-Hoover theorem [1, 16] that any vertexexchangeable graph is a mixture of sampling procedures from graphons. Further, any graph sampled from a graphon is almost surely dense or empty [20]. Thus, vertex-exchangeable random graph models are misspecified models for sparse network datasets, as they generate dense graphs. 2.2 Edge-exchangeable graph sequences Vertex-exchangeable sequences have distributions invariant to the order of vertex arrival. We introduce edge-exchangeable graph sequences, which will instead be invariant to the order of edge arrival. As before, we let Gn = (Vn, En) be the nth graph in the sequence. Here, though, we consider only active vertices—that is, vertices that are connected via some edge. That lets us define Vn as a function of En; namely, Vn is the union of the vertices in En. Note that a graph that has sub-quadratic growth in the number of edges as a function of the number of active vertices will necessarily have sub-quadratic growth in the number of edges as a function of the number of all vertices, so we obtain strictly stronger results by considering active vertices. In this case, the graph Gn is completely defined by its edge set En. As above, we suppose that En ⊆En+1. We can emphasize this projectivity property by augmenting each edge with the step on which it is added to the sequence. Let E′ n be a collection of tuples, in which the first element is the edge and the second element is the step (i.e., index) on which the edge is added: E′ n = {(e1, s1), . . . , (em, sm)}. We can then define a step-augmented graph sequence (E′ n)n = (E′ 1, E′ 2, . . .) as a sequence of step-augmented edge sets. Note that there is a bijection between the step-augmented graph sequence and the original graph sequence. Example 2.2. In the setup for vertex exchangeability, we assumed Vn = [n] and every edge is introduced as soon as both of its vertices are introduced. In this case, the step of any edge in the step-augmented graph is the maximum vertex value. For example, in Figure 1, we have E′ 1 = ∅, E′ 2 = E′ 3 = {({1, 2}, 2)}, E′ 4 = {({1, 2}, 2), ({1, 4}, 4), ({2, 4}, 4), ({3, 4}, 4)}. In general step-augmented graphs, though, the step need not equal the max vertex, as we see next. ■ Example 2.3. Suppose we have a graph given by the edge sequence (see Figure 1): E1 = E2 = {{2, 5}, {5, 5}}, E3 = E2 ∪{{2, 5}}, E4 = E3 ∪{{1, 6}}. The step-augmented graph E′ 4 is {({2, 5}, 1), ({5, 5}, 1), ({2, 5}, 3), ({1, 6}, 4)}. ■ Roughly, a random graph sequence is edge exchangeable if its distribution is invariant to finite permutations of the steps. Let π be a permutation of the integers [n]. For a step-augmented edge set E′ n = {(e1, s1), . . . , (em, sm)}, let π(E′ n) = {(e1, π(s1)), . . . , (em, π(sm))}. Definition 2.4. Consider the random graph sequence (Gn)n, where Gn has step-augmented edges E′ n and Vn are the active vertices of En. (Gn)n is (infinitely) edge exchangeable if for every n ∈N 3 and for every permutation π of the steps [n], Gn d= ˜Gn, where ˜Gn has step-augmented edges π(E′ n) and associated active vertices. See Figure 1 for visualizations of both vertex exchangeability and edge exchangeability. It remains to show that there are non-trivial models that are edge exchangeable (Section 3) and that edgeexchangeable models admit sparse graphs (Section 5). 3 Graph frequency models We next demonstrate that a wide class of models, which we call graph frequency models, exhibit edge exchangeability. Consider a latent infinity of vertices indexed by the positive integers N = {1, 2, . . .}, along with an infinity of edge labels (θ{i,j}), each in a set Θ, and positive edge rates (or frequencies) (w{i,j}) in R+. We allow both the (θ{i,j}) and (w{i,j}) to be random, though this is not mandatory. For instance, we might choose θ{i,j} = (i, j) for i ≤j, and Θ = R2. Alternatively, the θ{i,j} could be drawn iid from a continuous distribution such as Unif[0, 1]. For any choice of (θ{i,j}) and (w{i,j}), W := X {i,j}:i,j∈N w{i,j}δθ{i,j} (1) is a measure on Θ. Moreover, it is a discrete measure since it is always atomic. If either (θ{i,j}) or (w{i,j}) (or both) are random, W is a discrete random measure on Θ since it is a random, discretemeasure-valued element. Given the edge rates (or frequencies) (w{i,j}) in W, we next show some natural ways to construct edge-exchangeable graphs. Single edge per step. If the rates (w{i,j}) are normalized such that P {i,j}:i,j∈N w{i,j} = 1, then (w{i,j}) is a distribution over all possible vertex pairs. In other words, W is a probability measure. We can form an edge-exchangeable graph sequence by first drawing values for (w{i,j}) and (θ{i,j})—and setting E0 = ∅. We recursively set En+1 = En ∪{e}, where e is an edge {i, j} chosen from the distribution (w{i,j}). This construction introduces a single edge in the graph each step, although it may be a duplicate of an edge that already exists. Therefore, this technique generates multigraphs one edge at a time. Since the edge every step is drawn conditionally iid given W, we have an edge-exchangeable graph. Multiple edges per step. Alternatively, the rates (w{i,j}) may not be normalized. Then W may not be a probability measure. Let f(m|w) be a distribution over non-negative integers m given some rate w ∈R+. We again initialize our sequence by drawing (w{i,j}) and (θ{i,j}) and setting E0 = ∅. In this case, recursively, on the nth step, start by setting F = ∅. For every possible edge e = {i, j}, we draw the multiplicity of the edge e in this step as me ind ∼f(·|we) and add me copies of edge e to F. Finally, En+1 = En ∪F. This technique potentially introduces multiple edges in each step, in which edges themselves may have multiplicity greater than one and may be duplicates of edges that already exist in the graph. Therefore, this technique generates multigraphs, multiple edges at a time. If we restrict f and W such that finitely many edges are added on every step almost surely, we have an edge-exchangeable graph, as the edges in each step are drawn conditionally iid given W. Given a sequence of edge sets E0, E1, . . . constructed via either of the above methods, we can form a binary graph sequence ¯E0, ¯E1, . . . by setting ¯Ei to have the same edges as Ei except with multiplicity 1. Although this binary graph is not itself edge exchangeable, it inherits many of the properties (such as sparsity, as shown in Section 5) of the underlying edge-exchangeable multigraph. The choice of the distribution on the measure W has a strong influence on the properties of the resulting edge-exchangeable graph sampled via one of the above methods. For example, one choice is to set w{i,j} = wiwj, where the (wi)i are a countable infinity of random values generated according to a Poisson point process (PPP). We say that (wi)i is distributed according to a Poisson point process parameterized by rate measure ν, (wi)i ∼PPP(ν), if (a) #{i : wi ∈A} ∼Poisson(ν(A)) for any set A with finite measure ν(A) and (b) #{i : wi ∈Aj} are independent random variables across any finite collection of disjoint sets (Aj)J j=1. In Section 5 we examine a particular example of this graph frequency model, and demonstrate that sparsity is possible in edge-exchangeable graphs. 4 (a) Graph frequency model (fixed y, n steps) (b) Caron–Fox, PPP on [0, y] × [0, y] (1 step, y grows) Figure 2: A comparison of a graph frequency model (Section 3 and Equation (2)) and the generative model of Caron and Fox [12]. Any interval [0, y] contains a countably infinite number of atoms with a nonzero weight in the random measure; a draw from the random measure is plotted at the top (and repeated on the right side). Each atom corresponds to a latent vertex. Each point (θi, θj) corresponds to a latent edge. Darker point colors on the left occur for greater edge multiplicities. On the left, more latent edges are instantiated as more steps n are taken. On the right, the edges within [0, y]2 are fixed, but more edges are instantiated as y grows. 4 Related work and connection to nonparametric Bayes Given a unique label θi for each vertex i ∈N, and denoting gij = gji to be the number of undirected edges between vertices i and j, the graph itself can be represented as the discrete random measure G = P i,j gijδ(θi,θj) on R2 +. A different notion of exchangeability for graphs than the ones in Section 2 can be phrased for such atomic random measures: a point process G on R2 + is (jointly) exchangeable if, for all finite permutations π of N and all h > 0, G(Ai × Aj) d= G(Aπ(i) × Aπ(j)), for (i, j) ∈N2, where Ai := [h · (i −1), h · i]. This form of exchangeability, which we refer to as Kallenberg exchangeability, can intuitively be viewed as invariance of the graph distribution to relabeling of the vertices, which are now embedded in R2 +. As such it is analogous to vertex exchangeability, but for discrete random measures [12, Sec. 4.1]. Exchangeability for random measures was introduced by Aldous [2], and a representation theorem was given by Kallenberg [17, 18, Ch. 9]. The use of Kallenberg exchangeability for modeling graphs was first proposed by Caron and Fox [12], and then characterized in greater generality by Veitch and Roy [22] and Borgs et al. [6]. Edge exchangeability is distinct from Kallenberg exchangeability, as shown by the following example. Example 4.1 (Edge exchangeable but not Kallenberg exchangeable). Consider the graph frequency model developed in Section 3, with w{i,j} = (ij)−2 and θ{i,j} = {i, j}. Since the edges at each step are drawn iid given W, the graph sequence is edge exchangeable. However, the corresponding graph measure G = P i,j nijδ(i,j) (where nij = nji ∼Binom(N, (ij)−2)) is not Kallenberg exchangeable, since the probability of generating edge {i, j} is directly related to the positions (i, j) and (j, i) in R2 + of the corresponding atoms in G (in particular, the probability is decreasing in ij). ■ Our graph frequency model is reminiscent of the Caron and Fox [12] generative model, but has a number of key differences. At a high level, this earlier model generates a weight measure W = P i,j wijδ(θi,θj) (Caron and Fox [12] used, in particular, the outer product of a completely random measure), and the graph measure G is constructed by sampling gij once given wij for each pair i, j. To create a finite graph, the graph measure G is restricted to the subset [0, y] × [0, y] ⊂R2 + for 0 < y < ∞; to create a projective growing graph sequence, the value of y is increased. By contrast, in the analogous graph frequency model of the present work, y is fixed, and we grow the network 5 by repeatedly sampling the number of edges gij between vertices i and j and summing the result. Thus, in the Caron and Fox [12] model, a latent infinity of vertices (only finitely many of which are active) are added to the network each time y increases. In our graph frequency model, there is a single collection of latent vertices, which are all gradually activated by increasing the number of samples that generate edges between the vertices. See Figure 2 for an illustration. Increasing n in the graph frequency model has the interpretation of both (a) time passing and (b) new individuals joining a network because they have formed a connection that was not previously there. In particular, only latent individuals that will eventually join the network are considered. This behavior is analogous to the well-known behavior of other nonparametric Bayesian models such as, e.g., a Chinese restaurant process (CRP). In this analogy, the Dirichlet process (DP) corresponds to our graph frequency model, and the clusters instantiated by the CRP correspond to the vertices that are active after n steps. In the DP, only latent clusters that will eventually appear in the data are modeled. Since the graph frequency setting is stationary like the DP/CRP, it may be more straightforward to develop approximate Bayesian inference algorithms, e.g., via truncation [11]. Edge exchangeability first appeared in work by Crane and Dempsey [13, 14], Williamson [23], and Broderick and Cai [7, 8], Cai and Broderick [10]. Broderick and Cai [7, 8] established the notion of edge exchangeability used here and provided characterizations via exchangeable partitions and feature allocations, as in Appendix C. Broderick and Cai [7], Cai and Broderick [10] developed a frequency model based on weights (wi)i generated from a Poisson process and studied several types of power laws in the model. Crane and Dempsey [13] established a similar notion of edge exchangeability in the context of a larger statistical modeling framework. Crane and Dempsey [13, 14] provided sparsity and power law results for the case where the weights (wi)i are generated from a Pitman-Yor process and power law degree distribution simulations. Williamson [23] described a similar notion of edge exchangeability and developed an edge-exchangeable model where the weights (wi)i are generated from a Dirichlet process, a mixture model extension, and an efficient Bayesian inference procedure. In work concurrent to the present paper, Crane and Dempsey [15] re-examined edge exchangeability, provided a representation theorem, and studied sparsity and power laws for the same model based on Pitman-Yor weights. By contrast, we here obtain sparsity results across all Poisson point process-based graph frequency models of the form in Equation (2) below, and use a specific three-parameter beta process rate measure only for simulations in Section 6. 5 Sparsity in Poisson process graph frequency models We now demonstrate that, unlike vertex exchangeability, edge exchangeability allows for sparsity in random graph sequences. We develop a class of sparse, edge-exchangeable multigraph sequences via the Poisson point process construction introduced in Section 3, along with their binary restrictions. Model. Let W be a Poisson process on [0, 1] with a nonatomic, σ-finite rate measure ν satisfying ν([0, 1]) = ∞and R 1 0 wν(dw) < ∞. These two conditions on ν guarantee that W is a countably infinite collection of rates in [0, 1] and that P w∈W w < ∞almost surely. We can use W to construct the set of rates: w{i,j} = wiwj if i ̸= j, and w{i,i} = 0. The edge labels θ{i,j} are unimportant in characterizing sparsity, and so can be ignored. To use the multiple-edges-per-step graph frequency model from Section 3, we let f(·|w) be Bernoulli with probability w. Since edge {i, j} is added in each step with probability wiwj, its multiplicity M{i,j} after n steps has a binomial distribution with parameters n, wiwj. Note that self-loops are avoided by setting w{i,i} = 0. Therefore, the graph after n steps is described by: W ∼PPP(ν) M{i,j} ind ∼Binom(n, wiwj) for i < j ∈N. (2) As mentioned earlier, this generative model yields an edge-exchangeable graph, with edge multiset En containing {i, j} with multiplicity M{i,j}, and active vertices Vn = {i : P j M{i,j} > 0}. Although this model generates multigraphs, it can be modified to sample a binary graph ( ¯Vn, ¯En) by setting ¯Vn = Vn and ¯En to the set of edges {i, j} such that {i, j} has multiplicity ≥1 in En. We can express the number of vertices and edges, in the multi- and binary graphs respectively, as | ¯Vn|=|Vn|= X i 1  X j̸=i M{i,j} > 0  , |En| = 1 2 X i̸=j M{i,j}, | ¯En| = 1 2 X i̸=j 1 M{i,j} > 0  . 6 Moments. Recall that a sequence of graphs is considered sparse if |En| = o(|Vn|2). Thus, sparsity in the present setting is an asymptotic property of a random graph sequence. Rather than consider the asymptotics of the (dependent) random sequences |En| and |Vn| in concert, Lemma 5.1 allows us to consider the asymptotics of their first moments, which are deterministic sequences and can be analyzed separately. We use ∼to denote asymptotic equivalence, i.e., an ∼bn ⇐⇒limn→∞an bn = 1. For details on our asymptotic notation and proofs for this section, see Appendix D. Lemma 5.1. The number of vertices and edges for both the multi- and binary graphs satisfy | ¯Vn| = |Vn| a.s. ∼E (|Vn|) , |En| a.s. ∼E (|En|) , | ¯En| a.s. ∼E | ¯En|  , n →∞. Thus, we can examine the asymptotic behavior of the random numbers of edges and vertices by examining the asymptotic behavior of their expectations, which are provided by Lemma 5.2. Lemma 5.2. The expected numbers of vertices and edges for the multi- and binary graphs are E | ¯Vn|  = E (|Vn|) = Z  1 −exp  − Z (1 −(1 −wv)n)ν(dv)  ν(dw), E (|En|) = n 2 ZZ wv ν(dw)ν(dv), E | ¯En|  = 1 2 ZZ (1 −(1 −wv)n) ν(dw)ν(dv). Sparsity. We are now equipped to characterize the sparsity of this random graph sequence: Theorem 5.3. Suppose ν has a regularly varying tail, i.e., there exist α ∈(0, 1) and ℓ: R+ →R+ s.t. Z 1 x ν(dw) ∼x−αℓ(x−1), x →0 and ∀c > 0, lim x→∞ ℓ(cx) ℓ(x) = 1. Then as n →∞, |Vn| a.s. = Θ(nαℓ(n)), |En| a.s. = Θ(n), | ¯En| a.s. = O  ℓ(n1/2) min  n 1+α 2 , ℓ(n)n 3α 2  . Theorem 5.3 implies that the multigraph is sparse when α ∈(1/2, 1), and that the restriction to the binary graph is sparse for any α ∈(0, 1). See Remark D.7 for a discussion. Thus, edge-exchangeable random graph sequences allow for a wide range of sparse and dense behavior. 6 Simulations In this section, we explore the behavior of graphs generated by the model from Section 5 via simulation, with the primary goal of empirically demonstrating that the model produces sparse graphs. We consider the case when the Poisson process generating the weights in Equation (2) has the rate measure of a three-parameter beta process (3-BP) on (0, 1) [9, 21]: ν(dw) = γ Γ(1 + β) Γ(1 −α)Γ(α + β)w−1−α(1 −w)α+β−1 dw, (3) with mass γ > 0, concentration β > 0, and discount α ∈(0, 1). In order for the 3-BP to have finite total mass P j wj < ∞, we require that β > −α. We draw realizations of the weights from a 3-BP(γ, β, α) according to the stick-breaking representation given by Broderick, Jordan, and Pitman [9]. That is, the wi are the atom weights of the measure W for W = ∞ X i=1 Ci X j=1 V (i) i,j i−1 Y l=1 (1 −V (ℓ) i,j )δψi,j, Ci iid∼Pois(γ), V (ℓ) i,j ind ∼Beta(1 −α, β + ℓα), ψi,j iid∼B0 and any continuous (i.e., non-atomic) choice of distribution B0. Since simulating an infinite number of atoms is not possible, we truncate the outer summation in i to 2000 rounds, resulting in P2000 i=1 Ci weights. The parameters of the beta process were fixed to γ = 3 and θ = 1, as they do not influence the sparsity of the resulting graph frequency model, and we varied 7 (a) Multigraph edges vs. active vertices (b) Binary graph edges vs. active vertices Figure 3: Data simulated from a graph frequency model with weights generated according to a 3-BP. Colors represent different random draws. The dashed line has a slope of 2. the discount parameter α. Given a single draw W (at some specific discount α), we then simulated the edges of the graph, where the number of Bernoulli draws N varied between 50 and 2000. Figure 3a shows how the number of edges varies versus the total number of active vertices for the multigraph, with different colors representing different random seeds. To check whether the generated graph was sparse, we determined the exponent by examining the slope of the data points (on a log-scale). In all plots, the black dashed line is a line with slope 2. In the multigraph, we found that for the discount parameter settings α = 0.6, 0.7, the slopes were below 2; for α = 0, 0.3, the slopes were greater than 2. This corresponds to our theoretical results; for α < 0.5 the multigraph is dense with slope greater than 2, and for α > 0.5 the multigraph is sparse with slope less than 2. Furthermore, the sparse graphs exhibit power law relationships between the number of edges and vertices, i.e., |EN| a.s. ∼c |VN|b, N →∞, where b ∈(1, 2), as suggested by the linear relationship in the plots between the quantities on a log-scale. Note that there are necessarily fewer edges in the binary graph than in the multigraph, and thus this plot implies that the binary graph frequency model can also capture sparsity. Figure 3b confirms this observation; it shows how the number of edges varies with the number of active vertices for the binary graph. In this case, across α ∈(0, 1), we observe slopes that are less than 2. This agrees with our theory from Section 5, which states that the binary graph is sparse for any α ∈(0, 1). 7 Conclusions We have proposed an alternative form of exchangeability for random graphs, which we call edge exchangeability, in which the distribution of a graph sequence is invariant to the order of the edges. We have demonstrated that edge-exchangeable graph sequences, unlike traditional vertex-exchangeable sequences, can be sparse by developing a class of edge-exchangeable graph frequency models that provably exhibit sparsity. Simulations using edge frequencies drawn according to a three-parameter beta process confirm our theoretical results regarding sparsity. Our results suggest that a variety of future directions would be fruitful—including theoretically characterizing different types of power laws within graph frequency models, characterizing the use of truncation within graph frequency models as a means for approximate Bayesian inference in graphs, and understanding the full range of distributions over sparse, edge-exchangeable graph sequences. Acknowledgments We would like to thank Bailey Fosdick and Tyler McCormick for helpful conversations. 8 References [1] D. J. Aldous. Representations for partially exchangeable arrays of random variables. Journal of Multivariate Analysis, 11(4):581–598, 1981. [2] D. J. Aldous. Exchangeability and related topics. In École d’été de probabilités de Saint-Flour, XIII—1983, volume 1117 of Lecture Notes in Math., pages 1–198. Springer, Berlin, 1985. [3] B. Bollobás, S. Janson, and O. Riordan. The phase transition in inhomogeneous random graphs. Random Structures Algorithms, 31(1):3–122, 2007. [4] C. Borgs, J. T. Chayes, H. Cohn, and Y. Zhao. An Lp theory of sparse graph convergence I: limits, sparse random graph models, and power law distributions. arXiv e-print 1401.2906, 2014. [5] C. Borgs, J. T. Chayes, H. Cohn, and S. Ganguly. Consistent nonparametric estimation for heavy-tailed sparse graphs. arXiv e-print 1401.1137, 2015. [6] C. Borgs, J. T. Chayes, H. Cohn, and N. Holden. Sparse exchangeable graphs and their limits via graphon processes. arXiv e-print 1601.07134, 2016. [7] T. Broderick and D. Cai. Edge-exchangeable graphs, sparsity, and power laws. In NIPS 2015 Workshop on Bayesian Nonparametrics: The Next Generation, 2015. [8] T. Broderick and D. Cai. Edge-exchangeable graphs and sparsity. In NIPS 2015 Workshop on Networks in the Social and Informational Sciences, 2015. [9] T. Broderick, M. I. Jordan, and J. Pitman. Beta processes, stick-breaking and power laws. Bayesian Analysis, 7(2):439–475, 2012. [10] D. Cai and T. Broderick. Completely random measures for modeling power laws in sparse graphs. In NIPS 2015 Workshop on Networks in the Social and Informational Sciences, 2015. [11] T. Campbell, J. Huggins, J. How, and T. Broderick. Truncated random measures. arXiv e-print 1603.00861, 2016. [12] F. Caron and E. Fox. Sparse graphs using exchangeable random measures. arXiv e-print 1401.1137v3, 2015. [13] H. Crane and W. Dempsey. A framework for statistical network modeling. arXiv e-print 1509.08185, 2015. [14] H. Crane and W. Dempsey. Atypical scaling behavior persists in real world interaction networks. arXiv e-print 1509.08184, 2015. [15] H. Crane and W. Dempsey. Edge exchangeable models for network data. arXiv e-print 1603.04571, 2016. [16] D. N. Hoover. Relations on probability spaces and arrays of random variables. Preprint, Institute for Advanced Study, Princeton, NJ, 1979. [17] O. Kallenberg. Exchangeable random measures in the plane. Journal of Theoretical Probability, 3(1): 81–136, 1990. [18] O. Kallenberg. Probabilistic symmetries and invariance principles. Probability and its Applications. Springer, New York, 2005. [19] J. R. Lloyd, P. Orbanz, Z. Ghahramani, and D. M. Roy. Random function priors for exchangeable arrays with applications to graphs and relational data. In NIPS 25, 2012. [20] P. Orbanz and D. M. Roy. Bayesian models of graphs, arrays and other exchangeable random structures. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(2):437–461, 2015. [21] Y. W. Teh and D. Görür. Indian buffet processes with power-law behavior. In NIPS 23, 2009. [22] V. Veitch and D. M. Roy. The class of random graphs arising from exchangeable random measures. arXiv e-print 1512.03099, 2015. [23] S. Williamson. Nonparametric network models for link prediction. Journal of Machine Learning Research, 17:1–21, 2016. [24] P. J. Wolfe and S. C. Olhede. Nonparametric graphon estimation. arXiv e-print 1309.5936, 2013. 9
2016
67
6,527
Stochastic Variance Reduction Methods for Saddle-Point Problems P. Balamurugan INRIA - Ecole Normale Supérieure, Paris balamurugan.palaniappan@inria.fr Francis Bach INRIA - Ecole Normale Supérieure, Paris francis.bach@ens.fr Abstract We consider convex-concave saddle-point problems where the objective functions may be split in many components, and extend recent stochastic variance reduction methods (such as SVRG or SAGA) to provide the first large-scale linearly convergent algorithms for this class of problems which are common in machine learning. While the algorithmic extension is straightforward, it comes with challenges and opportunities: (a) the convex minimization analysis does not apply and we use the notion of monotone operators to prove convergence, showing in particular that the same algorithm applies to a larger class of problems, such as variational inequalities, (b) there are two notions of splits, in terms of functions, or in terms of partial derivatives, (c) the split does need to be done with convex-concave terms, (d) non-uniform sampling is key to an efficient algorithm, both in theory and practice, and (e) these incremental algorithms can be easily accelerated using a simple extension of the “catalyst” framework, leading to an algorithm which is always superior to accelerated batch algorithms. 1 Introduction When using optimization in machine learning, leveraging the natural separability of the objective functions has led to many algorithmic advances; the most common example is the separability as a sum of individual loss terms corresponding to individual observations, which leads to stochastic gradient descent techniques. Several lines of work have shown that the plain Robbins-Monro algorithm could be accelerated for strongly-convex finite sums, e.g., SAG [1], SVRG [2], SAGA [3]. However, these only apply to separable objective functions. In order to tackle non-separable losses or regularizers, we consider the saddle-point problem: min x∈Rd max y∈Rn K(x, y) + M(x, y), (1) where the functions K and M are “convex-concave”, that is, convex with respect to the first variable, and concave with respect to the second variable, with M potentially non-smooth but “simple” (e.g., for which the proximal operator is easy to compute), and K smooth. These problems occur naturally within convex optimization through Lagrange or Fenchel duality [4]; for example the bilinear saddlepoint problem minx∈Rd maxy∈Rn f(x)+y⊤Kx−g(y) corresponds to a supervised learning problem with design matrix K, a loss function g∗(the Fenchel conjugate of g) and a regularizer f. We assume that the function K may be split into a potentially large number of components. Many problems in machine learning exhibit that structure in the saddle-point formulation, but not in the associated convex minimization and concave maximization problems (see examples in Section 2.1). Like for convex minimization, gradient-based techniques that are blind to this separable structure need to access all the components at every iteration. We show that algorithms such as SVRG [2] and SAGA [3] may be readily extended to the saddle-point problem. While the algorithmic extension is straightforward, it comes with challenges and opportunities. We make the following contributions: 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. – We provide the first convergence analysis for these algorithms for saddle-point problems, which differs significantly from the associated convex minimization set-up. In particular, we use in Section 6 the interpretation of saddle-point problems as finding the zeros of a monotone operator, and only use the monotonicity properties to show linear convergence of our algorithms, thus showing that they extend beyond saddle-point problems, e.g., to variational inequalities [5, 6]. – We show that the saddle-point formulation (a) allows two different notions of splits, in terms of functions, or in terms of partial derivatives, (b) does need splits into convex-concave terms (as opposed to convex minimization), and (c) that non-uniform sampling is key to an efficient algorithm, both in theory and practice (see experiments in Section 7). – We show in Section 5 that these incremental algorithms can be easily accelerated using a simple extension of the “catalyst” framework of [7], thus leading to an algorithm which is always superior to accelerated batch algorithms. 2 Composite Decomposable Saddle-Point Problems We now present our new algorithms on saddle-point problems and show a natural extension to monotone operators later in Section 6. We thus consider the saddle-point problem defined in Eq. (1), with the following assumptions: (A) M is strongly (λ, γ)-convex-concave, that is, the function (x, y) 7→M(x, y) −λ 2 ∥x∥2 + γ 2 ∥y∥2 is convex-concave. Moreover, we assume that we may compute the proximal operator of M, i.e., for any (x′, y′) ∈Rn+d (σ is the step-length parameter associated with the prox operator): proxσ M(x′, y′) = arg min x∈Rd max y∈Rn σM(x, y) + λ 2 ∥x −x′∥2 −γ 2 ∥y −y′∥2. (2) The values of λ and γ lead to the definition of a weighted Euclidean norm on Rn+d defined as Ω(x, y)2 = λ∥x∥2 + γ∥y∥2, with dual norm defined through Ω∗(x, y)2 = λ−1∥x∥2 + γ−1∥y∥2. Dealing with the two different scaling factors λ and γ is crucial for good performance, as these may be very different, depending on the many arbitrary ways to set-up a saddle-point problem. (B) K is convex-concave and has Lipschitz-continuous gradients; it is natural to consider the gradient operator B : Rn+d →Rn+d defined as B(x, y) = (∂xK(x, y), −∂yK(x, y)) ∈Rn+d and to consider L = supΩ(x−x′,y−y′)=1 Ω∗(B(x, y) −B(x′, y′)). The quantity L represents the condition number of the problem. (C) The vector-valued function B(x, y) = (∂xK(x, y), −∂yK(x, y)) ∈Rn+d may be split into a family of vector-valued functions as B = P i∈I Bi, where the only constraint is that each Bi is Lipschitz-continuous (with constant Li). There is no need to assume the existence of a function Ki : Rn+d →R such that Bi = (∂xKi, −∂yKi). We will also consider splits which are adapted to the saddle-point nature of the problem, that is, of the form B(x, y) = P k∈K Bx k(x, y), P j∈J By j (x, y)  , which is a subcase of the above with I = J × K, Bjk(x, y) = (pjBx k(x, y), qkBy j (x, y)), for p and q sequences that sum to one. This substructure, which we refer to as “factored”, will only make a difference when storing the values of these operators in Section 4 for our SAGA algorithm. Given assumptions (A)-(B), the saddle-point problem in Eq. (1) has a unique solution (x∗, y∗) such that K(x∗, y)+M(x∗, y) ⩽K(x∗, y∗)+M(x∗, y∗) ⩽K(x, y∗)+M(x, y∗), for all (x, y); moreover minx∈Rd maxy∈Rn K(x, y) + M(x, y) = maxy∈Rn minx∈Rd K(x, y) + M(x, y) (see, e.g., [8, 4]). The main generic examples for the functions K(x, y) and M(x, y) are: – Bilinear saddle-point problems: K(x, y) = y⊤Kx for a matrix K ∈Rn×d (we identify here a matrix with the associated bilinear function), for which the vector-valued function B(x, y) is linear, i.e., B(x, y) = (K⊤y, −Kx). Then L = ∥K∥op/√γλ, where ∥K∥op is the largest singular value of K. There are two natural potential splits with I = {1, . . . , n} × {1, . . . , d}, with B = Pn j=1 Pd k=1 Bjk: (a) the split into individual elements Bjk(x, y) = Kjk(yj, −xk), where every element is the gradient operator of a bi-linear function, and (b) the “factored” split into rows/columns Bjk(x, y) = (qkyjK⊤ j·, −pjxkK·k), where Kj· and K·k are the j-th row and k-th column of K, p and q are any set of vectors summing to one, and every element is not the gradient operator of any function. These splits correspond to several “sketches” of the matrix K [9], adapted to subsampling of K, but other sketches could be considered. 2 – Separable functions: M(x, y) = f(x) −g(y) where f is any λ-strongly-convex and g is γstrongly convex, for which the proximal operators proxσ f(x′) = arg minx∈Rd σf(x)+ λ 2 ∥x−x′∥2 and proxσ g(y′) = arg maxy∈Rd −σg(y) −γ 2 ∥y −y′∥2 are easy to compute. In this situation, proxσ M(x′, y′) = (proxσ f(x′), proxσ g(y′)). Following the usual set-up of composite optimization [10], no smoothness assumption is made on M and hence on f or g. 2.1 Examples in machine learning Many learning problems are formulated as convex optimization problems, and hence by duality as saddle-point problems. We now give examples where our new algorithms are particularly adapted. Supervised learning with non-separable losses or regularizers. For regularized linear supervised learning, with n d-dimensional observations put in a design matrix K ∈Rn×d, the predictions are parameterized by a vector x ∈Rd and lead to a vector of predictions Kx ∈Rn. Given a loss function defined through its Fenchel conjugate g∗from Rn to R, and a regularizer f(x), we obtain exactly a bi-linear saddle-point problem. When the loss g∗or the regularizer f is separable, i.e., a sum of functions of individual variables, we may apply existing fast gradient-techniques [1, 2, 3] to the primal problem minx∈Rd g∗(Kx) + f(x) or the dual problem maxy∈Rn −g(y) −f ∗(K⊤y), as well as methods dedicated to separable saddle-point problems [11, 12]. When the loss g∗and the regularizer f are not separable (but have a simple proximal operator), our new fast algorithms are the only ones that can be applied from the class of large-scale linearly convergent algorithms. Non-separable losses may occur when (a) predicting by affine functions of the inputs and not penalizing the constant terms (in this case defining the loss functions as the minimum over the constant term, which becomes non-separable) or (b) using structured output prediction methods that lead to convex surrogates to the area under the ROC curve (AUC) or other precision/recall quantities [13, 14]. These come often with efficient proximal operators (see Section 7 for an example). Non-separable regularizers with available efficient proximal operators are numerous, such as groupednorms with potentially overlapping groups, norms based on submodular functions, or total variation (see [15] and references therein, and an example in Section 7). Robust optimization. The framework of robust optimization [16] aims at optimizing an objective function with uncertain data. Given that the aim is then to minimize the maximal value of the objective function given the uncertainty, this leads naturally to saddle-point problems. Convex relaxation of unsupervised learning. Unsupervised learning leads to convex relaxations which often exhibit structures naturally amenable to saddle-point problems, e.g, for discriminative clustering [17] or matrix factorization [18]. 2.2 Existing batch algorithms In this section, we review existing algorithms aimed at solving the composite saddle-point problem in Eq. (1), without using the sum-structure. Note that it is often possible to apply batch algorithms for the associated primal or dual problems (which are not separable in general). Forward-backward (FB) algorithm. The main iteration is (xt, yt) = proxσ M  (xt−1, yt−1) −σ 1/λ 0 0 1/γ  B(xt−1, yt−1)  = proxσ M xt−1 −σλ−1∂xK(xt−1, yt−1) + σγ−1∂yK(xt−1, yt−1)). The algorithm aims at simultaneously minimizing with respect to x while maximizing with respect to y (when M(x, y) is the sum of isotropic quadratic terms and indicator functions, we get simultaneous projected gradient descents). This algorithm is known not to converge in general [8], but is linearly convergent for strongly-convex-concave problems, when σ = 1/L2, with the rate (1 −1/(1 + L2))t [19] (see simple proof in Appendix B.1). This is the one we are going to adapt to stochastic variance reduction. When M(x, y) = f(x) −g(y), we obtain the two parallel updates xt = proxσ f xt−1 − λ−1σ∂xK(xt−1, yt−1  and yt = proxσ g yt−1 + γ−1σ∂yK(xt−1, yt−1  , which can de done serially by replacing the second one by yt = proxσ g yt−1 + γ−1σ∂yK(xt, yt−1  . This is often referred to as the Arrow-Hurwicz method (see [20] and references therein). 3 Accelerated forward-backward algorithm. The forward-backward algorithm may be accelerated by a simple extrapolation step, similar to Nesterov’s acceleration for convex minimization [21]. The algorithm from [20], which only applies to bilinear functions K, and which we extend from separable M to our more general set-up in Appendix B.2, has the following iteration: (xt, yt) = proxσ M  (xt−1, yt−1) −σ 1/λ 0 0 1/γ  B(xt−1 + θ(xt−1 −xt−2), yt−1 + θ(yt−1 −yt−2))  . With σ = 1/(2L) and θ = L/(L + 1), we get an improved convergence rate, where (1 − 1/(1 + L2))t is replaced by (1 −1/(1 + 2L))t. This is always a strong improvement when L is large (ill-conditioned problems), as illustrated in Section 7. Note that our acceleration technique in Section 5 may be extended to get a similar rate for the batch set-up for non-linear K. 2.3 Existing stochastic algorithms Forward-backward algorithms have been studied with added noise [22], leading to a convergence rate in O(1/t) after t iterations for strongly-convex-concave problems. In our setting, we replace B(x, y) in our algorithm with 1 πi Bi(x, y), where i ∈I is sampled from the probability vector (πi)i (good probability vectors will depend on the application, see below for bilinear problems). We have EBi(x, y) = B(x, y); the main iteration is then (xt, yt) = proxσt M  (xt−1, yt−1) −σt 1/λ 0 0 1/γ  1 πit Bit(xt−1, yt−1)  , with it selected independently at random in I with probability vector π. In Appendix C, we show that using σt = 2/(t + 1 + 8¯L(π)2) leads to a convergence rate in O(1/t), where ¯L(π) is a smoothness constant explicited below. For saddle-point problems, it leads to the complexities shown in Table 1. Like for convex minimization, it is fast early on but the performance levels off. Such schemes are typically used in sublinear algorithms [23]. 2.4 Sampling probabilities, convergence rates and running-time complexities In order to characterize running-times, we denote by T(A) the complexity of computing A(x, y) for any operator A and (x, y) ∈Rn+d, while we denote by Tprox(M) the complexity of computing proxσ M(x, y). In our motivating example of bilinear functions K(x, y), we assume that Tprox(M) takes times proportional to n + d and getting a single element of K is O(1). In order to characterize the convergence rate, we need the Lipschitz-constant L (which happens to be the condition number with our normalization) defined earlier as well as a smoothness constant adapted to our sampling schemes: ¯L(π)2 = sup(x,y,x′,y′) P i∈I 1 πi Ω∗(Bi(x, y) −Bi(x′, y′))2 such that Ω(x −x′, y −y′)2 ⩽1. We always have the bounds L2 ⩽¯L(π)2 ⩽maxi∈I L2 i × P i∈I 1 πi . However, in structured situations (like in bilinear saddle-point problems), we get much improved bounds, as described below. Bi-linear saddle-point. The constant L is equal to ∥K∥op/√λγ, and we will consider as well the Frobenius norm ∥K∥F defined through ∥K∥2 F = P j,k K2 jk, and the norm ∥K∥max defined as ∥K∥max = max{supj(KK⊤)1/2 jj , supk(K⊤K)1/2 kk }. Among the norms above, we always have: ∥K∥max ⩽∥K∥op ⩽∥K∥F ⩽ p max{n, d}∥K∥max ⩽ p max{n, d}∥K∥op, (3) which allows to show below that some algorithms have better bounds than others. There are several schemes to choose the probabilities πjk (individual splits) and πjk = pjqk (factored splits). For the factored formulation where we select random rows and columns, we consider the non-uniform schemes pj = (KK⊤)jj/∥K∥2 F and qk = (K⊤K)kk/∥K∥2 F , leading to ¯L(π) ⩽∥K∥F /√λγ, or uniform, leading to ¯L(π) ⩽ p max{n, d}∥K∥max/√λγ. For the individual formulation where we select random elements, we consider πjk = K2 jk/∥K∥2 F , leading to ¯L(π) ⩽ p max{n, d}∥K∥F /√λγ, or uniform, leading to ¯L(π) ⩽ √ nd∥K∥max/√λγ (in these situations, it is important to select several elements simultaneously, which our analysis supports). We characterize convergence with the quantity ε = Ω(x −x∗, y −y∗)2/Ω(x0 −x∗, y0 −y∗)2, where (x0, y0) is the initialization of our algorithms (typically (0, 0) for bilinear saddle-points). In Table 1 we give a summary of the complexity of all algorithms discussed in this paper: we recover the same type of speed-ups as for convex minimization. A few points are worth mentioning: 4 Algorithms Complexity Batch FB log(1/ε) × nd + nd∥K∥2 op/(λγ)  Batch FB-accelerated log(1/ε) × nd + nd∥K∥op/√λγ)  Stochastic FB-non-uniform (1/ε) × max{n, d}∥K∥2 F /(λγ)  Stochastic FB-uniform (1/ε) × nd∥K∥2 max/(λγ)  SAGA/SVRG-uniform log(1/ε) × nd + nd∥K∥2 max/(λγ)  SAGA/SVRG-non-uniform log(1/ε) × nd + max{n, d}∥K∥2 F /(λγ)  SVRG-non-uniform-accelerated log(1/ε) × nd + p nd max{n, d}∥K∥F /√λγ  Table 1: Summary of convergence results for the strongly (λ, γ)-convex-concave bilinear saddle-point problem with matrix K and individual splits (and n + d updates per iteration). For factored splits (little difference), see Appendix D.4. For accelerated SVRG, we omitted the logarithmic term (see Section 5). – Given the bounds between the various norms on K in Eq. (3), SAGA/SVRG with non-uniform sampling always has convergence bounds superior to SAGA/SVRG with uniform sampling, which is always superior to batch forward-backward. Note however, that in practice, SAGA/SVRG with uniform sampling may be inferior to accelerated batch method (see Section 7). – Accelerated SVRG with non-uniform sampling is the most efficient method, which is confirmed in our experiments. Note that if n = d, our bound is better than or equal to accelerated forwardbackward, in exactly the same way than for regular convex minimization. There is thus a formal advantage for variance reduction. 3 SVRG: Stochastic Variance Reduction for Saddle Points Following [2, 24], we consider a stochastic-variance reduced estimation of the finite sum B(x, y) = P i∈I Bi(x, y). This is achieved by assuming that we have an iterate (˜x, ˜y) with a known value of B(˜x, ˜y), and we consider the estimate of B(x, y): B(˜x, ˜y) + 1 πi Bi(x, y) −1 πi Bi(˜x, ˜y), which has the correct expectation when i is sampled from I with probability π, but with a reduced variance. Since we need to refresh (˜x, ˜y) regularly, the algorithm works in epochs (we allow to sample m elements per updates, i.e., a mini-batch of size m), with an algorithm that shares the same structure than SVRG for convex minimization; see Algorithm 1. Note that we provide an explicit number of iterations per epoch, proportional to (L2 + 3¯L2/m). We have the following theorem, shown in Appendix D.1 (see also a discussion of the proof in Section 6). Theorem 1 Assume (A)-(B)-(C). After v epochs of Algorithm 1, we have: E  Ω(xv −x∗, yv −y∗)2 ⩽(3/4)vΩ(x0 −x∗, y0 −y∗)2. The computational complexity to reach precision ε is proportional to  T(B) + (mL2 + ¯L2) maxi∈I T(Bi) + (1 + L2 + ¯L2/m)Tprox(M)  log 1 ε. Note that by taking the mini-batch size m large, we can alleviate the complexity of the proximal operator proxM if too large. Moreover, if L2 is too expensive to compute, we may replace it by ¯L2 but with a worse complexity bound. Bilinear saddle-point problems. When using a mini-batch size m = 1 with the factored updates, or m = n + d for the individual updates, we get the same complexities proportional to [nd + max{n, d}∥K∥2 F /(λγ)] log(1/ε) for non-uniform sampling, which improve significantly over (nonaccelerated) batch methods (see Table 1). 4 SAGA: Online Stochastic Variance Reduction for Saddle Points Following [3], we consider a stochastic-variance reduced estimation of B(x, y) = P i∈I Bi(x, y). This is achieved by assuming that we store values gi = Bi(xold(i), yold(i)) for an old iterate 5 Algorithm 1 SVRG: Stochastic Variance Reduction for Saddle Points Input: Functions (Ki)i, M, probabilities (πi)i, smoothness ¯L(π) and L, iterate (x, y) number of epochs v, number of updates per iteration (mini-batch size) m Set σ =  L2 + 3¯L2/m −1 for u = 1 to v do Initialize (˜x, ˜y) = (x, y) and compute B(˜x, ˜y) for k = 1 to log 4 × (L2 + 3¯L2/m) do Sample i1, . . . , im ∈I from the probability vector (πi)i with replacement (x, y) ←proxσ M  (x, y)−σ 1/λ 0 0 1/γ B(˜x, ˜y)+ 1 m Pm k=1  1 πik Bik(x, y)− 1 πik Bik(˜x, ˜y)  end for end for Output: Approximate solution (x, y) (xold(i), yold(i)), and we consider the estimate of B(x, y): P j∈I gj + 1 πi Bi(x, y) −1 πi gi, which has the correct expectation when i is sampled from I with probability π. At every iteration, we also refresh the operator values gi ∈Rn+d, for the same index i or with a new index i sampled uniformly at random. This leads to Algorithm 2, and we have the following theorem showing linear convergence, proved in Appendix D.2. Note that for bi-linear saddle-points, the initialization at (0, 0) has zero cost (which is not possible for convex minimization). Theorem 2 Assume (A)-(B)-(C). After t iterations of Algorithm 2 (with the option of resampling when using non-uniform sampling), we have: E  Ω(xt −x∗, yt −y∗)2 ⩽2 1 −(max{ 3|I| 2m , 1 + L2 µ2 + 3 ¯L2 mµ2 })−1t Ω(x0 −x∗, y0 −y∗)2. Resampling or re-using the same gradients. For the bound above to be valid for non-uniform sampling, like for convex minimization [25], we need to resample m operators after we make the iterate update. In our experiments, following [25], we considered a mixture of uniform and non-uniform sampling, without the resampling step. SAGA vs. SVRG. The difference between the two algorithms is the same as for convex minimization (see, e.g., [26] and references therein), that is SVRG has no storage, but works in epochs and requires slightly more accesses to the oracles, while SAGA is a pure online method with fewer parameters but requires some storage (for bi-linear saddle-point problems, we only need to store O(n+d) elements for the factored splits, while we need O(dn) for the individual splits). Overall they have the same running-time complexity for individual splits; for factored splits, see Appendix D.4. Factored splits. When using factored splits, we need to store the two parts of the operator values separately and update them independently, leading in Theorem 2 to replacing |I| by max{|J|, |K|}. 5 Acceleration Following the “catalyst” framework of [7], we consider a sequence of saddle-point problems with added regularization; namely, given (¯x, ¯y), we use SVRG to solve approximately min x∈Rd max y∈Rn K(x, y) + M(x, y) + λτ 2 ∥x −¯x∥2 −γτ 2 ∥y −¯y∥2, (4) for well-chosen τ and (¯x, ¯y). The main iteration of the algorithm differs from the original SVRG by the presence of the iterate (¯x, ¯y), which is updated regularly (after a precise number of epochs), and different step-sizes (see details in Appendix D.3). The complexity to get an approximate solution of Eq. (4) (forgetting the complexity of the proximal operator and for a single update), up to logarithmic terms, is proportional, to T(B) + ¯L2(1 + τ)−2 maxi∈I T(Bi). The key difference with the convex optimization set-up is that the analysis is simpler, without the need for Nesterov acceleration machinery [21] to define a good value of (¯x, ¯y); indeed, the solution of Eq. (4) is one iteration of the proximal-point algorithm, which is known to converge 6 Algorithm 2 SAGA: Online Stochastic Variance Reduction for Saddle Points Input: Functions (Ki)i, M, probabilities (πi)i, smoothness ¯L(π) and L, iterate (x, y) number of iterations t, number of updates per iteration (mini-batch size) m Set σ =  max{ 3|I| 2m −1, L2 + 3 ¯L2 m } −1 Initialize gi = Bi(x, y) for all i ∈I and G = P i∈I gi for u = 1 to t do Sample i1, . . . , im ∈I from the probability vector (πi)i with replacement Compute hk = Bik(x, y) for k ∈{1, . . . , m} (x, y) ←proxσ M  (x, y) −σ 1/λ 0 0 1/γ G + 1 m Pm k=1  1 πik hk − 1 πik gik  (optional) Sample i1, . . . , im ∈I uniformly with replacement (optional) Compute hk = Bik(x, y) for k ∈{1, . . . , m} Replace G ←G −Pm k=1{gik −hk} and gik ←hk for k ∈{1, . . . , m} end for Output: Approximate solution (x, y) linearly [27] with rate (1 + τ −1)−1 = (1 − 1 1+τ ). Thus the overall complexity is up to logarithmic terms equal to T(B)(1 + τ) + ¯L2(1 + τ)−1 maxi∈I T(Bi). The trade-off in τ is optimal for 1 + τ = ¯L p maxi∈I T(Bi)/T(B), showing that there is a potential acceleration when ¯L p maxi∈I T(Bi)/T(B) ⩾1, leading to a complexity ¯L p T(B) maxi∈I T(Bi). Since the SVRG algorithm already works in epochs, this leads to a simple modification where every log(1 + τ) epochs, we change the values of (¯x, ¯y). See Algorithm 3 in Appendix D.3. Moreover, we can adaptively update (¯x, ¯y) more aggressively to speed-up the algorithm. The following theorem gives the convergence rate of the method (see proof in Appendix D.3). With the value of τ defined above (corresponding to τ = max  0, ∥K∥F √λγ p max{n−1, d−1} −1 for bilinear problems), we get the complexity ¯L p T(B) maxi∈I T(Bi), up to the logarithmic term log(1 + τ). For bilinear problems, this provides a significant acceleration, as shown in Table 1. Theorem 3 Assume (A)-(B)-(C). After v epochs of Algorithm 3, we have, for any positive v: E  Ω(xv −x∗, yv −y∗)2 ⩽ 1 − 1 τ+1 v Ω(x0 −x∗, y0 −y∗)2. While we provide a proof only for SVRG, the same scheme should work for SAGA. Moreover, the same idea also applies to the batch setting (by simply considering |I| = 1, i.e., a single function), leading to an acceleration, but now valid for all functions K (not only bilinear). 6 Extension to Monotone Operators In this paper, we have chosen to focus on saddle-point problems because of their ubiquity in machine learning. However, it turns out that our algorithm and, more importantly, our analysis extend to all set-valued monotone operators [8, 28]. We thus consider a maximal strongly-monotone operator A on a Euclidean space E, as well as a finite family of Lipschitz-continuous (not necessarily monotone) operators Bi, i ∈I, with B = P i∈I Bi monotone. Our algorithm then finds the zeros of A + P i∈I Bi = A + B, from the knowledge of the resolvent (“backward”) operator (I + σA)−1 (for a well chosen σ > 0) and the forward operators Bi, i ∈I. Note the difference with [29], which requires each Bi to be monotone with a known resolvent and A to be monotone and single-valued. There several interesting examples (on which our algorithms apply): – Saddle-point problems: We assume for simplicity that λ = γ = µ (this can be achieved by a simple change of variable). If we denote B(x, y) = (∂xK(x, y), −∂yK(x, y)) and the multivalued operator A(x, y) = (∂xM(x, y), −∂yM(x, y)), then the proximal operator proxσ M may be written as (µI + σA)−1(µx, µy), and we recover exactly our framework from Section 2. – Convex minimization: A = ∂g and Bi = ∂fi for a strongly-convex function g and smooth functions fi: we recover proximal-SVRG [24] and SAGA [3], to minimize minz∈E g(z) + P i∈I fi(z). However, this is a situation where the operators Bi have an extra property called co-coercivity [6], 7 which we are not using because it is not satisfied for saddle-point problems. The extension of SAGA and SVRG to monotone operators was proposed earlier by [30], but only co-coercive operators are considered, and thus only convex minimization is considered (with important extensions beyond plain SAGA and SVRG), while our analysis covers a much broader set of problems. In particular, the step-sizes obtained with co-coercivity lead to divergence in the general setting. Because we do not use co-coercivity, applying our results directly to convex minimization, we would get slower rates, while, as shown in Section 2.1, they can be easily cast as a saddle-point problem if the proximal operators of the functions fi are known, and we then get the same rates than existing fast techniques which are dedicated to this problem [1, 2, 3]. – Variational inequality problems, which are notably common in game theory (see, e.g., [5]). 7 Experiments We consider binary classification problems with design matrix K and label vector in {−1, 1}n, a non-separable strongly-convex regularizer with an efficient proximal operator (the sum of the squared norm λ∥x∥2/2 and the clustering-inducing term P i̸=j |xi −xj|, for which the proximal operator may be computed in O(n log n) by isotonic regression [31]) and a non-separable smooth loss (a surrogate to the area under the ROC curve, defined as proportional to P i+∈I+ P i−∈I−(1−yi +yj)2, where I+/I−are sets with positive/negative labels, for a vector of prediction y, for which an efficient proximal operator may be computed as well, see Appendix E). Our upper-bounds depend on the ratio ∥K∥2 F /(λγ) where λ is the regularization strength and γ ≈n in our setting where we minimize an average risk. Setting λ = λ0 = ∥K∥2 F /n2 corresponds to a regularization proportional to the average squared radius of the data divided by 1/n which is standard in this setting [1]. We also experiment with smaller regularization (i.e., λ/λ0 = 10−1), to make the problem more ill-conditioned (it turns out that the corresponding testing losses are sometimes slightly better). We consider two datasets, sido (n = 10142, d = 4932, non-separable losses and regularizers presented above) and rcv1 (n = 20242, d = 47236, separable losses and regularizer described in Appendix F, so that we can compare with SAGA run in the primal). We report below the squared distance to optimizers which appears in our bounds, as a function of the number of passes on the data (for more details and experiments with primal-dual gaps and testing losses, see Appendix F). Unless otherwise specified, we always use non-uniform sampling. 0 100 200 300 400 500 10 −5 10 0 sido − distance to optimizers − λ/λ0=1.00 fb−acc fb−sto saga saga (unif) svrg svrg−acc fba−primal 0 100 200 300 400 500 10 −5 10 0 sido − distance to optimizers − λ/λ0=0.10 fb−acc fb−sto saga saga (unif) svrg svrg−acc fba−primal 0 100 200 300 400 500 10 −15 10 −10 10 −5 10 0 rcv1 − distance to optimizers − λ/λ0=1.00 fb−acc fb−sto saga saga (unif) svrg svrg−acc fba−primal saga−primal We see that uniform sampling for SAGA does not improve on batch methods, SAGA and accelerated SVRG (with non-uniform sampling) improve significantly over the existing methods, with a stronger gain for the accelerated version for ill-conditioned problems (middle vs. left plot). On the right plot, we compare to primal methods on a separable loss, showing that primal methods (here “fba-primal”, which is Nesterov acceleration) that do not use separability (and can thus be applied in all cases) are inferior, while SAGA run on the primal remains faster (but cannot be applied for non-separable losses). 8 Conclusion We proposed the first linearly convergent incremental gradient algorithms for saddle-point problems, which improve both in theory and practice over existing batch or stochastic algorithms. While we currently need to know the strong convexity-concavity constants, we plan to explore in future work adaptivity to these constants like already obtained for convex minimization [3], paving the way to an analysis without strong convexity-concavity. 8 References [1] N. Le Roux, M. Schmidt, and F. Bach. A stochastic gradient method with an exponential convergence rate for finite training sets. In Adv. NIPS, 2012. [2] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Adv. NIPS, 2013. [3] A. Defazio, F. Bach, and S. Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In Adv. NIPS, 2014. [4] R. T. Rockafellar. Monotone operators associated with saddle-functions and minimax problems. Nonlinear Functional Analysis, 18(part 1):397–407, 1970. [5] P. T. Harker and J.-S. Pang. Finite-dimensional variational inequality and nonlinear complementarity problems: a survey of theory, algorithms and applications. Math. Prog., 48(1-3):161–220, 1990. [6] D. L. Zhu and P. Marcotte. Co-coercivity and its role in the convergence of iterative schemes for solving variational inequalities. SIAM Journal on Optimization, 6(3):714–726, 1996. [7] H. Lin, J. Mairal, and Z. Harchaoui. A universal catalyst for first-order optimization. In Adv. NIPS, 2015. [8] H. H. Bauschke and P. L. Combettes. Convex Analysis and Monotone Operator Theory in Hilbert Spaces. Springer Science & Business Media, 2011. [9] D. Woodruff. Sketching as a tool for numerical linear algebra. Technical Report 1411.4357, arXiv, 2014. [10] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009. [11] X. Zhu and A. J. Storkey. Adaptive stochastic primal-dual coordinate descent for separable saddle point problems. In Machine Learning and Knowledge Discovery in Databases, pages 645–658. Springer, 2015. [12] Y. Zhang and L. Xiao. Stochastic primal-dual coordinate method for regularized empirical risk minimization. In Proc. ICML, 2015. [13] T. Joachims. A support vector method for multivariate performance measures. In Proc. ICML, 2005. [14] R. Herbrich, T. Graepel, and K. Obermayer. Large margin rank boundaries for ordinal regression. In Adv. NIPS, 1999. [15] F. Bach, R. Jenatton, J. Mairal, and G. Obozinski. Optimization with sparsity-inducing penalties. Foundations and Trends in Machine Learning, 4(1):1–106, 2012. [16] A. Ben-Tal, L. El Ghaoui, and A. Nemirovski. Robust Optimization. Princeton University Press, 2009. [17] L. Xu, J. Neufeld, B. Larson, and D. Schuurmans. Maximum margin clustering. In Adv. NIPS, 2004. [18] F. Bach, J. Mairal, and J. Ponce. Convex sparse matrix factorizations. Technical Report 0812.1869, arXiv, 2008. [19] G. H. G. Chen and R. T. Rockafellar. Convergence rates in forward-backward splitting. SIAM Journal on Optimization, 7(2):421–444, 1997. [20] A. Chambolle and T. Pock. A first-order primal-dual algorithm for convex problems with applications to imaging. Journal of Mathematical Imaging and Vision, 40(1):120–145, 2011. [21] Y. Nesterov. Introductory Lectures on Convex Optimization. Kluwer, 2004. [22] L. Rosasco, S. Villa, and B. C. V˜u. A stochastic forward-backward splitting method for solving monotone inclusions in hilbert spaces. Technical Report 1403.7999, arXiv, 2014. [23] K. L. Clarkson, E. Hazan, and D. P. Woodruff. Sublinear optimization for machine learning. Journal of the ACM (JACM), 59(5):23, 2012. [24] L. Xiao and T. Zhang. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. [25] M. Schmidt, R. Babanezhad, M.O. Ahmed, A. Defazio, A. Clifton, and A. Sarkar. Non-uniform stochastic average gradient method for training conditional random fields. In Proc. AISTATS, 2015. [26] R. Harikandeh, M. O. Ahmed, A. Virani, M. Schmidt, J. Koneˇcn`y, and S. Sallinen. Stop wasting my gradients: Practical SVRG. In Adv. NIPS, 2015. [27] R. T. Rockafellar. Monotone operators and the proximal point algorithm. SIAM Journal on Control and Optimization, 14(5):877–898, 1976. [28] E. Ryu and S. Boyd. A primer on monotone operator methods. Appl. Comput. Math., 15(1):3–43, 2016. [29] H. Raguet, J. Fadili, and G. Peyré. A generalized forward-backward splitting. SIAM Journal on Imaging Sciences, 6(3):1199–1226, 2013. [30] D. Davis. Smart: The stochastic monotone aggregated root-finding algorithm. Technical Report 1601.00698, arXiv, 2016. [31] X. Zeng and M. Figueiredo. Solving OSCAR regularization problems by fast approximate proximal splitting algorithms. Digital Signal Processing, 31:124–135, 2014. 9
2016
68
6,528
A Probabilistic Model of Social Decision Making based on Reward Maximization Koosha Khalvati Department of Computer Science University of Washington Seattle, WA 98105 koosha@cs.washington.edu Seongmin A. Park CNRS UMR 5229 Institut des Sciences Cognitives Marc Jeannerod Lyon, France park@isc.cnrs.fr Jean-Claude Dreher CNRS UMR 5229 Institut des Sciences Cognitives Marc Jeannerod Lyon, France dreher@isc.cnrs.fr Rajesh P. N. Rao Department of Computer Science University of Washington Seattle, WA 98195 rao@cs.washington.edu Abstract A fundamental problem in cognitive neuroscience is how humans make decisions, act, and behave in relation to other humans. Here we adopt the hypothesis that when we are in an interactive social setting, our brains perform Bayesian inference of the intentions and cooperativeness of others using probabilistic representations. We employ the framework of partially observable Markov decision processes (POMDPs) to model human decision making in a social context, focusing specifically on the volunteer’s dilemma in a version of the classic Public Goods Game. We show that the POMDP model explains both the behavior of subjects as well as neural activity recorded using fMRI during the game. The decisions of subjects can be modeled across all trials using two interpretable parameters. Furthermore, the expected reward predicted by the model for each subject was correlated with the activation of brain areas related to reward expectation in social interactions. Our results suggest a probabilistic basis for human social decision making within the framework of expected reward maximization. 1 Introduction A long tradition of research in social psychology recognizes volunteering as the hallmark of human altruistic action, aimed at improving the survival of a group of individuals living together [15]. Volunteering entails a dilemma wherein the optimal decision maximizing an individual’s utility differs from the strategy which maximizes benefits to the group to which the individual belongs. The "volunteer’s dilemma" characterizes everyday group decision-making whereby one or few volunteers are enough to bring common goods to the group [1, 6]. Examples of such volunteering include vigilance duty, serving on school boards or town councils, and donating blood. The fact that makes the volunteer’s dilemma challenging is not only that a lack of enough volunteers would lead to no common goods being produced, but also that resources would be wasted if more than the required number of group members volunteer. As a result, to achieve maximum utility in the volunteer’s dilemma, each member must have a very good sense of others’ intentions in the absence of any This work was supported by LABEX ANR-11-LABEX-0042, ANR-11-IDEX-0007, NSF-ANR ’Social_POMDP’ and ANR BrainCHOICE n◦14-CE13-0006 to JC. D, NSF grants EEC-1028725 and 1318733, ONR grant N000141310817, and CRCNS/NIMH grant 1R01MH112166-01. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Figure 1: The computer screen that players see during one round of PGG. communication between them, before choosing their actions. To model such social decision making, one therefore needs a framework that can model the uncertainty associated with the "theory of mind" of each player. In this paper, we tackle this problem by combining a probabilistic model with behavioral measures and fMRI recordings to provide an account of the decisions made under the volunteer’s dilemma and the underlying neural computations. The Public Goods Game (PGG) is a classic paradigm in behavioral economics. It has previously been employed as a useful tool to study the neural mechanisms underlying group cooperation [2, 3, 4, 16]. Here we recast the PGG to investigate the volunteer’s dilemma and conducted an experiment where 30 subjects played a version of the PGG while their brain activity was simultaneously recorded using fMRI. We show how a probabilistic model based on Partially Observable Markov Decision Processes (POMDPs) with a simple and intuitive state model can explain our subjects’ behavior. The normative model explains the behavior of the subjects in all trials of the game, including the first trial of each round, using only two parameters. The validity of the model is demonstrated by the correlation between the reward predicted by the model and activation of brain areas implicated in reward expectation in social interactions. Also, the values of the parameters of our model are interpretable, and the differences among players and games can be explained by these parameters. 2 Public Goods Game and Experimental Paradigm In a Public Goods Game (PGG), N strangers make collective decisions together as a group. In the current study, we keep the number of members in a group constant at N = 5. No communication among members is allowed. The game is composed of 15 rounds of interactions with the same partners. At the beginning of each round, 1 monetary unit (MU) is endowed (E) to each of N = 5 individuals. Each individual can choose between two decisions, contribution (c) or free-riding (f). When the participant makes a decision, the selected option is highlighted on the screen. The participant must make a decision within three seconds, otherwise a warning message appears and the trial is repeated. After all members of the group have made their decisions, the feedback screen is shown to all. According to the decisions of group members, public good is produced as the group reward (R = 2MU) only if at least k individuals have contributed their resources (k = 2 or k = 4). Value of k was conveyed to group members before decision-making and is kept fixed for any single PGG. From the feedback screen, participants only know the number of other contributors and not individual single member decisions, which are represented by white icons. A yellow icon stands for the individual playing in the scanner and served to track their decisions. Each PGG consists of a finite round of interactions (T = 15). This is informed to all participants. The computer screen in front of each player during one round of a PGG is shown in Figure 1. Each contribution has a cost (C = 1MU). Therefore, the resultant MUs after one round is E −C + R = 2MU for the contributor and E + R = 3MU for the free-rider when public good is produced (SUCCESS). On the other hand, the contributor has E −C = 0MU and the free-rider has E = 1MU when no public good is produced (FAILURE) . Each participant plays 14 games. During the first 2 PGGs, they receive no feedback, but the following 12 PGGs provide social and monetary feedback as shown in Figure 1. Our analyses are from the 12 PGGs with feedback. Importantly, we inform participants before the experiment that they get a final monetary reward as much as the result of one PGG randomly selected by the compute r at the end of the study [23]. 2 We recruited 30 right-handed subjects to participate in the Public Goods Game and make decisions in an fMRI scanner. Data from 29 participants (fourteen women, mean age 22.97 years old 1.99 S.D.) were analyzed (one participant aborted the experiment due to anxiety). Based on self-reported questionnaires, none of our subjects had a history of neurological or psychiatric disorders. Each participant was told that they would play with 19 other participants located in another room; in actuality, a computer selected the actions instead of 19 others. Each action selected by our computer algorithm in any round is a probabilistic function of the participant’s action in the previous round (at−1 i ), and its own previous actions (P j∈−i at−1 j ). Given the average contribution rate of others ¯at −i = P j∈−i at j N−1 we have logit(¯at −i) = e0at−1 i + e1(( 1−KT −t+1 1−K )e2¯at−1 −i −K) where K = k/N. This model has 3 free parameters: e0, e1, e2. These are obtained by fitting the above function to the actual behavior of individuals in another PGG study [16]. Therefore, this function is a simulation of real individuals’ behavior in a PGG. For the first round, we use the mean contribution rate of each subject as their fellow members’ decision. 3 Markov Decision Processes and POMDPs The family of Markov Decision Processes (MDPs and POMDPs) provide a mathematical framework for decision making in stochastic environments [22]. A Markov Decision Process (MDP) is formally a tuple (S, A, T, R, γ) with the following description: S is the set of states of the environment, A is the set of actions, T is the transition function P(s|s′, a), i.e., the probability of going from a state s′ to state s after performing action a. R : S × A →R is a bounded function determining the reward obtained after performing action a in state s. γ is the discount factor which we assume here is 1. Starting from an initial state s0, the goal is to find the sequence of actions to maximize expected discounted reward Est[P∞ t=0 γtR(st, at)]. This sequence of actions is given by an optimal policy, which is a mapping from states to actions: π∗: |S| →|A| representing the best action at a given state. The optimal policy can be computed by an efficient algorithm called value iteration [22]. MDPs assume that the current state is always fully observable to the agent. When this is not the case, a more general framework, known as Partially Observable Decision Processes (POMDPs), can be used. In a POMDP, the agent reasons about the current state based on an observation. Therefore, POMDP can be regarded as an MDP with observations, Z and an observation function O : Z × A × S →[0, 1], which determines P(z|a, s), the probability of observing z after performing action a in state s. In a POMDP, instead of knowing the current state, st, the agent computes the belief state, bt, which is the posterior probability over states given all past observations and actions. The belief state can be updated as: bt+1(s) ∝O(s, at, zt+1) P s′ T(s′, s, at)bt(s′). Consequently, the optimal policy of a POMDP is a mapping from belief state to actions: π∗: B →A where B = [0, 1]|S|. One could easily see that a POMDP is an MDP whose states are belief states. As the belief state space is exponentially larger than the original state space (B = [0, 1]|S|), solving POMDPs is computationally very expensive (NP-hard [19]). Therefore, heuristic methods are used to approximate the optimal policy for a POMDP [11, 20]. In the case that the belief state can be expressed in closed form, e.g., Gaussian, one can solve the POMDP by considering it as an MDP whose state space is the POMDP’s belief state space and performing the value iteration algorithm. We use this technique in our model. 4 Model of the Game In a PGG with N players and known minimum number of required volunteers (k), the reward of a player, say player i, in each round is determined only by their action (free ride (f) or contribution (c)), and the total number of contributors among other players. We use the notation −i to represent all players except player i. We denote the action of each player as a and the reward of each player as r. The occurrence of an event is given by an indicator function I (for event x, I(x) is equal to 1 if event x happens and 0 otherwise). Then, the reward expected by player i at round t is: ri t = E  E −I(ai t = c) · C + I   N X j=1 I(aj t = c) ≥k  · R   = E  E −I(ai t = c) · C + I  I(ai t = c) + X j∈−i I(aj t = c) ≥k  · R   (1) 3 This means that in order to choose the best action at step t (ai t), player i should estimate the probability of P j∈−i I(aj t = c). Now if each player is a contributor with probability θc, the probability of this sum would be a binomial distribution: P( X j∈−i I(aj t = c) = k′) = N −1 k′  θk′ c (1 −θc)N−1−k′ (2) We could model the whole group with one parameter, because players only get the total number of contributions made by others and not individual contributions. Individuals cannot be tracked by others, and all group members can be seen together as one group. In other words, θc could be interpreted as cooperativeness of the group on average. With θc, the reward that player i expects at time step t is: ri t = E −I(ai t = c) · C + I(ai t = c). N−1 X k′=k−1 N −1 k′  θk′ c (1 −θc)N−1−k′ ! · R + I(ai t = f). N−1 X k′=k N −1 k′  θk′ c (1 −θc)N−1−k′ ! · R (3) This is only for one round. The game however, contains multiple rounds (15 here) and the goal is to maximize the total expected reward, not the reward of a specific round. In addition, θc changes after each round because players see others’ actions and update the probability of cooperativeness in the group. For example, if a player sees that others are not contributing, they may reduce θc when picking an action in the next round. Also, since our subjects think they are playing with other humans, they may assume others make these updates too. As a result, each player thinks their own action will change θc as well. In fact, although they are playing with computers, our algorithm does depend on their actions and their assumption is thus, correct. In addition, because subjects think they have a correct model of the group, they assume all group members have the same θc as them. If we define each possible value of θc as a discrete state (this set is infinite, but we could discretize the space, e.g., 100 values from 0 to 1) and model the change in θc with a transition function, our problem of maximizing total expected reward becomes equivalent to an MDP. Unfortunately, the subject does not know θc and therefore must maintain a probability distribution (belief state) over θc denoting belief about the average cooperativeness of the group. The model therefore becomes a POMDP. The beta distribution is a conjugate prior for the binomial distribution, meaning that when the prior distribution is a beta distribution and the likelihood function is a binomial distribution, the posterior will also be a beta distribution. Therefore, in our model, the subject starts with a beta distribution as their initial belief, and updates their belief over the course of the game using the transition and observation functions which are both binomial, implying that their belief always remains a beta distribution. The beta distribution contains two parameters, α and β. Using maximum likelihood estimation (MLE), the posterior distribution after seeing k′ true events from total of N events with prior Beta(α, β) is Beta(α + k′, β + N −k′): Prior : Beta(α, β) →P(θ) = θα−1(1 −θ)β−1 B(α, β) (4) Posterior : Beta(α + k′, β(t) + N −k′) →P(θ) = θα+k′−1(1 −θ)β+N−k′−1 B(α + k′, β + N −k′) (5) where B(α, β) is the normalizing constant: B(α, β) = R 1 0 θα−1(1 −θ)β−1dθ. As mentioned before, each POMDP is an MDP whose state space is the belief state of the original POMDP. As our belief state has a closed form, we can estimate the solution of our POMDP by discretizing this belief space, e.g., considering a bounded set of integers for α and β, and solving it as an MDP. Also, the transition function of this MDP would be based on the maximum likelihood estimate shown above. This transition function is as follows: P((α + k′ + 1, β + N −1 −k′)|(α, β), c) = N −1 k′ B(α + k′, β + N −1 −k′) B(α, β) P((α + k′, β + N −k′)|(α, β), f) = N −1 k′ B(α + k′, β + N −1 −k′) B(α, β) (6) 4 The pair (α, β) is the state and represents the belief of the player about θc, given by Beta(α, β). The reward function of this belief-based MDP is: R((α, β), c) = E −C + N X k′=k−1 N −1 k′ B(α + k′, β + N −1 −k′) B(α, β) R R((α, β), f) = E + N X k′=k N −1 k′ B(α + k′, β + N −1 −k′) B(α, β) R (7) This MDP shows how the subject plays and learns their group dynamics simultaneously by updating their belief about the group during the course of the game. Note that although we are reducing the problem to an MDP for computational efficiency, conceptually the player is being modeled by a POMDP because the player maintains a belief about the environment and updates it based on observations (here, other players’ actions). 5 Results The parameters of our model are all known, so the question is how the model differs for different individuals. The difference is in the initial belief of the player about the group that they are playing within, in other words, the state that our belief-based MDP starts from (b0 in POMDP parlance). This means that each individual has a pair α0 and β0 for each k that shapes their behavior through the game. For example, an α0 significantly larger than β0 means that the player starts the game with the belief that the group is cooperative. Also, α0 and β0 for the same individual differs for different k’s since the number of required volunteers changes the game and consequently the belief of the player about the optimal strategy. We investigate these differences in our analysis below. 5.1 Modeling behavioral data To find α0 and β0 of each player (and for each k), we run our model with different values of α0 and β0, and using the actions that the player sees as other players’ actions during the experiment, we check if the actions predicted by our model is the same as the actual actions of the player. In other words we find the α0 and β0 that minimize P15 t=1 |ai t −˜ai t| where ai t is the action of our subject at step t, and ˜ai t is the predicted action from our model. Note that we only give the model other players’ data and do not correct the predicted action for the previous state if the model has made a mistake. Also, we calculate the error on all games of that player with the same k, i.e., we assume each game is an independent data point. This is justified because subjects are explicitly told that at each game they could play with different players and also, they get reward for only one game chosen randomly. As a result one cannot use one game for training for the next ones. For each player, we call the average of P15 t=1 |ai t −˜ai t| among all of their games with the same k, round by round error. The average round by round error among all players for the POMDP was 3.38 for k = 2 and 2.15 for k = 4 (Table 1). For example, only around 2 out of 15 rounds were predicted incorrectly by our model for k = 4. The possible α0 and β0 values for each player ranged over all integers between 1 and 100, yielding 1002 pairs to evaluate as s0 for the belief-based MDP; this evaluation process was computationally efficient. We found that MDPs with horizons longer than the true number of rounds fit our data better. As a result, we set our horizon to a number much larger than 15, in this case, 50. Such an error in estimating the dynamics of a game in humans is consistent with previous reports [3]. To compare our results with other state-of-the-art methods, we fit a previously proposed descriptive model [24] to our data. This model assumes that the action of the player in each round is a function of their action in the previous round (the "Previous Action" model). Therefore, to fit the data we need to estimate p(ai t|ai t−1). This means that the model has two parameters, i.e. p(ai t = c|ai t−1 = c) and p(ai t = c|ai t−1 = f). Note that this descriptive model is unable to predict the first action. We found that its average round by round error for the last 14 rounds (3.90 for k = 2 and 3.25 for k = 4) is more than the POMDP model’s error (Table 1), even though it considers one round less than the POMDP model. We also used Leave One Out Cross Validation (LOOCV) to compare the models (see Table 1). Although the LOOCV error for k = 2 is larger for the POMDP model, the POMDP model’s error 5 Table 1: Average round by round error by POMDP, the descriptive model based on previous action, p(ai t|ai t−1), and the most general descriptive mode, p(ai t|ai t−1, P j∈−i aj t−1) . In front of each error, the normalized error (divided by number of rounds) is written in parenthesis to facilitate comparison. model Fitting error Fitting error LOOCV error LOOCV error Total number (k = 2) (k = 4) (k = 2) (k = 4) of rounds POMDP 3.38 (0.22) 2.15 (0.14) 4.23 (0.28) 2.67 (0.18) 15 Previous Action 3.90 (0.28) 3.25 (0.23) 4.00 (0.29) 3.48 (0.25) 14 All Actions 3.75 (0.27) 2.74 (0.19) 5.52 (0.39) 7.33 (0.52) 14 is for 15 rounds while the error for the descriptive model is for 14 (note that the error divided by number of rounds is larger for the descriptive model). In addition, to examine if another descriptive model based on previous rounds can outperform the POMDP model, we tested a model based on all previous actions, i.e. p(ai t|ai t−1, P j∈−i aj t−1). The POMDP model outperforms this model as well. 5.2 Comparing model predictions to neural data Besides modeling human behavior better than the descriptive models, the POMDP model can also predict the amount of reward the subject is expecting since it is formulated based on reward maximization. We use the parameters obtained by the behavioral fit and generate the expected reward for each subject before playing the next round. To validate these predictions about reward expectation, we checked if there is any correlation between neural activity recorded by fMRI and the model’s predictions. Image preprocessing was performed using the SPM8 software package. The time-series of images were registered in three-dimensional space to minimize any effects from the participant’s head motion. Functional scans were realigned to the last volume, corrected for slice timing, co-registered with structural maps, spatially normalized into the standard Montreal Neurological Institute (MNI) atlas space, and then spatially smoothed with an 8mm isotropic full-width-at-half-maximum (FWHM) Gaussian kernel using standard procedures in SPM8. Specifically, we construct a general linear model (GLM) and run a first-level analysis modeling brain responses related to outcome while informing the judgments of others. They are modeled as a box-car function time-locked to the onset of outcome with the duration of 4 sec. Brain responses related to decision-making with knowledge of the outcome of the previous trial are modeled separately. These are modeled as a box-car function time-locked to the onset of decision-making with duration of reaction times in each trial. They are further modulated by parametric regressors accounting for the expected reward. In addition, the six types of motion parameters produced for head movement, and the two motor parameters produced for buttons pressing with the right and the left hands are also entered as additional regressors of no interest to account for motion-related artifacts. All these regressors are convolved with the canonical hemodynamic response function. Contrast images are calculated and entered into a second-level group analysis. In the GLM, brain regions whose blood-oxygen-level-dependent (BOLD) response are correlated with POMDP-model-based estimates of expected reward are first identified. To correct for multiple comparisons, small volume correction (SVC) is applied to a priori anatomically defined regions of interests (ROI). The search volume is defined by a 10mm diameter spherical ROI centered on the dorsolateral prefrontal cortex (dlPFC) and the ventral striatum (vS) that have been identified in previous studies. The role of the dlPFC has been demonstrated in the control of strategic decision-making [14], and its function and gray matter volume have been implicated in individual differences in social value computation [7, 21]. Moreover, vS has been found to mediate rewards signal engaged in mutual contribution, altruism, and social approval [18]. In particular, the left vS has been found to be associated with both social and monetary reward prediction error [13]. We find a strong correlation between our model’s prediction of expected reward and activity in bilateral dlPFC (the peak voxel in the right dlPFC: (x, y, z) = (42, 47, 19), T = 3.45, and the peak voxel in the left dlPFC: (x, y, z) = (−30, 50, 25), T = 3.17) [7], and left vS (the peak voxel in the vS: (x, y, z) = (−24, 17, −2), T = 2.98) [13](Figure 2). No other brain area was found to have a higher activation than them at the relatively liberal threshold, uncorrected p < 0.005. Large activations were found in these regions when participants received the outcome of a trial (p < 0.05, FWE corrected within small-volume clusters). This is because after seeing the outcome of one round, they update their belief and consequently their expected reward for the next round. 6 Figure 2: Strong correlation between brain activity in the dlPFC and the left vS after seeing the outcome of a round and the predicted expected reward for the next round by our model. The activations were reported with a significance of p < 0.05, FWE across participants corrected in a priori region of interest. The activation maps are acquired at the threshold, p < 0.005 (uncorrected). The color in each cluster indicates the level of z-score activation in each voxel. 5.3 Modeling subjects’ perception of group cooperativeness The ratio and the sum of the best fitting α0 and β0 that we obtain from the model are interpretable within the context of cognitive science. In the Beta-binomial distribution update equations 4 and 5, α is related to the occurrence of the action "contribution" and β to "free-riding." Therefore, the ratio of α0 to β0 captures the player’s prior belief about the cooperativeness of the group. On the other hand, after every binomial observation (here round), N (here N = 5) is added to the prior. Therefore, the absolute values of α and β determine the weight that the player gives to the prior compared to their observations during the game. For example, adding 5 does not change Beta(100, 100) much but changes Beta(2, 2) to Beta(7, 2); the former does not alter the chance of contribution versus free riding much while the latter indicates that the group is cooperative. We estimated the best initial parameters for each player, but is there a unique pair of α0 and β0 values that minimizes the round by round error or are there multiple values for the best fit? We investigated this question by examining the error for all possible parameter values for all players in our experiments. The error, as a function of α0 and β0, for one of the players is shown in Figure 3a as a heat map (darker means smaller error, i.e. better fit). We found that the error function is continuous and although there exist multiple best-fitting parameter values, these values define a set of lines α = aβ + c with bounds min ≤α ≤max. The lines and bounds are linked to the ratio and prior weight alluded to above, suggesting that players do consider prior probability and the weight, and best-fitting α0 and β0 values have similar characteristics. We also calculated the average error function over all players for both values of k. As shown in figures 3b and 3c, α0 is larger than β0 for k = 2, while for k = 4, they are close to each other. Also, the absolute value of these parameters are larger for k = 2. This implies that when k = 4, players start out with more caution to ascertain whether the group is cooperative or not. For k = 2 however, because only 2 volunteers are enough, they start by giving cooperativeness a higher probability. Higher absolute value for k = 2 is indicative of the fact that the game tends towards mostly free riders for k = 2 and the prior is weighted much more than observations. Players know only 2 volunteers are enough and they can free-ride more frequently but still get the public good.1 6 Related Work PGG has previously been analyzed using descriptive models, assuming that only the actions of players in the previous trial affect decisions in the current trial [8, 24, 25]. As a result, the first trial of each round cannot be predicted by these models. Moreover, these models only predicts with what probability each player changes their action. The POMDP model, in contrast, takes all trials of each 1We should emphasize that this is the behavior on average and a few subjects do deviate from this behavior. 7 (a) One player (b) k = 2 (c) k = 4 Figure 3: Round by round error based on different initial parameters α0 and β0. Darker means lower error. (a) Error function for one of the players. The function for other players and other ks has the same linear pattern in terms of continuity but the location of the low error line is different among individuals and ks. (b) Average error function over all players for k = 2. (c) Average error function for k = 4. round into account and predicts actions based on prior belief of the player about the cooperativeness of the group, within the context of maximizing expected reward. Most importantly, the POMDP model predicts not only actions, but also the expected reward for the next round for each player as demonstrated in our results above. POMDPs have previously been used in perceptual decision making [12, 17] and value-based decision making [5]. The modeled tasks, however, are all single player tasks. A model based on iPOMCPs, an interactive framework based on POMDPs ([9]) with Monte Carlo sampling, has been used to model a trust game [10] involving two players. The PGG task we consider involves a larger group of players (5 in our experiments). Also, the iPOMCP algorithm is complicated and its neural implementation remains unclear. By comparison, our POMDP model is relatively simple and only uses two parameters to represent the belief state. 7 Discussion This paper presents a probabilistic model of social decision making that not only explains human behavior in volunteer’s dilemma but also predicts the expected reward in each round of the game. This prediction was validated using neural data recorded from an fMRI scanner. Unlike other existing models for this task, our model is based on the principle of reward maximization and Bayesian inference, and does not rely on a subject’s actions directly. In other words, our model is normative. In addition, as we discussed above, the model parameters that we fit to an individual or k are interpretable. One may argue that our model ignores empathy among group members since it assumes that the players attempt to maximize their own reward. First, an extensive study with auxiliary tasks has shown that pro-social preferences such as empathy do not explain human behaviour in the public goods games [3]. Second, one’s own reward is not easily separable from others’ rewards as maximizing expected reward requires cooperation among group members. Third, a major advantage of a normative model is the fact that different hypotheses can be tested by varying the components of the model. Here we presented the most general model to avoid over-fitting. Testing different reward functions could be a fruitful direction of future research. Although we have not demonstrated that our model can be neurally implemented in the brain, the model does capture the fundamental components of social decision making required to solve tasks such as the volunteer’s dilemma, namely, belief about others (belief state in our model), updating of belief with new observations, knowing that other group members will update their beliefs as well (modeled via transition function), prior belief about people playing the game (ratio of α0 to β0), weight of the prior in comparison to observations (absolute value of initial parameters), and maximizing total expected reward (modeled via reward function in MDP/POMDP). Some of these components may be simplified or combined in a neural implementation but we believe acknowledging them explicitly in our models will help pave the way for a deeper understanding of the neural mechanisms underlying human social interactions. 8 References [1] M. Archetti. A strategy to increase cooperation in the volunteer’s dilemma: Reducing vigilance improves alarm calls. Evolution, 65(3):885–892, 2011. [2] N. Bault, B. Pelloux, J. J. Fahrenfort, K. R. Ridderinkhof, and F. van Winden. Neural dynamics of social tie formation in economic decision-making. Social Cognitive and Affective Neuroscience, 10(6):877–884, 2015. [3] M. N. Burton-Chellew and S. A. West. Prosocial preferences do not explain human cooperation in public-goods games. Proceedings of the National Academy of Sciences, 110(1):216–221, 2013. [4] D. Chung, K. Yun, and J. Jeong. Decoding covert motivations of free riding and cooperation from multi-feature pattern analysis of signals. Social Cognitive and Affective Neuroscience, 10(9):1210–1218, 2015. [5] P. Dayan and N. D. Daw. Decision theory, reinforcement learning, and the brain. Cognitive, Affective, & Behavioral Neuroscience, 8(4):429–453, 2008. [6] D. Diekmann. Cooperation in an asymmetric volunteer’s dilemma game: theory and experimental evidence. International Journal of Game Theory, 22(1):75–85, 1993. [7] A. S. R. Fermin, M. Sakagami, T. Kiyonari, Y. Li, Y. Matsumoto, and T. Yamagishi. Representation of economic preferences in the structure and function of the amygdala and prefrontal cortex. Scientific reports, 6, 2016. [8] U. Fischbacher, S. Gatcher, and E. Fehr. Are people conditionally cooperative? Evidence from a public goods experiment. Economics Letters, 71(3):397 – 404, 2001. [9] P. J. Gmytrasiewicz and P. Doshi. A framework for sequential planning in multi-agent settings. Journal of Artificial Intelligence Research, 24:49–79, 2005. [10] A. Hula, P. R. Montague, and P. Dayan. Monte carlo planning method estimates planning horizons during interactive social exchange. PLoS Computational Biology, 11(6):e1004254, 2015. [11] K. Khalvati and A. K. Mackworth. A fast pairwise heuristic for planning under uncertainty. In Proceedings of The Twenty-Seventh AAAI Conference on Artificial Intelligence, pages 187–193, 2013. [12] K. Khalvati and R. P. N. Rao. A Bayesian framework for modeling confidence in perceptual decision making. In Advances in Neural Information Processing Systems (NIPS) 28, pages 2413–2421. 2015. [13] A. Lin, R. Adolphs, and A. Rangel. Social and monetary reward learning engage overlapping neural substrates. Social cognitive and affective neuroscience, 7(3):274–281, 2012. [14] E. K. Miller and J. D. Cohen. An integrative theory of prefrontal cortex function. Annual Review of Neuroscience, 24:167–202, 2001. [15] M. Olson. The Logic of Collective Action: Public Goods and the Theory of Groups. Harvard University Press, 1971. [16] S. A. Park, S. Jeong, and J. Jeong. TV programs that denounce unfair advantage impact women’s sensitivity to defection in the public goods game. Social Neuroscience, 8(6):568–582, 2013. [17] R. P. N. Rao. Decision making under uncertainty: a neural model based on partially observable Markov decision processes. Frontiers in computational neuroscience, 4, 2010. [18] C. C. Ruff and E. Fehr. The neurobiology of rewards and values in social decision making. Nature Reviews Neuroscience, 15:549–562, 2014. [19] R. D. Smallwood and E. J. Sondik. The optimal control of partially observable markov processes over a finite horizon. Operations Research, 21(5):1071–1088, 1973. [20] T. Smith and R. G. Simmons. Heuristic search value iteration for POMDPs. In Proceedings of International Conference on Uncertainty in Artificial Intelligence (UAI), 2004. [21] N. Steinbeis and E. A. Crone. The link between cognitive control and decision-making across child and adolescent development. Current Opinion in Behavioral Sciences, 10:28–32, 2016. [22] S. Thrun, W. Burgard, and D. Fox. Probabilistic Robotics. MIT Press, Cambridge, MA„ 2005. [23] S. M. Tom, C. R. Fox, C. Trepel, and R. A. Poldrack. The neural basis of loss aversion in decision-making under risk. Science, 315(5811):515–518, 2007. [24] J. Wanga, S. Surib, and D. J. Wattsb. Cooperation and assortativity with dynamic partner updating. Proceedings of the National Academy of Sciences, 109(36):14363–14368, 2012. [25] M. Wunder, S. Suri, and D. J. Watts. Empirical agent based models of cooperation in public goods games. In Proceedings of the Fourteenth ACM Conference on Electronic Commerce (EC), pages 891–908, 2013. 9
2016
69
6,529
Bayesian Intermittent Demand Forecasting for Large Inventories Matthias Seeger, David Salinas, Valentin Flunkert Amazon Development Center Germany Krausenstrasse 38 10115 Berlin matthis@amazon.de, dsalina@amazon.de, flunkert@amazon.de Abstract We present a scalable and robust Bayesian method for demand forecasting in the context of a large e-commerce platform, paying special attention to intermittent and bursty target statistics. Inference is approximated by the Newton-Raphson algorithm, reduced to linear-time Kalman smoothing, which allows us to operate on several orders of magnitude larger problems than previous related work. In a study on large real-world sales datasets, our method outperforms competing approaches on fast and medium moving items. 1 Introduction Demand forecasting plays a central role in supply chain management, driving automated ordering, in-stock management, and facilities planning. Classical forecasting methods, such as exponential smoothing [10] or ARIMA models [5], produce Gaussian predictive distributions. While sufficient for inventories of several thousand fast-selling items, Gaussian assumptions are grossly violated for the extremely large catalogues maintained by e-commerce platforms. There, demand is highly intermittent and bursty: long runs of zeros, with islands of high counts. Decision making requires quantiles of predictive distributions [14], whose accuracy suffer under erroneous assumptions. In this work, we detail a novel methodology for intermittent demand forecasting which operates in the industrial environment of a very large e-commerce platform. Implemented in Apache Spark [16], our method is used to process many hundreds of thousands of items and several hundreds of millions of item-days. Key requirements are automated parameter learning (no expert interventions), scalability and a high degree of operational robustness. Our system produces forecasts both for short (one to three weeks) and longer lead times (up to several months), the latter require feature maps depending on holidays, sales days, promotions, and price changes. Previous work on intermittent demand forecasting in Statistics is surveyed in [15]: none of these address longer lead times. On a modelling level, our proposal is related to [6], yet several novelties are essential for operating at the industrial scale we target here. This paper makes the following contributions: • A combination of generalized linear models and time series smoothing. The former enables medium and longer term forecasts, the latter provides temporal continuity and reasonable distributions over time. Compared to [6], we provide empirical evidence for the usefulness of this combination. • A novel algorithm for maximum likelihood parameter learning in state space models with non-Gaussian likelihood, using approximate Bayesian inference. While there is substantial related prior work, our proposal stands out in robustness and scalability. We show how approximate inference is solved by the Newton-Raphson algorithm, fully reduced to Kalman smoothing once per iteration. This reduction scales linearly (a vanilla implementation 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. would scale cubically). While previously used in Statistics [7, Sect. 10.7], this reduction is not widely known in Machine Learning. If L-BFGS is used instead (as proposed in [6]), approximate inference fails in our real-world use cases. • A multi-stage likelihood, taylored to intermittent and bursty demand data (extension of [15]), and a novel transfer function for Poisson likelihood, which robustifies the Laplace approximation for bursty data. We demonstrate that our approach would not work without these novelties. The structure of this paper is as follows. In Section 2, we introduce intermittent demand likelihood function as well as a generalized linear model baseline. Our novel latent state forecasting methodology is detailed in Section 3. We relate our approach to prior work in Section 4. In Section 5, we evaluate our methods both on publicly available data and on a large dataset of real-world demand in the context of e-commerce, comparing against state of the art intermittent forecasting methods. 2 Generalized Linear Models In this section, we introduce a likelihood function for intermittent demand data, along with a generalized linear model as baseline. Denote demand by zit ∈N (i for item, t for day). Our goal is to predict distributions of zit aggregates in the future. We do this by fitting a probabilistic model to maximize the likelihood of training demand data, then drawing sample paths from the fitted model, which represent forecast distributions. In the sequel, we fix an item i and write zt instead of zit. A model is defined by a likelihood P(zt|yt) and a latent function yt. An example is the Poisson: Ppoi(z|y) = 1 z!λ(y)ze−λ(y), z ∈N, (1) where the rate λ(y) depends on y through a transfer function. Demand data over large inventories is both intermittent (many zt = 0) and bursty (occasional large zt), and is not well represented by a Poisson. A better choice is the multi-stage likelihood, generalizing a proposal in [15]. This likelihood decomposes into K = 3 stages, each with its latent function y(k). In stage k = 0, we emit z = 0 with probability1 σ(y(0)). Otherwise, we transfer to stage k = 1, where z = 1 is emitted with probability σ(y(1)). Finally, if z ≥2, then stage k = 2 draws z −2 from the Poisson (1) with rate λ(y(2)). If the latent function yt (or functions yt(k)) is linear, yt = x⊤ t w, we have a generalized linear model (GLM) [11]. Features in xt include kernels anchored at holidays (Christmas, Halloween), seasonality indicators (DayOfWeek, MonthOfYear), promotion or price change indicators. The weights w are learned by maximizing the training data likelihood. For the multi-stage likelihood, this amounts to separate instances of binary classification at stages 0, 1, and Poisson regression at stage 2. Generalized linear forecasters work reasonably well, but have some important drawbacks. They lack temporal continuity: for short term predictions, even simple smoothers can outperform a tuned GLM. More important, a GLM predicts overly narrow forecast distributions, whose widths do not grow over time, and it neglects temporal correlations. Both drawbacks are alleviated in Gaussian linear time series models, such as exponential smoothing (ES) [10]. A major challenge is to combine this technology with general likelihood functions (Poisson, multi-stage) to enable intermittent demand forecasting. 3 Latent State Forecasting In this section, we develop latent state forecasting for intermittent demand, combining GLMs, general likelihoods, and exponential smoothing time series models. We begin with a single likelihood P(zt|yt), for example the Poisson (1), then consider a multi-stage extension. The latent process is yt = a⊤ t lt−1 + bt, bt = w⊤xt, lt = F lt−1 + gtεt, εt ∼N(0, 1). (2) Here, bt is the GLM deterministic linear function, lt is a latent state. This innovation state space model (ISSM) [10] is defined by at, gt and F , as well as the prior l0 ∼P(l0). Note that ISSMs are characterized by a single Gaussian innovation variable εt per time step. In our experiments here, we 1 Here, σ(u) := (1 + e−u)−1 is the logistic sigmoid. 2 employ a simple2 instance: yt = lt−1 + bt, lt = lt−1 + αεt, l0 ∼N(µ0, σ2 0), meaning that F = [1], at = [1], gt = [α], and the latent state contains a level component only. The free parameters are w (weights), α > 0, and µ0, σ0 > 0 of P(l0), collected in the vector θ. 3.1 Training. Prediction. Multiple Stages We would like to learn θ by maximizing the likelihood of data [zt]t=1,...,T . Compared to the GLM case, this is harder to do, since latent (unobserved) variables s = [ε1, . . . , εT −1, l0⊤]⊤ have to be integrated out. If our likelihood P(zt|yt) was Gaussian, this marginalization could be computed analytically via Kalman smoothing [10]. With a non-Gaussian likelihood, the problem is analytically intractable, yet is amenable to the Laplace approximation [4, Sect. 4.4]. The exact log likelihood is log P(z|θ) = log R P(z, s|θ) ds = log R Q t P(zt|yt)P(s) ds, where y = y(s) is the affine mapping given by (2). We proceed in two steps. First, we find the mode of the posterior: ˆs = argmax log P(z, s|θ), the inner optimization problem. Second, we replace −log P(z, s|θ) by its quadratic Taylor approximation f(s; θ) at the mode. The criterion to replace the negative log likelihood is ψ(θ) := −log R e−f(s;θ) ds. More precisely, denote φt(yt) := −log P(zt|yt), and let ˆy = y(ˆs), where ˆs is the posterior mode. The log-concavity of the likelihood implies that φt(yt) is convex, and φ′′ t (yt) > 0. The quadratic Taylor approximation to φt(yt) at ˆyt is ˜φt(yt) := −log N(˜zt|yt, σ2 t ), where σ2 t = 1/φ′′ t (ˆyt) and ˜zt = ˆyt −σ2 t φ′ t(ˆyt). Now, Laplace’s approximation to −log P(z|θ) can be written as ψ(θ) = −log Z Y t N(˜zt|yt, σ2 t )P(s) ds + X t  φt(ˆyt) −˜φt(ˆyt)  , y = y(s; θ). (3) For log-concave3 P(zt|yt), the inner optimization is a convex problem. We use the Newton-Raphson algorithm to solve it. This algorithm iterates between fitting the current criterion by its local second order approximation and minimizing the quadratic surrogate. For the former step, we compute yt values by a forward pass (2), then replace the potentials P(zt|yt) by N(˜zt|yt, σ2 t ), where the values ˜zt, σ2 t are determined by the second order fit (as above, but ˆyt →yt). The latter step amounts to computing the posterior mean (equal to the mode) E[s] of the resulting Gaussian-linear model. This inference problem is solved by Kalman smoothing.4 Not only finding the mode ˆs, but also the computation of ∇θψ, is fully reduced to Kalman smoothing. This point is crucial. We can find ˆs by the most effective optimization algorithm there is. In general, each Newton step requires the O(T 3) inversion of a Hessian matrix. We reduce it to Kalman smoothing, a robust algorithm with O(T) scaling. As shown in Section 4, Newton-Raphson is essential here: other commonly used optimizers fail to find ˆs in a reasonable time. Prediction samples are obtained as follows. Denote observed demand by [z1, z2, . . . , zT ], unobserved demand in the prediction range by [zT +1, zT +2, . . . ]. We run Newton-Raphson one more time to obtain the Gaussian approximation to the posterior P(lT |z1:T ) over the final state. For each sample path [zT +t], we draw lT ∼P(lT |z1:T ), εT +t ∼N(0, 1), compute [yT +t] by a forward pass, and zT +t ∼P(zT +t|yT +t). Drawing prediction samples is not more expensive than from a GLM. Finally, we generalize latent state forecasting to the multi-stage likelihood. As for the GLM, we learn parameters θ(k) separately for each stage k. Stages k = 0, 1 are binary classification, while stage k = 2 is count regression. Say that a day t is active at stage k if zt ≥k. Recall that with GLMs, we simply drop non-active days. Here, we use ISSMs for [y(k) t ] on the full range t = 1, . . . , T, but all non-active y(k) t are considered unobserved: no likelihood potential is associated with t. Both Kalman smoothing and mode finding (Laplace approximation) are adapted to missing observations, which presents no difficulties (see also Section 5.1). 2 More advanced variants include damping, linear trend, and seasonality factors [10]. 3 Unless otherwise said, all likelihoods in this paper are log-concave. 4 We use a numerically robust implementation of Kalman smoothing, detailed in [10, Sect. 12]. 3 3.2 Some Details In this section, we sketch technical details, most of which are novel contributions. As demonstrated in our experiments, these details are essential for the whole approach to work robustly at the intended scale on our difficult real-world data. Full details are given in a supplemental report. We use L-BFGS for the outer optimization of ψ(θ), encoding the constrained parameters: α = αm + (αM −αm)σ(θ1); 0 < αm < αM; σ0 = log(1 + eθ2) > 0. We add a quadratic regularizer P j(ρj/2)(θj −¯θj)2 to the criterion, where ρj, ¯θj are shared across all items. Finally, recall that with the multi-stage likelihood, day t is unobserved at stage k > 1 if zt < k. If for some item, there are less than 7 observed days in a stage, we skip training and fall back to fixed parameters ¯θ. Every single evaluation of ψ(θ) requires finding the posterior mode ˆs. This high-dimensional inner optimization has to converge robustly in few iterations: ˆs = argmin F(s; θ) := −log P(z|s) − log P(s) = P t φt(yt) −log P(s). The use of Newton-Raphson and its reduction to linear-time Kalman smoothing was noted above. The algorithm is extended by a line search procedure as well as a heuristic to pick a starting point s0 (see supplemental report). We have to compute the gradient ∇θψ(θ), where the criterion is given by (3). The main difficulty here are indirect dependencies: ψ(θ, ˆy, ˆs), where ˆy = y(ˆs; θ), ˆs = ˆs(θ). Since ˆs is computed by an iterative algorithm, commonly used automated differentiation tools do not sensibly apply here. Maybe the most difficult indirect term is (∂ˆsψ)⊤(∂ˆs/∂θj), where θj ∈θ. First, ˆs is defined by ∂ˆsF = 0. Taking the derivative w.r.t. θj on both sides, we obtain (∂ˆs/∂θj) = −(∂ˆs,ˆsF)−1∂ˆs,θjF, so we are looking at −(∂ˆs,θjF)⊤(∂ˆs,ˆsF)−1(∂ˆsψ). It is of course out of the question to compute and invert ∂ˆs,ˆsF. But (∂ˆs,ˆsF)−1(∂ˆsψ) corresponds to the posterior mean for an ISSM with Gaussian likelihood, which depends on ∂ˆsψ. This means that the indirect gradient part costs one more run of Kalman smoothing, independent of the number of parameters θj. Note that the same reasoning underlies our reduction of Newton-Raphson to Kalman smoothing. A final novel contribution is essential for making the Laplace approximation work on real-world bursty demand data. Recall the transfer function λ(y) for the Poisson likelihood (1) at the highest stage k = 2. As shown in Section 4, the exponential choice λ = ey fails for all but short term forecasts. With a GLM, the logistic transfer λ(y) = g(y) works well, where g(u) := log(1 + eu). It behaves like ey for y < 0, but grows linearly for positive y. However, it exhibits grave problems for latent state forecasting. Denote φ(y) := −log P(z|y), where P(z|y) is the Poisson with logistic transfer. Recall Laplace’s approximation from Section 3.1: φ(·) is fit by a quadratic ˜φ(·) = (· −˜z)/(2σ2), where σ2 = 1/φ′′(y), ˜z = y −σ2φ′(y). For large y and z = 0, these two terms scale as ey, while for z > 0 they grow polynomially. In real-world data, we regularly exhibit sizable counts (say, a few zt > 25, driving up yt), followed by a single zt = 0. At this point, huge values (˜zt, σ2 t ) arise, causing cancellation errors in ψ(θ), and the outer optimization terminates prematurely. The root cause for these issues lies with the transfer function: g(y) ≈y for large y, its curvature behaves as e−y. Our remedy is to propose the novel twice logistic transfer function: λ(y) = g(y(1 + κg(y)), where κ > 0. If φκ(y) = −log P(z|y) with the new transfer function, then φκ(y) behaves similar to φ(y) for small or negative y, but crucially (φκ)′′(y) ≈2κ for large y and any z ∈N. This means that Laplace approximation terms are O(1/κ). Setting κ = 0.01 resolves all problems described above. Importantly, the resulting Poisson likelihood is log-concave for any κ ≥0. We conjecture that similar problems may arise with other “local” variational or expectation propagation inference approximations as well. The twice logistic transfer function should therefore be of wider applicability. 4 Related Work Our work has precursors both in Statistics and Machine Learning. Maximum likelihood learning for exponential smoothing models is developed in [10]. These methods are limited to Gaussian likelihood, approximate Bayesian inference is not used. Starting from Croston’s method [10, Sect. 16.2], there is a sizable literature on intermittent demand forecasting, as reviewed in [15]. The best-performing method in [15] uses negative binomial likelihood and a damped dynamic, parameters are learned by maximum likelihood. There is no latent (random) state, and neither non-Gaussian inference nor Kalman smoothing are required. It does not allow for a combination with GLMs. 4 We employ approximate Bayesian inference in a linear dynamical system, for which there is a lot of prior work in Machine Learning [3, 1, 2]. While Laplace’s technique is the most frequently used deterministic approximation in Statistics, both in publications and in automated inference systems [13], other techniques such as expectation propagation are applicable to models of interest here [12, 8]. The robustness and predictable running time of Laplace’s approximation are key in our application, where inference is driving parameter learning, running in parallel over hundreds of thousands of items. Expectation propagation is not guaranteed to converge, and Markov chain Monte Carlo methods even lack automated convergence tests. The work most closely related to ours is [6]. They target intermittent demand forecasting, using a Laplace approximation for maximum likelihood learning, allow for a combination with GLMs, and go beyond our work transferring information between items by way of a hierarchical prior distribution. Their work is evaluated on small datasets and short term scenarios only. In contrast, our system runs robustly on many hundreds of thousands of items and many millions of item-days, a three orders of magnitude larger scale than what they report. They do not explore the value of a feature-based deterministic part, which on our real-world data is essential for medium term forecasts. We find that a number of choices in [6] are limiting when it comes to robustness and scalability. First, they choose a likelihood which is not log-concave for two reasons: they use a negative binomial distribution instead of a Poisson, and they use zero-inflation instead of a multi-stage setup.5 This means their inner optimization problem is non-convex, jeopardizing robustness and efficiency of the nested learning process. Moreover, in our multi-stage setup, the conditional probability of zt = 0 versus zt > 0 is represented exactly, while zero-inflation caters for a time-independent zero probability only. 103 104 105 time [ms] 10−7 10−6 10−5 10−4 10−3 10−2 10−1 100 101 102 103 104 105 106 gradient norm newton lbfgs Figure 1: Comparison Newton-Raphson vs. LBFGS for inner optimization. Sampled at first evaluation of ψ(θ). Shown are median (p10, p90) over ca. 1500 items. L-BFGS fails to converge to decent accuracy. Next, they use an exponential transfer function λ = ey for the negative binomial rate, while we propose the novel twice logistic function (Section 3.2). Experiments with the exponential choice on our data resulted in total failure, at least beyond short term forecasts. Its huge curvature for large y results in extremely large and instable predictions around holidays. In fact, the exponential function causes rapid growth of predictions even without a linear function extension, unless the random process is strongly damped. Finally, they use a standard L-BFGS solver for their inner problem, evaluating the criterion using additional sparse matrix software. In contrast, we enable Newton-Raphson by reducing it to Kalman smoothing. In Figure 1, we evaluate the usefulness of L-BFGS for mode finding in our setup.6 L-BFGS clearly fails to attain decent accuracy in any reasonable amount of time, while Newton-Raphson converges reliably. Such inner reliability is key to reaching our goal of fully automated learning in an industrial system. In conclusion, while the lack of public code for [6] precludes a direct comparison, their approach, while partly more advanced, should be limited to smaller problems, shorter forecast horizons, and would be hard to run in an industrial setting. 5 Experiments In this section, we present experimental results, comparing variants of our approach to related work. 5.1 Out of Stock Treatment With a large and growing inventory, a fraction of items is out of stock at any given time, meaning that order fulfillments are delayed or do not happen at all. When out of stock, an item cannot be sold 5 Zero-inflation, p0I{zt=0} + (1 −p0)P ′(zt|yt), destroys log-concavity for zt = 0. 6 The inner problem is convex, its criterion is efficiently implemented (no dependence on foreign code). The situation in [6] is likely more difficult. 5 (zt = 0), yet may still elicit considerable customer demand. The probabilistic nature of latent state forecasting renders it easy to use out of stock information. If an item is not in stock at day t, the data zt = 0 is explained away, and the corresponding likelihood term should be dropped. As noted in Section 3.1, this presents no difficulty in our framework. Dec 2013 Mar 2014 Jun 2014 Sep 2014 Dec 2014 Mar 2015 Jun 2015 Sep 2015 unobservedDays Dec 2013 Mar 2014 Jun 2014 Sep 2014 Dec 2014 Mar 2015 Jun 2015 Sep 2015 unobservedDays Figure 2: Demand forecast for an item which is partially out of stock. Each panel: Training range left (green), prediction range right (red), true targets black. In color: Median, P10 to P90. Bottom: Out of stock (≥80% of day) marked in red. Left: Out of stock signal ignored. Demand forecast drops to zero, strong underbias in prediction range. Right: Out of stock regions treated as missing observations. Demand becomes uncertain in out of stock region. No underbias in prediction range. In Figure 2, we show demand forecasts for an item which is out of stock during certain periods in the training range. It is obvious that ignoring the out of stock signal leads to systematic underbias (since zt = 0 is interpreted as “no demand”). This underbias is corrected for by treating out of stock regions as having unobserved targets. Note that an item may be partially out of stock during a day, still creating some sales. In such cases, we could treat zt as unobserved, but lower-bounded by the sales, and an expectation maximization extension may be applied. However, such situations are comparatively rare in our data (compared to full-day out of stock). In the rest of this section, latent state forecasting is taking out of stock information into account. 5.2 Comparative Study We present experimental results obtained on a number of datasets, containing intermittent counts time series. Parts contains monthly demand of spare parts at a US automobile company, is publicly available, and was previously used in [10, 15, 6]. Further results are obtained on internal daily e-commerce sales data. In either case, we subsampled the sets in a stratified manner from a larger volume used in our production setting. EC-sub is medium size and contains fast and medium moving items. EC-all is a large dataset (more than 500K items, 150M item-days), being the union of EC-sub with items which are slower moving. Properties of these datasets are given in Figure 3, top left. Demand is highly intermittent and bursty in all cases, as witnessed by a large CV 2 and a high proportion of zt = 0: these properties are typical for supply chain data. Not only is EC-all much larger than any public demand forecasting dataset we are aware of, our internal datasets consists of longer series (up to 10×) and are more bursty than Parts. The following methods are compared. ETS is exponential smoothing with Gaussian additive errors and automatic model selection, a frequently used R package [9]. NegBin is our implementation of the negative binomial damped dynamic variant of [15]. We consider two variants of our latent state forecaster: LS-pure without features, and LS-feats with a feature vector xt (basic seasonality, kernels at holidays, price changes, out of stock). Predictive distributions are represented by 100 samples over the prediction range (length 8 for Parts, length 365 for others). We employ quadratic regularization for all methods except ETS (see Section 3.2). Hyperparameters consist of regularization constants ρj and centers ¯θj (full details are given in the supplemental report). We tune7 such parameters on random 10% of the data, evaluating test results on the remaining 90%. For LS-pure and LS-feats, we use two sets of tuned hyperparameters on the largest set EC-all: one for the EC-sub part, the other for the rest. Our metrics quantify the forecast accuracy of certain quantiles of predictive distributions. They are defined in terms of spans [L, L + S) in the prediction range, where L are lead times. In general, we ignore days when items are out of stock (see Figure 3, top left, for in-stock ratios). 7 We found that careful hyperparameter tuning is important for obtaining good results, also for NegBin. In contrast, regularization is not even mentioned in [15] (our implementation of NegBin includes the same quadratic regularization as for our methods). 6 If πit = I{i in stock at t}, define Zi;(L,S) = PL+S−1 t=L πitzit. For ρ ∈(0, 1), the predicted ρ-quantile of Zi;(L,S) is denoted by ˆZρ i;(L,S). These predictions are obtained from the sample paths by first summing over the span, then estimating the quantile by way of sorting. The ρ-quantile loss8 is defined as Lρ(z, ˆz) = 2(z −ˆz)(ρI{z>ˆz} −(1 −ρ)I{z≤ˆz}). The P(ρ · 100) risk metric for [L, L + S) is defined as Rρ[I; (L, S)] = |I|−1 P i∈I Lρ(Zi;(L,S), ˆZρ i;(L,S)), where the left argument Zi;(L,S) is computed from test targets.9 We focus on P50 risk (ρ = 0.5; mean absolute error) and P90 risk (ρ = 0.9; the 0.9-quantile is often relevant for automated ordering). Parts EC-sub EC-all # items 19874 39700 534884 Unit t month day day Median CV 2 2.4 5.8 9.7 Freq. zt = 0 54% 46% 83% In-stock ratio 100% 73% 71% Avg. size series 33 329 293 # item-days 656K 13M 157M sum units ETS NegBin LS-pure LS-feats true demand (a) Oct 14 Nov 14 Dec 14 Jan 15 Feb 15 Mar 15 Apr 15 May 15 Jun 15 Jul 15 Aug 15 P50 risk ETS NegBin LS-pure LS-feats (b) Oct 14 Nov 14 Dec 14 Jan 15 Feb 15 Mar 15 Apr 15 May 15 Jun 15 Jul 15 Aug 15 P90 risk ETS NegBin LS-pure LS-feats (c) Figure 3: Table: Dataset properties. CV 2 = Var[zt]/E[zt]2 measures burstiness. (a): Sum of weekly P50 point (median) forecast over a one-year prediction range for the different methods (lines) as well as sum of true demand (shaded area), on dataset I = EC-sub. (b): Weekly P50 risk R0.5[I; (7 · k, 7)], k = 0, 1, . . . , for same dataset. (c): Same as (b) for P90 risk. We plot the P50 and P90 risk on dataset EC-sub, as well the sum of P50 point (median) forecast and the true demand, in the three panels of Figure 3. All methods work well in the first week, but there are considerable differences further out. Naturally, losses are highest during the Christmas peak sales period. LS-feats strongly outperforms all others in this critical region (see Figure 3, top right), by means of its features (holidays, seasonality). The Gaussian predictive distributions of ETS exhibit growing errors over time. With the exception of the Christmas period, NegBin works rather well (in particular in P50 risk), but is uniformly outperformed by both LS-pure, and LS-feats in particular. A larger range of results are given in Table 1 (Parts, EC-sub) and Table 2 (EC-all), where numbers are relative to NegBin. Note that the R code for ETS could not be run on the large EC-all. On Parts, NegBin works best, yet LS-pure comes close (we did not use features on this dataset). On EC-sub, LS-feats outperforms all others in all scenarios. The featureless NegBin and LS-pure are comparable on this dataset. On the largest set EC-all, LS-feats generally outperforms the others, but differences are smaller. Finally, we report running times of parameter learning (outer optimization) for LS-feats on EC-sub. L-BFGS was run with maxIters = 55, gradTol = 10−5. Our experimental cluster consists of about 150 nodes, with Intel Xeon E5-2670 CPUs (4 cores) and 30GB RAM. Profiling was done separately in each stage: k = 0 (P5 = 0.180s, P50 = 1.30s, P95 = 2.15s), k = 1 (P5 = 0.143s, P50 = 1.11s, P95 = 1.79s), k = 2 (P5 = 0.138s, P50 = 1.29s, P95 = 3.25s). Here, we quote median (P50), 5% and 95% percentiles (P5, P95). The largest time recorded was 10.4s. The narrow spread of these numbers witnesses the robustness and predictability of the nested optimization process, crucial properties in the context of production systems running on parallel compute clusters. 8 EZ[Lρ(Z, ˆz)] is minimized by the ρ-quantile. Also, L0.5(z, ˆz) = |z −ˆz|. 9 More precisely, we filter I before use in Rρ[I; (L, S)]: I′ = {i ∈I | PL+S−1 t=L πit ≥0.8S}. 7 Parts EC-sub P90 risk P50 risk P90 risk P50 risk (L, S) (0, 2) dy(8) (0, 2) dy(8) (0, 56) (21, 84) wk(33) (0, 56) (21, 84) wk(33) ETS 1.04 1.04 1.19 1.38 0.99 0.75 1.13 1.07 1.10 1.18 LS-pure 1.08 1.06 1.04 1.06 1.07 0.97 0.99 0.95 1.03 0.99 LS-feats – – – – 0.80 0.73 0.85 0.84 0.84 0.94 NegBin 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 Table 1: Results for dataset Parts (left) and EC-sub (right). Metric values relative to NegBin (each column). dy(8): Average of Rρ[I; (k, 1)], k = 0, . . . , 7. wk(33): Average of Rρ[I; (7 · k, 7)], k = 0, . . . , 32. P90 risk P50 risk (L, S) (0, 56) (21, 84) wk(33) (0, 56) (21, 84) wk(33) LS-pure 1.11 1.03 0.99 1.00 1.03 1.05 LS-feats 0.95 0.86 0.89 0.92 0.88 0.98 NegBin 1.00 1.00 1.00 1.00 1.00 1.00 Table 2: Results for dataset EC-all. Metric values relative to NegBin (each column). ETS could not be run at this scale. 6 Conclusions. Future Work In this paper, we developed a framework for maximum likelihood learning of probabilistic latent state forecasting models, which can be seen as principled time series extensions of generalized linear models. We pay special attention to the intermittent and bursty statistics of demand, characteristic for the vast inventories maintained by large retailers or e-commerce platforms. We show how approximate Bayesian inference techniques can be implemented in a robust and highly scalable way, so to enable a forecasting system which runs safely on hundred of thousands of items and hundreds of millions of item-days. We can draw some conclusions from our comparative study on a range of real-world datasets. Our proposed method strongly outperforms competitors on sales data from fast and medium moving items. Besides good short term forecasts due to temporal smoothness and well-calibrated growth of uncertainty, our use of a feature vector seems most decisive for medium term forecasts. On slow moving items, simpler methods like NegBin [15] are competitive, even though they lack signal models which could be learned from data. We are investigating several directions for future work. Our current system uses time-independent ISSMs, in particular gt = [α] means that the same amount of innovation variance is applied every day. This assumption is violated by our data, where a lot more variation happens in the weeks leading up to Christmas or before major holidays than during the rest of the year. To this end, we are exploring learning two parameters: αh during high-variation periods, and αl for all remaining days. We also plan to augment the state lt by seasonality10 factors [10, Sect. 14] (both at, gt depend on time then). One of the most important future directions is to learn about and exploit dependencies between the demand time series of different items. In fact, the strategy to learn and forecast each item independently is not suitable for items with a short demand history, or for slow moving items. One approach we pursue is to couple latent processes by a shared (global) linear or non-linear function. Acknowledgements We would like to thank Maren Mahsereci for determining the running time figures, and the Wupper team for all the hard work without which this paper would not have happened. 10 Currently, periodic seasonality is dealt with by features in xt. 8 References [1] D. Barber. Expectation correction for smoothing in switching linear Gaussian state space models. Journal of Machine Learning Research, 7:2515–2540, 2006. [2] D. Barber, T. Cemgil, and S. Chiappa. Bayesian Time Series Models. Cambridge University Press, 1st edition, 2011. [3] M. Beal. Variational Algorithms for Approximate Bayesian Inference. PhD thesis, Gatsby Unit, UCL, 2003. [4] C. Bishop. Pattern Recognition and Machine Learning. Springer, 1st edition, 2006. [5] G. Box, G. Jenkins, and G. Reinsel. Time Series Analysis: Forecasting and Control. John Wiley & Sons, 4th edition, 2013. [6] N. Chapados. Effective Bayesian modeling of groups of related count time series. In E. Xing and T. Jebara, editors, International Conference on Machine Learning 31, pages 1395–1403. JMLR.org, 2014. [7] J. Durbin and S. Koopman. Time Series Analysis by State Space Methods. Oxford Statistical Sciences. Oxford University Press, 2nd edition, 2012. [8] Tom Heskes and Onno Zoeter. Expectation propagation for approximate inference in dynamic Bayesian networks. In A. Darwiche and N. Friedman, editors, Uncertainty in Artificial Intelligence 18. Morgan Kaufmann, 2002. [9] R. Hyndman and Y. Khandakar. Automatic time series forecasting: the forecast package for R. Journal of Statistical Software, 26(3):1–22, 2008. [10] R. Hyndman, A. Koehler, J. Ord, and R. Snyder. Forecasting with Exponential Smoothing: The State Space Approach. Springer, 1st edition, 2008. [11] P. McCullach and J.A. Nelder. Generalized Linear Models. Number 37 in Monographs on Statistics and Applied Probability. Chapman & Hall, 1st edition, 1983. [12] T. Minka. Expectation propagation for approximate Bayesian inference. In J. Breese and D. Koller, editors, Uncertainty in Artificial Intelligence 17. Morgan Kaufmann, 2001. [13] H. Rue and S. Martino. Approximate Bayesian inference for latent Gaussian models by using integrated nested Laplace approximations. Journal of Roy. Stat. Soc. B, 71(2):319–392, 2009. [14] L. Snyder and Z. Shen. Fundamentals of Supply Chain Theory. John Wiley & Sons, 1st edition, 2011. [15] R. Snyder, J. Ord, and A. Beaumont. Forecasting the intermittent demand for slow-moving inventories: A modelling approach. International Journal on Forecasting, 28:485–496, 2012. [16] M. Zaharia, M. Chowdhury, T. Das, A. Dave, J. Ma, M. McCauley, M. Franklin, S. Shenker, and I. Stoica. Resilient distributed datasets: A fault-tolerant abstraction for in-memory cluster computing. In Proceedings of the 9th USENIX conference on Networked Systems Design and Implementation (NSDI), page 2, 2012. 9
2016
7
6,530
Bootstrap Model Aggregation for Distributed Statistical Learning Jun Han Department of Computer Science Dartmouth College jun.han.gr@dartmouth.edu Qiang Liu Department of Computer Science Dartmouth College qiang.liu@dartmouth.edu Abstract In distributed, or privacy-preserving learning, we are often given a set of probabilistic models estimated from different local repositories, and asked to combine them into a single model that gives efficient statistical estimation. A simple method is to linearly average the parameters of the local models, which, however, tends to be degenerate or not applicable on non-convex models, or models with different parameter dimensions. One more practical strategy is to generate bootstrap samples from the local models, and then learn a joint model based on the combined bootstrap set. Unfortunately, the bootstrap procedure introduces additional noise and can significantly deteriorate the performance. In this work, we propose two variance reduction methods to correct the bootstrap noise, including a weighted M-estimator that is both statistically efficient and practically powerful. Both theoretical and empirical analysis is provided to demonstrate our methods. 1 Introduction Modern data science applications increasingly involve learning complex probabilistic models over massive datasets. In many cases, the datasets are distributed into multiple machines at different locations, between which communication is expensive or restricted; this can be either because the data volume is too large to store or process in a single machine, or due to privacy constraints as these in healthcare or financial systems. There has been a recent growing interest in developing communication-efficient algorithms for probabilistic learning with distributed datasets; see e.g., Boyd et al. (2011); Zhang et al. (2012); Dekel et al. (2012); Liu and Ihler (2014); Rosenblatt and Nadler (2014) and reference therein. This work focuses on a one-shot approach for distributed learning, in which we first learn a set of local models from local machines, and then combine them in a fusion center to form a single model that integrates all the information in the local models. This approach is highly efficient in both computation and communication costs, but casts a challenge in designing statistically efficient combination strategies. Many studies have been focused on a simple linear averaging method that linearly averages the parameters of the local models (e.g., Zhang et al., 2012, 2013; Rosenblatt and Nadler, 2014); although nearly optimal asymptotic error rates can be achieved, this simple method tends to degenerate in practical scenarios for models with non-convex log-likelihood or non-identifiable parameters (such as latent variable models, and neural models), and is not applicable at all for models with non-additive parameters (e.g., when the parameters have discrete or categorical values, or the parameter dimensions of the local models are different). A better strategy that overcomes all these practical limitations of linear averaging is the KL-averaging method (Liu and Ihler, 2014; Merugu and Ghosh, 2003), which finds a model that minimizes the sum of Kullback-Leibler (KL) divergence to all the local models. In this way, we directly combine the models, instead of the parameters. The exact KL-averaging is not computationally tractable 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. because of the intractability of calculating KL divergence; a practical approach is to draw (bootstrap) samples from the given local models, and then learn a combined model based on all the bootstrap data. Unfortunately, the bootstrap noise can easily dominate in this approach and we need a very large bootstrap sample size to obtain accurate results. In Section 3, we show that the MSE of the estimator obtained from the naive way is O(N −1 + (dn)−1), where N is the total size of the observed data, and n is bootstrap sample size of each local model and d is the number of machines. This means that to ensure a MSE of O(N −1), which is guaranteed by the centralized method and the simple linear averaging, we need dn ≳N; this is unsatisfying since N is usually very large by assumption. In this work, we use variance reduction techniques to cancel out the bootstrap noise and get better KL-averaging estimates. The difficulty of this task is first illustrated using a relatively straightforward control variates method, which unfortunately suffers some of the practical drawback of the linear averaging method due to the use of a linear correction term. We then propose a better method based on a weighted M-estimator, which inherits all the practical advantages of KL-averaging. On the theoretical part, we show that our methods give a MSE of O(N −1 + (dn2)−1), which significantly improves over the original bootstrap estimator. Empirical studies are provided to verify our theoretical results and demonstrate the practical advantages of our methods. This paper is organized as follows. Section 2 introduces the background, and Section 3 introduces our methods and analyze their theoretical properties. We present numerical results in Section 4 and conclude the paper in Section 5. Detailed proofs can be found in the appendix. 2 Background and Problem Setting Suppose we have a dataset X = {xj, j = 1, 2, ..., N} of size N, i.i.d. drawn from a probabilistic model p(x|θ∗) within a parametric family P = {p(x|θ) : θ ∈Θ}; here θ∗is the unknown true parameter that we want to estimate based on X. In the distributed setting, the dataset X is partitioned into d disjoint subsets, X = Sd k=1 Xk, where Xk denotes the k-th subset which we assume is stored in a local machine. For simplicity, we assume all the subsets have the same data size (N/d). The traditional maximum likelihood estimator (MLE) provides a natural way for estimating the true parameter θ∗based on the whole dataset X, Global MLE: ˆθmle = arg max θ∈Θ d X k=1 N/d X j=1 log p(xk j | θ), where Xk = {xk j }. (1) However, directly calculating the global MLE is challenging due to the distributed partition of the dataset. Although distributed optimization algorithms exist (e.g., Boyd et al., 2011; Shamir et al., 2014), they require iterative communication between the local machines and a fusion center, which can be very time consuming in distributed settings, for which the number of communication rounds forms the main bottleneck (regardless of the amount of information communicated at each round). We instead consider a simpler one-shot approach that first learns a set of local models based on each subset, and then send them to a fusion center in which they are combined into a global model that captures all the information. We assume each of the local models is estimated using a MLE based on subset Xk from the k-th machine: Local MLE: ˆθk = arg max θ∈Θ N/d X j=1 log p(xk j | θ), where k ∈[d] = {1, 2, · · · , d}. (2) The major problem is how to combine these local models into a global model. The simplest way is to linearly average all local MLE parameters: Linear Average: ˆθlinear = 1 d d X k=1 ˆθk. Comprehensive theoretical analysis has been done for ˆθlinear (e.g., Zhang et al., 2012; Rosenblatt and Nadler, 2014), which show that it has an asymptotic MSE of E||ˆθlinear −θ∗||2 = O(N −1). In fact, it is equivalent to the global MLE ˆθmle up to the first order O(N −1), and several improvements have been developed to improve the second order term (e.g., Zhang et al., 2012; Huang and Huo, 2015). 2 Unfortunately, the linear averaging method can easily break down in practice, or is even not applicable when the underlying model is complex. For example, it may work poorly when the likelihood has multiple modes, or when there exist non-identifiable parameters for which different parameter values correspond to a same model (also known as the label-switching problem); models of this kind include latent variable models and neural networks, and appear widely in machine learning. In addition, the linear averaging method is obviously not applicable when the local models have different numbers of parameters (e.g., Gaussian mixtures with unknown numbers of components), or when the parameters are simply not additive (such as parameters with discrete or categorical values). Further discussions on the practical limitations of the linear averaging method can be found in Liu and Ihler (2014). All these problems of linear averaging can be well addressed by a KL-averaging method which averages the model (instead of the parameters) by finding a geometric center of the local models in terms of KL divergence (Merugu and Ghosh, 2003; Liu and Ihler, 2014). Specifically, it finds a model p(x | θ∗ KL) where θ∗ KL is obtained by θ∗ KL = arg minθ Pd k=1 KL(p(x|ˆθk) || p(x|θ)), which is equivalent to, Exact KL Estimator: θ∗ KL = arg max θ∈Θ  η(θ) ≡ d X k=1 Z p(x | ˆθk) log p(x | θ)dx  . (3) Liu and Ihler (2014) studied the theoretical properties of the KL-averaging method, and showed that it exactly recovers the global MLE, that is, θ∗ KL = ˆθmle, when the distribution family is a full exponential family, and achieves an optimal asymptotic error rate (up to the second order) among all the possible combination methods of {ˆθk}. Despite the attractive properties, the exact KL-averaging is not computationally tractable except for very simple models. Liu and Ihler (2014) suggested a naive bootstrap method for approximation: it draws parametric bootstrap sample {exk j }n j=1 from each local model p(x|ˆθk), k ∈[d] and use it to approximate each integral in (3). The optimization in (3) then reduces to a tractable one, KL-Naive Estimator: ˆθKL = arg max θ∈Θ  ˆη(θ) ≡1 n d X k=1 n X j=1 log p(exk j | θ)  . (4) Intuitively, we can treat each e Xk = {exk j }n j=1 as an approximation of the original subset Xk = {xk j }N/d j=1, and hence can be used to approximate the global MLE in (1). Unfortunately, as we show in the sequel, the accuracy of ˆθKL critically depends on the bootstrap sample size n, and one would need n to be nearly as large as the original data size N/d to make ˆθKL achieve the baseline asymptotic rate O(N −1) that the simple linear averaging achieves; this is highly undesirably since N is often assumed to be large in distributed learning settings. 3 Main Results We propose two variance reduction techniques for improving the KL-averaging estimates and discuss their theoretical and practical properties. We start with a concrete analysis on the KL-naive estimator ˆθKL, which was missing in Liu and Ihler (2014). Assumption 1. 1. log p(x | θ), ∂log p(x|θ) ∂θ , and ∂2 log p(x|θ) ∂θ∂θ⊤ are continuous for ∀x ∈X and ∀θ ∈Θ; 2. ∂2 log p(x|θ) ∂θ∂θ⊤ is positive definite and C1 ≤∥∂2 log p(x|θ) ∂θ∂θ⊤ ∥≤C2 in a neighbor of θ∗for ∀x ∈X, and C1, C2 are some positive constans. Theorem 2. Under Assumption 1, ˆθKL is a consistent estimator of θ∗ KL as n →∞, and E(ˆθKL −θ∗ KL) = o( 1 dn), E∥ˆθKL −θ∗ KL∥2 = O( 1 dn), where d is the number of machines and n is the bootstrap sample size for each local model p(x | ˆθk). The proof is in Appendix A. Because the MSE between the exact KL estimator θ∗ KL and the true parameter θ∗is O(N −1) as shown in Liu and Ihler (2014), the MSE between ˆθKL and the true 3 parameter θ∗is E∥ˆθKL −θ∗∥2 ≈E∥ˆθKL −θ∗ KL∥2 + E∥θ∗ KL −θ∗∥2 = O(N −1 + (dn)−1). (5) To make the MSE between ˆθKL and θ∗equal O(N −1), as what is achieved by the simple linear averaging, we need draw dn ≳N bootstrap data points in total, which is undesirable since N is often assumed to be very large by the assumption of distributed learning setting (one exception is when the data is distributed due to privacy constraint, in which case N may be relatively small). Therefore, it is a critical task to develop more accurate methods that can reduce the noise introduced by the bootstrap process. In the sequel, we introduce two variance reduction techniques to achieve this goal. One is based a (linear) control variates method that improves ˆθKL using a linear correction term, and another is a multiplicative control variates method that modifies the M-estimator in (4) by assigning each bootstrap data point with a positive weight to cancel the noise. We show that both method achieves a higher O(N −1 + (dn2)−1) rate under mild assumptions, while the second method has more attractive practical advantages. 3.1 Control Variates Estimator The control variates method is a technique for variance reduction on Monte Carlo estimation (e.g., Wilson, 1984). It introduces a set of correlated auxiliary random variables with known expectations or asymptotics (referred as the control variates), to balance the variation of the original estimator. In our case, since each bootstrapped subsample e Xk = {exk j }n j=1 is know to be drawn from the local model p(x | ˆθk), we can construct a control variate by re-estimating the local model based on e Xk: Bootstrapped Local MLE: eθk = arg max θ∈Θ n X j=1 log p(exk j | θ), for k ∈[d], (6) where eθk is known to converge to ˆθk asymptotically. This allows us to define the following control variates estimator: KL-Control Estimator: ˆθKL−C = ˆθKL + d X k=1 Bk(eθk −ˆθk), (7) where Bk is a matrix chosen to minimize the asymptotic variance of ˆθKL−C; our derivation shows that the asymptotically optimal Bk has a form of Bk = −( d X k=1 I(ˆθk))−1I(ˆθk), k ∈[d], (8) where I(ˆθk) is the empirical Fisher information matrix of the local model p(x | ˆθk). Note that this differentiates our method from the typical control variates methods where Bk is instead estimated using empirical covariance between the control variates and the original estimator (in our case, we can not directly estimate the covariance because ˆθKL and eθk are not averages of i.i.d. samples).The procedure of our method is summarized in Algorithm 1. Note that the form of (7) shares some similarity with the one-step estimator in Huang and Huo (2015), but Huang and Huo (2015) focuses on improving the linear averaging estimator, and is different from our setting. We analyze the asymptotic property of the estimator ˆθKL−C, and summarize it as follows. Theorem 3. Under Assumption (1), ˆθKL−C is a consistent estimator of θ∗ KL as n →∞, and its asymptotic MSE is guaranteed to be smaller than the KL-naive estimator ˆθKL, that is, nE∥ˆθKL−C −θ∗ KL∥2 < nE∥ˆθKL −θ∗ KL∥2, as n →∞. In addition, when N > n×d, the ˆθKL−C has “zero-variance” in that E∥ˆθKL−θ∗ KL∥2 = O((dn2)−1). Further, in terms of estimating the true parameter, we have E∥ˆθKL−C −θ∗∥2 = O(N −1 + (dn2)−1). (9) 4 Algorithm 1 KL-Control Variates Method for Combining Local Models 1: Input: Local model parameters {ˆθk}d k=1. 2: Generate bootstrap data {exk j }n j=1 from each p(x|ˆθk), for k ∈[d]. 3: Calculate the KL-Naive estimator, ˆθKL = arg maxθ∈Θ Pd k=1 1 n Pn j=1 log p(exk j |θ). 4: Re-estimate the local parameters eθk via (6) based on the bootstrapped data subset {exk j }n j=1, for k ∈[d]. 5: Estimate the empirical Fisher information matrix I(ˆθk) = 1 n Pn j=1 ∂log p(exk j |ˆθk) ∂θ ∂log p(exk j |ˆθk) ∂θ ⊤ , for k ∈[d]. 6: Ouput: The parameter ˆθKL−C of the combined model is given by (7) and (8). The proof is in Appendix B. From (9), we can see that the MSE between ˆθKL−C and θ∗reduces to O(N −1) as long as n ≳(N/d)1/2, which is a significant improvement over the KL-naive method which requires n ≳N/d. When the goal is to achieve an O(ϵ) MSE, we would just need to take n ≳1/(dϵ)1/2 when N > 1/ϵ, that is, n does not need to increase with N when N is very large. Meanwhile, because ˆθKL−C requires a linear combination of ˆθk, eθk and ˆθKL, it carries the practical drawbacks of the linear averaging estimator as we discuss in Section 2. This motivates us to develop another KL-weighted method shown in the next section, which achieves the same asymptotical efficiency as ˆθKL−C, while still inherits all the practical advantages of KL-averaging. 3.2 KL-Weighted Estimator Our KL-weighted estimator is based on directly modifying the M-estimator for ˆθKL in (4), by assigning each bootstrap data point exk j a positive weight according to the probability ratio p(exk j | ˆθk)/p(exk j | eθk) of the actual local model p(x|ˆθk) and the re-estimated model p(x|eθk) in (6). Here the probability ratio acts like a multiplicative control variate (Nelson, 1987), which has the advantage of being positive and applicable to non-identifiable, non-additive parameters. Our estimator is defined as KL-Weighted Estimator: ˆθKL−W = arg max θ∈Θ  eη(θ) ≡ d X k=1 1 n n X j=1 p(exk j |ˆθk) p(exk j |eθk) log p(exk j |θ)  . (10) We first show that this weighted estimator eη(θ) gives a more accurate estimation of η(θ) in (3) than the straightforward estimator ˆη(θ) defined in (4) for any θ ∈Θ. Lemma 4. As n →∞, eη(θ) is a more accurate estimator of η(θ) than ˆη(θ), in that nVar(eη(θ)) ≤nVar(ˆη(θ)), as n →∞, for any θ ∈Θ. (11) This estimator is motivated by Henmi et al. (2007) in which the same idea is applied to reduce the asymptotic variance in importance sampling. Similar result is also found in Hirano et al. (2003), in which it is shown that a similar weighted estimator with estimated propensity score is more efficient than the estimator using true propensity score in estimating the average treatment effects. Although being a very powerful tool, results of this type seem to be not widely known in machine learning, except several applications in semi-supervised learning (Sokolovska et al., 2008; Kawakita and Kanamori, 2013), and off-policy learning (Li et al., 2015). We go a step further to analyze the asymptotic property of our weighted M-estimator ˆθKL−W that maximizes eη(θ). It is natural to expect that the asymptotic variance of ˆθKL−W is smaller than that of ˆθKL based on maximizing ˆη(θ); this is shown in the following theorem. Theorem 5. Under Assumption 1, ˆθKL−W is a consistent estimator of θ∗ KL as n →∞, and has a better asymptotic variance than ˆθKL, that is, nE∥ˆθKL−W −θ∗ KL∥2 ≤nE∥ˆθKL −θ∗ KL∥2, when n →∞. 5 Algorithm 2 KL-Weighted Method for Combining Local Models 1: Input: Local MLEs {ˆθk}d k=1. 2: Generate bootstrap sample {exk j }n j=1 from each p(x|ˆθk), for k ∈[d]. 3: Re-estimate the local model parameter eθk in (6) based on bootstrap subsample {exk j }n j=1, for each k ∈[d]. 4: Output: The parameter ˆθKL−W of the combined model is given by (10). When N > n × d, we have E∥ˆθKL−W −θ∗ KL∥2 = O((dn2)−1) as n →∞. Further, its MSE for estimating the true parameter θ∗is E∥ˆθKL−W −θ∗∥2 = O(N −1 + (dn2)−1). (12) The proof is in Appendix C. This result is parallel to Theorem 3 for the linear control variates estimator ˆθKL−C. Similarly, it reduces to an O(N −1) rate once we take n ≳(N/d)1/2. Meanwhile, unlike the linear control variates estimator, ˆθKL−W inherits all the practical advantages of KL-averaging: it can be applied whenever the KL-naive estimator can be applied, including for models with non-identifiable parameters, or with different numbers of parameters. The implementation of ˆθKL−W is also much more convenient (see Algorithm 2), since it does not need to calculate the Fisher information matrix as required by Algorithm 1. 4 Empirical Experiments We study the empirical performance of our methods on both simulated and real world datasets. We first numerically verify the convergence rates predicted by our theoretical results using simulated data, and then demonstrate the effectiveness of our methods in a challenging setting when the number of parameters of the local models are different as decided by Bayesian information criterion (BIC). Finally, we conclude our experiments by testing our methods on a set of real world datasets. The models we tested include probabilistic principal components analysis (PPCA), mixture of PPCA and Gaussian Mixtures Models (GMM). GMM is given by p(x | θ) = Pm s=1 αsN(µs, Σs) where θ = (αs, µs, Σs). PPCA model is defined with the help of a hidden variable t, p(x | θ) = R p(x | t; θ)p(t | θ)dt, where p(x | t; θ) = N(x; µ + Wt, σ2), and p(t | θ) = N(t; 0, I) and θ = {µ, W, σ2}. The mixture of PPCA is p(x | θ) = Pm s=1 αsps(x | θs), where θ = {αs, θs}m s=1 and each ps(x | θs) is a PPCA model. Because all these models are latent variable models with unidentifiable parameters, the direct linear averaging method are not applicable. For GMM, it is still possible to use a matched linear averaging which matches the mixture components of the different local models by minimizing a symmetric KL divergence; the same idea can be used on our linear control variates method to make it applicable to GMM. On the other hand, because the parameters of PPCA-based models are unidentifiable up to arbitrary orthonormal transforms, linear averaging and linear control variates can no longer be applied easily. We use expectation maximization (EM) to learn the parameters in all these three models. 4.1 Numerical Verification of the Convergence Rates We start with verifying the convergence rates in (5), (9) and (12) of MSE E||ˆθ −θ∗||2 of the different estimators for estimating the true parameters. Because there is also an non-identifiability problem in calculating the MSE, we again use the symmetric KL divergence to match the mixture components, and evaluate the MSE on WW ⊤to avoid the non-identifiability w.r.t. orthonormal transforms. To verify the convergence rates w.r.t. n, we fix d and let the total dataset N be very large so that N −1 is negligible. Figure 1 shows the results when we vary n, where we can see that the MSE of KL-naive ˆθKL is O(n−1) while that of KL-control ˆθKL−C and KL-weighted ˆθKL−W are O(n−2); both are consistent with our results in (5), (9) and (12). In Figure 2(a), we increase the number d of local machines, while using a fix n and a very large N, and find that both ˆθKL and ˆθKL−W scales as O(d−1) as expected. Note that since the total 6 observation data size N is fixed, the number of data in each local machine is (N/d) and it decreases as we increase d. It is interesting to see that the performance of the KL-based methods actually increases with more partitions; this is, of course, with a cost of increasing the total bootstrap sample size dn as d increases. Figure 2(b) considers a different setting, in which we increase d when fixing the total observation data size N, and the total bootstrap sample size ntot = n × d. According to (5) and (12), the MSEs of ˆθKL and ˆθKL−W should be about O(n−1 tot) and O(dn−2 tot) respectively when N is very large, and this is consistent with the results in Figure 2(b). It is interesting to note that the MSE of ˆθKL is independent with d while that of ˆθKL−W increases linearly with d. This is not conflict with the fact that ˆθKL−W is better than ˆθKL, since we always have d ≤ntot. Figure 2(c) shows the result when we set n = (N/d)α and vary α, where we find that ˆθKL−W quickly converges to the global MLE as α increases, while the KL-naive estimator ˆθKL converges significantly slower. Figure 2(d) demonstrates the case when we increase N while fix d and n, where we see our KL-weighted estimator ˆθKL−W matches closely with N, except when N is very large in which case the O((dn2)−1) term starts to dominate, while KL-naive is much worse. We also find the linear averaging estimator performs poorly, and does not scale with O(N −1) as the theoretical rate claims; this is due to unidentifiable orthonormal transform in the PPCA model that we test on. 100 1000 Bootstrap Size (n) -4 -3 -2 -1 0 Log MSE 100 1000 Bootstrap Size (n) -3 -2 -1 0 1 Log MSE 100 1000 Bootstrap Size (n) -5 -4 -3 -2 -1 Log MSE KL-Naive KL-Control KL-Weighted (a) PPCA (b) Mixture of PPCA (c) GMM Figure 1: Results on different models with simulated data when we change the bootstrap sample size n, with fixed d = 10 and N = 6 × 107. The dimensions of the PPCA models in (a)-(b) are 5, and that of GMM in (c) is 3. The numbers of mixture components in (b)-(c) are 3. Linear averaging and KL-Control are not applicable for the PPCA-based models, and are not shown in (a) and (b). 10 100 1000 d -4 -3 -2 -1 0 Log MSE 200 400 600 800 1000 d -4 -3 -2 -1 Log MSE 0.5 0.6 0.7 0.8 0.9 , -3.5 -3 -2.5 -2 -1.5 -1 -0.5 Log MSE Global MLE Linear KL-Naive KL-Weighted 100000 1e+06 1e+07 N -3 -2 -1 0 Log MSE (a) Fix N and n (b) Fix N and ntot (c) Fix N, n = ( N d )α and d (d) Fix n and d Figure 2: Further experiments on PPCA with simulated data. (a) varying n with fixed N = 5 × 107. (b) varying d with N = 5 × 107, ntot = n × d = 3 × 105. (c) varying α with n = ( N d )α, N = 107 and d. (d) varying N with n = 103 and d = 20. The dimension of data x is 5 and the dimension of latent variables t is 4. 4.2 Gaussian Mixture with Unknown Number of Components We further apply our methods to a more challenging setting for distributed learning of GMM when the number of mixture components is unknown. In this case, we first learn each local model with EM and decide its number of components using BIC selection. Both linear averaging and KL-control ˆθKL−C are not applicable in this setting, and and we only test KL-naive ˆθKL and KL-weighted ˆθKL−W . Since the MSE is also not computable due to the different dimensions, we evaluate ˆθKL and ˆθKL−W using the log-likelihood on a hold-out testing dataset as shown in Figure 3. We can see that ˆθKL−W generally outperforms ˆθKL as we expect, and the relative improvement increases 7 significantly as the dimension of the observation data x increases. This suggests that our variance reduction technique works very efficiently in high dimension problems. 2 4 6 8 N #104 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 Average LL KL-Naive KL-Weighted 2 4 6 8 10 N #104 -7 -6 -5 -4 -3 -2 Average LL 20 40 60 80 100 Dimension of Data -2 -1.5 -1 -0.5 Average LL (a) Dimension of x = 3 (b) Dimension of x = 80 (c) varying the dimension of x Figure 3: GMM with the number of mixture components estimated by BIC. We set n = 600 and the true number of mixtures to be 10 in all the cases. (a)-(b) vary the total data size N when the dimension of x is 3 and 80, respectively. (c) varies the dimension of the data with fixed N = 105. The y-axis is the testing log likelihood compared with that of global MLE. 4.3 Results on Real World Datasets Finally, we apply our methods to several real world datasets, including the SensIT Vehicle dataset on which mixture of PPCA is tested, and the Covertype and Epsilon datasets on which GMM is tested. From Figure 4, we can see that our KL-Weight and KL-Control (when it is applicable) again perform the best. The (matched) linear averaging performs poorly on GMM (Figure 4(b)-(c)), while is not applicable on mixture of PPCA. 1 2 3 4 5 N #104 -7 -6 -5 -4 -3 -2 -1 Average LL 0 5 10 N #104 -4 -3 -2 -1 0 Average LL 0 5 10 N #104 -1 -0.8 -0.6 -0.4 -0.2 0 Average LL Linear-Matched KL-Naive KL-Control KL-Weighted (a) Mixture of PPCA, SensIT Vehicle (b) GMM, Covertype (c) GMM, Epsilon Figure 4: Testing log likelihood (compared with that of global MLE) on real world datasets. (a) Learning Mixture of PPCA on SensIT Vehicle. (b)-(c) Learning GMM on Covertype and Epsilon. The number of local machines is 10 in all the cases, and the number of mixture components are taken to be the number of labels in the datasets. The dimension of latent variables in (a) is 90. For Epsilon, a PCA is first applied and the top 100 principal components are chosen. Linear-matched and KL-Control are not applicable on Mixture of PPCA and are not shown on (a). 5 Conclusion and Discussion We propose two variance reduction techniques for distributed learning of complex probabilistic models, including a KL-weighted estimator that is both statistically efficient and widely applicable for even challenging practical scenarios. Both theoretical and empirical analysis is provided to demonstrate our methods. Future directions include extending our methods to discriminant learning tasks, as well as the more challenging deep generative networks on which the exact MLE is not computable tractable, and surrogate likelihood methods with stochastic gradient descent are need. We note that the same KL-averaging problem also appears in the “knowledge distillation" problem in Bayesian deep neural networks (Korattikara et al., 2015), and it seems that our technique can be applied straightforwardly. Acknowledgement This work is supported in part by NSF CRII 1565796. 8 References 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), 2011. Y. Zhang, M. J. Wainwright, and J. C. Duchi. Communication-efficient algorithms for statistical optimization. In NIPS, 2012. O. Dekel, R. Gilad-Bachrach, O. Shamir, and L. Xiao. Optimal distributed online prediction using mini-batches. In JMLR, 2012. Q. Liu and A. T. Ihler. Distributed estimation, information loss and exponential families. In NIPS, 2014. J. Rosenblatt and B. Nadler. On the optimality of averaging in distributed statistical learning. arXiv preprint arXiv:1407.2724, 2014. Y. Zhang, J. Duchi, M. I. Jordan, and M. J. Wainwright. Information-theoretic lower bounds for distributed statistical estimation with communication constraints. In NIPS, 2013. S. Merugu and J. Ghosh. Privacy-preserving distributed clustering using generative models. In Data Mining, 2003. ICDM 2003. Third IEEE International Conference on, pages 211–218. IEEE, 2003. O. Shamir, N. Srebro, and T. Zhang. Communication efficient distributed optimization using an approximate Newton-type method. In ICML, 2014. C. Huang and X. Huo. A distributed one-step estimator. arXiv preprint arXiv:1511.01443, 2015. J. R. Wilson. Variance reduction techniques for digital simulation. American Journal of Mathematical and Management Sciences, 4, 1984. B. L. Nelson. On control variate estimators. Computers & Operations Research, 14, 1987. M. Henmi, R. Yoshida, and S. Eguchi. Importance sampling via the estimated sampler. Biometrika, 94(4), 2007. K. Hirano, G. W. Imbens, and G. Ridder. Efficient estimation of average treatment effects using the estimated propensity score. Econometrica, 71, 2003. N. Sokolovska, O. Cappé, and F. Yvon. The asymptotics of semi-supervised learning in discriminative probabilistic models. In ICML. ACM, 2008. M. Kawakita and T. Kanamori. Semi-supervised learning with density-ratio estimation. Machine learning, 91, 2013. L. Li, R. Munos, and C. Szepesvári. Toward minimax off-policy value estimation. In AISTATS, 2015. A. Korattikara, V. Rathod, K. Murphy, and M. Welling. Bayesian dark knowledge. arXiv preprint arXiv:1506.04416, 2015. 9
2016
70
6,531
Unsupervised Learning of 3D Structure from Images Danilo Jimenez Rezende* danilor@google.com S. M. Ali Eslami* aeslami@google.com Shakir Mohamed* shakir@google.com Peter Battaglia* peterbattaglia@google.com Max Jaderberg* jaderberg@google.com Nicolas Heess* heess@google.com * Google DeepMind Abstract A key goal of computer vision is to recover the underlying 3D structure that gives rise to 2D observations of the world. If endowed with 3D understanding, agents can abstract away from the complexity of the rendering process to form stable, disentangled representations of scene elements. In this paper we learn strong deep generative models of 3D structures, and recover these structures from 2D images via probabilistic inference. We demonstrate high-quality samples and report log-likelihoods on several datasets, including ShapeNet [2], and establish the first benchmarks in the literature. We also show how these models and their inference networks can be trained jointly, end-to-end, and directly from 2D images without any use of ground-truth 3D labels. This demonstrates for the first time the feasibility of learning to infer 3D representations of the world in a purely unsupervised manner. 1 Introduction We live in a three-dimensional world, yet our observations of it are typically in the form of twodimensional projections that we capture with our eyes or with cameras. A key goal of computer vision is that of recovering the underlying 3D structure that gives rise to these 2D observations. The 2D projection of a scene is a complex function of the attributes and positions of the camera, lights and objects that make up the scene. If endowed with 3D understanding, agents can abstract away from this complexity to form stable, disentangled representations, e.g., recognizing that a chair is a chair whether seen from above or from the side, under different lighting conditions, or under partial occlusion. Moreover, such representations would allow agents to determine downstream properties of these elements more easily and with less training, e.g., enabling intuitive physical reasoning about the stability of the chair, planning a path to approach it, or figuring out how best to pick it up or sit on it. Models of 3D representations also have applications in scene completion, denoising, compression and generative virtual reality. There have been many attempts at performing this kind of reasoning, dating back to the earliest years of the field. Despite this, progress has been slow for several reasons: First, the task is inherently illposed. Objects always appear under self-occlusion, and there are an infinite number of 3D structures that could give rise to a particular 2D observation. The natural way to address this problem is by learning statistical models that recognize which 3D structures are likely and which are not. Second, even when endowed with such a statistical model, inference is intractable. This includes the sub-tasks of mapping image pixels to 3D representations, detecting and establishing correspondences between 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. different images of the same structures, and that of handling the multi-modality of the representations in this 3D space. Third, it is unclear how 3D structures are best represented, e.g., via dense volumes of voxels, via a collection of vertices, edges and faces that define a polyhedral mesh, or some other kind of representation. Finally, ground-truth 3D data is difficult and expensive to collect and therefore datasets have so far been relatively limited in size and scope. 2D input 3D interpretation or Figure 1: Motivation: The 3D representation of a 2D image is ambiguous and multi-modal. We achieve such reasoning by learning a generative model of 3D structures, and recover this structure from 2D images via probabilistic inference. In this paper we introduce a family of generative models of 3D structures and recover these structures from 2D images via probabilistic inference. Learning models of 3D structures directly from pixels has been a long-standing research problem and a number of approaches with different levels of underlying assumptions and feature engineering have been proposed. Traditional approaches to vision as inverse graphics [20, 17, 19] and analysis-by-synthesis [23, 27, 16, 28] rely on heavily engineered visual features with which inference of object properties such as shape and pose is substantially simplified. More recent work [16, 4, 3, 30] addresses some of these limitations by learning parts of the encoding-decoding pipeline depicted in figure 2 in separate stages. Concurrent to our work [10] also develops a generative model of volumetric data based on adversarial methods. We discuss other related work in A.1. Unlike existing approaches, our approach is one of the first to learn 3D representations in an unsupervised, end-to-end manner, directly from 2D images. Our contributions are as follows. (a) We design a strong generative model of 3D structures, defined over the space of volumes and meshes, combining ideas from state-of-the-art generative models of images [7]. (b) We show that our models produce high-quality samples, can effectively capture uncertainty and are amenable to probabilistic inference, allowing for applications in 3D generation and simulation. We report log-likelihoods on a dataset of shape primitives, a 3D version of MNIST, and on ShapeNet [2], which to the best of our knowledge, constitutes the first quantitative benchmark for 3D density modeling. (c) We show how complex inference tasks, e.g., that of inferring plausible 3D structures given a 2D image, can be achieved using conditional training of the models. We demonstrate that such models recover 3D representations in one forward pass of a neural network and they accurately capture the multi-modality of the posterior. (d) We explore both volumetric and mesh-based representations of 3D structure. The latter is achieved by flexible inclusion of off-the-shelf renders such as OpenGL [22]. This allows us to build in further knowledge of the rendering process, e.g., how light bounces of surfaces and interacts with its material’s attributes. (e) We show how the aforementioned models and inference networks can be trained end-to-end directly from 2D images without any use of ground-truth 3D labels. This demonstrates for the first time the feasibility of learning to infer 3D representations of the world in a purely unsupervised manner. 2 Conditional Generative Models In this section we develop our framework for learning models of 3D structure from volumetric data or directly from images. We consider conditional latent variable models, structured as in figure 2 (left). Given an observed volume or image x and a context c, we wish to infer a corresponding 3D representation h (which can be a volume or a mesh). This is achieved by modelling the latent manifold of object shapes and poses via the low-dimensional codes z. The context is any quantity that is always observed at both train- and test-time, and it conditions all computations of inference and generation (see figure 2, middle). In our experiments, context is either 1) nothing, 2) an object class label, or 3) one or more views of the scene from different cameras. Our models employ a generative process which consists of first generating a 3D representation h (figure 2, middle) and then projecting to the domain of the observed data (figure 2, right). For instance, the model will first generate a volume or mesh representation of a scene or object and then render it down using a convolutional network or an OpenGL renderer to form a 2D image. Generative models with latent variables describe probability densities p(x) over datapoints x implicitly through a marginalization of the set of latent variables z, p(x) = R p✓(x|z)p(z)dz. Flexible models can be built by using multiple layers of latent variables, where each layer specifies a conditional distribution parameterized by a deep neural network. Examples of such models include [12, 15, 24]. The marginal likelihood p(x) is intractable and we must resort to approximations. 2 abstract code z volume/mesh representation c inference network 3D structure model training volume x training image x z x x training volume x training image xx x h learned/specified renderer context c z h x c volume/mesh representation observed volume/image observed context abstract code or observed class observed view(s) Figure 2: Proposed framework: Left: Given an observed volume or image x and contextual information c, we wish to infer a corresponding 3D representation h (which can be a volume or a mesh). This is achieved by modeling the latent manifold of object shapes via the low-dimensional codes z. In experiments we will consider unconditional models (i.e., no context), as well as models where the context c is class or one or more 2D views of the scene. Right: We train a contextconditional inference network (red) and object model (green). When ground-truth volumes are available, they can be trained directly. When only ground-truth images are available, a renderer is required to measure the distance between an inferred 3D representation and the ground-truth image. We opt for variational approximations [13], in which we bound the marginal likelihood p(x) by F = Eq(z|x)[log p✓(x|z)] −KL[qφ(z|x)kp(z)], where the true posterior distribution is approximated by a parametric family of posteriors qφ(z|x) with parameters φ. Learning involves joint optimization of the variational parameters φ and model parameters ✓. In this framework, we can think of the generative model as a decoder of the latent variables, and the inference network as an encoder of the observed data into the latent representation. Gradients of F are estimated using path-wise derivative estimators (‘reparameterization trick’) [12, 15]. 2.1 Architectures We build on recent work on sequential generative models [7, 11, 6] by extending them to operate on different 3D representations. This family of models generates the observed data over the course of T computational steps. More precisely, these models operate by sequentially transforming independently generated Gaussian latent variables into refinements of a hidden representation h, which we refer to as the ‘canvas’. The final configuration of the canvas, hT , is then transformed into the target data x (e.g. an image) through a final smooth transformation. In our framework, we refer to the hidden representation hT as the ‘3D representation’ since it will have a special form that is amenable to 3D transformations. This generative process is described by the following equations: Latents zt⇠N(·|0, 1) (1) Encoding et= fread(c, st−1; ✓r) (2) Hidden state st= fstate(st−1, zt, et; ✓s) (3) 3D representation ht= fwrite(st, ht−1; ✓w) (4) 2D projection ˆx = Proj(hT , sT ; ✓p) (5) Observation x ⇠p(x|ˆx). (6) Each step generates an independent set of K-dimensional variables zt (equation 1). We use a fully connected long short-term memory network (LSTM, [8]) as the transition function fstate(st−1, zt, c; ✓s). The context encoder fread(c, st−1; ✓r) is task dependent; we provide further details in section 3. When using a volumetric latent 3D representation, the representation update function fwrite(st, ht−1; ✓w) in equation 4 is parameterized by a volumetric spatial transformer (VST, [9]). More precisely, we set fwrite(st, ht−1; ✓w) = VST(g1(st), g2(st)) where g1 and g2 are MLPs that take the state st and map it to appropriate sizes. More details about the VST are provided in the appendix A.3. When using a mesh 3D representation fwrite is a fully-connected MLP. The function Proj(hT , sT ) is a projection operator from the model’s latent 3D representation hT to the training data’s domain (which in our experiments is either a volume or an image) and plays the role of a ‘renderer’. The conditional density p(x|ˆx) is either a diagonal Gaussian (for real-valued data) or a product of Bernoulli distributions (for binary data). We denote the set of all parameters of this generative model as ✓= {✓r, ✓w, ✓s, ✓p}. Details of the inference model and the variational bound is provided in the appendix A.2. 3 volume (DxHxW) image (1xHxW) image (3xHxW) volume (DxHxW) volume (FxDxHxW) mesh (3xM) camera camera VST 3D conv hT hT hT ˆx ˆx ˆx sT sT Figure 3: Projection operators: These drop-in modules relate a latent 3D representation with the training data. The choice of representation and the type of available training data determine which operator should be used. Left: Volume-to-volume projection (no parameters). Middle: Volumeto-image neural projection (learnable parameters). Right: Mesh-to-image OpenGL projection (no learnable parameters). Here we discuss the projection operators in detail. These drop-in modules relate a latent 3D representation with the training data. The choice of representation (volume or mesh) and the type of available training data (3D or 2D) determine which operator is used. 3D ! 3D projection (identity): In cases where training data is already in the form of volumes (e.g., in medical imagery, volumetrically rendered objects, or videos), we can directly define the likelihood density p(x|ˆx), and the projection operator is simply the identity ˆx = hT function (see figure 3 left). 3D ! 2D neural projection (learned): In most practical applications we only have access to images captured by a camera. Moreover, the camera pose may be unknown or partially known. For these cases, we construct and learn a map from an F-dimensional volume hT to the observed 2D images by combining the VST with 3D and 2D convolutions. When multiple views from different positions are simultaneously observed, the projection operator is simply cloned as many times as there are target views. The parameters of the projection operator are trained jointly with the rest of the model. This operator is depicted in figure 3 (middle). For details see appendix A.4. 3D ! 2D OpenGL projection (fixed): When working with a mesh representation, the projection operator in equation 4 is a complex map from the mesh description h provided by the generative model to the rendered images ˆx. In our experiments we use an off-the-shelf OpenGL renderer and treat it as a black-box with no parameters. This operator is depicted in figure 3 (right). A challenge in working with black-box renderers is that of back-propagating errors from the image to the mesh. This requires either a differentiable renderer [19], or resort to gradient estimation techniques such as finite-differences [5] or Monte Carlo estimators [21, 1]. We opt for a scheme based on REINFORCE [26], details of which are provided in appendix A.5. 3 Experiments We demonstrate the ability of our model to learn and exploit 3D scene representations in five challenging tasks. These tasks establish it as a powerful, robust and scalable model that is able to provide high quality generations of 3D scenes, can robustly be used as a tool for 3D scene completion, can be adapted to provide class-specific or view-specific generations that allow variations in scenes to be explored, can synthesize multiple 2D scenes to form a coherent understanding of a scene, and can operate with complex visual systems such as graphics renderers. We explore four data sets: Necker cubes The Necker cube is a classical psychological test of the human ability for 3D and spatial reasoning. This is the simplest dataset we use and consists of 40 ⇥40 ⇥40 volumes with a 10 ⇥10 ⇥10 wire-frame cube drawn at a random orientation at the center of the volume [25]. Primitives The volumetric primitives are of size 30 ⇥30 ⇥30. Each volume contains a simple solid geometric primitive (e.g., cube, sphere, pyramid, cylinder, capsule or ellipsoid) that undergoes random translations ([0, 20] pixels) and rotations ([−⇡, ⇡] radians). MNIST3D We extended the MNIST dataset [18] to create a 30 ⇥30 ⇥30 volumetric dataset by extruding the MNIST images. The resulting dataset has the same number of images as MNIST. The data is then augmented with random translations ([0, 20] pixels) and rotations ([−⇡, ⇡] radians) that are procedurally applied during training. 4 Figure 4: A generative model of volumes: For each dataset we display 9 samples from the model. The samples are sharp and capture the multi-modality of the data. Left: Primitives (trained with translations and rotations). Middle: MNIST3D (translations and rotations). Right: ShapeNet (trained with rotations only). Videos of these samples can be seen at https://goo.gl/9hCkxs. Necker Primitives MNIST3D Figure 5: Probabilistic volume completion (Necker Cube, Primitives, MNIST3D): Left: Full ground-truth volume. Middle: First few steps of the MCMC chain completing the missing left half of the data volume. Right: 100th iteration of the MCMC chain. Best viewed on a screen. Videos of these samples can be seen at https://goo.gl/9hCkxs. ShapeNet The ShapeNet dataset [2] is a large dataset of 3D meshes of objects. We experiment with a 40-class subset of the dataset, commonly referred to as ShapeNet40. We render each mesh as a binary 30 ⇥30 ⇥30 volume. For all experiments we used LSTMs with 300 hidden neurons and 10 latent variables per generation step. The context encoder fc(c, st−1) was varied for each task. For image inputs we used convolutions and standard spatial transformers, and for volumes we used volumetric convolutions and VSTs. For the class-conditional experiments, the context c is a one-hot encoding of the class. As meshes are much lower-dimensional than volumes, we set the number of steps to be T = 1 when working with this representation. We used the Adam optimizer [14] for all experiments. 3.1 Generating volumes When ground-truth volumes are available we can directly train the model using the identity projection operator (see section 2.1). We explore the performance of our model by training on several datasets. We show in figure 4 that it can capture rich statistics of shapes, translations and rotations across the datasets. For simpler datasets such as Primitives and MNIST3D (figure 4 left, middle), the model learns to produce very sharp samples. Even for the more complex ShapeNet dataset (figure 4 right) its samples show a large diversity of shapes whilst maintaining fine details. 3.2 Probabilistic volume completion and denoising We test the ability of the model to impute missing data in 3D volumes. This is a capability that is often needed to remedy sensor defects that result in missing or corrupt regions, (see for instance [29, 4]). For volume completion, we use an unconditional volumetric model and alternate between inference and generation, feeding the result of one into the other. This procedure simulates a Markov chain and samples from the correct distribution, as we show in appendix A.10. We test the model by occluding half of a volume and completing the missing half. Figure 5 demonstrates that our model successfully completes large missing regions with high precision. More examples are shown in the appendix A.7. 5 Baseline model 350 400 450 500 550 12 24 Generation Steps Bound (nats) 350 400 450 500 550 600 2 6 12 Generation Steps Bound (nats) 800 850 900 950 1000 1050 2 6 12 Generation Steps Bound (nats) Unconditional 1 context view 2 context views 3 context views Figure 6: Quantitative results: Increasing the number of steps or the number of contextual views both lead to improved log-likelihoods. Left: Primitives. Middle: MNIST3D. Right: ShapeNet. 3.3 Conditional volume generation The models can also be trained with context representing the class of the object, allowing for class conditional generation. We train a class-conditional model on ShapeNet and show multiple samples for 10 of the 40 classes in figure 7. The model produces high-quality samples of all classes. We note their sharpness, and that they accurately capture object rotations, and also provide a variety of plausible generations. Samples for all 40 ShapeNet classes are shown in appendix A.8. We also form conditional models using a single view of 2D contexts. Our results, shown in figure 8 indicate that the model generates plausible shapes that match the constraints provided by the context and captures the multi-modality of the posterior. For instance, consider figure 8 (right). The model is conditioned on a single view of an object that has a triangular shape. The model’s three shown samples have greatly varying shape (e.g., one is a cone and the other a pyramid), whilst maintaining the same triangular projection. More examples of these inferences are shown in the appendix A.9. 3.4 Performance benchmarking We quantify the performance of the model by computing likelihood scores, varying the number of conditioning views and the number of inference steps in the model. Figure 6 indicates that the number of generation steps is a very important factor for performance (note that increasing the number of steps does not affect the total number of parameters in the model). Additional context views generally improves the model’s performance but the effect is relatively small. With these experiments we establish the first benchmark of likelihood-bounds on Primitives (unconditional: 500 nats; 3-views: 472 nats), MNIST3D (unconditional: 410 nats; 3-views: 393 nats) and ShapeNet (unconditional: 827 nats; 3-views: 814 nats). As a strong baseline, we have also trained a deterministic 6-layer volumetric convolutional network with Bernoulli likelihoods to generate volumes conditioned on 3 views. The performance of this model is indicated by the red line in figure 6. Our generative model substantially outperforms the baseline for all 3 datasets, even when conditioned on a single view. 3.5 Multi-view training In most practical applications, ground-truth volumes are not available for training. Instead, data is captured as a collection of images (e.g., from a multi-camera rig or a moving robot). To accommodate this fact, we extend the generative model with a projection operator that maps the internal volumetric representation hT to a 2D image ˆx. This map imitates a ‘camera’ in that it first applies an affine transformation to the volumetric representation, and then flattens the result using a convolutional network. The parameters of this projection operator are trained jointly with the rest of the model. Further details are explained in the appendix A.4. In this experiment we train the model to learn to reproduce an image of the object given one or more views of it from fixed camera locations. It is the model’s responsibility to infer the volumetric representation as well as the camera’s position relative to the volume. It is clear to see how the model can ‘cheat’ by generating volumes that lead to good reconstructions but do not capture the underlying 3D structure. We overcome this by reconstructing multiple views from the same volumetric representation and using the context information to fix a reference frame for the internal volume. This enforces a consistent hidden representation that generalises to new views. We train a model that conditions on 3 fixed context views to reproduce 10 simultaneous random views of an object. After training, we can sample a 3D representation given the context, and render it from arbitrary camera angles. We show the model’s ability to perform this kind of inference in figure 6 table vase car laptop airplane bowl person cone Figure 7: Class-conditional samples: Given a one-hot encoding of class as context, the model produces high-quality samples. Notice, for instance, sharpness and variability of generations for ‘chair’, accurate capture of rotations for ‘car’, and even identifiable legs for the ‘person’ class. Videos of these samples can be seen at https://goo.gl/9hCkxs. 9. The resulting network is capable of producing an abstract 3D representation from 2D observations that is amenable to, for instance, arbitrary camera rotations. 3.6 Single-view training Finally, we consider a mesh-based 3D representation and demonstrate the feasibility of training our models with a fully-fledged, black-box renderer in the loop. Such renderers (e.g. OpenGL) accurately capture the relationship between a 3D representation and its 2D rendering out of the box. This image is a complex function of the objects’ colors, materials and textures, positions of lights, and that of other objects. By building this knowledge into the model we give hints for learning and constrain its hidden representation. We consider again the Primitives dataset, however now we only have access to 2D images of the objects at training time. The primitives are textured with a color on each side (which increases the complexity of the data, but also makes it easier to detect the object’s orientation relative to the camera), and are rendered under three lights. We train an unconditional model that given a 2D image, infers the parameters of a 3D mesh and its orientation relative to the camera, such that when textured and rendered reconstructs the image accurately. The inferred mesh is formed by a collection of 162 vertices that can move on fixed lines that spread from the object’s center, and is parameterized by the vertices’ positions on these lines. The results of these experiments are shown in figure 10. We observe that in addition to reconstructing the images accurately (which implies correct inference of mesh and camera), the model correctly infers the extents of the object not in view, as demonstrated by views of the inferred mesh from unobserved camera angles. 4 Discussion In this paper we introduced a powerful family of 3D generative models inspired by recent advances in image modeling. When trained on ground-truth volumes, they can produce high-quality samples that capture the multi-modality of the data. We further showed how common inference tasks, such as that of inferring a posterior over 3D structures given a 2D image, can be performed efficiently via conditional training. We also demonstrated end-to-end training of such models directly from 2D images through the use of differentiable renderers. This demonstrates for the first time the feasibility of learning to infer 3D representations in a purely unsupervised manner. We experimented with two kinds of 3D representations: volumes and meshes. Volumes are flexible and can capture a diverse range of structures, however they introduce modeling and computational challenges due to their high dimensionality. Conversely, meshes can be much lower dimensional and therefore easier to work with, and they are the data-type of choice for common rendering engines, however standard paramaterizations can be restrictive in the range of shapes they can capture. 7 It will be of interest to consider other representation types, such as NURBS, or training with a volume-to-mesh conversion algorithm (e.g., marching cubes) in the loop. c ˆx h r1 r2 c ˆx h r1 r2 Figure 8: Recovering 3D structure from 2D images: The model is trained on volumes, conditioned on c as context. Each row corresponds to an independent sample h from the model given c. We display ˆx, which is h viewed from the same angle as c. Columns r1 and r2 display the inferred 3D representation h from different viewpoints. The model generates plausible, but varying, interpretations, capturing the inherent ambiguity of the problem. Left: MNIST3D. Right: ShapeNet. Videos of these samples can be seen at https://goo.gl/9hCkxs. c1 c2 c3 r1 r2 r3 r4 r5 r6 r7 r8 Figure 9: 3D structure from multiple 2D images: Conditioned on 3 depth images of an object, the model is trained to generate depth images of that object from 10 different views. Left: Context views. Right: Columns r1 through r8 display the inferred abstract 3D representation h rendered from different viewpoints by the learned projection operator. Videos of these samples can be seen at https://goo.gl/9hCkxs. x ˆx r1 r2 r3 x ˆx r1 r2 r3 Figure 10: Unsupervised learning of 3D structure: The model observes x and is trained to reconstruct it using a mesh representation and an OpenGL renderer, resulting in ˆx. We rotate the camera around the inferred mesh to visualize the model’s understanding of 3D shape. We observe that in addition to reconstructing accurately, the model correctly infers the extents of the object not in view, demonstrating true 3D understanding of the scene. Videos of these reconstructions have been included in the supplementary material. Best viewed in color. Videos of these samples can be seen at https://goo.gl/9hCkxs. 8 References [1] Y. Burda, R. Grosse, and R. Salakhutdinov. Importance weighted autoencoders. arXiv preprint:1509.00519, 2015. [2] A. X. Chang, T. Funkhouser, L. Guibas, P. Hanrahan, Q. Huang, Z. Li, S. Savarese, M. Savva, S. Song, H. Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint:1512.03012, 2015. [3] C. B. Choy, D. Xu, J. Gwak, K. Chen, and S. Savarese. 3d-r2n2: An unified approach for single and multi-view 3d object reconstruction. arXiv preprint:1604.00449, 2016. [4] A. Dosovitskiy, J. Tobias Springenberg, and T. Brox. Learning to generate chairs with convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1538–1546, 2015. [5] S. Eslami, N. Heess, T. Weber, Y. Tassa, K. Kavukcuoglu, and G. E. Hinton. Attend, infer, repeat: Fast scene understanding with generative models. preprint:1603.08575, 2016. [6] K. Gregor, F. Besse, D. Jimenez Rezende, I. Danihelka, and D. Wierstra. Towards conceptual compression. arXiv preprint:1604.08772, 2016. [7] K. Gregor, I. Danihelka, A. Graves, D. Jimenez Rezende, and D. Wierstra. Draw: A recurrent neural network for image generation. In ICML, 2015. [8] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [9] M. Jaderberg, K. Simonyan, A. Zisserman, et al. Spatial transformer networks. In NIPS, pages 2008–2016, 2015. [10] W. Jiajun, Z. Chengkai, X. Tianfan, F. William T., and J. Tenenbaum. Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling. arXiv preprint: 1610.07584, 2016. [11] D. Jimenez Rezende, S. Mohamed, I. Danihelka, K. Gregor, and D. Wierstra. One-shot generalization in deep generative models. arXiv preprint:1603.05106, 2016. [12] D. Jimenez Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014. [13] M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999. [14] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [15] D. P. Kingma and M. Welling. Auto-encoding variational bayes. In ICLR, 2014. [16] T. Kulkarni, I. Yildirim, P. Kohli, W. Freiwald, and J. B. Tenenbaum. Deep generative vision as approximate bayesian computation. In NIPS 2014 ABC Workshop, 2014. [17] T. D. Kulkarni, V. K. Mansinghka, P. Kohli, and J. B. Tenenbaum. Inverse graphics with probabilistic cad models. arXiv preprint arXiv:1407.1339, 2014. [18] Y. Lecun and C. Cortes. The MNIST database of handwritten digits. [19] M. M. Loper and M. J. Black. Opendr: An approximate differentiable renderer. In Computer Vision–ECCV 2014, pages 154–169. Springer, 2014. [20] V. Mansinghka, T. D. Kulkarni, Y. N. Perov, and J. Tenenbaum. Approximate bayesian image interpretation using generative probabilistic graphics programs. In NIPS, pages 1520–1528, 2013. [21] A. Mnih and D. Jimenez Rezende. Variational inference for monte carlo objectives. arXiv preprint:1602.06725, 2016. [22] OpenGL Architecture Review Board. OpenGL Reference Manual: The Official Reference Document for OpenGL, Release 1. 1993. [23] L. D. Pero, J. Bowdish, D. Fried, B. Kermgard, E. Hartley, and K. Barnard. Bayesian geometric modeling of indoor scenes. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pages 2719–2726. IEEE, 2012. [24] R. Salakhutdinov and I. Murray. On the quantitative analysis of deep belief networks. In Proceedings of the 25th international conference on Machine learning, pages 872–879, 2008. [25] R. Sundareswara and P. R. Schrater. Perceptual multistability predicted by search model for bayesian decisions. Journal of Vision, 8(5):12–12, 2008. [26] R. J. Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. [27] D. Wingate, N. Goodman, A. Stuhlmueller, and J. M. Siskind. Nonstandard interpretations of probabilistic programs for efficient inference. In NIPS, pages 1152–1160, 2011. [28] 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 NIPS, pages 127–135, 2015. [29] Z. Wu, S. Song, A. Khosla, F. Yu, L. Zhang, X. Tang, and J. Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1912–1920, 2015. [30] T. Zhou, S. Tulsiani, W. Sun, J. Malik, and A. A. Efros. View synthesis by appearance flow. arXiv preprint, May 2016. 9
2016
71
6,532
β-risk: a New Surrogate Risk for Learning from Weakly Labeled Data Valentina Zantedeschi∗ Rémi Emonet Marc Sebban firstname.lastname@univ-st-etienne.fr Univ Lyon, UJM-Saint-Etienne, CNRS, Institut d Optique Graduate School, Laboratoire Hubert Curien UMR 5516, F-42023, SAINT-ETIENNE, France Abstract During the past few years, the machine learning community has paid attention to developing new methods for learning from weakly labeled data. This field covers different settings like semi-supervised learning, learning with label proportions, multi-instance learning, noise-tolerant learning, etc. This paper presents a generic framework to deal with these weakly labeled scenarios. We introduce the β-risk as a generalized formulation of the standard empirical risk based on surrogate marginbased loss functions. This risk allows us to express the reliability on the labels and to derive different kinds of learning algorithms. We specifically focus on SVMs and propose a soft margin β-SVM algorithm which behaves better that the state of the art. 1 Introduction The growing amount of data available nowadays allowed us to increase the confidence in the models induced by machine learning methods. On the other hand, it also caused several issues, especially in supervised classification, regarding the availability of labels and their reliability. Because it may be expensive and tricky to assign a reliable and unique label to each training instance, the data at our disposal for the application at hand are often weakly labeled. Learning from weak supervision has received important attention over the past few years [14, 12]. This research field includes different settings: only a fraction of the labels are known (Semi-Supervised learning [22]); we can access only the proportions of the classes (Learning with Label Proportions [19] and Multi-Instance Learning [8]); the labels are uncertain or noisy (Noise-Tolerant Learning [1, 18, 16]); different discording labels are given to the same instance by different experts (Multi-Expert Learning [21]); labels are completely unknown (Unsupervised Learning [11]). As a consequence of this statement of fact, the data provided in all these situations cannot be fully exploited using supervised techniques, at the risk of drastically reducing the performance of the learned models. To address this issue, numerous machine learning methods have been developed to deal with each of the previous specific situations. However, all these weakly labeled learning tasks share common features mainly relying on the confidence in the labels, opening the door to the development of generic frameworks. Unfortunately, only a few attempts have tried to address several settings with the same approach. The most interesting one has been presented in [14] where the authors propose WELLSVM which is dedicated to deal with three different weakly labeled learning scenarios: semi-supervised learning, multi-instance learning and clustering. However, WELLSVM focuses specifically on Support Vector Machines and it requires to ∗http://vzantedeschi.com/ 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. derive a new optimization problem for each new task. Even though WELLSVM constitutes a step further towards general models, it stopped in midstream constraining the learner to use SVMs. This paper aims to bridge this gap by presenting a generic framework for learning from weakly labeled data. Our approach is based on the derivation of the β-risk , a new surrogate empirical risk defined as a strict generalization of the standard empirical risk relying on surrogate margin-based loss functions. The main interesting property of the β-risk comes from its ability to exploit the information given by the weakly supervised setting and encoded as a β matrix reflecting the supervision on the labels. Moreover, the instance-specific weights β let one integrate in classical methods the side information provided by the setting. This is the peculiarity w.r.t. [18, 16]: in both papers, the proposed losses are defined using class-dependent weights (fixed to 1/2 for the first paper, and dependent on the class noise rate for the latter) while in our approach the used weights are provided for each instance, which gives a more flexible formulation. Making use of this β-risk , we design a generic algorithm devoted to address different kinds of aforementioned weakly labeled settings. To allow a comparison with the state of the art, we instantiate it with a learner that takes the form of an SVM algorithm. In this context, we derive a soft margin β-SVM algorithm and show that it outperforms WELLSVM. The remainder of this paper is organized as follows: in Section 2, we define the empirical surrogate β-risk and show under which conditions it can be used to learn without explicitly accessing the labels; we also show how to instantiate β according to the weakly labeled learning setting at hand; in Section 3, we present our generic iterative algorithm for learning with weakly labeled data and in Section 4 we exploit our new framework to derive a novel formulation of the Support Vector Machine problem, the β-SVM ; finally, we report experiments in semi-supervised learning and learning with label noise, conducted on classical datasets from the UCI repository [15], in order to compare our algorithm with the state of the art approaches. 2 From Classical Surrogate Losses and Surrogate Risks to the β-risk In this section, we first provide reminders about surrogate losses and then exploit the characteristics of the popular loss functions to introduce the empirical surrogate β-risk . The β-risk formulation allows us to tackle the problem of learning with weakly labeled data. We show under which conditions it can be used instead of the standard empirical surrogate risk (defined in a fully supervised context). Those conditions give insight on how to design algorithms that learn from weak supervision. We restrain our study to the context of binary classification. 2.1 Preliminaries In statistical learning, a common approach for choosing the optimal hypothesis h∗from a hypothesis class H is to select the classifier that minimizes the expected risk over the joint space Z = X × Y , where X is the feature space and Y the label space, expressed as Rℓ(h) = Z X×Y ℓ(yh(x))p(x, y)dxdy with ℓ: H × Z →R+ a margin-based loss function. Since the true distribution of the data p(x, y) is usually unknown, machine learning algorithms typically minimize the empirical version of the risk, computed over a finite set S composed of m instances (xi, yi) i.i.d. drawn from a distribution over X × {−1, 1}: Rℓ(S, h) = 1 m m X i=1 ℓ(yih(xi)). The most natural loss function is the so-called 0-1 loss. As this function is not convex, not differentiable and has zero gradient, other loss functions are commonly employed instead. These losses, such as the logistic loss (e.g., for the logistic regression [6]), the exponential loss (e.g., for boosting techniques [10]) and the hinge loss (e.g., for the SVM [7]), are convex and smooth relaxations of the 0-1 loss. Theoretical studies on the characteristics and behavior of such surrogate losses can be found in [17, 2, 20]. In particular, [17] showed that each commonly used surrogate loss can be 2 characterized by a permissible function φ (see below) and rewritten as Fφ(x) Fφ(x) = φ∗(−x) −aφ bφ where φ∗(x) = supa(xa −φ(a)) is the Legendre conjugate of φ (for more details, see [4]), aφ = −φ(0) = −φ(1) ≥0 and bφ = −φ( 1 2) −aφ > 0. As presented by the authors of [13] and [17], a permissible function is a function f : [0, 1] →R−, symmetric about −1 2, differentiable on ]0, 1[ and strictly convex. For instance, the permissible function φlog related to the logistic loss Fφ(x) = log(1 + exp−x) is: φlog(x) = x log(x) + (1 −x) log(1 −x) and aφ = 0 and bφ = log(2). As detailed in [17], considering a surrogate loss Fφ, the empirical surrogate risk of an hypothesis h : X →R w.r.t. S can be expressed as: Rφ(S, h) = 1 m m X i=1 Dφ yi, ∇−1 φ (h(xi))  = bφ m m X i=1 Fφ(yih(xi)) with Dφ the Bregman Divergence Dφ(x, y) = φ(x) −φ(y) −(x −y)∇φ(y). In order to evaluate such risk Rφ(S, h), it is mandatory to provide the labels y for all the instances. In addition, it is not possible to take into account eventual uncertainties on the given labels. Consequently, Rφ is defined in a totally supervised context, where the labels y are known and considered to be true. In order to face the numerous situations where training data may be weakly labeled, we claim that there is a need to fill the gap by defining a new empirical surrogate risk that can deal with such settings. In the following section, we propose a generalization of the empirical surrogate risk, called the empirical surrogate β−risk, which can be employed in the context of weakly labeled data instead of the standard one under some linear conditions on the margin. 2.2 The Empirical Surrogate β-risk Before defining the empirical surrogate β-risk for any loss Fφ and hypothesis h ∈H, let us rewrite the definition of Rφ introducing a new set of variables named β, and that can be laid out as a 2×m matrix. Lemma 2.1. For any S, φ and h, and for any non-negative real coefficients β-1 i and β+1 i defined for each instance xi ∈S such that β-1 i + β+1 i = 1, the empirical surrogate risk Rφ(S, h) can be rewritten as Rφ(S, h) = Rφ(S, h, β) where Rφ(S, h, β) = bφ m m X i=1 X σ∈ {-1,+1} βσ i Fφ(σh(xi)) + 1 m m X i=1 β-yi i (−yih(xi)). The coefficient β+1 i (resp. β-1 i ) for an instance xi can be interpreted here as the degree of confidence in (or the probability of) the label +1 (resp. -1) assigned to xi. 3 Proof. Rφ(S, h) = bφ m m X i=1 Fφ(yih(xi)) = bφ m m X i=1 βyi i Fφ(yih(xi)) + β-yi i Fφ(yih(xi))  (1) = bφ m m X i=1  βyi i Fφ(yih(xi)) + β-yi i  Fφ(−yih(xi)) −yih(xi) bφ  (2) = bφ m m X i=1 X σ∈ {-1,+1} βσ i Fφ(σh(xi)) + 1 m m X i=1 β-yi i (−yih(xi)). (3) Eq. (1) is because β-1 i + β+1 i = 1; Eq. (2) is due to the fact that φ∗(−x) = φ∗(x) −x (see the supplementary material) for any permissible function φ, so that Fφ(x) = φ∗(−x)−aφ bφ = φ∗(x)−aφ−x bφ = Fφ(−x) −x bφ . From Eq. (3), and considering that the sample S is composed by the finite set of features X and labels Y, we can write that Rφ(S, h) = Rφ(S, h, β) = Rβ φ(X, h) −1 m m X i=1 β-yi i yih(xi) (4) where Rβ φ(X, h) = bφ m m X i=1 X σ∈ {-1,+1} βσ i Fφ(σh(xi)) is the empirical surrogate β-risk for a matrix β = [β+1 0 , ..., β+1 m |β-1 0 , ..., β-1 m]. It is worth noticing that Rφ(S, h, β) is expressed in the form of a sum of two terms: the second one takes into account the labels of the data, while the first one, the β-risk, focuses on the loss suffered by h over X without explicitly needing the labels Y. The empirical β-risk is a generalization of the empirical risk: setting βyi i = 1 (and thus β−yi i = 0) for each instance, the second term vanishes and we retrieve the classical formulation of the empirical risk. Additionally, as developed in Section 2.3, the introduction of β makes it possible to inject some side-information about the labels. For this reason, we claim that the β-risk is suited to deal with classification in the context of weakly labeled data. Let us now focus on the conditions allowing the empirical β-risk (i) to be a surrogate of the 0-1 loss-based empirical risk and (ii) to be sufficient to learn with a weak supervision on the labels. From (4), we deduce: Rβ φ(X, h) = Rφ(S, h, β) + 1 m m X i=1 β-yi i yih(xi) ≥R0/1(S, h) + 1 m m X i=1 β-yi i yih(xi) (5) where R0/1(S, h) the empirical risk related to the 0-1 loss and Eq. (5) is because bφFφ(x) ≥F0/1(x) (for any surrogate loss). It is possible to ensure that the β-risk is both a convex upper-bound of the 0-1 loss based risk and a relaxation as tight as the traditional risk (i.e., that we have R0/1(S, h) ≤Rβ φ(X, h) ≤Rφ(S, h)) is to force the following constraint: Pm i=1 β-yi i yih(xi) = 0. Unfortunately, the constraint Pm i=1 β-yi i yih(xi) = 0 still depends on the vector y of labels, which is not always provided and most likely uncertain or inaccurate in a weakly labeled data setting. We will show in Section 3 that this issue can be overcome by means of an iterative 2-step learning procedure, that first learns a classifier minimizing the β-risk , possibly violating the constraint, and then learns a new matrix β that fulfills the constraint. 4 2.3 Instantiating β for Different Weakly Supervised Settings The β-risk can be used as the basis for handling different learning settings, including weakly labeled learning. This can be achieved by fixing the β values, choosing their initial values or putting a prior on them. We have already seen that, fully supervised learning can be obtained by fixing all β values to 1 for the assigned class and to 0 for the opposite class. The current section provides guidance on how β could be instantiated to handle various weakly labeled settings. In a semi-supervised setting, as detailed in the experimental section, we propose to initialize the β of unlabeled points to 0.5 and then to automatically refine them in an iterative process. Going further, and if we are ready to integrate spatial or topological information in the process, the β values of each unlabeled point could be initialized using a density estimation procedure (e.g., by considering the label proportions of the k nearest labeled neighbors). In the context of multi-expert learning, the experts’ votes for each instance i can simply be averaged to produce the βi values (or their initialization, or a prior). The case of learning with label proportions is especially useful for privacy-preserving data processing: the training points are grouped into bags and, for each bag, the proportion of labels are given. One way of handling such supervision is to initialize, for each bag, all the β with the same value that corresponds to the provided proportion of labels. Noise-tolerant learning aims at learning in the presence of label noise, where labels are given but can be wrong. For any point that can be possibly noisy, a direct approach is to use lower β values (instead of 1 in the supervised case) and refine them as in the semi-supervised setting. β can also be initialized using the label proportion of the k nearest labeled example (as done in the experimental section). The case of Multiple Instance Learning (MIL) is trickier: in a typical MIL setting, instances are grouped in bags and the supervision is given as a single label per bag that is positive if the bag contains at least one positive instance (negative bags contain only negative instances). A straightforward solution would be to recast the MIL supervision as a “learning with label proportion” (e.g., considering exactly one positive instance in each bag). It is not fully satisfying and a more promising solution would be to consider, within each bag, the set of β+1 variables and put a sparsity-inducing prior on them. This approach would be a less-constrained version of the relaxation proposed in WellSVM [14] (where it is supposed that there is exactly one positive instance per positive bag) and could be achieved by a l1 penalty or using a Dirichlet prior (with low α to promote sparsity). 3 An Iterative Algorithm for Weakly-labeled Learning As explained in Section 2, a sufficient condition for guaranteeing that the β-risk is a convex upper-bound of the 0-1 loss based risk and it is not worse than the traditional risk is to fix Pm i=1 β-yi i yih(xi) = 0. However, the previous constraint depends on the labels. We overcome this problem by (i) iteratively learning a classifier minimizing the β-risk and most likely violating the constraint and then (ii) learning a new matrix β that fulfills it. The algorithm is generic. It can be used in different weakly labeled settings and can be instantiated with different losses and regularizations, as we will do in the next Section with SVMs. As the process is iterative, let tβ be the estimation of β at iteration t. At each iteration, our algorithm consists in two steps. We first learn an hypothesis h for the following problem P1: ht+1 = P1(X, tβ) = arg min h cR tβ φ (X, h) + N(h) which boils down to minimizing the N-regularized empirical surrogate β-risk over the training sample X of size m, where N, for instance, can take the form of a L1 or a L2 norm. Then, we find the optimal β of the following problem P2 for the points of X: t+1β = P2(X, ht+1) = arg min β Rβ φ(X, ht+1) s.t. m X i=1 β-yi i (−yi ht+1(xi)) = 0 β-1 i + β+1 i = 1, β-1 i ≥0, β+1 i ≥0 ∀i = 1..m . For this step, a vector of labels is required. We choose to re-estimate it at each iteration according to the current value of β: we affect to an instance the most probable label, i.e. the σ corresponding 5 to the biggest βσ. The matrix β has to be initialized at the beginning of the algorithm according to the problem setting (see Section 2.3). While some stabilization criterion does not exceed a given threshold ϵ, the two steps are repeated. 4 Soft-margin β-SVM A major advantage of the empirical surrogate β-risk is that it can be plugged in numerous learning settings without radically modifying the original formulations. As an example, in this section we derive a new version of the Support Vector Machine problem, using the empirical surrogate β-risk , that takes into account the knowledge provided for each training instance (through the matrix β). The soft-margin β-SVM optimization problem is a direct generalization of a standard soft-margin SVM and is defined as follows: arg min θ 1 2 ∥θ∥2 2 + c m X i=1 β-1 i ξ-1 i + β+1 i ξ+1 i  s.t. σ(θT µ(xi) + b) ≥1 −ξσ i ∀i = 1..m, σ ∈{−1, 1} ξσ i ≥0 ∀i = 1..m, σ ∈{−1, 1} where θ ∈X′ is the vector defining the margin hyperplane and b its offset, µ : X →X′ a mapping function and c ∈R a tuned hyper-parameter. In the rest of the paper, we will refer to K : X ×X →R as the kernel function corresponding to µ, i.e. K(xi, xj) = µ(xi)µ(xj). The corresponding Lagrangian dual problem is given by (the complete derivation is provided in the supplementary material): max α −1 2 m X i=1 X σ∈ {-1,+1} m X j=1 X σ′∈ {-1,+1} ασ i σασ j σ′K(xi, xj) + m X i=1 X σ∈ {-1,+1} ασ i s.t. 0 ≤ασ i ≤cβσ i ∀i = 1..m, σ ∈{−1, 1} m X i=1 X σ∈ {-1,+1} ασ i σ = 0 ∀i = 1..m, σ ∈{−1, 1} which is concave w.r.t. α as for the standard SVM. The β-SVM formulation differs from the SVM one in two points: first, the number of Lagrangian multipliers is doubled, because we consider both positive and negative labels for each instance; second, the upper-bounds for α are not the same for all instances but depend on the given matrix β. Like the coefficient c in the classical formulation of SVM, those upper-bounds play the role of trade-off between under-fitting and over-fitting: the smaller they are, the more robust to outliers the learner is but the less it adapts to the data. It is then logical that the upper-bound for an instance i depends on βσ i because it reflects the reliability on the label σ for that instance: if the label σ is unlikely, its corresponding ασ i will be constrained to be null (and its adversary will have more chance to be selected as a support vector, as βσ i + β −σ i = 1). Also, those points for which no label is more probable than the other (βσ i →0.5) will have less importance in the learning process compared to those for which a label is almost certain. In order to fully exploit the advantages of our formulation, c has to be finite and bigger than 0. As a matter of fact, when c →∞or c →0, the constraints become exactly those of the original formulation. 5 Experimental Results In the first part of this section, we present some experimental results obtained by adapting the iterative algorithm presented in Section 3 for semi-supervised learning and combining it with the previously derived β-SVM . Note that some approaches based on SVMs have been already presented in the literature to address the problem of semi-supervised learning. Among them, TransductiveSVM [5] 6 iteratively learns a separator with the labeled instances, classifies a subset of the unlabeled instances and adds it to the training set. On the other hand, WellSVM [14] combines the classical SVM with a label generation strategy that allows one to learn the optimal separator, even when the training sample is not completely labeled, by convexly relaxing the original Mixed-Integer Programming problem. In [14], WellSVM has been shown to be very effective and better than TransductiveSVM and the state of the art. For this reason, we compare in this section β-SVM to WellSVM. In the second subsection, we present some preliminary results in the noise-tolerant learning setting, showing how β-SVM behaves when facing data with label noise. 5.1 Iterative β-SVM for semi-supervised learning We compare our method’s performances to those of WellSVM, that has been proved, in [14], to performs in average better than the state of the art semi-supervised learning methods based on SVM and the standard SVM as well. In a semi-supervised context, a set Xl of labeled instances of size ml and a set Xu of unlabeled instances of size mu are provided. The matrix β is initialized as follows: ∀i = 1..ml and ∀σ in {−1, 1}, 0βσ i = 1 if σ = yi, 0 otherwise, ∀i = ml+1..mu and ∀σ in {−1, 1}, 0βσ i = 0.5 and we learn an optimal separator: ht+1 = P1(Xl ∪Xu, tβ) = arg min h c1R tβ φ (Xl, h) + c2R tβ φ (Xu, h) + N(h). Here c1 and c2 are balance constants between the labeled and unlabeled set: when the number of unlabeled instances become greater than the number of labeled instances, we need to reduce the importance of the unlabeled set in the learning procedure because there exists the risk that the labeled set will be ignored. We consider the provided labels to be correct, so we keep the corresponding lβ fixed during the iterations of the algorithm and estimate uβ by optimizing P2(Xu, ht+1). The iterative algorithm with β-SVM is implemented in Python using Cvxopt (for optimizing β-SVM ) and Cvxpy 2 with its Ecos solver [9]. For each dataset, we show in Figure 1 the accuracy of the two methods with an increasing proportion of labeled data. The different approaches are compared on the same kernel, either the linear or the gaussian, the one that gives higher overall accuracy. As a matter of fact, the choice of the kernel depends on the geometry of the data, not on the learning method. For each proportion of labeled data, we perform a 4-fold cross-validation and we show the average accuracy over 10 iterations. Concerning the hyper-parameters of the different methods, we fix c2 of β-SVM to c1 ml m , c1 of WellSVM to 1 as explained in [14] and all the other hyper-parameters (c1 for β-SVM and c2 for WellSVM) are tuned by cross-validation through grid search. As for the stopping criteria, we fix ϵ of β-SVM to 10−5 + 10−3∥h∥F and ϵ of WellSVM to 10−3 and the maximal number of iterations to 20 for both methods. When using the gaussian kernel, the γ in K(xi, xj) = exp(−∥xi −xj∥2 2/γ) is fixed to the mean distance between instances. Our method performs better than WellSVM, with few exceptions, and is more efficient in terms of CPU time: for the Australian dataset, the biggest dataset in number of features and instances, WellSVM is in average 30 times slower than our algorithm (without particular optimization efforts). 5.2 Preliminary results under label-noise We quickly tackle another setting of the weakly labeled data field: the noise-tolerant learning, the task of learning from data that have noisy or uncertain labels. It has been shown in [3] that SVM learning is extremely sensitive to outliers, especially the ones lying next to the boundary. We study, the sensitivity of β-SVM to label noise artificially introduced on the Ionosphere dataset. We consider two initialization strategies for β: the standard on where βyi = 1 and β−yi = 0 and the 4-nn one where βσ is set to the proportion of neighboring instances with label σ. In Figure 2, we draw the mean accuracy over 4 repetitions w.r.t. an increasing percentage (as a proportion of the smallest dataset) of two kinds of noise: the symmetric noise, introduced by swapping the labels of instances belonging to different classes, and the asymmetric noise, introduced by gradually changing the labels of the 2http://cvxopt.org/ and http://www.cvxpy.org/ 7 5 10 15 20 0.75 0.8 0.85 (a) Ionosphere, gaussian kernel. 5 10 15 20 0.7 0.75 0.8 (b) Heart-statlog, linear kernel. 5 10 15 20 0.55 0.6 0.65 (c) Liver, linear kernel. 5 10 15 20 0.7 0.75 0.8 (d) Australian, gaussian kernel. 5 10 15 20 0.65 0.7 0.75 (e) Pima, linear kernel. 5 10 15 20 0.6 0.65 (f) Sonar, linear kernel. 5 10 15 20 0.5 0.55 0.6 0.65 WellSVM betaSVM (g) Splice, gaussian kernel. Figure 1: Comparison of the mean accuracies of WellSVM and β-SVM versus the percentage of labeled data on different UCI datasets. 10 20 30 40 50 0.75 0.8 0.85 (a) Symmetric Noise. 10 20 30 40 50 0.75 0.8 0.85 standard 4-nn (b) Asymmetric Noise. Figure 2: Comparison of the mean accuracy versus the percentage of noise of iterative β-SVM with different initializations of β. The standard curve refers to the initialization of βyi = 1 and β−yi = 0 and the 4-nn to the initialization of βσ to the proportion of neighboring instances with label σ. instances of one class. These preliminary results are encouraging and show that locally estimating the conditional class density to initialize the β matrix improves the robustness of our method to label noise. 6 Conclusion This paper focuses on the problem of learning from weakly labeled data. We introduced the βrisk which generalizes the standard empirical risk while allowing the integration of weak supervision. From the expression of the β-risk , we derived a generic algorithm for weakly labeled data and specialized it in an SVM-like context. The resulting β-SVM algorithm has been applied in two different weakly labeled settings, namely semi-supervised learning and learning with label noise, showing the advantages of the approach. The perspectives of this work are numerous and of two main kinds: covering new weakly labeled settings and studying theoretical guarantees. As proposed in Section 2.3, the β-risk can be used in various weakly labeled scenarios. This requires to use different strategies for the initialization and the refinement of β, and also to propose proper priors for these parameters. Generalizing the proposed β-risk to a multi-class setting is a natural extension as β is already a matrix of class probabilities. Another broad direction involves deriving robustness and convergence bounds for the algorithms built on the β-risk . 7 Acknowledgments We thank the reviewers for their valuable remarks. We also thank the ANR projects SOLSTICE (ANR-13-BS02-01) and LIVES (ANR-15-CE230026-03). 8 References [1] D. Angluin and P. Laird. Learning from noisy examples. Machine Learning, 2(4):343–370, 1988. [2] S. Ben-David, D. Loker, N. Srebro, and K. Sridharan. Minimizing the misclassification error rate using a surrogate convex loss. In Proceedings of the 29th International Conference on Machine Learning, ICML. icml.cc / Omnipress, 2012. [3] B. E. Boser, I. M. Guyon, and V. N. Vapnik. A training algorithm for optimal margin classifiers. In Proceedings of the fifth annual workshop on Computational learning theory, pages 144–152. ACM, 1992. [4] S. Boyd and L. Vandenberghe. Convex optimization. Cambridge university press, 2004. [5] L. Bruzzone, M. Chi, and M. Marconcini. A novel transductive svm for semisupervised classification of remote-sensing images. Geoscience and Remote Sensing, IEEE Transactions on, 44(11):3363–3373, 2006. [6] M. Collins, R. E. Schapire, and Y. Singer. Logistic regression, adaboost and bregman distances. Machine Learning, 48(1-3):253–285, 2002. [7] C. Cortes and V. Vapnik. Support-vector networks. Machine learning, 20(3):273–297, 1995. [8] T. G. Dietterich, R. H. Lathrop, and T. Lozano-Pérez. Solving the multiple instance problem with axis-parallel rectangles. Artificial intelligence, 89(1):31–71, 1997. [9] A. Domahidi, E. Chu, and S. Boyd. Ecos: An socp solver for embedded systems. In Control Conference (ECC), 2013 European, pages 3071–3076. IEEE, 2013. [10] Y. Freund, R. E. Schapire, et al. Experiments with a new boosting algorithm. In ICML, volume 96, pages 148–156, 1996. [11] T. Hastie, R. Tibshirani, and J. Friedman. Unsupervised learning. Springer, 2009. [12] A. Joulin and F. Bach. A convex relaxation for weakly supervised classifiers. arXiv preprint arXiv:1206.6413, 2012. [13] M. Kearns and Y. Mansour. On the boosting ability of top-down decision tree learning algorithms. In Proceedings of the twenty-eighth annual ACM symposium on Theory of computing, pages 459–468. ACM, 1996. [14] Y.-F. Li, I. W. Tsang, J. T. Kwok, and Z.-H. Zhou. Convex and scalable weakly labeled svms. The Journal of Machine Learning Research, 14(1):2151–2188, 2013. [15] M. Lichman. UCI machine learning repository, 2013. [16] N. Natarajan, I. S. Dhillon, P. K. Ravikumar, and A. Tewari. Learning with noisy labels. In Advances in neural information processing systems, pages 1196–1204, 2013. [17] R. Nock and F. Nielsen. Bregman divergences and surrogates for learning. IEEE Transactions on Pattern Analysis and Machine Intelligence, 31(11):2048–2059, 2009. [18] G. Patrini, F. Nielsen, R. Nock, and M. Carioni. Loss factorization, weakly supervised learning and label noise robustness. arXiv preprint arXiv:1602.02450, 2016. [19] G. Patrini, R. Nock, T. Caetano, and P. Rivera. (almost) no label no cry. In Advances in Neural Information Processing Systems, pages 190–198, 2014. [20] L. Rosasco, E. De Vito, A. Caponnetto, M. Piana, and A. Verri. Are loss functions all the same? Neural Computation, 16(5):1063–1076, 2004. [21] V. S. Sheng, F. Provost, and P. G. Ipeirotis. Get another label? improving data quality and data mining using multiple, noisy labelers. In Proceedings of the 14th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 614–622. ACM, 2008. [22] X. Zhu. Semi-supervised learning literature survey. Technical Report 1530, Computer Sciences, University of Wisconsin-Madison, 2005. 9
2016
72
6,533
Learning Supervised PageRank with Gradient-Based and Gradient-Free Optimization Methods Lev Bogolubsky1,2, Gleb Gusev1,5, Andrei Raigorodskii5,2,1,8, Aleksey Tikhonov1, Maksim Zhukovskii1,5 Yandex1, Moscow State University2, Buryat State University8 {bogolubsky, gleb57, raigorodsky, altsoph, zhukmax}@yandex-team.ru Pavel Dvurechensky3,4, Alexander Gasnikov4,5 Weierstrass Institute3, Institute for Information Transmission Problems RAS4, Moscow Institute of Physics and Technology5 pavel.dvurechensky@wias-berlin.de, gasnikov@yandex.ru Yurii Nesterov6,7 Center for Operations Research and Econometrics6, Higher School of Economics7 yurii.nesterov@uclouvain.be Abstract In this paper, we consider a non-convex loss-minimization problem of learning Supervised PageRank models, which can account for features of nodes and edges. We propose gradient-based and random gradient-free methods to solve this problem. Our algorithms are based on the concept of an inexact oracle and unlike the state-ofthe-art gradient-based method we manage to provide theoretically the convergence rate guarantees for both of them. Finally, we compare the performance of the proposed optimization methods with the state of the art applied to a ranking task. 1 INTRODUCTION The most acknowledged methods of measuring importance of nodes in graphs are based on random walk models. Particularly, PageRank [18], HITS [11], and their variants [8, 9, 19] are originally based on a discrete-time Markov random walk on a link graph. Despite undeniable advantages of PageRank and its mentioned modifications, these algorithms miss important aspects of the graph that are not described by its structure. In contrast, a number of approaches allows to account for different properties of nodes and edges between them by encoding them in restart and transition probabilities (see [3, 4, 6, 10, 12, 20, 21]). These properties may include, e.g., the statistics about users’ interactions with the nodes (in web graphs [12] or graphs of social networks [2]), types of edges (such as URL redirecting in web graphs [20]) or histories of nodes’ and edges’ changes [22]. In the general ranking framework called Supervised PageRank [21], weights of nodes and edges in a graph are linear combinations of their features with coefficients as the model parameters. The existing optimization method [21] of learning these parameters and the optimizations methods proposed in the presented paper have two levels. On the lower level, the following problem is solved: to estimate the value of the loss function (in the case of zero-order oracle) and its derivatives (in the case of first-order oracle) for a given parameter vector. On the upper level, the estimations obtained on the lower level of the optimization methods (which we also call inexact oracle information) are used for tuning the parameters by an iterative algorithm. Following [6], the authors of Supervised PageRank consider a non-convex loss-minimization problem for learning the parameters and solve 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. it by a two-level gradient-based method. On the lower level of this algorithm, an estimation of the stationary distribution of the considered Markov random walk is obtained by classical power method and estimations of derivatives w.r.t. the parameters of the random walk are obtained by power method introduced in [23, 24]. On the upper level, the obtained gradient of the stationary distribution is exploited by the gradient descent algorithm. As both power methods give imprecise values of the stationary distribution and its derivatives, there was no proof of the convergence of the state-of-the-art gradient-based method to a stationary point. The considered non-convex loss-minimization problem [21] can not be solved by existing optimization methods such as [16] and [7] due to presence of constraints for parameter vector and the impossibility to calculate the exact value of the loss function. Moreover, standard global optimization methods can not be applied, because they require unbiased estimations of the loss function. In our paper, we propose two two-level methods to solve the problem [21]. On the lower level of these methods, we use the linearly convergent method [17] to calculate an approximation to the stationary distribution of Markov random walk. We show that this method allows to approximate the value of the loss function at any given accuracy and has the lowest proved complexity bound among methods proposed in [5]. We develop a gradient method for general constrained non-convex optimization problems with inexact oracle, estimate its convergence rate to the stationary point of the problem. We exploit this gradient method on the upper level of the two-level algorithm for learning Supervised PageRank. Our contribution to the gradient-free methods framework consists in adapting the approach of [16] to the case of constrained optimization problems when the value of the function is calculated with some known accuracy. We prove a convergence theorem for this method and exploit it on the upper level of the second two-level algorithm. Another contribution consists in investigating both for the gradient and gradient-free methods the trade-off between the accuracy of the lower-level algorithm, which is controlled by the number of iterations of method in [17] and its generalization (for derivatives estimation), and the computational complexity of the two-level algorithm as a whole. Finally, we estimate the complexity of the whole two-level algorithms for solving the loss-minimization problem with a given accuracy. In the experiments, we apply our algorithms to learning Supervised PageRank on a real ranking task. Summing up, both two-level methods, unlike the state-of-the-art [21], have theoretical guarantees on convergence rate, and outperform it in the ranking quality in experiments. The main advantages of the first gradient-based algorithm: the guarantees of a convergence do not require the convexity, this algorithm has less input parameters than gradient-free one. The main advantage of the second gradient-free algorithm is that it avoids calculating the derivative for each element of a large matrix. 2 MODEL DESCRIPTION We concider the following random walk on a directed graph Γ = (V, E) introduced in [21]. Assume that each node i ∈V and each edge i →j ∈E is represented by a vector of features Vi ∈Rm1 + and a vector of features Eij ∈Rm2 + respectively. A surfer starts from a random page v0 of a seed set U ⊂V . The restart probability that v0 = i equals [π0]i = ⟨ϕ1, Vi⟩ P l∈U⟨ϕ1, Vl⟩, i ∈U (2.1) and [π0]i = 0 for i ∈V \ U, where ϕ1 ∈Rm1 is a parameter, which conducts the random walk. We assume that P l∈U⟨ϕ1, Vl⟩should be non-zero. At each step, the surfer makes a restart with probability α ∈(0, 1) (originally [18], α = 0.15) or traverses an outgoing edge (makes a transition) with probability 1 −α. In the former case, the surfer chooses a vertex according to the distribution π0. In the latter one, the transition probability of traversing an edge i →j ∈E is [P]i,j = ⟨ϕ2, Eij⟩ P l:i→l⟨ϕ2, Eil⟩, (2.2) where ϕ2 ∈Rm2 is a parameter and the current position i has non-zero outdegree, and [P(ϕ)]i,j = [π0(ϕ)]j for all j ∈V if the outdegree of i is zero (thus the surfer always makes a restart in this case). We assume that P l:i→l⟨ϕ2, Eil⟩is non-zero for all i with non-zero outdegree. 2 By Equations 2.1 and 2.2, the total probability of choosing vertex j ∈V conditioned by the surfer being at vertex i equals α[π0(ϕ)]j + (1 −α)[P(ϕ)]i,j, where ϕ = (ϕ1, ϕ2)T and we use π0(ϕ) and P(ϕ) to express the dependence of π0, P on the parameters. The stationary distribution π(ϕ) ∈Rp of the described Markov process is a solution of the system π = απ0(ϕ) + (1 −α)P T (ϕ)π. (2.3) In this paper, we learn an algorithm, which ranks nodes i according to scores [π(ϕ)]i. Let Q be a set of queries and a set of nodes Vq ⊂V is associated to each query q. For example, vertices in Vq may represent web pages visited by users after submitting query q. For each q ∈Q, some nodes of Vq are manually judged by relevance labels 1, . . . , ℓ. Our goal is to learn the parameter vector ϕ of a ranking algorithm πq = πq(ϕ) which minimizes the discrepancy of its ranking scores [πq]i, i ∈Vq, from the the assigned labels. We consider the square loss function [12, 21, 22] f(ϕ) = 1 |Q| |Q| X q=1 ∥(Aqπq(ϕ))+∥2 2. (2.4) Each row of matrix Aq ∈Rrq×pq corresponds to some pair of pages i1, i2 ∈Vq such that the label of i1 is strictly greater than the label of i2 (we denote by rq the number of all such pairs from Vq and pq := |Vq|). The i1-th element of this row is equal to −1, i2-th element is equal to 1, and all other elements are equal to 0. Vector x+ has components [x+]i = max{xi, 0}. To make ranking scores (2.3) query–dependent, we assume that π is defined on a query–dependent graph Γq = (Vq, Eq) with query-dependent feature vectors Vq i , i ∈Vq, Eq ij, i →j ∈Eq. For example, these features may reflect different aspects of query–page relevance. For a given q ∈Q, we consider all the objects related to the graph Γq introduced above: Uq := U, π0 q := π0, Pq := P, πq := π. In this way, the ranking scores πq depend on query via the query–dependent features, but the parameters of the model α and ϕ are not query–dependent. In what follows, we use the following notations throughout the paper: nq := |Uq|, m = m1 + m2, r = maxq∈Q rq, p = maxq∈Q pq, n = maxq∈Q nq, s = maxq∈Q sq, where sq = maxi∈Vq |{j : i →j ∈Eq}|. In order to guarantee that the probabilities in (2.1) and (2.2) are correctly defined, we need to appropriately choose a set Φ of possible values of parameters ϕ. We choose some ˆϕ and R > 0 such that Φ = {ϕ ∈Rm : ∥ϕ −ˆϕ∥2 ≤R} lies in the set of vectors with positive components Rm ++ 1. In this paper, we solve the following loss-minimization problem: min ϕ∈Φ f(ϕ), Φ = {ϕ ∈Rm : ∥ϕ −ˆϕ∥2 ≤R}. (2.5) 3 NUMERICAL CALCULATION OF f(ϕ) AND ∇f(ϕ) Our goal is to provide methods for solving Problem 2.5 with guarantees on rate of convergence and complexity bounds. The calculation of the values of f(ϕ) and its gradient ∇f(ϕ) is problematic, since it requires to calculate those for |Q| vectors πq(ϕ) defined by Equation 2.3. While the exact values are impossible to derive in general, existing methods provide estimations of πq(ϕ) and its derivatives dπq(ϕ) dϕT in an iterative way with a trade-off between time and accuracy. To be able to guarantee convergence of our optimization algorithm in this inexact oracle setting, we consider numerical methods that calculate approximation for πq(ϕ) and its derivatives with any required accuracy. We have analysed state-of-the-art methods summarized in the review [5] and power method used in [18, 2, 21] and have found that the method [17] is the most suitable. It constructs a sequence πk and outputs ˜πq(ϕ, N) by the following rule (integer N > 0 is a parameter): π0 = π0 q(ϕ), πk+1 = P T q (ϕ)πk, ˜πq(ϕ, N) = α 1 −(1 −α)N+1 N X k=0 (1 −α)kπk. (3.1) 1As probablities [π0 q(ϕ)]i, i ∈Vq, [Pq(ϕ)]˜i,i,˜i →i ∈Eq, are scale-invariant (π0 q(λϕ) = π0 q(ϕ), Pq(λϕ) = Pq(ϕ)), in our experiments, we consider the set Φ = {ϕ ∈Rm : ∥ϕ −em∥2 ≤0.99} , where em ∈Rm is the vector of all ones, that has large intersection with the simplex {ϕ ∈Rm ++ : ∥ϕ∥1 = 1} 3 Lemma 1. Assume that, for some δ1 > 0, Method 3.1 with N = l 1 α ln 8r δ1 m −1 is used to calculate the vector ˜πq(ϕ, N) for every q ∈Q. Then ˜f(ϕ, δ1) = 1 |Q| P|Q| q=1 ∥(Aq˜πq(ϕ, N))+∥2 2 satisfies | ˜f(ϕ, δ1) −f(ϕ)| ≤δ1. Moreover, the calculation of ˜f(ϕ, δ1) requires not more than |Q|(3mps + 3psN + 6r) a.o. The proof of Lemma 1 is in Supplementary Materials. Let pi(ϕ) be the i-th column of the matrix P T q (ϕ). Our generalization of the method [17] for calculation of dπq(ϕ) dϕT for any q ∈Q is the following. Choose some non-negative integer N1 and calculate ˜πq(ϕ, N1) using (3.1). Choose some N2 ≥0, calculate Πk, k = 0, ..., N2 and ˜Πq(ϕ, N2) Π0 = αdπ0 q(ϕ) dϕT + (1 −α) pq X i=1 dpi(ϕ) dϕT [˜πq(ϕ, N1)]i, Πk+1 = P T q (ϕ)Πk, (3.2) ˜Πq(ϕ, N2) = 1 1 −(1 −α)N2+1 N2 X k=0 (1 −α)kΠk. (3.3) In what follows, we use the following norm on the space of matrices A ∈Rn1×n2: ∥A∥1 = maxj=1,...,n2 Pn1 i=1 |aij|. Lemma 2. Let β1 be some explicitly computable constant (see Supplementary Materials). Assume that Method 3.1 with N1 = l 1 α ln 24β1r αδ2 m −1 is used for every q ∈Q to calculate the vector ˜πq(ϕ, N1) and Method 3.2, 3.3 with N2 = l 1 α ln 8β1r αδ2 m −1 is used for every q ∈Q to calculate the matrix ˜Πq(ϕ, N2) (3.3). Then the vector ˜g(ϕ, δ2) = 2 |Q| P|Q| q=1  ˜Πq(ϕ, N2) T AT q (Aq˜πq(ϕ, N1))+ satisfies ∥˜g(ϕ, δ2) −∇f(ϕ)∥∞≤δ2. Moreover, the calculation of ˜g(ϕ, δ2) requires not more than |Q|(10mps + 3psN1 + 3mpsN2 + 7r) a.o. The proof of Lemma 2 can be found in Supplementary Materials. 4 RANDOM GRADIENT-FREE OPTIMIZATION METHODS In this section, we first describe general framework of random gradient-free methods with inexact oracle and then apply it for Problem 2.5. Lemma 1 allows to control the accuracy of the inexact zero-order oracle and hence apply random gradient-free methods with inexact oracle. 4.1 GENERAL FRAMEWORK Below we extend the framework of random gradient-free methods [1, 16, 7] for the situation of presence of uniformly bounded error of unknown nature in the value of an objective function in general optimization problem. Unlike [16], we consider a constrained optimization problem and a randomization on a Euclidean sphere which seems to give better large deviations bounds and doesn’t need the assumption that the objective function can be calculated at any point of Rm. Let E be a m-dimensional vector space and E∗be its dual. In this subsection, we consider a general function f(·) : E →R and denote its argument by x or y to avoid confusion with other sections. We denote the value of linear function g ∈E∗at x ∈E by ⟨g, x⟩. We choose some norm ∥· ∥in E and say that f ∈C1,1 L (∥·∥) iff |f(x)−f(y)−⟨∇f(y), x−y⟩| ≤L 2 ∥x−y∥2, ∀x, y ∈E. The problem of our interest is to find minx∈X f(x), where f ∈C1,1 L (∥· ∥), X is a closed convex set and there exists a number D ∈(0, +∞) such that diamX := maxx,y∈X ∥x −y∥≤D. Also we assume that the inexact zero-order oracle for f(x) returns a value ˜f(x, δ) = f(x) + ˜δ(x), where ˜δ(x) is the error satisfying for some δ > 0 (which is known) |˜δ(x)| ≤δ for all x ∈X. Let x∗∈arg minx∈X f(x). Denote f ∗= minx∈X f(x). Unlike [16], we define the biased gradient-free oracle gτ(x, δ) = m τ ( ˜f(x + τξ, δ) −˜f(x, δ))ξ, where ξ is a random vector uniformly distributed over the unit sphere S = {t ∈Rm : ∥t∥2 = 1}, τ is a smoothing parameter. 4 Algorithm 1 Gradient-type method Input: Point x0 ∈X, stepsize h > 0, number of steps M. Set k = 0. repeat Generate ξk and calculate corresponding gτ(xk, δ). Calculate xk+1 = ΠX(xk −hgτ(xk, δ)) (ΠX(·) – Euclidean projection onto the set X). Set k = k + 1. until k > M Output: The point yM = arg minx{f(x) : x ∈{x0, . . . , xM}}. Theorem 1. Let f ∈C1,1 L (∥· ∥2) and convex. Assume that x∗∈intX, and the sequence xk is generated by Algorithm 1 with h = 1 8mL. Then for any M ≥0, we have EΞM−1f(yM) −f ∗≤ 8mLD2 M+1 + τ 2L(m+8) 8 + δmD 4τ + δ2m Lτ 2 . Here Ξk = (ξ0, . . . , ξk) is the history of realizations of the vector ξ. The full proof of the theorem is in Supplementary Materials. 4.2 SOLVING THE LEARNING PROBLEM Now, we apply the results of Subsection 4.1 to solve Problem 2.5. Note that presence of constraints and oracle inexactness do not allow to directly apply the results of [16]. We assume that there is a local minimum ϕ∗, and Φ is a small vicinity of ϕ∗, in which f(ϕ) (2.4) is convex (generally speaking, it is nonconvex). We choose the desired accuracy ε for f ∗(the optimal value) approximation in the sense that EΞM−1f(yM) −f ∗≤ε. In accordance with Theorem 1, ε gives the number of steps M of Algorithm 1, the value of τ, the value of the required accuracy δ of the inexact zero-order oracle. The value δ, by Lemma 1, gives the number of steps N of Method 3.1 required to calculate a δ-approximation ˜f(ϕ, δ) for f(ϕ). Then the inexact zero-order oracle ˜f(ϕ, δ) is used to make Algorithm 1 step. Theorem 1 and the choice of the feasible set Φ to be a Euclidean ball make it natural to choose ∥· ∥2-norm in the space Rm of parameter ϕ. It is easy to see that in this norm diamΦ ≤2R. Algorithm 2 in Supplementary Materials is a formal record of these ideas. The most computationally hard on each iteration of the main cycle of this method are calculations of ˜f(ϕk + τξk, δ), ˜f(ϕk, δ). Using Lemma 1, we obtain the complexity of each iteration and the following result, which gives the complexity of Algorithm 2. Theorem 2. Assume that the set Φ in (2.5) is chosen in a way such that f(ϕ) is convex on Φ and some ϕ∗∈arg minϕ∈Φ f(ϕ) belongs also to intΦ. Then the mean total number of arithmetic operations of the Algorithm 2 for the accuracy ε (i.e. for the inequality EΞM−1f( ˆϕM) −f(ϕ∗) ≤ε to hold) is not more than 768mps|Q|LR2 ε m + 1 α ln 128mrR p L(m + 8) ε3/2√ 2 + 6r ! . 5 GRADIENT-BASED OPTIMIZATION METHODS In this section, we first develop a general framework of gradient methods with inexact oracle for non-convex problems from rather general class and then apply it for the particular Problem 2.5. Lemma 1 and Lemma 2 allow to control the accuracy of the inexact first-order oracle and hence apply proposed framework. 5.1 GENERAL FRAMEWORK In this subsection, we generalize the approach in [7] for constrained non-convex optimization problems. Our main contribution consists in developing this framework for an inexact first-order oracle and unknown "Lipschitz constant" of this oracle. We consider a composite optimization problem of the form minx∈X{ψ(x) := f(x) + h(x)}, where X ⊂E is a closed convex set, h(x) is a simple convex function, e.g. ∥x∥1. We assume that f(x) is 5 a general function endowed with an inexact first-order oracle in the following sense. There exists a number L ∈(0, +∞) such that for any δ ≥0 and any x ∈X one can calculate ˜f(x, δ) ∈R and ˜g(x, δ) ∈E∗satisfying |f(y) −( ˜f(x, δ) −⟨˜g(x, δ), y −x⟩)| ≤L 2 ∥x −y∥2 + δ. (5.1) for all y ∈X. The constant L can be considered as "Lipschitz constant" because for the exact firstorder oracle for a function f ∈C1,1 L (∥· ∥) Inequality 5.1 holds with δ = 0. This is a generalization of the concept of (δ, L)-oracle considered in [25] for convex problems. We choose a prox-function d(x) which is continuously differentiable and 1-strongly convex on X with respect to ∥· ∥. This means that for any x, y ∈X d(y) −d(x) −⟨∇d(x), y −x⟩≥1 2∥y −x∥2. We define also the corresponding Bregman distance V (x, z) = d(x) −d(z) −⟨∇d(z), x −z⟩. Algorithm 2 Adaptive projected gradient algorithm Input: Point x0 ∈X, number L0 > 0. Set k = 0, z = +∞. repeat Set Mk = Lk, flag = 0. repeat Set δ = ε 16Mk . Calculate ˜f(xk, δ) and ˜g(xk, δ). Find wk = arg minx∈Q {⟨˜g(xk, δ), x⟩+ MkV (x, xk) + h(x)} and calculate ˜f(wk, δ). If the inequality ˜f(wk, δ) ≤˜f(xk, δ) + ⟨˜g(xk, δ), wk −xk⟩+ Mk 2 ∥wk −xk∥2 + ε 8Mk holds, set flag = 1. Otherwise set Mk = 2Mk. until flag = 1 Set xk+1 = wk, Lk+1 = Mk 2 . If ∥Mk(xk −xk+1)∥< z, set z = ∥Mk(xk −xk+1)∥, K = k. Set k = k + 1. until z ≤ε Output: The point xK+1. Theorem 3. Assume that f(x) is endowed with the inexact first-order oracle in a sense (5.1) and that there exists a number ψ∗> −∞such that ψ(x) ≥ψ∗for all x ∈X. Then after M iterations of Algorithm 2 it holds that ∥MK(xK −xK+1)∥2 ≤4L(ψ(x0)−ψ∗) M+1 + ε 2. Moreover, the total number of inexact oracle calls is not more than 2M + 2 log2 2L L0 . The full proof of the theorem is in Supplementary Materials. 5.2 SOLVING THE LEARNING PROBLEM In this subsection, we return to Problem 2.5 and apply the results of the previous subsection. Note that we can not directly apply the results of [7] due to the inexactness of the oracle. For this problem, h(·) ≡0. It is easy to show that in 1-norm diamΦ ≤2R√m. For any δ > 0, Lemma 1 with δ1 = δ 2 allows us to obtain ˜f(ϕ, δ1) such that inequality | ˜f(ϕ, δ1) −f(ϕ)| ≤δ1 holds and Lemma 2 with δ2 = δ 4R√m allows us to obtain ˜g(ϕ, δ2) such that inequality ∥˜g(ϕ, δ2) −∇f(ϕ)∥∞≤δ2 holds. Similar to [25], since f ∈C1,1 L (∥· ∥2), these two inequalities lead to Inequality 5.1 for ˜f(ϕ, δ1) in the role of ˜f(x, δ), ˜g(ϕ, δ2) in the role of ˜g(x, δ) and ∥· ∥2 in the role of ∥· ∥. We choose the desired accuracy ε for approximating the stationary point of Problem 2.5. This accuracy gives the required accuracy δ of the inexact first-order oracle for f(ϕ) on each step of the inner cycle of the Algorithm 2. Knowing the value δ1 = δ 2 and using Lemma 1, we choose the number of steps N of Method 3.1 and thus approximate f(ϕ) with the required accuracy δ1 by ˜f(ϕ, δ1). Knowing the value δ2 = δ 4R√m and using Lemma 2, we choose the number of steps N1 of Method 3.1 and the number of steps N2 of Method 3.2, 3.3 and obtain the approximation ˜g(ϕ, δ2) of ∇f(ϕ) with the required accuracy δ2. Then we use the inexact first-order oracle ( ˜f(ϕ, δ1), ˜g(ϕ, δ2)) to perform a step of Algorithm 2. Since Φ is the Euclidean ball, it is natural to set E = Rm and ∥· ∥= ∥· ∥2, 6 choose the prox-function d(ϕ) = 1 2∥ϕ∥2 2. Then the Bregman distance is V (ϕ, ω) = 1 2∥ϕ −ω∥2 2. Algorithm 4 in Supplementary Materials is a formal record of the above ideas. The most computationally consuming operations of the inner cycle of Algorithm 4 are calculations of ˜f(ϕk, δ1), ˜f(ωk, δ1) and ˜g(ϕk, δ2). Using Lemma 1 and Lemma 2, we obtain the complexity of each iteration. From Theorem 3 we obtain the following result, which gives the complexity of Algorithm 4. Theorem 4. The total number of arithmetic operations in Algorithm 4 for the accuracy ε (i.e. for the inequality ∥MK(ϕK −ϕK+1)∥2 2 ≤ε to hold) is not more than 8L(f(ϕ0) −f ∗) ε + log2 2L L0  ·  7r|Q| + 6mps|Q| α ln 1024β1rRL√m αε  . 6 EXPERIMENTAL RESULTS In this section, we compare our gradient-free and gradient-based methods with the state-of-the-art gradient-based method [21] on the web page ranking problem. In the next section, we describe the dataset. In Section 6.2, we report the results of the experiments. 6.1 DATA We consider the user web browsing graph Γq = (Vq, Eq), q ∈Q, introduced in [12]. Unlike a link graph, a user browsing graph is query–dependent. The set of vertices Vq consists of all different pages visited by users during their sessions started from q. The set of directed edges Eq represents all the ordered pairs of neighboring elements (˜i, i) from such sessions. We add a page i in the seed set Uq if and only if there is a session where i is the first page visited after submitting query q. All experiments are performed with data of a popular commercial search engine Yandex2. We chose a random set of 600 queries Q and collected user sessions started with them. There are ≈11.7K vertices and ≈7.5K edges in graphs Γq, q ∈Q, in total. For each query, a set of pages was labelled by professional assessors with standard 5 relevance grades (≈1.7K labeled query–document pairs in total). We divide our data into two parts. On the first part Q1 (50% of the set of queries Q) we train the parameters and on the second part Q2 we test the algorithms. For each q ∈Q and i ∈Vq, vector Vq i of size m1 = 26 encodes features for query–document pair (q, i). Vector Eq ˜ii of m2 = 52 features for an edge ˜i →i ∈Eq is obtained as the concatenation of Vq ˜i and Vq i . To study a dependency between the efficiency of the algorithms and the sizes of the graphs, we sort the sets Q1, Q2 in ascending order of sizes of the respective graphs. Sets Q1 j, Q2 j, Q3 j contain first (in terms of these order) 100, 200, 300 elements respectively for j ∈{1, 2}. 6.2 PERFORMANCES OF THE OPTIMIZATION ALGORITHMS We optimized the parameters ϕ by three methods: our gradient-free method GFN (Algorithm 2), the gradient-based method GBN (Algorithm 4), and the state-of-the-art gradient-method GBP. The values of hyperparameters are the following: the Lipschitz constant L = 10−4 in GFN (and L0 = 10−4 in GBN), the accuracy ε = 10−6 (in both GBN and GFN), the radius R = 0.99 (in both GBN and GFN). On all sets of queries, we compare final values of the loss function for GBN when L0 ∈{10−4, 10−3, 10−2, 10−1, 1}. The differences are less than 10−7. We choose L in GFN to be equal to L0 (we show how the choice of L influences the output of the gradient-free algorithm, see supplementary materials, Figure 2). Moreover, we evaluate both our gradient-based and gradient-free algorithms for different values of the accuracies. The outputs of the algorithms differ insufficiently on all test sets Qi 2, i ∈{1, 2, 3}, when ε ≤10−6. On the lower level of the state-of-the-art gradientbased algorithm, the stochastic matrix and its derivative are raised to the power 100. We evaluate GBP for different values of the step size (50, 100, 200, 500). We stop the GBP algorithms when the differences between the values of the loss function on the next step and the current step are less than −10−5 on the test sets. 2yandex.com 7 In Table 1, we present the performances of the optimization algorithms in terms of the loss function f (2.4). We also compare the algorithms with the untuned Supervised PageRank (ϕ = ϕ0 = em). On Figure 1, we give the outputs of the optimization algorithms on each iteration of the upper levels of the learning processes on the test set Q3 2, similar results were obtained for the sets Q1 2, Q2 2. Q1 2 Q2 2 Q3 2 Meth. loss steps loss steps loss steps PR .00357 0 .00354 0 .0033 0 GBN .00279 12 .00305 12 .00295 12 GFN .00274 106 .00297 106 .00292 106 GBP 50s. .00282 16 .00307 31 .00295 40 GBP 100s. .00282 8 .00307 16 .00295 20 GBP 200s. .00283 4 .00308 7 .00295 9 GBP 500s. .00283 2 .00308 2 .00295 3 Table 1: Comparison of the algorithms on the test sets. Figure 1: Values of the loss function on each iteration of the optimization algorithms on the test set Q3 2. GFN significantly outperforms the state-of-the-art algorithms on all test sets. GBN significantly outperforms the state-of-the-art algorithm on Q1 2 (we obtain the p-values of the paired t-tests for all the above differences on the test sets of queries, all these values are less than 0.005). However, GBN requires less iterations of the upper level (until it stops) than GBP for step sizes 50 and 100 on Q2 2, Q3 2. Finally, we show that Nesterov–Nemirovski method converges to the stationary distribution faster than the power method (in supplementary materials, on Figure 2, we demonstrate the dependencies of the value of the loss function on Q1 1 for both methods of computing the untuned Supervised PageRank ϕ = ϕ0 = em). 7 CONCLUSION We propose a gradient-free optimization method for general convex problems with inexact zero-order oracle and an adaptive gradient method for possibly nonconvex general composite optimization problems with inexact first-order oracle. For both methods, we provide convergence rate analysis. We also apply our new methods for known problem of learning a web-page ranking algorithm. Our new algorithms not only outperform existing algorithms, but also are guaranteed to solve this learning problem. In practice, this means that these algorithms can increase the reliability and speed of a search engine. Also, to the best of our knowledge, this is the first time when the ideas of random gradient-free and gradient optimization methods are combined with some efficient method for huge-scale optimization using the concept of an inexact oracle. Acknowledgments The research by P. Dvurechensky and A. Gasnikov presented in Section 4 of this paper was conducted in IITP RAS and supported by the Russian Science Foundation grant (project 14-50-00150), the research presented in Section 5 was supported by RFBR. 8 References [1] A. Agarwal, O. Dekel and L. Xiao, Optimal algorithms for online convex optimization with multi-point bandit feedback, 2010, 23rd Annual Conference on Learning Theory (COLT). [2] L. Backstrom and J. Leskovec, Supervised random walks: predicting and recommending links in social networks, 2011, WSDM. [3] Na Dai and Brian D. Davison, Freshness Matters: In Flowers, Food, and Web Authority, 2010, SIGIR. [4] N. Eiron, K. S. McCurley and J. A. Tomlin, Ranking the web frontier, 2004, WWW. [5] A. Gasnikov and D. Dmitriev, Efficient randomized algorithms for PageRank problem, Comp. Math. & Math. Phys, 2015, 55(3): 1–18. [6] B. Gao, T.-Y. Liu, W. W. Huazhong, T. Wang and H. Li, Semi-supervised ranking on very large graphs with rich metadata, 2011, KDD. [7] S. Ghadimi, G. Lan, Stochastic first- and zeroth-order methods for nonconvex stochastic programming, SIAM Journal on Optimization, 2014, 23(4), 2341–2368. [8] T. H. Haveliwala, Efficient computation of PageRank, Stanford University, 1999. [9] T. H. Haveliwala, Topic-Sensitive PageRank, 2002, WWW. [10] G. Jeh and J. Widom, Scaling Personalized Web Search, 2003, WWW. [11] J. M. Kleinberg, Authoritative sources in a hyperlinked environment, 1998, SODA. [12] Y. Liu, B. Gao, T.-Y. Liu, Y. Zhang, Z. Ma, S. He, H. Li, BrowseRank: Letting Web Users Vote for Page Importance, 2008, SIGIR. [13] J. Matyas, Random optimization, Automation and Remote Control, 1965, 26: 246–253. [14] Yu. Nesterov, Introductory Lectures on Convex Optimization, Springer, 2004, New York. [15] Yu. Nesterov, Efficiency of coordinate descent methods on huge-scale optimization problems, SIAM Journal on Optimization, 2012, 22(2): 341–362. [16] Yu. Nesterov and V. Spokoiny, Random Gradient-Free Minimization of Convex Functions, Foundations of Computational Mathematics, 2015, 1–40. [17] Yu. Nesterov and A. Nemirovski, Finding the stationary states of Markov chains by iterative methods, Applied Mathematics and Computation, 2015, 255: 58–65. [18] L. Page, S. Brin, R. Motwani, T. Winograd, The PageRank citation ranking: Bringing order to the web, Stanford InfoLab, 1999. [19] M. Richardson and P. Domingos, The intelligent surfer: Probabilistic combination of link and content information in PageRank, 2002, NIPS. [20] M. Zhukovskii, G. Gusev, P. Serdyukov, URL Redirection Accounting for Improving Link-Based Ranking Methods, 2013, ECIR. [21] M. Zhukovskii, G. Gusev, P. Serdyukov, Supervised Nested PageRank, 2014, CIKM. [22] M. Zhukovskii, A. Khropov, G. Gusev, P. Serdyukov, Fresh BrowseRank, 2013, SIGIR. [23] A. L. Andrew, Convergence of an iterative method for derivatives of eigensystems, Journal of Computational Physics, 1978, 26: 107–112. [24] A. Andrew, Iterative computation of derivatives of eigenvalues and eigenvectors, IMA Journal of Applied Mathematics, 1979, 24(2): 209–218. [25] O. Devolder, F. Glineur, Yu. Nesterov, First-order methods of smooth convex optimization with inexact oracle, Mathematical Programming, 2013, 146(1): 37–75. [26] Yu. Nesterov, B.T. Polyak, Cubic regularization of Newton method and its global performance, Mathematical Programming, 2006, 108(1) 177–205. [27] Yu. Nesterov, Gradient methods for minimizing composite functions, Mathematical Programming, 2012, 140(1) 125–161. 9
2016
73
6,534
Globally Optimal Training of Generalized Polynomial Neural Networks with Nonlinear Spectral Methods A. Gautier, Q. Nguyen and M. Hein Department of Mathematics and Computer Science Saarland Informatics Campus, Saarland University, Germany Abstract The optimization problem behind neural networks is highly non-convex. Training with stochastic gradient descent and variants requires careful parameter tuning and provides no guarantee to achieve the global optimum. In contrast we show under quite weak assumptions on the data that a particular class of feedforward neural networks can be trained globally optimal with a linear convergence rate with our nonlinear spectral method. Up to our knowledge this is the first practically feasible method which achieves such a guarantee. While the method can in principle be applied to deep networks, we restrict ourselves for simplicity in this paper to one and two hidden layer networks. Our experiments confirm that these models are rich enough to achieve good performance on a series of real-world datasets. 1 Introduction Deep learning [13, 16] is currently the state of the art machine learning technique in many application areas such as computer vision or natural language processing. While the theoretical foundations of neural networks have been explored in depth see e.g. [1], the understanding of the success of training deep neural networks is a currently very active research area [5, 6, 9]. On the other hand the parameter search for stochastic gradient descent and variants such as Adagrad and Adam can be quite tedious and there is no guarantee that one converges to the global optimum. In particular, the problem is even for a single hidden layer in general NP hard, see [17] and references therein. This implies that to achieve global optimality efficiently one has to impose certain conditions on the problem. A recent line of research has directly tackled the optimization problem of neural networks and provided either certain guarantees [2, 15] in terms of the global optimum or proved directly convergence to the global optimum [8, 11]. The latter two papers are up to our knowledge the first results which provide a globally optimal algorithm for training neural networks. While providing a lot of interesting insights on the relationship of structured matrix factorization and training of neural networks, Haeffele and Vidal admit themselves in their paper [8] that their results are “challenging to apply in practice”. In the work of Janzamin et al. [11] they use a tensor approach and propose a globally optimal algorithm for a feedforward neural network with one hidden layer and squared loss. However, their approach requires the computation of the score function tensor which uses the density of the data-generating measure. However, the data generating measure is unknown and also difficult to estimate for high-dimensional feature spaces. Moreover, one has to check certain non-degeneracy conditions of the tensor decomposition to get the global optimality guarantee. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. In contrast our nonlinear spectral method just requires that the data is nonnegative which is true for all sorts of count data such as images, word frequencies etc. The condition which guarantees global optimality just depends on the parameters of the architecture of the network and boils down to the computation of the spectral radius of a small nonnegative matrix. The condition can be checked without running the algorithm. Moreover, the nonlinear spectral method has a linear convergence rate and thus the globally optimal training of the network is very fast. The two main changes compared to the standard setting are that we require nonnegativity on the weights of the network and we have to minimize a modified objective function which is the sum of loss and the negative total sum of the outputs. While this model is non-standard, we show in some first experimental results that the resulting classifier is still expressive enough to create complex decision boundaries. As well, we achieve competitive performance on some UCI datasets. As the nonlinear spectral method requires some non-standard techniques, we use the main part of the paper to develop the key steps necessary for the proof. However, some proofs of the intermediate results are moved to the supplementary material. 2 Main result 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 Figure 1: Classification decision boundaries in R2. (Best viewed in colors.) In this section we present the algorithm together with the main theorem providing the convergence guarantee. We limit the presentation to one hidden layer networks to improve the readability of the paper. Our approach can be generalized to feedforward networks of arbitrary depth. In particular, we present in Section 4.1 results for two hidden layers. We consider in this paper multi-class classification where d is the dimension of the feature space and K is the number of classes. We use the negative cross-entropy loss defined for label y ∈[K] := {1, . . . , K} and classifier f : Rd →RK as L y, f(x)  = −log efy(x) PK j=1 efj(x) ! = −fy(x) + log  K X j=1 efj(x) . The function class we are using is a feedforward neural network with one hidden layer with n1 hidden units. As activation functions we use real powers of the form of a generalized polyomial, that is for α ∈Rn1 with αi ≥1, i ∈[K], we define: fr(x) = fr(w, u)(x) = n1 X l=1 wrl  d X m=1 ulmxm αl, (1) where R+ = {x ∈R | x ≥0} and w ∈RK×n1 + , u ∈Rn1×d + are the parameters of the network which we optimize. The function class in (1) can be seen as a generalized polynomial in the sense that the powers do not have to be integers. Polynomial neural networks have been recently analyzed in [15]. Please note that a ReLU activation function makes no sense in our setting as we require the data as well as the weights to be nonnegative. Even though nonnegativity of the weights is a strong constraint, one can model quite complex decision boundaries (see Figure 1, where we show the outcome of our method for a toy dataset in R2). In order to simplify the notation we use w = (w1, . . . , wK) for the K output units wi ∈Rn1 + , i = 1, . . . , K. All output units and the hidden layer are normalized. We optimize over the set S+ =  (w, u) ∈RK×n1 + × Rn1×d + ∥u∥pu = ρu, ∥wi∥pw = ρw, ∀i = 1, . . . , K . We also introduce S++ where one replaces R+ with R++ = {t ∈R | t > 0}. The final optimization problem we are going to solve is given as max (w,u)∈S+ Φ(w, u) with (2) Φ(w, u) = 1 n n X i=1 h −L  yi, f(w, u)(xi)  + K X r=1 fr(w, u)(xi) i + ϵ  K X r=1 n1 X l=1 wr,l + n1 X l=1 d X m=1 ulm  , 2 where (xi, yi) ∈Rd + × [K], i = 1, . . . , n is the training data. Note that this is a maximization problem and thus we use minus the loss in the objective so that we are effectively minimizing the loss. The reason to write this as a maximization problem is that our nonlinear spectral method is inspired by the theory of (sub)-homogeneous nonlinear eigenproblems on convex cones [14] which has its origin in the Perron-Frobenius theory for nonnegative matrices. In fact our work is motivated by the closely related Perron-Frobenius theory for multihomogeneous problems developed in [7]. This is also the reason why we have nonnegative weights, as we work on the positive orthant which is a convex cone. Note that ϵ > 0 in the objective can be chosen arbitrarily small and is added out of technical reasons. In order to state our main theorem we need some additional notation. For p ∈(1, ∞), we let p′ = p/(p −1) be the Hölder conjugate of p, and ψp(x) = sign(x)|x|p−1. We apply ψp to scalars and vectors in which case the function is applied componentwise. For a square matrix A we denote its spectral radius by ρ(A). Finally, we write ∇wiΦ(w, u) (resp. ∇uΦ(w, u)) to denote the gradient of Φ with respect to wi (resp. u) at (w, u). The mapping GΦ(w, u) =  ρwψp′w(∇w1Φ(w, u)) ∥ψp′w(∇w1Φ(w, u))∥pw , . . . , ρwψp′w(∇wKΦ(w, u)) ∥ψp′w(∇wKΦ(w, u))∥pw , ρuψp′u(∇uΦ(w, u)) ∥ψp′u(∇uΦ(w, u))∥pu  , (3) defines a sequence converging to the global optimum of (2). Indeed, we prove: Theorem 1. Let {xi, yi}n i=1 ⊂Rd + × [K], pw, pu ∈(1, ∞), ρw, ρu > 0, n1 ∈N and α ∈ Rn1 with αi ≥1 for every i ∈[n1]. Define ρx, ξ1, ξ2 > 0 as ρx = maxi∈[n] ∥xi∥1, ξ1 = ρw Pn1 l=1(ρuρx)αl, ξ2 = ρw Pn1 l=1 αl(ρuρx)αl and let A ∈R(K+1)×(K+1) ++ be defined as Al,m = 4(p′ w −1)ξ1, Al,K+1 = 2(p′ w −1)(2ξ2 + ∥α∥∞), AK+1,m = 2(p′ u −1)(2ξ1 + 1), AK+1,K+1 = 2(p′ u −1)(2ξ2 + ∥α∥∞−1), ∀m, l ∈[K]. If the spectral radius ρ(A) of A satisfies ρ(A) < 1, then (2) has a unique global maximizer (w∗, u∗) ∈S++. Moreover, for every (w0, u0) ∈S++, there exists R > 0 such that lim k→∞(wk, uk) = (w∗, u∗) and ∥(wk, uk) −(w∗, u∗)∥∞≤R ρ(A)k ∀k ∈N, where (wk+1, uk+1) = GΦ(wk, uk) for every k ∈N. Note that one can check for a given model (number of hidden units n1, choice of α, pw, pu, ρu, ρw) easily if the convergence guarantee to the global optimum holds by computing the spectral radius of a square matrix of size K + 1. As our bounds for the matrix A are very conservative, the “effective” spectral radius is typically much smaller, so that we have very fast convergence in only a few iterations, see Section 5 for a discussion. Up to our knowledge this is the first practically feasible algorithm to achieve global optimality for a non-trivial neural network model. Additionally, compared to stochastic gradient descent, there is no free parameter in the algorithm. Thus no careful tuning of the learning rate is required. The reader might wonder why we add the second term in the objective, where we sum over all outputs. The reason is that we need that the gradient of GΦ is strictly positive in S+, this is why we also have to add the third term for arbitrarily small ϵ > 0. In Section 5 we show that this model achieves competitive results on a few UCI datasets. Choice of α: It turns out that in order to get a non-trivial classifier one has to choose α1, . . . , αn1 ≥1 so that αi ̸= αj for every i, j ∈[n1] with i ̸= j. The reason for this lies in certain invariance properties of the network. Suppose that we use a permutation invariant componentwise activation function σ, that is σ(Px) = Pσ(x) for any permutation matrix P and suppose that A, B are globally optimal weight matrices for a one hidden layer architecture, then for any permutation matrix P, Aσ(Bx) = AP T Pσ(Bx) = AP T σ(PBx), which implies that A′ = AP T and B′ = PB yield the same function and thus are also globally optimal. In our setting we know that the global optimum is unique and thus it has to hold that, A = AP T and B = PB for all permutation matrices P. This implies that both A and B have rank one and thus lead to trivial classifiers. This is the reason why one has to use different α for every unit. 3 Dependence of ρ(A) on the model parameters: Let Q, ˜Q ∈Rm×m + and assume 0 ≤Qi,j ≤˜Qi,j for every i, j ∈[m], then ρ(Q) ≤ρ( ˜Q), see Corollary 3.30 [3]. It follows that ρ(A) in Theorem 1 is increasing w.r.t. ρu, ρw, ρx and the number of hidden units n1. Moreover, ρ(A) is decreasing w.r.t. pu, pw and in particular, we note that for any fixed architecture (n1, α, ρu, ρw) it is always possible to find pu, pw large enough so that ρ(A) < 1. Indeed, we know from the Collatz-Wielandt formula (Theorem 8.1.26 in [10]) that ρ(A) = ρ(AT ) ≤maxi∈[K+1](AT v)i/vi for any v ∈RK+1 ++ . We use this to derive lower bounds on pu, pw that ensure ρ(A) < 1. Let v = (pw −1, . . . , pw −1, pu −1), then (AT v)i < vi for every i ∈[K + 1] guarantees ρ(A) < 1 and is equivalent to pw > 4(K + 1)ξ1 + 3 and pu > 2(K + 1)(∥α∥∞+ 2ξ2) −1, (4) where ξ1, ξ2 are defined as in Theorem 1. However, we think that our current bounds are sub-optimal so that this choice is quite conservative. Finally, we note that the constant R in Theorem 1 can be explicitly computed when running the algorithm (see Theorem 3). Proof Strategy: The following main part of the paper is devoted to the proof of the algorithm. For that we need some further notation. We introduce the sets V+ = RK×n1 + × Rn1×d + , V++ = RK×n1 ++ × Rn1×d ++ B+ =  (w, u) ∈V+ ∥u∥pu ≤ρu, ∥wi∥pw ≤ρw, ∀i = 1, . . . , K}, and similarly we define B++ replacing V+ by V++ in the definition. The high-level idea of the proof is that we first show that the global maximum of our optimization problem in (2) is attained in the “interior” of S+, that is S++. Moreover, we prove that any critical point of (2) in S++ is a fixed point of the mapping GΦ. Then we proceed to show that there exists a unique fixed point of GΦ in S++ and thus there is a unique critical point of (2) in S++. As the global maximizer of (2) exists and is attained in the interior, this fixed point has to be the global maximizer. Finally, the proof of the fact that GΦ has a unique fixed point follows by noting that GΦ maps B++ into B++ and the fact that B++ is a complete metric space with respect to the Thompson metric. We provide a characterization of the Lipschitz constant of GΦ and in turn derive conditions under which GΦ is a contraction. Finally, the application of the Banach fixed point theorem yields the uniqueness of the fixed point of GΦ and the linear convergence rate to the global optimum of (2). In Section 4 we show the application of the established framework for our neural networks. 3 From the optimization problem to fixed point theory Lemma 1. Let Φ : V →R be differentiable. If ∇Φ(w, u) ∈V++ for every (w, u) ∈S+, then the global maximum of Φ on S+ is attained in S++. We now identify critical points of the objective Φ in S++ with fixed points of GΦ in S++. Lemma 2. Let Φ : V →R be differentiable. If ∇Φ(w, u) ∈V++ for all (w, u) ∈S++, then (w∗, u∗) is a critical point of Φ in S++ if and only if it is a fixed point of GΦ. Our goal is to apply the Banach fixed point theorem to GΦ : B++ →S++ ⊂B++. We recall this theorem for the convenience of the reader. Theorem 2 (Banach fixed point theorem e.g. [12]). Let (X, d) be a complete metric space with a mapping T : X →X such that d(T(x), T(y)) ≤q d(x, y) for q ∈[0, 1) and all x, y ∈X. Then T has a unique fixed-point x∗in X, that is T(x∗) = x∗and the sequence defined as xn+1 = T(xn) with x0 ∈X converges limn→∞xn = x∗with linear convergence rate d(xn, x∗) ≤ qn 1 −q d(x1, x0). So, we need to endow B++ with a metric µ so that (B++, µ) is a complete metric space. A popular metric for the study of nonlinear eigenvalue problems on the positive orthant is the so-called Thompson metric d: Rm ++ × Rm ++ →R+ [18] defined as d(z, ˜z) = ∥ln(z) −ln(˜z)∥∞ where ln(z) = ln(z1), . . . , ln(zm)  . 4 Using the known facts that (Rn ++, d) is a complete metric space and its topology coincides with the norm topology (see e.g. Corollary 2.5.6 and Proposition 2.5.2 [14]), we prove: Lemma 3. For p ∈(1, ∞) and ρ > 0, ({z ∈Rn ++ | ∥z∥p ≤ρ}, d) is a complete metric space. Now, the idea is to see B++ as a product of such metric spaces. For i = 1, . . . , K, let Bi ++ = {wi ∈Rn1 ++ | ∥wi∥pw ≤ρw} and di(wi, ˜wi) = γi∥ln(wi) −ln( ˜wi)∥∞for some constant γi > 0. Furthermore, let BK+1 ++ = {u ∈Rn1×d ++ | ∥u∥pu ≤ρu} and dK+1(u, ˜u) = γK+1∥ln(u) −ln(˜u)∥∞. Then (Bi ++, di) is a complete metric space for every i ∈[K + 1] and B++ = B1 ++ × . . . × BK ++ × BK+1 ++ . It follows that (B++, µ) is a complete metric space with µ: B++ × B++ →R+ defined as µ (w, u), ( ˜w, ˜u)  = K X i=1 γi∥ln(wi) −ln( ˜wi)∥∞+ γK+1∥ln(u) −ln(˜u)∥∞. The motivation for introducing the weights γ1, . . . , γK+1 > 0 is given by the next theorem. We provide a characterization of the Lipschitz constant of a mapping F : B++ →B++ with respect to µ. Moreover, this Lipschitz constant can be minimized by a smart choice of γ. For i ∈[K], a, j ∈[n1], b ∈[d], we write Fwi,j and Fuab to denote the components of F such that F = (Fw1,1, . . . , Fw1,n1, Fw2,1, . . . , FwK,n1, Fu11, . . . , Fun1d). Lemma 4. Suppose that F ∈C1(B++, V++) and A ∈R(K+1)×(K+1) + satisfies |∇wkFwi,j(w, u)|, wk ≤Ai,k Fwi,j(w, u), |∇uFwi,j(w, u)|, u ≤Ai,K+1 Fwi,j(w, u) and ⟨|∇wkFuab(w, u)|, wk⟩≤AK+1,k Fuab(w, u), ⟨|∇uFuab(w, u)|, u⟩≤AK+1,K+1 Fuab(w, u) for all i, k ∈[K], a, j ∈[n1], b ∈[d] and (w, u) ∈B++. Then, for every (w, u), ( ˜w, ˜u) ∈B++ it holds µ F(w, u), F( ˜w, ˜u)  ≤U µ (w, u), ( ˜w, ˜u)  with U = max k∈[K+1] (AT γ)k γk . Note that, from the Collatz-Wielandt ratio for nonnegative matrices, we know that the constant U in Lemma 4 is lower bounded by the spectral radius ρ(A) of A. Indeed, by Theorem 8.1.31 in [10], we know that if AT has a positive eigenvector γ ∈RK+1 ++ , then max i∈[K+1] (AT γ)i γi = ρ(A) = min ˜γ∈RK+1 ++ max i∈[K+1] (AT ˜γ)i ˜γi . (5) Therefore, in order to obtain the minimal Lipschitz constant U in Lemma 4, we choose the weights of the metric µ to be the components of γ. A combination of Theorem 2, Lemma 4 and this observation implies the following result. Theorem 3. Let Φ ∈C1(V, R) ∩C2(B++, R) with ∇Φ(S+) ⊂V++. Let GΦ : B++ →B++ be defined as in (3). Suppose that there exists a matrix A ∈R(K+1)×(K+1) + such that GΦ and A satisfies the assumptions of Lemma 4 and AT has a positive eigenvector γ ∈RK+1 ++ . If ρ(A) < 1, then Φ has a unique critical point (w∗, u∗) in S++ which is the global maximum of the optimization problem (2). Moreover, the sequence (wk, uk)  k defined for any (w0, u0) ∈ S++ as (wk+1, uk+1) = GΦ(wk, uk), k ∈N, satisfies limk→∞(wk, uk) = (w∗, u∗) and ∥(wk, uk) −(w∗, u∗)∥∞≤ρ(A)k  µ (w1, u1), (w0, u0)  1 −ρ(A)  min  γK+1 ρu , mint∈[K] γt ρw  ∀k ∈N, where the weights in the definition of µ are the entries of γ. 4 Application to Neural Networks In the previous sections we have outlined the proof of our main result for a general objective function satisfying certain properties. The purpose of this section is to prove that the properties hold for our optimization problem for neural networks. 5 We recall our objective function from (2) Φ(w, u) = 1 n n X i=1 h −L yi, f(w, u)(xi)  + K X r=1 fr(w, u)(xi) i + ϵ  K X r=1 n1 X l=1 wr,l + n1 X l=1 d X m=1 ulm  and the function class we are considering from (1) fr(x) = fr(w, u)(x) = n1 X l=1 wr,l  d X m=1 ulmxm αl, The arbitrarily small ϵ in the objective is needed to make the gradient strictly positive on the boundary of V+. We note that the assumption αi ≥1 for every i ∈[n1] is crucial in the following lemma in order to guarantee that ∇Φ is well defined on S+. Lemma 5. Let Φ be defined as in (2), then ∇Φ(w, u) is strictly positive for any (w, u) ∈S+. Next, we derive the matrix A ∈R(K+1)×(K+1) in order to apply Theorem 3 to GΦ with Φ defined in (2). As discussed in its proof, the matrix A given in the following theorem has a smaller spectral radius than that of Theorem 1. To express this matrix, we consider Ψα p,q : Rn1 ++ × R++ →R++ defined for p, q ∈(1, ∞) and α ∈Rn1 ++ as Ψα p,q(δ, t) = h X l∈J (δl tαl) p q q−αp i1−αp q + max j∈Jc(δj tαj)p 1/p , (6) where J = {l ∈[n1] | αlp ≤q}, Jc = {l ∈[n1] | αlp > q} and α = minl∈J αl. Theorem 4. Let Φ be defined as above and GΦ be as in (3). Set Cw = ρw Ψα p′w,pu(1, ρuρx), Cu = ρw Ψα p′w,pu(α, ρuρx) and ρx = maxi∈[n] ∥xi∥p′u. Then A and GΦ satisfy all assumptions of Lemma 4 with A = 2 diag p′ w −1, . . . , p′ w −1, p′ u −1   Qw,w Qw,u Qu,w Qu,u  where Qw,w ∈RK×K ++ , Qw,u ∈RK×1 ++ , Qu,w ∈R1×K ++ and Qu,u ∈R++ are defined as Qw,w = 2Cw11T , Qw,u = (2Cu + ∥α∥∞)1, Qu,w = (2Cw + 1)1T , Qu,u = (2Cu + ∥α∥∞−1). In the supplementary material, we prove that Ψα p,q(δ, t) ≤Pn1 l=1 δltαl which yields the weaker bounds ξ1, ξ2 given in Theorem 1. In particular, this observation combined with Theorems 3 and 4 implies Theorem 1. 4.1 Neural networks with two hidden layers We show how to extend our framework for neural networks with 2 hidden layers. In future work we will consider the general case. We briefly explain the major changes. Let n1, n2 ∈N and α ∈Rn1 ++, β ∈Rn2 ++ with αi, βj ≥1 for all i ∈[n1], j ∈[n2], our function class is: fr(x) = fr(w, v, u)(x) = n2 X l=1 wr,l  n1 X m=1 vlm  d X s=1 umsxs αmβl and the optimization problem becomes max (w,v,u)∈S+ Φ(w, v, u) where V+ = RK×n2 + × Rn2×n1 + × Rn1×d + , (7) S+ = {(w1, . . . , wK, v, u) ∈V+ | ∥wi∥pw = ρw, ∥v∥pv = ρv, ∥u∥pu = ρu} and Φ(w, v, u) = 1 n n X i=1 h −L yi, f(xi)  + K X r=1 fr(xi) i +ϵ  K X r=1 n2 X l=1 wr,l+ n2 X l=1 n1 X m=1 vlm+ n1 X m=1 d X s=1 ums  . 6 The map GΦ : S++ →S++ = {z ∈S+ | z > 0}, GΦ = (GΦ w1, . . . , GΦ wK, GΦ v , GΦ u), becomes GΦ wi(w, v, u) = ρw ψp′w(∇wiΦ(w, u)) ∥ψp′w(∇wiΦ(w, v, u))∥pw ∀i ∈[K] (8) and GΦ v (w, v, u) = ρv ψp′v(∇vΦ(w, v, u)) ∥ψp′ v(∇vΦ(w, v, u))∥pv , GΦ u(w, v, u) = ρu ψp′u(∇uΦ(w, v, u)) ∥ψp′ u(∇uΦ(w, v, u))∥pu . We have the following equivalent of Theorem 1 for 2 hidden layers. Theorem 5. Let {xi, yi}n i=1 ⊂Rd + ×[K], pw, pv, pu ∈(1, ∞), ρw, ρv, ρu > 0, n1, n2 ∈N and α ∈Rn1 ++, β ∈Rn2 ++ with αi, βj ≥1 for all i ∈[n1], j ∈[n2]. Let ρx = maxi∈[n] ∥xi∥p′u, θ = ρvΨα p′v,pu(1, ρuρx), Cw = ρwΨβ p′w,pv(1, θ), Cv = ρwΨβ p′w,pv(β, θ), Cu = ∥α∥∞Cv, and define A ∈R(K+2)×(K+2) ++ as Am,l = 4(p′ w −1)Cw, Am,K+1 = 2(p′ w −1)(2Cv + ∥β∥∞) Am,K+2 = 2(p′ w −1) 2Cu + ∥α∥∞∥β∥∞  , AK+1,l = 2(p′ v −1) 2Cw + 1  AK+1,K+1 = 2(p′ v −1) 2Cv + ∥β∥∞−1  , AK+1,K+2 = 2(p′ v −1) 2Cu + ∥α∥∞∥β∥∞  AK+2,l = 2(p′ u −1)(2Cw + 1), AK+2,K+1 = 2(p′ u −1)(2Cv + ∥β∥∞), AK+2,K+2 = 2(p′ u −1)(2Cu + ∥α∥∞∥β∥∞−1) ∀m, l ∈[K]. If ρ(A) < 1, then (7) has a unique global maximizer (w∗, v∗, u∗) ∈S++. Moreover, for every (w0, v0, u0) ∈S++, there exists R > 0 such that lim k→∞(wk, vk, uk) = (w∗, v∗, u∗) and ∥(wk, vk, uk)−(w∗, v∗, u∗)∥∞≤R ρ(A)k ∀k ∈N where (wk+1, vk+1, uk+1) = GΦ(wk, vk, uk) for every k ∈N and GΦ is defined as in (8). As for the case with one hidden layer, for any fixed architecture ρw, ρv, ρu > 0, n1, n2 ∈N and α ∈Rn1 ++, β ∈Rn2 ++ with αi, βj ≥1 for all i ∈[n1], j ∈[n2], it is possible to derive lower bounds on pw, pv, pu that guarantee ρ(A) < 1 in Theorem 5. Indeed, it holds Cw ≤ζ1 = ρw n2 X j=1 h ρv n1 X l=1 (ρu˜ρx)αl iβj and Cv ≤ζ2 = ρw n2 X j=1 βj h ρv n1 X l=1 (ρu˜ρx)αl iβj , with ˜ρx = maxi∈[n] ∥xi∥1. Hence, the two hidden layers equivalent of (4) becomes pw > 4(K+2)ζ1+5, pv > 2(K+2)  2ζ2+∥β∥∞  −1, pu > 2(K+2)∥α∥∞(2ζ2+∥β∥∞)−1. (9) 5 Experiments 10 0 10 1 10 2 epochs 10 -14 10 -12 10 -10 10 -8 (p∗−f)/|p∗| NLSM1 SGD 100 SGD 10 SGD 1 SGD 0.1 SGD 0.01 10 0 10 1 10 2 10 3 epochs 0 20 40 60 80 100 test error NLSM1 SGD 100 SGD 10 SGD 1 SGD 0.1 SGD 0.01 Figure 2: Training score (left) w.r.t. the optimal score p∗ and test error (right) of NLSM1 and Batch-SGD with different step-sizes. Table 1: Test accuracy on UCI datasets Dataset NLSM1 NLSM2 ReLU1 ReLU2 SVM Cancer 96.4 96.4 95.7 93.6 95.7 Iris 90.0 96.7 100 93.3 100 Banknote 97.1 96.4 100 97.8 100 Blood 76.0 76.7 76.0 76.0 77.3 Haberman 75.4 75.4 70.5 72.1 72.1 Seeds 88.1 90.5 90.5 92.9 95.2 Pima 79.2 80.5 76.6 79.2 79.9 The shown experiments should be seen as a proof of concept. We do not have yet a good understanding of how one should pick the parameters of our model to achieve good performance. However, the other papers which have up to now discussed global optimality for neural networks [11, 8] have not included any results on real datasets. Thus, up to our 7 Nonlinear Spectral Method for 1 hidden layer Input: Model n1 ∈N, pw, pu ∈(1, ∞), ρw, ρu > 0, α1, . . . , αn1 ≥1, ϵ > 0 so that the matrix A of Theorem 1 satisfies ρ(A) < 1. Accuracy τ > 0 and (w0, u0) ∈S++. 1 Let (w1, u1) = GΦ(w0, u0) and compute R as in Theorem 3 2 Repeat 3 (wk+1, uk+1) = GΦ(wk, uk) 4 k ←k + 1 5 Until k ≥ln τ/R  / ln ρ(A)  Output: (wk, uk) fulfills ∥(wk, uk) −(w∗, u∗)∥∞< τ. With GΦ defined as in (3). The method for two hidden layers is similar: consider GΦ as in (8) instead of (3) and assume that the model satisfies Theorem 5. knowledge, we show for the first time a globally optimal algorithm for neural networks that leads to non-trivial classification results. We test our methods on several low dimensional UCI datasets and denote our algorithms as NLSM1 (one hidden layer) and NLSM2 (two hidden layers). We choose the parameters of our model out of 100 randomly generated combinations of (n1, α, ρw, ρu) ∈[2, 20] × [1, 4] × (0, 1]2 (respectively (n1, n2, α, β, ρw, ρv, ρu) ∈[2, 10]2 × [1, 4]2 × (0, 1]2) and pick the best one based on 5-fold cross-validation error. We use Equation (4) (resp. Equation (9)) to choose pu, pw (resp. pu, pv, pw) so that every generated model satisfies the conditions of Theorem 1 (resp. Theorem 5), i.e. ρ(A) < 1. Thus, global optimality is guaranteed in all our experiments. For comparison, we use the nonlinear RBF-kernel SVM and implement two versions of the Rectified-Linear Unit network - one for one hidden layer networks (ReLU1) and one for two hidden layers networks (ReLU2). To train ReLU, we use a stochastic gradient descent method which minimizes the sum of logistic loss and L2 regularization term over weight matrices to avoid over-fitting. All parameters of each method are jointly cross validated. More precisely, for ReLU the number of hidden units takes values from 2 to 20, the step-sizes and regularizers are taken in {10−6, 10−5, . . . , 102} and {0, 10−4, 10−3, . . . , 104} respectively. For SVM, the hyperparameter C and the kernel parameter γ of the radius basis function K(xi, xj) = exp(−γ∥xi −xj∥2) are taken from {2−5, 2−4 . . . , 220} and {2−15, 2−14 . . . , 23} respectively. Note that ReLUs allow negative weights while our models do not. The results presented in Table 1 show that overall our nonlinear spectral methods achieve slightly worse performance than kernel SVM while being competitive/slightly better than ReLU networks. Notably in case of Cancer, Haberman and Pima, NLSM2 outperforms all the other models. For Iris and Banknote, we note that without any constraints ReLU1 can easily find an architecture which achieves zero test error while this is difficult for our models as we impose constraints on the architecture in order to prove global optimality. We compare our algorithms with Batch-SGD in order to optimize (2) with batch-size being 5% of the training data while the step-size is fixed and selected between 10−2 and 102. At each iteration of our spectral method and each epoch of Batch-SGD, we compute the objective and test error of each method and show the results in Figure 2. One can see that our method is much faster than SGDs, and has a linear convergence rate. We noted in our experiments that as α is large and our data lies between [0, 1], all units in the network tend to have small values that make the whole objective function relatively small. Thus, a relatively large change in (w, u) might cause only small changes in the objective function but performance may vary significantly as the distance is large in the parameter space. In other words, a small change in the objective may have been caused by a large change in the parameter space, and thus, largely influences the performance - which explains the behavior of SGDs in Figure 2. The magnitude of the entries of the matrix A in Theorems 1 and 5 grows with the number of hidden units and thus the spectral radius ρ(A) also increases with this number. As we expect that the number of required hidden units grows with the dimension of the datasets we have limited ourselves in the experiments to low-dimensional datasets. However, these bounds are likely not to be tight, so that there might be room for improvement in terms of dependency on the number of hidden units. 8 Acknowledgment The authors acknowledge support by the ERC starting grant NOLEPRO 307793. References [1] M. Anthony and P. Bartlett. Neural Network Learning: Theoretical Foundations. Cambridge University Press, New York, 1999. [2] S. Arora, A. Bhaskara, R. Ge, and T. Ma. Provable bounds for learning some deep representations. In ICML, 2014. [3] A. Berman and R. J. Plemmons. Nonnegative Matrices in the Mathematical Sciences. SIAM, Philadelphia, 1994. [4] D. P. Bertsekas. Nonlinear Programming. Athena Scientific, Belmont, Mass., 1999. [5] A. Choromanska, M. Hena, M. Mathieu, G. B. Arous, and Y. LeCun. The loss surfaces of multilayer networks. In AISTATS, 2015. [6] A Daniely, R. Frostigy, and Y. Singer. Toward deeper understanding of neural networks: The power of initialization and a dual view on expressivity, 2016. arXiv:1602.05897v1. [7] A. Gautier, F. Tudisco, and M. Hein. The Perron-Frobenius Theorem for Multi-Homogeneous Maps. in preparation, 2016. [8] B. D. Haeffele and Rene Vidal. Global optimality in tensor factorization, deep learning, and beyond, 2015. arXiv:1506.07540v1. [9] M. Hardt, B. Recht, and Y. Singer. Train faster, generalize better: Stability of stochastic gradient descent. In ICML, 2016. [10] R. A. Horn and C. R. Johnson. Matrix Analysis. Cambridge University Press, New York, second edition, 2013. [11] M. Janzamin, H. Sedghi, and A. Anandkumar. Beating the perils of non-convexity:guaranteed training of neural networks using tensor methods, 2015. arXiv:1506.08473v3. [12] W. A. Kirk and M. A. Khamsi. An Introduction to Metric Spaces and Fixed Point Theory. John Wiley, New York, 2001. [13] Y. LeCun, Y. Bengio, and G. Hinton. Deep learning. Nature, 521, 2015. [14] B. Lemmens and R. D. Nussbaum. Nonlinear Perron-Frobenius theory. Cambridge University Press, New York, general edition, 2012. [15] R. Livni, S. Shalev-Shwartz, and O. Shamir. On the computational efficiency of training neural networks. In NIPS, pages 855–863, 2014. [16] J. Schmidhuber. Deep Learning in Neural Networks: An Overview. Neural Networks, 61:85–117, 2015. [17] J. Sima. Training a single sigmoidal neuron is hard. Neural Computation, 14:2709–2728, 2002. [18] A. C. Thompson. On certain contraction mappings in a partially ordered vector space. Proceedings of the American Mathematical Society, 14:438–443, 1963. 9
2016
74
6,535
Optimal Black-Box Reductions Between Optimization Objectives∗ Zeyuan Allen-Zhu zeyuan@csail.mit.edu Institute for Advanced Study & Princeton University Elad Hazan ehazan@cs.princeton.edu Princeton University Abstract The diverse world of machine learning applications has given rise to a plethora of algorithms and optimization methods, finely tuned to the specific regression or classification task at hand. We reduce the complexity of algorithm design for machine learning by reductions: we develop reductions that take a method developed for one setting and apply it to the entire spectrum of smoothness and strong-convexity in applications. Furthermore, unlike existing results, our new reductions are optimal and more practical. We show how these new reductions give rise to new and faster running times on training linear classifiers for various families of loss functions, and conclude with experiments showing their successes also in practice. 1 Introduction The basic machine learning problem of minimizing a regularizer plus a loss function comes in numerous different variations and names. Examples include Ridge Regression, Lasso, Support Vector Machine (SVM), Logistic Regression and many others. A multitude of optimization methods were introduced for these problems, but in most cases specialized to very particular problem settings. Such specializations appear necessary since objective functions for different classification and regularization tasks admin different convexity and smoothness parameters. We list below a few recent algorithms along with their applicable settings. • Variance-reduction methods such as SAGA and SVRG [9, 14] intrinsically require the objective to be smooth, and do not work for non-smooth problems like SVM. This is because for loss functions such as hinge loss, no unbiased gradient estimator can achieve a variance that approaches to zero. • Dual methods such as SDCA or APCG [20, 30] intrinsically require the objective to be strongly convex (SC), and do not directly apply to non-SC problems. This is because for a non-SC objective such as Lasso, its dual is not well-behaved due to the ℓ1 regularizer. • Primal-dual methods such as SPDC [35] require the objective to be both smooth and SC. Many other algorithms are only analyzed for both smooth and SC objectives [7, 16, 17]. In this paper we investigate whether such specializations are inherent. Is it possible to take a convex optimization algorithm designed for one problem, and apply it to different classification or regression settings in a black-box manner? Such a reduction should ideally take full and optimal advantage of the objective properties, namely strong-convexity and smoothness, for each setting. Unfortunately, existing reductions are still very limited for at least two reasons. First, they incur at least a logarithmic factor log(1/ε) in the running time so leading only to suboptimal convergence ∗The full version of this paper can be found on https://arxiv.org/abs/1603.05642. This paper is partially supported by an NSF Grant, no. 1523815, and a Microsoft Research Grant, no. 0518584. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. rates.2 Second, after applying existing reductions, algorithms become biased so the objective value does not converge to the global minimum. These theoretical concerns also translate into running time losses and parameter tuning difficulties in practice. In this paper, we develop new and optimal regularization and smoothing reductions that can • shave off a non-optimal log(1/ε) factor • produce unbiased algorithms Besides such technical advantages, our new reductions also enable researchers to focus on designing algorithms for only one setting but infer optimal results more broadly. This is opposed to results such as [4, 25] where the authors develop ad hoc techniques to tweak specific algorithms, rather than all algorithms, and apply them to other settings without losing extra factors and without introducing bias. Our new reductions also enable researchers to prove lower bounds more broadly [32]. 1.1 Formal Setting and Classical Approaches Consider minimizing a composite objective function min x∈Rd  F(x) def = f(x) + ψ(x) , (1.1) where f(x) is a differentiable convex function and ψ(x) is a relatively simple (but possibly nondifferentiable) convex function, sometimes referred to as the proximal function. Our goal is to find a point x ∈Rd satisfying F(x) ≤F(x∗) + ε, where x∗is a minimizer of F. In most classification and regression problems, f(x) can be written as f(x) = 1 n Pn i=1 fi(⟨x, ai⟩) where each ai ∈Rd is a feature vector. We refer to this as the finite-sum case of (1.1). • CLASSICAL REGULARIZATION REDUCTION. Given a non-SC F(x), one can define a new objective F ′(x) def = F(x) + σ 2 ∥x0 −x∥2 in which σ is on the order of ε. In order to minimize F(x), the classical regularization reduction calls an oracle algorithm to minimize F ′(x) instead, and this oracle only needs to work with SC functions. EXAMPLE. If F is L-smooth, one can apply accelerated gradient descent to minimize F ′ and obtain an algorithm that converges in O( p L/ε log 1 ε) iterations in terms of minimizing the original F. This complexity has a suboptimal dependence on ε and shall be improved using our new regularization reduction. • CLASSICAL SMOOTHING REDUCTION (FINITE-SUM CASE).3 Given a non-smooth F(x) of a finite-sum form, one can define a smoothed variant bfi(α) for each fi(α) and let F ′(x) = 1 n Pn i=1 bfi(⟨ai, x⟩) + ψ(x). 4 In order to minimize F(x), the classical smoothing reduction calls an oracle algorithm to minimize F ′(x) instead, and this oracle only needs to work with smooth functions. EXAMPLE. If F(x) is σ-SC and one applies accelerated gradient descent to minimize F ′, this yields an algorithm that converges in O 1 √σε log 1 ε  iterations for minimizing the original F(x). Again, the additional factor log(1/ε) can be removed using our new smoothing reduction. Besides the non-optimality, applying the above two reductions gives only biased algorithms. One has to tune the regularization or smoothing parameter, and the algorithm only converges to the minimum of the regularized or smoothed problem F ′(x), which can be away from the true minimizer of F(x) by a distance proportional to the parameter. This makes the reduction hard to use in practice. 2Recall that obtaining the optimal convergence rate is one of the main goals in operations research and machine learning. For instance, obtaining the optimal 1/ε rate for online learning was a major breakthrough since the log(1/ε)/ε rate was discovered [13, 15, 26]. 3Smoothing reduction is typically applied to the finite sum form only. This is because, for a general high dimensional function f(x), its smoothed variant bf(x) may not be efficiently computable. 4More formally, one needs this variant to satisfy | bfi(α) −fi(α)| ≤ε for all α and be smooth at the same time. This can be done at least in two classical ways if bfi(α) is Lipschitz continuous. One is to define bfi(α) = Ev∈[−1,1][fi(α + εv)] as an integral of f over the scaled unit interval, see for instance Chapter 2.3 of [12], and the other is to define bfi(α) = maxβ  β · α −f ∗ i (β) −ε 2α2} using the Fenchel dual f ∗ i (β) of fi(α), see for instance [24]. 2 1.2 Our New Results To introduce our new reductions, we first define a property on the oracle algorithm. Our Black-Box Oracle. Consider an algorithm A that minimizes (1.1) when the objective F is L-smooth and σ-SC. We say that A satisfies the homogenous objective decrease (HOOD) property in time Time(L, σ) if, for every starting vector x0, A produces an output x′ satisfying F(x′)−F(x∗) ≤ F (x0)−F (x∗) 4 in time Time(L, σ). In other words, A decreases the objective value distance to the minimum by a constant factor in time Time(L, σ), regardless of how large or small F(x0) −F(x∗) is. We give a few example algorithms that satisfy HOOD: • Gradient descent and accelerated gradient descent satisfy HOOD with Time(L, σ) = O(L/σ)·C and Time(L, σ) = O( p L/σ) · C respectively, where C is the time needed to compute a gradient ∇f(x) and perform a proximal gradient update [23]. Many subsequent works in this line of research also satisfy HOOD, including [3, 7, 16, 17]. • SVRG and SAGA [14, 34] solve the finite-sum form of (1.1) and satisfy HOOD with Time(L, σ) = O n + L/σ  · C1 where C1 is the time needed to compute a stochastic gradient ∇fi(x) and perform a proximal gradient update. • Katyusha [1] solves the finite-sum form of (1.1) and satisfies HOOD with Time(L, σ) = O n + p nL/σ  · C1. AdaptReg. For objectives F(x) that are non-SC and L-smooth, our AdaptReg reduction calls the an oracle satisfying HOOD a logarithmic number of times, each time with a SC objective F(x) + σ 2 ∥x −x0∥2 for an exponentially decreasing value σ. In the end, AdaptReg produces an output bx satisfying F(bx) −F(x∗) ≤ε with a total running time P∞ t=0 Time(L, ε · 2t). Since most algorithms have an inverse polynomial dependence on σ in Time(L, σ), when summing up Time(L, ε · 2t) for positive values t, we do not incur the additional factor log(1/ε) as opposed to the old reduction. In addition, AdaptReg is an unbiased and anytime algorithm. F(bx) converges to F(x∗) as the time goes without the necessity of changing parameters, so the algorithm can be interrupted at any time. We mention some theoretical applications of AdaptReg: • Applying AdaptReg to SVRG, we obtain a running time O n log 1 ε + L ε  · C1 for minimizing finite-sum, non-SC, and smooth objectives (such as Lasso and Logistic Regression). This improves on known theoretical running time obtained by non-accelerated methods, including O n log 1 ε + L ε log 1 ε  · C1 through the old reduction, as well as O n+L ε  · C1 through direct methods such as SAGA [9] and SAG [27]. • Applying AdaptReg to Katyusha, we obtain a running time O n log 1 ε + √ nL √ε  · C1 for minimizing finite-sum, non-SC, and smooth objectives (such as Lasso and Logistic Regression). This is the first and only known stochastic method that converges with the optimal 1/√ε rate (as opposed to log(1/ε)/√ε) for this class of objectives. [1] • Applying AdaptReg to methods that do not originally work for non-SC objectives such as [7, 16, 17], we improve their running times by a factor of log(1/ε) for working with non-SC objectives. AdaptSmooth and JointAdaptRegSmooth. For objectives F(x) that are finite-sum, σ-SC, but non-smooth, our AdaptSmooth reduction calls an oracle satisfying HOOD a logarithmic number of times, each time with a smoothed variant of F (λ)(x) and an exponentially decreasing smoothing parameter λ. In the end, AdaptSmooth produces an output bx satisfying F(bx) −F(x∗) ≤ε with a total running time P∞ t=0 Time( 1 ε·2t , σ). Since most algorithms have a polynomial dependence on L in Time(L, σ), when summing up Time( 1 ε·2t , σ) for positive values t, we do not incur an additional factor of log(1/ε) as opposed to the old reduction. AdaptSmooth is also an unbiased and anytime algorithm for the same reason as AdaptReg. In addition, AdaptReg and AdaptSmooth can effectively work together, to solve finite-sum, non-SC, and non-smooth case of (1.1), and we call this reduction JointAdaptRegSmooth. We mention some theoretical applications of AdaptSmooth and JointAdaptRegSmooth: 3 • Applying AdaptReg to Katyusha, we obtain a running time O n log 1 ε + √n √σε  ·C1 for minimizing finite-sum, SC, and non-smooth objectives (such as SVM). Therefore, Katyusha combined with AdaptReg is the first and only known stochastic method that converges with the optimal 1/√ε rate (as opposed to log(1/ε)/√ε) for this class of objectives. [1] • Applying JointAdaptRegSmooth to Katyusha, we obtain a running time O n log 1 ε + √n ε  · C1 for minimizing finite-sum, SC, and non-smooth objectives (such as L1-SVM). Therefore, Katyusha combined with JointAdaptRegSmooth gives the first and only known stochastic method that converges with the optimal 1/ε rate (as opposed to log(1/ε)/ε) for this class of objectives. [1] Roadmap. We provide notations in Section 2 and discuss related works in Section 3. We propose AdaptReg in Section 4 and AdaptSmooth in Section 5. We leave proofs as well as the description and analysis of JointAdaptRegSmooth to the full version of this paper. We include experimental results in Section 7. 2 Preliminaries In this paper we denote by ∇f(x) the full gradient of f if it is differentiable, or the subgradient if f is only Lipschitz continuous. Recall some classical definitions on strong convexity and smoothness. Definition 2.1 (smoothness and strong convexity). For a convex function f : Rn →R, • f is σ-strongly convex if ∀x, y ∈Rn, it satisfies f(y) ≥f(x) + ⟨∇f(x), y −x⟩+ σ 2 ∥x −y∥2. • f is L-smooth if ∀x, y ∈Rn, it satisfies ∥∇f(x) −∇f(y)∥≤L∥x −y∥. Characterization of SC and Smooth Regimes. In this paper we give numbers to the following 4 categories of objectives F(x) in (1.1). Each of them corresponds to some well-known training problems in machine learning. (Letting (ai, bi) ∈Rd × R be the i-th feature vector and label.) Case 1: ψ(x) is σ-SC and f(x) is L-smooth. Examples: • ridge regression: f(x) = 1 2n Pn i=1(⟨ai, x⟩−bi)2 and ψ(x) = σ 2 ∥x∥2 2. • elastic net: f(x) = 1 2n Pn i=1(⟨ai, x⟩−bi)2 and ψ(x) = σ 2 ∥x∥2 2 + λ∥x∥1. Case 2: ψ(x) is non-SC and f(x) is L-smooth. Examples: • Lasso: f(x) = 1 2n Pn i=1(⟨ai, x⟩−bi)2 and ψ(x) = λ∥x∥1. • logistic regression: f(x) = 1 n Pn i=1 log(1 + exp(−bi⟨ai, x⟩)) and ψ(x) = λ∥x∥1. Case 3: ψ(x) is σ-SC and f(x) is non-smooth (but Lipschitz continuous). Examples: • SVM: f(x) = 1 n Pn i=1 max{0, 1 −bi⟨ai, x⟩} and ψ(x) = σ∥x∥2 2. Case 4: ψ(x) is non-SC and f(x) is non-smooth (but Lipschitz continuous). Examples: • ℓ1-SVM: f(x) = 1 n Pn i=1 max{0, 1 −bi⟨ai, x⟩} and ψ(x) = λ∥x∥1. Definition 2.2 (HOOD property). We say an algorithm A(F, x0) solving Case 1 of problem (1.1) satisfies the homogenous objective decrease (HOOD) property with time Time(L, σ) if, for every starting point x0, it produces output x′ ←A(F, x0) such that F(x′)−minx F(x) ≤F (x0)−minx F (x) 4 in time Time(L, σ).5 In this paper, we denote by C the time needed for computing a full gradient ∇f(x) and performing a proximal gradient update of the form x′ ←arg minx  1 2∥x −x0∥2 + η(⟨∇f(x), x −x0⟩+ ψ(x)) . For the finite-sum case of problem (1.1), we denote by C1 the time needed for computing a stochastic (sub-)gradient ∇fi(⟨ai, x⟩) and performing a proximal gradient update of the form x′ ←arg minx  1 2∥x −x0∥2 + η(⟨∇fi(⟨ai, x⟩)ai, x −x0⟩+ ψ(x)) . For finite-sum forms of (1.1), C is usually on the magnitude of n × C1. 5Although our definition is only for deterministic algorithms, if the guarantee is probabilistic, i.e., E  F(x′)  − minx F(x) ≤F (x0)−minx F (x) 4 , all the results of this paper remain true. Also, the constant 4 is very arbitrary and can be replaced with any other constant bigger than 1. 4 Algorithm 1 The AdaptReg Reduction Input: an objective F(·) in Case 2 (smooth and not necessarily strongly convex); x0 a starting vector, σ0 an initial regularization parameter, T the number of epochs; an algorithm A that solves Case 1 of problem (1.1). Output: bxT . 1: bx0 ←x0. 2: for t ←0 to T −1 do 3: Define F (σt)(x) def = σt 2 ∥x −x0∥+ F(x). 4: bxt+1 ←A(F (σt), bxt). 5: σt+1 ←σt/2. 6: end for 7: return bxT . 3 Related Works Catalyst/APPA [11, 19] turn non-accelerated methods into accelerated ones, which is different from the purpose of this paper. They can be used as regularization reductions from Case 2 to Case 1 (but not from Cases 3 or 4); however, they suffer from two log-factor loss in the running time, and perform poor in practice [1]. In particular, Catalyst/APPA fix the regularization parameter throughout the algorithm but our AdaptReg decreases it exponentially. Their results cannot imply ours. Beck and Teboulle [5] give a reduction from Case 4 to Case 2. Such a reduction does not suffer from a log-factor loss for almost trivial reason: by setting the smoothing parameter λ = ε and applying any O(1/√ε)-convergence method for Case 2, we immediately obtain an O(1/ε) method for Case 4 without an extra log factor. Our main challenge in this paper is to provide log-free reductions to Case 1;6 simple ideas fail to produce log-free reductions in this case because all efficient algorithms solving Case 1 (due to linear convergence) have a log factor. In addition, the Beck-Teboulle reduction is biased but ours is unbiased. The so-called homotopy methods (e.g. methods with geometrically decreasing regularizer/smoothing weights) appeared a lot in the literature [6, 25, 31, 33]. However, to the best of our knowledge, all existing homotopy analysis either only work for specific algorithms [6, 25, 31] or solve only special problems [33]. In other words, none of them provides all-purpose black-box reductions like we do. 4 AdaptReg: Reduction from Case 2 to Case 1 We now focus on solving Case 2 of problem (1.1): that is, f(·) is L-smooth, but ψ(·) is not necessarily SC. We achieve so by reducing the problem to an algorithm A solving Case 1 that satisfies HOOD. AdaptReg works as follows (see Algorithm 1). At the beginning of AdaptReg, we set bx0 to equal x0, an arbitrary given starting vector. AdaptReg consists of T epochs. At each epoch t = 0, 1, . . . , T −1, we define a σt-strongly convex objective F (σt)(x) def = σt 2 ∥x −x0∥2 + F(x). Here, the parameter σt+1 = σt/2 for each t ≥0 and σ0 is an input parameter to AdaptReg that will be specified later. We run A on F (σt)(x) with starting vector bxt in each epoch, and let the output be bxt+1. After all T epochs are finished, AdaptReg simply outputs bxT . We state our main theorem for AdaptReg below and prove it in the full version of this paper. Theorem 4.1 (AdaptReg). Suppose that in problem (1.1) f(·) is L-smooth. Let x0 be a starting vector such that F(x0) −F(x∗) ≤∆and ∥x0 −x∗∥2 ≤Θ. Then, AdaptReg with σ0 = ∆/Θ and T = log2(∆/ε) produces an output bxT satisfying F(bxT ) −minx F(x) ≤O(ε) in a total running time of PT −1 t=0 Time(L, σ0 · 2−t).7 Remark 4.2. We compare the parameter tuning effort needed for AdaptReg against the classical regularization reduction. In the classical reduction, there are two parameters: T, the number of 6Designing reductions to Case 1 (rather than for instance Case 2) is crucial for various reasons. First, algorithm design for Case 1 is usually easier (esp. in stochastic settings). Second, Case 3 can only be reduced to Case 1 but not Case 2. Third, lower bound results [32] require reductions to Case 1. 7If the HOOD property is only satisfied probabilistically as per Footnote 5, our error guarantee becomes probabilistic, i.e., E  F(bxT )  −minx F(x) ≤O(ε). This is also true for other reduction theorems of this paper. 5 iterations that does not need tuning; and σ, which had better equal ε/Θ which is an unknown quantity so requires tuning. In AdaptReg, we also need tune only one parameter, that is σ0. Our T need not be tuned because AdaptReg can be interrupted at any moment and bxt of the current epoch can be outputted. In our experiments later, we spent the same effort turning σ in the classical reduction and σ0 in AdaptReg. As it can be easily seen from the plots, tuning σ0 is much easier than σ. Corollary 4.3. When AdaptReg is applied to SVRG, we solve the finite-sum case of Case 2 with running time PT −1 t=0 Time(L, σ0 · 2−t) = PT −1 t=0 O(n + L2t σ0 ) · C1 = O(n log ∆ ε + LΘ ε ) · C1. This is faster than O n+ LΘ ε  log ∆ ε  ·C1 obtained through the old reduction, and faster than O n+LΘ ε  ·C1 obtained by SAGA [9] and SAG [27]. When AdaptReg is applied to Katyusha, we solve the finite-sum case of Case 2 with running time PT −1 t=0 Time(L, σ0 · 2−t) = PT −1 t=0 O(n + √ nL2t √σ0 ) · C1 = O(n log ∆ ε + p nLΘ/ε) · C1. This is faster than O n + p nL/ε  log ∆ ε  · C1 obtained through the old reduction on Katyusha [1].8 5 AdaptSmooth: Reduction from Case 3 to 1 We now focus on solving the finite-sum form of Case 3 for problem (1.1). Without loss of generality, we assume ∥ai∥= 1 for each i ∈[n] because otherwise one can scale fi accordingly. We solve this problem by reducing it to an oracle A which solves the finite-sum form of Case 1 and satisfies HOOD. Recall the following definition using Fenchel conjugate:9 Definition 5.1. For each function fi : R →R, let f ∗ i (β) def = maxα{α · β −fi(α)} be its Fenchel conjugate. Then, we define the following smoothed variant of fi parameterized by λ > 0: f (λ) i (α) def = maxβ  β · α −f ∗ i (β) −λ 2 β2 . Accordingly, we define F (λ)(x) def = 1 n Pn i=1 f (λ) i (⟨ai, x⟩) + ψ(x) . From the property of Fenchel conjugate (see for instance the textbook [28]), we know that f (λ) i (·) is a (1/λ)-smooth function and therefore the objective F (λ)(x) falls into the finite-sum form of Case 1 for problem (1.1) with smoothness parameter L = 1/λ. Our AdaptSmooth works as follows (see pseudocode in the full version). At the beginning of AdaptSmooth, we set bx0 to equal x0, an arbitrary given starting vector. AdaptSmooth consists of T epochs. At each epoch t = 0, 1, . . . , T −1, we define a (1/λt)-smooth objective F (λt)(x) using Definition 5.1. Here, the parameter λt+1 = λt/2 for each t ≥0 and λ0 is an input parameter to AdaptSmooth that will be specified later. We run A on F (λt)(x) with starting vector bxt in each epoch, and let the output be bxt+1. After all T epochs are finished, AdaptSmooth outputs bxT . We state our main theorem for AdaptSmooth below and prove it the full version of this paper. Theorem 5.2. Suppose that in problem (1.1), ψ(·) is σ strongly convex and each fi(·) is G-Lipschitz continuous. Let x0 be a starting vector such that F(x0) −F(x∗) ≤∆. Then, AdaptSmooth with λ0 = ∆/G2 and T = log2(∆/ε) produces an output bxT satisfying F(bxT ) −minx F(x) ≤O(ε) in a total running time of PT −1 t=0 Time(2t/λ0, σ). Remark 5.3. We emphasize that AdaptSmooth requires less parameter tuning effort than the old reduction for the same reason as in Remark 4.2. Also, AdaptSmooth, when applied to Katyusha, provides the fastest running time on solving the Case 3 finite-sum form of (1.1), similar to Corollary 4.3. 6 JointAdaptRegSmooth: From Case 4 to 1 We show in the full version that AdaptReg and AdaptSmooth can work together to reduce the finite-sum form of Case 4 to Case 1. We call this reduction JointAdaptRegSmooth and it relies on a jointly exponentially decreasing sequence of (σt, λt), where σt is the weight of the convexity parameter that we add on top of F(x), and λt is the smoothing parameter that determines how we 8If the old reduction is applied on APCG, SPDC, or AccSDCA rather than Katyusha, then two log factors will be lost. 9For every explicitly given fi(·), this Fenchel conjugate can be symbolically computed and fed into the algorithm. This pre-process is needed for nearly all known algorithms in order for them to apply to non-smooth settings (such as SVRG, SAGA, SPDC, APCG, SDCA, etc). 6 1E-10 1E-09 1E-08 1E-07 1E-06 1E-05 1E-04 1E-03 1E-02 1E-01 0 20 40 60 80 100 (a) covtype, λ = 10−6 1E-08 1E-07 1E-06 1E-05 1E-04 1E-03 1E-02 1E-01 0 20 40 60 80 100 (b) mnist, λ = 10−5 1E-05 1E-04 1E-03 1E-02 1E-01 1E+00 0 20 40 60 80 100 (c) rcv1, λ = 10−5 Figure 1: Comparing AdaptReg and the classical reduction on Lasso (with ℓ1 regularizer weight λ). y-axis is the objective distance to minimum, and x-axis is the number of passes to the dataset. The blue solid curves represent APCG under the old regularization reduction, and the red dashed curve represents APCG under AdaptReg. For other values of λ, or the results on SDCA, please refer to the full version of this paper. change each fi(·). The analysis is analogous to a careful combination of the proofs for AdaptReg and AdaptSmooth. 7 Experiments We perform experiments to confirm our theoretical speed-ups obtained for AdaptSmooth and AdaptReg. We work on minimizing Lasso and SVM objectives for the following three well-known datasets that can be found on the LibSVM website [10]: covtype, mnist, and rcv1. We defer some dataset and implementation details the full version of this paper. 7.1 Experiments on AdaptReg To test the performance of AdaptReg, consider the Lasso objective which is in Case 2 (i.e. non-SC but smooth). We apply AdaptReg to reduce it to Case 1 and apply either APCG [20], an accelerated method, or (Prox-)SDCA [29, 30], a non-accelerated method. Let us make a few remarks: • APCG and SDCA are both indirect solvers for non-strongly convex objectives and therefore regularization is intrinsically required in order to run them for Lasso or more generally Case 2. • APCG and SDCA do not satisfy HOOD in theory. However, they still benefit from AdaptReg as we shall see, demonstrating the practical value of AdaptReg. A Practical Implementation. In principle, one can implement AdaptReg by setting the termination criteria of the oracle in the inner loop as precisely suggested by the theory, such as setting the number of iterations for SDCA to be exactly T = O(n + L σt ) in the t-th epoch. However, in practice, it is more desirable to automatically terminate the oracle whenever the objective distance to the minimum has been sufficiently decreased. In all of our experiments, we simply compute the duality gap and terminate the oracle whenever the duality gap is below 1/4 times the last recorded duality gap of the previous epoch. For details see the full version of this paper. Experimental Results. For each dataset, we consider three different magnitudes of regularization weights for the ℓ1 regularizer in the Lasso objective. This totals 9 analysis tasks for each algorithm. For each such a task, we first implement the old reduction by adding an additional σ 2 ∥x∥2 term to the Lasso objective and then apply APCG or SDCA. We consider values of σ in the set {10k, 3 · 10k : k ∈Z} and show the most representative six of them in the plots (blue solid curves in Figure 3 and Figure 4). Naturally, for a larger value of σ the old reduction converges faster but to a point that is farther from the exact minimizer because of the bias. We implement AdaptReg where we choose the initial parameter σ0 also from the set {10k, 3 · 10k : k ∈Z} and present the best one in each of 18 plots (red dashed curves in Figure 3 and Figure 4). Due to space limitations, we provide only 3 of the 18 plots for medium-sized λ in the main body of this paper (see Figure 1), and include Figure 3 and 4 only in the full version of this paper. It is clear from our experiments that • AdaptReg is more efficient than the old regularization reduction; • AdaptReg requires no more parameter tuning than the classical reduction; 7 1E-07 1E-06 1E-05 1E-04 1E-03 1E-02 1E-01 1E+00 0 20 40 60 80 100 (a) covtype, σ = 10−5 1E-07 1E-06 1E-05 1E-04 1E-03 1E-02 1E-01 1E+00 0 20 40 60 80 100 (b) mnist, σ = 10−4 1E-04 1E-03 1E-02 1E-01 1E+00 0 20 40 60 80 100 (c) rcv1, σ = 10−4 Figure 2: Comparing AdaptSmooth and the classical reduction on SVM (with ℓ2 regularizer weight λ). y-axis is the objective distance to minimum, and x-axis is the number of passes to the dataset. The blue solid curves represent SVRG under the old smoothing reduction, and the red dashed curve represents SVRG under AdaptSmooth. For other values of σ, please refer to the full version. • AdaptReg is unbiased so simplifies the parameter selection procedure.10 7.2 Experiments on AdaptSmooth To test the performance of AdaptSmooth, consider the SVM objective which is non-smooth but SC. We apply AdaptSmooth to reduce it to Case 1 and apply SVRG [14]. We emphasize that SVRG is an indirect solver for non-smooth objectives and therefore regularization is intrinsically required in order to run SVRG for SVM or more generally for Case 3. A Practical Implementation. In principle, one can implement AdaptSmooth by setting the termination criteria of the oracle in the inner loop as precisely suggested by the theory, such as setting the number of iterations for SVRG to be exactly T = O(n + 1 σλt ) in the t-th epoch. In practice, however, it is more desirable to automatically terminate the oracle whenever the objective distance to the minimum has been sufficiently decreased. In all of our experiments, we simply compute the Euclidean norm of the full gradient of the objective, and terminate the oracle whenever the norm is below 1/3 times the last recorded Euclidean norm of the previous epoch. For details see full version. Experimental Results. For each dataset, we consider three different magnitudes of regularization weights for the ℓ2 regularizer in the SVM objective. This totals 9 analysis tasks. For each such a task, we first implement the old reduction by smoothing the hinge loss functions (using Definition 5.1) with parameter λ > 0 and then apply SVRG. We consider different values of λ in the set {10k, 3 · 10k : k ∈Z} and show the most representative six of them in the plots (blue solid curves in Figure 5). Naturally, for a larger λ, the old reduction converges faster but to a point that is farther from the exact minimizer due to its bias. We then implement AdaptSmooth where we choose the initial smoothing parameter λ0 also from the set {10k, 3 · 10k : k ∈Z} and present the best one in each of the 9 plots (red dashed curves in Figure 5). Due to space limitations, we provide only 3 of the 9 plots for small-sized σ in the main body of this paper (see Figure 2, and include Figure 5 only in full version. It is clear from our experiments that • AdaptSmooth is more efficient than the old smoothing reduction, especially when the desired training error is small; • AdaptSmooth requires no more parameter tuning than the classical reduction; • AdaptSmooth is unbiased and simplifies the parameter selection for the same reason as Footnote 10. References [1] Zeyuan Allen-Zhu. Katyusha: The First Direct Acceleration of Stochastic Gradient Methods. ArXiv e-prints, abs/1603.05953, March 2016. [2] Zeyuan Allen-Zhu and Lorenzo Orecchia. Linear coupling: An ultimate unification of gradient and mirror descent. ArXiv e-prints, abs/1407.1537, July 2014. [3] Zeyuan Allen-Zhu, Peter Richtárik, Zheng Qu, and Yang Yuan. Even faster accelerated coordinate descent using non-uniform sampling. In ICML, 2016. 10It is easy to determine the best σ0 in AdaptReg, and in contrast, in the old reduction if the desired error is somehow changed for the application, one has to select a different σ and restart the algorithm. 8 [4] Zeyuan Allen-Zhu and Yang Yuan. Improved SVRG for Non-Strongly-Convex or Sum-of-Non-Convex Objectives. In ICML, 2016. [5] Amir Beck and Marc Teboulle. Smoothing and first order methods: A unified framework. SIAM Journal on Optimization, 22(2):557–580, 2012. [6] Radu Ioan Bo¸t and Christopher Hendrich. A variable smoothing algorithm for solving convex optimization problems. TOP, 23(1):124–150, 2015. [7] Sébastien Bubeck, Yin Tat Lee, and Mohit Singh. A geometric alternative to Nesterov’s accelerated gradient descent. ArXiv e-prints, abs/1506.08187, June 2015. [8] Antonin Chambolle and Thomas Pock. A first-order primal-dual algorithm for convex problems with applications to imaging. Journal of Mathematical Imaging and Vision, 40(1):120–145, 2011. [9] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. SAGA: A Fast Incremental Gradient Method With Support for Non-Strongly Convex Composite Objectives. In NIPS, 2014. [10] Rong-En Fan and Chih-Jen Lin. LIBSVM Data: Classification, Regression and Multi-label. Accessed: 2015-06. [11] Roy Frostig, Rong Ge, Sham M. Kakade, and Aaron Sidford. Un-regularizing: approximate proximal point and faster stochastic algorithms for empirical risk minimization. In ICML, volume 37, pages 1–28, 2015. [12] Elad Hazan. DRAFT: Introduction to online convex optimimization. Foundations and Trends in Machine Learning, XX(XX):1–168, 2015. [13] Elad Hazan and Satyen Kale. Beyond the regret minimization barrier: Optimal algorithms for stochastic strongly-convex optimization. The Journal of Machine Learning Research, 15(1):2489–2512, 2014. [14] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, NIPS 2013, pages 315–323, 2013. [15] Simon Lacoste-Julien, Mark W. Schmidt, and Francis R. Bach. A simpler approach to obtaining an o(1/t) convergence rate for the projected stochastic subgradient method. ArXiv e-prints, abs/1212.2002, 2012. [16] Yin Tat Lee and Aaron Sidford. Efficient accelerated coordinate descent methods and faster algorithms for solving linear systems. In FOCS, pages 147–156. IEEE, 2013. [17] Laurent Lessard, Benjamin Recht, and Andrew Packard. Analysis and design of optimization algorithms via integral quadratic constraints. CoRR, abs/1408.3595, 2014. [18] Hongzhou Lin. private communication, 2016. [19] Hongzhou Lin, Julien Mairal, and Zaid Harchaoui. A Universal Catalyst for First-Order Optimization. In NIPS, 2015. [20] Qihang Lin, Zhaosong Lu, and Lin Xiao. An Accelerated Proximal Coordinate Gradient Method and its Application to Regularized Empirical Risk Minimization. In NIPS, pages 3059–3067, 2014. [21] Arkadi Nemirovski. Prox-Method with Rate of Convergence O(1/t) for Variational Inequalities with Lipschitz Continuous Monotone Operators and Smooth Convex-Concave Saddle Point Problems. SIAM Journal on Optimization, 15(1):229–251, January 2004. [22] Yurii Nesterov. A method of solving a convex programming problem with convergence rate O(1/k2). In Doklady AN SSSR (translated as Soviet Mathematics Doklady), volume 269, pages 543–547, 1983. [23] Yurii Nesterov. Introductory Lectures on Convex Programming Volume: A Basic course, volume I. Kluwer Academic Publishers, 2004. [24] Yurii Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103(1):127– 152, December 2005. [25] Francesco Orabona, Andreas Argyriou, and Nathan Srebro. Prisma: Proximal iterative smoothing algorithm. arXiv preprint arXiv:1206.2372, 2012. [26] Alexander Rakhlin, Ohad Shamir, and Karthik Sridharan. Making gradient descent optimal for strongly convex stochastic optimization. In ICML, 2012. [27] Mark Schmidt, Nicolas Le Roux, and Francis Bach. Minimizing finite sums with the stochastic average gradient. arXiv preprint arXiv:1309.2388, pages 1–45, 2013. Preliminary version appeared in NIPS 2012. [28] Shai Shalev-Shwartz. Online Learning and Online Convex Optimization. Foundations and Trends in Machine Learning, 4(2):107–194, 2012. [29] Shai Shalev-Shwartz and Tong Zhang. Proximal Stochastic Dual Coordinate Ascent. arXiv preprint arXiv:1211.2717, pages 1–18, 2012. [30] Shai Shalev-Shwartz and Tong Zhang. Stochastic dual coordinate ascent methods for regularized loss minimization. Journal of Machine Learning Research, 14:567–599, 2013. [31] Quoc Tran-Dinh. Adaptive smoothing algorithms for nonsmooth composite convex minimization. arXiv preprint arXiv:1509.00106, 2015. [32] Blake Woodworth and Nati Srebro. Tight Complexity Bounds for Optimizing Composite Objectives. In NIPS, 2016. [33] Lin Xiao and Tong Zhang. A proximal-gradient homotopy method for the sparse least-squares problem. SIAM Journal on Optimization, 23(2):1062–1091, 2013. [34] Lin Xiao and Tong Zhang. A Proximal Stochastic Gradient Method with Progressive Variance Reduction. SIAM Journal on Optimization, 24(4):2057—-2075, 2014. [35] Yuchen Zhang and Lin Xiao. Stochastic Primal-Dual Coordinate Method for Regularized Empirical Risk Minimization. In ICML, 2015. 9
2016
75
6,536
Sequential Neural Models with Stochastic Layers Marco Fraccaro† Søren Kaae Sønderby‡ Ulrich Paquet* Ole Winther†‡ † Technical University of Denmark ‡ University of Copenhagen * Google DeepMind Abstract How can we efficiently propagate uncertainty in a latent state representation with recurrent neural networks? This paper introduces stochastic recurrent neural networks which glue a deterministic recurrent neural network and a state space model together to form a stochastic and sequential neural generative model. The clear separation of deterministic and stochastic layers allows a structured variational inference network to track the factorization of the model’s posterior distribution. By retaining both the nonlinear recursive structure of a recurrent neural network and averaging over the uncertainty in a latent path, like a state space model, we improve the state of the art results on the Blizzard and TIMIT speech modeling data sets by a large margin, while achieving comparable performances to competing methods on polyphonic music modeling. 1 Introduction Recurrent neural networks (RNNs) are able to represent long-term dependencies in sequential data, by adapting and propagating a deterministic hidden (or latent) state [5, 16]. There is recent evidence that when complex sequences such as speech and music are modeled, the performances of RNNs can be dramatically improved when uncertainty is included in their hidden states [3, 4, 7, 11, 12, 15]. In this paper we add a new direction to the explorer’s map of treating the hidden RNN states as uncertain paths, by including the world of state space models (SSMs) as an RNN layer. By cleanly delineating a SSM layer, certain independence properties of variables arise, which are beneficial for making efficient posterior inferences. The result is a generative model for sequential data, with a matching inference network that has its roots in variational auto-encoders (VAEs). SSMs can be viewed as a probabilistic extension of RNNs, where the hidden states are assumed to be random variables. Although SSMs have an illustrious history [24], their stochasticity has limited their widespread use in the deep learning community, as inference can only be exact for two relatively simple classes of SSMs, namely hidden Markov models and linear Gaussian models, neither of which are well-suited to modeling long-term dependencies and complex probability distributions over high-dimensional sequences. On the other hand, modern RNNs rely on gated nonlinearities such as long short-term memory (LSTM) [16] cells or gated recurrent units (GRUs) [6], that let the deterministic hidden state of the RNN act as an internal memory for the model. This internal memory seems fundamental to capturing complex relationships in the data through a statistical model. This paper introduces the stochastic recurrent neural network (SRNN) in Section 3. SRNNs combine the gated activation mechanism of RNNs with the stochastic states of SSMs, and are formed by stacking a RNN and a nonlinear SSM. The state transitions of the SSM are nonlinear and are parameterized by a neural network that also depends on the corresponding RNN hidden state. The SSM can therefore utilize long-term information captured by the RNN. We use recent advances in variational inference to efficiently approximate the intractable posterior distribution over the latent states with an inference network [19, 23]. The form of our variational 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. dt−1 dt dt+1 xt−1 xt xt+1 ut−1 ut ut+1 (a) RNN zt−1 zt zt+1 xt−1 xt xt+1 ut−1 ut ut+1 (b) SSM Figure 1: Graphical models to generate x1:T with a recurrent neural network (RNN) and a state space model (SSM). Diamond-shaped units are used for deterministic states, while circles are used for stochastic ones. For sequence generation, like in a language model, one can use ut = xt−1. approximation is inspired by the independence properties of the true posterior distribution over the latent states of the model, and allows us to improve inference by conveniently using the information coming from the whole sequence at each time step. The posterior distribution over the latent states of the SRNN is highly non-stationary while we are learning the parameters of the model. To further improve the variational approximation, we show that we can construct the inference network so that it only needs to learn how to compute the mean of the variational approximation at each time step given the mean of the predictive prior distribution. In Section 4 we test the performances of SRNN on speech and polyphonic music modeling tasks. SRNN improves the state of the art results on the Blizzard and TIMIT speech data sets by a large margin, and performs comparably to competing models on polyphonic music modeling. Finally, other models that extend RNNs by adding stochastic units will be reviewed and compared to SRNN in Section 5. 2 Recurrent Neural Networks and State Space Models Recurrent neural networks and state space models are widely used to model temporal sequences of vectors x1:T = (x1, x2, . . . , xT ) that possibly depend on inputs u1:T = (u1, u2, . . . , uT ). Both models rest on the assumption that the sequence x1:t of observations up to time t can be summarized by a latent state dt or zt, which is deterministically determined (dt in a RNN) or treated as a random variable which is averaged away (zt in a SSM). The difference in treatment of the latent state has traditionally led to vastly different models: RNNs recursively compute dt = f(dt−1, ut) using a parameterized nonlinear function f, like a LSTM cell or a GRU. The RNN observation probabilities p(xt|dt) are equally modeled with nonlinear functions. SSMs, like linear Gaussian or hidden Markov models, explicitly model uncertainty in the latent process through z1:T . Parameter inference in a SSM requires z1:T to be averaged out, and hence p(zt|zt−1, ut) and p(xt|zt) are often restricted to the exponential family of distributions to make many existing approximate inference algorithms applicable. On the other hand, averaging a function over the deterministic path d1:T in a RNN is a trivial operation. The striking similarity in factorization between these models is illustrated in Figures 1a and 1b. Can we combine the best of both worlds, and make the stochastic state transitions of SSMs nonlinear whilst keeping the gated activation mechanism of RNNs? Below, we show that a more expressive model can be created by stacking a SSM on top of a RNN, and that by keeping them layered, the functional form of the true posterior distribution over z1:T guides the design of a backward-recursive structured variational approximation. 3 Stochastic Recurrent Neural Networks We define a SRNN as a generative model pθ by temporally interlocking a SSM with a RNN, as illustrated in Figure 2a. The joint probability of a single sequence and its latent states, assuming knowledge of the starting states z0 = 0 and d0 = 0, and inputs u1:T , factorizes as 2 dt−1 dt dt+1 zt−1 zt zt+1 xt−1 xt xt+1 ut−1 ut ut+1 (a) Generative model pθ dt−1 dt dt+1 at−1 at at+1 zt−1 zt zt+1 xt−1 xt xt+1 (b) Inference network qφ Figure 2: A SRNN as a generative model pθ for a sequence x1:T . Posterior inference of z1:T and d1:T is done through an inference network qφ, which uses a backward-recurrent state at to approximate the nonlinear dependence of zt on future observations xt:T and states dt:T ; see Equation (7). pθ(x1:T , z1:T , d1:T |u1:T , z0, d0) = pθx(x1:T |z1:T , d1:T ) pθz(z1:T |d1:T , z0) pθd(d1:T |u1:T , d0) = T Y t=1 pθx(xt|zt, dt) pθz(zt|zt−1, dt) pθd(dt|dt−1, ut) . (1) The SSM and RNN are further tied with skip-connections from dt to xt. The joint density in (1) is parameterized by θ = {θx, θz, θd}, which will be adapted together with parameters φ of a so-called “inference network” qφ to best model N independently observed data sequences {xi 1:Ti}N i=1 that are described by the log marginal likelihood or evidence L(θ) = log pθ {xi 1:Ti} | {ui 1:Ti, zi 0, di 0}N i=1  = X i log pθ(xi 1:Ti|ui 1:Ti, zi 0, di 0) = X i Li(θ) . (2) Throughout the paper, we omit superscript i when only one sequence is referred to, or when it is clear from the context. In each log likelihood term Li(θ) in (2), the latent states z1:T and d1:T were averaged out of (1). Integrating out d1:T is done by simply substituting its deterministically obtained value, but z1:T requires more care, and we return to it in Section 3.2. Following Figure 2a, the states d1:T are determined from d0 and u1:T through the recursion dt = fθd(dt−1, ut). In our implementation fθd is a GRU network with parameters θd. For later convenience we denote the value of d1:T , as computed by application of fθd, by ed1:T . Therefore pθd(dt|dt−1, ut) = δ(dt −edt), i.e. d1:T follows a delta distribution centered at ed1:T . Unlike the VRNN [7], zt directly depends on zt−1, as it does in a SSM, via pθz(zt|zt−1, dt). This split makes a clear separation between the deterministic and stochastic parts of pθ; the RNN remains entirely deterministic and its recurrent units do not depend on noisy samples of zt, while the prior over zt follows the Markov structure of SSMs. The split allows us to later mimic the structure of the posterior distribution over z1:T and d1:T in its approximation qφ. We let the prior transition distribution pθz(zt|zt−1, dt) = N(zt; µ(p) t , v(p) t ) be a Gaussian with a diagonal covariance matrix, whose mean and log-variance are parameterized by neural networks that depend on zt−1 and dt, µ(p) t = NN(p) 1 (zt−1, dt) , log v(p) t = NN(p) 2 (zt−1, dt) , (3) where NN denotes a neural network. Parameters θz denote all weights of NN(p) 1 and NN(p) 2 , which are two-layer feed-forward networks in our implementation. Similarly, the parameters of the emission distribution pθx(xt|zt, dt) depend on zt and dt through a similar neural network that is parameterized by θx. 3.1 Variational inference for the SRNN The stochastic variables z1:T of the nonlinear SSM cannot be analytically integrated out to obtain L(θ) in (2). Instead of maximizing L with respect to θ, we maximize a variational evidence lower 3 bound (ELBO) F(θ, φ) = P i Fi(θ, φ) ≤L(θ) with respect to both θ and the variational parameters φ [17]. The ELBO is a sum of lower bounds Fi(θ, φ) ≤Li(θ), one for each sequence i, Fi(θ, φ) = ZZ qφ(z1:T , d1:T |x1:T , A) log pθ(x1:T , z1:T , d1:T |A) qφ(z1:T , d1:T |x1:T , A) dz1:T dd1:T , (4) where A = {u1:T , z0, d0} is a notational shorthand. Each sequence’s approximation qφ shares parameters φ with all others, to form the auto-encoding variational Bayes inference network or variational auto encoder (VAE) [19, 23] shown in Figure 2b. Maximizing F(θ, φ) – which we call “training” the neural network architecture with parameters θ and φ – is done by stochastic gradient ascent, and in doing so, both the posterior and its approximation qφ change simultaneously. All the intractable expectations in (4) would typically be approximated by sampling, using the reparameterization trick [19, 23] or control variates [22] to obtain low-variance estimators of its gradients. We use the reparameterization trick in our implementation. Iteratively maximizing F over θ and φ separately would yield an expectation maximization-type algorithm, which has formed a backbone of statistical modeling for many decades [8]. The tightness of the bound depends on how well we can approximate the i = 1, . . . , N factors pθ(zi 1:Ti, di 1:Ti|xi 1:Ti, Ai) that constitute the true posterior over all latent variables with their corresponding factors qφ(zi 1:Ti, di 1:Ti|xi 1:Ti, Ai). In what follows, we show how qφ could be judiciously structured to match the posterior factors. We add initial structure to qφ by noticing that the prior pθd(d1:T |u1:T , d0) in the generative model is a delta function over ed1:T , and so is the posterior pθ(d1:T |x1:T , u1:T , d0). Consequently, we let the inference network use exactly the same deterministic state setting ed1:T as that of the generative model, and we decompose it as qφ(z1:T , d1:T |x1:T , u1:T , z0, d0) = qφ(z1:T |d1:T , x1:T , z0) q(d1:T |x1:T , u1:T , d0) | {z } = pθd(d1:T |u1:T ,d0) . (5) This choice exactly approximates one delta-function by itself, and simplifies the ELBO by letting them cancel out. By further taking the outer average in (4), one obtains Fi(θ, φ) = Eqφ h log pθ(x1:T |z1:T , ed1:T ) i −KL  qφ(z1:T |ed1:T , x1:T , z0) pθ(z1:T |ed1:T , z0)  , (6) which still depends on θd, u1:T and d0 via ed1:T . The first term is an expected log likelihood under qφ(z1:T |ed1:T , x1:T , z0), while KL denotes the Kullback-Leibler divergence between two distributions. Having stated the second factor in (5), we now turn our attention to parameterizing the first factor in (5) to resemble its posterior equivalent, by exploiting the temporal structure of pθ. 3.2 Exploiting the temporal structure The true posterior distribution of the stochastic states z1:T , given both the data and the deterministic states d1:T , factorizes as pθ(z1:T |d1:T , x1:T , u1:T , z0) = Q t pθ(zt|zt−1, dt:T , xt:T ). This can be verified by considering the conditional independence properties of the graphical model in Figure 2a using d-separation [13]. This shows that, knowing zt−1, the posterior distribution of zt does not depend on the past outputs and deterministic states, but only on the present and future ones; this was also noted in [20]. Instead of factorizing qφ as a mean-field approximation across time steps, we keep the structured form of the posterior factors, including zt’s dependence on zt−1, in the variational approximation qφ(z1:T |d1:T , x1:T , z0) = Y t qφ(zt|zt−1, dt:T , xt:T ) = Y t qφz(zt|zt−1, at = gφa(at+1, [dt, xt])) , (7) where [dt, xt] is the concatenation of the vectors dt and xt. The graphical model for the inference network is shown in Figure 2b. Apart from the direct dependence of the posterior approximation at time t on both dt:T and xt:T , the distribution also depends on d1:t−1 and x1:t−1 through zt−1. We mimic each posterior factor’s nonlinear long-term dependence on dt:T and xt:T through a backwardrecurrent function gφa, shown in (7), which we will return to in greater detail in Section 3.3. The inference network in Figure 2b is therefore parameterized by φ = {φz, φa} and θd. In (7) all time steps are taken into account when constructing the variational approximation at time t; this can therefore be seen as a smoothing problem. In our experiments we also consider filtering, 4 where only the information up to time t is used to define qφ(zt|zt−1, dt, xt). As the parameters φ are shared across time steps, we can easily handle sequences of variable length in both cases. As both the generative model and inference network factorize over time steps in (1) and (7), the ELBO in (6) separates as a sum over the time steps Fi(θ, φ) = X t Eq∗ φ(zt−1) h Eqφ(zt|zt−1,edt:T ,xt:T )  log pθ(xt|zt, edt)  + −KL  qφ(zt|zt−1, edt:T , xt:T ) pθ(zt|zt−1, edt) i , (8) where q∗ φ(zt−1) denotes the marginal distribution of zt−1 in the variational approximation to the posterior qφ(z1:t−1|ed1:T , x1:T , z0), given by q∗ φ(zt−1) = Z qφ(z1:t−1|ed1:T , x1:T , z0) dz1:t−2 = Eq∗ φ(zt−2) h qφ(zt−1|zt−2, edt−1:T , xt−1:T ) i . (9) We can interpret (9) as having a VAE at each time step t, with the VAE being conditioned on the past through the stochastic variable zt−1. To compute (8), the dependence on zt−1 needs to be integrated out, using our posterior knowledge at time t −1 which is given by q∗ φ(zt−1). We approximate the outer expectation in (8) using a Monte Carlo estimate, as samples from q∗ φ(zt−1) can be efficiently obtained by ancestral sampling. The sequential formulation of the inference model in (7) allows such samples to be drawn and reused, as given a sample z(s) t−2 from q∗ φ(zt−2), a sample z(s) t−1 from qφ(zt−1|z(s) t−2, edt−1:T , xt−1:T ) will be distributed according to q∗ φ(zt−1). 3.3 Parameterization of the inference network The variational distribution qφ(zt|zt−1, dt:T , xt:T ) needs to approximate the dependence of the true posterior pθ(zt|zt−1, dt:T , xt:T ) on dt:T and xt:T , and as alluded to in (7), this is done by running a RNN with inputs edt:T and xt:T backwards in time. Specifically, we initialize the hidden state of the backward-recursive RNN in Figure 2b as aT +1 = 0, and recursively compute at = gφa(at+1, [edt, xt]). The function gφa represents a recurrent neural network with, for example, LSTM or GRU units. Each sequence’s variational approximation factorizes over time with qφ(z1:T |d1:T , x1:T , z0) = Q t qφz(zt|zt−1, at), as shown in (7). We let qφz(zt|zt−1, at) be a Gaussian with diagonal covariance, whose mean and the log-variance are parameterized with φz as µ(q) t = NN(q) 1 (zt−1, at) , log v(q) t = NN(q) 2 (zt−1, at) . (10) Instead of smoothing, we can also do filtering by using a neural network to approximate the dependence of the true posterior pθ(zt|zt−1, dt, xt) on dt and xt, through for instance at = NN(a)(dt, xt). Improving the posterior approximation. In our experiments we found that during training, the parameterization introduced in (10) can lead to small values of the KL term KL(qφ(zt|zt−1, at) ∥pθ(zt|zt−1, edt)) in the ELBO in (8). This happens when gφ in the inference network does not rely on the information propagated back from future outputs in at, but it is mostly using the hidden state edt to imitate the behavior of the prior. The inference network could therefore get stuck by trying to optimize the ELBO through sampling from the prior of the model, making the variational approximation to the posterior useless. To overcome this issue, we directly include some knowledge of the predictive prior dynamics in the parameterization of the inference network, using our approximation of the posterior distribution q∗ φ(zt−1) over the previous latent states. In the spirit of sequential Monte Carlo methods [10], we improve the parameterization of qφ(zt|zt−1, at) by using q∗ φ(zt−1) from (9). As we are constructing the variational distribution sequentially, we approximate the predictive prior mean, i.e. our “best guess” on the prior dynamics of zt, as bµ(p) t = Z NN(p) 1 (zt−1, dt) p(zt−1|x1:T ) dzt−1 ≈ Z NN(p) 1 (zt−1, dt) q∗ φ(zt−1) dzt−1 , (11) where we used the parameterization of the prior distribution in (3). We estimate the integral required to compute bµ(p) t by reusing the samples that were needed for the Monte Carlo estimate of the ELBO 5 in (8). This predictive prior mean can then be used in the parameterization of the mean of the variational approximation qφ(zt|zt−1, at), µ(q) t = bµ(p) t + NN(q) 1 (zt−1, at) , (12) Algorithm 1 Inference of SRNN with Resq parameterization from (12). 1: inputs: ed1:T and a1:T 2: initialize z0 3: for t = 1 to T do 4: bµ(p) t = NN(p) 1 (zt−1, edt) 5: µ(q) t = bµ(p) t + NN(q) 1 (zt−1, at) 6: log v(q) t = NN(q) 2 (zt−1, at) 7: zt ∼N(zt; µ(q) t , v(q) t ) 8: end for and we refer to this parameterization as Resq in the results in Section 4. Rather than directly learning µ(q) t , we learn the residual between bµ(p) t and µ(q) t . It is straightforward to show that with this parameterization the KL-term in (8) will not depend on bµ(p) t , but only on NN(q) 1 (zt−1, at). Learning the residual improves inference, making it seemingly easier for the inference network to track changes in the generative model while the model is trained, as it will only have to learn how to “correct” the predictive prior dynamics by using the information coming from edt:T and xt:T . We did not see any improvement in results by parameterizing log v(q) t in a similar way. The inference procedure of SRNN with Resq parameterization for one sequence is summarized in Algorithm 1. 4 Results In this section the SRNN is evaluated on the modeling of speech and polyphonic music data, as they have shown to be difficult to model without a good representation of the uncertainty in the latent states [3, 7, 11, 12, 15]. We test SRNN on the Blizzard [18] and TIMIT raw audio data sets (Table 1) used in [7]. The preprocessing of the data sets and the testing performance measures are identical to those reported in [7]. Blizzard is a dataset of 300 hours of English, spoken by a single female speaker. TIMIT is a dataset of 6300 English sentences read by 630 speakers. As done in [7], for Blizzard we report the average log-likelihood for half-second sequences and for TIMIT we report the average log likelihood per sequence for the test set sequences. Note that the sequences in the TIMIT test set are on average 3.1s long, and therefore 6 times longer than those in Blizzard. For the raw audio datasets we use a fully factorized Gaussian output distribution. Additionally, we test SRNN for modeling sequences of polyphonic music (Table 2), using the four data sets of MIDI songs introduced in [4]. Each data set contains more than 7 hours of polyphonic music of varying complexity: folk tunes (Nottingham data set), the four-part chorales by J. S. Bach (JSB chorales), orchestral music (MuseData) and classical piano music (Piano-midi.de). For polyphonic music we use a Bernoulli output distribution to model the binary sequences of piano notes. In our experiments we set ut = xt−1, but ut could also be used to represent additional input information to the model. All models where implemented using Theano [2], Lasagne [9] and Parmesan1. Training using a NVIDIA Titan X GPU took around 1.5 hours for TIMIT, 18 hours for Blizzard, less than 15 minutes for the JSB chorales and Piano-midi.de data sets, and around 30 minutes for the Nottingham and MuseData data sets. To reduce the computational requirements we use only 1 sample to approximate all the intractable expectations in the ELBO (notice that the KL term can be computed analytically). Further implementation and experimental details can be found in the Supplementary Material. Blizzard and TIMIT. Table 1 compares the average log-likelihood per test sequence of SRNN to the results from [7]. For RNNs and VRNNs the authors of [7] test two different output distributions, namely a Gaussian distribution (Gauss) and a Gaussian Mixture Model (GMM). VRNN-I differs from the VRNN in that the prior over the latent variables is independent across time steps, and it is therefore similar to STORN [3]. For SRNN we compare the smoothing and filtering performance (denoted as smooth and filt in Table 1), both with the residual term from (12) and without it (10) (denoted as Resq if present). We prefer to only report the more conservative evidence lower bound for SRNN, as the approximation of the log-likelihood using standard importance sampling is known to be difficult to compute accurately in the sequential setting [10]. We see from Table 1 that SRNN outperforms all the competing methods for speech modeling. As the test sequences in TIMIT are on average more than 6 times longer than the ones for Blizzard, the results obtained with SRNN for 1github.com/casperkaae/parmesan. The code for SRNN is available at github.com/marcofraccaro/srnn. 6 Models Blizzard TIMIT SRNN (smooth+Resq) ≥11991 ≥60550 SRNN (smooth) ≥10991 ≥59269 SRNN (filt+Resq) ≥10572 ≥52126 SRNN (filt) ≥10846 ≥50524 VRNN-GMM ≥9107 ≥28982 ≈9392 ≈29604 VRNN-Gauss ≥9223 ≥28805 ≈9516 ≈30235 VRNN-I-Gauss ≥8933 ≥28340 ≈9188 ≈29639 RNN-GMM 7413 26643 RNN-Gauss 3539 -1900 Table 1: Average log-likelihood per sequence on the test sets. For TIMIT the average test set length is 3.1s, while the Blizzard sequences are all 0.5s long. The non-SRNN results are reported as in [7]. Smooth: gφa is a GRU running backwards; filt: gφa is a feed-forward network; Resq: parameterization with residual in (12). Figure 3: Visualization of the average KL term and reconstructions of the output mean and log-variance for two examples from the Blizzard test set. Models Nottingham JSB chorales MuseData Piano-midi.de SRNN (smooth+Resq) ≥−2.94 ≥−4.74 ≥−6.28 ≥−8.20 TSBN ≥−3.67 ≥−7.48 ≥−6.81 ≥−7.98 NASMC ≈−2.72 ≈−3.99 ≈−6.89 ≈−7.61 STORN ≈−2.85 ≈−6.91 ≈−6.16 ≈−7.13 RNN-NADE ≈−2.31 ≈−5.19 ≈−5.60 ≈−7.05 RNN ≈−4.46 ≈−8.71 ≈−8.13 ≈−8.37 Table 2: Average log-likelihood on the test sets. The TSBN results are from [12], NASMC from [15], STORN from [3], RNN-NADE and RNN from [4]. TIMIT are in line with those obtained for Blizzard. The VRNN, which performs well when the voice of the single speaker from Blizzard is modeled, seems to encounter difficulties when modeling the 630 speakers in the TIMIT data set. As expected, for SRNN the variational approximation that is obtained when future information is also used (smoothing) is better than the one obtained by filtering. Learning the residual between the prior mean and the mean of the variational approximation, given in (12), further improves the performance in 3 out of 4 cases. In the first two lines of Figure 3 we plot two raw signals from the Blizzard test set and the average KL term between the variational approximation and the prior distribution. We see that the KL term increases whenever there is a transition in the raw audio signal, meaning that the inference network is using the information coming from the output symbols to improve inference. Finally, the reconstructions of the output mean and log-variance in the last two lines of Figure 3 look consistent with the original signal. Polyphonic music. Table 2 compares the average log-likelihood on the test sets obtained with SRNN and the models introduced in [3, 4, 12, 15]. As done for the speech data, we prefer to report the more conservative estimate of the ELBO in Table 2, rather than approximating the log-likelihood with importance sampling as some of the other methods do. We see that SRNN performs comparably to other state of the art methods in all four data sets. We report the results using smoothing and learning the residual between the mean of the predictive prior and the mean of the variational approximation, but the performances using filtering and directly learning the mean of the variational approximation are now similar. We believe that this is due to the small amount of data and the fact that modeling MIDI music is much simpler than modeling raw speech signals. 7 5 Related work A number of works have extended RNNs with stochastic units to model motion capture, speech and music data [3, 7, 11, 12, 15]. The performances of these models are highly dependent on how the dependence among stochastic units is modeled over time, on the type of interaction between stochastic units and deterministic ones, and on the procedure that is used to evaluate the typically intractable log likelihood. Figure 4 highlights how SRNN differs from some of these works. In STORN [3] (Figure 4a) and DRAW [14] the stochastic units at each time step have an isotropic Gaussian prior and are independent between time steps. The stochastic units are used as an input to the deterministic units in a RNN. As in our work, the reparameterization trick [19, 23] is used to optimize an ELBO. dt dt−1 xt ut zt (a) STORN zt−1 dt dt−1 zt xt ut (b) VRNN zt−1 zt xt ut (c) Deep Kalman Filter Figure 4: Generative models of x1:T that are related to SRNN. For sequence modeling it is typical to set ut = xt−1. The authors of the VRNN [7] (Figure 4b) note that it is beneficial to add information coming from the past states to the prior over latent variables zt. The VRNN lets the prior pθz(zt|dt) over the stochastic units depend on the deterministic units dt, which in turn depend on both the deterministic and the stochastic units at the previous time step through the recursion dt = f(dt−1, zt−1, ut). The SRNN differs by clearly separating the deterministic and stochastic part, as shown in Figure 2a. The separation of deterministic and stochastic units allows us to improve the posterior approximation by doing smoothing, as the stochastic units still depend on each other when we condition on d1:T . In the VRNN, on the other hand, the stochastic units are conditionally independent given the states d1:T . Because the inference and generative networks in the VRNN share the deterministic units, the variational approximation would not improve by making it dependent on the future through at, when calculated with a backward GRU, as we do in our model. Unlike STORN, DRAW and VRNN, the SRNN separates the “noisy” stochastic units from the deterministic ones, forming an entire layer of interconnected stochastic units. We found in practice that this gave better performance and was easier to train. The works by [1, 20] (Figure 4c) show that it is possible to improve inference in SSMs by using ideas from VAEs, similar to what is done in the stochastic part (the top layer) of SRNN. Towards the periphery of related works, [15] approximates the log likelihood of a SSM with sequential Monte Carlo, by learning flexible proposal distributions parameterized by deep networks, while [12] uses a recurrent model with discrete stochastic units that is optimized using the NVIL algorithm [21]. 6 Conclusion This work has shown how to extend the modeling capabilities of recurrent neural networks by combining them with nonlinear state space models. Inspired by the independence properties of the intractable true posterior distribution over the latent states, we designed an inference network in a principled way. The variational approximation for the stochastic layer was improved by using the information coming from the whole sequence and by using the Resq parameterization to help the inference network to track the non-stationary posterior. SRNN achieves state of the art performances on the Blizzard and TIMIT speech data set, and performs comparably to competing methods for polyphonic music modeling. Acknowledgements We thank Casper Kaae Sønderby and Lars Maaløe for many fruitful discussions, and NVIDIA Corporation for the donation of TITAN X and Tesla K40 GPUs. Marco Fraccaro is supported by Microsoft Research through its PhD Scholarship Programme. 8 References [1] E. Archer, I. M. Park, L. Buesing, J. Cunningham, and L. Paninski. Black box variational inference for state space models. arXiv:1511.07367, 2015. [2] F. Bastien, P. Lamblin, R. Pascanu, J. Bergstra, I. Goodfellow, A. Bergeron, N. Bouchard, D. Warde-Farley, and Y. Bengio. Theano: new features and speed improvements. arXiv:1211.5590, 2012. [3] J. Bayer and C. Osendorfer. Learning stochastic recurrent networks. arXiv:1411.7610, 2014. [4] N. Boulanger-Lewandowski, Y. Bengio, and P. Vincent. Modeling temporal dependencies in highdimensional sequences: Application to polyphonic music generation and transcription. arXiv:1206.6392, 2012. [5] 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, pages 1724–1734, 2014. [6] J. Chung, C. Gulcehre, K. Cho, and Y. Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv:1412.3555, 2014. [7] J. Chung, K. Kastner, L. Dinh, K. Goel, A. C. Courville, and Y. Bengio. A recurrent latent variable model for sequential data. In NIPS, pages 2962–2970, 2015. [8] A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum likelihood from incomplete data via the EM algorithm. Journal of the Royal Statistical Society, Series B, 39(1), 1977. [9] S. Dieleman, J. Schlüter, C. Raffel, E. Olson, S. K. Sønderby, D. Nouri, E. Battenberg, and A. van den Oord. Lasagne: First release, 2015. [10] A. Doucet, N. de Freitas, and N. Gordon. An introduction to sequential Monte Carlo methods. In Sequential Monte Carlo Methods in Practice, Statistics for Engineering and Information Science. 2001. [11] O. Fabius and J. R. van Amersfoort. Variational recurrent auto-encoders. arXiv:1412.6581, 2014. [12] Z. Gan, C. Li, R. Henao, D. E. Carlson, and L. Carin. Deep temporal sigmoid belief networks for sequence modeling. In NIPS, pages 2458–2466, 2015. [13] D. Geiger, T. Verma, and J. Pearl. Identifying independence in Bayesian networks. Networks, 20:507–534, 1990. [14] K. Gregor, I. Danihelka, A. Graves, and D. Wierstra. DRAW: A recurrent neural network for image generation. In ICML, 2015. [15] S. Gu, Z. Ghahramani, and R. E. Turner. Neural adaptive sequential Monte Carlo. In NIPS, pages 2611–2619, 2015. [16] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735–1780, Nov. 1997. [17] M. I. Jordan, Z. Ghahramani, T. S. Jaakkola, and L. K. Saul. An introduction to variational methods for graphical models. Machine Learning, 37(2):183–233, 1999. [18] S. King and V. Karaiskos. The Blizzard challenge 2013. In The Ninth Annual Blizzard Challenge, 2013. [19] D. Kingma and M. Welling. Auto-encoding variational Bayes. In ICLR, 2014. [20] R. G. Krishnan, U. Shalit, and D. Sontag. Deep Kalman filters. arXiv:1511.05121, 2015. [21] A. Mnih and K. Gregor. Neural variational inference and learning in belief networks. arXiv:1402.0030, 2014. [22] J. W. Paisley, D. M. Blei, and M. I. Jordan. Variational Bayesian inference with stochastic search. In ICML, 2012. [23] D. J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, pages 1278–1286, 2014. [24] S. Roweis and Z. Ghahramani. A unifying review of linear Gaussian models. Neural Computation, 11(2):305–45, 1999. 9
2016
76
6,537
Iterative Refinement of the Approximate Posterior for Directed Belief Networks R Devon Hjelm University of New Mexico and the Mind Research Network dhjelm@mrn.org Kyunghyun Cho Courant Institute & Center for Data Science, New York University kyunghyun.cho@nyu.edu Junyoung Chung University of Montreal junyoung.chung@umontreal.ca Russ Salakhutdinov Carnegie Melon University rsalakhu@cs.toronto.edu Vince Calhoun University of New Mexico and the Mind Research Network vcalhoun@mrn.org Nebojsa Jojic Microsoft Research jojic@microsoft.com Abstract Variational methods that rely on a recognition network to approximate the posterior of directed graphical models offer better inference and learning than previous methods. Recent advances that exploit the capacity and flexibility in this approach have expanded what kinds of models can be trained. However, as a proposal for the posterior, the capacity of the recognition network is limited, which can constrain the representational power of the generative model and increase the variance of Monte Carlo estimates. To address these issues, we introduce an iterative refinement procedure for improving the approximate posterior of the recognition network and show that training with the refined posterior is competitive with state-of-the-art methods. The advantages of refinement are further evident in an increased effective sample size, which implies a lower variance of gradient estimates. 1 Introduction Variational methods have surpassed traditional methods such as Markov chain Monte Carlo [MCMC, 15] and mean-field coordinate ascent [25] as the de-facto standard approach for training directed graphical models. Helmholtz machines [3] are a type of directed graphical model that approximate the posterior distribution with a recognition network that provides fast inference as well as flexible learning which scales well to large datasets. Many recent significant advances in training Helmholtz machines come as estimators for the gradient of the objective w.r.t. the approximate posterior. The most successful of these methods, variational autoencoders [VAE, 12], relies on a re-parameterization of the latent variables to pass the learning signal to the recognition network. This type of parameterization, however, is not available with discrete units, and the naive Monte Carlo estimate of the gradient has too high variance to be practical [3, 12]. However, good estimators are available through importance sampling [1], input-dependent baselines [13], a combination baselines and importance sampling [14], and parametric Taylor expansions [9]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Each of these methods strive to be a lower-variance and unbiased gradient estimator. However, the reliance on the recognition network means that the quality of learning is bounded by the capacity of the recognition network, which in turn raises the variance. We demonstrate reducing the variance of Monte Carlo based estimators by iteratively refining the approximate posterior provided by the recognition network. The complete learning algorithm follows expectation-maximization [EM, 4, 16], where in the E-step the variational parameters of the approximate posterior are initialized using the recognition network, then iteratively refined. The refinement procedure provides an asymptotically-unbiased estimate of the variational lowerbound, which is tight w.r.t. the true posterior and can be used to easily train both the recognition network and generative model during the M-step. The variance-reducing refinement is available to any directed graphical model and can give a more accurate estimate of the log-likelihood of the model. For the iterative refinement step, we use adaptive importance sampling [AIS, 17]. We demonstrate the proposed refinement procedure is effective for training directed belief networks, providing a better or competitive estimates of the log-likelihood. We also demonstrate the improved posterior from refinement can improve inference and accuracy of evaluation for models trained by other methods. 2 Directed Belief Networks and Variational Inference A directed belief network is a generative directed graphical model consisting of a conditional density p(x|h) and a prior p(h), such that the joint density can be expressed as p(x, h) = p(x|h)p(h). In particular, the joint density factorizes into a hierarchy of conditional densities and a prior: p(x, h) = p(x|h1)p(hL) QL−1 l=1 p(hl|hl+1), where p(hl|hl+1) is the conditional density at the l-th layer and p(hL) is a prior distribution of the top layer. Sampling from the model can be done simply via ancestral-sampling, first sampling from the prior, then subsequently sampling from each layer until reaching the observation, x. This latent variable structure can improve model capacity, but inference can still be intractable, as is the case in sigmoid belief networks [SBN, 15], deep belief networks [DBN, 11], deep autoregressive networks [DARN, 7], and other models in which each of the conditional distributions involves complex nonlinear functions. 2.1 Variational Lowerbound of Directed Belief Network The objective we consider is the likelihood function, p(x; φ), where φ represent parameters of the generative model (e.g. a directed belief network). Estimating the likelihood function given the joint distribution, p(x, h; φ), above is not generally possible as it requires intractable marginalization over h. Instead, we introduce an approximate posterior, q(h|x), as a proposal distribution. In this case, the log-likelihood can be bounded from below∗: log p(x) = X h log p(x, h) ≥ X h q(h|x) log p(x, h) q(h|x) = Eq(h|x)  log p(x, h) q(h|x)  := L1, (1) where we introduce the subscript in the lowerbound to make the connection to importance sampling later. The bound is tight (e.g., L1 = log p(x)) when the KL divergence between the approximate and true posterior is zero (e.g., DKL(q(h|x)||p(h|x)) = 0). The gradients of the lowerbound w.r.t. the generative model can be approximated using the Monte Carlo approximation of the expectation: ∇φL1 ≈1 K K X k=1 ∇φ log p(x, h(k); φ), h(k) ∼q(h|x). (2) The success of variational inference lies on the choice of approximate posterior, as poor choice can result in a looser variational bound. A deep feed-forward recognition network parameterized by ψ has become a popular choice, such that q(h|x) = q(h|x; ψ), as it offers fast and flexible data-dependent inference [see, e.g., 22, 12, 13, 20]. Generally known as a “Helmholtz machine” [3], these approaches often require additional tricks to train, as the naive Monte Carlo gradient of the lowerbound w.r.t. the variational parameters has high variance. In addition, the variational lowerbound in Eq. (1) is constrained by the assumptions implicit in the choice of approximate posterior, as the approximate posterior must be within the capacity of the recognition network and factorial. ∗For clarity of presentation, we will often omit dependence on parameters φ of the generative model, so that p(x, h) = p(x, h; φ) 2 Figure 1: Iterative refinement for variational inference. An initial estimate of the variational parameters is made through a recognition network. The variational parameters are then updated iteratively, maximizing the lowerbound. The final approximate posterior is used to train the generative model by sampling. The recognition network parameters are updated using the KL divergence between the refined posterior qk and the output of the recognition network q0. 2.2 Importance Sampled Variational lowerbound These assumptions can be relaxed by using an unbiased K-sampled importance weighted estimate of the likelihood function (see [2] for details): L1 ≤LK = 1 K X k=1 p(x, h(k)) q(h(k)|x) = 1 K X k=1 w(k) ≤p(x), (3) where h(k) ∼q(h|x) and w(k) are the importance weights. This lowerbound is tighter than the single-sample version provided in Eq. (1) and is an asymptotically unbiased estimate of the likelihood as K →∞. The gradient of the lowerbound w.r.t. the model parameters φ is simple and can be estimated as: ∇φLK = K X k=1 ˜w(k)∇φ log p(x, h(k); φ), where ˜w(k) = w(k) PK k′=1 w(k′) . (4) The estimator in Eq. (3) can reduce the variance of the gradients, ∇ψLK, but in general additional variance reduction is needed [14]. Alternatively, importance sampling yields an estimate of the inclusive KL divergence, DKL(p(h|x)||q(h|x)), which can be used for training parameters ψ of the recognition network [1]. However, it is well known that importance sampling can yield heavilyskewed distributions over the importance weights [5], so that only a small number of the samples will effectively have non-zero weight. This is consequential not only in training, but also for evaluating models when using Eq. (3) to estimate test log-probabilities, which requires drawing a very large number of samples (N ≥100, 000 in the literature for models trained on MNIST [7]). The effective samples size, ne, of importance-weighted estimates increases and is optimal when the approximate posterior matches the true posterior: ne = PK k=1 w(k)2 PK k=1(w(k))2 ≤ PK k=1 p(x, h(k))/p(h(k)|x) 2 PK k=1 p(x, h(k))/p(h(k)|x) 2 ≤(Kp(x))2 Kp(x)2 = K. (5) Conversely, importance sampling from a poorer approximate posterior will have lower effective sampling size, resulting in higher variance of the gradient estimates. In order to improve the effectiveness of importance sampling, we need a method for improving the approximate posterior from those provided by the recognition network. 3 Iterative Refinement for Variational Inference (IRVI) To address the above issues, iterative refinement for variational inference (IRVI) uses the recognition network as a preliminary guess of the posterior, then refines the posterior through iterative updates of the variational parameters. For the refinement step, IRVI uses a stochastic transition operator, g(.), that maximizes the variational lowerbound. 3 An overview of IRVI is available in Figure 1. For the expectation (E)-step, we feed the observation x through the recognition network to get the initial parameters, µ0, of the approximate posterior, q0(h|x; ψ). We then refine µ0 by applying T updates to the variational parameters, µt+1 = g(µt, x), iterating through T parameterizations µ1, . . . , µT of the approximate posterior qt(h|x). With the final set of parameters, µT , the gradient estimate of the recognition parameters ψ in the maximization (M)-step is taken w.r.t the negative exclusive KL divergence: −∇ψDKL(qT (h|x)||q0(h|x; ψ)) ≈1 K K X k=1 ∇ψ log q0(h(k)|x; ψ), (6) where h(k) ∼qT (h|x). Similarly, the gradients w.r.t. the parameters of the generative model φ follow Eqs. (2) or (4) using samples from the refined posterior qT (h|x). As an alternative to Eq. (6), we can maximize the negative inclusive KL divergence using the refined approximate posterior: −∇ψDKL(p(h|x)||q0(h|x; ψ)) ≈ K X k=1 ˜w(k)∇ψ log q0(h(k)|x; ψ). (7) The form of the IRVI transition operator, g(µt, x), depends on the problem. In the case of continuous variables, we can make use of the VAE re-parameterization with the gradient of the lowerbound in Eq. (1) for our refinement step (see supplementary material). However, as this is not available with discrete units, we take a different approach that relies on adaptive importance sampling. 3.1 Adaptive Importance Refinement (AIR) Adaptive importance sampling [AIS, 17] provides a general approach for iteratively refining the variational parameters. For Bernoulli distributions, we observe that the mean parameter of the true posterior, ˆµ, can be written as the expected value of the latent variables: ˆµ = Ep(h|x) [h] = X h h p(h|x) = 1 p(x) X h q(h|x) h p(x, h) q(h|x) ≈ K X k=1 ˜w(k)h(k). (8) As the initial estimator typically has high variance, AIS iteratively moves µt toward ˆµ by applying Eq. 8 until a stopping criteria is met. While using the update, g(µt, x, γ) = PK k=1 ˜w(k)h(k) in principle works, a convex combination of importance sample estimate of the current step and the parameters from the previous step tends to be more stable: h(m) ∼Bernoulli(µk); µt+1 = g(µt, x, γ) = (1 −γ)µt + γ K X k=1 ˜w(k)h(k). (9) Here, γ is the inference rate and (1 −γ) can be thought of as the adaptive “damping” rate. This approach, which we call adaptive importance refinement (AIR), should work with any discrete parametric distribution. Although AIR is applicable with continuous Gaussian variables, which model second-order statistics, we leave adapting AIR to continuous latent variables for future work. 3.2 Algorithm and Complexity The general AIR algorithm follows Algorithm 1 with gradient variations following Eqs. (2), (4), (6), and (7). While iterative refinement may reduce the variance of stochastic gradient estimates and speed up learning, it comes at a computational cost, as each update is T times more expensive than fixed approximations. However, in addition to potential learning benefits, AIR can also improve the approximate posterior of an already trained directed belief networks at test, independent on how the model was trained. Our implementation following Algorithm 1 is available at https://github.com/rdevon/IRVI. 4 Related Work Adaptive importance refinement (AIR) trades computation for expressiveness and is similar in this regard to the refinement procedure of hybrid MCMC for variational inference [HVI, 24] and 4 Algorithm 1 AIR Require: A generative model p(x, h; φ) = p(x|h; φ)p(h; φ) and a recognition network µ0 = f(x; ψ) Require: A transition operator g(µ, x, γ) and inference rate γ. Compute µ0 = f(x; ψ) for q0(h|x; ψ) for t=1:T do Draw K samples h(k) ∼qt(h|x) and compute normalized importance weights ˜w(k) µt = (1 −γ)µt−1 + γ PK k=1 ˜w(k)h(k) end for if reweight then ∆φ ∝PK k=1 ˜w(k)∇φ log p(x, h(k); φ) else ∆φ ∝ 1 K PK k=1 ∇φ log p(x, h(k); φ) end if if inclusive KL Divergence then ∆ψ ∝PK k=1 ˜w(k)∇ψ log q0(h(k)|x; ψ) else ∆ψ ∝ 1 K PK k=1 ∇ψ log q0(h(k)|x; ψ) end if normalizing flows for VAE [NF, 21]. HVI has a similar complexity as AIR, as it requires re-estimating the lowerbound at every step. While NF can be less expensive than AIR, both HVI and NF rely on the VAE re-parameterization to work, and thus cannot be applied to discrete variables. Sequential importance sampling [SIS, 5] can offer a better refinement step than AIS but typically requires resampling to control variance. While parametric versions exist that could be applicable to training directed graphical models with discrete units [8, 18], their applicability as a general refinement procedure is limited as the refinement parameters need to be learned. Importance sampling is central to reweighted wake-sleep [RWS, 1], importance-weighted autoencoders [IWAE, 2], variational inference for Monte Carlo objectives [VIMCO, 14], and recent work on stochastic feed-forward networks [SFFN, 26, 19]. While each of these methods are competitive, they rely on importance samples from the recognition network and do not offer the low-variance estimates available from AIR. Neural variational inference and learning [NVIL, 13] is a single-sample and biased version of VIMCO, which is greatly outperformed by techniques that use importance sampling. Both NVIL and VIMCO reduce the variance of the Monte Carlo estimates of gradients by using an input-dependent baseline, but this approach does not necessarily provide a better posterior and cannot be used to give better estimates of the likelihood function or expectations. Finally, IRVI is meant to be a general approach to refining the approximate posterior. IRVI is not limited to the refinement step provided by AIR, and many different types of refinement steps are available to improve the posterior for models above (see supplementary material for the continuous case). SIS and sequential importance resampling [SIR, 6] can be used as an alternative to AIR and may provide a better refinement step for IRVI. 5 Experiments We evaluate iterative refinement for variational inference (IRVI) using adaptive importance refinement (AIR) for both training and evaluating directed belief networks. We train and test on the following benchmarks: the binarized MNIST handwritten digit dataset [23] and the Caltech-101 Silhouettes dataset. We centered the MNIST and Caltech datasets by subtracting the mean-image over the training set when used as input to the recognition network. We also train additional models using the re-weighted wake-sleep algorithm [RWS, 1], the state of the art for many configurations of directed belief networks with discrete variables on these datasets for comparison and to demonstrate improving the approximate posteriors with refinement. With our experiments, we show that 1) IRVI can train a variety of directed models as well or better than existing methods, 2) the gains from refinement improves the approximate posterior, and can be applied to models trained by other algorithms, and 3) IRVI can be used to improve a model with a relatively simple approximate posterior. Models were trained using the RMSprop algorithm [10] with a batch size of 100 and early stopping by recorded best variational lower bound on the validation dataset. For AIR, 20 “inference steps" 5 Figure 2: The log-likelihood (left) and normalized effective sample size (right) with epochs in log-scale on the training set for AIR with 5 and 20 refinement steps (vanilla AIR), reweighted AIR with 5 and 20 refinement steps, reweighted AIR with inclusive KL objective and 5 or 20 refinement steps, and reweighted wake-sleep (RWS), all with a single stochastic latent layer. All models were evaluated with 100 posterior samples, their respective number of refinement steps for the effective sample size (ESS), and with 20 refinement steps of AIR for the log-likelihood. Despite longer wall-clock time per epoch, (K = 20), 20 adaptive samples (M = 20), and an adaptive damping rate, (1 −γ), of 0.9 were used during inference, chosen from validation in initial experiments. 20 posterior samples (N = 20) were used for model parameter updates for both AIR and RWS. All models were trained for 500 epochs and were fine-tuned for an additional 500 with a decaying learning rate and SGD. We use a generative model composed of a) a factorized Bernoulli prior as with sigmoid belief networks (SBNs) or b) an autoregressive prior, as in published MNIST results with deep autoregressive networks [DARN, 7]: a) p(h) = Y i p(hi); P(hi = 1) = σ(bi), b) P(hi = 1) = σ( i−1 X j=0 (W i,j<i r hj<i) + bi), (10) where σ is the sigmoid (σ(x) = 1/(1 + exp(−x))) function, Wr is a lower-triangular square matrix, and b is the bias vector. For our experiments, we use conditional and approximate posterior densities that follow Bernoulli distributions: P(hi,l = 1|hl+1) = σ(W i,: l · hl+1 + bi,l), (11) where Wl is a weight matrix between the l and l + 1 layers. As in Gregor et al. [7] with MNIST, we do not use autoregression on the observations, x, and use a fully factorized approximate posterior. 5.1 Variance Reduction and Choosing the AIR Objective The effective sample size (ESS) in Eq. (5) is a good indicator of the variance of gradient estimate. In Fig. 2 (right), we observe that the ESS improves as we take more AIR steps when training a deep belief network (AIR(5) vs AIR(20)). When the approximate posterior is not refined (RWS), the ESS stays low throughout training, eventually resulting in a worse model. This improved ESS reveals itself as faster convergence in terms of the exact log-likelihood in the left panel of Fig. 2 (see the progress of each curve until 100 epochs. See also supplementary materials for wall-clock time.) This faster convergence does not guarantee a good final log-likelihood, as the latter depends on the tightness of the lowerbound rather than the variance of its estimate. This is most apparent when comparing AIR(5), AIR+RW(5) and AIR+RW+IKL(5). AIR(5) has a low variance (high ESS) but computes the gradient of a looser lowerbound from Eq. (2), while the other two compute the gradient of a tighter lowerbound from Eq. (4). This results in AIR(5) converging faster than the other two, while the final log-likelihood estimates are better for the other two. We however observe that the final log-likelihood estimates are comparable across all three variants (AIR, AIR+RW and AIR+RW+IKL) when a sufficient number of AIR steps are taken so that L1 is sufficiently tight. When 20 steps were taken, we observe that the AIR(20) converges faster as well as achieves a better log-likelihood compared to AIR+RW(20) and AIR+RW+IKL(20). Based on these observations, we use vanilla AIR (subsequently just “AIR”) in our following experiments. 6 Table 1: Results for adaptive importance sampling iterative refinement (AIR), reweighted wake-sleep (RWS), and RWS with refinement with AIR at test (RWS+) for a variety of model configurations. Additional sigmoid belief networks (SBNs) trained with neural variational inference and learning (NVIL) from †Mnih and Gregor [13] and variational inference for Monte Carlo objectives (VIMCO) from §Mnih and Rezende [14]. AIR is trained with 20 inference steps and adaptive samples (K = 20, M = 20) in training (*3 layer SBN was trained with 50 steps with a inference rate of 0.05). NVIL DARN results are from fDARN and VIMCO was trained using 50 posterior samples (as opposed to 20 with AIR and RWS). Model MNIST Caltech-101 Silhouettes RWS RWS+ AIR NVIL† VIMCO§ RWS RWS+ AIR SBN 200 102.51 102.00 100.92 113.1 – 121.38 118.63 116.61 SBN 200-200 93.82 92.83 92.90 99.8 – 112.86 107.20 106.94 SBN 200-200-200 92.00 91.02 92.56∗ 96.7 90.9§ 110.57 104.54 104.36 DARN 200 86.91 86.21 85.89 92.5† – 113.69 109.73 109.76 DARN 500 85.40 84.71 85.46 90.7† – – – – 5.2 Training and Density Estimation We evaluate AIR for training SBNs with one, two, and three layers of 200 hidden units and DARN with 200 and 500 hidden units, comparing against our implementation of RWS. All models were tested using 100, 000 posterior samples to estimate the lowerbounds and average test log-probabilities. When training SBNs with AIR and RWS, we used a completely deterministic network for the approximate posterior. For example, for a 2-layer SBN, the approximate posterior factors into the approximate posteriors for the top and the bottom hidden layers, and the initial variational parameters of the top layer, µ(2) 0 are a function of the initial variational parameters of the first layer, µ(1) 0 : q0(h1, h2|x) = q0(h1|x; µ(1) 0 )q(h2|x; µ(2) 0 ); µ(1) 0 = f1(x; ψ1); µ(2) 0 = f2(µ(1) 0 ; ψ2). (12) For DARN, we trained two different configurations on MNIST: one with 500 stochastic units and an additional hyperbolic tangent deterministic layer with 500 units in both the generative and recognition networks, and another with 200 stochastic units with a 500 hyperbolic tangent deterministic layer in the generative network only. We used DARN with 200 units with the Caltech-101 silhouettes dataset. The results of our experiments with the MNIST and Caltech-101 silhouettes datasets trained with AIR, RWS, and RWS refined at test with AIR (RWS+) are in Table 1. Refinement at test (RWS+) always improves the results for RWS. As our unrefined results are comparable to those found in Bornschein and Bengio [1], the improved results indicate many evaluations of Helmholtz machines in the literature could benefit from refinement with AIR to improve evaluation accuracy. For most model configurations, AIR and RWS perform comparably, though RWS appears to do better in the average test log-probability estimates for some configurations of MNIST. RWS+ performs comparably with variational inference for Monte Carlo objectives [VIMCO, 14], despite the reported VIMCO results relying on more posterior samples in training. Finally, AIR results approach SOTA with Caltech-101 silhouettes with 3-layer SBNs against neural autoregressive distribution estimator [NADE, 1]. We also tested our log-probability estimates against the exact log-probability (by marginalizing over the joint) of smaller single-layer SBNs with 20 stochastic units. The exact log-probability was −127.474 and our estimate with the unrefined approximate was −127.51 and −127.48 with 100 refinement steps. Overall, this result is consistent with those of Table 1, that iterative refinement improves the accuracy of log-probability estimates. 5.3 Posterior Improvement In order to visualize the improvements due to refinement and to demonstrate AIR as a general means of improvement for directed models at test, we generate N samples from the approximate posterior without (h ∼q0(h|x; ψ)) and with refinement (h ∼qT (h|x)), from a single-layer SBN with 20 stochastic units originally trained with RWS. We then use the samples from the approximate posterior to compute the expected conditional probability or average reconstruction: 1 N PN n=1 p(x|h(n)). We used a restricted model with a lower number of stochastic units to demonstrate that refinement also works well with simple models, where the recognition network is more likely to “average” over latent configurations, giving a misleading evaluation of the model’s generative capability. 7 Figure 3: Top: Average reconstructions, 1/N PN n=1 p(x|h(n)), for h(n) sampled from the output of the recognition network, q0(h|x) (middle row) against those sampled from the refined posterior, qT (h|x) (bottom row) for T = 20 with a model trained on MNIST. Top row is ground truth. Among the digits whose reconstruction changes the most, many changes correctly reveal the identity of the digit. Bottom: Average reconstructions for a single-layer model with 200 trained on Caltech-101 silhouettes. Instead of using the posterior from the recognition network, we derived a simpler version, setting 80% of the variational parameters from the recognition network to 0.5, then applied iterative refinement. We also refine the approximate posterior of a simplified version of the recognition network of a single-layer SBN with 200 units trained with RWS. We simplified the approximate posterior by first computing µ0 = f(x; ψ), then randomly setting 80% of the variational parameters to 0.5. Fig. 3 shows improvement from refinement for 25 digits from the MNIST test dataset, where the samples chosen were those of which the expected reconstruction error of the original test sample was the most improved. The digits generated from the refined posterior are of higher quality, and in many cases the correct digit class is revealed. This shows that, in many cases where the recognition network indicates that the generative model cannot model a test sample correctly, refinement can more accurately reveal the model’s capacity. With the simplified approximate posterior, refinement is able to retrieve most of the shape of images from the Caltech-101 silhouettes, despite only starting with 20% of the original parameters from the recognition network. This indicates that the work of inference need not all be done via a complex recognition network: iterative refinement can be used to aid in inference with a relatively simple approximate posterior. 6 Conclusion We have introduced iterative refinement for variational inference (IRVI), a simple, yet effective and flexible approach for training and evaluating directed belief networks that works by improving the approximate posterior from a recognition network. We demonstrated IRVI using adaptive importance refinement (AIR), which uses importance sampling at each iterative step, and showed that AIR can be used to provide low-variance gradients to efficiently train deep directed graphical models. AIR can also be used to more accurately reveal the generative model’s capacity, which is evident when the approximate posterior is of poor quality. The improved approximate posterior provided by AIR shows an increased effective samples size, which is a consequence of a better approximation of the true posterior and improves the accuracy of the test log-probability estimates. 7 Acknowledgements This work was supported by Microsoft Research to RDH under NJ; NIH P20GM103472, R01 grant REB020407, and NSF grant 1539067 to VDC; and ONR grant N000141512791 and ADeLAIDE grant FA8750-16C-0130-001 to RS. KC was supported in part by Facebook, Google (Google Faculty Award 2016) and NVidia (GPU Center of Excellence 2015-2016), and RDH was supported in part by PIBBS. References [1] Jörg Bornschein and Yoshua Bengio. Reweighted wake-sleep. arXiv preprint arXiv:1406.2751, 2014. [2] Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015. 8 [3] Peter Dayan, Geoffrey E Hinton, Radford M Neal, and Richard S Zemel. The helmholtz machine. Neural computation, 7(5):889–904, 1995. [4] 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), 1977. [5] Arnaud Doucet, Nando De Freitas, and Neil Gordon. An introduction to sequential monte carlo methods. In Sequential Monte Carlo methods in practice, pages 3–14. Springer, 2001. [6] Neil J Gordon, David J Salmond, and Adrian FM Smith. Novel approach to nonlinear/non-gaussian bayesian state estimation. In Radar and Signal Processing, IEE Proceedings F, volume 140, pages 107–113. IET, 1993. [7] Karol Gregor, Ivo Danihelka, Andriy Mnih, Charles Blundell, and Daan Wierstra. Deep autoregressive networks. arXiv preprint arXiv:1310.8499, 2013. [8] Shixiang Gu, Zoubin Ghahramani, and Richard E Turner. Neural adaptive sequential monte carlo. In Advances in Neural Information Processing Systems, pages 2611–2619, 2015. [9] Shixiang Gu, Sergey Levine, Ilya Sutskever, and Andriy Mnih. Muprop: Unbiased backpropagation for stochastic neural networks. arXiv preprint arXiv:1511.05176, 2015. [10] Geoffrey Hinton. Neural networks for machine learning. Coursera, video lectures, 2012. [11] Geoffrey E Hinton, Simon Osindero, and Yee-Whye Teh. A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527–1554, 2006. [12] Diederik Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [13] Andriy Mnih and Karol Gregor. Neural variational inference and learning in belief networks. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1791–1799, 2014. [14] Andriy Mnih and Danilo J Rezende. Variational inference for monte carlo objectives. arXiv preprint arXiv:1602.06725, 2016. [15] Radford M Neal. Connectionist learning of belief networks. Artificial intelligence, 56(1), 1992. [16] Radford M Neal and Geoffrey E Hinton. A view of the em algorithm that justifies incremental, sparse, and other variants. In Learning in graphical models, pages 355–368. Springer, 1998. [17] Man-Suk Oh and James O Berger. Adaptive importance sampling in monte carlo integration. Journal of Statistical Computation and Simulation, 41(3-4):143–168, 1992. [18] Brooks Paige and Frank Wood. Inference networks for sequential monte carlo in graphical models. arXiv preprint arXiv:1602.06701, 2016. [19] Tapani Raiko, Mathias Berglund, Guillaume Alain, and Laurent Dinh. Techniques for learning binary stochastic feedforward neural networks. arXiv preprint arXiv:1406.2989, 2014. [20] Danilo J Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on Machine Learning (ICML-14), pages 1278–1286, 2014. [21] Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770, 2015. [22] Ruslan Salakhutdinov and Hugo Larochelle. Efficient learning of deep boltzmann machines. In International Conference on Artificial Intelligence and Statistics, pages 693–700, 2010. [23] Ruslan Salakhutdinov and Iain Murray. On the quantitative analysis of deep belief networks. In Proceedings of the 25th international conference on Machine learning, pages 872–879. ACM, 2008. [24] Tim Salimans, Diederik Kingma, and Max Welling. Markov chain monte carlo and variational inference: Bridging the gap. In David Blei and Francis Bach, editors, Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1218–1226. JMLR Workshop and Conference Proceedings, 2015. URL http://jmlr.org/proceedings/papers/v37/salimans15.pdf. [25] Lawrence K Saul, Tommi Jaakkola, and Michael I Jordan. Mean field theory for sigmoid belief networks. Journal of artificial intelligence research, 4(1):61–76, 1996. [26] Yichuan Tang and Ruslan R Salakhutdinov. Learning stochastic feedforward neural networks. In Advances in Neural Information Processing Systems, pages 530–538, 2013. 9
2016
77
6,538
Stochastic Multiple Choice Learning for Training Diverse Deep Ensembles Stefan Lee Virginia Tech steflee@vt.edu Senthil Purushwalkam Carnegie Mellon University spurushw@andrew.cmu.edu Michael Cogswell Virginia Tech cogswell@vt.edu Viresh Ranjan Virginia Tech rviresh@vt.edu David Crandall Indiana University djcran@indiana.edu Dhruv Batra Virginia Tech dbatra@vt.edu Abstract Many practical perception systems exist within larger processes that include interactions with users or additional components capable of evaluating the quality of predicted solutions. In these contexts, it is beneficial to provide these oracle mechanisms with multiple highly likely hypotheses rather than a single prediction. In this work, we pose the task of producing multiple outputs as a learning problem over an ensemble of deep networks – introducing a novel stochastic gradient descent based approach to minimize the loss with respect to an oracle. Our method is simple to implement, agnostic to both architecture and loss function, and parameter-free. Our approach achieves lower oracle error compared to existing methods on a wide range of tasks and deep architectures. We also show qualitatively that the diverse solutions produced often provide interpretable representations of task ambiguity. 1 Introduction Perception problems rarely exist in a vacuum. Typically, problems in Computer Vision, Natural Language Processing, and other AI subfields are embedded in larger applications and contexts. For instance, the task of recognizing and segmenting objects in an image (semantic segmentation [6]) might be embedded in an autonomous vehicle [7], while the task of describing an image with a sentence (image captioning [18]) might be part of a system to assist visually-impaired users [22,30]. In these scenarios, the goal of perception is often not to generate a single output but a set of plausible hypotheses for a ‘downstream’ process, such as a verification component or a human operator. These downstream mechanisms may be abstracted as oracles that have the capability to pick the correct solution from this set. Such a learning setting is called Multiple Choice Learning (MCL) [8], where the goal for the learner is to minimize oracle loss achieved by a set of M solutions. More formally, given a dataset of input-output pairs {(xi, yi) | xi ∈X, yi ∈Y}, the goal of classical supervised learning is to search for a mapping F : X →Y that minimizes a task-dependent loss ℓ: Y ×Y →R+ capturing the error between the actual labeling yi and predicted labeling ˆyi. In this setting, the learned function f makes a single prediction for each input and pays a penalty for that prediction. In contrast, Multiple Choice Learning seeks to learn a mapping g : X →YM that produces M solutions ˆYi = (ˆy1 i , . . . , ˆyM i ) such that oracle loss minm ℓ(yi, ˆym i ) is minimized. In this work, we fix the form of this mapping g to be the union of outputs from an ensemble of predictors such that g(x) = {f1(x), f2(x), . . . , fM(x)}, and address the task of training ensemble members f1, . . . , fM such that g minimizes oracle loss. Under our formulation, different ensemble members are free to specialize on subsets of the data distribution, so that collectively they produce a set of outputs which covers the space of high probability predictions well. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Horse Cow A  couple  of  birds  that  are  standing  in  the  grass. A  bird  perched  on  top  of  a  tree  branch. A  bird  perched  on  a  tree  branch  in  the  sky. Figure 1: Single-prediction based models often produce solutions with low expected loss in the face of ambiguity; however, these solutions are often unrealistic or do not reflect the image content well (row 1). Instead, we train ensembles under a unified loss which allows each member to produce different outputs reflecting multi-modal beliefs (row 2). We evaluate our method on image classification, segmentation, and captioning tasks. Diverse solution sets are especially useful for structured prediction problems with multiple reasonable interpretations, only one of which is correct. Situations that often arise in practical systems include: – Implicit class confusion. The label space of many classification problems is often an arbitrary quantization of a continuous space. For example, a vision system may be expected to classify between tables and desks, despite many real-world objects arguably belonging to both classes. By making multiple predictions, this implicit confusion can be viewed explicitly in system outputs. – Ambiguous evidence. Often there is simply not enough information to make a definitive prediction. For example, even a human expert may not be able to identify a fine-grained class (e.g., particular breed of dog) given an occluded or distant view, but they likely can produce a small set of reasonable guesses. In such cases, the task of producing a diverse set of possibilities is more clearly defined than producing one correct answer. – Bias towards the mode. Many models have a tendency to exhibit mode-seeking behaviors as a way to reduce expected loss over a dataset (e.g., a conversation model frequently producing ‘I don’t know’). By making multiple predictions, a system can improve coverage of lower density areas of the solution space, without sacrificing performance on the majority of examples. In other words, by optimizing for the oracle loss, a multiple-prediction learner can respond to ambiguity much like a human does, by making multiple guesses that capture multi-modal beliefs. In contrast, a single-prediction learner is forced to produce a solution with low expected loss in the face of ambiguity. Figure 1 illustrates how this can produce solutions that are not useful in practice. In semantic segmentation, for example, this problem often causes objects to be predicted as a mixture of multiple classes (like the horse-cow shown in the figure). In image captioning, minimizing expected loss encourages generic sentences that are ‘safe’ with respect to expected error but not very informative. For example, Figure 1 shows two pairs of images each having different image content but very similar, generic captions – the model knows it is safe to assume that birds are on branches and that cakes are eaten with forks. In this paper, we generalize the Multiple Choice Learning paradigm [8,9] to jointly learn ensembles of deep networks that minimize the oracle loss directly. We are the first to formalize these ideas in the context of deep networks and we present a novel training algorithm that avoids costly retraining [8] of past methods. Our primary technical contribution is the formulation of a stochastic block gradient descent optimization approach well-suited to minimizing the oracle loss in ensembles of deep networks, which we call Stochastic Multiple Choice Learning (sMCL). Our formulation is applicable to any model trained with stochastic gradient descent, is agnostic to the form of the task dependent loss, is parameter-free, and is time efficient, training all ensemble members concurrently. We demonstrate the broad applicability and efficacy of sMCL for training diverse deep ensembles with interpretable emergent expertise on a wide range of problem domains and network architectures, including Convolutional Neural Network (CNN) [1] ensembles for image classification [17], FullyConvolutional Network (FCN) [20] ensembles for semantic segmentation [6], and combined CNN and Recurrent Neural Network (RNN) ensembles [14] for image captioning [18]. We provide detailed analysis of the training and output behaviors of the resulting ensembles, demonstrating how ensemble member specialization and expertise emerge automatically when trained using sMCL. Our method outperforms existing baselines and produces sets of outputs with high oracle performance. 2 2 Related Work Ensemble Learning. Much of the existing work on training ensembles focuses on diversity between member models as a means to improve performance by decreasing error correlation. This is often accomplished by resampling existing training data for each member model [27] or by producing artificial data that encourages new models to be decorrelated with the existing ensemble [21]. Other approaches train or combine ensemble members under a joint loss [19,26]. More recently, work of Hinton et al. [12] and Ahmed et al. [2] explores using ‘generalist’ network performance statistics to inform the design of ensemble-of-expert architectures for classification. In contrast, sMCL discovers specialization as a consequence of minimizing oracle loss. Importantly, most existing methods do not generalize to structured output labels, while sMCL seamlessly adapts, discovering different task-dependent specializations automatically. Generating Multiple Solutions. There is a large body of work on the topic of extracting multiple diverse solutions from a single model [3,15,16,23,24]; however, these approaches are designed for probabilistic structured-output models and are not directly applicable to general deep architectures. Most related to our approach is the work of Guzman-Rivera et al. [8,9] which explicitly minimizes oracle loss over the outputs of an ensemble, formalizing this setting as the Multiple Choice Learning (MCL) paradigm. They introduce a general alternating block coordinate descent training approach which requires retraining models multiple times. Vondrick et al. [29] follow a similar methodology to train multi-modal regressors to predict the feature representations of future frames in video. Recently, Dey et al. [5] reformulated the problem of generating multiple diverse solutions as a submodular optimization task in which ensemble members are learned sequentially in a boosting-like manner to maximize marginal gain in oracle performance. Both these methods require either costly retraining or sequential training, making them poorly suited to modern deep architectures that can take weeks to train. To address this serious shortcoming and to provide the first practical algorithm for training diverse deep ensembles, we introduce a stochastic gradient descent (SGD) based algorithm to train ensemble members concurrently. 3 Multiple-Choice Learning as Stochastic Block Gradient Descent We consider the task of training an ensemble of differentiable learners that together produce a set of solutions with minimal loss with respect to an oracle that selects only the lowest-error prediction. Notation. We use [n] to denote the set {1, 2, . . . , n}. Given a training set of input-output pairs D = {(xi, yi) | xi ∈X, yi ∈Y}, our goal is to learn a function g : X →YM which maps each input to M outputs. We fix the form of g to be an ensemble of M learners f such that g(x) = (f1(x), . . . , fM(x)). For some task-dependent loss ℓ(y, ˆy), which measures the error between true and predicted outputs y and ˆy, we define the oracle loss of g over the dataset D as LO(D) = n X i=1 min m∈[M] ℓ(yi, fm(xi)) . Minimizing Oracle Loss with Multiple Choice Learning. In order to directly minimize the oracle loss for an ensemble of learners, Guzman-Rivera et al. [8] present an objective which forms a (potentially tight) upper-bound. This objective replaces the min in the oracle loss with indicator variables (pi,m)M m=1 where pi,m is 1 if predictor m has the lowest error on example i, argmin fm,pi,m n X i=1 M X m=1 pi,m ℓ(yi, fm(xi)) (1) s.t. M X pi,m = 1, pi,m ∈{0, 1}. The resulting minimization is a constrained joint optimization over ensemble parameters and datapoint assignments. The authors propose an alternating block algorithm, shown in Algorithm 1, to approximately minimize this objective. Similar to K-Means or ‘hard-EM,’ this approach alternates between assigning examples to their min-loss predictors and training models to convergence on the partition of examples assigned to them. Note that this approach is not feasible with training deep networks, since modern architectures [11] can take weeks or months to train a single model once. 3 Figure 2: The MCL approach of [8] (Alg. 1) requires costly retraining while our sMCL method (Alg. 2) works within standard SGD solvers, training all ensemble members under a joint loss. Stochastic Multiple Choice Learning. To overcome this shortcoming, we propose a stochastic algorithm for differentiable learners which interleaves the assignment step with batch updates in stochastic gradient descent. Consider the partial derivative of the objective in Eq. 1 with respect to the output of the mth individual learner on example xi, ∂LO ∂fm(xi) = pi,m ∂ℓ(yi, fm(xi)) ∂fm(xi) . (2) Notice that if fm is the minimum error predictor for example xi, then pi,m = 1, and the gradient term is the same as if training a single model; otherwise, the gradient is zero. This behavior lends itself to a straightforward optimization strategy for learners trained by SGD based solvers. For each batch, we pass the examples through the learners, calculating losses from each ensemble member for each example. During the backward pass, the gradient of the loss for each example is backpropagated only to the lowest error predictor on that example (with ties broken arbitrarily). This approach, which we call Stochastic Multiple Choice Learning (sMCL), is shown in Algorithm 2. sMCL is generalizable to any learner trained by stochastic gradient descent and is thus applicable to an extensive range of modern deep networks. Unlike the iterative training schedule of MCL, sMCL ensembles need only be trained to convergence once in parallel. sMCL is also agnostic to the exact form of loss function ℓsuch that it can be applied without additional effort on a variety of problems. 4 Experiments In this section, we present results for sMCL ensembles trained for the tasks and deep architectures shown in Figure 3. These include CNN ensembles for image classification, FCN ensembles for semantic segmentation, and a CNN+RNN ensembles for image caption generation. Baselines. Many existing general techniques for inducing diversity are not directly applicable to deep networks. We compare our proposed method against: - Classical ensembles in which each model is trained under an independent loss with differing random initializations. We will refer to these as Indp. ensembles in figures. - MCL [8] that alternates between training models to convergence on assigned examples and allocating examples to their lowest error model. We repeat this process for 5 meta-iterations and initialize ensembles with (different) random weights. We find MCL performs similarly to sMCL on small classification tasks; however, MCL performance drops substantially on segmentation and captioning tasks. Unlike sMCL which can effectively reassign an example once per epoch, MCL only does this after convergence, limiting its capacity to specialize compared to sMCL. We also note that sMCL is 5x faster than MCL, where the factor 5 is the result of choosing 5 meta-iterations (other applications may require more, further increasing the gap.) - Dey et al. [5] train models sequentially in a boosting-like fashion, each time reweighting examples to maximize marginal increase of the evaluation metric. We find these models saturate quickly as the ensemble size grows. As performance increases, the marginal gain and therefore the weights 4 (a) Convolutional classification model of [1] for CIFAR10 [17] (b) Fully-convolutional segmentation model of Long et al. [20] (c) CNN+RNN based captioning model of Karpathy et al. [14] Figure 3: We experiment with three problem domains using the various architectures shown above. approach zero. With low weights, the average gradient backpropagated for stochastic learners drops substantially, reducing the rate and effectiveness of learning without careful tuning. To compute weights, [5] requires an error measure bounded above by 1: accuracy (for classification) and IoU (for segmentation) satisfy this; the CIDEr-D score [28] divided by 10 guarantees this for captioning. Oracle Evaluation. We present results as oracle versions of the task-dependent performance metrics. These oracle metrics report the highest score over all outputs for a given input. For example, in classification tasks, oracle accuracy is exactly the top-k criteria of ImageNet [25], i.e. whether at least one of the outputs is the correct label. Likewise, the oracle intersection over union (IoU) is the highest IoU between the ground truth segmentation and any one of the outputs. Oracle metrics allow the evaluation of multiple-prediction systems separately from downstream re-ranking or selection systems, and have been extensively used in previous work [3,5,8,9,15,16,23,24]. Our experiments convincingly demonstrate the broad applicability and efficacy of sMCL for training diverse deep ensembles. In all three experiments, sMCL significantly outperforms classical ensembles, Dey et al. [5] (typical improvements of 6-10%), and MCL (while providing a 5x speedup over MCL). Our analysis shows that the exact same algorithm (sMCL) leads to the automatic emergence of different interpretable notions of specializations among ensemble members. 4.1 Image Classification Model. We begin our experiments with sMCL on the CIFAR10 [17] dataset using the small convolutional neural network “CIFAR10-Quick” provided with the Caffe deep learning framework [13]. CIFAR10 is a ten way classification task with small 32×32 images. For these experiments, the reference model is trained using a batch size of 350 for 5,000 iterations with a momentum of 0.9, weight decay of 0.004, and an initial learning rate of 0.001 which drops to 0.0001 after 4000 iterations. Results. Oracle accuracy for sMCL and baseline ensembles of size 1 to 6 are shown in Figure 4a. The sMCL trained ensembles result in higher oracle accuracy than the baseline methods, and are comparable to MCL while being 5x faster. The method of Dey et al. [5] performs worse than independent ensembles as ensemble size grows. Figure 4b shows the oracle loss during training for sMCL and regular ensembles. The sMCL trained models optimize for the oracle cross-entropy loss directly, not only arriving at lower loss solutions but also reducing error more quickly. Interpretable Expertise: sMCL Induces Label-Space Clustering. Figure 4c shows the class-wise distribution of the assignment of test datapoints to the oracle or ‘winning’ predictor for an M = 4 sMCL ensemble. The level of class division is striking – most predictors become specialists for certain classes. Note that these divisions emerge from training under the oracle loss and are not hand-designed or pre-initialized in any way. In contrast, Figure 4f show that the oracle assignments for a standard ensemble are nearly uniform. To explore the space between these two extremes, we loosen the constraints of Eq. 1 such that the lowest k error predictors are penalized. By varying k between 1 and the number of ensemble members M, the models transition from minimizing oracle loss at k = 1 to a traditional ensemble at k = M. Figures 4d and 4e show these results. We find a direct correlation between the degree of specialization and oracle accuracy, with k = 1 netting highest oracle accuracy. 4.2 Semantic Segmentation We now present our results for the semantic segmentation task on the Pascal VOC dataset [6]. Model. We use the fully convolutional network (FCN) architecture presented by Long et al. [20] as our base model. Like [20], we train on the Pascal VOC 2011 training set augmented with extra segmentations provided in [10] and we test on a subset of the VOC 2011 validation set. We initialize 5 1 2 3 4 5 6 80 85 90 95 Ensemble Size M Oracle Accuracy sMCL MCL Dey [5] Indp. (a) Effect of Ensemble Size 0 2,500 5,000 0 2 4 Iterations Oracle Loss sMCL Indp. (b) Oracle Loss During Training (M = 4) 0.10% 0.20% 99.50% 0.10% 37.60% 0.10% 99.90% 0.00% 0.00% 0.00% 99.60% 0.00% 0.10% 99.90% 0.00% 0.00% 0.10% 99.90% 0.00% 0.00% 0.10% 99.80% 0.30% 0.00% 62.40% 0.00% 0.00% 0.00% 100.00% 0.20% 0.20% 0.00% 0.10% 0.00% 0.00% 99.90% 0.00% 0.10% 0.00% 99.80% 0 1 2 3 airplaine automobile bird cat deer dog frog horse ship truck (c) k=1 70.60% 0.00% 0.00% 0.00% 55.80% 63.30% 27.70% 38.90% 0.00% 68.40% 0.10% 0.00% 78.80% 0.00% 0.00% 0.10% 72.30% 0.00% 80.00% 0.00% 29.20% 22.20% 19.30% 62.90% 44.20% 0.00% 0.00% 60.10% 0.00% 31.40% 0.10% 77.80% 1.90% 37.10% 0.00% 36.60% 0.00% 1.00% 20.00% 0.20% 0 1 2 3 (d) k=2 28.50% 36.20% 27.90% 0.00% 24.90% 61.20% 50.40% 23.20% 0.10% 35.40% 39.90% 0.00% 47.60% 71.30% 57.40% 0.00% 0.00% 0.00% 57.60% 0.00% 31.60% 38.10% 0.00% 20.50% 0.00% 24.00% 33.30% 49.40% 11.60% 28.00% 0.00% 25.70% 24.50% 8.20% 17.70% 14.80% 16.30% 27.40% 30.70% 36.60% 0 1 2 3 (e) k=3 22.60% 30.30% 19.70% 26.30% 20.00% 29.30% 17.30% 26.30% 25.30% 23.80% 33.20% 20.30% 27.70% 26.40% 23.60% 21.40% 18.30% 26.80% 22.70% 20.60% 25.20% 26.10% 26.30% 24.30% 31.70% 27.90% 32.50% 22.60% 24.40% 27.10% 19.00% 23.30% 26.30% 23.00% 24.70% 21.40% 31.90% 24.30% 27.60% 28.50% 0 1 2 3 (f) k=M=4 Figure 4: sMCL trained ensembles produce higher oracle accuracies than baselines (a) by directly optimizing the oracle loss (b). By varying the number of predictors k each example can be assigned to, we can interpolate between sMCL and standard ensembles, and (c-f) show the percentage of test examples of each class assigned to each ensemble member by the oracle for various k. These divisions are not preselected and show how specialization is an emergent property of sMCL training. our sMCL models from a standard ensemble trained for 50 epochs at a learning rate of 10−3. The sMCL ensemble is then fine-tuned for another 15 epochs at a reduced learning rate of 10−5. Results. Figure 5a shows oracle accuracy (class-averaged IoU) for all methods with ensemble sizes ranging from 1 to 6. Again, sMCL significantly outperforms all baselines (~7% relative improvement over classical ensembles). In this more complex setting, we see the method of Dey et al. [5] saturates more quickly – resulting in performance worse than classical ensembles as ensemble size grows. Though we expect MCL to achieve similar results as sMCL, retraining the MCL ensembles a sufficient number of times proved infeasible so results after five meta-iterations are shown. Interpretable Expertise: sMCL as Segmentation Specialists. In Figure 5b, we analyze the class distribution of the predictions using an sMCL ensemble with 4 members. For each test sample, the oracle picks the prediction which corresponds to the ensemble member with the highest accuracy for that sample. We find the specialization with respect to classes is much less evident than in the classification experiments. As segmentation presents challenges other than simply selecting the correct class, specialization can occur in terms of shape and frequency of predicted segments in addition to class divisions; however, we do still see some class biases – network 2 captures cows, tables, and sofas well and network 4 has become an expert on sheep and horses. Figure 6 shows qualitative results from a four member sMCL ensemble. We can clearly observe the diversity in the segmentations predicted by different members. In the first row, we see the majority of the ensemble members produce dining tables of various completeness in response to the visual uncertainty caused by the clutter. Networks 2 and 3 capture this ambiguity well, producing segmentations with the dining table completely present or absent. Row 2 demonstrates the capacity of sMCL ensembles to provide multiple high quality solutions. The models are confused whether the 1 2 3 4 5 6 60 65 70 75 Ensemble Size M Oracle Mean IoU sMCL MCL Dey [5] Indp. (a) Effect of Ensemble Size Net  1 Net  2 Net  3 Net  4 (b) Oracle Assignment Distributions by Class Figure 5: a) sMCL trained ensembles consistently result in improved oracle mean IoU over baselines on PASCAL VOC 2011. b) Distribution of examples from each category assigned by the oracle for an sMCL ensemble. 6 Independent Ensemble Oracle sMCL Ensemble Predictions IoU 82.64 IoU 77.11 IoU 88.12 IoU 58.70 IoU 52.78 IoU 54.26 IoU 56.45 IoU 62.03 IoU 47.68 IoU 37.73 IoU 20.31 IoU 21.34 IoU 14.17 IoU 94.55 IoU 19.18 Input Net 1 Net 2 Net 3 Net 4 Figure 6: Samples images and corresponding predictions obtained by each member of the sMCL ensemble as well as the top output of a classical ensemble. The output with minimum loss on each example is outlined in red. Notice that sMCL ensembles vary in the shape, class, and frequency of predicted segments. animal is a horse or a cow – models 1 and 3 produce typical ‘safe’ responses while models 2 and 4 attempt to give cohesive responses. Finally, row 3 shows how the models can learn biases about the frequency of segments with model 3 presenting only the sheep. 4.3 Image Captioning In this section, we show that sMCL trained ensembles can produce sets of high quality and diverse sentences, which is essential to improving recall and capturing ambiguities in language and perception. Model. We adopt the model and training procedure of Karpathy et al. [14], utilizing their publicly available implementation neuraltalk2. The model consists of an VGG16 network [4] which encodes the input image as a fixed-length representation for a Long Short-Term Memory (LSTM) language model. We train and test on the MSCOCO dataset [18], using the same splits as [14]. We perform two experimental setups by either freezing or finetuning the CNN. In the first, we freeze the parameters of the CNN and train multiple LSTM models using the CNN as a static feature generator. In the second, we aggregate and back-propagate the gradients from each LSTM model through the CNN in a tree-like model structure. This is largely a construct of memory restrictions as our hardware could not accommodate multiple VGG16 networks. We train each ensemble for 70k iterations with the parameters of the CNN fixed. For the fine-tuning experiments, we perform another 70k iterations of training to fine-tune the CNN. We generate sentences for testing by performing beam search with a beam width of two (following [14]). Results. Table 1 presents the oracle CIDEr-D [28] scores for all methods on the validation set. We additionally compare with all outputs of a beam search over a single CNN+LSTM model with beam width ranging from 1 to 5. sMCL significantly outperforms the baseline ensemble learning methods (shown in the upper section of the table), increasing both oracle performance and the number of unique n-grams. For M = 5, beam search from a single model achieves greater oracle but produces significantly fewer unique n-grams. We note that beam search is an inference method and increased beam width could provide similar benefits for sMCL ensembles. Oracle CIDEr-D for Ensemble of Size # Unique n-Grams (M=5) M = 1 2 3 4 5 n = 1 2 3 4 Avg. Length sMCL 0.822 0.862 0.911 0.922 713 2902 6464 15427 10.21 MCL [8] 0.752 0.81 0.823 0.852 384 1565 3586 9551 9.87 Dey [5] 0.798 0.850 0.887 0.910 584 2266 4969 12208 10.26 Indp. 0.684 0.757 0.784 0.809 0.831 540 2003 4312 10297 10.24 sMCL (fine-tuned CNN) 1.064 1.130 1.179 1.184 1135 6028 15184 35518 10.43 Indp. (fine-tuned CNN) 0.912 1.001 1.05 1.073 1.095 921 4335 10534 23811 10.33 Beam Search 0.654 0.754 0.833 0.888 0.943 580 2272 4920 12920 10.62 Table 1: sMCL base methods outperform other ensemble methods a captioning, improve both oracle performance and the number of distinct n-grams. For low M, sMCL also performs better than multiple-output decoders. 7 Input Independently Trained Networks sMCL Ensemble A man riding a wave on top of a surfboard. A man riding a wave on top of a surfboard. A man riding a wave on top of a surfboard. A man riding a wave on top of a surfboard. A man riding a wave on top of a surfboard. A person on a surfboard in the water. A surfer is riding a wave in the ocean. A surfer riding a wave in the ocean. A group of people standing on a sidewalk. A man is standing in the middle of the street. A group of people standing around a fire hydrant. A group of people standing around a fire hydrant A man is walking down the street with an umbrell. A group of people sitting at a table with umbrellas. A group of people standing around a large plane. A group of people standing in front of a building A kitchen with a stove and a microwave. A white refrigerator freezer sitting inside of a kitchen. A white refrigerator sitting next to a window. A white refrigerator freezer sitting in a kitchen A cat sitting on a chair in a living room. A kitchen with a stove and a sink. A cat is sitting on top of a refrigerator. A cat sitting on top of a wooden table A bird is sitting on a tree branch. A bird is perched on a branch in a tree. A bird is perched on a branch in a tree. A bird is sitting on a tree branch A small bird perched on top of a tree branch. A couple of birds that are standing in the grass. A bird perched on top of a branch. A bird perched on a tree branch in the sky Figure 7: Comparison of sentences generated by members of a standard independently trained ensemble and an sMCL based ensemble of size four. Intepretable Expertise: sMCL as N-Gram Specialists. Figure 7 shows example images and generated captions from standard and sMCL ensembles of size four (results from beam search over a single model are similar). It is evident that the independently trained models tend to predict similar sentences independent of initialization, perhaps owing to the highly structured nature of the output space and the mode bias of the underlying language model. On the other hand, the sMCL based ensemble generates diverse sentences which capture ambiguity both in language and perception. The first row shows an extreme case in which all of the members of the standard ensemble predict identical sentences. In contrast, the sMCL ensemble produces sentences that describe the scene with many different structures. In row three, both models are confused about the content of the image, mistaking the pile of suitcases as kitchen appliances. However, the sMCL ensemble widens the scope of some sentences to include the cat clearly depicted in the image. The fourth row is an example of regression towards the mode, with the standard model producing multiple similar sentences describing birds on branches. In the sMCL ensemble, we also see this tendency; however, one model breaks away and captures the true content of the image. 5 Conclusion To summarize, we propose Stochastic Multiple Choice Learning (sMCL), an SGD-based technique for training diverse deep ensembles that follows a ‘winner-take-gradient’ training strategy. Our experiments demonstrate the broad applicability and efficacy of sMCL for training diverse deep ensembles. In all experimental settings, sMCL significantly outperforms classical ensembles and other strong baselines including the 5x slower MCL procedure. Our analysis shows that exactly the same algorithm (sMCL) automatically generates specializations among ensemble members along different task-specific dimensions. sMCL is simple to implement, agnostic to both architecture and loss function, parameter free, and simply involves introducing one new sMCL layer into existing ensemble architectures. Acknowledgments This work was supported in part by a National Science Foundation CAREER award, an Army Research Office YIP award, ICTAS Junior Faculty award, Office of Naval Research grant N00014-14-1-0679, Google Faculty Research award, AWS in Education Research grant, and NVIDIA GPU donation, all awarded to DB, and by an NSF CAREER award (IIS-1253549), the Intelligence Advanced Research Projects Activity (IARPA) via Air Force Research Laboratory contract FA8650-12-C-7212, a Google Faculty Research award, and an NVIDIA GPU donation, all awarded to DC. Computing resources used by this work are supported in part by NSF (ACI-0910812 and CNS-0521433), the Lily Endowment, Inc., and the Indiana METACyt Initiative. 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, AFRL, NSF, or the U.S. Government. 8 References [1] CIFAR-10 Quick Network Tutorial. http://caffe.berkeleyvision.org/gathered/examples/cifar10.html, 2016. [2] K. Ahmed, M. H. Baig, and L. Torresani. Network of experts for large-scale image categorization. In arXiv preprint arXiv:1604.06119, 2016. [3] D. Batra, P. Yadollahpour, A. Guzman-Rivera, and G. Shakhnarovich. Diverse M-Best Solutions in Markov Random Fields. In Proceedings of European Conference on Computer Vision (ECCV), 2012. [4] K. Chatfield, K. Simonyan, A. Vedaldi, and A. Zisserman. Return of the devil in the details: Delving deep into convolutional nets. arXiv preprint arXiv:1405.3531, 2014. [5] D. Dey, V. Ramakrishna, M. Hebert, and J. Andrew Bagnell. Predicting multiple structured visual interpretations. In Proceedings of IEEE International Conference on Computer Vision (ICCV), 2015. [6] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2011 (VOC2011) Results. http://www.pascalnetwork.org/challenges/VOC/voc2011/workshop/index.html. [7] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun. Vision meets Robotics: The KITTI Dataset. International Journal of Robotics Research (IJRR), 2013. [8] A. Guzman-Rivera, D. Batra, and P. Kohli. Multiple Choice Learning: Learning to Produce Multiple Structured Outputs. In Advances in Neural Information Processing Systems (NIPS), 2012. [9] A. Guzman-Rivera, P. Kohli, D. Batra, and R. Rutenbar. Efficiently enforcing diversity in multi-output structured prediction. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), 2014. [10] B. Hariharan, P. Arbelaez, L. Bourdev, S. Maji, and J. Malik. Semantic contours from inverse detectors. In Proceedings of IEEE International Conference on Computer Vision (ICCV), 2011. [11] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015. [12] G. E. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. In Advances in Neural Information Processing Systems (NIPS) - Deep Learning Workshop, 2014. [13] Y. Jia. Caffe: An open source convolutional architecture for fast feature embedding. http://caffe. berkeleyvision.org/, 2013. [14] A. Karpathy and L. Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. [15] A. Kirillov, B. Savchynskyy, D. Schlesinger, D. Vetrov, and C. Rother. Inferring m-best diverse solutions in a single one. In Proceedings of IEEE International Conference on Computer Vision (ICCV), 2015. [16] A. Kirillov, D. Schlesinger, D. Vetrov, C. Rother, and B. Savchynskyy. M-best-diverse labelings for submodular energies and beyond. In Advances in Neural Information Processing Systems (NIPS), 2015. [17] A. Krizhevsky. Learning multiple layers of features from tiny images, 2009. [18] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick. Microsoft COCO: Common objects in context, 2014. [19] Y. Liu and X. Yao. Ensemble learning via negative correlation. Neural Networks, 12(10):1399–1404, 1999. [20] J. Long, E. Shelhamer, and T. Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. [21] P. Melville and R. J. Mooney. Creating diversity in ensembles using artificial data. Information Fusion, 6(1):99–111, 2005. [22] Microsoft. Decades of computer vision research, one ‘Swiss Army knife’. blogs.microsoft.com /next/2016/03/30/decades-of-computer-vision-research-one-swiss-army-knife/, 2016. [23] D. Park and D. Ramanan. N-best maximal decoders for part models. In Proceedings of IEEE International Conference on Computer Vision (ICCV), pages 2627–2634, 2011. [24] A. Prasad, S. Jegelka, and D. Batra. Submodular meets structured: Finding diverse subsets in exponentiallylarge structured item sets. In Advances in Neural Information Processing Systems (NIPS), 2014. [25] O. Russakovsky, J. Deng, J. Krause, A. Berg, and L. Fei-Fei. The ImageNet Large Scale Visual Recognition Challenge 2012 (ILSVRC2012). http://www.image-net.org/challenges/LSVRC/2012/. [26] A. Strehl and J. Ghosh. Cluster ensembles—a knowledge reuse framework for combining multiple partitions. The Journal of Machine Learning Research, 3:583–617, 2003. [27] K. Tumer and J. Ghosh. Error correlation and error reduction in ensemble classifiers. Connection Science, 8(3-4):385–404, 1996. [28] R. Vedantam, C. Lawrence Zitnick, and D. Parikh. Cider: Consensus-based image description evaluation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2015. [29] C. Vondrick, H. Pirsiavash, and A. Torralba. Anticipating visual representations from unlabeled video. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 98–106, 2016. [30] WIRED. Facebook’s AI Can Caption Photos for the Blind on Its Own. wired.com/2015/10/facebookartificial-intelligence-describes-photo-captions-for-blind-people/, 2015. 9
2016
78
6,539
Learning shape correspondence with anisotropic convolutional neural networks Davide Boscaini1, Jonathan Masci1, Emanuele Rodol`a1, Michael Bronstein1,2,3 1USI Lugano, Switzerland 2Tel Aviv University, Israel 3Intel, Israel name.surname@usi.ch Abstract Convolutional neural networks have achieved extraordinary results in many computer vision and pattern recognition applications; however, their adoption in the computer graphics and geometry processing communities is limited due to the non-Euclidean structure of their data. In this paper, we propose Anisotropic Convolutional Neural Network (ACNN), a generalization of classical CNNs to nonEuclidean domains, where classical convolutions are replaced by projections over a set of oriented anisotropic diffusion kernels. We use ACNNs to effectively learn intrinsic dense correspondences between deformable shapes, a fundamental problem in geometry processing, arising in a wide variety of applications. We tested ACNNs performance in challenging settings, achieving state-of-the-art results on recent correspondence benchmarks. 1 Introduction In geometry processing, computer graphics, and vision, finding intrinsic correspondence between 3D shapes affected by different transformations is one of the fundamental problems with a wide spectrum of applications ranging from texture mapping to animation [25]. Of particular interest is the setting in which the shapes are allowed to deform non-rigidly. Traditional hand-crafted correspondence approaches are divided into two main categories: point-wise correspondence methods [17], which establish the matching between (a subset of) the points on two or more shapes by minimizing metric distortion, and soft correspondence methods [23], which establish a correspondence among functions defined over the shapes, rather than the vertices themselves. Recently, the emergence of 3D sensing technology has brought the need to deal with acquisition artifacts, such as missing parts, geometric, and topological noise, as well as matching 3D shapes in different representations, such as meshes and point clouds. With new and broader classes of artifacts, comes the need of learning from data invariance that is otherwise impossible to model axiomatically. In the past years, we have witnessed the emergence of learning-based approaches for 3D shape analysis. The first attempts were aimed at learning local shape descriptors [15, 5, 27], and shape correspondence [20]. The dramatic success of deep learning (in particular, convolutional neural networks [8, 14]) in computer vision [13] has led to a recent keen interest in the geometry processing and graphics communities to apply such methodologies to geometric problems [16, 24, 28, 4, 26]. Extrinsic deep learning. Many machine learning techniques successfully working on images were tried “as is” on 3D geometric data, represented for this purpose in some way “digestible” by standard frameworks. Su et al. [24] used CNNs applied to range images obtained from multiple views of 3D objects for retrieval and classification tasks. Wei et al. [26] used view-based representation to find correspondence between non-rigid shapes. Wu et al. [28] used volumetric CNNs applied to rasterized volumetric representation of 3D shapes. The main drawback of such approaches is their treatment of geometric data as Euclidean structures. Such representations are not intrinsic, and vary 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Figure 1: Illustration of the difference between extrinsic (left) and intrinsic (right) deep learning methods on geometric data. Intrinsic methods work on the manifold rather than its Euclidean realization and are isometry-invariant by construction. as the result of pose or deformation of the object. For instance, in Figure 1, the filter that responds to features on a straight cylinder would not respond to a bent one. Achieving invariance to shape deformations, a common requirement in many applications, is extremely hard with the aforementioned methods and requires complex models and huge training sets due to the large number of degrees of freedom involved in describing non-rigid deformations. Intrinsic deep learning approaches try to apply learning techniques to geometric data by generalizing the main ingredients such as convolutions to non-Euclidean domains. In an intrinsic representation, the filter is applied to some data on the surface itself, thus being invariant to deformations by construction (see Figure 1). The first intrinsic convolutional neural network architecture (Geodesic CNN) was presented in [16]. While producing impressive results on several shape correspondence and retrieval benchmarks, GCNN has a number of significant drawbacks. First, the charting procedure is limited to meshes, and second, there is no guarantee that the chart is always topologically meaningful. Another intrinsic CNN construction (Localized Spectral CNN) using an alternative charting technique based on the windowed Fourier transform [22] was proposed in [4]. This method is a generalization of a previous work [6] on spectral deep learning on graphs. One of the key advantages of LSCNN is that the same framework can be applied to different shape representations, in particular, meshes and point clouds. A drawback of this approach is its memory and computation requirements, as each window needs to be explicitly produced. Contributions. We present Anisotropic Convolutional Neural Networks (ACNN), a method for intrinsic deep learning on non-Euclidean domains. Though it is a generic framework that can be used to handle different tasks, we focus here on learning correspondence between shapes. Our approach is related to two previous methods for deep learning on manifolds, GCNN [16] and ADD [5]. Compared to [5], where a learned spectral filter applied to the eigenvalues of anisotropic LaplaceBeltrami operator, we use anisotropic heat kernels as spatial weighting functions allowing to extract a local intrinsic representation of a function defined on the manifold. Unlike ADD, our ACNN is a convolutional neural network architecture. Compared to GCNN, our construction of the “patch operator” is much simpler, does not depend on the injectivity radius of the manifold, and is not limited to triangular meshes. Overall, ACNN combines all the best properties of the previous approaches without inheriting their drawbacks. We show that the proposed framework outperforms GCNN, ADD, and other state-of-the-art approaches on challenging correspondence benchmarks. 2 Background We model a 3D shape as a two-dimensional compact Riemannian manifold (surface) X. Let TxX denote the tangent plane at x, modeling the surface locally as a Euclidean space. A Riemannian metric is an inner product h·, ·iTxX : TxX ⇥TxX ! R on the tangent plane, depending smoothly on x. Quantities which are expressible entirely in terms of Riemannian metric, and therefore independent on the way the surface is embedded, are called intrinsic. Such quantities are invariant to isometric (metric-preserving) deformations. Heat diffusion on manifolds is governed by the heat equation, which has the most general form ft(x, t) = −divX(D(x)rXf(x, t)), (1) with appropriate boundary conditions if necessary. Here rX and divX denote the intrinsic gradient and divergence operators, and f(x, t) is the temperature at point x at time t. D(x) is the thermal conductivity tensor (2 ⇥2 matrix) applied to the intrinsic gradient in the tangent plane. This formulation allows modeling heat flow that is position- and direction-dependent (anisotropic). Andreux et 2 al. [1] considered anisotropic diffusion driven by the surface curvature. Boscaini et al. [5], assuming that at each point x the tangent vectors are expressed w.r.t. the orthogonal basis vm, vM of principal curvature directions, used a thermal conductivity tensor of the form D↵✓(x) = R✓(x)  ↵ 1 " R> ✓(x), (2) where the 2 ⇥2 matrix R✓(x) performs rotation of ✓w.r.t. to the maximum curvature direction vM(x), and ↵> 0 is a parameter controlling the degree of anisotropy (↵= 1 corresponds to the classical isotropic case). We refer to the operator ∆↵✓f(x) = −divX(D↵✓(x)rXf(x)) as the anisotropic Laplacian, and denote by {φ↵✓i, λ↵✓i}i≥0 its eigenfunctions and eigenvalues (computed, if applicable, with the appropriate boundary conditions) satisfying ∆↵✓φ↵✓i(x) = λ↵✓iφ↵✓i(x). Given some initial heat distribution f0(x) = f(x, 0), the solution of heat equation (1) at time t is obtained by applying the anisotropic heat operator Ht ↵✓= e−t∆↵✓to f0, f(x, t) = Ht ↵✓f0(x) = Z X f0(⇠)h↵✓t(x, ⇠) d⇠, (3) where h↵✓t(x, ⇠) is the anisotropic heat kernel, and the above equation can be interpreted as a nonshift-invariant version of convolution. In the spectral domain, the heat kernel is expressed as h↵✓t(x, ⇠) = X k≥0 e−tλ↵✓kφ↵✓k(x)φ↵✓k(⇠). (4) Appealing to the signal processing intuition, the eigenvalues λ play the role of ‘frequencies’, e−tλ acts as a low-pass filter (larger t corresponding to longer diffusion results in a filter with a narrower pass band). This construction was used in ADD [5] to generalize the OSD approach [15] using anisotropic heat kernels (considering the diagonal h↵✓t(x, x) and learning a set of optimal taskspecific spectral filters replacing the low-pass filters e−tλ↵✓k). ↵ij βij ✓ i j k h R✓ˆum R✓ˆuM ˆum ˆuM ˆn ˆekj ˆeki ˆehi ˆehj Discretization. In the discrete setting, the surface X is sampled at n points V = {x1, . . . , xn}. The points are connected by edges E and faces F, forming a manifold triangular mesh (V, E, F). To each triangle ijk 2 F, we attach an orthonormal reference frame Uijk = (ˆuM, ˆum, ˆn), where ˆn is the unit normal vector to the triangle and ˆuM, ˆum 2 R3 are the directions of principal curvature. The thermal conductivity tensor for the triangle ijk operating on tangent vectors is expressed w.r.t. Uijk as a 3 ⇥3 matrix ⇣↵ 1 0 ⌘ . The discretization of the anisotropic Laplacian takes the form of an n ⇥n sparse matrix L = −S−1W. The mass matrix S is a diagonal matrix of area elements si = 1 3 P jk:ijk2F Aijk, where Aijk denotes the area of triangle ijk. The stiffness matrix W is composed of weights wij = 8 > < > : 1 2 ⇣hˆekj,ˆekiiH✓ sin ↵ij + hˆehj,ˆehiiH✓ sin βij ⌘ (i, j) 2 E; −P k6=i wik i = j; 0 else , (5) where the notation is according to the inset figure, and the shear matrix H✓ = R✓Uijk ⇣↵ 1 0 ⌘ U> ijkR> ✓encodes the anisotropic scaling up to an orthogonal basis change. Here R✓denotes the 3 ⇥3 rotation matrix, rotating the basis vectors Uijk on each triangle around the normal ˆn by angle ✓. 3 3 Intrinsic deep learning This paper deals with the extension of the popular convolutional neural networks (CNN) [14] to non-Euclidean domains. The key feature of CNNs is the convolutional layer, implementing the idea of “weight sharing”, wherein a small set of templates (filters) is applied to different parts of the data. In image analysis applications, the input into the CNN is a function representing pixel values given on a Euclidean domain (plane); due to shift-invariance the convolution can be thought of as passing a template across the plane and recording the correlation of the template with the function at that location. One of the major problems in applying the same paradigm to non-Euclidean domains is the lack of shift-invariance, the template now has to be location-dependent. Among the recent attempts to develop intrinsic CNNs on non-Euclidean domain [6, 4, 16], the most related to our work is GCNN [16]. The latter approach was introduced as a generalization of CNN to triangular meshes based on geodesic local patches. The core of this method is the construction of local geodesic polar coordinates using a procedure previously employed for intrinsic shape context descriptors [12]. The patch operator (D(x)f)(✓, ⇢) in GCNN maps the values of the function f around vertex x into the local polar coordinates ✓, ⇢, leading to the definition of the geodesic convolution (f ⇤a)(x) = max ∆✓2[0,2⇡) Z a(✓+ ∆✓, ⇢)(D(x)f)(✓, ⇢)d⇢d✓, (6) which follows the idea of multiplication by template, but is defined up to arbitrary rotation ∆✓2 [0, 2⇡) due to the ambiguity in the selection of the origin of the angular coordinate. The authors propose to take the maximum over all possible rotations of the template a(⇢, ✓) to remove this ambiguity. Here, and in the following, f is some feature vector that is defined on the surface (e.g. texture, geometric descriptors, etc.) There are several drawbacks to this construction. First, the charting method relies on a fast marchinglike procedure requiring a triangular mesh. While relatively insensitive to triangulation [12], it may fail if the mesh is very irregular. Second, the radius of the geodesic patches must be sufficiently small compared to the injectivity radius of the shape, otherwise the resulting patch is not guaranteed to be a topological disk. In practice, this limits the size of the patches one can safely use, or requires an adaptive radius selection mechanism. 4 Anisotropic convolutional neural networks The key idea of the Anisotropic CNN presented in this paper is the construction of a patch operator using anisotropic heat kernels. We interpret heat kernels as local weighting functions and construct (D↵(x)f)(✓, t) = R X h↵✓t(x, ⇠)f(⇠)d⇠ R X h↵✓t(x, ⇠)d⇠ , (7) for some anisotropy level ↵> 1. This way, the values of f around point x are mapped to a local system of coordinates (✓, t) that behaves like a polar system (here t denotes the scale of the heat kernel and ✓is its orientation). We define intrinsic convolution as (f ⇤a)(x) = Z a(✓, t)(D↵(x)f)(✓, t)dtd✓, (8) Note that unlike the arbitrarily oriented geodesic patches in GCNN, necessitating to take a maximum over all the template rotations (6), in our construction it is natural to use the principal curvature direction as the reference ✓= 0. Such an approach has a few major advantages compared to previous intrinsic CNN models. First, being a spectral construction, our patch operator can be applied to any shape representation (like LSCNN and unlike GCNN). Second, being defined in the spatial domain, the patches and the resulting filters have a clear geometric interpretation (unlike LSCNN). Third, our construction accounts for local directional patterns (like GCNN and unlike LSCNN). Fourth, the heat kernels are always well defined independently of the injectivity radius of the manifold (unlike GCNN). We summarize the comparative advantages in Table 1. ACNN architecture. Similarly to Euclidean CNNs, our ACNN consists of several layers that are applied subsequently, i.e. the output of the previous layer is used as the input into the subsequent one. 4 Method Repr. Input Generalizable Filters Context Directional Task OSD [15] Any Geometry Yes Spectral No No Descriptors ADD [5] Any Geometry Yes Spectral No Yes Any RF [20] Any Any Yes Spectral No No Correspondence GCNN [16] Mesh Any Yes Spatial Yes Yes Any SCNN [6] Any Any No Spectral Yes No Any LSCNN [4] Any Any Yes Spectral Yes No Any ACNN Any Any Yes Spatial Yes Yes Any Table 1: Comparison of different intrinsic learning models. Our ACNN model combines all the best properties of the other models. Note that OSD and ADD are local spectral descriptors operating with intrinsic geometric information of the shape and cannot be applied to arbitrary input, unlike the Random Forest (RF) and convolutional models. ACNN, as any convolutional network, is applied in a point-wise manner on a function defined on the manifolds, producing a point-wise output that is interpreted as soft correspondence, as described below. Our intrinsic convolutional layer ICQ, with Q output maps, is defined as follows and replaces the convolutional layer used in classical Euclidean CNNs with the construction (8). The ICQ layer contains PQ filters arranged in banks (P filters in Q banks); each bank corresponds to an output dimension. The filters are applied to the input as follows, f out q (x) = P X p=1 (f in p ⇤aqp)(x), q = 1, . . . , Q, (9) where aqp(✓, t) are the learnable coefficients of the pth filter in the qth filter bank. A visualization of such filters is available in the supplementary material. Overall, the ACNN architecture combining several layers of different type, acts as a non-linear parametric mapping of the form f⇥(x) at each point x of the shape, where ⇥denotes the set of all learnable parameters of the network. The choice of the parameters is done by an optimization process, minimizing a task-specific cost, and can thus be rather general. Here, we focus on learning shape correspondence. Learning correspondence Finding correspondence in a collection of shapes can be cast as a labelling problem, where one tries to label each vertex of a given query shape X with the index of a corresponding point on some reference shape Y [20]. Let n and m denote the number of vertices in X and Y , respectively. For a point x on a query shape, the output of ACNN f⇥(x) is m-dimensional and is interpreted as a probability distribution (‘soft correspondence’) on Y . The output of the network at all the points of the query shape represents the probability of x mapped to y. Let us denote by y⇤(x) the ground-truth correspondence of x on the reference shape. We assume to be provided with examples of points from shapes across the collection and their ground-truth correspondence, T = {(x, y⇤(x))}. The optimal parameters of the network are found by minimizing the multinomial regression loss `reg(⇥) = − X (x,y⇤(x))2T log f⇥(x, y⇤(x)). (10) 5 Results In this section, we evaluate the proposed ACNN method and compare it to state-of-the-art approaches. Anisotropic Laplacians were computed according to (5). Heat kernels were computed in the frequency domain using all the eigenpairs. In all experiments, we used L = 16 orientations and the anisotropy parameter ↵= 100. Neural networks were implemented in Theano [2]. The ADAM [11] stochastic optimization algorithm was used with initial learning rate of 10−3, β1 = 0.9, and β2 = 0.999. As the input to the networks, we used the local SHOT descriptor [21] with 544 dimensions and using default parameters. For all experiments, training was done by minimizing the loss (10). For shapes with 6.9K vertices, Laplacian computation and eigendecomposition took 1 sec and 4 seconds per angle, respectively on a desktop workstation with 64Gb of RAM and i7-4820K CPU. Forward propagation of the trained model takes approximately 0.5 sec to produce the dense soft correspondence for all the vertices. 5 0 10 20 30 40 cm 0 0.05 0.1 0.15 0.2 0 0.2 0.4 0.6 0.8 1 % geodesic diameter Geodesic error % correspondences BIM LSCNN RF ADD GCNN ACNN 0.05 0.1 0.15 0.2 0 0.2 0.4 0.6 0.8 1 % geodesic diameter Geodesic error RF PFM ACNN 0.05 0.1 0.15 0.2 0 0.2 0.4 0.6 0.8 1 % geodesic diameter Geodesic error RF PFM ACNN Figure 2: Performance of different correspondence methods, left to right: FAUST meshes, SHREC’16 Partial cuts and holes. Evaluation of the correspondence was done using the Princeton protocol. Full mesh correspondence We used the FAUST humans dataset [3], containing 100 meshes of 10 scanned subjects, each in 10 different poses. The shapes in the collection manifest strong non-isometric deformations. Vertex-wise groundtruth correspondence is known between all the shapes. The zeroth FAUST shape containing 6890 vertices was used as reference; for each point on the query shape, the output of the network represents the soft correspondence as a 6890dimensional vector which was then converted to point correspondence with the technique explained in Section 4. First 80 shapes for training and the remaining 20 for testing, following verbatim the settings of [16]. Batch normalization [9] allowed to effectively train larger and deeper networks. For this experiment, we adopted the following architecture inspired by GCNN [16]: FC64+IC64+IC128+IC256+FC1024+FC512+Softmax. The soft correspondences produced by the net were refined using functional map [18]. We refer to the supplementary material for the details. We compare to Random Forests (RF) [20], Blended Intrinsic Maps (BIM) [10], Localized Spectral CNN (LSCNN) [4], and Anisotropic Diffusion Descriptors (ADD) [5]. Figure 2 (left) shows the performance of different methods. The performance was evaluated using the Princeton protocol [10], plotting the percentage of matches that are at most r-geodesically distant from the groundtruth correspondence on the reference shape. Two versions of the protocol consider intrinsically symmetric matches as correct (symmetric setting, solid curves) or wrong (asymmetric, more challenging setting, dashed curves). Some methods based on intrinsic structures (e.g. LSCNN or RF applied on WKS descriptors) are invariant under intrinsic symmetries and thus cannot distinguish between symmetric points. The proposed ACNN method clearly outperforms all the compared approaches and also perfectly distinguishes symmetric points. Figure 3 shows the pointwise geodesic error of different correspondence methods (distance of the correspondence at a point from the groundtruth). ACNN shows dramatically smaller distortions compared to other methods. Over 60% of matches are exact (zero geodesic error), while only a few points have geodesic error larger than 10% of the geodesic diameter of the shape 1. Please refer to the supplementary material for an additional visualization of the quality of the correspondences obtained with ACNN in terms of texture transfer. Partial correspondence We used the recent very challenging SHREC’16 Partial Correspondence benchmark [7], consisting of nearly-isometrically deformed shapes from eight classes, with different parts removed. Two types of partiality in the benchmark are cuts (removal of a few large parts) and holes (removal of many small parts). In each class, the vertex-wise groundtruth correspondence between the full shape and its partial versions is given. The dataset was split into training and testing disjoint sets. For cuts, training was done on 15 shapes per class; for holes, training was done on 10 shapes per class. We used the following ACNN architecture: IC32+FC1024+DO(0.5)+FC2048+DO(0.5)+Softmax. The soft correspondences produced by the net were refined using partial functional correspondence [19]. We refer to the supplementary mate1Per subject leave-one-out produces comparable results with mean accuracy of 59.6 ± 3.7%. 6 Anisotropic CNN Geodesic CNN Blended Intrinsic Maps 0 0.1 Figure 3: Pointwise geodesic error (in % of geodesic diameter) of different correspondence methods (top to bottom: Blended Intrinsic Maps, GCNN, ACNN) on the FAUST dataset. Error values are saturated at 10% of the geodesic diameter. Hot colors correspond to large errors. rial for the details. The dropout regularization, with ⇡drop = 0.5, was crucial to avoid overfitting on such a small training set. We compared ACNN to RF [20] and Partial Functional Maps (PFM) [19]. For the evaluation, we used the protocol of [7], which closely follows the Princeton benchmark. Figure 2 (middle) compares the performance of different partial matching methods on the SHREC’16 Partial (cuts) dataset. ACNN outperforms other approaches with a significant margin. Figure 4 (top) shows examples of partial correspondence on the horse shape as well as the pointwise geodesic error. We observe that the proposed approach produces high-quality correspondences even in such a challenging setting. Figure 2 (right) compares the performance of different partial matching methods on the SHREC’16 Partial (holes) dataset. In this setting as well, ACNN outperforms other approaches with a significant margin. Figure 4 (bottom) shows examples of partial correspondence on the dog shape as well as the pointwise geodesic error. 6 Conclusions We presented Anisotropic CNN, a new framework generalizing convolutional neural networks to non-Euclidean domains, allowing to perform deep learning on geometric data. Our work follows the very recent trend in bringing machine learning methods to computer graphics and geometry processing applications, and is currently the most generic intrinsic CNN model. Our experiments show that ACNN outperforms previously proposed intrinsic CNN models, as well as additional state-of-the-art methods in the shape correspondence application in challenging settings. Being a generic model, ACNN can be used for many other applications. The most promising future work direction is applying ACNN to learning on graphs. 7 Random Forest Anisotropic CNN 0 0.1 Random Forest Anisotropic CNN 0 0.1 Figure 4: Examples of partial correspondence on the SHREC’16 Partial cuts (top) and holes (bottom) datasets. Rows 1 and 4: correspondence produced by ACNN. Corresponding points are shown in similar color. Reference shape is shown on the left. Rows 2, 5 and 3, 6: pointwise geodesic error (in % of geodesic diameter) of the ACNN and RF correspondence, respectively. Error values are saturated at 10% of the geodesic diameter. Hot colors correspond to large errors. 8 Acknowledgments The authors wish to thank Matteo Sala for the textured models. This research was supported by the ERC Starting Grant No. 307047 (COMET), a Google Faculty Research Award, and Nvidia equipment grant. References [1] M. Andreux, E. Rodol`a, M. Aubry, and D. Cremers. Anisotropic Laplace-Beltrami operators for shape analysis. In Proc. NORDIA, 2014. [2] J. Bergstra et al. Theano: a CPU and GPU math expression compiler. In Proc. SciPy, June 2010. [3] F. Bogo, J. Romero, M. Loper, and M. J. Black. FAUST: Dataset and evaluation for 3D mesh registration. In Proc. CVPR, 2014. [4] D. Boscaini, J. Masci, S. Melzi, M. M. Bronstein, U. Castellani, and P. Vandergheynst. Learning classspecific descriptors for deformable shapes using localized spectral convolutional networks. Computer Graphics Forum, 34(5):13–23, 2015. [5] D. Boscaini, J. Masci, E. Rodol`a, M. M. Bronstein, and D. Cremers. Anisotropic diffusion descriptors. Computer Graphics Forum, 35(2), 2016. [6] J. Bruna, W. Zaremba, A. Szlam, and Y. LeCun. Spectral networks and locally connected networks on graphs. In Proc. ICLR, 2014. [7] L. Cosmo, E. Rodol`a, M. M. Bronstein, A. Torsello, D. Cremers, and Y. Sahillio˘glu. Shrec’16: Partial matching of deformable shapes. In Proc. 3DOR, 2016. [8] K. Fukushima. Neocognitron: A self-organizing neural network model for a mechanism of pattern recognition unaffected by shift in position. Biological Cybernetics, 36(4):193–202, 1980. [9] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proc. ICML, pages 448–456, 2015. [10] V. G. Kim, Y. Lipman, and T. Funkhouser. Blended intrinsic maps. TOG, 30(4):79, 2011. [11] D. P. Kingma and J. Ba. ADAM: A method for stochastic optimization. In ICLR, 2015. [12] I. Kokkinos, M. M. Bronstein, R. Litman, and A. M. Bronstein. Intrinsic shape context descriptors for deformable shapes. In Proc. CVPR, 2012. [13] A. Krizhevsky, I. Sutskever, and G. E. Hinton. ImageNet classification with deep convolutional neural networks. In Proc. NIPS, 2012. [14] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4):541–551, 1989. [15] R. Litman and A. M. Bronstein. Learning spectral descriptors for deformable shape correspondence. PAMI, 36(1):170–180, 2014. [16] J. Masci, D. Boscaini, M. M. Bronstein, and P. Vandergheynst. Geodesic convolutional neural networks on riemannian manifolds. In Proc. 3dRR, 2015. [17] F. M´emoli. Gromov-Wasserstein Distances and the Metric Approach to Object Matching. Foundations of Computational Mathematics, pages 1–71, 2011. [18] M. Ovsjanikov, M. Ben-Chen, J. Solomon, A. Butscher, and L. Guibas. Functional maps: a flexible representation of maps between shapes. TOG, 31(4):1–11, 2012. [19] E. Rodol`a, L. Cosmo, M. M. Bronstein, A. Torsello, and D. Cremers. Partial functional correspondence. Computer Graphics Forum, 2016. [20] E. Rodol`a, S. Rota Bul`o, T. Windheuser, M. Vestner, and D. Cremers. Dense non-rigid shape correspondence using random forests. In Proc. CVPR, 2014. [21] S. Salti, F. Tombari, and L. Di Stefano. SHOT: unique signatures of histograms for surface and texture description. CVIU, 125:251–264, 2014. [22] D. I Shuman, B. Ricaud, and P. Vandergheynst. Vertex-frequency analysis on graphs. arXiv:1307.5708, 2013. [23] J. Solomon, A. Nguyen, A. Butscher, M. Ben-Chen, and L. Guibas. Soft maps between surfaces. Computer Graphics Forum, 31(5):1617–1626, 2012. [24] H. Su, S. Maji, E. Kalogerakis, and E. Learned-Miller. Multi-view convolutional neural networks for 3D shape recognition. In Proc. ICCV, 2015. [25] O. van Kaick, H. Zhang, G. Hamarneh, and D. Cohen-Or. A survey on shape correspondence. Computer Graphics Forum, 20:1–23, 2010. [26] L. Wei, Q. Huang, D. Ceylan, E. Vouga, and H. Li. Dense human body correspondences using convolutional networks. In Proc. CVPR, 2016. [27] T. Windheuser, M. Vestner, E. Rodol`a, R. Triebel, and D. Cremers. Optimal intrinsic descriptors for non-rigid shape analysis. In Proc. BMVC, 2014. [28] Z. Wu, S. Song, A. Khosla, et al. 3D ShapeNets: A deep representation for volumetric shapes. In Proc. CVPR, 2015. 9
2016
79
6,540
Visual Dynamics: Probabilistic Future Frame Synthesis via Cross Convolutional Networks Tianfan Xue*1 Jiajun Wu*1 Katherine L. Bouman1 William T. Freeman1,2 1 Massachusetts Institute of Technology 2 Google Research {tfxue, jiajunwu, klbouman, billf}@mit.edu Abstract We study the problem of synthesizing a number of likely future frames from a single input image. In contrast to traditional methods, which have tackled this problem in a deterministic or non-parametric way, we propose to model future frames in a probabilistic manner. Our probabilistic model makes it possible for us to sample and synthesize many possible future frames from a single input image. To synthesize realistic movement of objects, we propose a novel network structure, namely a Cross Convolutional Network; this network encodes image and motion information as feature maps and convolutional kernels, respectively. In experiments, our model performs well on synthetic data, such as 2D shapes and animated game sprites, as well as on real-world video frames. We also show that our model can be applied to visual analogy-making, and present an analysis of the learned network representations. 1 Introduction From just a single snapshot, humans are often able to imagine how a scene will visually change over time. For instance, due to the pose of the girl in Figure 1, most would predict that her arms are stationary but her leg is moving. However, the exact motion is often unpredictable due to an intrinsic ambiguity. Is the girl’s leg moving up or down? In this work, we study the problem of visual dynamics: modeling the conditional distribution of future frames given an observed image. We propose to tackle this problem using a probabilistic, content-aware motion prediction model that learns this distribution without using annotations. Sampling from this model allows us to visualize the many possible ways that an input image is likely to change over time. Modeling the conditional distribution of future frames given only a single image as input is a very challenging task for a number of reasons. First, natural images come from a very high dimensional distribution that is difficult to model. Designing a generative model for realistic images is a very challenging problem. Second, in order to properly predict motion distributions, the model must first learn about image parts and the correlation of their respective motions in an unsupervised fashion. In this work, we tackle the visual dynamics problem using a neural network structure, based on a variational autoencoder [Kingma and Welling, 2014] and our newly proposed cross convolutional layer. During training, the network observes a set of consecutive image pairs in videos, and automatically infers the relationship between them without any supervision. During testing, the network then predicts the conditional distribution, P(J|I), of future RGB images J (Figure 1b) given an RGB input image I that was not in the training set (Figure 1a). Using this distribution, the network is able to synthesize multiple different image samples corresponding to possible future frames of the input image (Figure 1c). Our network contains a number of key components that contribute to its success: • We use a conditional variational autoencoder to model the complex conditional distribution of future frames [Kingma and Welling, 2014, Yan et al., 2016]. This allows us to approximate a sample, J, from the distribution of future images by using a trainable function J = f(I, z). ∗indicates equal contributions. (a) Input Image (c) Output Image Samples (b) Probabilistic Model Conditional Distribution of Future Frame Figure 1: Predicting the movement of an object from a single snapshot is often ambiguous. For instance, is the girl’s leg in (a) moving up or down? We propose a probabilistic, content-aware motion prediction model (b) that learns the conditional distribution of future frames. Using this model we are able to synthesize various future frames (c) that are all consistent with the observed input (a). The argument z is a sample from a simple distribution, e.g. Gaussian, which introduces randomness into the sampling of J. This formulation makes the problem of learning the distribution much more tractable than explicitly modeling the distribution. • We model motion using a set of image-dependent convolution kernels operating over an image pyramid. Unlike normal convolutional layers, these kernels vary between images, as different images may have different motions. Our proposed cross convolutional layer convolves image-dependent kernels with feature maps from an observed frame, to synthesize a probable future frame. We test the proposed model on two synthetic datasets as well as a dataset generated from real videos. We show that, given an RGB input image, the algorithm can successfully model a distribution of possible future frames, and generate different samples that cover a variety of realistic motions. In addition, we demonstrate that our model can be easily applied to tasks such as visual analogy-making, and present an analysis of the learned network representations. 2 Related Work Motion priors Research studying the human visual system and motion priors provides evidence for low-level statistics of object motion. Pioneering work by Weiss and Adelson [1998] found that the human visual system prefers slow and smooth motion fields. More recent work by Roth and Black [2005] analyzed the response of spatial filters applied to optical flow fields. Fleet et al. [2000] also found that a local motion field can be represented by a linear combination of a small number of bases. All these works focus on the distribution of a motion field itself without considering any image information. On the contrary, our context-aware model captures the relationship between an observed image and its motion field. Motion or future prediction Our problem is closely related to the motion or feature prediction problem. Given an observed image or a short video sequence, models have been proposed to predict a future motion field [Liu et al., 2011, Pintea et al., 2014, Xue et al., 2014, Walker et al., 2015, 2016], a future trajectory of objects [Walker et al., 2014, Wu et al., 2015], or a future visual representation [Vondrick et al., 2016b]. Most of these works use deterministic prediction models [Pintea et al., 2014, Vondrick et al., 2016b]. Recently, and concurrently with our own work, Walker et al. [2016] found that there is an intrinsic ambiguity in deterministic prediction, and propose a probabilistic prediction framework. Our model is also a probabilistic prediction model, but it directly predicts the pixel values, rather than motion fields or image features. Parametric image synthesis Early work in parametric image synthesis mostly focus on texture synthesis using hand-crafted features [Portilla and Simoncelli, 2000]. More recently, works in image synthesis have begun to produce impressive results by training variants of neural network structures to produce novel images [Gregor et al., 2015, Xie et al., 2016a,b, Zhou et al., 2016]. Generative adversarial networks [Goodfellow et al., 2014, Denton et al., 2015, Radford et al., 2016] and variational autoencoders [Kingma and Welling, 2014, Yan et al., 2016] have been used to model and sample from natural image distributions. Our proposed algorithm is also based on the variational autoencoder, but unlike in this previous work, we also model temporal consistency. Video synthesis Techniques that exploit the periodic structure of motion in videos have also been successful at generating novel frames from an input sequence. Early work in video textures proposed to shuffle frames from an existing video to generate a temporally consistent, looping image sequence [Schödl et al., 2000]. These ideas were later extended to generate cinemagraphies [Joshi et al., 2012], seamlessly looping videos containing a variety of objects with different motion patterns [Agarwala et al., 2005, Liao et al., 2013], or video inpainting [Wexler et al., 2004]. While 2 (d) Probabilistic frame predictor (c) Motion prior (b) Deterministic motion prediction 𝐼 (a) A toy world 𝐼 𝑣 𝑣 𝑣 𝑧 𝑧 𝑣 𝑧 𝑣 𝑣 𝐼 𝑣 𝑣 𝑧 𝐼 𝑝(𝑣|𝑧) 𝑝(𝑧|𝑣) 𝑝(𝑣|𝐼, 𝑧) 𝑝(𝑧|𝐼, 𝑣) 𝑓 Figure 2: A toy world example. See Section 3.2 for details. high-resolution and realistic looking videos are generated using these techniques, they are often limited to periodic motion and require an input reference video. In contrast, we build an image generation model that does not require a reference video at test time. Recently, several network structures have been proposed to synthesize a new frame from observed frames. They infer the future motion either from multiple previous frames Srivastava et al. [2015], Mathieu et al. [2016], user-supplied action labels Oh et al. [2015], Finn et al. [2016], or a random vector Vondrick et al. [2016a]. In contrast to these approaches, our network takes a single frame as input and learns the distribution of future frames without any supervision. 3 Formulation 3.1 Problem Definition In this section, we describe how to sample future frames from a current observation image. Here we focus on next frame synthesis; given an RGB image I observed at time t, our goal is to model the conditional distribution of possible frames observed at time t + 1. Formally, let {(I(1), J(1)), . . . , (I(n), J(n))} be the set of image pairs in the training set, where I(i) and J(i) are images observed at two consecutive time steps. Using this data, our task is to model the distribution pθ(J|I) of all possible next frames J for a new, previously unseen test image I, and then to sample new images from this distribution. In practice, we choose not to directly predict the next frame, but instead to predict the difference image v = J −I, also known as the Eulerian motion, between the observed frame I and the future frame J; these two problems are equivalent. The task is then to learn the conditional distribution pθ(v|I) from a set of training pairs {(I(1), v(1)), . . . , (I(n), v(n))}. 3.2 A Toy Example Consider a simple toy world that only consists of circles and squares. All circles move vertically, while all squares move horizontally, as shown in the Figure 2(a). Although in practice we choose v to be the difference image between consecutive frames, for this toy example we show v as a 2D motion field for a more intuitive visualization. Consider the three models shown in Figure 2. (1) Deterministic motion prediction In this structure, the model tries to find a deterministic relationship between the input image and object motion (Figure 2(b)). To do this, it attempts to find a function f that minimizes the reconstruction error P i ||v(i) −f(I(i))|| on a training set. Thus, it cannot capture the multiple possible motions that a shape can have, and the algorithm can only learn a mean motion for each object. In the case of zero-mean, symmetric motion distributions, the algorithm would produce an output frame with almost no motion. (2) Motion prior A simple way to model the multiple possible motions of future frames is to use a variational autoencoder [Kingma and Welling, 2014], as shown in Figure 2(c). The network consists of an encoder network (gray) and a decoder network (yellow), and the latent representation z encodes the intrinsic dimensionality of the motion fields. A shortcoming of this model is that it does not see the input image during inference. Therefore, it will only learn a global motion field of both circles and squares, without distinguishing the particular motion pattern for each class of objects. (3) Probabilistic frame predictor In this work, we combine the deterministic motion prediction structure with a motion prior, to model the uncertainty in a motion field and the correlation between motion and image content. We extend the decoder in (2) to take two inputs, the intrinsic motion representation z and an image I (see the yellow network in Figure 2(d), which corresponds to p(v|I, z)). Therefore, instead of modeling a joint distribution of motion v, it will learn a conditional distribution of motion given the input image I. 3 In this toy example, since squares and circles only move in one (although different) direction, we would only need a scalar z ∈R for encoding the velocity of the object. The model is then able to infer the location and direction of motion conditioned on the shape that appears in the input image. 3.3 Conditional Variational Autoencoder In this section, we will formally derive the training objective of our model, following the similar derivations as those in Kingma and Welling [2014], Kingma et al. [2014], Yan et al. [2016]. Consider the following generative process that samples a future frame conditioned on an observed image, I. First, the algorithm samples the hidden variable z from a prior distribution pz(z); in this work, we assume pz(z) is a multivariate Gaussian distribution where each dimension is i.i.d. with zero-mean and unit-variance. Then, given a value of z, the algorithm samples the intensity difference image v from the conditional distribution pθ(v|I, z). The final image, J = I + v, is then returned as output. In the training stage, the algorithm attempts to maximize the log-likelihood of the conditional marginal distribution P i log p(v(i)|I(i)). Assuming I and z are independent, the marginal distribution is expanded as P i log R z p(v(i)|I(i), z)pz(z)dz. Directly maximizing this marginal distribution is hard, thus we instead maximize its variational upper-bound, as proposed by Kingma and Welling [2014]. Each term in the marginal distribution is upper-bounded by L(θ, φ, v(i)|I(i)) ≈−DKL(qφ(z|v(i), I(i))||pz(z)) + 1 L L X l=1 h log pθ(v(i)|z(i,l), I(i)) i , (1) where DKL is the KL-divergence, qφ(z|v(i), I(i)) is the variational distribution that approximates the posterior p(z|v(i), I(i)), and z(i,l) are samples from the variational distribution. For simplicity, we refer to the conditional data distribution, pθ(·), as the generative model, and the variational distribution, qφ(·), as the recognition model. We assume Gaussian distributions for both the generative model and recognition model∗, where the mean and variance of the distributions are functions specified by neural networks, that is†: pθ(v(i)|z(i,l), I(i)) = N(v(i); fmean(z(i,l), I(i)), σ2I), (2) qφ(z(i,l)|v(i), I(i)) = N(z(i,l); gmean(v(i), I(i)), gvar(v(i), I(i))), (3) where N( · ; a, b) is a Gaussian distrubtion with mean a and variance b. fmean is a function that predicts the mean of the generative model, defined by the generative network (the yellow network in Figure 2(d)). gmean and gvar are functions that predict the mean and variance of the recognition model, respectively, defined by the recognition network (the gray network in Figure 2(d)). Here we assume that all dimensions of the generative model have the same variance σ2, where σ is a hand-tuned hyper parameter. In the next section, we will describe the details of both network structures. 4 Method In this section we present a trainable neural network structure, which defines the generative function fmean and recognition functions gmean, and gvar. Once trained, these functions can be used in conjunction with an input image to sample future frames. We first describe our newly proposed cross convolutional layer, which naturally characterizes a layered motion representation [Wang and Adelson, 1993]. We then explain our network structure and demonstrate how we integrate the cross convolutional layer into the network for future frame synthesis. 4.1 Layered Motion Representations and Cross Convolutional Networks Motion can often be decomposed in a layer-wise manner [Wang and Adelson, 1993]. Intuitively, different semantic segments in an image should have different distributions over all possible motions; for example, a building is often static, but a river flows. To model layered motion, we propose a novel cross convolutional network (Figure 3). The network first decomposes an input image pyramid into multiple feature maps through an image encoder (Figure 3(c)). It then convolves these maps with different kernels (Figure 3(d)), and uses the outputs to synthesize a difference image (Figure 3(e)). This network structure naturally fits a layered motion representation, as each feature map characterizes an image layer (note this is different from a network ∗A complicated distribution can be approximated by a function of a simple distribution, e.g. Gaussian, which is referred as the reparameterization trick in [Kingma and Welling, 2014]. †Here the bold I denotes an identity matrix, whereas the normal-font I denotes the observed image. 4 𝑧 Difference image Pyramid of the current frame Feature maps (e) Motion decoder (c) Image encoder Difference image (d) Cross convolution (a) Motion encoder … (b) Kernel decoder … … Upsample Figure 3: Our network consists of five components: (a) a motion encoder, (b) a kernel decoder, (c) an image encoder, (d) a cross convolution layer, and (e) a motion decoder. Our image encoder takes images at four scales as input. For simplicity, we only show two scales in this figure. layer) and the corresponding kernel characterizes the motion of that layer. In other words, we model motions as convolutional kernels, which are applied to feature maps of images at multiple scales. Unlike a traditional convolutional network, these kernels should not be identical for all inputs, as different images typically have different motions (kernels). We therefore propose a cross convolutional layer to tackle this problem. The cross convolutional layer does not learn the weights of the kernels itself. Instead, it takes both kernel weights and feature maps as input and performs convolution during a forward pass; for back propagation, it computes the gradients of both convolutional kernels and feature maps. Concurrent works from Finn et al. [2016], Brabandere et al. [2016] also explored similar ideas. While they applied the learned kernels on input images, we jointly learn feature maps and kernels without direct supervision. 4.2 Network Structure As shown in Figure 3, our network consists of five components: (a) a motion encoder, (b) a kernel decoder, (c) an image encoder, (d) a cross convolutional layer, and (e) a motion decoder. The recognition functions gmean and gvar are defined by the motion encoder, whereas the generative function fmean is defined by the remaining network. During training, our variational motion encoder (Figure 3(a)) takes two adjacent frames in time as input, both at a resolution of 128 × 128, and outputs a 3,200-dimensional mean vector and a 3,200-dimensional variance vector. The network samples the latent motion representation z using these mean and variance vectors. Next, the kernel decoder (Figure 3(b)) sends the 3,200 = 128×5×5 tensor into two additional convolutional layers, producing four sets of 32 motion kernels of size 5 × 5. Our image encoder (Figure 3(c)) operates on four different scaled versions of the input image I (256 × 256, 128 × 128, 64 × 64, and 32 × 32). The output sizes of the feature maps in these four channels are 32 × 64 × 64, 32 × 32 × 32, 32 × 16 × 16, and 32 × 8 × 8, respectively. This multi-scale convolutional network allows us to model both global and local structures in the image, which may have different motions. See appendix for more details. The core of our network is a cross convolutional layer (Figure 3(d)) which, as discussed in Section 4.1, applies the kernels learned by the kernel decoder to the feature maps learned by the image encoder, respectively. The output size of the cross convolutional layer is identical to that of the image encoder. Finally, our motion decoder (Figure 3(e)) uses the output of the cross convolutional layer to regress the output difference image. Training and testing details During training, the image encoder takes a single frame I(i) as input, and the motion encoder takes both I(i) and the difference image v(i) = J(i) −I(i) as input, where J(i) is the next frame. The network aims to regress the difference image that minimizes the ℓ2 loss. During testing, the image encoder still sees a single image I; however, instead of using a motion encoder, we directly sample motion vectors z(j) from the prior distribution pz(z). In practice, we use an empirical distribution of z over all training samples as an approximation to the prior, as we find it produces better synthesis results. The network synthesizes possible difference images v(j) by taking 5 (a) Frame 1 (b) Frame 2 (ground truth) (c) Frame 2 (Reconstruction) (d) Frame 2 (Sample 1) (e) Frame 2 (Sample 2) Figure 4: Results on the shapes dataset containing circles (C) squares (S) and triangles (T). For each ‘Frame 2’ we show the RGB image along with an overlay of green and magenta versions of the 2 consecutive frames, to help illustrate motion. See text and our project page for more details and a better visualization. -5 0 5 -5 0 5 -5 0 5 -5 0 5 Square Triangles Circles-Triangles -5 0 5 -5 0 5 -5 0 5 -5 0 5 Circles -5 0 5 -5 0 5 -5 0 5 -5 0 5 -5 0 5 -5 0 5 -5 0 5 -5 0 5 Vy Vx Vy Vx Vy Vx Vy Vx Vy Vx Vy Vx Vcirc VTri Vcirc VTri Ground truth distribution Predicted distribution KL divergence (DKL(pgt || ppred)) between predicted and ground truth distributions Method Shapes C. S. T. C.-T. Flow 6.77 7.07 6.07 8.42 AE 8.76 12.37 10.36 10.58 Ours 1.70 2.48 1.14 2.46 Figure 5: Left: for each object, comparison between its ground-truth motion distribution and the distribution predicted by our method. Right: KL divergence between ground-truth distributions and distributions predicted by three different algorithms. the sampled latent representation z(j) and an RGB image I as input. We then generate a set of future frames {J(j)} from these difference images: J(j) = I + v(j). 5 Evaluations We now present a series of experiments to evaluate our method. All experimental results, along with additional visualizations, are also available on our project page‡. Movement of 2D shapes We first evaluate our method using a dataset of synthetic 2D shapes. This dataset serves to benchmark our model on objects with simple, yet nontrivial, motion distributions. It contains three types of objects: circles, squares, and triangles. Circles always move vertically, squares horizontally, and triangles diagonally. The motion of circles and squares are independent, while the motion of circles and triangles are correlated. The shapes can be heavily occluded, and their sizes, positions, and colors are chosen randomly. There are 20,000 pairs for training, and 500 for testing. Results are shown in Figure 4. Figure 4(a) and (b) show a sample of consecutive frames in the dataset, and Figure 4(c) shows the reconstruction of the second frame after encoding and decoding with the ground truth images. Figure 4(d) and (e) show samples of the second frame; in these results the network only takes the first image as input, and the compact motion representation, z, is randomly sampled. Note that the network is able to capture the distinctive motion pattern for each shape, including the strong correlation of triangle and circle motion. To quantitatively evaluate our algorithm, we compare the displacement distributions of circles, squares, and triangles in the sampled images with their ground truth distributions. We sampled 50,000 images and used the optical flow package by Liu [2009] to calculate the movement of each object. We compare our algorithm with a simple baseline that copies the optical flow field from the training set (‘Flow’ in Figure 5 right); for each test image, we find its 10-nearest neighbors in the training set, and randomly transfer one of the corresponding optical flow fields. To illustrate the advantage of using a variational autoencoder over a standard autoencoder, we also modify our network by removing the KL-divergence loss and sampling layer (‘AE’ in Figure 5 right). Figure 5 shows our predicted distribution is very close to the ground-truth distribution. It also shows that a variational autoencoder helps to capture the true distribution of future frames. ‡Our project page: http://visualdynamics.csail.mit.edu 6 (a) Frame 1 (b) Frame 2 (ground truth) (c) Frame 2 (Sample 1) (d) Frame 2 (Sample 2) Labeled real (%) Method Resolution 32×32 64×64 Flow 29.7 21.0 Ours 41.2 35.7 Figure 6: Left: Sampling results on the Sprites dataset. Motion is illustrated using the overlay described in Figure 4. Right: Probability that a synthesized result is labeled as real by humans in Mechanical Turk behavioral experiments (a) Frame 1 (b) Frame 2 (ground truth) (c) Frame 2 (Sample 1) (d) Frame 2 (Sample 2) Labeled real (%) Method Resolution 32×32 64×64 Flow 31.3 25.5 Ours 36.7 31.3 Figure 7: Results on Exercise dataset. Left: Sampling results on Exercise dataset. Motion is illustrated using the overlay described in Figure 4. Right: probability that a synthesized result is labeled as real by humans in Mechanical Turk behavior experiments Movement of video game sprites We evaluate our framework on a video game sprites dataset§, also used by Reed et al. [2015]. The dataset consists of 672 unique characters, and for each character there are 5 animations (spellcast, thrust, walk, slash, shoot) from 4 different viewpoints. Each animation ranges from 6 to 13 frames. We collect 102,364 pairs of neighboring frames for training, and 3,140 pairs for testing. The same character does not appear in both the training and test sets. Synthesized sample frames are shown in Figure 6. The results show that from a single input frame, our method can capture various possible motions that are consistent with those in the training set. For a quantitative evaluation, we conduct behavioral experiments on Amazon Mechanical Turk. We randomly select 200 images, sample possible next frames using our algorithm, and show them to multiple human subjects as an animation side by side with the ground truth animation. We then ask the subject to choose which animation is real (not synthesized). An ideal algorithm should achieve a success rate of 50%. In our experiments, we present the animation in both the original resolution (64 × 64) and a lower resolution (32 × 32). We only evaluate on subjects that have a past approval rating of > 95% and also pass our qualification tests. Figure 6 shows that our algorithm significantly out-performs a baseline algorithm that warps an input image by transferring a randomly selected flow field from the training set. Subjects are more easily fooled by the 32 × 32 pixel images, as it is harder to hallucinate realistic details in high-resolution images. Movement in real videos captured in the wild To demonstrate that our algorithm can also handle real videos, we collect 20 workout videos from YouTube, each about 30 to 60 minutes long. We first apply motion stabilization to the training data as a pre-processing step to remove camera motion. We then extract 56,838 pairs of frames for training and 6,243 pairs for testing. The training and testing pairs come from different video sequences. Figure 7 shows that our framework works well in predicting the movement of the legs and torso. Additionally, Mechanical Turk behavioral experiments show that the synthesized frames are visually realistic. Zero-shot visual analogy-making Recently, Reed et al. [2015] studied the problem of inferring the relationship between a pair of reference images and synthesizing a new analogy-image by applying the inferred relationship to a test image. Our network is also able to preform this task, without even requiring supervision. Specifically, we extract the motion vector, z, from two reference frames using our motion encoder (Figure 3(a)). We then use the extracted motion vector z to synthesize an analogy-image given a new test image. Our network successfully transfers the motion in reference pairs to a test image. For example, in Figure 8(a), it learns that the character leans toward to the right, and in Figure 8(b) it learns that the girl spreads her feet apart. A quantitative evaluation is also shown in Figure 9. Even without §Liberated pixel cup: http://lpc.opengameart.org 7 Reference Input Prediction + (a) (b) Figure 8: Visual analogy-making (predicted frames are marked in red) Model spellcast thrust walk slash shoot average Add 41.0 53.8 55.7 52.1 77.6 56.0 Dis 40.8 55.8 52.6 53.5 79.8 56.5 Dis+Cls 13.3 24.6 17.2 18.9 40.8 23.0 Ours 9.5 11.5 11.1 28.2 19.0 15.9 Figure 9: Mean squared pixel error on test analogies, by animation. The first three models (Add, Dis, and Dis+Cls) are from Reed et al. [2015]. Input Images Scale 2 Map 20 Scale 2 Map 28 Scale 1 Map 25 Scale 2 Map 31 Input Images Scale 1 Map 32 Scale 2 Map 5 Input Images Scale 1 Map 1 Figure 10: Learned feature maps on the shapes dataset (left), the sprites dataset (top right), and the exercise dataset (bottom right) supervision, our method out-performs the algorithm by Reed et al. [2015], which requires visual analogy labels during training. Visualizing feature maps We visualize the learned feature maps (see Figure 3(b)) in Figure 10. Even without supervision, our network learns to detect objects or contours in the image. For example, we see that the network automatically learns object detectors and edge detectors on the shape dataset. It also learns a hair detector and a body detector on the sprites and exercise datasets, respectively. Visualizing latent representations By visualizing the latent representations of z we have found that each dimension corresponds to a certain type of motion. For instance, in the excerise dataset, varying one dimension of z causes the girl to stand-up and another causes her to move a leg. Please refer to our project page for this visualization. Dimension of latent representation Although our latent motion representation, z, has 3,200 dimensions, its intrinsic dimensionality is much smaller. First, zmean is very sparse. The non-zero elements of zmean for each dataset are 299 in shapes, 54 in sprites, and 978 in exercise. Second, the independent components of z are even fewer. We run principle component analysis (PCA) on the zmeans obtained from a set of training images, and find that for each dataset, a small fraction of components cover at least 95% of the variance in zmean (5 in shapes, 2 in sprites, and 27 in exercise). This indicates that our network has learned a compact representation of motion in an unsupervised fashion, and encodes high-level knowledge using a small number of bits, rather than simply memorizing training samples. The KL-divergence criterion in Eq. 1 forces the latent representation, z, to carry minimal information, as discussed by Hinton and Van Camp [1993] and concurrently by Higgins et al. [2016]. 6 Conclusion In this paper, we have proposed a novel framework that samples future frames from a single input image. Our method incorporates a variational autoencoder for learning compact motion representations, and a novel cross convolutional layer for regressing Eulerian motion maps. We have demonstrated that our framework works well on both synthetic, and real-life videos. More generally, results suggest that our probabilistic visual dynamics model may be useful for additional applications, such as inferring objects’ higher-order relationships by examining correlations in their motion distributions. Furthermore, this learned representation could be potentially used as a sophisticated motion prior in other computer vision and computational photography applications. Acknowledgement The authors thank Yining Wang for helpful discussions. This work is supported by NSF Robust Intelligence 1212849, NSF Big Data 1447476, ONR MURI 6923196, Adobe, and Shell Research. The authors would also like to thank Nvidia for GPU donations. 8 References Aseem Agarwala, Ke Colin Zheng, Chris Pal, Maneesh Agrawala, Michael Cohen, Brian Curless, David Salesin, and Richard Szeliski. Panoramic video textures. ACM TOG, 24(3):821–827, 2005. 2 Bert De Brabandere, Xu Jia, Tinne Tuytelaars, and Luc Van Gool. Dynamic filter networks. NIPS, 2016. 5 Emily L Denton, Soumith Chintala, and Rob Fergus. Deep generative image models using an laplacian pyramid of adversarial networks. In NIPS, 2015. 2 Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In NIPS, 2016. 3, 5 David J Fleet, Michael J Black, Yaser Yacoob, and Allan D Jepson. Design and use of linear models for image motion analysis. IJCV, 36(3):171–193, 2000. 2 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. 2 Karol Gregor, Ivo Danihelka, Alex Graves, Danilo Jimenez Rezende, and Daan Wierstra. Draw: A recurrent neural network for image generation. In ICML, 2015. 2 Irina Higgins, Loic Matthey, Xavier Glorot, Arka Pal, Benigno Uria, Charles Blundell, Shakir Mohamed, and Alexander Lerchner. Early visual concept learning with unsupervised deep learning. arXiv preprint arXiv:1606.05579, 2016. 8 Geoffrey E Hinton and Drew Van Camp. Keeping the neural networks simple by minimizing the description length of the weights. In COLT, 1993. 8 Neel Joshi, Sisil Mehta, Steven Drucker, Eric Stollnitz, Hugues Hoppe, Matt Uyttendaele, and Michael Cohen. Cliplets: juxtaposing still and dynamic imagery. In UIST, 2012. 2 Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014. 1, 2, 3, 4 Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In NIPS, 2014. 4 Zicheng Liao, Neel Joshi, and Hugues Hoppe. Automated video looping with progressive dynamism. ACM TOG, 32(4):77, 2013. 2 Ce Liu. Beyond pixels: exploring new representations and applications for motion analysis. PhD thesis, Massachusetts Institute of Technology, 2009. 6 Ce Liu, Jenny Yuen, and Antonio Torralba. SIFT flow: Dense correspondence across scenes and its applications. IEEE TPAMI, 33(5):978–994, 2011. 2 Michael Mathieu, Camille Couprie, and Yann LeCun. Deep multi-scale video prediction beyond mean square error. In ICLR, 2016. 3 Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In NIPS, 2015. 3 Silvia L Pintea, Jan C van Gemert, and Arnold WM Smeulders. Dejavu: Motion prediction in static images. In ECCV, 2014. 2 Javier Portilla and Eero P Simoncelli. A parametric texture model based on joint statistics of complex wavelet coefficients. IJCV, 40(1):49–70, 2000. 2 Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016. 2 Scott E Reed, Yi Zhang, Yuting Zhang, and Honglak Lee. Deep visual analogy-making. In NIPS, 2015. 7, 8 Stefan Roth and Michael J Black. On the spatial statistics of optical flow. In ICCV, 2005. 2 Arno Schödl, Richard Szeliski, David H Salesin, and Irfan Essa. Video textures. ACM TOG, 7(5):489–498, 2000. 2 Nitish Srivastava, Elman Mansimov, and Ruslan Salakhutdinov. Unsupervised learning of video representations using LSTMs. In ICML, 2015. 3 Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. NIPS, 2016a. 3 Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Anticipating visual representations from unlabeled video. In CVPR, 2016b. 2 Jacob Walker, Abhinav Gupta, and Martial Hebert. Patch to the future: unsupervised visual prediction. In CVPR, 2014. 2 Jacob Walker, Abhinav Gupta, and Martial Hebert. Dense optical flow prediction from a static image. In ICCV, 2015. 2 Jacob Walker, Carl Doersch, Abhinav Gupta, and Martial Hebert. An uncertain future: Forecasting from static images using variational autoencoders. In ECCV, 2016. 2 John YA Wang and Edward H Adelson. Layered representation for motion analysis. In CVPR, 1993. 4 Yair Weiss and Edward H Adelson. Slow and Smooth: a Bayesian theory for the combination of local motion signals in human vision. Center for Biological and Computational Learning Paper, 158(1624):1–42, 1998. 2 Yonatan Wexler, Eli Shechtman, and Michal Irani. Space-time video completion. In CVPR, 2004. 2 Jiajun Wu, Ilker Yildirim, Joseph J Lim, William T Freeman, and Joshua B Tenenbaum. Galileo: Perceiving physical object properties by integrating a physics engine with deep learning. In NIPS, 2015. 2 Jianwen Xie, Song-Chun Zhu, and Ying Nian Wu. Synthesizing dynamic textures and sounds by spatial-temporal generative convnet. arXiv preprint arXiv:1606.00972, 2016a. 2 Junyuan Xie, Ross Girshick, and Ali Farhadi. Deep3d: Fully automatic 2d-to-3d video conversion with deep convolutional neural networks. arXiv preprint arXiv:1604.03650, 2016b. 2 Tianfan Xue, Michael Rubinstein, Neal Wadhwa, Anat Levin, Fredo Durand, and William T Freeman. Refraction wiggles for measuring fluid depth and velocity from video. In ECCV, 2014. 2 Xinchen Yan, Jimei Yang, Kihyuk Sohn, and Honglak Lee. Attribute2image: Conditional image generation from visual attributes. In ECCV, 2016. 1, 2, 4 Tinghui Zhou, Shubham Tulsiani, Weilun Sun, Jitendra Malik, and Alexei A Efros. View synthesis by appearance flow. ECCV, 2016. 2 9
2016
8
6,541
Learning Tree Structured Potential Games Vikas K. Garg CSAIL, MIT vgarg@csail.mit.edu Tommi Jaakkola CSAIL, MIT tommi@csail.mit.edu Abstract Many real phenomena, including behaviors, involve strategic interactions that can be learned from data. We focus on learning tree structured potential games where equilibria are represented by local maxima of an underlying potential function. We cast the learning problem within a max margin setting and show that the problem is NP-hard even when the strategic interactions form a tree. We develop a variant of dual decomposition to estimate the underlying game and demonstrate with synthetic and real decision/voting data that the game theoretic perspective (carving out local maxima) enables meaningful recovery. 1 Introduction Structured prediction methods [1; 2; 3; 4; 5] are widely adopted techniques for learning mappings between context descriptions x ∈X and configurations y ∈Y. The variables specifying each configuration y (e.g., arcs in natural language parsing) are typically mutually dependent and it is therefore beneficial to predict them jointly rather than individually. The predicted y often arises as the highest scoring configuration with respect to a parameterized scoring function that decomposes into terms that couple two or more variables together to model their interactions. Structured prediction methods have been broadly useful across areas, from computational biology (e.g., molecular arrangements, alignments), natural language processing (e.g., parsing, tagging), computer vision (e.g., segmentation, matching), and many others. However, the setting is less suitable for modeling strategic interactions that are better characterized in terms of local consistency constraints. We consider the problem of predicting configurations y that represent game theoretic equilibria. Such configurations are unlikely to coincide with the maximum of a global scoring function as in structured prediction. Indeed, there may be many possible equilibria in a specific context, and the particular choice may vary considerably. Each possible configuration is nevertheless characterized by local constraints that represent myopic optimizations of individual players. For example, senators can be thought to vote relative to give and take deals with other closely associated senators. Several assumptions are necessary to make the game theoretic setting feasible. We abstract the setting as a potential game [6; 7; 8] among the players, and define a stochastic process to model the dynamics of the game. A game is said to be a potential game if the incentive of all players to change their strategy can be expressed using a single global potential function. Every potential game is guaranteed to have at least one (possibly multiple) pure strategy Nash equilibria [9], and we will exploit this property in modeling and analyzing several real world scenarios. Note that each pure Nash equilibrium corresponds to a local optimum of the underlying potential function rather than the global optimum as in structured prediction. We further restrict the setting by permitting the payoff of each player to depend only on their own action and the actions of their neighbors (a subset of the other players). Thus, we may view our setting as a graphical game [10; 11]. In this work, we investigate potential games where the graphical structure of the interactions form a tree. The goal is to recover the tree structured potential function that supports observed configurations of actions as locally optimal solutions. We prove that it is 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. NP-hard to recover such games under a max-margin setting. We then propose a variant of dual decomposition (cf. [12; 13]) to learn the tree structure and the associated parameters. 2 Setting We commence with the game theoretic setting. There are n players indexed by a position in [n] ≜ {1, 2, . . . , n}. These players can be visualized as nodes of a tree-structured graph T with undirected edges E. We denote the set of neighbors of node i by Ni, i.e., (i, j) ∈E ⇐⇒j ∈Ni ∧i ∈Nj, and abbreviate (i, j) ∈E as ij ∈T without introducing ambiguity. Each player i has a finite discrete set of strategies Yi. A strategy profile or label configuration is an n-dimensional vector of the form y = (y1, y2, . . . , yn) ∈Y = Qn i=1 Yi. We denote the parametric potential function associated with the tree by f(y; x, T, θ), where y is a strategy profile, θ the set of parameters, and x ∈X is a context [14]. We obtain an (n −1)-dimensional vector y−i = (y1, . . . , yi−1, yi+1, . . . , yn) by considering the strategies of all players other than i. Thus, we may equivalently write y = (yi, y−i). Moreover, we use yNi to denote the strategy profile pertaining to the neighbors of node i. We can extract from f(y; x, T, θ) individual payoff (or cost) functions fi(yi, yNi; x, T, θ), i ∈[n], which merely include all the terms that pertain to the strategy of the ith player yi. The choice of a particular equilibrium (local optimum) in a context results from a stochastic process. Starting with an initial configuration y at time t = 0 (e.g., chosen at random), the game proceeds in an iterative fashion: during each subsequent iteration t = 1, 2, . . ., a player pt ∈[n] is chosen uniformly at random. The player pt then computes the best response candidate set Zpt = arg max z∈Ypt fpt(z, yNpt ; x, T, θ), and switches to a strategy within this set uniformly at random if their current strategy does not already belong to this set, i.e., player changes their strategy only if a better option presents itself. The game finishes when a locally optimal configuration ˆy ∈Y has been reached, i.e., when no player can improve their payoff unilaterally. Since many locally optimal configurations could have been reached in the given context x, the stochastic process induces a distribution over the strategy profiles. We assume that our training data S = {(x1, y1), . . . , (xM, yM)} is generated by some distribution over contexts and the induced conditional distribution over strategy profiles with respect to some tree structured potential function. Our objective is to learn both the underlying tree structure T and the parameters θ using a max-margin setting. Specifically, given S, we are interested in finding T and θ such that ∀m ∈[M], i ∈[n], yi ∈Yi, f(ym; xm, T, θ) ≥f(ym −i, yi; xm, T, θ) + e(y, ym), where e(y, ym) is a non-negative loss (e.g. Hamming loss), which is 0 if and only if y = ym. Note that the maximum margin framework does not make an explicit use of the assumed induced distribution over equilibria. The setting here is superficially similar to relaxations of structured prediction tasks such as pseudolikelihood [15] or decomposed learning [16]. These methods are, however, designed to provide computationally efficient approximations of the original structured prediction task by using fewer constraints during learning. Instead, we are specifically interested in modeling the observations as locally optimal solutions with respect to the potential function. We only state the results of our theorems in the main text, and defer all the proofs to the Supplementary. 3 Learning Tree Structured Potential Games We first show that it is NP-hard to learn a tree structured potential game in a discriminative maxmargin setting. Previous hardness results are available about learning structured prediction models under global constraints and arbitrary graphs [15], and under global constraints and tree structured models [17], also in a max-margin setting. Theorem 1. Given a set of training examples S = {(xm, ym)}M m=1 and a family of potential functions of the form f(y; x, T, θ) = X ij∈T θij(yi, yj) + X i θi(yi) + X i xi(yi), 2 it is NP-hard to decide whether there exists a tree T and parameters θ (up to model equivalence) such that the following holds: ∀m, i, yi, f(ym; xm, T, θ) ≥f(ym −i, yi; xm, T, θ) + e(y, ym). 3.1 Dual decomposition algorithm The remainder of this section concerns with developing an approximate method for learning the potential function by appeal to dual decomposition. Dual decomposition methods are typically employed to solve inference tasks over combinatorial structures (e.g., [12; 13]). In contrast, we decompose the problem on two levels. On one hand, we break the problem into independent local neighborhood choices and use dual variables to reconcile these choices across the players so as to obtain a single tree-structured model. On the other hand, we ensure that initially disjoint parameters mediating the interactions between a player and its neighbors are in agreement across the edges in the resulting structure. The two constraints ensure that there is a single tree-structured global potential function. For each node i, let Ni be the set of neighbors of i represented in terms of indicator variables such that Nij = 1 if i selects j as a neighbor. Nij can be chosen independently from Nji but the two will be enforced to agree at the solution. We will use Ni as a set of neighbors and as a set of indicator variables interchangeably. Similarly, we decompose the parameters into node potentials θi · φ(yi; x) = θi(yi; x) and edge potentials θij · φ(yi, yj; x) = θi,j(yi, yj; x) where again θij may be chosen separately from θji but will be encouraged to agree. The set of parameters associated with each player then consists of locally controllable parameters Θi = {θi, θi·} and Ni, where Ni selects the relevant subset of interaction terms: f(y; x, Ni, Θi) = θi(yi; x) + X j̸=i Nijθi,j(yi, yj; x) Given a training set S = {(x1, y1), . . . , (xM, yM)}, the goal is to learn the set of neighbors N = {N1, . . . , Nn}, and weights Θ = {Θ1, . . . , Θn} so as to minimize 1 2||Θ||2 + C Mn n X i=1 M X m=1 max yi  f(ym −i, yi; xm, Ni, Θi) −f(ym; xm, Ni, Θi) + e(yi, ym i )  | {z } ≜Rmi(Ni,Θi) (1) subject to N forming a tree and Θ agreeing across the players. Let Ri(Ni, Θi) = C/(Mn) P m Rmi(Ni, Θi). We force the neighbor choices to agree with a global tree structure represented by indicators N ′. Similarly, we enforce parameters Θi to agree across neighbors. The resulting Lagrangian can be written as n X i=1 1 2||Θi||2 + Ri(Ni, Θi) + X j̸=i (δijNij + λij · θij)  | {z } L(Θi,Ni;δ,λ) +  − X i,j̸=i δijN ′ ij + G(N ′)  | {z } G(N ′,δ) where G(N ′) = 0 if N ′ forms a tree and ∞otherwise, and λij = −λji. For the dual decomposition algorithm, we must be able to solve minΘi L(Θi, Ni; δ, λ) to obtain Θ∗ i and minNi L(Θi, Ni; δ, λ) to get N ∗ i . The former is a QP while the latter is more challenging though may permit efficient solutions via additional relaxations, exploiting combinatorial properties in restricted cases (sub-modularity), or even brute force for smaller problems. G(N ′, δ) corresponds to a minimum weighted spanning tree, and thus can be efficiently solved using any standard algorithm like Bor˚uvka’s, Kruskal’s or Prim’s. The basic dual decomposition alternatively solves Θ∗ i , N ∗ i , and N ′∗, resulting in updates of the dual variables based on disagreements. While the method has been successful for enforcing structural constraints (e.g., parsing), it is less appropriate for constraints involving continuous variables. To address this, we employ the alternating direction method of multipliers (ADMM) [18; 19; 20] for parameter agreements. Specifically, we encourage θi· and θ·i to agree with their mean ui·, by introducing an additional term to the Lagrangian L LA(Θi, Ni; ui·, δ, λ) = L(Θi, Ni; δ, λ) + ρ 2||θi· −ui·||2 3 where ui· is updated as an independent parameter. There are many ways to schedule the updates. We employ a two-phase algorithm that learns the structure of the game tree and the parameters separately. The algorithm is motivated by the following theorem. Since the result applies broadly to the dual decomposition paradigm, we state the theorem in a slightly more generic form than that required for our purpose. The theorem applies to our setting with f(N ′) = −G(N ′), A = [n], and gi(Θi, Ni) = X j̸=i δijNij −L(Θi, Ni; δ, λ). We now set up the conditions of the theorem. Consider the following combinatorial problem Opt = max z ( f(z) + X α∈A gα(zα) ) , where f(z) specifies global constraints on admissible z, and gα(zα) represent local terms guiding the assignment of values to different subsets of variables zα = {zj}j∈α. Let the problem be minimized with respect to the dual coefficients {δi,α(zi)} by following a dual decomposition approach. Suppose we can find a global assignment ˆz and dual coefficients such that this assignment nearly attains the local maxima for all α ∈A, i.e., gα(ˆzα) + X j∈α δj,α(ˆzj) ≥max zα  gα(zα) + X j∈α δj,α(zj) −ϵ. Assume further, without loss of generality,1 that the assignment attains the max for the global constraint. Then, we have the following result. Theorem 2. If there exists an assignment ˆz and associated dual coefficients such that the assignment obtains ϵ-maximum of each term in the decomposition, for some ϵ > 0, then the objective value for ˆz ∈  Opt −|A|ϵ, Opt  . The theorem implies that if a global structure nearly attains the optima for the local neighborhoods, then we might as well shift our focus to finding the global structure rather than optimize for the parameters corresponding to the exact local optima. The result guarantees that the value of such a global structure cannot be too far from that of the optimal global structure. We outline our two-phase approach in Algorithm 1. The first phase concerns only with iteratively finding a globally consistent structure. It is possible that at the conclusion of this phase, the local structures do not fully agree (the relaxation is not tight). For this reason, the procedure runs for a specified maximum number of iterations and selects the global tree corresponding to an iteration that is least inconsistent with the local neighborhoods. Note that this phase does not precisely solve the original problem we posed earlier. Instead, the structure is obtained without constraining parameters to agree. In this sense, the first phase does not consider strictly potential games as the interactions between players can remain intrinsic to the players themselves. The second phase simply optimizes the parameters for the already specified global tree. This step realizes a potential game as the parameters and the structure will be in agreement. We note that such parameters could be optimized directly for the selected tree without the need of dual decomposition. However, Algorithm 1 remains suitable in a distributed setting since each player is required to solve only local problems during the entire execution of the algorithm. 3.2 Scaling the algorithm As already noted, Algorithm 1 exhaustively enumerates all neighborhoods for each local optimization problem. This makes the algorithm computationally prohibitive in realistic settings. We now outline an approximation procedure that restricts the candidate neighborhood assignments. Specifically, for a local optimization at any node i, we may restrict the possible local neighborhoods at any iteration t to only those configurations that are at most h Hamming distance away from the best local configuration for i in iteration t-1. That is, we update each local max-structure incrementally, still guided by the 1We can adjust the bound with a term that depends on the difference between the value of the optimal global structure and the value of the global structure under consideration if these values do not coincide. 4 overall tree within the same dual decomposition framework. Note that we recover Algorithm 1 as a special case when h = n. A small h corresponds to searching over a much smaller space compared to the brute force algorithm. For instance, if we take h = 1, then the total complexity of the approximate algorithm reduces to O(n2 ∗MaxIter) since in each iteration we need to solve n local problems each having O(n) candidate neighborhoods. Algorithm 1 Learning tree structured potential games 1: procedure LEARNTREEPOTENTIALGAME 2: Input: parameters ρ, β, MaxIter, and ϵ > 0. 3: 4: Phase 1: Learn Tree Structure 5: Initialize t = 1, λij = 0, δij = 0, MinGap = ∞. 6: repeat 7: Find N ′ = argmin N G(N, δ) using a minimum spanning tree algorithm 8: for each i ∈[n] do 9: for each Ni do 10: Compute Θ∗t+1 i = min Θi L(Θi, Ni; δ, 0) 11: Find N ∗ i = argmin Ni L(Θ∗t+1 i , Ni; δ, 0) 12: Compute gap: Gap = X i,j I(N ∗ ij ̸= N ′ ij). 13: if Gap < MinGap then MinGap = Gap, Global = N ′ 14: Update δ ∀i, j ̸= i: δij = δij + βt(N ∗ ij −N ′ ij) 15: t ←t + 1 16: until MinGap = 0 or t > MaxIter. 17: Set N ′∗= Global. 18: 19: Phase 2: Learn Parameters 20: Set N = N ′∗ 21: Compute Θ∗t+1 i = min Θi L(Θi, Ni; 0, λ) 22: repeat 23: Compute u ∀i, j ̸= i: ut+1 ij = (θ∗t+1 ij + θ∗t+1 ji )/2 24: Update λ ∀i, j ̸= i: λij = λij + ρ(θ∗t+1 ij −ut+1 ij ) 25: Compute Θ∗t+1 i = min Θi LA(Θi, Ni; ui·, 0, λ) 26: t ←t + 1 27: until X i,j̸=i ||θ∗t+1 ij −θ∗t+1 ji ||2 < ϵ 28: Set θ∗ ij, θ∗ ji = (θ∗t+1 ij + θ∗t+1 ji )/2 29: Output: N ′∗, Θ∗ 4 Experimental Results We now describe the results of our experiments on both synthetic and real data to demonstrate the efficacy of our algorithm. We found the algorithm to perform well for a wide range of C and β across different data. We report below the results of our experiments with the following setting of parameters: ρ = 1, βt = 0.005 (for all t), C = 10, ϵ = 0.1, and MaxIter = 100. For each local optimization problem, the configurations were constrained to share the slack variable in order to reduce the total number of optimization variables. Moreover, we used a scaled 0-1 loss [15], e(y, ym) = 1{y ̸= ym}/n for each local optimization. We set h = 1 for the approximate method. We conducted different sets of experiments to underscore the different aspects of our approach. Our experiments with toy synthetic data highlight recovery of an underlying true structure under controlled conditions (pertaining to the data generation process). The results on a real, but toy dataset, Supreme Court vindicate the applicability of the exhaustive approach to unraveling the interactions 5 latent in real datasets. Finally, we address the scalability issues inherent in the exhaustive search, by demonstrating the approximate version on the larger Congressional Votes real dataset. 4.1 Synthetic Dataset We will now describe how the brute force method recovered the true structure on a synthetic dataset. For this, data were assumed to come from the underlying model f(y; x, θ) = X ij∈E θij(yi, yj) + X i xiθi(yi), where x represents the context that varies. The parameters were set as follows. We designed a n-node degenerate or pathological tree, n = 6, with edges between node i and i + 1, i ∈{1, 2, . . . , n −1}. On each edge (i, j) ∈E, we sampled θij(yi, yj), yi, yj ∈{0, 1} uniformly at random from [−1, 1] independently of the other edges. For each node i, we also sampled θi(yi), yi ∈{0, 1} independently from the same range. Each training example pair (xm, ym) was sampled in two steps. First, each xmj, j ∈[n] was set uniformly at random in the range [−10, 10], independently of each other. The associated ym was then generated according to the stochastic process described in Section 2. Briefly, starting with ym ∈{0, 1}n sampled uniformly at random, we successively updated the configuration by changing a randomly chosen coordinate of ym, and accepting the move only if the associated score was higher. Since there are 2n possible configurations of binary vectors, we were guaranteed that, in finite time, this procedure ended in a locally stable configuration. Once this locally stable configuration was reached, we checked if the score of this configuration exceeded all the other configurations with Hamming distance one by at least 1/n. If yes, then we included the pair (xm, ym) in our synthetic data set, otherwise we discarded the pair. Starting with 100 examples, this procedure resulted in a total of 78 stable configurations that scored higher than each configuration one Hamming distance away by at least 1/n. These configurations formed our synthetic data set. We were able to exactly recover the tree structure at the end of the Phase 1 of our algorithm using the training data. Fig. 1 shows the evolution of the global tree structure (i.e. N ′ in the iterations that resulted in decrease of Gap). Note how the algorithm corrects for incorrect edges, starting from a star tree till it recovers the pathological tree structure. Fig. 2 elucidates the synergy between the global tree and local neighborhoods toward recovering the correct structure. 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 1 2 3 4 5 6 Figure 1: Recovery on synthetic data. Evolution of the tree structure is shown from left to right. Each incorrect edge is indicated by coloring one of the end nodes in red. After first iteration, only the edge (1, 2) is identified correctly. At termination, all edges in the underlying structure are recovered. We show in Fig. 3 the evolution of the tree when the observations were falsely treated as globally optimal points. Clearly, structured prediction failed to recover the underlying tree structure. 4.2 Real Dataset 1: Supreme Court Rulings For both real datasets, we assumed the following decomposition: f(y; θ) = X ij∈E θij(yi, yj) + X i θi(yi). For our first real dataset,2 we considered the rulings of a Supreme Court bench comprising Justices Alito (A), Breyer (B), Ginsburg (G), Kennedy (K), Roberts (R), Scalia (S), and Thomas (T), during 2Publicly available at http://scdb.wustl.edu/. 6 4 5 1 3 2 6 1 2 3 4 5 6 3 2 1 4 5 6 Figure 2: Global-Local Synergy. (Center & Right) Spanning trees formed from two separate local neighborhoods (in different iterations). (Left) The common global tree structure. The global tree structure reappears during the execution of the algorithm. On first occurrence, the global tree is misaligned from chain 2-3-4 of the local neighborhood tree at node 5, as indicated by tree in the center. The algorithm takes corrective action, and on the next occurrence, node 5 moves to the desired position, as seen from tree on the right. The algorithm proceeds to correct the positioning of node 6. 1 2 3 4 5 6 1 5 3 4 2 6 1 5 3 6 2 4 1 5 3 4 2 6 Figure 3: Evolution of structured prediction. Structured prediction fails to recover true structure. K Kennedy T Thomas R Roberts S Scalia A Alito B Breyer G Ginsburg Conservatives Liberals T B K G R S A Figure 4: (Left) Tree recovered from Supreme Court data. The tree is consistent with widely known ideology of the justices: Justice Kennedy (K) is considered largely moderate, while the others espouse a more conservative or liberal jurisprudence. The thickness of an edge indicates the strength of interaction in terms of (scaled) l2-norm of the edge parameters. (Right) Enforcing global constraints (structured prediction) resulted in a qualitatively incorrect structure. the year 2013. Justices Alito, Roberts, Scalia, and Thomas are known to be conservatives, while Justices Breyer and Ginsburg belong to the liberal side of the Court. Justice Kennedy generally takes a moderate stand on most issues. On every case under their jurisdiction, each Justice chose an integer from the set {1, 2, . . . , 8}. We considered all the rulings of this bench that had at least one “dissent". For our purposes, we created a dataset from those rulings that did not register a value 6, 7, 8 from any of the Justices, since these values seem to have a complex interpretation instead of a simple yes/no. For all other values, we used the interpretation by [21]: dissent value 2 was treated as 0 (no), and others with 1 (yes). Fig. 4 shows that we were able to recover the known ideology of the Justices by correctly treating the rulings as local optimal, whereas structured prediction failed to identify a qualitatively correct structure. 7 Figure 5: (Congressional Votes.) The recovered tree is consistent with the expected voting pattern that, in general, Democrats and Republicans vote along their respective party principles. 4.3 Real Dataset 2: Congressional Voting Records We also experimented with a dataset3 obtained by compiling the votes on all the bills of the 110th United States Congress (Session 2). The US Congress records the voting proceedings of the legislative branch of the US federal government [11]. The U.S. Senate consists of 100 senators: each of the 50 U.S. states is represented by two senators. We compiled all the votes of the first 30 senators (in data order) over this period on bills without unanimity. Each vote takes one of the two values: +1 or -1, to denote whether the vote was in favor or against the proposed bill. We treated vote values -1 with 0 to create a binary dataset. Fig. 5 shows how the approximate algorithm is able to recover a qualitatively correct structure that Democrats and Republicans typically vote along their respective party ideologies (note that there might be more than one qualitatively correct structure). Specifically, we obtain a structure where no Democrat is sandwiched between two Republicans, or vice-versa. Discussion A primary goal of this work is to argue that complex strategic interactions are better modeled as locally optimal solutions instead of globally optimal assignments (as done, for instance, in structured prediction). We believe this local versus global distinction has not been accorded due significance in the literature, and we hope our work fosters more research in that direction. The work opens up several interesting avenues. All the results presented in this paper are qualitative in nature, primarily because quantitative evaluation is non-trivial in our setting since a strategic game may have multiple equilibria (local optima). The incremental method proposed in this paper does not come with any certificate of optimality, unlike most dual decomposition settings. We assumed the dynamics of the underlying game follow a stochastic process, whereas players typically take deterministic turns in real game settings. From a statistical learning perspective, it will be interesting to estimate the generalization bounds in terms of the number of local equibria samples. Learning across (repeated) games and exploring sub-modular potential functions are other directions. Acknowledgments Jean Honorio provided the Congressional Votes dataset for our experiments. We would also like to thank the anonymous reviewers for their helpful comments. 3Publicly available at http://www.senate.gov/. 8 References [1] I. Tsochantaridis, T. Joachims, T. Hofmann, and Y. Altun. Large margin methods for structured and interdependent output variables, JMLR, 6(2), pp. 1453-1484, 2005. [2] B. Taskar, C. Guestrin, and D. Koller. Max-margin Markov networks, NIPS, 2003. [3] J. Lafferty, A. McCallum, and F. Pereira. Conditional random fields: Probabilistic models for segmenting and labeling sequence data, ICML, 2001. [4] J. K. Bradley and C. Guestrin. Learning tree conditional random fields, ICML, 2010. [5] S. Nowozin and C. H. Lampert. Structured Learning and Prediction in Computer Vision, Foundations and Trends in Computer Graphics and Vision, 2011. [6] P. Dubey, O. Haimanko, and A. Zapechelnyuk. Strategic complements and substitutes, and potential games, Games and Economic Behavior, 54, pp. 77-94, 2006. [7] D. Monderer and L. Shapley. Potential Games, Games and Economic Behavior, 14, pp. 124-143, 1996. [8] Y. Song, S. H. Y. Wong, and K.-W. Lee. Optimal gateway selection in multi-domain wireless networks: a potential game perspective, MobiCom, 2011. [9] T. Ui. Robust equilibria of potential games, Econometrica, 69, pp. 1373-1380, 2000. [10] M. Kearns, M. L. Littman, and S. P. Singh. Graphical Models for Game Theory, UAI, 2001. [11] J. Honorio and L. Ortiz. Learning the Structure and Parameters of Large-Population Graphical Games from Behavioral Data, JMLR, 16, pp. 1157-1210, 2015. [12] A. M. Rush and M. Collins. A Tutorial on Dual Decomposition and Lagrangian Relaxation for Inference in Natural Language Processing, JAIR, 45, pp. 305-362, 2012. [13] A. M. Rush, D. Sontag, M. Collins, and T. Jaakkola. On Dual Decomposition and Linear Programming Relaxations for Natural Language Processing, EMNLP, 2010. [14] M. Hoefer and A. Skopalik. Social Context in Potential Games, Internet and Network Economics, pp. 364-377, 2012. [15] D. Sontag, O. Meshi, T. Jaakkola, and A. Globerson. More data means less inference: A pseudo-max approach to structured learning, NIPS, 2010. [16] R. Samdani and D. Roth. Efficient Decomposed Learning for Structured Prediction, ICML, 2012. [17] O. Meshi, E. Eban, G. Elidan, and A. Globerson. Learning Max-Margin Tree Predictors, UAI, 2013. [18] S. Boyd, N. Parikh, E. Chu, B. Peleato, and J. Ecksteain. Distributed Optimization and Statistical Learning via the Alternating Direction Method of Multipliers. Foundations and Trends in Machine Learning, 3(1), pp. 1-122, 2010. [19] A. F. T. Martins, N. A. Smith, E. P. Xing, P. M. Q. Aguiar, and M. A. T. Figueiredo. Augmenting Dual Decomposition for MAP Inference, NIPS, 2010. [20] A. F. T. Martins, N. A. Smith, P. M. Q. Aguiar, and M. A. T. Figueiredo. Dual Decomposition with Many Overlapping Components, EMNLP, 2011. [21] M. T. Irfan and L. E. Ortiz. On influence, stable behavior, and the most influential individuals in networks: A game-theoretic approach, Artificial Intelligence, 215, pp. 79-119, 2014. 9
2016
80
6,542
RETAIN: An Interpretable Predictive Model for Healthcare using Reverse Time Attention Mechanism Edward Choi⇤, Mohammad Taha Bahadori⇤, Joshua A. Kulas⇤, Andy Schuetz†, Walter F. Stewart†, Jimeng Sun⇤ ⇤Georgia Institute of Technology † Sutter Health {mp2893,bahadori,jkulas3}@gatech.edu, {schueta1,stewarwf}@sutterhealth.org, jsun@cc.gatech.edu Abstract Accuracy and interpretability are two dominant features of successful predictive models. Typically, a choice must be made in favor of complex black box models such as recurrent neural networks (RNN) for accuracy versus less accurate but more interpretable traditional models such as logistic regression. This tradeoff poses challenges in medicine where both accuracy and interpretability are important. We addressed this challenge by developing the REverse Time AttentIoN model (RETAIN) for application to Electronic Health Records (EHR) data. RETAIN achieves high accuracy while remaining clinically interpretable and is based on a two-level neural attention model that detects influential past visits and significant clinical variables within those visits (e.g. key diagnoses). RETAIN mimics physician practice by attending the EHR data in a reverse time order so that recent clinical visits are likely to receive higher attention. RETAIN was tested on a large health system EHR dataset with 14 million visits completed by 263K patients over an 8 year period and demonstrated predictive accuracy and computational scalability comparable to state-of-the-art methods such as RNN, and ease of interpretability comparable to traditional models. 1 Introduction The broad adoption of Electronic Health Record (EHR) systems has opened the possibility of applying clinical predictive models to improve the quality of clinical care. Several systematic reviews have underlined the care quality improvement using predictive analysis [7, 25, 5, 20]. EHR data can be represented as temporal sequences of high-dimensional clinical variables (e.g., diagnoses, medications and procedures), where the sequence ensemble represents the documented content of medical visits from a single patient. Traditional machine learning tools summarize this ensemble into aggregate features, ignoring the temporal and sequence relationships among the feature elements. The opportunity to improve both predictive accuracy and interpretability is likely to derive from effectively modeling temporality and high-dimensionality of these event sequences. Accuracy and interpretability are two dominant features of successful predictive models. There is a common belief that one has to trade accuracy for interpretability using one of three types of traditional models [6]: 1) identifying a set of rules (e.g. via decision trees [27]), 2) case-based reasoning by finding similar patients (e.g. via k-nearest neighbors [18] and distance metric learning [36]), and 3) identifying a list of risk factors (e.g. via LASSO coefficients [15]). While interpretable, all of these models rely on aggregated features, ignoring the temporal relation among features inherent to EHR data. As a consequence, model accuracy is sub-optimal. Latent-variable time-series models, such as [34, 35], account for temporality, but often have limited interpretation due to abstract state variables. Recently, recurrent neural networks (RNN) have been successfully applied in modeling sequential EHR data to predict diagnoses [30] and disease progression [11, 14]. But, the gain in accuracy from 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. $* '* "* /* ⨀ $* ,* "* /* ⨀ '* +* &* Less interpretable End-to-End Interpretable End-to-End +* (a) Standard attention model $* '* "* /* ⨀ $* ,* "* /* ⨀ '* +* &* Less interpretable End-to-End Interpretable End-to-End +* (b) RETAIN model Figure 1: Common attention models vs. RETAIN, using folded diagrams of RNNs. (a) Standard attention mechanism: the recurrence on the hidden state vector vi hinders interpretation of the model. (b) Attention mechanism in RETAIN: The recurrence is on the attention generation components (hi or gi) while the hidden state vi is generated by a simpler more interpretable output. use of RNNs is at the cost of model output that is notoriously difficult to interpret. While there have been several attempts at directly interpreting RNNs [19, 26, 8], these methods are not sufficiently developed for application in clinical care. We have addressed this limitation using a modeling strategy known as RETAIN, a two-level neural attention model for sequential data that provides detailed interpretation of the prediction results while retaining the prediction accuracy comparable to RNN. To this end, RETAIN relies on an attention mechanism modeled to represent the behavior of physicians during an encounter. A distinguishing feature of RETAIN (see Figure 1) is to leverage sequence information using an attention generation mechanism, while learning an interpretable representation. And emulating physician behaviors, RETAIN examines a patient’s past visits in reverse time order, facilitating a more stable attention generation. As a result, RETAIN identifies the most meaningful visits and quantifies visit specific features that contribute to the prediction. RETAIN was tested on a large health system EHR dataset with 14 million visits completed by 263K patients over an 8 year period. We compared predictive accuracy of RETAIN to traditional machine learning methods and to RNN variants using a case-control dataset to predict a future diagnosis of heart failure. The comparative analysis demonstrates that RETAIN achieves comparable performance to RNN in both accuracy and speed and significantly outperforms traditional models. Moreover, using a concrete case study and visualization method, we demonstrate how RETAIN offers an intuitive interpretation. 2 Methodology We first describe the structure of sequential EHR data and our notation, then follow with a general framework for predictive analysis in healthcare using EHR, followed by details of the RETAIN method. EHR Structure and our Notation. The EHR data of each patient can be represented as a timelabeled sequence of multivariate observations. Assuming we use r different variables, the n-th patient of N total patients can be represented by a sequence of T (n) tuples (t(n) i , x(n) i ) 2 R ⇥Rr, i = 1, . . . , T (n). The timestamps t(n) i denotes the time of the i-th visit of the n-th patient and T (n) the number of visits of the n-th patient. To minimize clutter, we describe the algorithms for a single patient and have dropped the superscript (n) whenever it is unambiguous. The goal of predictive modeling is to predict the label at each time step yi 2 {0, 1}s or at the end of the sequence y 2 {0, 1}s. The number of labels s can be more than one. For example, in disease progression modeling (DPM) [11], each visit of a patient visit sequence is represented by a set of varying number of medical codes {c1, c2, . . . , cn}. cj is the j-th code from the vocabulary C. Therefore, in DPM, the number of variables r = |C| and input xi 2 {0, 1}|C| is 2 a binary vector where the value one in the j-th coordinate indicates that cj was documented in i-th visit. Given a sequence of visits x1, . . . , xT , the goal of DPM is, for each time step i, to predict the codes occurring at the next visit x2, . . . , xT +1, with the number of labels s = |C|. In case of learning to diagnose (L2D) [30], the input vector xi consists of continuous clinical measures. If there are r different measurements, then xi 2 Rr. The goal of L2D is, given an input sequence x1, . . . , xT , to predict the occurrence of a specific disease (s = 1) or multiple diseases (s > 1). Without loss of generality, we will describe the algorithm for DPM, as L2D can be seen as a special case of DPM where we make a single prediction at the end of the visit sequence. In the rest of this section, we will use the abstract symbol RNN to denote any recurrent neural network variants that can cope with the vanishing gradient problem [3], such as LSTM [23], GRU [9], and IRNN [29], with any depth (number of hidden layers). 2.1 Preliminaries on Neural Attention Models Attention based neural network models are being successfully applied to image processing [1, 32, 21, 37], natural language processing [2, 22, 33] and speech recognition [12]. The utility of the attention mechanism can be seen in the language translation task [2] where it is inefficient to represent an entire sentence with one fixed-size vector because neural translation machines finds it difficult to translate the given sentence represented by a single vector. Intuitively, the attention mechanism for language translation works as follows: given a sentence of length S in the original language, we generate h1, . . . , hS, to represent the words in the sentence. To find the j-th word in the target language, we generate attentions ↵j i for i = 1, . . . , S for each word in the original sentence. Then, we compute the context vector cj = P i ↵j ihi and use it to predict the j-th word in the target language. In general, the attention mechanism allows the model to focus on a specific word (or words) in the given sentence when generating each word in the target language. We rely on a conceptually similar temporal attention mechanism to generate interpretable prediction models using EHR data. Our model framework is motivated by and mimics how doctors attend to a patient’s needs and explore the patient record, where there is a focus on specific clinical information (e.g., key risk factors) working from the present to the past. 2.2 Reverse Time Attention Model RETAIN Figure 2 shows the high-level overview of our model, where a central feature is to delegate a considerable portion of the prediction responsibility to the process for generating attention weights. This is intended to address, in part, the difficulty with interpreting RNNs where the recurrent weights feed past information to the hidden layer. Therefore, to consider both the visit-level and the variablelevel (individual coordinates of xi) influence, we use a linear embedding of the input vector xi. That is, we define vi = Wembxi, (Step 1) where vi 2 Rm denotes the embedding of the input vector xi 2 Rr, m the size of the embedding dimension, Wemb 2 Rm⇥r the embedding matrix to learn. We can alternatively use more sophisticated yet interpretable representations such as those derived from multilayer perceptron (MLP) [13, 28]. MLP has been used for representation learning in EHR data [10]. We use two sets of weights, one for the visit-level attention and the other for variable-level attention, respectively. The scalars ↵1, . . . , ↵i are the visit-level attention weights that govern the influence of each visit embedding v1, . . . , vi. The vectors β1, . . . , βi are the variable-level attention weights that focus on each coordinate of the visit embedding v1,1, v1,2, . . . , v1,m, . . . , vi,1, vi,2, . . . , vi,m. We use two RNNs, RNN↵and RNNβ, to separately generate ↵’s and β’s as follows, gi, gi−1, . . . , g1 = RNN↵(vi, vi−1, . . . , v1), ej = w> ↵gj + b↵, for j = 1, . . . , i ↵1, ↵2, . . . , ↵i = Softmax(e1, e2, . . . , ei) (Step 2) hi, hi−1, . . . , h1 = RNNβ(vi, vi−1, . . . , v1) βj = tanh " Wβhj + bβ # for j = 1, . . . , i, (Step 3) 3 ,# ,) ,* &# &) &* "# ") "* $# $) $* +# +) +* '# ') '* Σ .* /* 5 ⨀ ⨀ ⨀ 1 2 3 4 011& 0112 Time Figure 2: Unfolded view of RETAIN’s architecture: Given input sequence x1, . . . , xi, we predict the label yi. Step 1: Embedding, Step 2: generating ↵values using RNN↵, Step 3: generating β values using RNNβ, Step 4: Generating the context vector using attention and representation vectors, and Step 5: Making prediction. Note that in Steps 2 and 3 we use RNN in the reversed time. where gi 2 Rp is the hidden layer of RNN↵at time step i, hi 2 Rq the hidden layer of RNNβ at time step i and w↵2 Rp, b↵2 R, Wβ 2 Rm⇥q and bβ 2 Rm are the parameters to learn. The hyperparameters p and q determine the hidden layer size of RNN↵and RNNβ, respectively. Note that for prediction at each timestamp, we generate a new set of attention vectors ↵and β. For simplicity of notation, we do not include the index for predicting at different time steps. In Step 2, we can use Sparsemax [31] instead of Softmax for sparser attention weights. As noted, RETAIN generates the attention vectors by running the RNNs backward in time; i.e., RNN↵ and RNNβ both take the visit embeddings in a reverse order vi, vi−1, . . . , v1. Running the RNN in reversed time order also offers computational advantages since the reverse time order allows us to generate e’s and β’s that dynamically change their values when making predictions at different time steps i = 1, 2, . . . , T. This ensures that the attention vectors are modified at each time step, increasing the computational stability of the attention generation process.1 Using the generated attentions, we obtain the context vector ci for a patient up to the i-th visit as follows, ci = i X j=1 ↵jβj ⊙vj, (Step 4) where ⊙denotes element-wise multiplication. We use the context vector ci 2 Rm to predict the true label yi 2 {0, 1}s as follows, byi = Softmax(Wci + b), (Step 5) where W 2 Rs⇥m and b 2 Rs are parameters to learn. We use the cross-entropy to calculate the classification loss as follows, L(x1, . . . , xT ) = −1 N N X n=1 1 T (n) T (n) X i=1 ⇣ y> i log(byi) + (1 −yi)> log(1 −byi) ⌘ (1) where we sum the cross entropy errors from all dimensions of byi. In case of real-valued output yi 2 Rs, we can change the cross-entropy in Eq. (1) to, for example, mean squared error. Overall, our attention mechanism can be viewed as the inverted architecture of the standard attention mechanism for NLP [2] where the words are encoded by RNN and the attention weights are generated by MLP. In contrast, our method uses MLP to embed the visit information to preserve interpretability and uses RNN to generate two sets of attention weights, recovering the sequential information as well as mimicking the behavior of physicians. Note that we did not use the timestamp of each visit in our formulation. Using timestamps, however, provides a small improvement in the prediction performance. We propose a method to use timestamps in Appendix A. 1For example, feeding visit embeddings in the original order to RNN↵and RNNβ will generate the same e1 and β1 for every time step i = 1, 2, . . . , T. Moreover, in many cases, a patient’s recent visit records deserve more attention than the old records. Then we need to have ej+1 > ej which makes the process computationally unstable for long sequences. 4 3 Interpreting RETAIN Finding the visits that contribute to prediction are derived using the largest ↵i, which is straightforward. However, finding influential variables is slightly more involved as a visit is represented by an ensemble of medical variables, each of which can vary in its predictive contribution. The contribution of each variable is determined by v, β and ↵, and interpretation of ↵alone informs which visit is influential in prediction but not why. We propose a method to interpret the end-to-end behavior of RETAIN. By keeping ↵and β values fixed as the attention of doctors, we analyze changes in the probability of each label yi,1, . . . , yi,s in relation to changes in the original input x1,1, . . . , x1,r, . . . , xi,1, . . . , xi,r. The xj,k that yields the largest change in yi,d will be the input variable with highest contribution. More formally, given the sequence x1, . . . , xi, we are trying to predict the probability of the output vector yi 2 {0, 1}s, which can be expressed as follows p(yi|x1, . . . , xi) = p(yi|ci) = Softmax (Wci + b) (2) where ci 2 Rm denotes the context vector. According to Step 4, ci is the sum of the visit embeddings v1, . . . , vi weighted by the attentions ↵’s and β’s. Therefore Eq (2) can be rewritten as follows, p(yi|x1, . . . , xi) = p(yi|ci) = Softmax ✓ W ⇣ i X j=1 ↵jβj ⊙vj ⌘ + b ◆ (3) Using the fact that the visit embedding vi is the sum of the columns of Wemb weighted by each element of xi, Eq (3) can be rewritten as follows, p(yi|x1, . . . , xi) = Softmax ✓ W ⇣ i X j=1 ↵jβj ⊙ r X k=1 xj,kWemb[:, k] ⌘ + b ◆ = Softmax ✓ i X j=1 r X k=1 xj,k ↵jW ⇣ βj ⊙Wemb[:, k] ⌘ + b ◆ (4) where xj,k is the k-th element of the input vector xj. Eq (4) can be completely deconstructed to the variables at each input x1, . . . , xi, which allows for calculating the contribution ! of the k-th variable of the input xj at time step j i, for predicting yi as follows, !(yi, xj,k) = ↵jW(βj ⊙Wemb[:, k]) | {z } Contribution coefficient xj,k |{z} Input value , (5) where the index i of yi is omitted in the ↵j and βj. As we have described in Section 2.2, we are generating ↵’s and β’s at time step i in the visit sequence x1, . . . , xT . Therefore the index i is always assumed for ↵’s and β’s. Additionally, Eq (5) shows that when we are using a binary input value, the coefficient itself is the contribution. However, when we are using a non-binary input value, we need to multiply the coefficient and the input value xj,k to correctly calculate the contribution. 4 Experiments We compared performance of RETAIN to RNNs and traditional machine learning methods. Given space constraints, we only report the results on the learning to diagnose (L2D) task and summarize the disease progression modeling (DPM) in Appendix C. The RETAIN source code is publicly available at https://github.com/mp2893/retain. 4.1 Experimental setting Source of data: The dataset consists of electronic health records from Sutter Health. The patients are 50 to 80 years old adults chosen for a heart failure prediction model study. From the encounter records, medication orders, procedure orders and problem lists, we extracted visit records consisting of diagnosis, medication and procedure codes. To reduce the dimensionality while preserving the clinical information, we used existing medical groupers to aggregate the codes into input variables. The details of the medical groupers are given in the Appendix B. A profile of the dataset is summarized in Table 1. 5 Table 1: Statistics of EHR dataset. (D:Diagnosis, R:Medication, P:Procedure) # of patients 263,683 Avg. # of codes in a visit 3.03 # of visits 14,366,030 Max # of codes in a visit 62 Avg. # of visits per patient 54.48 Avg. # of Dx codes in a visit 1.83 # of medical code groups 615 (D:283, R:94, P:238) Max # of Dx in a visit 42 Implementation details: We implemented RETAIN with Theano 0.8 [4]. For training the model, we used Adadelta [38] with the mini-batch of 100 patients. The training was done in a machine equipped with Intel Xeon E5-2630, 256GB RAM, two Nvidia Tesla K80’s and CUDA 7.5. Baselines: For comparison, we completed the following models. • Logistic regression (LR): We compute the counts of medical codes for each patient based on all her visits as input variables and normalize the vector to zero mean and unit variance. We use the resulting vector to train the logistic regression. • MLP: We use the same feature construction as LR, but put a hidden layer of size 256 between the input and output. • RNN: RNN with two hidden layers of size 256 implemented by the GRU. Input sequences x1, . . . , xi are used. Logistic regression is applied to the top hidden layer. We use two layers of RNN of to match the model complexity of RETAIN. • RNN+↵M: One layer single directional RNN (hidden layer size 256) along time to generate the input embeddings v1, . . . , vi. We use the MLP with a single hidden layer of size 256 to generate the visit-level attentions ↵1, . . . , ↵i. We use the input embeddings v1, . . . , vi as the input to the MLP. This baseline corresponds to Figure 1a. • RNN+↵R: This is similar to RNN+↵M but use the reverse-order RNN (hidden layer size 256) to generate the visit-level attentions ↵1, . . . , ↵i. We use this baseline to confirm the effectiveness of generating the attentions using reverse time order. The comparative visualization of the baselines are provided in Appendix D. We use the same implementation and training method for the baselines as described above. The details on the hyperparameters, regularization and drop-out strategies for the baselines are described in Appendix B. Evaluation measures: Model accuracy was measured by: • Negative log-likelihood that measures the model loss on the test set. The loss can be calculated by Eq (1). • Area Under the ROC Curve (AUC) of comparing byi with the true label yi. AUC is more robust to imbalanced positive/negative prediction labels, making it appropriate for evaluation of classification accuracy in the heart failure prediction task. We also report the bootstrap (10,000 runs) estimate of the standard deviation of the evaluation measures. 4.2 Heart Failure Prediction Objective: Given a visit sequence x1, . . . , xT , we predicted if a primary care patient will be diagnosed with heart failure (HF). This is a special case of DPM with a single disease outcome at the end of the sequence. Since this is a binary prediction task, we use the logistic sigmoid function instead of the Softmax in Step 5. Cohort construction: From the source dataset, 3,884 cases are selected and approximately 10 controls are selected for each case (28,903 controls). The case/control selection criteria are fully described in the supplementary section. Cases have index dates to denote the date they are diagnosed with HF. Controls have the same index dates as their corresponding cases. We extract diagnosis codes, medication codes and procedure codes in the 18-months window before the index date. Training details: The patient cohort was divided into the training, validation and test sets in a 0.75:0.1:0.15 ratio. The validation set was used to determine the values of the hyper-parameters. See Appendix B for details of hyper-parameter tuning. 6 Table 2: Heart failure prediction performance of RETAIN and the baselines Model Test Neg Log Likelihood AUC Train Time / epoch Test Time LR 0.3269 ± 0.0105 0.7900 ± 0.0111 0.15s 0.11s MLP 0.2959 ± 0.0083 0.8256 ± 0.0096 0.25s 0.11s RNN 0.2577 ± 0.0082 0.8706 ± 0.0080 10.3s 0.57s RNN+↵M 0.2691 ± 0.0082 0.8624 ± 0.0079 6.7s 0.48s RNN+↵R 0.2605 ± 0.0088 0.8717 ± 0.0080 10.4s 0.62s RETAIN 0.2562 ± 0.0083 0.8705 ± 0.0081 10.8s 0.63s Results: Logistic regression and MLP underperformed compared to the four temporal learning algorithms (Table 2). RETAIN is comparable to the other RNN variants in terms of prediction performance while offering the interpretation benefit. Note that RNN+↵R model are a degenerated version of RETAIN with only scalar attention, which is still a competitive model as shown in table 2. This confirms the efficiency of generating attention weights using the RNN. However, RNN+↵R model only provides scalar visit-level attention, which is not sufficient for healthcare applications. Patients often receives several medical codes at a single visit, and it will be important to distinguish their relative importance to the target. We show such a case study in section 4.3. Table 2 also shows the scalability of RETAIN, as its training time (the number of seconds to train the model over the entire training set once) is comparable to RNN. The test time is the number of seconds to generate the prediction output for the entire test set. We use the mini-batch of 100 patients when assessing both training and test times. RNN takes longer than RNN+↵M because of its two-layer structure, whereas RNN+↵M uses a single layer RNN. The models that use two RNNs (RNN, RNN+↵R, RETAIN)2 take similar time to train for one epoch. However, each model required a different number of epochs to converge. RNN typically takes approximately 10 epochs, RNN+↵M and RNN+↵R 15 epochs and RETAIN 30 epochs. Lastly, training the attention models (RNN+↵M, RNN+↵R and RETAIN) for DPM would take considerably longer than L2D, because DPM modeling generates context vectors at each time step. RNN, on the other hand, does not require additional computation other than embedding the visit to its hidden layer to predict target labels at each time step. Therefore, in DPM, the training time of the attention models will increase linearly in relation to the length of the input sequence. 4.3 Model Interpretation for Heart Failure Prediction We evaluated the interpretability of RETAIN in the HF prediction task by choosing a HF patient from the test set and calculating the contribution of the variables (medical codes in this case) to diagnostic prediction. The patient suffered from skin problems, skin disorder (SD), benign neoplasm (BN), excision of skin lesion (ESL), for some time before showing symptoms of HF, cardiac dysrhythmia (CD), heart valve disease (HVD) and coronary atherosclerosis (CA), and then a diagnosis of HF (Figure 3). We can see that skin-related codes from the earlier visits made little contribution to HF prediction as expected. RETAIN properly puts much attention to the HF-related codes that occurred in recent visits. To confirm RETAIN’s ability to exploit the sequence information of the EHR data, we reverse the visit sequence of Figure 3a and feed it to RETAIN. Figure 3b shows the contribution of the medical codes of the reversed visit record. HF-related codes in the past are still making positive contributions, but not as much as they did in Figure 3a. Figure 3b also emphasizes RETAIN’s superiority to interpretable, but stationary models such as logistic regression. Stationary models often aggregate past information and remove the temporality from the input data, which can mistakenly lead to the same risk prediction for Figure 3a and 3b. RETAIN, however, can correctly digest the sequence information and calculates the HF risk score of 9.0%, which is significantly lower than that of Figure 3a. Figure 3c shows how the contributions of codes change when selected medication data are used in the model. We added two medications from day 219: antiarrhythmics (AA) and anticoagulants (AC), both of which are used to treat cardiac dysrhythmia (CD). The two medications make a negative contributions, especially towards the end of the record. The medications decreased the positive contributions of heart valve disease and cardiac dysrhythmia in the last visit. Indeed, the HF risk 2The RNN baseline uses two layers of RNN, RNN+↵R uses one for visit embedding and one for generating ↵, RETAIN uses each for generating ↵and β 7 ESL SD Time 0 SD SD SD 1.5 -0.5 Contribution CD HVD CA CD CD SD, ESL CD CD SD ESL, BN SD BN ESL SD SD CA ESL SD, ESL Time 0 SD, BN SD, ESL SD, ESL, BN CD SD CD CD SD SD CD CD HVD 1.5 -0.5 Contribution AA, AC AA, AC AA, ACAC AA AC AA SD CA ESL SD, ESL Time 0 SD, BN SD, ESL SD, ESL, BN CD SD CD CD SD CD CD HVD 1.5 -0.5 SD: Skin disorder ESL: Excision of skin lesion BN: Benign neoplasm AA: Antiarrhythmic medication AC: Anticoagulant medication CD: Cardiac dysrhythmia CA: Coronary atherosclerosis HVD: Heart valve disorder Contribution 0 (day) 57 95 126 171 219 294 328 342 350 Diagnosed with HF 354 (b)HF risk: 0.0905 (c) HF risk: 0.2165 (a) HF risk: 0.2474 SD Figure 3: (a) Temporal visualization of a patient’s visit records where the contribution of variables for diagnosis of heart failure (HF) is summarized along the x-axis (i.e. time) with the y-axis indicating the magnitude of visit and code specific contributions to HF diagnosis. (b) We reverse the order of the visit sequence to see if RETAIN can properly take into account the modified sequence information. (c) Medication codes are added to the visit record to see how it changes the behavior of RETAIN. prediction (0.2165) of Figure 3c is lower than that of Figure 3a (0.2474). This suggests that taking proper medications can help the patient in reducing their HF risk. 5 Conclusion Our approach to modeling event sequences as predictors of HF diagnosis suggest that complex models can offer both superior predictive accuracy and more precise interpretability. Given the power of RNNs for analyzing sequential data, we proposed RETAIN, which preserves RNN’s predictive power while allowing a higher degree of interpretation. The key idea of RETAIN is to improve the prediction accuracy through a sophisticated attention generation process, while keeping the representation learning part simple for interpretation, making the entire algorithm accurate and interpretable. RETAIN trains two RNN in a reverse time order to efficiently generate the appropriate attention variables. For future work, we plan to develop an interactive visualization system for RETAIN and evaluating RETAIN in other healthcare applications. References [1] J. Ba, V. Mnih, and K. Kavukcuoglu. Multiple object recognition with visual attention. In ICLR, 2015. [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, 2015. [3] Y. Bengio, P. Simard, and P. Frasconi. Learning long-term dependencies with gradient descent is difficult. Neural Networks, IEEE Transactions on, 5(2):157–166, 1994. [4] J. Bergstra, O. Breuleux, F. Bastien, P. Lamblin, R. Pascanu, G. Desjardins, J. Turian, D. Warde-Farley, and Y. Bengio. Theano: a CPU and GPU math expression compiler. In Proceedings of SciPy, 2010. [5] A. D. Black, J. Car, C. Pagliari, C. Anandan, K. Cresswell, T. Bokun, B. McKinstry, R. Procter, A. Majeed, and A. Sheikh. The impact of ehealth on the quality and safety of health care: a systematic overview. PLoS Med, 8(1):e1000387, 2011. [6] R. Caruana, Y. Lou, J. Gehrke, P. Koch, M. Sturm, and N. Elhadad. Intelligible models for healthcare: Predicting pneumonia risk and hospital 30-day readmission. In KDD, 2015. [7] B. Chaudhry, J. Wang, S. Wu, M. Maglione, W. Mojica, E. Roth, S. C. Morton, and P. G. Shekelle. Systematic review: impact of health information technology on quality, efficiency, and costs of medical care. Annals of internal medicine, 144(10):742–752, 2006. [8] Z. Che, S. Purushotham, R. Khemani, and Y. Liu. Distilling knowledge from deep networks with applications to healthcare domain. arXiv preprint arXiv:1512.03542, 2015. 8 [9] K. Cho, B. Van Merriënboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP, 2014. [10] E. Choi, M. T. Bahadori, E. Searles, C. Coffey, and J. Sun. Multi-layer representation learning for medical concepts. In KDD, 2016. [11] E. Choi, M. T. Bahadori, and J. Sun. Doctor ai: Predicting clinical events via recurrent neural networks. arXiv preprint arXiv:1511.05942, 2015. [12] J. K. Chorowski, D. Bahdanau, D. Serdyuk, K. Cho, and Y. Bengio. Attention-based models for speech recognition. In NIPS, pages 577–585, 2015. [13] D. Erhan, Y. Bengio, A. Courville, and P. Vincent. Visualizing higher-layer features of a deep network. University of Montreal, 2009. [14] C. Esteban, O. Staeck, Y. Yang, and V. Tresp. Predicting clinical events by combining static and dynamic information using recurrent neural networks. arXiv preprint arXiv:1602.02685, 2016. [15] A. S. Fleisher, B. B. Sowell, C. Taylor, A. C. Gamst, R. C. Petersen, L. J. Thal, and f. t. A. D. C. Study. Clinical predictors of progression to Alzheimer disease in amnestic mild cognitive impairment. Neurology, 68(19):1588–1595, May 2007. [16] A. for Healthcare Research and Quality. Clinical classifications software (ccs) for icd-9-cm. https: //www.hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp. Accessed: 2016-04-01. [17] A. for Healthcare Research and Quality. Clinical classifications software for services and procedures. https://www.hcup-us.ahrq.gov/toolssoftware/ccs_svcsproc/ccssvcproc.jsp. Accessed: 2016-04-01. [18] B. Gallego, S. R. Walter, R. O. Day, A. G. Dunn, V. Sivaraman, N. Shah, C. A. Longhurst, and E. Coiera. Bringing cohort studies to the bedside: framework for a ’green button’ to support clinical decision-making. Journal of Comparative Effectiveness Research, pages 1–7, May 2015. [19] J. Ghosh and V. Karamcheti. Sequence learning with recurrent networks: analysis of internal representations. In Aerospace Sensing, pages 449–460. International Society for Optics and Photonics, 1992. [20] C. L. Goldzweig, A. Towfigh, M. Maglione, and P. G. Shekelle. Costs and benefits of health information technology: new trends from the literature. Health affairs, 28(2):w282–w293, 2009. [21] K. Gregor, I. Danihelka, A. Graves, and D. Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623, 2015. [22] K. M. Hermann, T. Kocisky, E. Grefenstette, L. Espeholt, W. Kay, M. Suleyman, and P. Blunsom. Teaching machines to read and comprehend. In NIPS, pages 1684–1692, 2015. [23] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. [24] W. K. C. D. Information. Medi-span electronic drug file (med-file) v2. http://www.wolterskluwercdi. com/drug-data/medi-span-electronic-drug-file/. Accessed: 2016-04-01. [25] A. K. Jha, C. M. DesRoches, E. G. Campbell, K. Donelan, S. R. Rao, T. G. Ferris, A. Shields, S. Rosenbaum, and D. Blumenthal. Use of electronic health records in us hospitals. N Engl J Med, 2009. [26] A. Karpathy, J. Johnson, and F.-F. Li. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015. [27] A. N. Kho, M. G. Hayes, L. Rasmussen-Torvik, J. A. Pacheco, W. K. Thompson, L. L. Armstrong, J. C. Denny, P. L. Peissig, A. W. Miller, W.-Q. Wei, S. J. Bielinski, C. G. Chute, C. L. Leibson, G. P. Jarvik, D. R. Crosslin, C. S. Carlson, K. M. Newton, W. A. Wolf, R. L. Chisholm, and W. L. Lowe. Use of diverse electronic medical record systems to identify genetic risk for type 2 diabetes within a genome-wide association study. JAMIA, 19(2):212–218, Apr. 2012. [28] Q. V. Le. Building high-level features using large scale unsupervised learning. In ICASSP, 2013. [29] Q. V. Le, N. Jaitly, and G. E. Hinton. A simple way to initialize recurrent networks of rectified linear units. arXiv preprint arXiv:1504.00941, 2015. [30] Z. C. Lipton, D. C. Kale, C. Elkan, and R. Wetzell. Learning to Diagnose with LSTM Recurrent Neural Networks. In ICLR, 2016. [31] A. F. Martins and R. F. Astudillo. From softmax to sparsemax: A sparse model of attention and multi-label classification. In ICML, 2016. [32] V. Mnih, N. Heess, A. Graves, et al. Recurrent models of visual attention. In NIPS, 2014. [33] A. M. Rush, S. Chopra, and J. Weston. A neural attention model for abstractive sentence summarization. In EMNLP, 2015. [34] S. Saria, D. Koller, and A. Penn. Learning individual and population level traits from clinical temporal data. In NIPS, Predictive Models in Personalized Medicine workshop, 2010. [35] P. Schulam and S. Saria. A probabilistic graphical model for individualizing prognosis in chronic, complex diseases. In AMIA, volume 2015, page 143, 2015. [36] J. Sun, F. Wang, J. Hu, and S. Edabollahi. Supervised patient similarity measure of heterogeneous patient records. ACM SIGKDD Explorations Newsletter, 14(1):16–24, 2012. [37] K. Xu, J. Ba, R. Kiros, A. Courville, R. Salakhutdinov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In ICML, 2015. [38] M. D. Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012. 9
2016
81
6,543
PAC Reinforcement Learning with Rich Observations Akshay Krishnamurthy University of Massachusetts, Amherst Amherst, MA, 01003 akshay@cs.umass.edu Alekh Agarwal Microsoft Research New York, NY 10011 alekha@microsoft.com John Langford Microsoft Research New York, NY 10011 jcl@microsoft.com Abstract We propose and study a new model for reinforcement learning with rich observations, generalizing contextual bandits to sequential decision making. These models require an agent to take actions based on observations (features) with the goal of achieving long-term performance competitive with a large set of policies. To avoid barriers to sample-efficient learning associated with large observation spaces and general POMDPs, we focus on problems that can be summarized by a small number of hidden states and have long-term rewards that are predictable by a reactive function class. In this setting, we design and analyze a new reinforcement learning algorithm, Least Squares Value Elimination by Exploration. We prove that the algorithm learns near optimal behavior after a number of episodes that is polynomial in all relevant parameters, logarithmic in the number of policies, and independent of the size of the observation space. Our result provides theoretical justification for reinforcement learning with function approximation. 1 Introduction The Atari Reinforcement Learning research program [21] has highlighted a critical deficiency of practical reinforcement learning algorithms in settings with rich observation spaces: they cannot effectively solve problems that require sophisticated exploration. How can we construct Reinforcement Learning (RL) algorithms which effectively plan and plan to explore? In RL theory, this is a solved problem for Markov Decision Processes (MDPs) [6, 13, 26]. Why do these results not apply? An easy response is, “because the hard games are not MDPs.” This may be true for some of the hard games, but it is misleading—popular algorithms like Q-learning with ✏-greedy exploration do not even engage in minimal planning and global exploration1 as is required to solve MDPs efficiently. MDP-optimized global exploration has also been avoided because of a polynomial dependence on the number of unique observations which is intractably large with observations from a visual sensor. In contrast, supervised and contextual bandit learning algorithms have no dependence on the number of observations and at most a logarithmic dependence on the size of the underlying policy set. Approaches to RL with a weak dependence on these quantities exist [15] but suffer from an exponential dependence on the time horizon—with K actions and a horizon of H, they require ⌦(KH) samples. Examples show that this dependence is necessary, although they typically require a large number of states. Can we find an RL algorithm with no dependence on the number of unique observations and a polynomial dependence on the number of actions K, the number of necessary states M, the horizon H, and the policy complexity log(|⇧|)? 1We use “global exploration” to distinguish the sophisticated exploration strategies required to solve an MDP efficiently from exponentially less efficient alternatives such as ✏-greedy. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. To begin answering this question we consider a simplified setting with episodes of bounded length H and deterministic state transitions. We further assume that we have a function class that contains the optimal observation-action value function Q?. These simplifications make the problem significantly more tractable without trivializing the core goal of designing a Poly(K, M, H, log(|⇧|))) algorithm. To this end, our contributions are: 1. A new class of models for studying reinforcement learning with rich observations. These models generalize both contextual bandits and small-state MDPs, but do not exhibit the partial observability issues of more complex models like POMDPs. We show exponential lower bounds on sample complexity in the absence of the assumptions to justify our model. 2. A new reinforcement learning algorithm Least Squares Value Elimination by Exploration (LSVEE) and a PAC guarantee that it finds a policy that is at most ✏sub-optimal (with the above assumptions) using O ⇣ MK2H6 ✏3 log(|⇧|) ⌘ samples, with no dependence on the number of unique observations. This is done by combining ideas from contextual bandits with a novel state equality test and a global exploration technique. Like initial contextual bandit approaches [1], the algorithm is computationally inefficient since it requires enumeration of the policy class, an aspect we hope to address in future work. LSVEE uses a function class to approximate future rewards, and thus lends theoretical backing for reinforcement learning with function approximation, which is the empirical state-of-the-art. 2 The Model Our model is a Contextual Decision Process, a term we use broadly to refer to any sequential decision making task where an agent must make decision on the basis of rich features (context) to optimize long-term reward. In this section, we introduce the model, starting with basic notation. Let H 2 N denote an episode length, X ✓Rd an observation space, A a finite set of actions, and S a finite set of latent states. Let K , |A|. We partition S into H disjoint groups S1, . . . , SH, each of size at most M. For a set P, ∆(P) denotes the set of distributions over P. 2.1 Basic Definitions Our model is defined by the tuple (Γ1, Γ, D) where Γ1 2 ∆(S1) denotes a starting state distribution, Γ : (S ⇥A) ! ∆(S) denotes the transition dynamics, and Ds 2 ∆(X ⇥[0, 1]K) associates a distribution over observation-reward pairs with each state s 2 S. We also use Ds to denote the marginal distribution over observations (usage will be clear from context) and use Ds|x for the conditional distribution over reward given the observation x in state s. The marginal and conditional probabilities are referred to as Ds(x) and Ds|x(r). We assume that the process is layered (also known as loop-free or acyclic) so that for any sh 2 Sh and action a 2 A, Γ(sh, a) 2 ∆(Sh+1). Thus, the environment transitions from state space S1 up to SH via a sequence of actions. Layered structure allows us to avoid indexing policies and Q-functions with time, which enables concise notation. Each episode produces a full record of interaction (s1, x1, a1, r1, . . . , sH, xH, aH, rH) where s1 ⇠ Γ1, sh ⇠Γ(sh−1, ah−1), (xh, rh) ⇠Dsh and all actions ah are chosen by the learning agent. The record of interaction observed by the learner is (x1, a1, r1(a1), . . . , xH, aH, rH(aH)) and at time point h, the learner may use all observable information up to and including xh to select ah. Notice that all state information and rewards for alternative actions are unobserved by the learning agent. The learner’s reward for an episode is PH h=1 rh(ah), and the goal is to maximize the expected cumulative reward, R = E[PH h=1 rh(ah)], where the expectation accounts for all the randomness in the model and the learner. We assume that almost surely PH h=1 rh(ah) 2 [0, 1] for any action sequence. In this model, the optimal expected reward achievable can be computed recursively as V ? , Es⇠Γ1[V ?(s)] with V ?(s) , Ex⇠Ds max a Er⇠Ds|x ⇥ r(a) + Es0⇠Γ(s,a)V ?(s0) ⇤ . (1) 2 As the base case, we assume that for states s 2 SH, all actions transition to a terminal state sH+1 with V ?(sH+1) , 0. For each (s, x) pair such that Ds(x) > 0 we also define a Q? function as Q? s(x, a) , Er⇠Ds|x ⇥ r(a) + Es0⇠Γ(s,a)V ?(s0) ⇤ . (2) This function captures the optimal choice of action given this (state, observation) pair and therefore encodes optimal behavior in the model. With no further assumptions, the above model is a layered episodic Partially Observable Markov Decision Process (LE-POMDP). Both learning and planning are notoriously challenging in POMDPs, because the optimal policy depends on the entire trajectory and the complexity of learning such a policy grows exponentially with H (see e.g. Kearns et al. [15] as well as Propositions 1 and 2 below). Our model avoids this statistical barrier with two assumptions: (a) we consider only reactive policies, and (b) we assume access to a class of functions that can realize the Q? function. Both assumptions are implicit in the empirical state of the art RL results. They also eliminate issues related to partial observability, allowing us to focus on our core goal of systematic exploration. We describe both assumptions in detail before formally defining the model. Reactive Policies: One approach taken by some prior theoretical work is to consider reactive (or memoryless) policies that use only the current observation to select an action [4, 20]. Memorylessness is slightly generalized in the recent empirical advances in RL, which typically employ policies that depend only on the few most recent observations [21]. A reactive policy ⇡: X ! A is a strategy for navigating the search space by taking actions ⇡(x) given observation x. The expected reward for a policy is defined recursively through V (⇡) , Es⇠Γ1[V (s, ⇡)] and V (s, ⇡) , E(x,r)⇠Ds ⇥ r(⇡(x)) + Es0⇠Γ(s,⇡(x))V (s0, ⇡) ⇤ . A natural learning goal is to identify a policy with maximal value V (⇡) from a given collection of reactive policies ⇧. Unfortunately, even when restricting to reactive policies, learning in POMDPs requires exponentially many samples, as we show in the next lower bound. Proposition 1. Fix H, K 2 N with K ≥2 and ✏2 (0, p 1/8). For any algorithm, there exists a LE-POMDP with horizon H, K actions, and 2H total states; a class ⇧of reactive policies with |⇧| = KH; and a constant c > 0 such that the probability that the algorithm outputs a policy ˆ⇡with V (ˆ⇡) > max⇡2⇧V (⇡) −✏after collecting T trajectories is at most 2/3 for all T cKH/✏2. This lower bound precludes a Poly(K, M, H, log(|⇧|)) sample complexity bound for learning reactive policies in general POMDPs as log(|⇧|) = H log(K) in the construction, but the number of samples required is exponential in H. The lower bound instance provides essentially no instantaneous feedback and therefore forces the agent to reason over KH paths independently. Predictability of Q?: The assumption underlying the empirical successes in RL is that the Q? function can be well-approximated by some large set of functions F. To formalize this assumption, note that for some POMDPs, we may be able to write Q? as a function of the observed history (x1, a1, r1(a1), . . . , xh) at time h. For example, this is always true in deterministic-transition POMDPs, since the sequence of previous actions encodes the state and Q? as in Eq. (2) depends only on the state, the current observation, and the proposed action. In the realizable setting, we have access to a collection of functions F mapping the observed history to [0, 1], and we assume that Q? 2 F. Unfortunately, even with realizability, learning in POMDPs can require exponentially many samples. Proposition 2. Fix H, K 2 N with K ≥2 and ✏2 (0, p 1/8). For any algorithm, there exists a LE-POMDP with time horizon H, K actions, and 2H total states; a class of predictors F with |F| = KH and Q? 2 F; and a constant c ≥0 such that the probability that the algorithm outputs a policy ˆ⇡with V (ˆ⇡) > V ? −✏after collecting T trajectories is at most 2/3 for all T cKH/✏2. As with Proposition 1, this lower bound precludes a Poly(K, M, H, log(|⇧|)) sample complexity bound for learning POMDPs with realizability. The lower bound shows that even with realizability, the agent may have to reason over KH paths independently since the functions can depend on the entire history. Proofs of both lower bounds here are deferred to Appendix A. Both lower bounds use POMDPs with deterministic transitions and an extremely small observation space. Consequently, even learning in deterministic-transition POMDPs requires further assumptions. 3 2.2 Main Assumptions As we have seen, neither restricting to reactive policies, nor imposing realizability enable tractable learning in POMDPs on their own. Combined however, we will see that sample-efficient learning is possible, and the combination of these two assumptions is precisely how we characterize our model. Specifically, we study POMDPs for which Q? can be realized by a predictor that uses only the current observation and proposed action. Assumption 1 (Reactive Value Functions). We assume that for all x 2 X, a 2 A and any two state s, s0 such that Ds(x), Ds0(x) > 0, we have Q? s(x, a) = Q? s0(x, a). The restriction on Q? implies that the optimal policy is reactive and also that the optimal predictor of long-term reward depends only on the current observation. In the following section, we describe how this condition relates to other RL models in the literature. We first present a natural example. Example 1 (Disjoint observations). The simplest example is one where each state s can be identified with a subset Xs with Ds(x) > 0 only for x 2 Xs and where Xs \ Xs0 = ; when s 6= s0. A realized observation then uniquely identifies the underlying state s so that Assumption 1 trivially holds, but this mapping from s to Xs is unknown to the agent. Thus, the problem cannot be easily reduced to a small-state MDP. This setting is quite natural in several robotics and navigation tasks, where the visual signals are rich enough to uniquely identify the agent’s position (and hence state). It also applies to video game playing, where the raw pixel intensities suffice to decode the game’s memory state, but learning this mapping is challenging. Thinking of x as the state, the above example is an MDP with infinite state space but with structured transition operator. While our model is more general, we are primarily motivated by these infinitestate MDPs, for which the reactivity assumptions are completely non-restrictive. For infinite-state MDPs, our model describes a particular structure on the transition operator that we show enables efficient learning. We emphasize that our focus is not on partial observability issues. As we are interested in understanding function approximation, we make a realizability assumption. Assumption 2 (Realizability). We are given access to a class of predictors F ✓(X ⇥A ! [0, 1]) of size |F| = N and assume that Q? = f ? 2 F. We identify each predictor f with a policy ⇡f(x) , argmaxa f(x, a). Observe that the optimal policy is ⇡f ? which satisfies V (⇡f ?) = V ?. Assumptions 1 and 2 exclude the lower bounds from Propositions 1 and 2. Our algorithm requires one further assumption. Assumption 3 (Deterministic Transitions). We assume that the transition model is deterministic. This means that the starting distribution Γ1 is a point-mass on some state s1 and Γ : (S ⇥A) ! S. Even with deterministic transitions, learning requires systematic global exploration that is unaddressed in previous work. Recall that the lower bound constructions for Propositions 1 and 2 actually use deterministic transition POMDPs. Therefore, deterministic transitions combined with either the reactive or the realizability assumption by itself still precludes tractable learning. Nevertheless, we hope to relax this final assumption in future work. More broadly, this model provides a framework to reason about reinforcement learning with function approximation. This is highly desirable as such approaches are the empirical state-of-the-art, but the limited supporting theory provides little advice on systematic global exploration. 2.3 Connections to Other Models and Techniques The above model is closely related to several well-studied models in the literature, namely: Contextual Bandits: If H = 1, then our model reduces to stochastic contextual bandits [8, 16], a well-studied simplification of the general reinforcement learning problem. The main difference is that the choice of action does not influence the future observations (there is only one state), and algorithms do not need to perform long-term planning to obtain low sample complexity. Markov Decision Processes: If X = S and Ds(x) for each state s is concentrated on s, then our model reduces to small-state MDPs, which can be efficiently solved by tabular approaches [6, 13, 26]. The key differences in our setting are that the observation space X is extremely large or infinite 4 and the underlying state is unobserved, so tabular methods are not viable and algorithms need to generalize across observations. When the number of states is large, existing methods typically require exponentially many samples such as the O(KH) result of Kearns et al. [15]. Others depend poorly on the complexity of the policy set or scale linearly in the size of a covering over the state space [10, 12, 23]. Lastly, policy gradient methods avoid dependence on size of the state space, but do not achieve global optimality [11, 27] in theory and in practice, unlike our algorithm which is guaranteed to find the globally optimal policy. POMDPs: By definition our model is a POMDP where the Q? function is consistent across states. This restriction implies that the agent does not have to reason over belief states as is required in POMDPs. There are some sample complexity guarantees for learning in arbitrarily complex POMDPs, but the bounds we are aware of are quite weak as they scale linearly with |⇧| [14, 19], or require discrete observations from a small set [4]. State Abstraction: State abstraction (see [18] for a survey) focuses on understanding what optimality properties are preserved in an MDP after the state space is compressed. While our model does have a small number of underlying states, they do not necessarily admit non-trivial state abstractions that are easy to discover (i.e. that do not amount to learning the optimal behavior) as the optimal behavior can depend on the observation in an arbitrary manner. Furthermore, most sample complexity results cannot search over large abstraction sets (see e.g. Jiang et al. [9]), limiting their scope. Function Approximation: Our approach uses function approximation to address the generalization problem implicit in our model. Function approximation is the empirical state-of-the-art in reinforcement learning [21], but theoretical analysis has been quite limited. Several authors have studied linear or more general function approximation (See [5, 24, 28]), but none of these results give finite sample bounds, as they do not address the exploration question. Li and Littman [17] do give finite sample bounds, but they assume access to a “Knows-what-it-knows" (KWIK) oracle, which cannot exist even for simple problems. Other theoretical results either make stronger realizability assumptions (c.f., [2]) or scale poorly with problem parameters (e.g., polynomial in the number of functions [22] or the size of the observation space [23]). 3 The Result We consider the task of Probably Approximately Correct (PAC) learning the models defined in Section 2. Given F (Assumption 2), we say that an algorithm PAC learns our model if for any ✏, δ 2 (0, 1), the algorithm outputs a policy ˆ⇡satisfying V (ˆ⇡) ≥V ? −✏with probability at least 1 −δ. The sample complexity is a function n : (0, 1)2 ! N such that for any ✏, δ 2 (0, 1), the algorithm returns an ✏-suboptimal policy with probability at least 1 −δ using at most n(✏, δ) episodes. We refer to a Poly(M, K, H, 1/✏, log N, log(1/δ)) sample complexity bound as polynomial in all relevant parameters. Notably, there should be no dependence on |X|, which may be infinite. 3.1 The Algorithm Before turning to the algorithm, it is worth clarifying some additional notation. Since we are focused on the deterministic transition setting, it is natural to think about the environment as an exponentially large search tree with fan-out K and depth H. Each node in the search tree is labeled with an (unobserved) state s 2 S, and each edge is labeled with an action a 2 A, consistent with the transition model. A path p 2 A? is a sequence of actions from the root of the search tree, and we also use p to denote the state reached after executing the path p from the root. Thus, Dp is the observation distribution of the state at the end of the path p. We use p ◦a to denote a path formed by executing all actions in p and then executing action a, and we use |p| to denote the length of the path. Let ? denote the empty path, which corresponds to the root of the search tree. The pseudocode for the algorithm, which we call Least Squares Value Elimination by Exploration (LSVEE), is displayed in Algorithm 1 (See also Appendix B). LSVEE has two main components: a depth-first-search routine with a learning step (step 6 in Algorithm 2) and an on-demand exploration technique (steps 5-8 in Algorithm 1). The high-level idea of the algorithm is to eliminate regression functions that do not meet Bellman-like consistency properties of the Q? function. We now describe both components and their properties in detail. 5 Algorithm 1 Least Squares Value Elimination by Exploration: LSVEE (F, ✏, δ) 1: F DFS-LEARN(?, F, ✏, δ/2). 2: Choose any f 2 F. Let ˆV ? be a Monte Carlo estimate of V f(?, ⇡f). (See Eq. (3)) 3: Set ✏demand = ✏/2, n1 = 32 log(12MH/δ) ✏2 and n2 = 8 log(6MH/δ) ✏ . 4: while true do 5: Fix a regressor f 2 F. 6: Collect n1 trajectories according to ⇡f and estimate V (⇡f) via Monte-Carlo estimate ˆV (⇡f). 7: If | ˆV (⇡f) −ˆV ?| ✏demand, return ⇡f. 8: Otherwise update F by calling DFS-LEARN (p, F, ✏, δ 6MH2n2 ) on each of the H −1 prefixes p of each of the first n2 paths collected in step 6. 9: end while Algorithm 2 DFS-LEARN (p, F, ✏, δ) 1: Set φ = ✏ 320H2p K and ✏test = 20(H −|p| −5/4) p Kφ. 2: for a 2 A, if not CONSENSUS(p ◦a, F, ✏test, φ, δ/2 MKH ) do 3: F DFS-LEARN(p ◦a, F, ✏, δ). 4: end for 5: Collect ntrain = 24 φ2 log ' 8MHN δ ( observations (xi, ai, ri) where (xi, r0 i) ⇠Dp, ai is chosen uniformly at random, and ri = r0 i(ai). 6: Return n f 2 F : ˜R(f) minf 02F ˜R(f 0) + 2φ2 + 22 log(4MHN/δ) ntrain o , ˜R(f) defined in Eq. (4). The DFS routine: When the DFS routine, displayed in Algorithm 2, is run at some path p, we first decide whether to recursively expand the descendants p ◦a by performing a consensus test. Given a path p0, this test, displayed in Algorithm 3, computes estimates of value predictions, V f(p0, ⇡f) , Ex⇠Dp0 f(x, ⇡f(x)), (3) for all the surviving regressors. These value predictions are easily estimated by collecting many observations after rolling in to p0 and using empirical averages (See line 2 in Algorithm 3). If all the functions agree on this value for p0 the DFS need not visit this path. After the recursive calls, the DFS routine performs the elimination step (line 6). When this step is invoked at path p, the algorithm collects ntrain observations (xi, ai, ri) where (xi, r0 i) ⇠Dp, ai is chosen uniformly at random, and ri = r0 i(ai) and eliminates regressors that have high empirical risk, ˜R(f) , 1 ntrain ntrain X i=1 (f(xi, ai) −ri −ˆV f(p ◦ai, ⇡f))2. (4) Intuition for DFS: This regression problem is motivated by the realizability assumption and the definition of Q? in Eq. (2), which imply that at path p and for all actions a, f ?(x, a) = Er⇠Dp|xr(a) + V (p ◦a, ⇡f ?) = Er⇠Dp|xr(a) + Ex0⇠Dp◦af ?(x0, ⇡f ?(x0)). (5) Thus f ? is consistent between its estimate at the current state s and the future state s0 = Γ(s, a). The regression problem (4) is essentially a finite sample version of this identity. However, some care must be taken as the target for the regression function f includes V f(p ◦a, ⇡f), which is f’s value prediction for the future. The fact that the target differs across functions can cause instability in the regression problem, as some targets may have substantially lower variance than f ?’s. To ensure correct behavior, we must obtain high-quality future value prediction estimates, and so, we re-use the Monte-Carlo estimates ˆV f(p ◦a, ⇡f) in Eq. (3) from the consensus tests. Each time we perform elimination, the regression targets are close for all considered f in Equation (4) owing to consensus being satisfied at the successor nodes in Step 2 of Algorithm 2. Given consensus at all the descendants, each elimination step inductively propagates learning towards the start state by ensuring the following desirable properties hold: (i) f ? is not eliminated, (ii) 6 Algorithm 3 CONSENSUS(p, F, ✏test, φ, δ) 1: Set ntest = 2 φ2 log(2N/δ). Collect ntest observations xi ⇠Dp. 2: Compute for each function, ˆV f(p, ⇡f) = 1 ntest Pntest i=1 f(xi, ⇡f(xi)). 3: Return 1 h | ˆV f(p, ⇡f) −ˆV g(p, ⇡g)| ✏test 8f, g 2 F i . consensus is reached at p, and (iii) surviving policies choose good actions at p. Property (ii) controls the sample complexity, since consensus tests at state s return true once elimination has been invoked on s, so DFS avoids exploring the entire search space. Property (iii) leads to the PAC-bound; if we have run the elimination step on all states visited by a policy, that policy must be near-optimal. To bound the sample complexity of the DFS routine, since there are M states per level and the consensus test returns true once elimination has been performed, we know that the DFS does not visit a large fraction of the search tree. Specifically, this means DFS is invoked on at most MH nodes in total, so we run elimination at most MH times, and we perform at most MKH consensus tests. Each of these operations requires polynomially many samples. The elimination step is inspired by the RegressorElimination algorithm of Agarwal et. al [1] for contextual bandit learning in the realizable setting. In addition to forming a different regression problem, RegressorElimination carefully chooses actions to balance exploration and exploitation which leads to an optimal regret bound. In contrast, we are pursuing a PAC-guarantee here, for which it suffices to focus exclusively on exploration. On-demand Exploration: While DFS is guaranteed to estimate the optimal value V ?, it unfortunately does not identify the optimal policy. For example, if consensus is satisfied at a state s without invoking the elimination step, then each function accurately predicts the value V ?(s), but the associated policies are not guaranteed to achieve this value. To overcome this issue, we use an on-demand exploration technique in the second phase of the algorithm (Algorithm 1, steps 5-8). At each iteration of this phase, we select a policy ⇡f and estimate its value via Monte Carlo sampling. If the policy has sub-optimal value, we invoke the DFS procedure on many of the paths visited. If the policy has near-optimal value, we have found a good policy, so we are done. This procedure requires an accurate estimate of the optimal value, which we already obtained by invoking the DFS routine at the root, since it guarantees that all surviving regressors agree with f ?’s value on the starting state distribution. f ?’s value is precisely the optimal value. Intuition for On-demand Exploration: Running the elimination step at some path p ensures that all surviving regressors take good actions at p, in the sense that taking one action according to any surviving policy and then behaving optimally thereafter achieves near-optimal reward for path p. This does not ensure that all surviving policies achieve near-optimal reward, because they may take highly sub-optimal actions after the first one. On the other hand, if a surviving policy ⇡f visits only states for which the elimination step has been invoked, then it must have near-optimal reward. More precisely, letting L denote the set of states for which the elimination step has been invoked (the “learned" states), we prove that any surviving ⇡f satisfies V ? −V (⇡f) ✏/8 + P [⇡f visits a states /2 L] Thus, if ⇡f is highly sub-optimal, it must visit some unlearned states with substantial probability. By calling DFS-LEARN on the paths visited by ⇡f, we ensure that the elimination step is run on at least one unlearned states. Since there are only MH distinct states and each non-terminal iteration ensures training on an unlearned state, the algorithm must terminate and output a near-optimal policy. Computationally, the running time of the algorithm may be O(N), since eliminating regression functions according to Eq. (4) may require enumerating over the class and the consensus function requires computing the maximum and minimum of N numbers, one for each function. This may be intractably slow for rich function classes, but our focus is on statistical efficiency, so we ignore computational issues here. 3.2 The PAC Guarantee Our main result certifies that LSVEE PAC-learns our models with polynomial sample complexity. 7 Theorem 1 (PAC bound). For any (✏, δ) 2 (0, 1) and under Assumptions 1, 2, and 3, with probability at least 1 −δ, the policy ⇡returned by LSVEE is at most ✏-suboptimal. Moreover, the number of episodes required is at most ˜O ✓MH6K2 ✏3 log(N/δ) log(1/δ) ◆ . This result uses the ˜O notation to suppress logarithmic dependence in all parameters except for N and δ. The precise dependence on all parameters can be recovered by examination of our proof and is shortened here simply for clarity. See Appendix C for the full proof of the result. This theorem states that LSVEE produces a policy that is at most ✏-suboptimal using a number of episodes that is polynomial in all relevant parameters. To our knowledge, this is the first polynomial sample complexity bound for reinforcement learning with infinite observation spaces, without prohibitively strong assumptions (e.g., [2, 22, 23]). We also believe this is the first finite-sample guarantee for reinforcement learning with general function approximation without prohibitively strong assumptions (e.g., [2]). Since our model generalizes both contextual bandits and MDPs, it is worth comparing the sample complexity bounds. 1. In contextual bandits, we have M = H = 1 so that the sample complexity of LSVEE is ˜O( K2 ✏3 log(N/δ) log(1/δ)), in contrast with known ˜O( K ✏2 log(N/δ)) results. 2. Prior results establish the sample complexity for learning layered episodic MDPs with deterministic transitions is ˜O( MKpoly(H) ✏2 log(1/δ)) [7, 25]. Both comparisons show our sample complexity bound may be suboptimal in its dependence on K and ✏. Looking into our proof, the additional factor of K comes from collecting observations to estimate the value of future states, while the additional 1/✏factor arises from trying to identify a previously unexplored state. In contextual bandits, these issues do not arise since there is only one state, while, in tabular MDPs, they can be trivially resolved as the states are observed. Thus, with minor modifications, LSVEE can avoid these dependencies for both special cases. In addition, our bound disagrees with the MDP results in the dependence on the policy complexity log(N); which we believe is unavoidable when working with rich observation spaces. Finally, our bound depends on the number of states M in the worst case, but the algorithm actually uses a more refined notion. Since the states are unobserved, the algorithm considers two states distinct only if they have reasonably different value functions, meaning learning on one does not lead to consensus on the other. Thus, a more distribution-dependent analysis defining states through the function class is a promising avenue for future work. 4 Discussion This paper introduces a new model in which it is possible to design and analyze principled reinforcement learning algorithms engaging in global exploration. As a first step, we develop a new algorithm and show that it learns near-optimal behavior under a deterministic-transition assumption with polynomial sample complexity. This represents a significant advance in our understanding of reinforcement learning with rich observations. However, there are major open questions: 1. Do polynomial sample bounds for this model with stochastic transitions exist? 2. Can we design an algorithm for learning this model that is both computationally and statistically efficient? The sample complexity of our algorithm is logarithmic in the size of the function class F but uses an intractably slow enumeration of these functions. Good answers to both of these questions may yield new practical reinforcement learning algorithms. Acknowledgements We thank Akshay Balsubramani and Hal Daumé III for formative discussions, and we thank Tzu-Kuo Huang and Nan Jiang for carefully reading an early draft of this paper. This work was carried out while AK was at Microsoft Research. 8 References [1] A. Agarwal, M. Dudík, S. Kale, J. Langford, and R. E. Schapire. Contextual bandit learning with predictable rewards. In AISTATS, 2012. [2] A. Antos, C. Szepesvári, and R. Munos. Learning near-optimal policies with Bellman-residual minimization based fitted policy iteration and a single sample path. MLJ, 2008. [3] P. Auer, N. Cesa-Bianchi, Y. Freund, and R. E. Schapire. The nonstochastic multiarmed bandit problem. SICOMP, 2002. [4] K. Azizzadenesheli, A. Lazaric, and A. Anandkumar. Reinforcement learning of POMDPs using spectral methods. In COLT, 2016. [5] L. Baird. Residual algorithms: Reinforcement learning with function approximation. In ICML, 1995. [6] R. I. Brafman and M. Tennenholtz. R-max – a general polynomial time algorithm for near-optimal reinforcement learning. JMLR, 2003. [7] C. Dann and E. Brunskill. Sample complexity of episodic fixed-horizon reinforcement learning. In NIPS, 2015. [8] M. Dudik, D. Hsu, S. Kale, N. Karampatziakis, J. Langford, L. Reyzin, and T. Zhang. Efficient optimal learning for contextual bandits. In UAI, 2011. [9] N. Jiang, A. Kulesza, and S. Singh. Abstraction selection in model-based reinforcement learning. In ICML, 2015. [10] N. K. Jong and P. Stone. Model-based exploration in continuous state spaces. In Abstraction, Reformulation, and Approximation, 2007. [11] S. Kakade and J. Langford. Approximately optimal approximate reinforcement learning. In ICML, 2002. [12] S. Kakade, M. J. Kearns, and J. Langford. Exploration in metric state spaces. In ICML, 2003. [13] M. Kearns and S. Singh. Near-optimal reinforcement learning in polynomial time. MLJ, 2002. [14] M. J. Kearns, Y. Mansour, and A. Y. Ng. Approximate planning in large POMDPs via reusable trajectories. In NIPS, 1999. [15] M. J. Kearns, Y. Mansour, and A. Y. Ng. A sparse sampling algorithm for near-optimal planning in large markov decision processes. MLJ, 2002. [16] J. Langford and T. Zhang. The epoch-greedy algorithm for multi-armed bandits with side information. In NIPS, 2008. [17] L. Li and M. L. Littman. Reducing reinforcement learning to KWIK online regression. Ann. Math AI, 2010. [18] L. Li, T. J. Walsh, and M. L. Littman. Towards a unified theory of state abstraction for MDPs. In ISAIM, 2006. [19] Y. Mansour. Reinforcement learning and mistake bounded algorithms. In COLT, 1999. [20] N. Meuleau, L. Peshkin, K.-E. Kim, and L. P. Kaelbling. Learning finite-state controllers for partially observable environments. In UAI, 1999. [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, B. Charles, S. Amir, I. Antonoglou, H. King, D. Kumaran, D. Wierstra, S. Legg, and D. Hassabis. Human-level control through deep reinforcement learning. Nature, 2015. [22] P. Nguyen, O.-A. Maillard, D. Ryabko, and R. Ortner. Competing with an infinite set of models in reinforcement learning. In AISTATS, 2013. [23] J. Pazis and R. Parr. Efficient PAC-optimal exploration in concurrent, continuous state MDPs with delayed updates. In AAAI, 2016. [24] T. J. Perkins and D. Precup. A convergent form of approximate policy iteration. In NIPS, 2002. [25] S. Reveliotis and T. Bountourelis. Efficient PAC learning for episodic tasks with acyclic state spaces. DEDS, 2007. [26] A. L. Strehl, L. Li, E. Wiewiora, J. Langford, and M. L. Littman. PAC model-free reinforcement learning. In ICML, 2006. [27] R. S. Sutton, D. A. McAllester, S. P. Singh, and Y. Mansour. Policy gradient methods for reinforcement learning with function approximation. In NIPS, 1999. [28] J. N. Tsitsiklis and B. Van Roy. An analysis of temporal-difference learning with function approximation. IEEE TAC, 1997. 9
2016
82
6,544
Generative Shape Models: Joint Text Recognition and Segmentation with Very Little Training Data Xinghua Lou, Ken Kansky, Wolfgang Lehrach, CC Laan Vicarious FPC Inc., San Francisco, USA xinghua,ken,wolfgang,cc@vicarious.com Bhaskara Marthi, D. Scott Phoenix, Dileep George Vicarious FPC Inc., San Francisco, USA bhaskara,scott,dileep@vicarious.com Abstract Abstract: We demonstrate that a generative model for object shapes can achieve state of the art results on challenging scene text recognition tasks, and with orders of magnitude fewer training images than required for competing discriminative methods. In addition to transcribing text from challenging images, our method performs fine-grained instance segmentation of characters. We show that our model is more robust to both affine transformations and non-affine deformations compared to previous approaches. 1 Introduction Classic optical character recognition (OCR) tools focus on reading text from well-prepared scanned documents. They perform poorly when used for reading text from images of real world scenes [1]. Scene text exhibits very strong variation in font, appearance, and deformation, and image quality can be lowered by many factors, including noise, blur, illumination change and structured background. Fig. 1 shows some representative images from two major scene text datasets: International Conference on Document Analysis and Recognition (ICDAR) 2013 and Street View Text (SVT). Figure 1: Examples of text in real world scenes: ICDAR 2013 (left two columns) and SVT (right two columns). Unlike classic OCR that handles well-prepared scanned documents, scene text recognition is difficult because of the strong variation in font, background, appearance, and distortion. Despite these challenges, the machine learning and computer vision community have recently witnessed a surging interest in developing novel approaches for scene text recognition. This is driven by numerous potential applications such as scene understanding for robotic control and augmented reality, street sign reading for autonomous driving, and image feature extraction for large-scale image search. In this paper we present a novel approach for robust scene text recognition. Specifically, we study the problem of text recognition in a cropped image that contains a single word, which is usually the output from some text localization method (see [2] for a thorough review on this topic). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Our core contribution is a novel generative shape model that shows strong generalization capabilities. Unlike many previous approaches that are based on discriminative models and trained on millions of real world images, our generative model only requires hundreds of training images, yet still effectively captures affine transformations and non-affine deformations. To cope with the strong variation of fonts in real scenes, we also propose a greedy approach for selecting representative fonts from a large database of fonts. Finally, we introduce a word parsing model that is trained using structured output learning. We evaluated our approach on ICDAR 2013 and SVT and achieved state-of-the-art performance despite using several orders of magnitude less of training data. Our results show that instead of relying on a massive amount of supervision to train a discriminative model, a generative model trained on uncluttered fonts with properly encoded invariance generalizes well to text in natural images and is more interpretable. 2 Related Work We only consider literature on recognizing scene text in English. There are two paradigms for solving this problem: character detection followed by word parsing, and simultaneous character detection and word parsing. Character detection followed by word parsing is the more popular paradigm. Essentially, a character detection method first finds candidate characters, and then a parsing model searches for the true sequence of characters by optimizing some objective function. Many previous works following this paradigm differ in the detection and parsing methods. Character detection methods can be patch-based or bottom-up. Patch-based detection first finds patches of (hopefully) single characters using over-segmentation [3] or the stroke width transformation [4], followed by running a character classifier on each patch. Bottom-up detection first creates an image-level representation using engineered or learned features and then finds instances of characters by aggregating image-level evidence and searching for strong activations at every pixel. Many different representations have been proposed such as Strokelets [5], convolutional neural networks [6], region-based features [7], tree-structured deformable models [8] and simple shape template [9]. Both patch-based and bottom-up character detection have flawed localization because they cannot provide accurate segmentation boundaries of the characters. Unlike detection, word parsing methods in literature show strong similarity. They are generally sequence models that utilize attributes of individual as well as adjacent candidate characters. They differ in model order and inference techniques. For example, [10] considered the problem as a highorder Markov model in a Bayesian inference framework. A classic pairwise conditional random field was also used by [8, 11, 4], and inference was carried out using message passing [11] and dynamic programming [8, 4]. Acknowledging that a pairwise model cannot encode as useful features as a high-order character n-gram, [3] proposed a patch-based sequence model that encodes up to 4thorder character n-grams and applied beam search to solve it. A second paradigm is simultaneous character detection and word parsing, reading the text without an explicit step for detecting the characters. For example, [12] proposed a graphical model that jointly models the attributes, location, and class of characters as well as the language consistency of the word they constitute. Inference was carried out using weighted finite-state transducers (WFSTs). [13] took a drastically different approach: they used a lexicon of about 90k words to synthesize about 8 million images of text, which were used to train a CNN that predicts a character at each independent position. The main drawback of this “all-in-one” approach is weak invariance and insufficient robustness, since changes in any attribute such as spacing between characters may cause the system to fail due to over-fitting to the training data. 3 Model Our approach follows the first detection-parsing paradigm. First, candidate characters are detected using a novel generative shape model trained on clean character images. Second, a parsing model is used to infer the true word, and this parser is trained using max-margin structured output learning. 2 3.1 Generative Shape Model for Fonts Unlike many vision problem such as distinguishing dogs from cats where many local discriminative features can be informative, text in real scenes, printed or molded using some fonts, is not as easily distinguishable from local features. For example, the curve “⌣” at the bottom of “O” also exists in “G”, “U” and “Q”. This special structure “⊢” can be found in “B”, “E”, “F”, “H”, “P” and “R”. Without a sense of the global structure, a naive accumulation of local features easily leads to false detections in the presence of noise or when characters are printed tightly. We aim at building a model that specifically accounts for the global structure, i.e. the entire shape of characters. Our model is generative such that during testing time we obtain a segmentation together with classification, making the final word parsing much easier due to better explaining-away. Model Construction During training we build a graph representation from rendered clean images of fonts, as shown in Fig. 2. Since we primarily care about shape, the basic image-level feature representation relies only on edges, making our model invariant to appearance such as color and texture. Specifically, given a clean font image we use 16 oriented filters to detect edges, followed by local suppression that keeps at most one edge orientation active per pixel (Fig. 2a). Then, “landmark” features are generated by selecting one edge at a time, suppressing any other edges within a fixed radius, and repeat (Fig. 2b). We then create a pool variable centered around each landmark point such that it allows translation pooling in a window around the landmark (Fig. 2b). To coordinate the the pool choices between adjacent landmarks (thus the shape of the letter), we add “lateral constraints” between neighboring pairs of pools that lie on the same edge contour (blue dashed lines in Fig. 2c). All lateral constraints are elastic, allowing for some degree of affine and non-affine deformation. This allows our model to generalize to different variations observed in real images such as noise, aspect change, blur, etc. In addition to contour laterals, we add lateral constraints between distant pairs of pixels (red dashed lines in Fig. 2c) to further constrain the shapes this model can represent. These distant laterals are greedily added one at a time, from shortest to longest, between pairs of features that with the current constraints can deform more than γ times the deformation allowed by adding a direct constraint between the features (typically γ ≈3). Figure 2: Model construction process for our generative shape model for fonts. Given a clean character images, we detect 16 oriented edge features at every pixel (a). We perform a sparsification process that selects “landmark” features from the dense edge map (b) and then add pooling window (b). We then add lateral constraints to constrain the shape model (c). A factor graph representation of our model is partially shown in (d). (best viewed in color) Formally, our model can be viewed as a factor graph shown in Fig. 2d. Each pool variable centered on a landmark feature is considered a random variable and is associated with unary factors corresponding to the translations of the landmark feature. Each lateral constraint is a pairwise factor. The unary factors give positive scores when matching features are found in the test image. The pairwise factor is parameterized with a single perturbation radius parameter, which is defined as the largest allowed change in the relative position of features in the adjacent pools. This perturbation radius forbids extreme deformation, giving −∞log probability if this lateral constraint is violated. During testing, the state space of each random variable is the pooling window and lateral constraints are not allowed to be violated. During training, this model construction process is carried out independently for all letter images, and each letter is rendered in multiple fonts. 3 Inference and Instance Detection The letter models can be considered to be tiling an input image at all translations. Given a test image, finding all candidate character instances involves two steps: a forward pass and backtracing. The forward pass is a bottom-up procedure that accumulate evidence from the test image to compute the marginal distribution of the shape model at each pixel location, similar to an activation heatmap. To speed-up the computation, we simplify our graph (Fig. 2c) into a minimum spanning tree, computed with edge weights equal to the pixel distance between features. Moreover, we make the pooling window as large as the entire image to avoid a scanning procedure. The marginals in the tree can be computed exactly and quickly with a single iteration of belief propagation. After non-maximum suppression, a few positions that have the strongest activation are selected for backtracing. This process is guaranteed to overestimate the true marginals in the original loopy graphical model, so this forward pass admits some false positives. Such false positives occur more often when the image has a tight character layout or a prominent texture or background. Given the estimated positions of character instances, backtracing is performed in the original loopy graph to further reduce false positives and to output a segmentation (by connecting the “landmarks”) of each instance in the test image. The backtracing procedure selects a single landmark feature, constrains its position to one of the local maxima in its marginal from the forward pass, and then performs MAP inference in the full loopy graph to estimate the positions of all other landmarks in the model, which provides the segmentation. Because this inference is more accurate than the forward pass, additional false positives can be pruned after backtracing. In both the forward and backward pass, classic loopy belief propagation was sufficient. Greedy Font Model Selection One challenge in scene text reading is covering the huge variation of fonts in uncontrolled, real world images. It is not feasible to train on all fonts because it is too computationally expensive and redundant. We resort to an automated greedy font selection approach. Briefly, for some letter we render images for all fonts and then use the resulting images to train shape models. These shape models are then tested on every other rendered image, yielding a compatibility score (amount of matching “landmark” features) between every pair of fonts of the same letter. One font is considered representable by another if their compatibility score is greater than a given threshold (=0.8). For each letter, we find and keep the fonts that can represent most other fonts and remove it from the font candidate set together with all the fonts it represents. This selection process is repeated until 90% of all fonts are represented. Usually the remaining 10% fonts are non-typical and rare in real scenes. 3.2 Word Parsing using Structured Output Learning Parsing Model Our generative shape models were trained independently on all font images. Therefore, no explaining-away is performed before parsing. The shape model shows high invariance and sensitivity, yielding a rich list of candidate letters that contains many false positives. For example, an image of letter “E” may also trigger the following: “F”, “I”, “L” and “c”. Word parsing refers to inferring the true word from this list of candidate letters. Figure 3: Our parsing model represented as a high-order factor graph. Given a test image, the shape model generates a list of candidate letters. A factor graph is created by adding edges between hypothetical neighboring letters and considering these edges as random variables. Four types of factors are defined: transition, smoothness, consistency, and singleton factors. The first two factors characterize the likelihood of parsing path, while the latter two ensure valid parsing output. Our parsing model can be represented as a high-order factor graph in Fig. 3. First, we build hypothetical edges between a candidate letter and every candidate letter on its right-hand side within some distance. Two pseudo letters “*” and “#” are created, indicating start and end of the graph, 4 respectively. Edges are created from start to all possible head letters and similarly from end to all possible tail letters. Each edge is considered as a binary random variable which, if activated, indicates a pair of neighboring letters from the true word. We define four types of factors. Transition factors (green, unary) describe the likelihood of a hypothetical pair of neighboring letters being true. Similarly, smoothness factors (blue, pairwise) describe the likelihood of a triplet of consecutive letters. Two additional factors are added as constraints to ensure valid output. Consistency factors (red, high-order) ensure that if any candidate letter has an activated inward edge, it must have one activated outward edge. This is sometimes referred to as “flow consistency”. Lastly, to satisfy the single word constraint, a singleton factor (purple, highorder) is added such that there must be a single activated edge from “start”. Examples of these factors are shown in Fig. 3. Mathematically, assuming that potentials on the factors are provided, inferring the state of random variables in the parsing factor graph is equivalent to solving the following optimization problem. ˆz = arg maxz        X c∈C X v∈Out(c) φT v (wT)zv + X c∈C X u∈In(c) v∈Out(c) φS u,v(wS)zuzv        (1) s.t. ∀c ∈C, P u∈In(c) zu = P v∈Out(c) zv, (2) P v∈Out(∗) zv = 1, (3) ∀c ∈C, ∀v ∈Out(c), zv ∈{0, 1}. (4) where, z = {zv} is the set of all binary random variables indexed by v; C is the set of all candidate letters, and for candidate letter c in C, In(c) and Out(c) index the random variables that correspond to the inward and outward edges of c, respectively; φT v (wT) is the potential of transition factor at v (parameterized by weight vector wT) and φS u,v(wS) is the potential of smoothness factor from u to v (parameterized by weight vector wS); Constraints (2)–(4) ensure flow consistency, singleton, and the binary nature of all random variables. Parameter Learning Another issue is proper parameterization of the factor potentials, i.e. φT v (wT) and φS u,v(wS). Due to the complex nature of real world images, high dimensional parsing features are required. For one example, consecutive letters of the true word are usually evenly spaced. For another example, a character n-gram model can be used to resolve ambiguous letter detections and improve parsing quality. We use Wikipedia as the source for building our character n-gram model. Both φT v (wT) and φS u,v(wS) are linear models of some features and a weight vector. To learn the best weight vector that directly maps the input-output dependency of the parsing factor graph, we used the maximum-margin structured output learning paradigm [14]. Briefly, maximum-margin structured output learning attempts to learn a direct functional dependency between structured input and output by maximizing the margin between the compatibility score of the ground truth solution and that of the second best solution. It is an extension to the classic support vector machine (SVM) paradigm. Usually, the compatibility score is a linear function of some so-called joint feature vector (i.e. parsing features) and feature weights to be learned (i.e. wT and wS here). We designed 18 parsing features, including the score of individual candidate letters, color consistency between hypothetical neighboring pairs, alignment of hypothetical consecutive triplets, and character n-grams up to third order. Re-ranking Lastly, top scoring words from the second-order Viterbi algorithm are re-ranked using statistical word frequencies from Wikipedia. 4 Experiments 4.1 Datasets ICDAR ICDAR (“International Conference on Document Analysis and Recognition”) is a biannual competition on text recognition. The ICDAR 2013 Robust Reading Competition was designed for comparing scene text recognition approaches [1]. Unlike digital-born images like those used on the 5 web, real world image recognition is more challenging due to uncontrolled environmental and imaging conditions that result in strong variation in font, blur, noise, distortion, non-uniform appearance, and background structure. We worked on two datasets: ICDAR 2013 Segmentation dataset and ICDAR 2013 Recognition dataset. In this experiment, we only consider letters, ignoring punctuations and digits. All test images are cropped and each image contains only a single word, see examples in Fig. 1. SVT The Street View Text (SVT) dataset [15] was harvested from Google Street View. Image text in this dataset exhibits high variability and often has low resolution. SVT provides a small lexicon and was created for lexicon-driven word recognition. In our experiments, we did not restrict the setting to a given small lexicon and instead used a general, large English lexicon. SVT does not contain symbols other than letters. 4.2 Model Training Training Generative Shape Model To ensure sufficient coverage of fonts, we obtained 492 fonts from Google Fonts1. Manual font selection is biased and inaccurate, and it is not feasible to train on all fonts (492 fonts times 52 letters gives 25584 training images). After the proposed greedy font selection process for all letters, we retained 776 unique training images in total (equivalent to a compression rate of 3% if we would have trained on all fonts for all letters). Fig. 4 shows the selected fonts for letter “a” and “A”, respectively. Figure 4: Results of greedy font selection for letter “a” and “A”. Given a large font database of 492 fonts, this process leverages the representativeness of our generative shape model to significantly reduce the number of training images required to cover all fonts. Training Word Parsing Model Training the structured output prediction model is expensive in terms of supervision because every training sample consists of many random variables, and the state of every random variable has to be annotated (i.e. the entire parsing path). We prepared training data for our parsing model automatically using the ICDAR 2013 Segmentation dataset [1] that provides per-character segmentation of scene text. Briefly, we first detect characters and construct a parsing graph for each image. We then find the true path in the parsing graph (i.e. a sequence of activated random variables) by matching the detected characters to the ground truth segmentation. In total, we used 630 images for training the parser using PyStruct2. Shape Model Invariance Study We studied the invariance of our model by testing on transformations of the training images. We considered scaling and rotation. For the former, our model performs robust fitting when the scaling varies between 130% and 70%. For the later, the angle of robust fitting is between -20 and +20 degrees. 4.3 Results and Comparison Character Detection We first tested our shape model on the ICDAR 2013 Segmentation dataset. Since this is pre-parsing and no explaining-away is performed, we specifically looked for high recall. A detected letter and a true segmented letter is considered a match only when the letter classes match and their segmentation masks strongly overlap with ≥0.8 IoU (intersection-over-union). Trained on fonts selected from Google Fonts, we obtained a very high 95.0% recall, which is significantly better than 68.7% by the best reported method on the dataset [1]. This attributes to the high invariance encoded in our model from the lateral constraints. The generative nature of the model gives a complete segmentation and classification instead of only letter classification (as most discriminative models do). Fig. 5 shows some instances of letters detected by our model. They exhibit strong variance in font and appearance. Note that two scales (×1, ×2) are used during testing. 1https://www.google.com/fonts 2https://pystruct.github.io 6 Figure 5: Examples of detected and segmented characters (“A”, “E” and “R”) from the ICDAR 2013 Segmentation dataset. Despite obvious differences in font, appearance, and imaging condition and quality, our shape model shows high accuracy in localizing and segmenting them from the full image. (best viewed in color and when zoomed in) Word Parsing We compared our approach against top performing ones in the ICDAR 2013 Robust Reading Competition. Results are given in Table 4.3. Our model perform better than Google’s PhotoOCR[3] with a margin of 2.3%. However, a more important message is that we achieved this result using three orders of magnitude less training data: 1406 total images (776 letter font images for training the shape models and 630 word images for training the parser) versus 5 million by PhotoOCR. Two major factors attribute to our high efficiency. First, considering character detection, our model demonstrates strong generalization in practice. Data-intensive models like those in PhotoOCR impose weaker structural priors and require significantly more supervision. Second, considering word parsing, our generative model solves recognition and segmentation together, allowing the use of highly accurate parsing features. On the other hand, PhotoOCR’s neural-network based character classifier is incapable of generating accurate character segmentation boundaries, making the parsing quality bounded. Our observations on the SVT dataset are similar: using exactly the same training data we achieved state-of-the-art 80.7% accuracy. Note that all reported results in our experiments are case-sensitive. Fig. 6 demonstrates the robustness of our approach toward unusual fonts, noise, blur, and distracting backgrounds. Method ICDAR SVT Training Data Size PicRead [1] 63.1% 72.9% N/A Deep Struc. Learn. [16] 81.8% 71.7% 8,000,000 (synthetic) PhotoOCR [3] 84.3% 78.0% 7,900,000 (manually labeled + augmented) This paper 86.2% 80.7 % 1,406 (776 letter images + 630 word images) Figure 6: Visualization of correctly parsed images from ICDAR (first two columns) and SVT (last column) including per-character segmentation and parsing path. The numbers therein are local potential values on the parsing factor graph. (best viewed in color and when zoomed in) 7 4.4 Further Analysis & Discussion Failure Case Analysis Fig. 7 shows some typical failure cases for our system (left) and PhotoOCR (right). Our system fails mostly when the image is severely corrupted by noise, blur, over-exposure, or when the text is handwritten. PhotoOCR fails at some clean images where the text is easily readable. This reflects the limited generalization of data-intensive models because of the diminishing return of more training data. This comparison also shows that our approach is more interpretable: we can quickly justify the failure reasons by viewing the letter segmentation boundaries overlaid on the raw image. For example, over-exposure and blur cause edge features to drop out and thus fail the shape model. On the contrary, it is not so straightforward to explain why a discriminative model like PhotoOCR fails at some cases as shown in Fig. 7. Figure 7: Examples of failure cases for our system and PhotoOCR. Typically our system fails when the image is severely corrupted or contains handwriting. PhotoOCR is susceptible to failing at clean images where the text is easily readable. Language Model In our experiments, a language model plays two roles: in parsing as character ngram features and in re-ranking as word-level features. Ideally, a perfect perception system should be able to recognize most text in ICDAR without the need for a language model. We turned off the language model in our experiments and observed approximately a 15% performance drop. For PhotoOCR in the same setting, the performance drop is more than 40%. This is due to the fact that PhotoOCR’s core recognition model is a coarse understanding of the scene, and parsing is difficult without the high quality character segmentation that our generative shape model provides. Relation to Other Methods Here we discuss the connections and differences between our shape model and two very popular vision models: deformable parts models (DPM) [17] and convolutional neural networks (CNN) [18]. The first major distinction is that both DPM and CNN are discriminative while our model is generative. Only our model can generate segmentation boundaries without any additional ad-hoc processing. Second, CNN does not model any global shape structure, depending solely on local discriminative features (usually in a hierarchical fashion) to perform classification. DPM accounts for some degree of global structure, as the relative positions of parts are encoded in a star graph or tree structure. Our model imposes stronger global structure by using short and long lateral constraints. Third, during model inference both CNN and DPM only perform a forward pass, while ours also performs backtracing for accurate segmentation. Finally, regarding invariance and generalization, we directly encode invariance into the model using the perturbation radius in lateral constraints. This is proven very effective in capturing various deformations while still maintaining the stability of the overall shape. Neither DPM nor CNN encode invariance directly and instead rely on substantial data to learn model parameters. 5 Conclusion and Outlook This paper presents a novel generative shape model for scene text recognition. Together with a parser trained using structured output learning, the proposed approach achieved state-of-the-art performance on the ICDAR and SVT datasets, despite using orders of magnitude fewer training images than many pure discriminative models require. This paper demonstrates that it is preferable to directly encode invariance and deformation priors in the form of lateral constraints. Following this principle, even a non-hierarchical model like ours can outperform deep discriminative models. In the future, we are interested in extending our model to a hierarchical version with reusable features. We are also interested in further improving the parsing model to account for missing edge evidence due to blur and over-exposure. 8 References [1] Dimosthenis Karatzas, Faisal Shafait, Seiichi Uchida, Mikio Iwamura, Lluis Gomez i Bigorda, Sergi Robles Mestre, Jordi Mas, David Fernandez Mota, Jon Almazan Almazan, and Lluis-Pere de las Heras. Icdar 2013 robust reading competition. In Document Analysis and Recognition (ICDAR), 2013 12th International Conference on, pages 1484–1493. IEEE, 2013. [2] Qixiang Ye and David Doermann. Text detection and recognition in imagery: A survey. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 37(7):1480–1500, 2015. [3] Alessandro Bissacco, Mark Cummins, Yuval Netzer, and Hartmut Neven. Photoocr: Reading text in uncontrolled conditions. In Proceedings of the IEEE International Conference on Computer Vision, pages 785–792, 2013. [4] Lukas Neumann and Jiri Matas. Scene text localization and recognition with oriented stroke detection. In Proceedings of the IEEE International Conference on Computer Vision, pages 97–104, 2013. [5] Cong Yao, Xiang Bai, Baoguang Shi, and Wenyu Liu. Strokelets: A learned multi-scale representation for scene text recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4042–4049, 2014. [6] Adam Coates, Blake Carpenter, Carl Case, Sanjeev Satheesh, Bipin Suresh, Tao Wang, David J Wu, and Andrew Y Ng. Text detection and character recognition in scene images with unsupervised feature learning. In Document Analysis and Recognition (ICDAR), 2011 International Conference on, pages 440–445. IEEE, 2011. [7] Chen-Yu Lee, Anurag Bhardwaj, Wei Di, Vignesh Jagadeesh, and Robinson Piramuthu. Region-based discriminative feature pooling for scene text recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4050–4057, 2014. [8] Cunzhao Shi, Chunheng Wang, Baihua Xiao, Yang Zhang, Song Gao, and Zhong Zhang. Scene text recognition using part-based tree-structured character detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2961–2968, 2013. [9] James M Coughlan and Sabino J Ferreira. Finding deformable shapes using loopy belief propagation. In European Conference on Computer Vision, pages 453–468. Springer, 2002. [10] Jerod J Weinman, Erik Learned-Miller, and Allen R Hanson. Scene text recognition using similarity and a lexicon with sparse belief propagation. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 31(10):1733–1746, 2009. [11] Anand Mishra, Karteek Alahari, and CV Jawahar. Top-down and bottom-up cues for scene text recognition. In Computer Vision and Pattern Recognition (CVPR), 2012 IEEE Conference on, pages 2687–2694. IEEE, 2012. [12] Tatiana Novikova, Olga Barinova, Pushmeet Kohli, and Victor Lempitsky. Large-lexicon attributeconsistent text recognition in natural images. In Computer Vision–ECCV 2012, pages 752–765. Springer, 2012. [13] Max Jaderberg, Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Synthetic data and artificial neural networks for natural scene text recognition. arXiv preprint arXiv:1406.2227, 2014. [14] Ioannis Tsochantaridis, Thomas Hofmann, Thorsten Joachims, and Yasemin Altun. Support vector machine learning for interdependent and structured output spaces. In Proceedings of the twenty-first international conference on Machine learning, page 104. ACM, 2004. [15] Kai Wang and Serge Belongie. Word spotting in the wild. Computer Vision–ECCV 2010, pages 591–604, 2010. [16] Max Jaderberg, Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep structured output learning for unconstrained text recognition. arXiv preprint arXiv:1412.5903, 2014. [17] Pedro Felzenszwalb, David McAllester, and Deva Ramanan. A discriminatively trained, multiscale, deformable part model. In Computer Vision and Pattern Recognition, 2008. CVPR 2008. IEEE Conference on, pages 1–8. IEEE, 2008. [18] Yann LeCun, L´eon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998. 9
2016
83
6,545
Probabilistic Linear Multistep Methods Onur Teymur Department of Mathematics Imperial College London o@teymur.uk Konstantinos Zygalakis School of Mathematics University of Edinburgh k.zygalakis@ed.ac.uk Ben Calderhead Department of Mathematics Imperial College London b.calderhead@imperial.ac.uk Abstract We present a derivation and theoretical investigation of the Adams-Bashforth and Adams-Moulton family of linear multistep methods for solving ordinary differential equations, starting from a Gaussian process (GP) framework. In the limit, this formulation coincides with the classical deterministic methods, which have been used as higher-order initial value problem solvers for over a century. Furthermore, the natural probabilistic framework provided by the GP formulation allows us to derive probabilistic versions of these methods, in the spirit of a number of other probabilistic ODE solvers presented in the recent literature [1, 2, 3, 4]. In contrast to higher-order Runge-Kutta methods, which require multiple intermediate function evaluations per step, Adams family methods make use of previous function evaluations, so that increased accuracy arising from a higher-order multistep approach comes at very little additional computational cost. We show that through a careful choice of covariance function for the GP, the posterior mean and standard deviation over the numerical solution can be made to exactly coincide with the value given by the deterministic method and its local truncation error respectively. We provide a rigorous proof of the convergence of these new methods, as well as an empirical investigation (up to fifth order) demonstrating their convergence rates in practice. 1 Introduction Numerical solvers for differential equations are essential tools in almost all disciplines of applied mathematics, due to the ubiquity of real-world phenomena described by such equations, and the lack of exact solutions to all but the most trivial examples. The performance – speed, accuracy, stability, robustness – of the numerical solver is of great relevance to the practitioner. This is particularly the case if the computational cost of accurate solutions is significant, either because of high model complexity or because a high number of repeated evaluations are required (which is typical if an ODE model is used as part of a statistical inference procedure, for example). A field of work has emerged which seeks to quantify this performance – or indeed lack of it – by modelling the numerical errors probabilistically, and thence trace the effect of the chosen numerical solver through the entire computational pipeline [5]. The aim is to be able to make meaningful quantitative statements about the uncertainty present in the resulting scientific or statistical conclusions. Recent work in this area has resulted in the development of probabilistic numerical methods, first conceived in a very general way in [6]. An recent summary of the state of the field is given in [7]. The particular case of ODE solvers was first addressed in [8], formalised and extended in [1, 2, 3] with a number of theoretical results recently given in [4]. The present paper modifies and extends the constructions in [1, 4] to the multistep case, improving the order of convergence of the method but avoiding the simplifying linearisation of the model required by the approaches of [2, 3]. Furthermore we offer extensions to the convergence results in [4] to our proposed method and give empirical results confirming convergence rates which point to the practical usefulness of our higher-order approach without significantly increasing computational cost. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 1.1 Mathematical setup We consider an Initial Value Problem (IVP) defined by an ODE d dty(t, ✓) = f(y(t, ✓), t), y(t0, ✓) = y0 (1) Here y(·, ✓) : R+ ! Rd is the solution function, f : Rd ⇥R+ ! Rd is the vector-valued function that defines the ODE, and y0 2 Rd is a given vector called the initial value. The dependence of y on an m-dimensional parameter ✓2 Rm will be relevant if the aim is to incorporate the ODE into an inverse problem framework, and this parameter is of scientific interest. Bayesian inference under this setup (see [9]) is covered in most of the other treatments of this topic but is not the main focus of this paper; we therefore suppress ✓for the sake of clarity. Some technical conditions are required in order to justify the existence and uniqueness of solutions to (1). We assume that f is evaluable point-wise given y and t and also that it satisfies the Lipschitz condition in y, namely ||f(y1, t) −f(y2, t)|| Lf||y1 −y2|| for some Lf 2 R+ and all t, y1 and y2; and also is continuous in t. These conditions imply the existence of a unique solution, by a classic result usually known as the Picard-Lindelöf Theorem [10]. We consider a finite-dimensional discretisation of the problem, with our aim being to numerically generate an N-dimensional vector1 y1:N approximating the true solution y(t1:N) in an appropriate sense. Following [1], we consider the joint distribution of y1:N and the auxiliary variables f0:N (obtained by evaluating the function f), with each yi obtained by sequentially conditioning on previous evaluations of f. A basic requirement is that the marginal mean of y1:N should correspond to some deterministic iterative numerical method operating on the grid t1:N. In our case this will be a linear multistep method (LMM) of specified type. 2 Firstly we telescopically factorise the joint distribution as follows: p(y1:N, f0:N|y0) = p(f0|y0) N−1 Y i=0 p(yi+1|y0:i, f0:i) p(fi+1|y0:i+1, f0:i) (2) We can now make simplifying assumptions about the constituent distributions. Firstly since we have assumed that f is evaluable point-wise given y and t, p(fi|yi, . . . ) = p(fi|yi) = δfi " f(yi, ti) # , (3) which is a Dirac-delta measure equivalent to simply performing this evaluation deterministically. Secondly, we assume a finite moving window of dependence for each new state – in other words yi+1 is only allowed to depend on yi and fi, fi−1, . . . , fi−(s−1) for some s 2 N. This corresponds to the inputs used at each iteration of the s-step Adams-Bashforth method. For i < s we will assume dependence on only those derivative evaluations up to i; this initialisation detail is discussed briefly in Section 4. Strictly speaking, fN is superfluous to our requirements (since we already have yN) and thus we can rewrite (2) as p(y1:N, f0:N−1|y0) = N−1 Y i=0 p(fi|yi) p(yi+1|yi, fmax(0,i−s+1):i) (4) = N−1 Y i=0 δfi(f(yi, ti)) p(yi+1|yi, fmax(0,i−s+1):i) | {z } ⇤ (5) The conditional distributions ⇤are the primary objects of our study – we will define them by constructing a particular Gaussian process prior over all variables, then identifying the appropriate (Gaussian) conditional distribution. Note that a simple modification to the decomposition (2) allows the same set-up to generate an (s + 1)-step Adams-Moulton iterator3 – the implicit multistep method where yi+1 depends in addition on fi+1. At various stages of this paper this extension is noted but omitted for reasons of space – the collected results are given in Appendix C. 1The notation y0:N denotes the vector (y0, . . . , yN), and analogously t0:N, f0:N etc. 2We argue that the connection to some specific deterministic method is a desirable feature, since it aids interpretability and allows much of the well-developed theory of IVP solvers to be inherited by the probabilistic solver. This is a particular strength of the formulation in [4] which was lacking in all previous works. 3The convention is that the number of steps is equal to the total number of derivative evaluations used in each iteration, hence the s-step AB and (s + 1)-step AM methods both go ‘equally far back’. 2 Linear multistep methods We give a very short summary of Adams family LMMs and their conventional derivation via interpolating polynomials. For a fuller treatment of this well-studied topic we refer the reader to the comprehensive references [10, 11, 12]. Using the usual notation we write yi for the numerical estimate of the true solution y(ti), and fi for the estimate of f(ti) ⌘y0(ti). The classic s-step Adams-Bashforth method calculates yi+1 by constructing the unique polynomial Pi(!) 2 Ps−1 interpolating the points {fi−j}s−1 j=0. This is given by Lagrange’s method as Pi(!) = s−1 X j=0 ` 0:s−1 j (!)fi−j ` 0:s−1 j (!) = s−1 Y k=0 k6=j ! −ti−k ti−j −ti−k (6) The ` 0:s−1 j (!) are known as Lagrange polynomials, have the property that ` 0:s−1 p (ti−q) = δpq, and form a basis for the space Ps−1 known as the Lagrange basis. The Adams-Bashforth iteration then proceeds by writing the integral version of (1) as y(ti+1)−y(ti) ⌘ R ti+1 ti f(y, t) dt and approximating the function under the integral by the extrapolated interpolating polynomial to give yi+1 −yi ⇡ Z ti+1 ti Pi(!) d! = h s−1 X j=0 βAB j,s fi−j (7) where h = ti+1 −ti and the βAB j,s ⌘h−1 R h 0 ` 0:s−1 j (!) d! are the Adams-Bashforth coefficients for order s, all independent of h and summing to 1. Note that if f is a polynomial of degree s −1 (so y(t) is a polynomial of degree s) this procedure will give the next solution value exactly. Otherwise the extrapolation error in fi+1 is of order O(hs) and in yi+1 (after an integration) is of order O(hs+1). So the local truncation error is O(hs+1) and the global error O(hs) [10]. Adams-Moulton methods are similar except that the polynomial Qi(!) 2 Ps interpolates the s + 1 points {fi−j}s−1 j=−1. The resulting equation analogous to (7) is thus an implicit one, with the unknown yi+1 appearing on both sides. Typically AM methods are used in conjunction with an AB method of one order lower, in a ‘predictor-corrector’ arrangement. Here, a predictor value y⇤ i+1 is calculated using an AB step; this is then used to estimate f ⇤ i+1 = f(y⇤ i+1); and finally an AM step uses this value to calculate yi+1. We again refer the reader to Appendix C for details of the AM construction. 2 Derivation of Adams family LMMs via Gaussian processes We now consider a formulation of the Adams-Bashforth family starting from a Gaussian process framework and then present a probabilistic extension. We fix a joint Gaussian process prior over yi+1, yi, fi, fi−1, . . . , fi−s+1 as follows. We define two vectors of functions φ(!) and Φ(!) in terms of the Lagrange polynomials ` 0:s−1 j (!) defined in (6) as φ(!) = ✓ 0 ` 0:s−1 0 (!) ` 0:s−1 1 (!) . . . ` 0:s−1 s−1 (!) ◆T (8) Φ(!) = Z φ(!) d! = ✓ 1 Z ` 0:s−1 0 (!) d! . . . Z ` 0:s−1 s−1 (!) d! ◆T (9) The elements (excluding the first) of φ(!) form a basis for Ps−1 and the elements of Φ(!) form a basis for Ps. The initial 0 in φ(!) is necessary to make the dimensions of the two vectors equal, so we can correctly define products such as Φ(!)T φ(!) which will be required later. The first element of Φ(!) can be any non-zero constant C; the analysis later is unchanged and we therefore take C = 1. Since we will solely be interested in values of the argument ! corresponding to discrete equispaced time-steps tj −tj−1 = h indexed relative to the current time-point ti = 0, we will make our notation more concise by writing φi+k for φ(ti+k), and similarly Φi+k for Φ(ti+k). We now use these vectors of basis functions to define a joint Gaussian process prior as follows: 3 0 B B B B B B B B @ yi+1 yi fi fi−1 ... fi−s+1 1 C C C C C C C C A = N 2 666666664 0 B B B B B B B B @ 0 0 0 0 ... 0 1 C C C C C C C C A , 0 B B B B B B B B @ ΦT i+1Φi+1 ΦT i+1Φi ΦT i+1φi · · · ΦT i+1φi−s+1 ΦT i Φi+1 ΦT i Φi ΦT i φi · · · ΦT i φi−s+1 φT i Φi+1 φT i Φi φT i φi . . . φT i φi−s+1 φT i−1Φi+1 φT i−1Φi φT i−1φi . . . φT i−1φi−s+1 ... ... ... ... ... φT i−s+1Φi+1 φT i−s+1Φi φT i−s+1φi . . . φT i−s+1φi−s+1 1 C C C C C C C C A 3 777777775 (10) This construction works because y0 = f and differentiation is a linear operator; the rules for the transformation of the covariance elements is given in Section 9.4 of [13] and can easily be seen to correspond to the defined relationship between φ(!) and Φ(!). Recalling the decomposition in (5), we are interested in the conditional distribution p(yi+1|yi, fi−s+1:i). This is also Gaussian, with mean and covariance given by the standard formulae for Gaussian conditioning. This construction now allows us to state the following result: Proposition 1. The conditional distribution p(yi+1|yi, fi−s+1:i) under the Gaussian process prior given in (10), with covariance kernel basis functions as in (8) and (9), is a δ-measure concentrated on the s-step Adams-Bashforth predictor yi + h Ps−1 j=0 βAB j,s fi−j. The proof of this proposition is given in Appendix A. Because of the natural probabilistic structure provided by the Gaussian process framework, we can augment the basis function vectors φ(!) and Φ(!) to generate a conditional distribution for yi+1 that has non-zero variance. By choosing a particular form for this augmented basis we can obtain an expression for the standard deviation of yi+1 that is exactly equal to the leading-order local truncation error of the corresponding deterministic method. We will expand the vectors φ(!) and Φ(!) by one component, chosen so that the new vector comprises elements that span a polynomial space of order one greater than before. Define the augmented bases φ+(!) and Φ+(!) as φ(!)+ = ✓ 0 ` 0:s−1 0 (!) ` 0:s−1 1 (!) . . . ` 0:s−1 s−1 (!) ↵hs` −1:s−1 −1 (!) ◆T (11) Φ(!)+ = ✓ 1 Z ` 0:s−1 0 (!) d! . . . Z ` 0:s−1 s−1 (!) d! Z ↵hs` −1:s−1 −1 (!) d! ◆T (12) The additional term at the end of φ+(!) is the polynomial of order s which arises from interpolating f at s + 1 points (with the additional point at ti+1) and choosing the basis function corresponding to the root at ti+1, scaled by ↵hs with ↵a positive constant whose role will be explained in the next section. The elements of these vectors span Ps and Ps+1 respectively. With this new basis we can give the following result: Proposition 2. The conditional distribution p(yi+1|yi, fi−s+1:i) under the Gaussian process prior given in (10), with covariance kernel basis functions as in (11) and (12), is Gaussian with mean equal to the s-step Adams-Bashforth predictor yi + h Ps−1 j=0 βAB j,s fi−j and, setting ↵= y(s+1)(⌘) for some ⌘2 (ti−s+1, ti+1), standard deviation equal to its local truncation error. The proof is given in Appendix B. In order to de-mystify the construction, we now exhibit a concrete example for the case s = 3. The conditional distribution of interest is p(yi+1|yi, fi, fi−1, fi−2) ⌘ p(yi+1|yi, fi:i−2). In the deterministic case, the vectors of basis functions become φ(!)s=3 = ✓ 0 (! + h)(! + 2h) 2h2 !(! + 2h) −h2 !(! + h) 2h2 ◆ Φ(!)s=3 = ✓ 1 ! " 2!2 + 9h! + h2# 12h2 !2 (! + 3h) −3h2 !2 (2! + 3h) 12h2 ◆ 4 and simple calculations give that E(yi+1|yi, fi:i−2) = yi + h ✓23 12fi −4 3fi−1 + 5 12fi−2 ◆ Var(yi+1|yi, fi:i−2) = 0 The probabilistic version follows by setting φ+(!)s=3 = ✓ 0 (! + h)(! + 2h) 2h2 !(! + 2h) −h2 !(! + h) 2h2 ↵!(! + h)(! + 2h) 6 ◆ Φ+(!)s=3 = ✓ 1 ! " 2!2 + 9h! + h2# 12h2 !2 (x + 3h) −3h2 !2 (2! + 3h) 12h2 ↵!2(! + 2h)2 24 ◆ and further calculation shows that E(yi+1|yi, fi:i−2) = yi + h ✓23 12fi −4 3fi−1 + 5 12fi−2 ◆ Var(yi+1|yi, fi:i−2) = ✓3h4↵ 8 ◆2 An entirely analogous argument can be shown to reproduce and probabilistically extend the implicit Adams-Moulton scheme. The Gaussian process prior now includes fi+1 as an additional variable and the correlation structure and vectors of basis functions are modified accordingly. The required modifications are given in Appendix C and a explicit derivation for the 4-step AM method is given in Appendix D. 2.1 The role of ↵ Replacing ↵in (11) by y(s+1)(⌘), with ⌘2 (ti−s+1, ti+1), makes the variance of the integrator coincide exactly with the local truncation error of the underlying deterministic method.4 This is of course of limited utility unless higher derivatives of y(t) are available, and even if they are, ⌘is itself unknowable in general. However it is possible to estimate the integrator variance in a systematic way by using backward difference approximations [14] to the required derivative at ti+1. We show this by expanding the s-step Adams-Bashforth iterator as yi+1 = yi + h Ps−1 j=0 βAB j,s fi−j + hs+1CAB s y(s+1)(⌘) ⌘2 [ti−s+1, ti+1] = yi + h Ps−1 j=0 βAB j,s fi−j + hs+1CAB s y(s+1)(ti+1) + O(hs+2) = yi + h Ps−1 j=0 βAB j,s fi−j + hs+1CAB s f (s)(ti+1) + O(hs+2) since y0 = f = yi + h Ps−1 j=0 βAB j,s fi−j + hs+1CAB s h h−s Ps−1+p k=0 δk,s−1+pfi−k + O(hp) i + O(hs+2) = yi + h Ps−1 j=0 βAB j,s fi−j + hCAB s Ps k=0 δk,sfi−k + O(hs+2) if we set p = 1 (13) where βAB ·,s are the set of coefficients and CAB s the local truncation error constant for the s-step Adams-Bashforth method, and δ·,s−1+p are the set of backward difference coefficients for estimating the sth derivative of f to order O(hp) [14]. In other words, the constant ↵can be substituted with h−s Ps k=0 δk,sfi−k, using already available function values and to adequate order. It is worth noting that collecting the coefficients βAB ·,s and δ·,s results in an expression equivalent to the Adams-Bashforth method of order s + 1 and therefore, this procedure is in effect employing two integrators of different orders and estimating the truncation error from the difference of the two.5 This principle is similar to the classical Milne Device [12], which pairs an AB and and AM iterator to achieve the same thing. Using the Milne Device to generate a value for the error variance is also straightforward within our framework, but requires two evaluations of f at each iteration (one of which immediately goes to waste) instead of the approach presented here, which only requires one. 4We do not claim that this is the only possible way of modelling the numerical error in the solver. The question of how to do this accurately is an open problem in general, and is particularly challenging in the multi-dimensional case. In many real world problems different noise scales will be appropriate for different dimensions and – especially in ‘hierarchical’ models arising from higher-order ODEs – non-Gaussian noise is to be expected. That said, the Gaussian assumption as a first order approximation for numerical error is present in virtually all work on this subject and goes all the way back to [8]. We adopt this premise throughout, whilst noting this interesting unresolved issue. 5An explicit derivation of this for s = 3 is given in Appendix E. 5 3 Convergence of the probabilistic Adams-Bashforth integrator We now give the main result of our paper, which demonstrates that the convergence properties of the probabilistic Adams-Bashforth integrator match those of its deterministic counterpart. Theorem 3. Consider the s-step deterministic Adams-Bashforth integrator given in Proposition 1, which is of order s. Then the probabilistic integrator constructed in Proposition 2 has the same mean square error as its deterministic counterpart. In particular max 0khT E|Yk −yk|2 Kh2s where Yk ⌘y(tk) denotes the true solution, yk the numerical solution, and K is a positive real number depending on T but independent of h. The proof of this theorem is given in Appendix F, and follows a similar line of reasoning to that given for a one-step probabilistic Euler integrator in [4]. In particular, we deduce the convergence of the algorithm by extrapolating from the local error. The additional complexity arises due to the presence of the stochastic part, which means we cannot rely directly on the theory of difference equations and the representations of their solutions. Instead, following [15], we rewrite the defining s-step recurrence equation as a one-step recurrence equation in a higher dimensional space. 4 Implementation We now have an implementable algorithm for an s-step probabilistic Adams-Bashforth integrator. Firstly, an accurate initialisation is required for the first s iterations – this can be achieved with, for example, a Runge-Kutta method of sufficiently high order.6 Secondly, at iteration i, the preceding s stored function evaluations are used to find the posterior mean and variance of yi+1. The integrator then advances by generating a realisation of the posterior measure derived in Proposition 2. Following [1], a Monte Carlo repetition of this procedure with different random seeds can then be used as an effective way of generating propagated uncertainty estimates at any time 0 < T < 1. 4.1 Example – Chua circuit The Chua circuit [16] is the simplest electronic circuit that exhibits chaotic behaviour, and has been the subject of extensive study – in both the mathematics and electronics communities – for over 30 years. Readers interested in this rich topic are directed to [17] and the references therein. The defining characteristic of chaotic systems is their unpredictable long-term sensitivity to tiny changes in initial conditions, which also manifests itself in the sudden amplification of error introduced by any numerical scheme. It is therefore of interest to understand the limitations of a given numerical method applied to such a problem – namely the point at which the solution can no longer be taken to be a meaningful approximation of the ground truth. Probabilistic integrators allow us to do this in a natural way [1]. The Chua system is given by x0 = ↵(y −(1 + h1)x −h3x3), y0 = x −y + z, z0 = −βy −γz. We use parameter values ↵= −1.4157, β = 0.02944201, γ = 0.322673579, h1 = −0.0197557699, h3 = −0.0609273571 and initial conditions x0 = 0, y0 = 0.003, z0 = 0.005. This particular choice is taken from ‘Attractor CE96’ in [18]. Using the probabilistic version of the Adams-Bashforth integrator with s > 1, it is possible to delay the point at which numerical path diverges from the truth, with effectively no additional evaluations of f required compared to the one-step method. This is demonstrated in Figure 1. Our approach is therefore able to combine the benefits of classical higher-order methods with the additional insight into solution uncertainty provided by a probabilistic method. 4.2 Example – Lotka-Volterra model We now apply the probabilistic integrator to a simple periodic predator-prey model given by the system x0 = ↵x −βxy, y0 = γxy −δy for parameters ↵= 1, β = 0.3, γ = 1 and δ = 0.7. We demonstrate the convergence behaviour stated in Theorem 3 empirically. 6We use a (packaged) adaptive Runge-Kutta-Fehlberg solver of 7th order with 8th order error control. 6 Figure 1: Time series for the x-component in the Chua circuit model described in Section 4.1, solved 20 times for 0 t 1000 using an s-step probabilistic AB integrator with s = 1 (top), s = 3 (middle), s = 5 (bottom). Step-size remains h = 0.01 throughout. Wall-clock time for each simulation was close to constant (±10 per cent – the difference primarily accounted for by the RKF initialisation procedure). The left-hand plot in Figure 2 shows the sample mean of the absolute error of 200 realisations of the probabilistic integrator plotted against step-size, on a log-log scale. The differing orders of convergence of the probabilistic integrators are easily deduced from the slopes of the lines shown. The right-hand plot shows the actual error value (no logarithm or absolute value taken) of the same 200 realisations, plotted individually against step-size. This plot shows that the error in the one-step integrator is consistently positive, whereas for two- and three-step integrators is approximately centred around 0. (This is also visible with the same data if the plot is zoomed to more closely examine the range with small h.) Though this phenomenon can be expected to be somewhat problem-dependent, it is certainly an interesting observation which may have implications for bias reduction in a Bayesian inverse problem setting. −10 −5 0 −4 −3 −2 log10 h log10 E |Error| 0.0 0.2 0.4 0.6 −4 −3 −2 log10 h Error No. of steps (s) 1 2 3 4 5 Figure 2: Empirical error analysis for the x-component of 200 realisations of the probabilistic AB integrator as applied to the Lotka-Volterra model described in Section 4.2. The left-hand plot shows the convergence rates for AB integrators of orders 1-5, while the right-hand plot shows the distribution of error around zero for integrators of orders 1-3. 7 5 Conclusion We have given a derivation of the Adams-Bashforth and Adams-Moulton families of linear multistep ODE integrators, making use of a Gaussian process framework, which we then extend to develop their probabilistic counterparts. We have shown that the derived family of probabilistic integrators result in a posterior mean at each step that exactly coincides with the corresponding deterministic integrator, with the posterior standard deviation equal to the deterministic method’s local truncation error. We have given the general forms of the construction of these new integrators to arbitrary order. Furthermore, we have investigated their theoretical properties and provided a rigorous proof of their rates of convergence, Finally we have demonstrated the use and computational efficiency of probabilistic Adams-Bashforth methods by implementing the solvers up to fifth order and providing example solutions of a chaotic system, and well as empirically verifying the convergence rates in a Lotka-Voltera model. We hope the ideas presented here will add to the arsenal of any practitioner who uses numerical methods in their scientific analyses, and contributes a further tool in the emerging field of probabilistic numerical methods. References [1] O. A. CHKREBTII, D. A. CAMPBELL, B. CALDERHEAD, and M. A. GIROLAMI. Bayesian Solution Uncertainty Quantification for Differential Equations. Bayesian Analysis, 2016. [2] P. HENNIG and S. HAUBERG. Probabilistic Solutions to Differential Equations and their Application to Riemannian Statistics. In, Proc. of the 17th int. Conf. on Artificial Intelligence and Statistics (AISTATS). Vol. 33. JMLR, W&CP, 2014. [3] M. SCHOBER, D. K. DUVENAUD, and P. HENNIG. Probabilistic ODE Solvers with Runge-Kutta Means. In Z. GHAHRAMANI, M. WELLING, C. CORTES, N. D. LAWRENCE, and K. Q. WEINBERGER, editors, Advances in Neural Information Processing Systems 27, pp. 739–747. Curran Associates, Inc., 2014. [4] P. R. CONRAD, M. GIROLAMI, S. SÄRKKÄ, A. STUART, and K. ZYGALAKIS. Statistical Analysis of Differential Equations: Introducing Probability Measures on Numerical Solutions. Statistics and Computing, 2016. [5] M. C. KENNEDY and A. O’HAGAN. Bayesian Calibration of Computer Models. Journal of the Royal Statistical Society: Series B, 63(3):425–464, 2001. [6] P. DIACONIS. Bayesian Numerical Analysis. In J. BERGER and S. GUPTA, editors, Statistical Decision Theory and Related Topics IV. Vol. 1, pp. 163–175. Springer, 1988. [7] P. HENNIG, M. A. OSBORNE, and M. GIROLAMI. Probabilistic Numerics and Uncertainty in Computations. Proc. R. Soc. A, 471(2179):20150142, 2015. [8] J. SKILLING. Bayesian Numerical Analysis. In J. W. T. GRANDY and P. W. MILONNI, editors, Physics and Probability, pp. 207–222. Cambridge University Press, 1993. [9] M. GIROLAMI. Bayesian Inference for Differential Equations. Theor. Comp. Sci., 408(1):4–16, 2008. [10] A. ISERLES. A First Course in the Numerical Analysis of Differential Equations. Cambridge University Press, 2nd ed., 2008. [11] E. HAIRER, S. NØRSETT, and G. WANNER. Solving Ordinary Differential Equations I: Nonstiff Problems. Of Springer Series in Computational Mathematics. Springer, 2008. [12] J. BUTCHER. Numerical Methods for Ordinary Differential Equations: Second Edition. Wiley, 2008. [13] C. RASMUSSEN and C. WILLIAMS. Gaussian Processes for Machine Learning. University Press Group Limited, 2006. [14] B. FORNBERG. Generation of Finite Difference Formulas on Arbitrarily Spaced Grids. Mathematics of Computation, 51(184):699–706, 1988. [15] E. BUCKWAR and R. WINKLER. Multistep Methods for SDEs and Their Application to Problems with Small Noise. SIAM J. Numer. Anal., 44(2):779–803, 2006. [16] L. O. CHUA. The Genesis of Chua’s Circuit. Archiv für Elektronik und Übertragungstechnik, 46(4):250– 257, 1992. [17] L. O. CHUA. Chua Circuit. Scholarpedia, 2(10):1488, 2007. [18] E. BILOTTA and P. PANTANO. A Gallery of Chua Attractors. World Scientific, 2008. KZ was partially supported by a grant from the Simons Foundation and by the Alan Turing Institute under the EPSRC grant EP/N510129/1. Part of this work was done during the author’s stay at the Newton Institute for the programme Stochastic Dynamical Systems in Biology: Numerical Methods and Applications. 8
2016
84
6,546
Computational and Statistical Tradeoffs in Learning to Rank Ashish Khetan and Sewoong Oh Department of ISE, University of Illinois at Urbana-Champaign Email: {khetan2,swoh}@illinois.edu Abstract For massive and heterogeneous modern data sets, it is of fundamental interest to provide guarantees on the accuracy of estimation when computational resources are limited. In the application of learning to rank, we provide a hierarchy of rankbreaking mechanisms ordered by the complexity in thus generated sketch of the data. This allows the number of data points collected to be gracefully traded off against computational resources available, while guaranteeing the desired level of accuracy. Theoretical guarantees on the proposed generalized rank-breaking implicitly provide such trade-offs, which can be explicitly characterized under certain canonical scenarios on the structure of the data. 1 Introduction In classical statistical inference, we are typically interested in characterizing how more data points improve the accuracy, with little restrictions or considerations on computational aspects of solving the inference problem. However, with massive growths of the amount of data available and also the complexity and heterogeneity of the collected data, computational resources, such as time and memory, are major bottlenecks in many modern applications. As a solution, recent advances in [7, 23, 8, 1, 16] introduce hierarchies of algorithmic solutions, ordered by the respective computational complexity, for several fundamental machine learning applications. Guided by sharp analyses on the sample complexity, these approaches provide theoretically sound guidelines that allow the analyst the flexibility to fall back to simpler algorithms to enjoy the full merit of the improved run-time. Inspired by these advances, we study the time-data tradeoff in learning to rank. In many applications such as election, policy making, polling, and recommendation systems, we want to aggregate individual preferences to produce a global ranking that best represents the collective social preference. Learning to rank is a rank aggregation approach, which assumes that the data comes from a parametric family of choice models, and learns the parameters that determine the global ranking. Traditionally, each revealed preference is assumed to have one of the following three structures. Pairwise comparison, where one item is preferred over another, is common in sports and chess matches. Best-out-of-κ comparison, where one is chosen among a set of κ alternatives, is common in historical purchase data. κ-way comparison, where we observe a linear ordering of a set of κ candidates, is used in some elections and surveys. For such traditional preferences, efficient schemes for learning to rank have been proposed, e.g. [12, 9]. However, modern data sets are unstructured and heterogeneous. This can lead to significant increase in the computational complexity, requiring exponential run-time in the size of the problem in the worst case [15]. To alleviate this computational challenge, we propose a hierarchy of estimators which we call generalized rank-breaking, ordered in increasing computational complexity and achieving increasing accuracy. The key idea is to break down the heterogeneous revealed preferences into simpler pieces of ordinal relations, and apply an estimator tailored for those simple structures treating each piece as independent. Several aspects of rank-breaking makes this problem interesting and challenging. A 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. priori, it is not clear which choices of the simple ordinal relations are rich enough to be statistically efficient and yet lead to tractable estimators. Even if we identify which ordinal relations to extract, the ignored correlations among those pieces can lead to an inconsistent estimate, unless we choose carefully which pieces to include and which to omit in the estimation. We further want sharp analysis on the sample complexity, which reveals how computational and statistical efficiencies trade off. We would like to address all these challenges in providing generalized rank-breaking methods. Problem formulation. We study the problem of aggregating ordinal data based on users’ preferences that are expressed in the form of partially ordered sets (poset). A poset is a collection of ordinal relations among items. For example, consider a poset {(i6 ≺{i5, i4}), (i5 ≺i3), ({i3, i4} ≺ {i1, i2})} over items {i1, . . . , i6}, where (i6 ≺{i5, i4}) indicates that item i5 and i4 are both preferred over item i6. Such a relation is extracted from, for example, the user giving a 2-star rating to i5 and i4 and a 1-star to i6. Assuming that the revealed preference is consistent, a poset can be represented as a directed acyclic graph (DAG) Gj as below. i1 i2 i3 i4 i5 i6 i1 i2 i3 i4 i5 i6 i1 i2 i3 i4 i5 i6 Gj e1 e2 Figure 1: An example of Gj for user j’s consistent poset, and two rank-breaking hyper edges extracted from it: e1 = ({i6, i5, i4, i3} ≺{i2, i1}) and e2 = ({i6} ≺{i5, i4, i3}). We assume that each user j is presented with a subset of items Sj, and independently provides her ordinal preference in the form of a poset, where the ordering is drawn from the Plackett-Luce (PL) model. The PL model is a popular choice model from operations research and psychology, used to model how people make choices under uncertainty. It is a special case of random utility models, where each item i is parametrized by a latent true utility θi ∈R. When offered with Sj, the user samples the perceived utility Ui for each item independently according to Ui = θi + Zi, where Zi’s are i.i.d. noise. In particular, the PL model assumes Zi’s follow the standard Gumbel distribution. Although statistical and computational tradeoff has been studied under Mallows models [6] or stochastically transitive models [22], the techniques we develop are different and have a potential to generalize to analyze more general class of random utility models. The observed poset is a partial observation of the ordering according to this perceived utilities. The particular choice of the Gumbel distribution has several merits, largely stemming from the fact that the Gumbel distribution has a log-concave pdf and is inherently memoryless. In our analyses, we use the log-concavity to show that our proposed algorithm is a concave maximization (Remark 2.1) and the memoryless property forms the basis of our rank-breaking idea. Precisely, the PL model is statistically equivalent to the following procedure. Consider a ranking as a mapping from a rank to an item, i.e. σj : [|Sj|] →Sj. It can be shown that the PL model is generated by first independently assigning each item i ∈Sj an unobserved value Yi, exponentially distributed with mean e−θi, and the resulting ranking σj is inversely ordered in Yi’s so that Yσj(1) ≤Yσj(2) ≤· · · ≤Yσj(|Sj|). This inherits the memoryless property of exponential variables, such that P(Y1 < Y2 < Y3) = P(Y1 < {Y2, Y3})P(Y2 < Y3), leading to a simple interpretation of the PL model as sequential choices: P(i3 ≺i2 ≺i1) = P({i3, i2} ≺i1)P(i3 ≺i2) = (eθi1 /(eθi1 +eθi2 +eθi3 ))×(eθi2 /(eθi2 + eθi3 )). In general, we have P[σj] = Q|Sj|−1 i=1 (e θ∗ σj (i))/(P|Sj| i′=i e θ∗ σj (i′)). We assume that the true utility θ∗∈Ωb where Ωb = {θ ∈Rd| P i∈[d] θi = 0, |θi| ≤b for all i ∈[d]}. Notice that centering of θ ensures its uniqueness as PL model is invariant under shifting of θ. The bound b on θi is written explicitly to capture the dependence in our main results. We denote a set of n users by [n] = {1, . . . , n} and the set of d items by [d]. Let Gj denote the DAG representation of the poset provided by the user j over Sj ⊆[d] according to the PL model with weights θ∗. The maximum likelihood estimate (MLE) maximizes the sum of all possible rankings 2 that are consistent with the observed Gj for each j: bθ ∈ arg max θ∈Ωb  n X j=1 log  X σ∈Gj Pθ[σ]  , (1) where we slightly abuse the notation Gj to denote the set of all rankings σ that are consistent with the observation. When Gj has a traditional structure as explained earlier in this section, then the optimization is a simple multinomial logit regression, that can be solved efficiently with off-the-shelf convex optimization tools [12]. For general posets, it can be shown that the above optimization is a concave maximization, using similar techniques as Remark 2.1. However, the summation over rankings in Gj can involve number of terms super exponential in the size |Sj|, in the worst case. This renders MLE intractable and impractical. Pairwise rank-breaking. A common remedy to this computational blow-up is to use rank-breaking. Rank-breaking traditionally refers to pairwise rank-breaking, where a bag of all the pairwise comparisons is extracted from observations {Gj}j∈[n] and is applied to estimators that are tailored for pairwise comparisons, treating each paired outcome as independent. This is one of the motivations behind the algorithmic advances in learning from pairwise comparisons [19, 21, 17]. It is computationally efficient to apply maximum likelihood estimator assuming independent pairwise comparisons, which takes O(d2) operations to evaluate. However, this computational gain comes at the cost of statistical efficiency. It is known from [4] that if we include all paired comparisons, then the resulting estimate can be statistically inconsistent due to the ignored correlations among the paired orderings, even with infinite samples. In the example from Figure 1, there are 12 paired relations: (i6 ≺i5), (i6 ≺i4), (i6 ≺i3), . . . , (i3 ≺i1), (i4 ≺i1). In order to get a consistent estimate, [4] provides a rule for choosing which pairs to include, and [15] provides an estimator that optimizes how to weigh each of those chosen pairs to get the best finite sample complexity bound. However, such a consistent pairwise rank-breaking results in throwing away many of the ordered relations, resulting in significant loss in accuracy. For example, none of the pairwise orderings can be used from Gj in the example, without making the estimator inconsistent [3]. Whether we include all paired comparisons or only a subset of consistent ones, there is a significant loss in accuracy as illustrated in Figure 2. For the precise condition for consistent rank-breaking we refer to [3, 4, 15]. The state-of-the-art approaches operate on either one of the two extreme points on the computational and statistical trade-off. The MLE in (1) requires O(P j∈[n] |Sj|!) summations to just evaluate the objective function, in the worst case. On the other hand, the pairwise rank-breaking requires only O(d2) summations, but suffers from significant loss in the sample complexity. Ideally, we would like to give the analyst the flexibility to choose a target computational complexity she is willing to tolerate, and provide an algorithm that achieves the optimal trade-off at any operating point. Contribution. We introduce a novel generalized rank-breaking that bridges the gap between MLE and pairwise rank-breaking. Our approach allows the user the freedom to choose the level of computational resources to be used, and provides an estimator tailored for the desired complexity. We prove that the proposed estimator is tractable and consistent, and provide an upper bound on the error rate in the finite sample regime. The analysis explicitly characterizes the dependence on the topology of the data. This in turn provides a guideline for designing surveys and experiments in practice, in order to maximize the sample efficiency. We provide numerical experiments confirming the theoretical guarantees. 2 Generalized rank-breaking Given Gj’s representing the users’ preferences, generalized rank-breaking extracts a set of ordered relations and applies an estimator treating each ordered relation as independent. Concretely, for each Gj, we first extract a maximal ordered partition Pj of Sj that is consistent with Gj. An ordered partition is a partition with a linear ordering among the subsets, e.g. Pj = ({i6} ≺{i5, i4, i3} ≺ {i2, i1}) for Gj from Figure 1. This is maximal, since we cannot further partition any of the subsets without creating artificial ordered relations that are not present in the original Gj. The extracted ordered partition is represented by a directed hypergraph Gj(Sj, Ej), which we call a rank-breaking graph. Each edge e = (B(e), T(e)) ∈Ej is a directed hyper edge from a subset of nodes B(e) ⊆Sj to another subset T(e) ⊆Sj. The number of edges in Ej is |Pj| −1 3 where |Pj| is the number of subsets in the partition. For each subset in Pj except for the least preferred subset, there is a corresponding edge whose top-set T(e) is the subset, and the bottom-set B(e) is the set of all items less preferred than T(e). In Figure 1, for Ej = {e1, e2} we show e1 = (B(e1), T(e1)) = ({i6, i5, i4, i3}, {i2, i1}) and e2 = (B(e2), T(e2) = ({i6}, {i5, i4, i3}) extracted from Gj. Denote the probability that T(e) is preferred over B(e) when T(e) ∪B(e) is offered as Pθ(e) = Pθ B(e) ≺T(e)  = X σ∈ΛT (e) exp P|T (e)| c=1 θσ(c)  Q|T (e)| u=1 P|T (e)| c′=u exp θσ(c′)  + P i∈B(e) exp (θi)  (2) which follows from the definition of the PL model, where ΛT (e) is the set of all rankings over T(e). The computational complexity of evaluating this probability is dominated by the size of the top-set |T(e)|, as it involves (|T(e)|!) summations. We let the analyst choose the order M ∈Z+ depending on how much computational resource is available, and only include those edges with |T(e)| ≤M in the following step. We apply the MLE for comparisons over paired subsets, assuming all rank-breaking graphs are independently drawn. Precisely, we propose order-M rank-breaking estimate, which is the solution that maximizes the log-likelihood under the independent assumption: bθ ∈ arg max θ∈Ωb LRB(θ) , where LRB(θ) = X j∈[n] X e∈Ej:|T (e)|≤M log Pθ(e) . (3) In a special case when M = 1, this can be transformed into the traditional pairwise rank-breaking, where (i) this is a concave maximization; (ii) the estimate is (asymptotically) unbiased and consistent [3, 4]; and (iii) and the finite sample complexity have been analyzed [15]. Although, this order-1 rank-breaking provides a significant gain in computational efficiency, the information contained in higher-order edges are unused, resulting in a significant loss in sample efficiency. We provide the analyst the freedom to choose the computational complexity he/she is willing to tolerate. However, for general M, it has not been known if the optimization in (3) is tractable and/or if the solution is consistent. Since Pθ(B(e) ≺T(e)) as explicitly written in (2) is a sum of log-concave functions, it is not clear if the sum is also log-concave. Due to the ignored dependency in the formulation (3), it is not clear if the resulting estimate is consistent. We first establish that it is a concave maximization in Remark 2.1, then prove consistency in Remark 2.2, and provide a sharp analysis of the performance in the finite sample regime, characterizing the trade-off between computation and sample size in Section 4. We use the Random Utility Model (RUM) interpretation of the PL model to prove concavity. We refer to Appendix A in the supplementary material for a proof. Remark 2.1. LRB(θ) is concave in θ ∈Rd. For consistency, we consider a simple but canonical scenario for sampling ordered relations. However, we study a general sampling scenario, when we analyze the order-M estimator in the finite sample regime in Section 4. Following is the canonical sampling scenario. There is a set of ˜ℓintegers ( ˜m1, . . . , ˜m˜ℓ) whose sum is strictly less than d. A new arriving user is presented with all d items and is asked to provide her top ˜m1 items as an unordered set, and then the next ˜m2 items, and so on. This is sampling from the PL model and observing an ordered partition with (˜ℓ+ 1) subsets of sizes ˜ma’s, and the last subset includes all remaining items. We apply the generalized rank-breaking to get rank-breaking graphs {Gj} with ˜ℓedges each, and order-M estimate is computed. We show that this is consistent, i.e. asymptotically unbiased in the limit of the number of users n. A proof is provided in the supplementary material. Remark 2.2. Under the PL model and the above sampling scenario, the order-M rank-breaking estimate bθ in (3) is consistent for all choices of M ≥mina∈˜ℓ˜ma. Figure 2 (left) illustrates the trade-off between run-time and sample size necessary to achieve a fixed accuracy: MSE≤0.3d2 × 10−6. In the middle panel, we show the accuracy-sample tradeoff for increasing computation M on the same data. We fix d = 256, ˜ℓ= 5, ˜ma = a for a ∈{1, 2, 3, 4, 5}, and sample posets from the canonical scenario, except that each user is presented κ = 32 random items. The PL weights are chosen i.i.d. U[−2, 2]. On the right panel, we let ˜ma = 3 for all a ∈[˜ℓ] and vary ˜ℓ. We compare GRB with M = 3 to PRB, and an oracle estimator who knows the exact ordering among those top three items and runs MLE. 4 200 600 100 1000 105 106 Time (s) sample size n M = 1 M = 2 M = 3 M = 4 M = 5 10-6 10-5 10-4 104 105 106 inconsistent PRB GRB order M = 1 2 3 4 C ∥bθ −θ∗∥2 2 sample size n 0.05 4 0.1 1 1 2 4 8 16 20 inconsistent PRB GRB order M=3 oracle lower bound CR lower bound number of edges |Ej| Figure 2: The time-data trade-off for fixed accuracy (left) and accuracy improvement for increased computation M (middle). Generalized Rank-Breaking (GRB) achieves the oracle lower bound and significantly improves upon Pairwise Rank-Breaking (PRB) (right). Notations. Given rank-breaking graphs {Gj(Sj, Ej)}j∈[n] extracted from the posets {Gj}, we first define the order M rank-breaking graphs {G(M) j (Sj, E(M) j )}, where E(M) j is a subset of Ej that includes only those edges ej ∈Ej with |T(ej)| ≤M. This represents those edges that are included in the estimation for a choice of M. For finite sample analysis, the following quantities capture how the error depends on the topology of the data collected. Let κj ≡|Sj| and ℓj ≡|E(M) j |. We index each edge ej in E(M) j by a ∈[ℓj] and define mj,a ≡|T(ej,a)| for the a-th edge of the j-th rank-breaking graph and rj,a ≡|T(ej,a)| + |B(ej,a)|. Note that, we use tilde in subscript with mj,a and ℓj when M is equal to Sj. That is ˜ℓj is the number of edges in Ej and ˜mj,a is the size of the top-sets in those edges. We let pj ≡P a∈[ℓj] mj,a denote the effective sample size for the observation G(M) j , such that the total effective sample size is P j∈[n] pj. Notice that although we do not explicitly write the dependence on M, all of the above quantities implicitly depend on the choice of M. 3 Comparison graph The analysis of the optimization in (3) shows that, with high probability, LRB(θ) is strictly concave with λ2(H(θ)) ≤−Cbγ1γ2γ3λ2(L) < 0 for all θ ∈Ωb (Lemma C.3), and the gradient is also bounded with ∥∇LRB(θ∗)∥≤C′ bγ−1/2 2 (P j pj log d)1/2 (Lemma C.2). the quantities γ1, γ2, γ3, and λ2(L), to be defined shortly, represent the topology of the data. This leads to Theorem 4.1: ∥bθ −θ∗∥2 ≤2∥∇LRB(θ∗)∥ −λ2(H(θ)) ≤C′′ b qP j pj log d γ1γ3/2 2 γ3λ2(L) , (4) where Cb, C′ b, and C′′ b are constants that only depend on b, and λ2(H(θ)) is the second largest eigenvalue of a negative semidefinite Hessian matrix H(θ) of LRB(θ). Recall that θ⊤1 = 0 since we restrict our search in Ωb. Hence, the error depends on λ2(H(θ)) instead of λ1(H(θ)) whose corresponding eigen vector is the all-ones vector. We define a comparison graph H([d], E) as a weighted undirected graph with weights Aii′ = P j∈[n]:i,i′∈Sj pj/(κj(κj −1)). The corresponding graph Laplacian is defined as: L ≡ n X j=1 pj κj(κj −1) X i<i′∈Sj (ei −ei′)(ei −ei′)⊤. (5) It is immediate that λ1(L) = 0 with 1 as the eigenvector. There are remaining d −1 eigenvalues that sum to Tr(L) = P j pj. The rescaled λ2(L) and λd(L) capture the dependency on the topology: α ≡λ2(L)(d −1) Tr(L) , β ≡ Tr(L) λd(L)(d −1) . (6) In an ideal case where the graph is well connected, then the spectral gap of the Laplacian is large. This ensures all eigenvalues are of the same order and α = β = Θ(1), resulting in a smaller error 5 rate. The concavity of LRB(θ) also depends on the following quantities. We discuss the role of the topology in Section 4. Note that the quantities defined in this section implicitly depend on the choice of M, which controls the necessary computational power, via the definition of the rank-breaking {Gj,a}. We define the following quantities that control our upper bound. γ1 incorporates asymmetry in probabilities of items being ranked at different positions depending upon their weight θ∗ i . It is 1 for b = 0 that is when all the items have same weight, and decreases exponentially with increase in b. γ2 controls the range of the size of the top-set with respect to the size of the bottom-set for which the error decays with the rate of 1/(size of the top-set). The dependence in γ3 and ν are due to weakness in the analysis, and ensures that the Hessian matrix is strictly negative definite. γ1 ≡ min j,a rj,a −mj,a κj 2e2b−2 , γ2 ≡min j,a rj,a −mj,a rj,a 2 , and (7) γ3 ≡1 −max j,a 4e16b γ1 m2 j,ar2 j,aκ2 j (rj,a −mj,a)5  , ν ≡ max j,a  mj,aκ2 j (rj,a −mj,a)2  . (8) 4 Main Results We present main theoretical analyses and numerical simulations confirming the theoretical predictions. 4.1 Upper bound on the achievable error We provide an upper bound on the error for the order-M rank-breaking approach, showing the explicit dependence on the topology of the data. We assume each user provides a partial ranking according to his/her ordered partitions. Precisely, we assume that the set of offerings Sj, the number of subsets (˜ℓj + 1), and their respective sizes ( ˜mj,1, . . . , ˜mj,˜ℓj) are predetermined. Each user randomly draws a ranking of items from the PL model, and provides the partial ranking of the form ({i6} ≺{i5, i4, i3} ≺{i2, i1}) in the example in Figure 1. For a choice of M, the order-M rank-breaking graph is extracted from this data. The following theorem provides an upper bound on the achieved error, and a proof is provided in the supplementary material. Theorem 4.1. Suppose there are n users, d items parametrized by θ∗∈Ωb, and each user j ∈[n] is presented with a set of offerings Sj ⊆[d] and provides a partial ordering under the PL model. For a choice of M ∈Z+, if γ3 > 0 and the effective sample size Pn j=1 pj is large enough such that n X j=1 pj ≥ 214e20bν2 (αγ1γ2γ3)2β pmax κmin d log d , (9) where b ≡maxi |θ∗ i | is the dynamic range, pmax = maxj∈[n] pj, κmin = minj∈[n] κj, α is the (rescaled) spectral gap, β is the (rescaled) spectral radius in (6), and γ1, γ2, γ3, and ν are defined in (7) and (8), then the generalized rank-breaking estimator in (3) achieves 1 √ d ∥bθ −θ∗∥ ≤ 40e7b αγ1γ3/2 2 γ3 s d log d Pn j=1 Pℓj a=1 mj,a , (10) with probability at least 1 −3e3d−3. Moreover, for M ≤3 the above bound holds with γ3 replaced by one, giving a tighter result. Note that the dependence on the choice of M is not explicit in the bound, but rather is implicit in the construction of the comparison graph and the number of effective samples N = P j P a∈[ℓj] mj,a. In an ideal case, b = O(1) and mj,a = O(r1/2 j,a ) for all (j, a) such that γ1, γ2 are finite. further, if the spectral gap is large such that α > 0 and β > 0, then Equation (10) implies that we need the effective sample size to scale as O(d log d), which is only a logarithmic factor larger than the number of parameters. In this ideal case, there exist universal constants C1, C2 such that if mj,a < C1√rj,a and rj,a > C2κj for all {j, a}, then the condition γ3 > 0 is met. Further, when rj,a = O(κj,a), max κj,a/κj′,a′ = O(1), and max pj,a/pj′,a′ = O(1), then condition on the effective sample size is met with P j pj = O(d log d). We believe that dependence in γ3 is weakness of our analysis and there is no dependence as long as mj,a < rj,a. 6 4.2 Lower bound on computationally unbounded estimators Recall that ˜ℓj ≡|Ej|, ˜mj,a = |T(ea)| and ˜rj,a = |T(ea) ∪B(ea)| when M = Sj. We prove a fundamental lower bound on the achievable error rate that holds for any unbiased estimator even with no restrictions on the computational complexity. For each (j, a), define ηj,a as ηj,a = ˜mj,a−1 X u=0  1 ˜rj,a −u + u( ˜mj,a −u) ˜mj,a(˜rj,a −u)2  + X u<u′∈[ ˜mj,a−1] 2u ˜mj,a(˜rj,a −u) ˜mj,a −u′ ˜rj,a −u′ (11) = ˜m2 j,a/(3˜rj,a) + O( ˜m3 j,a/˜r2 j,a) . (12) Theorem 4.2. Let U denote the set of all unbiased estimators of θ∗that are centered such that bθ1 = 0, and let µ = maxj∈[n],a∈[˜ℓj]{ ˜mj,a −ηj,a}. For all b > 0, inf bθ∈U sup θ∗∈Ωb E[∥bθ −θ∗∥2] ≥ max    (d −1)2 Pn j=1 P˜ℓj a=1( ˜mj,a −ηj,a) , 1 µ d X i=2 1 λi(L)   . (13) The proof relies on the Cramer-Rao bound and is provided in the supplementary material. Since ηj,a’s are non-negative, the mean squared error is lower bounded by (d −1)2/N, where N = P j P a∈˜ℓj ˜mj,a is the effective sample size. Comparing it to the upper bound in (10), this is tight up to a logarithmic factor when (a) the topology of the data is well-behaved such that all respective quantities are finite; and (b) there is no limit on the computational power and M can be made as large as we need. The bound in Eq. (13) further gives a tighter lower bound, capturing the dependency in ηj,a’s and λi(L)’s. Considering the first term, ηj,a is larger when ˜mj,a is close to ˜rj,a, giving a tighter bound. The second term in (13) implies we get a tighter bound when λ2(L) is smaller. 1 1 2 3 4 5 inconsistent PRB GRB order M=m oracle lower bound CR lower bound C ∥bθ −θ∗∥2 2 size of top-set m 1 1 2 3 4 5 inconsistent PRB GRB order M=m oracle lower bound CR lower bound size of top-set m 1 10 100 5 6 8 16 32 64 10 b=2 1 0.5 0.2 CR lower bound set-size κ Figure 3: Accuracy degrades as (κ −m) gets small and as the dynamic range b gets large. In Figure 3 left and middle panel, we compare performance of our algorithm with pairwise breaking, Cramer Rao lower bound and oracle MLE lower bound. We fix d = 512, n = 105, θ∗chosen i.i.d. uniformly over [−2, 2]. Oracle MLE knows relative ordering of items in all the top-sets T(e) and hence is strictly better than the GRB. We fix ˜ℓ= ℓ= 1 that is r = κ, and vary m . In the left panel, we fix κ = 32 and in the middle panel, we fix κ = 16. Perhaps surprisingly, GRB matches with the oracle MLE which means relative ordering of top-m items among themselves is statistically insignificant when m is sufficiently small in comparison to κ. For κ = 16, as m gets large, the error starts to increase as predicted by our analysis. The reason is that the quantities γ1 and γ2 gets smaller as m increases, and the upper bound increases consequently. In the right panel, we fix m = 4. When κ is small, γ2 is small, and hence error is large; when b is large γ1 is exponentially small, and hence error is significantly large. This is different from learning Mallows models, where peaked distributions are easier to learn [2], and is related to the fact that we are not only interested in recovering the (ordinal) ranking but also the (cardinal) weight. 4.3 Computational and statistical tradeoff For estimators with limited computational power, however, the above lower bound fails to capture the dependency on the allowed computational power. Understanding such fundamental trade-offs is a challenging problem, which has been studied only in a few special cases, e.g. planted clique problem 7 [10, 18]. This is outside the scope of this paper, and we instead investigate the trade-off achieved by the proposed rank-breaking approach. When we are limited on computational power, Theorem 4.1 implicitly captures this dependence when order-M rank-breaking is used. The dependence is captured indirectly via the resulting rank-breaking {Gj,a}j∈[n],a∈[ℓj] and the topology of it. We make this trade-off explicit by considering a simple but canonical example. Suppose θ∗∈Ωb with b = O(1). Each user gives an i.i.d. partial ranking, where all items are offered and the partial ranking is based on an ordered partition with ˜ℓj = ⌊ √ 2cd1/4⌋subsets. The top subset has size ˜mj,1 = 1, and the a-th subset has size ˜mj,a = a, up to a < ˜ℓj, in order to ensure that they sum at most to c √ d for sufficiently small positive constant c and the condition on γ3 > 0 is satisfied. The last subset includes all the remaining items in the bottom, ensuring ˜mj,˜ℓj ≥d/2 and γ1, γ2 and ν are all finite. Computation. For a choice of M such that M ≤ℓj −1, we consider the computational complexity in evaluating the gradient of LRB, which scales as TM = P j∈[n] P a∈[M](mj,a!)rj,a = O(M!×dn). Note that we find the MLE by solving a convex optimization problem using first order methods, and detailed analysis of the convergence rate and the complexity of solving general convex optimizations is outside the scope of this paper. Sample. Under the canonical setting, for M ≤ℓj−1, we have L = M(M+1)/(2d(d−1)) I−11⊤ . This complete graph has the largest possible spectral gap, and hence α > 0 and β > 0. Since the effective samples size is P j,a ˜mj,aI{ ˜mj,a ≤M} = nM(M + 1)/2, it follows from Theorem 4.1 that the (rescaled) root mean squared error is O( p (d log d)/(nM 2)). In order to achieve a target error rate of ε, we need to choose M = Ω((1/ε) p (d log d)/n). The resulting trade-off between run-time and sample to achieve root mean squared error ε is T(n) ∝(⌈(1/ε) p (d log d)/n⌉)!dn. We show numerical experiment under this canonical setting in Figure 2 (left) with d = 256 and M ∈{1, 2, 3, 4, 5}, illustrating the trade-off in practice. 4.4 Real-world data sets On sushi preferences [14] and jester dataset [11], we improve over pairwise breaking and achieves same performance as the oracle MLE. Full rankings over κ = 10 types of sushi are randomly chosen from d = 100 types of sushi are provided by n = 5000 individuals. As the ground truth θ∗, we use the ML estimate of PL weights over the entire data. In Figure 4, left panel, for each m ∈{3, 4, 5, 6, 7}, we remove the known ordering among the top-m and bottom-(10 −m) sushi in each set, and run our estimator with one breaking edge between top-m and bottom-(10 −m) items. We compare our algorithm with inconsistent pairwise breaking (using optimal choice of parameters from [15]) and the oracle MLE. For m ≤6, the proposed rank-breaking performs as well as an oracle who knows the hidden ranking among the top m items. Jester dataset consists of continuous ratings between −10 to +10 of 100 jokes on sets of size κ, 36 ≤κ ≤100, by 24, 983 users. We convert ratings into full rankings. The ground truth θ∗is computed similarly. For m ∈{2, 3, 4, 5}, we convert each full ranking into a poset that has ℓ= ⌊κ/m⌋partitions of size m, by removing known relative ordering from each partition. Figure 4 compares the three algorithms using all samples (middle panel), and by varying the sample size (right panel) for fixed m = 4. All figures are averaged over 50 instances. 1 10 3 4 5 6 7 inconsistent PRB GRB order M = m oracle lower bound C ∥bθ −θ∗∥2 2 size of top-set m 0.01 0.1 1 2 3 4 5 inconsistent PRB GRB order M = m oracle lower bound size of top-sets m 0.001 0.01 0.1 1000 10000 inconsistent PRB GRB order M = 4 oracle lower bound sample size n Figure 4: Generalized rank-breaking improves over pairwise RB and is close to oracle MLE. Acknowledgements This work is supported by NSF SaTC award CNS-1527754, and NSF CISE award CCF-1553452. 8 References [1] A. Agarwal, P. L. Bartlett, and J. C. Duchi. Oracle inequalities for computationally adaptive model selection. arXiv preprint arXiv:1208.0129, 2012. [2] A. Ali and M. Meil˘a. Experiments with kemeny ranking: What works when? Mathematical Social Sciences, 64(1):28–40, 2012. [3] H. Azari Soufiani, W. Chen, D. C Parkes, and L. Xia. Generalized method-of-moments for rank aggregation. In Advances in Neural Information Processing Systems 26, pages 2706–2714, 2013. [4] H. Azari Soufiani, D. Parkes, and L. Xia. Computing parametric ranking models via rank-breaking. In Proceedings of The 31st International Conference on Machine Learning, pages 360–368, 2014. [5] H. Azari Soufiani, D. C. Parkes, and L. Xia. Random utility theory for social choice. In NIPS, pages 126–134, 2012. [6] N. Betzler, R. Bredereck, and R. Niedermeier. Theoretical and empirical evaluation of data reduction for exact kemeny rank aggregation. Autonomous Agents and Multi-Agent Systems, 28(5):721–748, 2014. [7] O. Bousquet and L. Bottou. The tradeoffs of large scale learning. In Advances in neural information processing systems, pages 161–168, 2008. [8] V. Chandrasekaran and M. I. Jordan. Computational and statistical tradeoffs via convex relaxation. Proceedings of the National Academy of Sciences, 110(13):E1181–E1190, 2013. [9] Y. Chen and C. Suh. Spectral mle: Top-k rank aggregation from pairwise comparisons. arXiv:1504.07218, 2015. [10] Y. Deshpande and A. Montanari. Improved sum-of-squares lower bounds for hidden clique and hidden submatrix problems. arXiv preprint arXiv:1502.06590, 2015. [11] K. Goldberg, T. Roeder, D. Gupta, and C. Perkins. Eigentaste: A constant time collaborative filtering algorithm. Information Retrieval, 4(2):133–151, 2001. [12] B. Hajek, S. Oh, and J. Xu. Minimax-optimal inference from partial rankings. In Advances in Neural Information Processing Systems 27, pages 1475–1483, 2014. [13] T. P. Hayes. A large-deviation inequality for vector-valued martingales. Combinatorics, Probability and Computing, 2005. [14] T. Kamishima. Nantonac collaborative filtering: recommendation based on order responses. In Proceedings of the ninth ACM SIGKDD international conference on Knowledge discovery and data mining, pages 583–588. ACM, 2003. [15] A. Khetan and S. Oh. Data-driven rank breaking for efficient rank aggregation. In International Conference on Machine Learning, 2016. [16] M. Lucic, M. I. Ohannessian, A. Karbasi, and A. Krause. Tradeoffs for space, time, data and risk in unsupervised learning. In AISTATS, 2015. [17] L. Maystre and M. Grossglauser. Fast and accurate inference of plackett-luce models. In Advances in Neural Information Processing Systems 28 (NIPS 2015), 2015. [18] R. Meka, A. Potechin, and A. Wigderson. Sum-of-squares lower bounds for planted clique. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, pages 87–96. ACM, 2015. [19] S. Negahban, S. Oh, and D. Shah. Rank centrality: Ranking from pair-wise comparisons. preprint arXiv:1209.1688, 2014. [20] A. Prékopa. Logarithmic concave measures and related topics. In Stochastic programming, 1980. [21] N. B. Shah, S. Balakrishnan, J. Bradley, A. Parekh, K. Ramchandran, and M. J. Wainwright. Estimation from pairwise comparisons: Sharp minimax bounds with topology dependence. arXiv:1505.01462, 2015. [22] N. B. Shah, S. Balakrishnan, A. Guntuboyina, and M. J. Wainright. Stochastically transitive models for pairwise comparisons: Statistical and computational issues. arXiv preprint arXiv:1510.05610, 2015. [23] S. Shalev-Shwartz and N. Srebro. Svm optimization: inverse dependence on training set size. In Proceedings of the 25th international conference on Machine learning, pages 928–935. ACM, 2008. 9
2016
85
6,547
Split LBI: An Iterative Regularization Path with Structural Sparsity Chendi Huang1, Xinwei Sun1, Jiechao Xiong1, Yuan Yao2,1 1Peking University, 2Hong Kong University of Science and Technology {cdhuang, sxwxiaoxiaohehe, xiongjiechao}@pku.edu.cn, yuany@ust.hk Abstract An iterative regularization path with structural sparsity is proposed in this paper based on variable splitting and the Linearized Bregman Iteration, hence called Split LBI. Despite its simplicity, Split LBI outperforms the popular generalized Lasso in both theory and experiments. A theory of path consistency is presented that equipped with a proper early stopping, Split LBI may achieve model selection consistency under a family of Irrepresentable Conditions which can be weaker than the necessary and sufficient condition for generalized Lasso. Furthermore, some ℓ2 error bounds are also given at the minimax optimal rates. The utility and benefit of the algorithm are illustrated by applications on both traditional image denoising and a novel example on partial order ranking. 1 Introduction In this paper, consider the recovery from linear noisy measurements of β⋆∈Rp, which satisfies the following structural sparsity that the linear transformation γ⋆:= Dβ⋆for some D ∈Rm×p has most of its elements being zeros. For a design matrix X ∈Rn×p, let y = Xβ⋆+ ϵ, γ⋆= Dβ⋆(S = supp (γ⋆) , s = |S|) , (1.1) where ϵ ∈Rn has independent identically distributed components, each of which has a sub-Gaussian distribution with parameter σ2 (E[exp(tϵi)] ≤exp(σ2t2/2)). Here γ⋆is sparse, i.e. s ≪m. Given (y, X, D), the purpose is to estimate β⋆as well as γ⋆, and in particular, recovers the support of γ⋆. There is a large literature on this problem. Perhaps the most popular approach is the following ℓ1-penalized convex optimization problem, arg min β  1 2n ∥y −Xβ∥2 2 + λ ∥Dβ∥1  . (1.2) Such a problem can be at least traced back to [ROF92] as a total variation regularization for image denoising in applied mathematics; in statistics it is formally proposed by [Tib+05] as fused Lasso. As D = I it reduces to the well-known Lasso [Tib96] and different choices of D include many special cases, it is often called generalized Lasso [TT11] in statistics. Various algorithms are studied for solving (1.2) at fixed values of the tuning parameter λ, most of which is based on the Split Bregman or ADMM using operator splitting ideas (see for examples [GO09; YX11; Wah+12; RT14; Zhu15] and references therein). To avoid the difficulty in dealing with the structural sparsity in ∥Dβ∥1, these algorithms exploit an augmented variable γ to enforce sparsity while keeping it close to Dβ. On the other hand, regularization paths are crucial for model selection by computing estimators as functions of regularization parameters. For example, [Efr+04] studies the regularization path of standard Lasso with D = I, the algorithm in [Hoe10] computes the regularization path of fused 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Lasso, and the dual path algorithm in [TT11] can deal with generalized Lasso. Recently, [AT16] discussed various efficient implementations of the the algorithm in [TT11], and the related R package genlasso can be found in CRAN repository. All of these are based on homotopy method of solving convex optimization (1.2). Our departure here, instead of solving (1.2), is to look at an extremely simple yet novel iterative scheme which finds a new regularization path with structural sparsity. We are going to show that it works in a better way than genlasso, in both theory and experiments. To see this, define a loss function which splits Dβ and γ, ℓ(β, γ) := 1 2n ∥y −Xβ∥2 2 + 1 2ν ∥γ −Dβ∥2 2 (ν > 0). (1.3) Now consider the following iterative algorithm, βk+1 = βk −κα∇βℓ(βk, γk), (1.4a) zk+1 = zk −α∇γℓ(βk, γk), (1.4b) γk+1 = κ · prox∥·∥1(zk+1), (1.4c) where the initial choice z0 = γ0 = 0 ∈Rm, β0 = 0 ∈Rp, parameters κ > 0, α > 0, ν > 0, and the proximal map associated with a convex function h is defined by proxh(z) = arg minx ∥z − x∥2/2 + h(x), which is reduced to the shrinkage operator when h is taken to be the ℓ1-norm, prox∥·∥1(z) = S (z, 1) where S (z, λ) = sign(z) · max (|z| −λ, 0) (λ ≥0). In fact, without the sparsity enforcement (1.4c), the algorithm is called the Landweber Iteration in inverse problems [YRC07], also known as L2-Boost [BY02] in statistics. When D = I and ν →0 which enforces γ = Dβ = β, the iteration (1.4) is reduced (by dropping (1.4a)) to the popular Linearized Bregman Iteration (LBI) for linear regression or compressed sensing which is firstly proposed in [Yin+08]. The simple iterative scheme returns the whole regularization path, at the same cost of computing one Lasso estimator at a fixed regularization parameter using the iterative soft-thresholding algorithm. However, LBI regularization path could be better than Lasso regularization path which is always biased. In fact, recently [Osh+16] shows that under nearly the same conditions as standard Lasso, LBI may achieve sign-consistency but with a less biased estimator than Lasso, which in the limit dynamics will reach the bias-free Oracle estimator. The difference between (1.4) and the standard LBI lies in the partial sparsity control on γ, which splits the structural sparsity on Dβ into a sparse γ and Dβ by controlling their gap ∥γ −Dβ∥2/(2ν). Thereafter algorithm (1.4) is called Split LBI in this paper. Split LBI generates a sequence (βk, γk)k∈N which indeed defines a discrete regularization path. Furthermore, the path can be more accurate than that of generalized Lasso, in terms of Area Under Curve (AUC) measurement of the order of regularization paths becoming nonzero in consistent with the ground truth sparsity pattern. The following simple experiment illustrates these properties. Example 1. Consider two problems: standard Lasso and 1-D fused Lasso. In both cases, set n = p = 50, and generate X ∈Rn×p denoting n i.i.d. samples from N(0, Ip), ϵ ∼N(0, In), y = Xβ⋆+ ϵ. β⋆ j = 2 (if 1 ≤j ≤10), −2 (if 11 ≤j ≤15), and 0 (otherwise). For Lasso we choose D = I, and for 1-D fused Lasso we choose D = [D1; D2] ∈R(p−1+p)×p such that (D1β)j = βj −βj+1 (for 1 ≤j ≤p −1) and D2 = Ip. The left panel of Figure 1 shows the regularization paths by genlasso ({Dβλ}) and by iteration (1.4) (linear interpolation of {γk}) with κ = 200 and ν ∈{1, 5, 10}, respectively. The generalized Lasso path is in fact piecewise linear with respect to λ while we show it along t = 1/λ for a comparison. Note that the iterative paths exhibit a variety of different shapes depending on the choice of ν. However, in terms of order of those curves entering into nonzero range, these iterative paths exhibit a better accuracy than genlasso. Table 1 shows this by the mean AUC of 100 independent experiments in each case, where the increase of ν improves the model selection accuracy of Split LBI paths and beats that of generalized Lasso. Why does the simple iterative algorithm (1.4) work, even better than the generalized Lasso? In this paper, we aim to answer it by presenting a theory for model selection consistency of (1.4). Model selection and estimation consistency of generalized Lasso (1.2) has been studied in previous work. [SSR12] considered the model selection consistency of the edge Lasso, with a special D in 2 Figure 1: Left shows {Dβλ} (t = 1/λ) by genlasso and {γk} (t = kα) by Split LBI (1.4) with ν = 1, 5, 10, for 1-D fused Lasso. Right is a comparison between our family of Irrepresentable Condition (IRR(ν)) and IC in [Vai+13], with log-scale horizontal axis. As ν grows, IRR(ν) can be significantly smaller than IC0 and IC1, so that our model selection condition is easier to be met! Table 1: Mean AUC (with standard deviation) comparisons where Split LBI (1.4) beats genlasso. Left is for the standard Lasso. Right is for the 1-D fused Lasso in Example 1. genlasso Split LBI 1 5 10 .9426 .9845 .9969 .9982 (.0390) (.0185) (.0065) (.0043) genlasso Split LBI 1 5 10 .9705 .9955 .9996 .9998 (.0212) (.0056) (.0014) (.0009) (1.2), which has applications over graphs. [LYY13] provides an upper bound of estimation error by assuming the design matrix X is a Gaussian random matrix. In particular, [Vai+13] proposes a general condition called Identifiability Criterion (IC) for sign consistency. [LST13] establishes a general framework for model selection consistency for penalized M-estimators, proposing an Irrepresentable Condition which is equivalent to IC from [Vai+13] under the specific setting of (1.2). In fact both of these conditions are sufficient and necessary for structural sparse recovery by generalized Lasso (1.2) in a certain sense. However, as we shall see soon, the benefits of exploiting algorithm (1.4) not only lie in its algorithmic simplicity, but also provide a possibility of theoretical improvement on model selection consistency. Below a new family of Irrepresentable Condition depending on ν will be presented for iteration (1.4), under which model selection consistency can be established. Moreover, this family can be weaker than IC as the parameter ν grows, which sheds light on the superb performance of Split LBI we observed above. The main contributions of this paper can be summarized as follows: (A) a new iterative regularization path with structural sparsity by (1.4); (B) a theory of path consistency which shows the model selection consistency of (1.4), under some weaker conditions than generalized Lasso, together with ℓ2 error bounds at minimax optimal rates. Further experiments are given with applications on 2-D image reconstruction and partial order estimation. 1.1 Notation For matrix Q with m rows (D for example) and J ⊆{1, 2, . . . , m}, let QJ = QJ,· be the submatrix of Q with rows indexed by J. However, for Q ∈Rn×p (X for example) and J ⊆{1, 2, . . . , p}, let QJ = Q·,J be the submatrix of Q with columns indexed by J, abusing the notation. Sometimes we use ⟨a, b⟩:= aT b, denoting the inner product between vectors a, b. PL denotes the projection matrix onto a linear subspace L, Let L1 + L2 := {ξ1 + ξ2 : ξ ∈L1, ξ ∈L2} for subspaces L1, L2. For a matrix Q, let Q† denotes the Moore-Penrose pseudoinverse of Q, and we recall that Q† = (QT Q)†QT . Let λmin(Q), λmax(Q) denotes the smallest and largest singular value (i.e. eigenvalue if Q is symmetric) of Q. For symmetric matrices P and Q, Q ≻P (or Q ⪰P) means that Q −P is positive (semi)-definite, respectively. Let Q∗:= QT /n. 3 2 Path Consistency of Split LBI 2.1 Basic Assumptions For the identifiability of β⋆, we assume that β⋆and its estimators of interest are restricted in L := (ker(X) ∩ker(D))⊥= Im XT  + Im DT  , since replacing β⋆with “the projection of β⋆onto L” does not change the model. Note that ℓ(β, γ) is quadratic, and we can define its Hessian matrix which depends on ν > 0 H(ν) := ∇2ℓ(β, γ) ≡  X∗X + DT D/ν −DT /ν −D/ν Im/ν  . (2.1) We make the following assumptions on H. Assumption 1 (Restricted Strong Convexity (RSC)). There is a constant λH > 0 such that βT , γT S  · H(β,S),(β,S) ·  β γS  ≥λH  β γS  2 2 (β ∈L, γS ∈Rs) . (2.2) Remark 1. Since the true parameter supp(γ⋆) = supp(Dβ⋆) = S, it is equivalent to say that the loss ℓ(β, γ) is strongly convex when restricting on the sparse subspace corresponding to support of γ⋆. Assumption 2 (Irrepresentable Condition (IRR)). There is a constant η ∈(0, 1] such that sup ρ∈[−1,1]s HSc,(β,S)H† (β,S),(β,S) ·  0p ρ  ∞ ≤1 −η. (2.3) Remark 2. IRR here directly generalizes the Irrepresentable Condition from standard Lasso [ZY06] and other algorithms [Tro04], to the partial Lasso: minβ,γ(ℓ(β, γ) + λ∥γ∥1). Following the standard Lasso, one version of the Irrepresentable Condition should be HSc,(β,S)H† (β,S),(β,S)ρ⋆ (β,S) ∞≤1 −η, where ρ⋆ (β,S) =  0p ρ⋆ S  . ρ⋆ (β,S) is the value of gradient (subgradient) of ℓ1 penalty function ∥· ∥1 on (β⋆; γ⋆ S). Here ρ⋆ β = 0p, because β is not assumed to be sparse and hence is not penalized. Assumption 2 slightly strengthens this by a supremum over ρ, for uniform sparse recovery independent to a particular sign pattern of γ⋆. 2.2 Equivalent Conditions and a Comparison Theorem The assumptions above, though being natural, are not convenient to compare with that in [Vai+13]. Here we present some equivalent conditions, followed by a comparison theorem showing that IRR can be weaker than IC in [Vai+13], a necessary and sufficient for model selection consistency of generalized Lasso. First of all, we introduce some notations. Given γ, minimizing ℓsolves β = A†(νX∗y + DT γ), where A := νX∗X + DT D. Substituting A†(νX∗y + DT γk) for βk in (1.4b), and dropping (1.4a), we have zk+1 = zk + α(DA†X∗y −Σγk), (2.4a) γk+1 = κ · prox∥·∥1(zk+1), (2.4b) where Σ := I −DA†DT  /ν, A = νX∗X + DT D. (2.5) In other words, Σ is the Schur complement of Hβ,β in Hessian matrix H(ν). Comparing (2.4) with the standard LBI (D = I) studied in [Osh+16], we know that Σ in our paper plays the similar role of X∗X in their paper. In order to obtain path consistency results of standard LBI in [Osh+16], they propose “Restricted Strong Convexity” and “Irrpresentable Condition” on X∗X. So in this paper, we can obtain similar assumptions on Σ (instead of H), which actually prove to be equivalent with Assumption 1 and 2, and closely related to literature. Precisely, by Lemma 6 in Supplementary Information we know that Assumption 1 is equivalent to 4 Assumption 1′ (Restricted Strong convexity (RSC)). There is a constant λΣ > 0 such that ΣS,S ⪰λΣI. (2.6) Remark 3. Lemma 2 in Supplementary Information says ΣS,S ≻0 ⇔ker(DSc) ∩ker(X) ⊆ ker(DS), which is also a natural assumption for the uniqueness of β⋆. Actually, if it fails, then there will be some β such that DScβ = 0, Xβ = 0 while DSβ ̸= 0. Thus for any β′⋆:= β⋆+ β, we have y = Xβ′⋆+ ϵ, supp(Dβ′⋆) ⊆supp(Dβ⋆) = S, while DSβ′⋆̸= DSβ⋆. Therefore one can neither estimate β⋆nor DSβ⋆even if the support set is known or has been exactly recovered. When ΣS,S ≻0, Lemma 7 in Supplementary Information implies that Assumption 2 is equivalent to Assumption 2′ (Irrepresentable condition (IRR)). There is a constant η ∈(0, 1] such that ΣSc,SΣ−1 S,S ∞≤1 −η. (2.7) Remark 4. For standard Lasso problems (D = I), it is easy to derive Σ = X∗(1 + νXX∗)−1X ≈ X∗X when ν is small. So Assumption 1′ approximates the usual Restricted Strong Convexity assumption X∗ SXS ⪰λΣI and Assumption 2′ approximates the usual Irrepresentable Condition ∥X∗ ScXS(X∗ SXS)−1∥∞≤1 −η for standard Lasso problems. The left hand side of (2.7) depends on parameter ν. From now on, define IRR(ν) := ΣSc,SΣ−1 S,S ∞, IRR(0) := lim ν→0 IRR(ν), IRR(∞) := lim ν→+∞IRR(ν). (2.8) Now we are going to compare Assumption 2′ with the assumption in [Vai+13]. Let W be a matrix whose columns form an orthogonal basis of ker(DSc), and define ΩS :=  D† Sc T  X∗XW W T X∗XW † W T −I  DT S , IC0 := ΩS ∞, IC1 := min u∈ker(DT Sc) ΩSsign (DSβ⋆) −u ∞. [Vai+13] proved the sign consistency of the generalized Lasso estimator of (1.2) for specifically chosen λ, under the assumption IC1 < 1 along with ker(DSc) ∩ker(X) = {0}. As we shall see later, the same conclusion holds under the assumption IRR(ν) ≤1 −η along with Assumption 1′ which is equivalent to ker(DSc) ∩ker(X) ⊆ker(DS). Which assumption is weaker to be satisfied? The following theorem answers this, whose proof is in Supplementary Information. Theorem 1 (Comparisons between IRR in Assumption 2′ and IC in [Vai+13]). 1. IC0 ≥IC1. 2. IRR(0) exists, and IRR(0) = IC0. 3. IRR(∞) exists, and IRR(∞) = 0 if and only if ker(X) ⊆ker(DS). From this comparison theorem with a design matrix X of full column rank, as ν grows, IRR(ν) < IC1 ≤IC0, hence Assumption 2′ is weaker than IC. Now recall the setting of Example 1 where ker(X) = 0 generically. In the right panel of Figure 1, the (solid and dashed) horizontal red lines denote IC0, IC1, and we see the blue curve denoting IRR(ν) approaches IC0 when ν →0 and approaches 0 when ν →+∞, which illustrates Theorem 1 (here each of IC0, IC1, IRR(ν) is the mean of 100 values calculated under 100 generated X’s). Although IRR(0) = IC0 is slightly larger than IC1, IRR(ν) can be significantly smaller than IC1 if ν is not tiny. On the right side of the vertical line, IRR(ν) drops below 1, indicating that Assumption 2′ is satisfied while the assumption in [Vai+13] fails. Remark 5. Despite that Theorem 1 suggests to adopt a large ν, ν can not be arbitrarily large. From Assumption 1′ and the definition of Σ, 1/ν ≥∥Σ∥2 ≥∥ΣS,S∥2 ≥λΣ. So if ν is too large, λΣ has to be small enough, which will deteriorates the estimator in terms of ℓ2 error shown in the next. 2.3 Consistency of Split LBI We are ready to establish the theorems on path consistency of Split LBI (1.4), under Assumption 1 and 2. The proofs are based on a careful treatment of the limit dynamics of (1.4) and collected in Supplementary Information. Before stating the theorems, we need some definitions and constants. 5 Let the compact singular value decomposition (compact SVD) of D be D = UΛV T Λ ∈Rr×r, Λ ≻0, U ∈Rm×r, V ∈Rp×r , (2.9) and (V, ˜V ) be an orthogonal square matrix. Let the compact SVD of X ˜V /√n be X ˜V /√n = U1Λ1V T 1  Λ1 ∈Rr′×r′, Λ1 ≻0, U1 ∈Rn×r′, V1 ∈R(p−r)×r′ , (2.10) and let (V1, ˜V1) be an orthogonal square matrix. Let ΛX = p Λmax (X∗X), λD = λmin (Λ) , ΛD = Λmax (Λ) , λ1 = λmin (Λ1) . (2.11) We see ΛD is the largest singular value of D, λD is the smallest nonzero singular value of D, and λ2 1 is the smallest nonzero eigenvalue of ˜V T X∗X ˜V . If D has full column rank, then r = p, r′ = 0, and ˜V , U1, Λ1, V1, λ1 all drop, while ˜V1 ∈R(p−r)×(p−r) is an orthogonal square matrix. The following theorem says that under Assumption 1 and 2, Split LBI will automatically evolve in an “oracle” subspace (unknown to us) restricted within the support set of (β⋆, γ⋆) before leaving it, and if the signal parameters is strong enough, sign consistency will be reached. Moreover, ℓ2 error bounds on γk and βk are given. Theorem 2 (Consistency of Split LBI). Under Assumption 1 and 2, suppose κ is large enough to satisfy κ ≥4 η  1 + 1 λD + ΛX λ1λD   1 + s 2 (1 + νΛ2 X + Λ2 D) λHν   ·  (1 + ΛD) ∥β⋆∥2 + 2σ λH ΛX λD + ΛX λ2 D + λHλ2 D + Λ2 X λ1λ2 D  , (2.12) and κα∥H∥2 < 2. Let ¯τ := η 8σ · λD ΛX r n log m, K := j ¯τ α k , λ′ H := λH(1 −κα∥H∥2/2) > 0. Then with probability not less than 1 −6/m −3 exp(−4n/5), we have all the following properties. 1. No-false-positive: The solution has no false-positive, i.e. supp(γk) ⊆S, for 0 ≤kα ≤τ. 2. Sign consistency of γk: Once the signal is strong enough such that γ⋆ min := (DSβ⋆)min ≥ 16σ ηλ′ H (1 −5α/¯τ) · ΛXΛD λ2 D (2 log s + 5 + log(8ΛD)) r log m n , (2.13) then γk has sign consistency at K, i.e. sign (γK) = sign (Dβ⋆). 3. ℓ2 consistency of γk: ∥γK −Dβ⋆∥2 ≤ 42σ ηλ′ H (1 −α/¯τ) · ΛX λD r s log m n . 4. ℓ2 consistency of βk: ∥βK −β⋆∥2 ≤ 42σ ηλ′ H (1 −α/¯τ) · λ1ΛX(1 + λD) + Λ2 X λ1λ2 D r s log m n + 2σ λ1 r r′ log m n + ν · 2σ · λ1ΛX + Λ2 X λ1λ2 D . Despite that the sign consistency of γk can be established here, usually one can not expect Dβk recovers the sparsity pattern of γ⋆due to the variable splitting. As shown in the last term of ℓ2 error bound of βk, increasing ν will sacrifice its accuracy. However, one can remedy this by projecting βk on to a subspace using the support set of γk, and obtain a good estimator ˜βk with both sign consistency and ℓ2 consistency at the minimax optimal rates. 6 Theorem 3 (Consistency of revised version of Split LBI). Under Assumption 1 and 2, suppose κ is large enough to satisfy (2.12), and κα∥H∥2 < 2. ¯τ, K, λ′ H are defined the same as in Theorem 2. Define Sk := supp(γk), PSk := Pker  DSc k  = I −D† Sc kDSc k, ˜βk := PSkβk. If Sc k = ∅, define PSk = I. Then we have the following properties. 1. Sign consistency of ˜βk: If the γ⋆ min condition (2.13) holds, then with probability not less than 1 −8/m −3 exp(−4n/5), there holds sign(D ˜βK) = sign(Dβ⋆). 2. ℓ2 consistency of ˜βk: With probability not less than 1 −8/m −2r′/m2 −3 exp(−4n/5), we have that for 0 ≤kα ≤¯τ, ˜βk −β⋆ 2 ≤ 10√s λ′ Hkα + 2σ λ′ H · ΛXΛD λ3 D r s log m n ! + 2σ λ′ H ΛX λ2 D + λ′ Hλ2 D + Λ2 X λ1λ2 D  r r′ log m n + 2 D† Sc kDSc k∩Sβ⋆ 2 . Consequently, if additionally SK = S, then the last term on the right hand side drops for k = K, and it reaches ˜βK −β⋆ 2 ≤ 80σ ηλ′ H (1 −α/¯τ) · ΛX ΛD + λ2 D  λ3 D r s log m n + 2σ λ′ H ΛX λ2 D + λ′ Hλ2 D + Λ2 X λ1λ2 D  r r′ log m n . Remark 6. Note that r′ ≤min(n, p−r). In many real applications, r′ is very small. So the dominant ℓ2 error rate is O( p s log m/n), which is minimax optimal [LST13; LYY13]. 3 Experiments 3.1 Parameter Setting Parameter κ should be large enough according to (2.12). Moreover, step size α should be small enough to ensure the stability of Split LBI. When ν, κ are determined, α can actually be determined by α = ν/(κ(1 + νΛ2 X + Λ2 D)) (see (C.6) in Supplementary Information). 3.2 Application: Image Denoising Consider the image denoising problem in [TT11]. The original image is resized to 50 × 50, and reset with only four colors, as in the top left image in Figure 2. Some noise is added by randomly changing some pixels to be white, as in the bottom left. Let G = (V, E) is the 4-nearest-neighbor grid graph on pixels, then β = (βR, βG, βB) ∈R3|V | since there are 3 color channels (RGB channels). X = I3|V | and D = diag(DG, DG, DG), where DGδ ∈R|E|×|V | is the gradient operator on graph G defined by (DGx)(eij) = xi −xj, eij ∈E. Set ν = 180, κ = 100. The regularization path of Split LBI is shown in Figure 2, where as t evolves, images on the path gradually select visually salient features before picking up the random noise. Now compare the AUC (Area Under Curve) of genlasso and Split LBI algorithm with different ν. For simplicity we show the AUC corresponding to the red color channel. Here ν ∈{1, 20, 40, 60, . . . , 300}. As shown in the right panel of Figure 2, with the increase of ν, Split LBI beats genlasso with higher AUC values. 3.3 Application: Partial Order Ranking for Basketball Teams Here we consider a new application on the ranking of p = 12 FIBA basketball teams into partial orders. The teams are listed in Figure 3. We collected n = 134 pairwise comparison game results mainly from various important championship such as Olympic Games, FIBA World Championship 7 Original Figure t =9.3798 t =23.7812 Noisy Figure t =60.5532 t =617.1275 Figure 2: Left is image denoising results by Split LBI. Right shows the AUC of Split LBI (blue solid line) increases and exceeds that of genlasso (dashed red line) as ν increases. Figure 3: Partial order ranking for basketball teams. Top left: {βλ} (t = 1/λ) by genlasso and ˜βk (t = kα) by Split LBI. Top right: grouping result just passing t5. Bottom: FIBA ranking. and FIBA Basketball Championship in 5 continents from 2006–2014 (8 years is not too long for teams to keep relatively stable levels while not too short to have enough samples). For each sample indexed by k and corresponding team pair (i, j), yk = si −sj is the score difference between team i and j. We assume a model yk = β⋆ ik −β⋆ jk +ϵk where β⋆∈Rp measures the strength of these teams. So the design matrix X ∈Rn×p is defined by its k-th row: xk,ik = 1, xk,jk = −1, xk,l = 0 (l ̸= ik, jk). In sports, teams of similar strength often meet than those in different levels. Thus we hope to find a coarse grained partial order ranking by adding a structural sparsity on Dβ⋆where D = cX (c scales the smallest nonzero singular value of D to be 1). The top left panel of Figure 3 shows {βλ} by genlasso and ˜βk by Split LBI with ν = 1 and κ = 100. Both paths give the same partial order at early stages, though the Split LBI path looks qualitatively better. For example, the top right panel shows the same partial order after the change point t5. It is interesting to compare it against the FIBA ranking in September, 2014, shown in the bottom. Note that the average basketball level in Europe is higher than that of in Asia and Africa, hence China can get more FIBA points than Germany based on the dominant position in Asia, so is Angola in Africa. But their true levels might be lower than Germany, as indicated in our results. Moreover, America (FIBA points 1040.0) itself forms a group, agreeing with the common sense that it is much better than any other country. Spain, having much higher FIBA ranking points (705.0) than the 3rd team Argentina (455.0), also forms a group alone. It is the only team that can challenge America in recent years, and it enters both finals against America in 2008 and 2012. Acknowledgments The authors were supported in part by National Basic Research Program of China under grants 2012CB825501 and 2015CB856000, as well as NSFC grants 61071157 and 11421110001. 8 References [AT16] Taylor B. Arnold and Ryan J. Tibshirani. “Efficient Implementations of the Generalized Lasso Dual Path Algorithm”. In: Journal of Computational and Graphical Statistics 25.1 (2016), pp. 1–27. [BY02] Peter Bühlmann and Bin Yu. “Boosting with the L2-Loss: Regression and Classification”. In: Journal of American Statistical Association 98 (2002), pp. 324–340. [Efr+04] B. Efron, T. Hastie, I. Johnstone, and R. Tibshirani. “Least angle regression”. In: The Annals of statistics 32.2 (2004), pp. 407–499. [GO09] Tom Goldstein and Stanley Osher. “Split Bregman method for large scale fused Lasso”. In: SIAM Journal on Imaging Sciences 2.2 (2009), pp. 323–343. [Hoe10] Holger Hoefling. “A Path Algorithm for the Fused Lasso Signal Approximator”. In: Journal of Computational and Graphical Statistics 19.4 (2010), pp. 984–1006. [LST13] Jason D Lee, Yuekai Sun, and Jonathan E Taylor. “On model selection consistency of penalized M-estimators: a geometric theory”. In: Advances in Neural Information Processing Systems (NIPS) 26. 2013, pp. 342–350. [LYY13] Ji Liu, Lei Yuan, and Jieping Ye. “Guaranteed Sparse Recovery under Linear Transformation”. In: Proceedings of The 30th International Conference on Machine Learning. 2013, pp. 91–99. [Moe12] Michael Moeller. “Multiscale Methods for Polyhedral Regularizations and Applications in High Dimensional Imaging”. PhD thesis. Germany: University of Muenster, 2012. [Osh+16] Stanley Osher, Feng Ruan, Jiechao Xiong, Yuan Yao, and Wotao Yin. “Sparse recovery via differential inclusions”. In: Applied and Computational Harmonic Analysis (2016). DOI: 10. 1016/j.acha.2016.01.002. [ROF92] Leonid I. Rudin, Stanley Osher, and Emad Fatemi. “Nonlinear Total Variation Based Noise Removal Algorithms”. In: Physica D: Nonlinear Phenomena 60.1-4 (Nov. 1992), pp. 259–268. [RT14] Aaditya Ramdas and Ryan J. Tibshirani. “Fast and Flexible ADMM Algorithms for Trend Filtering”. In: Journal of Computational and Graphical Statistics (2014). DOI: 10.1080/10618600. 2015.1054033. [SSR12] James Sharpnack, Aarti Singh, and Alessandro Rinaldo. “Sparsistency of the edge lasso over graphs”. In: International Conference on Artificial Intelligence and Statistics. 2012, pp. 1028– 1036. [Tib+05] Robert Tibshirani, Michael Saunders, Saharon Rosset, Ji Zhu, and Keith Knight. “Sparsity and smoothness via the fused lasso”. In: Journal of the Royal Statistical Society Series B (2005), pp. 91–108. [Tib96] Robert Tibshirani. “Regression shrinkage and selection via the lasso”. In: Journal of the Royal Statistical Society. Series B (Methodological) (1996), pp. 267–288. [Tro04] Joel A. Tropp. “Greed is good: Algorithmic results for sparse approximation”. In: IEEE Trans. Inform. Theory 50.10 (2004), pp. 2231–2242. [TT11] Ryan J. Tibshirani and Jonathan Taylor. “The solution path of the generalized lasso”. In: The Annals of Statistics 39.3 (June 2011), pp. 1335–1371. [Vai+13] S. Vaiter, G. Peyre, C. Dossal, and J. Fadili. “Robust Sparse Analysis Regularization”. In: IEEE Transactions on Information Theory 59.4 (Apr. 2013), pp. 2001–2016. [Wah+12] Bo Wahlberg, Stephen Boyd, Mariette Annergren, and Yang Wang. “An ADMM Algorithm for a Class of Total Variation Regularized Estimation Problems”. In: IFAC Proceedings Volumes. 16th IFAC Symposium on System Identification 45.16 (2012), pp. 83–88. [Yin+08] Wotao Yin, Stanley Osher, Jerome Darbon, and Donald Goldfarb. “Bregman Iterative Algorithms for Compressed Sensing and Related Problems”. In: SIAM Journal on Imaging Sciences 1.1 (2008), pp. 143–168. [YRC07] Yuan Yao, Lorenzo Rosasco, and Andrea Caponnetto. “On Early Stopping in Gradient Descent Learning”. In: Constructive Approximation 26.2 (2007), pp. 289–315. [YX11] Gui-Bo Ye and Xiaohui Xie. “Split Bregman method for large scale fused Lasso”. In: Computational Statistics & Data Analysis 55.4 (2011), pp. 1552–1569. [Zha06] Fuzhen Zhang. The Schur Complement and Its Applications. Springer Science & Business Media, 2006. 308 pp. ISBN: 978-0-387-24273-6. [Zhu15] Yunzhang Zhu. “An augmented ADMM algorithm with application to the generalized lasso problem”. In: Journal of Computational and Graphical Statistics (2015). DOI: 10.1080/10618600. 2015.1114491. [ZY06] Peng Zhao and Bin Yu. “On Model Selection Consistency of Lasso”. In: Journal of Machine Learning Research 7 (2006), pp. 2541–2567. 9
2016
86
6,548
Incremental Variational Sparse Gaussian Process Regression Ching-An Cheng Institute for Robotics and Intelligent Machines Georgia Institute of Technology Atlanta, GA 30332 cacheng@gatech.edu Byron Boots Institute for Robotics and Intelligent Machines Georgia Institute of Technology Atlanta, GA 30332 bboots@cc.gatech.edu Abstract Recent work on scaling up Gaussian process regression (GPR) to large datasets has primarily focused on sparse GPR, which leverages a small set of basis functions to approximate the full Gaussian process during inference. However, the majority of these approaches are batch methods that operate on the entire training dataset at once, precluding the use of datasets that are streaming or too large to fit into memory. Although previous work has considered incrementally solving variational sparse GPR, most algorithms fail to update the basis functions and therefore perform suboptimally. We propose a novel incremental learning algorithm for variational sparse GPR based on stochastic mirror ascent of probability densities in reproducing kernel Hilbert space. This new formulation allows our algorithm to update basis functions online in accordance with the manifold structure of probability densities for fast convergence. We conduct several experiments and show that our proposed approach achieves better empirical performance in terms of prediction error than the recent state-of-the-art incremental solutions to variational sparse GPR. 1 Introduction Gaussian processes (GPs) are nonparametric statistical models widely used for probabilistic reasoning about functions. Gaussian process regression (GPR) can be used to infer the distribution of a latent function f from data. The merit of GPR is that it finds the maximum a posteriori estimate of the function while providing the profile of the remaining uncertainty. However, GPR also has drawbacks: like most nonparametric learning techniques the time and space complexity of GPR scale polynomially with the amount of training data. Given N observations, inference of GPR involves inverting an N ×N covariance matrix which requires O(N 3) operations and O(N 2) storage. Therefore, GPR for large N is infeasible in practice. Sparse Gaussian process regression is a pragmatic solution that trades accuracy against computational complexity. Instead of parameterizing the posterior using all N observations, the idea is to approximate the full GP using the statistics of finite M ≪N function values and leverage the induced low-rank structure to reduce the complexity to O(M 2N + M 3) and the memory to O(M 2). Often sparse GPRs are expressed in terms of the distribution of f(˜xi), where ˜X = {˜xi ∈X}M i=1 are called inducing points or pseudo-inputs [21, 23, 18, 26]. A more general representation leverages the information about the inducing function (Lif)(˜xi) defined by indirect measurement of f through a bounded linear operator Li (e.g. integral) to more compactly capture the full GP [27, 8]. In this work, we embrace the general notion of inducing functions, which trivially includes f(˜xi) by choosing Li to be identity. With abuse of notation, we reuse the term inducing points ˜X to denote the parameters that define the inducing functions. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Learning a sparse GP representation in regression can be summarized as inference of the hyperparameters, the inducing points, and the statistics of inducing functions. One approach to learning is to treat all of the parameters as hyperparameters and find the solution that maximizes the marginal likelihood [21, 23, 18]. An alternative approach is to view the inducing points and the statistics of inducing functions as variational parameters of a class of full GPs, to approximate the true posterior of f, and solve the problem via variational inference, which has been shown robust to over-fitting [26, 1]. All of the above methods are designed for the batch setting, where all of the data is collected in advance and used at once. However, if the training dataset is extremely large or the data are streaming and encountered in sequence, we may want to incrementally update the approximate posterior of the latent function f. Early work by Csató and Opper [6] proposed an online version of GPR, which greedily performs moment matching of the true posterior given one sample instead of the posterior of all samples. More recently, several attempts have been made to modify variational batch algorithms to incremental algorithms for learning sparse GPs [1, 9, 10]. Most of these methods rely on the fact that variational sparse GPR with fixed inducing points and hyperparameters is equivalent to inference of the conjugate exponential family: Hensman et al. [9] propose a stochastic approximation of the variational sparse GPR problem [26] based on stochastic natural gradient ascent [11]; Hoang et al. [10] generalizes this approach to the case with general Gaussian process priors. Unlike the original variational algorithm for sparse GPR [26], which finds the optimal inducing points and hyperparameters, these algorithms only update the statistics of the inducing functions f ˜ X. In this paper, we propose an incremental learning algorithm for variational sparse GPR, which we denote as iVSGPR. Leveraging the dual formulation of variational sparse GPR in reproducing kernel Hilbert space (RKHS), iVSGPR performs stochastic mirror ascent in the space of probability densities [17] to update the approximate posterior of f, and stochastic gradient ascent to update the hyperparameters. Stochastic mirror ascent, similar to stochastic natural gradient ascent, considers the manifold structure of probability functions and therefore converges faster than the naive gradient approach. In each iteration, iVSGPR solves a variational sparse GPR problem of the size of a minibatch. As a result, iVSGPR has constant complexity per iteration and can learn all the hyperparameters, the inducing points, and the associated statistics online. 2 Background In this section, we provide a brief summary of Gaussian process regression and sparse Gaussian process regression for efficient inference before proceeding to introduce our incremental algorithm for variational sparse Gaussian process regression in Section 3. 2.1 Gaussian Processes Regression Let F be a family of real-valued continuous functions f : X 7→R. A GP is a distribution of functions f in F such that, for any finite set X ⊂X, {f(x)|x ∈X} is Gaussian distributed N(f(x)|m(x), k(x, x′)): for any x, x′ ∈X, m(x) and k(x, x′) represent the mean of f(x) and the covariance between f(x) and f(x′), respectively. In shorthand, we write f ∼GP(m, k). The mean m(x) and the covariance k(x, x′) (the kernel function) are often parametrized by a set of hyperparameters which encode our prior belief of the unknown function f. In this work, for simplicity, we assume that m(x) = 0 and the kernel can be parameterized as k(x, x′) = ρ2gs(x, x′), where gs(x, x′) is a positive definite kernel, ρ2 is a scaling factor and s denotes other hyperparameters [20]. The objective of GPR is to infer the posterior probability of the function f given data D = {(xi, yi)}N i=1. In learning, the function value f(xi) is treated as a latent variable and the observation yi = f(xi) + ϵi is modeled as the function corrupted by i.i.d. noise ϵi ∼N(ϵ|0, σ2). Let X = {xi}N i=1. The posterior probability distribution p(f|y) can be compactly summarized as GP(m|D, k|D): m|D(x) = kx,X(KX + σ2I)−1y (1) k|D(x, x′) = kx,x′ −kx,X(KX + σ2I)−1kX,x′ (2) where y = (yi)N i=1 ∈RN, kx,X ∈R1×N denotes the vector of the cross-covariance between x and X, and KX ∈RN×N denotes the empirical covariance matrix of the training set. The hyperparameters 2 θ := (s, ρ, σ) in the GP are learned by maximizing the log-likelihood of the observation y max θ log p(y) = max θ log N(y|0, KX + σ2I). (3) 2.2 Sparse Gaussian Processes Regression A straightforward approach to sparse GPR is to approximate the GP prior of interest with a degenerate GP [21, 23, 18]. Formally, for any xi, xj ∈X, it assumes that f(xi) ⊥yi|f ˜ X, f(xi) ⊥f(xj)|f ˜ X, (4) where f ˜ X denotes ((Lif)(˜xi))M i=1 and ⊥denotes probabilistic independence between two random variables. That is, the original empirical covariance matrix KX is replaced by a rank-M approximation ˆKX := KX, ˜ XK−1 ˜ X K ˜ X,X, where K ˜ X is the covariance of f ˜ X and KX, ˜ X ∈RN×M is the cross-covariance between fX and f ˜ X. Let Λ ∈RN×N be diagonal. The inducing points ˜X are treated as hyperparameters and can be found by jointly maximizing the log-likelihood with θ max θ, ˜ X log N(y|0, ˆKX + σ2I + Λ), (5) Several approaches to sparse GPR can be viewed as special cases of this problem [18]: the Deterministic Training Conditional (DTC) [21] approximation sets Λ as zero. To heal the degeneracy in p(fX), the Fully Independent Training Conditional (FITC) approximation [23] includes heteroscedastic noise, setting Λ = diag(KX −ˆKX). As a result, their sum Λ + ˆKX matches the true covariance KX in the diagonal term. This general maximum likelihood scheme for finding the inducing points is adopted with variations in [24, 27, 8, 2]. A major drawback of all of these approaches is that they can over-fit due to the high degrees-of-freedom ˜X in the prior parametrization [26]. Variational sparse GPR can alternatively be formulated to approximate the posterior of the latent function by a full GP parameterized by the inducing points and the statistics of inducing functions [1, 26]. Specifically, Titsias [26] proposes to use q(fX, f ˜ X) = p(fX|f ˜ X)q(f ˜ X) (6) to approximate p(fX, f ˜ X|y), where q(f ˜ X) = N(f ˜ X| ˜m, ˜S) is the Gaussian approximation of p(f ˜ X|y) and p(fX|f ˜ X) = N(fX|KX, ˜ XK−1 ˜ X f ˜ X, KX −ˆKX) is the conditional probability in the full GP. The novelty here is that q(fX, f ˜ X), despite parametrization by finite parameters, is still a full GP, which, unlike its predecessor [21], can be infinite-dimensional. The inference problem of variational sparse GPR is solved by minimizing the KL-divergence KL[q(fX, f ˜ X)||p(fX, f ˜ X|y)]. In practice, the minimization problem is transformed into the maximization of the lower bound of the log-likelihood [26]: max θ log p(y) ≥max θ, ˜ X, ˜m, ˜S Z q(fX, f ˜ X) log p(y|fX)p(fX|f ˜ X)p(f ˜ X) q(fX, f ˜ X) dfXdf ˜ X = max θ, ˜ X, ˜m, ˜S Z p(fX|f ˜ X)q(f ˜ X) log p(y|fX)p(f ˜ X) q(f ˜ X) dfXdf ˜ X = max θ, ˜ X log N(y|0, ˆKX + σ2I) − 1 2σ2 Tr(KX −ˆKX). (7) The last equality results from exact maximization over ˜m and ˜S; for treatment of non-conjugate likelihoods, see [22]. We note that q(f ˜ X) is a function of ˜m and ˜S, whereas p(f ˜ X) and p(fX|f ˜ X) are functions of ˜X. As a result, ˜X become variational parameters that can be optimized without over-fitting. Compared with (5), the variational approach in (7) regularizes the learning with penalty Tr(KX −ˆKX) and therefore exhibits better generalization performance. Several subsequent works employ similar strategies: Alvarez et al. [3] adopt the same variational approach in the multi-output regression setting with scaled basis functions, and Abdel-Gawad et al. [1] use expectation propagation to solve for the approximate posterior under the same factorization. 3 3 Incremental Variational Sparse Gaussian Process Regression Despite leveraging sparsity, the batch solution to the variational objective in (7) requires O(M 2N) operations and access to all of the training data during each optimization step [26], which means that learning from large datasets is still infeasible. Recently, several attempts have been made to incrementally solve the variational sparse GPR problem in order to learn better models from large datasets [1, 9, 10]. The key idea is to rewrite (7) explicitly into the sum of individual observations: max θ, ˜ X, ˜m, ˜S Z p(fX|f ˜ X)q(f ˜ X) log p(y|fX)p(f ˜ X) q(f ˜ X) dfXdf ˜ X = max θ, ˜ X, ˜m, ˜S Z q(f ˜ X) N X i=1 Ep(fxi|f ˜ X)[log p(yi|fxi)] + log p(f ˜ X) q(f ˜ X) ! df ˜ X. (8) The objective function in (8), with fixed ˜X, is identical to the problem of stochastic variational inference [11] of conjugate exponential families. Hensman et al. [9] exploit this idea to incrementally update the statistics ˜m and ˜S via stochastic natural gradient ascent,1 which, at the tth iteration, takes the direction derived from the limit of maximizing (8) subject to KLsym(qt(f ˜ X)||qt−1(f ˜ X)) < ϵ as ϵ →0. Natural gradient ascent considers the manifold structure of probability distribution derived from KL divergence and is known to be Fisher efficient [4]. Although the optimal inducing points ˜X, like the statistics ˜m and ˜S, should be updated given new observations, it is difficult to design natural gradient ascent for learning the inducing points ˜X online. Because p(fX|f ˜ X) in (8) depends on all the observations, evaluating the divergence with respect to p(fX|f ˜ X)q(f ˜ X) over iterations becomes infeasible. We propose a novel approach to incremental variational sparse GPR, iVSGPR, that works by reformulating (7) in its RKHS dual form. This avoids the issue of the posterior approximation p(fX|f ˜ X)q(f ˜ X) referring to all observations. As a result, we can perform stochastic approximation of (7) while monitoring the KL divergence between the posterior approximates due to the change of ˜m, ˜S, and ˜X across iterations. Specifically, we use stochastic mirror ascent [17] in the space of probability densities in RKHS, which was recently proven to be as efficient as stochastic natural gradient ascent [19]. In each iteration, iVSGPR solves a subproblem of fractional Bayesian inference, which we show can be formulated into a standard variational sparse GPR of the size of a minibatch in O(M 2Nm + M 3) operations, where Nm is the size of a minibatch. 3.1 Dual Representations of Gaussian Processes in RKHS An RKHS H is a Hilbert space of functions satisfying the reproducing property: ∃kx ∈H such that ∀f ∈H, f(x) = ⟨f, kx⟩H. In general, H can be infinite-dimensional and uniformly approximate continuous functions on a compact set [16]. To simplify the notation we write kT x f for ⟨f, kx⟩H, and f T Lg for ⟨f, Lg⟩, where f, g ∈H and L : H 7→H, even if H is infinite-dimensional. A Gaussian process GP(m, k) has a dual representation in an RKHS H [12]: there exists µ ∈H and a positive semi-definite linear operator Σ : H 7→H such that for any x, x′ ∈X, ∃φx, φx′ ∈H, m(x) = ρφT x µ, k(x, x′) = ρ2φT x Σφx′. (9) That is, the mean function has a realization µ in H, which is defined by the reproducing kernel ˜k(x, x′) = ρ2φT x φx′; the covariance function can be equivalently represented by a linear operator Σ. In shorthand, with abuse of notation, we write N(f|µ, Σ).2 Note that we do not assume the samples from GP(m, k) are in H. In the following, without loss of generality, we assume the GP prior considered in regression has µ = 0 and Σ = I. That is, m(x) = 0 and k(x, x′) = ρ2φT x φx′. 3.1.1 Subspace Parametrization of the Approximate Posterior The full GP posterior approximation p(fX|f ˜ X)q(f ˜ X) in (7) can be written equivalently in a subspace parametrization using {ψ˜xi ∈H|˜xi ∈˜X}M i=1: ˜µ = Ψ ˜ Xa, ˜Σ = I + Ψ ˜ XAΨT ˜ X, (10) 1Although ˜ X was fixed in their experiments, it can potentially be updated by stochastic gradient ascent. 2Because a GP can be infinite-dimensional, it cannot define a density but only a Gaussian measure. The notation N(f|µ, Σ) is used to indicate that the Gaussian measure can be defined, equivalently, by µ and Σ. 4 where a ∈RM, A ∈RM×M such that ˜Σ ⪰0, and Ψ ˜ X : RM 7→H is defined as Ψ ˜ Xa = PM i=1 aiψ˜xi. Suppose q(f ˜ X) = N(f ˜ X| ˜m, ˜S) and define ψ˜xi to satisfy ΨT ˜ X ˜µ = ˜m. By (10), ˜m = K ˜ Xa and ˜S = K ˜ X + K ˜ XAK ˜ X, which implies the relationship a = K−1 ˜ X ˜m, A = K−1 ˜ X ˜SK−1 ˜ X −K−1 ˜ X , (11) where the covariances related to the inducing functions are defined as K ˜ X = ΨT ˜ XΨ ˜ X and KX, ˜ X = ρΦT XΨ ˜ X. The sparse structure results in f(x) ∼GP(kx, ˜ XK−1 ˜ X ˜m, kx,x + kx, ˜ X(K−1 ˜ X ˜SK−1 ˜ X − K−1 ˜ X )k ˜ X,x), which is the same as R p(f(x)|f ˜ X)q(f ˜ X)df ˜ X, the posterior GP found in (7), where kx,x = k(x, x) and kx, ˜ X = ρφT x Ψ ˜ X. We note that the scaling factor ρ is associated with the evaluation of f(x), not the inducing functions f ˜ X. In addition, we distinguish the hyperparameter s (e.g. length scale) that controls the measurement basis φx from the parameters in inducing points ˜X. A subspace parametrization corresponds to a full GP if ˜Σ ≻0. More precisely, because (10) is completely determined by the statistics ˜m, ˜S, and the inducing points ˜X, the family of subspace parametrized GPs lie on a nonlinear submanifold in the space of all GPs (the degenerate GP in (4) is a special case if we allow I in (10) to be ignored). 3.1.2 Sparse Gaussian Processes Regression in RKHS We now reformulate the variational inference problem (7) in RKHS3. Following the previous section, the sparse GP structure on the posterior approximate q(fX, f ˜ X) in (6) has a corresponding dual representation in RKHS q(f) = N(f|˜µ, ˜Σ). Specially, q(f) and q(fX, f ˜ X) are related as follows: q(f) ∝p(fX|f ˜ X)q(f ˜ X)|K ˜ X|1/2|KX −ˆKX|1/2, (12) in which the determinant is due to the change of measure. The equality (12) allows us to rewrite (7) in terms of q(f) simply as max q(f) L(q(f)) = max q(f) Z q(f) log p(y|f)p(f) q(f) df, (13) or equivalently as minq(f) KL[q(f)||p(f|y)]. That is, the heuristically motivated variational problem (7) is indeed minimizing a proper KL-divergence between two Gaussian measures. A similar justification on (7) is given rigorously in [14] in terms of KL-divergence minimization between Gaussian processes, which can be viewed as a dual of our approach. Due to space limitations, the proofs of (12) and the equivalence between (7) and (13) can be found in the Appendix. The benefit of the formulation of (13) is that in its sampling form, max q(f) Z q(f) N X i=1 log p(yi|f) + log p(f) q(f) ! df, (14) the approximate posterior q(f) nicely summarizes all the variational parameters ˜X, ˜m, and ˜S without referring to the samples as in p(fX|f ˜ X)q(f ˜ X). Therefore, the KL-divergence of q(f) across iterations can be used to regulate online learning. 3.2 Incremental Learning Stochastic mirror ascent [17] considers (non-)Euclidean structure on variables induced by a Bregman divergence (or prox-function) [5] in convex optimization. We apply it to solve the variational inference problem in (14), because (14) is convex in the space of probabilities [17]. Here, we ignore the dependency of q(f) on f for simplicity. At the tth iteration, stochastic mirror ascent solves the subproblem qt+1 = arg max q γt Z ˆ∂L(qt, yt)q(f)df −KL[q||qt], (15) 3Here we assume the set X is finite and countable. This assumption suffices in learning and allows us to restrict H be the finite-dimensional span of ΦX. Rigorously, for infinite-dimensional H, the equivalence can be written in terms of Radon–Nikodym derivative between q(f)df and normal Gaussian measure, where q(f)df denotes a Gaussian measure that has an RKHS representation given as q(f) 5 where γt is the step size, ˆ∂L(qt, yt) is the sampled subgradient of L with respect to q when the observation is (xt, yt). The algorithm converges in O(t−1/2) if (15) is solved within numerical error ϵt such that P ϵt ∼O(P γ2 t ) [7]. The subproblem (15) is actually equivalent to sparse variational GP regression with a general Gaussian prior. By definition of L(q) in (14), (15) can be derived as qt+1 = arg max q γt Z q(f)  N log p(yt|f) + log p(f) qt(f)  df −KL[q||qt] = arg max q Z q(f) log p(yt|f)Nγtp(f)γtq1−γt t (f) q(f) df. (16) This equation is equivalent to (13) but with the prior modified to p(f)γtqt(f)1−γt and the likelihood modified to p(yi|f)Nγt. Because p(f) is an isotropic zero-mean Gaussian, p(f)γtqt(f)1−γt has the subspace parametrization expressed in the same basis functions as qt. Suppose qt has mean ˜µt and precision ˜Σ−1 t . Then p(f)γtqt(f)1−γt is equivalent to N(f|ˆµ, ˆΣ) up to a constant factor, where ˆµt = (1−γt)ˆΣt ˜Σ−1 t ˜µt and ˆΣ−1 t = (1−γt)˜Σ−1 t +γtI. By (10), ˜Σ−1 t = I −Ψ ˜ X(A−1 t +K ˜ X)−1Ψ ˜ X for some At, and therefore ˆΣ−1 t = I −(1 −γt)Ψ ˜ X(A−1 t + K ˜ X)−1Ψ ˜ X, which is expressed in the same basis. In addition, by (12), (16) can be further written in the form of (7) and therefore solved by a standard sparse variational GPR program with modified ˜m and ˜S (Please see Appendix for details). Although we derived the equations for a single observation, minibatchs can be used with the same convergence rate and reduced variance by changing the factor p(yt|f)Nγt to QNm i=1 p(yti|f) Nγt Nm . The hyperparameters θ = (s, ρ, σ) in the GP can be updated along with the variational parameters using stochastic gradient ascent along the gradient of R qt(f) log p(yt|f)p(f) qt(f) df. 3.3 Related Work The subproblem (16) is equivalent to first performing stochastic natural gradient ascent [11] of q(f) in (14) and then projecting the distribution back to the low-dimensional manifold specified by the subspace parametrization. At the tth iteration, define q′ t(f) := p(yt|f)Nγtp(f)γtqt(f)1−γt. Because a GP can be viewed as Gaussian measure in an infinite-dimensional RKHS, q′ t(f) (16) can be viewed as the result of taking natural stochastic gradient ascent with step size γt from qt(f). Then (16) becomes minq KL[q||q′ t] in order to project q′ t back to subspace parametrization specified by M basis functions. Therefore, (16) can also be viewed as performing stochastic natural gradient ascent with a KL divergence projection. From this perspective, we can see that if ˜X, which controls the inducing functions, are fixed in the subproblem (16), iVSGPR degenerates to the algorithm of Hensman et al. [9]. Recently, several researches have considered the manifold structure induced by KL divergence in Bayesian inference [7, 25, 13]. Theis and Hoffman [25] use trust regions to mitigate the sensitivity of stochastic variational inference to choices of hyperparameters and initialization. Let ξt be the size of the trust region. At the tth iteration, it solves the objective maxq L(q) −ξtKL[q||qt], which is the same as subproblem (16) if applied to (14). The difference is that in (16) γt is a decaying step sequence in stochastic mirror ascent, whereas ξt is manually selected. A similar formulation also appears in [13], where the part of L(q) non-convex to the variational parameters is linearized. Dai et al. [7] use particles or a kernel density estimator to approximate the posterior of ˜X in the setting with low-rank GP prior. By contrast, we follow Titsias’s variational approach [26] to adopt a full GP as the approximate posterior, and therefore avoid the difficulties in estimating the posterior of ˜X and focus on the approximate posterior q(f) related to the function values. The stochastic mirror ascent framework sheds light on the convergence condition of the algorithm. As pointed out in Dai et al. [7], the subproblem (15) can be solved up to ϵt accuracy as long as P ϵt is order O(P γ2 t ), where γt ∼O(1/ √ t) [17]. Also, Khan et al. [13] solves a linearized approximation of (15) in each step and reports satisfactory empirical results. Although variational sparse GPR (16) is a nonconvex optimization in ˜X and is often solved by nonlinear conjugate gradient ascent, empirically the objective function increases most significantly in the first few iterations. Therefore, based on the results in [7], we argue that in online learning (16) can be solved approximately by performing a small fixed number of line searches. 6 4 Experiments We compare our method iVSGPR with VSGPRsvi the state-of-the-art variational sparse GPR method based on stochastic variational inference [9], in which i.i.d. data are sampled from the training dataset to update the models. We consider a zero-mean GP prior generated by a squared-exponential with automatic relevance determination (SE-ARD) kernel [20] k(x, x′) = ρ2 QD d=1 exp( −(xd−x′ d)2 2s2 d ), where sd > 0 is the length scale of dimension d and D is the dimensionality of the input. For the inducing functions, we modified the multi-scale kernel in [27] to ψT x ψx′ = D Y i=d 2lx,dlx′,d l2 x,d + l2 x′,d !1/2 exp − D X d=1 ∥xd −x′ d∥2 l2 x,d + l2 x′,d ! , (17) where lx,d is the length-scale parameter. The definition (17) includes the SE-ARD kernel as a special case, which can be recovered by identifying ψx = φx and (lx,d)D d=1 = (sd)D d=1, and hence their cross covariance can be computed. In the following experiments, we set the number inducing functions to 512. All models were initialized with the same hyperparameters and inducing points: the hyperparameters were selected as the optimal ones in the batch variational sparse GPR [26] trained on subset of the training dataset of size 2048; the inducing points were initialized as random samples from the first minibatch. We chose the learning rate to be γt = (1 + √ t)−1, for stochastic mirror ascent to update the posterior approximation; the learning rate for the stochastic gradient ascent to update the hyperparameters is set to 10−4γt . We evaluate the models in terms of the normalized mean squared error (nMSE) on a held-out test set after 500 iterations. We performed experiments on three real-world robotic datasets datasets, kin40k4, SARCOS5, KUKA6, and three variations of iVSGPR: iVSGPR5, iVSGPR10, and iVSGPRada.7 For the kin40k and SARCOS datasets, we also implemented VSGPR∗ svi, which uses stochastic variational inference to update ˜m and ˜S but fixes hyperparameters and inducing points as the solution to the batch variational sparse GPR [26] with all of the training data. Because VSGPR∗ svi reflects the perfect scenario of performing stochastic approximation under the selected learning rate, we consider it as the optimal goal we want to approach. The experimental results of kin40k and SARCOS are summarized in Table 1a. In general, the adaptive scheme iVSGPRada performs the best, but we observe that even performing a small fixed number of iterations ( iVSGPR5, iVSGPR10) results in performance that is close to, if not better than VSGPR∗ svi. Possible explanations are that the change of objective function in gradient-based algorithms is dominant in the first few iterations and that the found inducing points and hyper-parameters have finite numerical resolution in batch optimization. For example, Figure 1a shows the change of test error over iterations in learning joint 2 of SARCOS dataset. For all methods, the convergence rate improves with a larger minibatch. In addition, from Figure 1b, we observe that the required number of steps iVSGPRada needed to solve (16) decays with the number of iterations; only a small number line searches is required after the first few iterations. Table 1b and Table 1c show the experimental results on two larger datasets. In the experiments, we mixed the offline and online partitions in the original KUKA dataset and then split 90% into training and 10% into testing datasets in order to create an online i.i.d. streaming scenario. We did not compare to VSGPR∗ svi on these datasets, since computing the inducing points and hyperparameters in batch is infeasible. As above, iVSGPRada stands out from other models, closely followed by iVSGPR10. We found that the difference between VSGPRsvi and iVSGPRs is much greater on these larger real-world benchmarks. Auxiliary experimental results illustrating convergence for all experiments summarized in Tables 1a, 1b, and 1c are included in the Appendix. 4kin40k: 10000 training data, 30000 testing data, 8 attributes [23] 5SARCOS: 44484 training data, 4449 testing data, 28 attributes. http://www.gaussianprocess.org/gpml/data/ 6KUKA1&KUKA2: 17560 offline data, 180360 online data, 28 attributes. [15] 7The number in the subscript denotes the number of function calls allowed in nonlinear conjugate gradient descent [20] to solve subproblems (16) and ada denotes (16) is solved until the relative function change is less than 10−5. 7 VSGPRsvi iVSGPR5 iVSGPR10 iVSGPRada VSGPR∗ svi kin40k 0.0959 0.0648 0.0608 0.0607 0.0535 SARCOS J1 0.0247 0.0228 0.0214 0.0210 0.0208 SARCOS J2 0.0193 0.0176 0.0159 0.0156 0.0156 SARCOS J3 0.0125 0.0112 0.0104 0.0103 0.0104 SARCOS J4 0.0048 0.0044 0.0040 0.0038 0.0039 SARCOS J5 0.0267 0.0243 0.0229 0.0226 0.0230 SARCOS J6 0.0300 0.0259 0.0235 0.0229 0.0230 SARCOS J7 0.0101 0.0090 0.0082 0.0081 0.0101 (a) kin40k and SARCOS VSGPRsvi iVSGPR5 iVSGPR10 iVSGPRada J1 0.1699 0.1455 0.1257 0.1176 J2 0.1530 0.1305 0.1221 0.1138 J3 0.1873 0.1554 0.1403 0.1252 J4 0.1376 0.1216 0.1151 0.1108 J5 0.1955 0.1668 0.1487 0.1398 J6 0.1766 0.1645 0.1573 0.1506 J7 0.1374 0.1357 0.1342 0.1333 (b) KUKA1 VSGPRsvi iVSGPR5 iVSGPR10 iVSGPRada J1 0.1737 0.1452 0.1284 0.1214 J2 0.1517 0.1312 0.1183 0.1081 J3 0.2108 0.1818 0.1652 0.1544 J4 0.1357 0.1171 0.1104 0.1046 J5 0.2082 0.1846 0.1697 0.1598 J6 0.1925 0.1890 0.1855 0.1809 J7 0.1329 0.1309 0.1287 0.1275 (c) KUKA2 Table 1: Testing error (nMSE) after 500 iterations. Nm = 2048; Ji denotes the ith joint. (a) Test error (b) Functions calls of iVSGPRada Figure 1: Online learning results of SARCOS joint 2. (a) nMSE evaluated on the held out test set; the dash lines and the solid lines denote the results with Nm = 512 and Nm = 2048, respectively. (b) Number of function calls used by iVSGPRada in solving (16) (A maximum of 100 calls is imposed ) 5 Conclusion We propose a stochastic approximation of variational sparse GPR [26], iVSGPR. By reformulating the variational inference in RKHS, the update of the statistics of the inducing functions and the inducing points can be unified as stochastic mirror ascent on probability densities to consider the manifold structure. In our experiments, iVSGPR shows better performance than the direct adoption of stochastic variational inference to solve variational sparse GPs. As iVSGPR executes a fixed number of operations for each minibatch, it is suitable for applications where training data is abundant, e.g. sensory data in robotics. In future work, we are interested in applying iVSGPR to extensions of sparse Gaussian processes such as GP-LVMs and dynamical system modeling. References [1] Ahmed H Abdel-Gawad, Thomas P Minka, et al. Sparse-posterior gaussian processes for general likelihoods. arXiv preprint arXiv:1203.3507, 2012. [2] Mauricio Alvarez and Neil D Lawrence. Sparse convolved gaussian processes for multi-output regression. In Advances in neural information processing systems, pages 57–64, 2009. [3] Mauricio A Alvarez, David Luengo, Michalis K Titsias, and Neil D Lawrence. Efficient multioutput gaussian processes through variational inducing kernels. In International Conference on Artificial Intelligence and Statistics, pages 25–32, 2010. 8 [4] Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998. [5] Arindam Banerjee, Srujana Merugu, Inderjit S Dhillon, and Joydeep Ghosh. Clustering with bregman divergences. The Journal of Machine Learning Research, 6:1705–1749, 2005. [6] Lehel Csató and Manfred Opper. Sparse on-line gaussian processes. Neural computation, 14(3):641–668, 2002. [7] Bo Dai, Niao He, Hanjun Dai, and Le Song. Scalable bayesian inference via particle mirror descent. arXiv preprint arXiv:1506.03101, 2015. [8] Anibal Figueiras-vidal and Miguel Lázaro-gredilla. Inter-domain gaussian processes for sparse inference using inducing features. In Advances in Neural Information Processing Systems, pages 1087–1095, 2009. [9] James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. arXiv preprint arXiv:1309.6835, 2013. [10] Trong Nghia Hoang, Quang Minh Hoang, and Kian Hsiang Low. A unifying framework of anytime sparse gaussian process regression models with stochastic variational inference for big data. In Proc. ICML, pages 569–578, 2015. [11] 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. [12] Irina Holmes and Ambar N Sengupta. The gaussian radon transform and machine learning. Infinite Dimensional Analysis, Quantum Probability and Related Topics, 18(03):1550019, 2015. [13] Mohammad E Khan, Pierre Baqué, François Fleuret, and Pascal Fua. Kullback-leibler proximal variational inference. In Advances in Neural Information Processing Systems, pages 3384–3392, 2015. [14] Alexander G de G Matthews, James Hensman, Richard E Turner, and Zoubin Ghahramani. On sparse variational methods and the kullback-leibler divergence between stochastic processes. In Proceedings of the Nineteenth International Conference on Artificial Intelligence and Statistics, 2016. [15] Franziska Meier, Philipp Hennig, and Stefan Schaal. Incremental local gaussian regression. In Advances in Neural Information Processing Systems, pages 972–980, 2014. [16] Charles A Micchelli, Yuesheng Xu, and Haizhang Zhang. Universal kernels. The Journal of Machine Learning Research, 7:2651–2667, 2006. [17] Arkadi Nemirovski, Anatoli Juditsky, Guanghui Lan, and Alexander Shapiro. Robust stochastic approximation approach to stochastic programming. SIAM Journal on Optimization, 19(4):1574–1609, 2009. [18] Joaquin Quiñonero-Candela and Carl Edward Rasmussen. A unifying view of sparse approximate gaussian process regression. The Journal of Machine Learning Research, 6:1939–1959, 2005. [19] Garvesh Raskutti and Sayan Mukherjee. The information geometry of mirror descent. Information Theory, IEEE Transactions on, 61(3):1451–1457, 2015. [20] Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian processes for machine learning. 2006. [21] Matthias Seeger, Christopher Williams, and Neil Lawrence. Fast forward selection to speed up sparse gaussian process regression. In Artificial Intelligence and Statistics 9, number EPFL-CONF-161318, 2003. [22] Rishit Sheth, Yuyang Wang, and Roni Khardon. Sparse variational inference for generalized gp models. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1302–1311, 2015. [23] Edward Snelson and Zoubin Ghahramani. Sparse gaussian processes using pseudo-inputs. In Advances in neural information processing systems, pages 1257–1264, 2005. [24] Edward Snelson and Zoubin Ghahramani. Local and global sparse gaussian process approximations. In International Conference on Artificial Intelligence and Statistics, pages 524–531, 2007. [25] Lucas Theis and Matthew D Hoffman. A trust-region method for stochastic variational inference with applications to streaming data. arXiv preprint arXiv:1505.07649, 2015. [26] Michalis K Titsias. Variational learning of inducing variables in sparse gaussian processes. In International Conference on Artificial Intelligence and Statistics, pages 567–574, 2009. [27] Christian Walder, Kwang In Kim, and Bernhard Schölkopf. Sparse multiscale gaussian process regression. In Proceedings of the 25th international conference on Machine learning, pages 1112–1119. ACM, 2008. 9
2016
87
6,549
Sublinear Time Orthogonal Tensor Decomposition∗ Zhao Song‡ David P. Woodruff† Huan Zhang⋆ ‡Dept. of Computer Science, University of Texas, Austin, USA †IBM Almaden Research Center, San Jose, USA ⋆Dept. of Electrical and Computer Engineering, University of California, Davis, USA zhaos@utexas.edu, dpwoodru@us.ibm.com, ecezhang@ucdavis.edu Abstract A recent work (Wang et. al., NIPS 2015) gives the fastest known algorithms for orthogonal tensor decomposition with provable guarantees. Their algorithm is based on computing sketches of the input tensor, which requires reading the entire input. We show in a number of cases one can achieve the same theoretical guarantees in sublinear time, i.e., even without reading most of the input tensor. Instead of using sketches to estimate inner products in tensor decomposition algorithms, we use importance sampling. To achieve sublinear time, we need to know the norms of tensor slices, and we show how to do this in a number of important cases. For symmetric tensors T = Pk i=1 λiu⊗p i with λi > 0 for all i, we estimate such norms in sublinear time whenever p is even. For the important case of p = 3 and small values of k, we can also estimate such norms. For asymmetric tensors sublinear time is not possible in general, but we show if the tensor slice norms are just slightly below ∥T ∥F then sublinear time is again possible. One of the main strengths of our work is empirical - in a number of cases our algorithm is orders of magnitude faster than existing methods with the same accuracy. 1 Introduction Tensors are a powerful tool for dealing with multi-modal and multi-relational data. In recommendation systems, often using more than two attributes can lead to better recommendations. This could occur, for example, in Groupon where one could look at users, activities, and time (season, time of day, weekday/weekend, etc.), as three attributes to base predictions on (see [13] for a discussion). Similar to low rank matrix approximation, we seek a tensor decomposition to succinctly store the tensor and to apply it quickly. A popular decomposition method is the canonical polyadic decomposition, i.e., the CANDECOMP/PARAFAC (CP) decomposition, where the tensor is decomposed into a sum of rank-1 components [9]. We refer the reader to [23], where applications of CP including data mining, computational neuroscience, and statistical learning for latent variable models are mentioned. A natural question, given the emergence of large data sets, is whether such decompositions can be performed quickly. There are a number of works on this topic [17, 16, 7, 11, 10, 4, 20]. Most related to ours are several recent works of Wang et al. [23] and Tung et al. [18], in which it is shown how to significantly speed up this decomposition for orthogonal tensor decomposition using the randomized technique of linear sketching [15]. In this work we also focus on orthogonal tensor decomposition. The idea in [23] is to create a succinct sketch of the input tensor, from which one can then perform implicit tensor decomposition by approximating inner products in existing decomposition methods. Existing methods, like the power method, involve computing the inner product of a vector, which is now a rank-1 matrix, with another vector, which is now a slice of a tensor. Such inner products can ∗Full version appears on arXiv, 2017. ‡Work done while visiting IBM Almaden. †Supported by XDATA DARPA Air Force Research Laboratory contract FA8750-12-C-0323. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. be approximated much faster by instead computing the inner product of the sketched vectors, which have significantly lower dimension. One can also replace the sketching with sampling to approximate inner products; we discuss some sampling schemes [17, 4] below and compare them to our work. 1.1 Our Contributions We show in a number of important cases, one can achieve the same theoretical guarantees in the work of Wang et al. [23] (which was applied later by Tung et al. [18]), in sublinear time, that is, without reading most of the input tensor. While previous work needs to walk through the input at least once to create a sketch, we show one can instead perform importance sampling of the tensor based on the current iterate, together with reading a few entries of the tensor which help us learn the norms of tensor slices. We use a version of ℓ2-sampling for our importance sampling. One source of speedup in our work and in Wang et al. [23] comes from approximating inner products in iterations in the robust tensor power method (see below). To estimate ⟨u, v⟩for n-dimensional vectors u and v, their work computes sketches S(u) and S(v) and approximates ⟨u, v⟩≈⟨S(u), S(v)⟩. Instead, if one has u, one can sample coordinates i proportional to u2 i , which is known as ℓ2-sampling [14, 8]. One estimates ⟨u, v⟩as vi∥u∥2 2 ui , which is unbiased and has variance O(∥u∥2 2∥v∥2 2). These guarantees are similar to those using sketching, though the constants are significantly smaller (see below), and unlike sketching, one does not need to read the entire tensor to perform such sampling. Symmetric Tensors: As in [23], we focus on orthogonal tensor decomposition of symmetric tensors, though we explain the extension to the asymmetric case below. Symmetric tensors arise in engineering applications, for example, to represent the symmetric tensor field of stress, strain, and anisotropic conductivity. Another example is diffusion MRI in which one uses symmetric tensors to describe diffusion in the brain or other parts of the body. In spectral methods symmetric tensors are exactly those that come up in Latent Dirichlet Allocation problems. Although one can symmetrize a tensor using simple matrix operations (see, e.g., [1]), we cannot do this in sublinear time. In orthogonal tensor decompostion of a symmetric matrix, there is an underlying n × n · · · n tensor T∗= Pk i=1 λiv⊗p i , and the input tensor is T = T∗+ E, where ∥E ∥2 ≤ϵ. We have λ1 > λ2 > · · · > λk > 0 and that {vi}k i=1 is a set of orthonormal vectors. The goal is to reconstruct approximations ˆvi to the vectors vi, and approximations ˆλi to the λi. Our results naturally generalize to tensors with different lengths in different dimensions. For simplicity, we first focus on order p = 3. In the robust tensor power method [1], one generates a random initial vector u, and performs T update steps ˆu = T(I, u, u)/∥T(I, u, u)∥2, where T(I, u, u) = h n X j=1 n X ℓ=1 T1,j,ℓujuℓ, n X j=1 n X ℓ=1 T2,j,ℓujuℓ, · · · , n X j=1 n X ℓ=1 Tn,j,ℓujuℓ i . The matrices T1,∗,∗, . . . , Tn,∗,∗are referred to as the slices. The vector ˆu typically converges to the top eigenvector in a small number of iterations, and one often chooses a small number L of random initial vectors to boost confidence. Successive eigenvectors can be found by deflation. The algorithm and analysis immediately extend to higher order tensors. We use ℓ2-sampling to estimate T(I, u, u). To achieve the same guarantees as in [23], for typical settings of parameters (constant k and several eigenvalue assumptions) naïvely one needs to take O(n2) ℓ2-samples from u for each slice in each iteration, resulting in Ω(n3) time and destroying our sublinearity. We observe that if we additionally knew the squared norms ∥T1,∗,∗∥2 F , . . . , ∥Tn,∗,∗∥2 F , then we could take O(n2) ℓ2-samples in total, where we take ∥Ti,∗,∗∥2 F ∥T ∥2 F · O(n2) ℓ2-samples from the i-th slice in expectation. Perhaps in some applications such norms are known or cheap to compute in a single pass, but without further assumptions, how can one obtain such norms in sublinear time? If T is a symmetric tensor, then Tj,j,j = Pk i=1 λiv3 i,j + Ej,j,j. Note that if there were no noise, then we could read off approximations to the slice norms, since ∥Tj,∗,∗∥2 F = Pk i=1 λ2 i v2 i,j, and so T2/3 j,j,j is an approximation to ∥Tj,∗,∗∥2 F up to factors depending on k and the eigenvalues. However, there is indeed noise. To obtain non-trivial guarantees, the robust tensor power method assumes ∥E ∥2 = O(1/n), where ∥E ∥2 = sup ∥u∥2=∥v∥2=∥w∥2=1 E(u, v, w) = sup ∥u∥2=∥v∥2=∥w∥2=1 n X i=1 n X j=1 n X k=1 Ei,j,k uivjwk, 2 which in particular implies | Ej,j,j | = O(1/n). This assumption comes from the Θ(1/√n)correlation of the random initial vector to v1. This noise bound does not trivialize the problem; indeed, Ej,j,j can be chosen adversarially subject to | Ej,j,j | = O(1/n), and if the vi were random unit vectors and the λi and k were constant, then Pk i=1 λiv3 i,j = O(1/n3/2), which is small enough to be completely masked by the noise Ej,j,j. Nevertheless, there is a lot of information about the slice norms. Indeed, suppose k = 1, λ1 = Θ(1), and ∥T ∥F = 1. Then Tj,j,j = Θ(v3 1,j) + Ej,j,j, and one can show ∥Tj,∗,∗∥2 F = λ2 1v2 1,j ± O(1/n). Again using that | Ej,j,j | = O(1/n), this implies ∥Tj,∗,∗∥2 F = ω(n−2/3) if and only if Tj,j,j = ω(1/n), and therefore one would notice this by reading Tj,j,j. There can only be o(n2/3) slices j for which ∥Tj,∗,∗∥2 F = ω(n−2/3), since ∥T ∥2 F = 1. Therefore, for each of them we can afford to take O(n2) ℓ2-samples and still have an O(n2+2/3) = o(n3) sublinear running time. The remaining slices all have ∥Tj,∗,∗∥2 F = O(n−2/3), and therefore if we also take O(n1/3) ℓ2-samples from every slice, we will also estimate the contribution to T(I, u, u) from these slices well. This is also a sublinear O(n2+1/3) number of samples. While the previous paragraph illustrates the idea for k = 1, for k = 2 we need to read more than the Tj,j,j entries to decide how many ℓ2-samples to take from a slice. The analysis is more complicated because of sign cancellations. Even for k = 2 we could have Tj,j,j = λ1v3 1,j + λ2v3 2,j + Ej,j,j, and if v1,j = −v2,j then we may not detect that ∥Tj,∗,∗∥2 F is large. We fix this by also reading the entries Ti,j,j, Tj,i,j, and Tj,j,i for every i and j. This is still only O(n2) entries and so we are still sublinear time. Without additional assumptions, we only give a formal analysis of this for k ∈{1, 2}. More importantly, if instead of third-order symmetric tensors we consider p-th order symmetric tensors for even p, we do not have such sign cancellations. In this case we do not have any restrictions on k for estimating slice norms. One does need to show after deflation, the slice norms can still be estimated; this holds because the eigenvectors and eigenvalues are estimated sufficiently well. We also give several per-iteration optimizations of our algorithm, based on careful implementations of generating a sorted list of random numbers and random permutations. We find empirically (see below) that we are much faster per iteration than previous sketching algorithms, in addition to not having to read the entire input tensor in a preprocessing step. Asymmetric Tensors: For asymmetric tensors, e.g., 3rd-order tensors of the form Pk i=1 λiui ⊗vi ⊗ wi, it is impossible to achieve sublinear time in general, since it is hard to distinguish T = ei⊗ej ⊗ek for random i, j, k ∈{1, 2, . . . , n} from T = 0⊗3. We make a necessary and sufficient assumption that all the entries of the ui are less than n−γ for an arbitrarily small constant γ > 0. In this case, all slice norms are o(n−γ) and by taking O(n2−γ) samples from each slice we achieve sublinear time. We can also apply such an assumption to symmetric tensors. Empirical Results: One of the main strengths of our work is our empirical results. In each iteration we approximate T(I, u, u) a total of B times independently and take the median to increase our confidence. In the notation of [23], B corresponds to the number of independent sketches used. While the median works empirically, there are some theoretical issues with it discussed in Remark 4. Also let b be the total number of ℓ2-samples we take per iteration, which corresponds to the sketch size in the notation of [23]. We found that empirically we can set B and b to be much smaller than that in [23] and achieve the same error guarantees. One explanation for this is that the variance bound we obtain via importance sampling is a factor of 43 = 64 smaller than in [23], and for p-th order tensors, a factor of 4p smaller. To give an idea of how much smaller we can set b and B, to achieve roughly the same squared residual norm error on the synthetic data sets of dimension 1200 for finding a good rank-1 approximation, the algorithm of [23] would need to set parameters b = 216 and B = 50, whereas we can set b = 10 × 1200 and B = 5. Our running time is 2.595 seconds and we have no preprocessing time, whereas the algorithm of [23] has a running time of 116.3 seconds and 55.34 seconds of preprocessing time. We refer the reader to Table 1 in Section 3. In total we are over 50 times faster. We also demonstrate our algorithm in a real-world application using real datasets, even when the datasets are sparse. Namely, we consider a spectral algorithm for Latent Dirichlet Allocation [1, 2] which uses tensor decomposition as its core computational step. We show a significant speedup can be achieved on tensors occurring in applications such as LDA, and we refer the reader to Table 2 in 3 Section 3. For example, on the wiki [23] dataset with a tensor dimension of 200, we run more than 5 times faster than the sketching-based method. Previous Sampling Algorithms: Previous sampling-based schemes of [17, 4] do not achieve our guarantees, because [17] uses uniform sampling, which does not work for tensors with spiky elements, while the non-uniform sampling in [4] requires touching all of the entries in the tensor and making two passes over it. Notation Let [n] denote {1, 2, . . . , n}. Let ⊗denote the outer product, and u⊗3 = u ⊗ u ⊗u. Let T ∈Rnp, where p is the order of tensor T and n is the dimension of tensor T. Let ⟨A, B⟩denote the entry-wise inner product between two tensors A, B ∈Rnp, e.g., ⟨A, B⟩= Pn i1=1 Pn i2=1 · · · Pn ip=1 Ai1,i2,··· ,ip · Bi1,i2,··· ,ip. For a tensor A ∈Rnp, ∥A ∥F = (Pn i1=1 Pn i2=1 · · · Pn ip=1 A2 i1,··· ,ip) 1 2 . For random variable X let E[X] denote its expectation of X and V[X] its variance (if these quantities exist). 2 Main Results We explain the details of our main results in this section. First, we state the importance sampling lemmas for our tensor application. Second, we explain how to quickly produce a list of random tuples according to a certain distribution needed by our algorithm. Third, we combine the first and the second parts to get a fast way of approximating tensor contractions, which are used as subroutines in each iteration of the robust tensor power method. We then provide our main theoretical results, and how to estimate the slice norms needed by our main algorithm. Importance sampling lemmas. Approximating an inner product is a simple application of importance sampling. Tensor contraction T(u, v, w) can be regarded as the inner product between two n3-dimensional vectors, and thus importance sampling can be applied. Lemma 1 suggests that we can take a few samples according to their importance, e.g., we can sample Ti,j,k uivjwk with probability |uivjwk|2/∥u∥2 2∥v∥2 2∥w∥2 2. As long as the number of samples is large enough, it will approximate the true tensor contraction P i P j P k Ti,j,k uivjwk with small variance after a final rescaling. Lemma 1. Suppose random variable X = Ti,j,k uivjwk/(piqjrk) with probability piqjrk where pi = |ui|2/∥u∥2 2, qj = |vj|2/∥v∥2 2, and rk = |wk|2/∥w∥2 2, and we take L i.i.d. samples of X, denoted X1, X2, · · · , XL. Let Y = 1 L PL ℓ=1 Xℓ. Then (1) E[Y ] = ⟨T, u ⊗v ⊗w⟩, and (2) V[Y ] ≤1 L∥T ∥2 F · ∥u ⊗v ⊗w∥2 F . Similarly, we also have importance sampling for each slice Ti,∗,∗, i.e., “face” of T. Lemma 2. For all i ∈[n], suppose random variable Xi = Ti,j,k vjwk/(qjrk) with probability qjrk, where qj = |vj|2/∥v∥2 2 and rk = |wk|2/∥w∥2 2, and we take Li i.i.d. samples of Xi, say Xi 1, Xi 2, · · · , Xi Li. Let Y i = 1 Li PL ℓ=1 Xi ℓ. Then (1) E[Y i] = ⟨Ti,∗,∗, v ⊗w⟩and (2) V[Y i] ≤ 1 Li ∥Ti,∗,∗∥2 F ∥v ⊗w∥2 F . Generating importance samples in linear time. We need an efficient way to sample indices of a vector based on their importance. We view this problem as follows: imagine [0, 1] is divided into z “bins” with different lengths corresponding to the probability of selecting each bin, where z is the number of indices in a probability vector. We generate m random numbers uniformly from [0, 1] and see which bin each random number belongs to. If a random number is in bin i, we sample the i-th index of a vector. There are known algorithms [6, 19] to solve this problem in O(z + m) time. We give an alternative algorithm GENRANDTUPLES. Our algorithm combines Bentley and Saxe’s algorithm [3] for efficiently generating m sorted random numbers in O(m) time, and Knuth’s shuffling algorithm [12] for generating a random permutation of [m] in O(m) time. We use the notation CUMPROB(v, w) and CUMPROB(u, v, w) for the algorithm creating the distributions on Rn2 and Rn3 of Lemma 2 and Lemma 1, respectively. We note that naïvely applying previous algorithms would require z = O(n2) and z = O(n3) time to form these two distributions, but we can take O(m) samples from them implicitly in O(n + m) time. Fast approximate tensor contractions. We propose a fast way to approximately compute tensor contractions T(I, v, w) and T(u, v, w) with a sublinear number of samples of T, as shown in Alogrithm 1 and Algorithm 2. Naïvely computing tensor contractions using all of the entries of T gives an exact answer but could take n3 time. Also, to keep our algorithm sublinear time, we never explicitly compute the deflated tensor; rather we represent it implicitly and sample from it. 4 Algorithm 1 Subroutine for approximate tensor contraction T(I, v, w) 1: function APPROXTIVW(T, v, w, n, B, {bbi}) 2: eq, er ←CUMPROB(v, w) 3: for d = 1 →B do 4: L ←GENRANDTUPLES(Pn i=1 bbi, eq, er) 5: for i = 1 →n do 6: s(d) i ←0 7: for ℓ= 1 →bbi do 8: (j, k) ←L(i−1)b+ℓ 9: s(d) i ←s(d) i + 1 qjrk Ti,j,k ·uj · uk 10: bT(I, v, w)i ←median d∈[B] s(d) i /bbi, ∀i ∈[n] 11: return bT(I, v, w) Algorithm 2 Subroutine for approximate tensor contraction T(u, v, w) 1: function APPROXTUVW(T, u, v, w, n, B,bb) 2: ep, eq, er ←CUMPROB(u, v, w) 3: for d = 1 →B do 4: L ←GENRANDTUPLES(bb, ep, eq, er). 5: s(d) ←0 6: for (i, j, k) ∈L do 7: s(d) ←s(d) + 1 piqjrk Ti,j,k ·ui · uj · uk 8: s(d) ←s(d)/bb 9: bT(u, v, w) ←median d∈[B] s(d) 10: return bT(u, v, w) The following theorem gives the error bounds of APPROXTIVW and APPROXTUVW (in Algorithm 1 and 2). Let bbi be the number samples we take from slice i ∈[n] in APPROXTIVW, and let bb denote the total number of samples in our algorithm. Theorem 3. For T ∈Rn×n×n and u ∈Rn with ∥u∥2 = 1, define the number ε1,T(u) = bT(u, u, u) −T(u, u, u) and the vector ε2,T(u) = bT(I, u, u) −T(I, u, u). For any b > 0, if bbi ≳b∥Ti,∗,∗∥2 F /∥T ∥2 F then the following bounds hold 1: E[|ε1,T(u)|2] = O(∥T ∥2 F /b), and E[∥ε2,T(u)∥2 2] = O(n∥T ∥2 F /b). In addition, for any fixed ω ∈Rn with ∥ω∥2 = 1, E[⟨ω, ε2,T (u)⟩2] = O(∥T ∥2 F /b). (1) Eq. (1) can be obtained by observing that each random variable [ε2,T(u)]i is independent and so V[⟨ω, ε2,T(u)⟩] = Pn i=1 ω2 i ∥Ti,∗,∗∥2 F bbi ≲(Pn i=1 ω2 i ) ∥T ∥2 F b = ∥T ∥2 F b . Remark 4. In [23], the coordinate-wise median of B estimates to the T(I, v, w) is used to boost the success probability. There appears to be a gap [21] in their argument as it is unclear how to achieve (1) after taking a coordinate-wise median, which is (7) in Theorem 1 of [23]. To fix this, we instead pay a factor proportional to the number of iterations in Algorithm 3 in the sample complexity bb. Since we have expectation bounds on the quantities in Theorem 3, we can apply a Markov bound and a union bound across all iterations. This suffices for our main theorem concerning sublinear time below. One can obtain high probability bounds by running Algorithm 3 multiple times independently, and taking coordinate-wise medians of the output eigenvectors. Empirically, our algorithm works even if we take the median in each iteration, which is done in line 10 in Algorithm 1. Replacing Theorem 1 in [23] by our Theorem 3, the rest of the analysis in [23] is unchanged. Our Algorithm 3 is the same as the sketching-based robust tensor power method in [23], except for lines 10, 12, 15, and 17, where the sketching-based approximate tensor contraction is replaced by our importance sampling procedures APPROXTUVW and APPROXTIVW. Rather than use Theorem 2 of Wang et al. [23], the main theorem concerning the correctness of the robust tensor decomposition algorithm, we use a recent improvement of it by Wang and Anandkumar in Theorems 4.1 and 4.2 of [22], which states general guarantees for any algorithm satisfying per iteration noise guarantees. These theorems also remove many of the earlier eigenvalue assumptions in Theorem 2 of [23]. Theorem 5. (Theorem 4.1 and 4.2 of [22]), Suppose T = T∗+ E, where T = Pk i=1 λiv⊗3 i with λi > 0 and orthonormal basis vectors {v1, . . . , vk} ⊆Rn, n ≥k. Let λmax, λmin be the largest and smallest values in {λi}k i=1 and {bλi, bvi}k i=1 be outputs of the robust tensor power method. There exist absolute constants K0, C0, C1, C2, C3 > 0 such that if E satisfies ∥E(I, u(τ) t , u(τ) t )∥2 ≤ϵ, | E(vi, u(τ) t , u(τ) t )| ≤min{ϵ/ √ k, C0λmin/n}, (2) 1For two functions f, g, we use the shorthand f ≲g (resp. ≳) to indicate that f ≤Cg (resp. ≥) for some absolute constant C. 5 Algorithm 3 Our main algorithm 1: function IMPORTANCESAMPLINGRB(T, n, B, b) 2: if si are known, where ∥Ti,∗,∗∥2 F ≲si then 3: bbi ←b · si/∥T ∥2 F , ∀i ∈[n] 4: else 5: bbi ←b/n, ∀i ∈[n] 6: bb = Pn i=1 bbi 7: for ℓ= 1 →L do 8: u(ℓ) ←INITIALIZATION 9: for t = 1 →T do 10: u(ℓ) ←APPROXTIVW(T, u(ℓ), u(ℓ), n, B, {bbi}) 11: u(ℓ) ←u(ℓ)/∥u(ℓ)∥2 12: λ(ℓ) ←APPROXTUVW(T, u(ℓ), u(ℓ), u(ℓ), n, B,bb) 13: ℓ∗←arg maxℓ∈[L] λ(ℓ), u∗←u(ℓ∗) 14: for t = 1 →T do 15: u∗←APPROXTIVW(T, u∗, u∗, n, B, {bbi}) 16: u∗←u∗/∥u∗∥2 17: λ∗←APPROXTUVW(T, u∗, u∗, u∗, n, B,bb) 18: return λ∗, u∗ 200 400 600 800 1000 1200 tensor dimension n 0 20 40 60 80 100 Running time (seconds) Sketching Sampling without pre-scanning Sampling with pre-scanning (a) Sketching v.s. importance sampling 200 400 600 800 1000 1200 tensor dimension n 0 20 40 60 80 Preprocessing time (seconds) Sketching Sampling without pre-scanning Sampling with pre-scanning (b) Preprocessing time Figure 1: Running time with growing dimension for all i ∈[k], t ∈[T], and τ ∈[L] and furthermore ϵ ≤C1 · λmin/ √ k, T = Ω(log(λmaxn/ϵ)), L ≥max{K0, k} log(max{K0, k}), then with probability at least 9/10, there exists a permutation π : [k] →[k] such that |λi −bλπ(i)| ≤C2ϵ, ∥vi −bvπ(i)∥2 ≤C3ϵ/λi, ∀i = 1, · · · , k. Combining the previous theorem with our importance sampling analysis, we obtain: Theorem 6 (Main). Assume the notation of Theorem 5. For each j ∈[k], suppose we take bb(j) = Pn i=1 bb(j) i samples during the power iterations for recovering bλj and bvj, the number of samples for slice i is bb(j) i ≳bkT∥[T −Pj−1 l=1 bλlbv⊗3 l ]i,∗,∗∥2 F /∥T −Pj−1 l=1 bλlbv⊗3 l ∥2 F where b ≳n∥T ∥2 F /ϵ2 + ∥T ∥2 F / min{ϵ/ √ k, λmin/n}2. Then the output guarantees of Theorem 5 hold for Algorithm 3 with constant probability. Our total time is O(LTk2bb) and the space is O(nk), where bb = maxj∈[k] bb(j). In Theorem 3, if we require bbi = b∥Ti,∗,∗∥2 F /∥T ∥2 F , we need to scan the entire tensor to compute ∥Ti,∗,∗∥2 F , making our algorithm not sublinear. With the following mild assumption in Theorem 7, our algorithm is sublinear when sampling uniformly (bbi = b/n) without computing ∥Ti,∗,∗∥2 F : Theorem 7 (Bounded slice norm). There is a constant α > 0, a constant β ∈(0, 1] and a sufficiently small constant γ > 0, such that, for any 3rd order tensor T = T∗+ E ∈Rn3 with rank(T∗) ≤nγ, λk ≥1/nγ, if ∥Ti,∗,∗∥2 F ≤ 1 nβ ∥T ∥2 F for all i ∈[n], and E satisfies (2), then Algorithm 3 runs in O(n3−α) time. The condition β ∈(0, 1] is a practical one. When β = 1, all tensor slices have equal Frobenius norm. The case β = 0 only occurs when ∥Ti,∗,∗∥F = ∥T ∥F ; i.e., all except one slice is zero. This theorem can also be applied to asymmetric tensors, since the analysis in [23] can be extended to them. For certain cases, we can remove the bounded slice norm assumption. The idea is to take a sublinear number of samples from the tensor to obtain upper bounds on all slice norms. In the full version, we extend the algorithm and analysis of the robust tensor power method to p > 3 by replacing contractions T(u, v, w) and T(I, v, w) with T(u1, u2, · · · , up) and T(I, u2, · · · , up). As outlined in Section 1, when p is even, because we do not have sign cancellations we can show: Theorem 8 (Even order). There is a constant α > 0 and a sufficiently small constant γ > 0, such that, for any even order-p tensor T = T∗+ E ∈Rnp with rank(T∗) ≤nγ, p ≤nγ and λk ≥1/nγ. For any sufficiently large constant c0, there exists a sufficiently small constant c > 0, for any ϵ ∈(0, cλk/(c0p2kn(p−2)/2)) if E satisfies ∥E ∥2 ≤ϵ/(c0 √n), Algorithm 3 runs in O(np−α) time. 6 As outlined in Section 1, for p = 3 and small k we can take sign considerations into account: Theorem 9 (Low rank). There is a constant α > 0 and a sufficiently small constant γ > 0 such that for any symmetric tensor T = T∗+ E ∈Rn3 with E satisfying (2), rank(T∗) ≤2, and λk ≥1/nγ, then Algorithm 3 runs in O(n3−α) time. 3 Experiments 3.1 Experiment Setup and Datasets Our implementation shares the same code base 1 as the sketching-based robust tensor power method proposed in [23]. We ran our experiments on an i7-5820k CPU with 64 GB of memory in singlethreaded mode. We ran two versions of our algorithm: the version with pre-scanning scans the full tensor to accurately measure per-slice Frobenius norms and make samples for each slice in proportion to its Frobenius norm in APPROXTIVW; the version without pre-scanning assumes that the Frobenius norm of each slice is bounded by 1 nα ∥T ∥2 F , α ∈(0, 1] and uses b/n samples per slice, where b is the total number of samples our algorithm makes, analogous to the sketch length b in [23]. Synthetic datasets. We first generated an orthonormal basis {vi}k i=1 and then computed the synthetic tensor as T∗= Pk i=1 λiv⊗3 i , with λ1 ≥· · · ≥λk. Then we normalized T∗such that ∥T∗∥F = 1, and added a symmetric Gaussian noise tensor E where Eijl ∼N(0, σ n1.5 ) for i ≤j ≤l. Then σ controls the noise-to-signal ratio and we kept it as 0.01 in all our synthetic tensors. For the eigenvalues λi, we generated three different decays: inverse decay λi = 1 i , inverse square decay λi = 1 i2 , and linear decay λi = 1 −i−1 k . We also set k = 100 when generating tensors, since higher rank eigenvalues were almost indistinguishable from the added noise. To show the scalability of our algorithm, we generated tensors with different dimensions: n = 200, 400, 600, 800, 1000, 1200. Real-life datasets. Latent Dirichlet Allocation [5] (LDA) is a powerful generative statistical model for topic modeling. A spectral method has been proposed to solve LDA models [1, 2] and the most critical step in spectral LDA is to decompose a symmetric K × K × K tensor with orthogonal eigenvectors, where K is the number of modeled topics. We followed the steps in [1, 18] and built a K × K × K tensor TLDA for each dataset, and then ran our algorithms directly on TLDA to see how it works on those tensors in real applications. In our experiments we keep K = 200. We used the two same datasets as the previous work [23]: Wiki and Enron, as well as four additional real-life datasets. We refer the reader to our GitHub repository 2 for our code and full results. 3.2 Results We considered running time and the squared residual norm to evaluate the performance of our algorithms. Given a tensor T ∈Rn3, let ∥T −Pk i=1 λiui ⊗vi ⊗wi∥2 F denote the squared residual norm where {(λ1, u1, v1, w1), · · · , (λk, uk, vk, wk)} are the eigenvalue/eigenvectors obtained by the robust power method. To reduce the experiment time we looked only for the first eigenvalue and eigenvector, but our algorithm is capable of finding any number of eigenvalues/eigenvectors. We list the pre-scanning time as preprocessing time in tables. It only depends on the tensor dimension n and unlike the sketching based method, it does not depend on b. Pre-scanning time is very short, because it only requires one pass of sequential access to the tensor which is very efficient on hardware. Sublinear time verification. Our theoretical result suggests the total number of samples bno-prescan for our algorithm without pre-scanning is n1−α(α ∈(0, 1]) times larger than bprescan for our algorithm with pre-scanning. But in experiments we observe that when bno-prescan = bprescan both algorithms achieve very similar accuracy, indicating that in practice α ≈1. Synthetic datasets. We ran our algorithm on a large number of synthetic tensors with different dimensions and different eigengaps. Table 1 shows results for a tensor with 1200 dimensions with 100 non-zero eigenvalues decaying as λi = 1 i2 . To reach roughly the same residual norm, the running time of our algorithm is over 50 times faster than that of the sketching-based robust tensor power method, thanks to the fact that we usually need a relatively small B and b to get a good residual, and the hidden constant factor in the running time of sampling is much smaller than that of sketching. Our algorithm scales well on large tensors due to its sub-linear nature. In Figure 1(a), for the sketching-based method we kept b = 216, B = 30 for n ≤800 and B = 50 for n > 800 (larger n requires more sketches to observe a reasonable recovery). For our algorithm, we chose b and B such 1http://yining-wang.com/fftlda-code.zip 2https://github.com/huanzhang12/sampling_tensor_decomp/ 7 that for each n, our residual norm is on-par or better than the sketching-based method. Our algorithm needs much less time than the sketching-based one over all dimensions. Another advantage of our algorithm is that there are zero or very minimal preprocessing steps. In Figure 1(b), we can see how the preprocessing time grows to prepare sketches when the dimension increases. For applications where only the first few eigenvectors are needed, the preprocessing time could be a large overhead. Real-life datasets Due to the small tensor dimension (200), our algorithm shows less speedup than the sketching-based method. But it is still 2 ∼6 times faster in each of the six real-life datasets, achieving the same squared residual norm. Table 2 reports results for one of the datasets in many different settings of (b, B). Like in synthetic datasets, we also empirically observe that the constant b in importance sampling is much smaller than the b used in sketching to get the same error guarantee. Sketching based robust power method: n = 1200, λi = 1 i2 Squared residual norm Running time (s) Preprocessing time (s) b B 10 30 50 10 30 50 10 30 50 210 1.010 1.014 0.5437 0.6114 2.423 4.374 5.361 15.85 26.08 212 1.020 0.2271 0.1549 1.344 4.563 8.022 5.978 17.23 28.31 214 0.1513 0.1097 0.1003 4.928 15.51 27.87 8.788 24.72 40.4 216 0.1065 0.09242 0.08936 22.28 69.7 116.3 13.76 34.74 55.34 Importance sampling based robust power method (without prescanning): n = 1200, λi = 1 i2 Squared residual norm Running time (s) Preprocessing time (s) b B 10 30 50 10 30 50 10 30 50 5n 0.08684 0.08637 0.08639 2.595 8.3 15.46 0.0 0.0 0.0 10n 0.08784 0.08671 0.08627 4.42 13.68 25.84 0.0 0.0 0.0 20n 0.08704 0.08700 0.08618 8.02 24.51 46.37 0.0 0.0 0.0 30n 0.08697 0.08645 0.08625 11.63 35.35 66.71 0.0 0.0 0.0 40n 0.08653 0.08664 0.08611 15.19 46.12 87.24 0.0 0.0 0.0 Importance sampling based robust power method (with prescanning): n = 1200, λi = 1 i2 Squared residual norm Running time (s) Preprocessing time (s) b B 10 30 50 10 30 50 10 30 50 5n 0.08657 0.08684 0.08636 3.1 10.47 18 2.234 2.236 2.234 10n 0.08741 0.08677 0.08668 5.427 17.43 30.26 2.232 2.233 2.233 20n 0.08648 0.08624 0.08634 9.843 31.42 54.49 2.226 2.226 2.226 30n 0.08635 0.08634 0.08615 14.33 45.4 63.85 2.226 2.224 2.227 40n 0.08622 0.08652 0.08619 18.68 59.32 82.83 2.225 2.225 2.225 Table 1: Synthetic tensor decomposition using the robust tensor power method. We use an order-3 normalized dense tensor with dimension n = 1200 with σ = 0.01 noise added. We run sketching-based and sampling-based methods to find the first eigenvalue and eigenvector by setting L = 50, T = 30 and varying B and b. Sketching based robust power method: dataset wiki, ∥T∥2 F = 2.135e+07 Squared residual norm Running time (s) Preprocessing time (s) b B 10 30 10 30 10 30 210 2.091e+07 1.951e+07 0.2346 0.8749 0.1727 0.2535 211 1.971e+07 1.938e+07 0.4354 1.439 0.2408 0.3167 212 1.947e+07 1.930e+07 1.035 2.912 0.4226 0.4275 213 1.931e+07 1.927e+07 2.04 5.94 0.5783 0.6493 214 1.928e+07 1.926e+07 4.577 13.93 1.045 1.121 Importance sampling based robust power method (without prescanning): dataset wiki, ∥T∥2 F = 2.135e+07 Squared residual norm Running time (s) Preprocessing time (s) b B 10 30 10 30 10 30 5n 1.931e+07 1.928e+07 0.3698 1.146 0.0 0.0 10n 1.931e+07 1.929e+07 0.5623 1.623 0.0 0.0 20n 1.935e+07 1.926e+07 0.9767 2.729 0.0 0.0 30n 1.929e+07 1.926e+07 1.286 3.699 0.0 0.0 40n 1.928e+07 1.925e+07 1.692 4.552 0.0 0.0 Importance sampling based robust power method (with prescanning): dataset wiki, ∥T∥2 F = 2.135e+07 Squared residual norm Running time (s) Preprocessing time (s) b B 10 30 10 30 10 30 5n 1.931e+07 1.930e+07 0.4376 1.168 0.01038 0.01103 10n 1.928e+07 1.930e+07 0.6357 1.8 0.0104 0.01044 20n 1.931e+07 1.927e+07 1.083 2.962 0.01102 0.01042 30n 1.929e+07 1.925e+07 1.457 4.049 0.01102 0.01043 40n 1.929e+07 1.925e+07 1.905 5.246 0.01105 0.01105 Table 2: Tensor decomposition in LDA on the wiki dataset. The tensor is generated by spectral LDA with dimension 200 × 200 × 200. It is symmetric but not normalized. We fix L = 50, T = 30 and vary B and b. 8 References [1] A. Anandkumar, R. Ge, D. Hsu, S. M. Kakade, and M. Telgarsky. Tensor decompositions for learning latent variable models. JMLR, 15(1):2773–2832, 2014. [2] A. Anandkumar, Y.-k. Liu, D. J. Hsu, D. P. Foster, and S. M. Kakade. A spectral algorithm for latent dirichlet allocation. In NIPS, pages 917–925, 2012. [3] J. L. Bentley and J. B. Saxe. Generating sorted lists of random numbers. ACM Transactions on Mathematical Software (TOMS), 6(3):359–364, 1980. [4] S. Bhojanapalli and S. Sanghavi. A new sampling technique for tensors. CoRR, abs/1502.05023, 2015. [5] D. M. Blei, A. Y. Ng, and M. I. Jordan. Latent dirichlet allocation. JMLR, 3:993–1022, 2003. [6] K. Bringmann and K. Panagiotou. Efficient sampling methods for discrete distributions. In International Colloquium on Automata, Languages, and Programming, pages 133–144. Springer, 2012. [7] J. H. Choi and S. Vishwanathan. Dfacto: Distributed factorization of tensors. In NIPS, pages 1296–1304, 2014. [8] K. L. Clarkson, E. Hazan, and D. P. Woodruff. Sublinear optimization for machine learning. J. ACM, 59(5):23, 2012. [9] R. A. Harshman. Foundations of the parafac procedure: Models and conditions for an explanatory multi-modal factor analysis. 16(1):84, 1970. [10] F. Huang, N. U. N, M. U. Hakeem, P. Verma, and A. Anandkumar. Fast detection of overlapping communities via online tensor methods on gpus. CoRR, abs/1309.0787, 2013. [11] U. Kang, E. E. Papalexakis, A. Harpale, and C. Faloutsos. Gigatensor: scaling tensor analysis up by 100 times - algorithms and discoveries. In KDD, pages 316–324, 2012. [12] D. E. Knuth. The art of computer programming. vol. 2: Seminumerical algorithms. addisonwesley. Reading, MA, pages 229–279, 1969. [13] A. Moitra. Tensor decompositions and their applications, 2014. [14] M. Monemizadeh and D. P. Woodruff. 1-pass relative-error lp-sampling with applications. In SODA, pages 1143–1160, 2010. [15] N. Pham and R. Pagh. Fast and scalable polynomial kernels via explicit feature maps. In KDD, pages 239–247, 2013. [16] A. H. Phan, P. Tichavský, and A. Cichocki. Fast alternating LS algorithms for high order CANDECOMP/PARAFAC tensor factorizations. IEEE Transactions on Signal Processing, 61(19):4834–4846, 2013. [17] C. E. Tsourakakis. MACH: fast randomized tensor decompositions. In SDM, pages 689–700, 2010. [18] H.-Y. F. Tung, C.-Y. Wu, M. Zaheer, and A. J. Smola. Spectral methods for the hierarchical dirichlet process. 2015. [19] A. J. Walker. An efficient method for generating discrete random variables with general distributions. ACM Transactions on Mathematical Software (TOMS), 3(3):253–256, 1977. [20] C. Wang, X. Liu, Y. Song, and J. Han. Scalable moment-based inference for latent dirichlet allocation. In ECML-PKDD, pages 290–305, 2014. [21] Y. Wang. Personal communication. 2016. [22] Y. Wang and A. Anandkumar. Online and differentially-private tensor decomposition. CoRR, abs/1606.06237, 2016. [23] Y. Wang, H.-Y. Tung, A. J. Smola, and A. Anandkumar. Fast and guaranteed tensor decomposition via sketching. In NIPS, pages 991–999, 2015. 9
2016
88
6,550
Mapping Estimation for Discrete Optimal Transport Micha¨el Perrot Univ Lyon, UJM-Saint-Etienne, CNRS, Lab. Hubert Curien UMR 5516, F-42023 michael.perrot@univ-st-etienne.fr Nicolas Courty Universit´e de Bretagne Sud, IRISA, UMR 6074, CNRS, courty@univ-ubs.fr R´emi Flamary Universit´e Cˆote d’Azur, Lagrange, UMR 7293 , CNRS, OCA remi.flamary@unice.fr Amaury Habrard Univ Lyon, UJM-Saint-Etienne, CNRS, Lab. Hubert Curien UMR 5516, F-42023 amaury.habrard@univ-st-etienne.fr Abstract We are interested in the computation of the transport map of an Optimal Transport problem. Most of the computational approaches of Optimal Transport use the Kantorovich relaxation of the problem to learn a probabilistic coupling γ but do not address the problem of learning the underlying transport map T linked to the original Monge problem. Consequently, it lowers the potential usage of such methods in contexts where out-of-samples computations are mandatory. In this paper we propose a new way to jointly learn the coupling and an approximation of the transport map. We use a jointly convex formulation which can be efficiently optimized. Additionally, jointly learning the coupling and the transport map allows to smooth the result of the Optimal Transport and generalize it to out-of-samples examples. Empirically, we show the interest and the relevance of our method in two tasks: domain adaptation and image editing. 1 Introduction In recent years Optimal Transport (OT) [1] has received a lot of attention in the machine learning community [2, 3, 4, 5]. This gain of interest comes from several nice properties of OT when used as a divergence to compare discrete distributions: (i) it provides a sound and theoretically grounded way of comparing multivariate probability distributions without the need for estimating parametric versions and (ii) by considering the geometry of the underlying space through a cost metric, it can encode useful information about the nature of the problem. OT is usually expressed as an optimal cost functional but it also enjoys a dual variational formulation [1, Chapter 5]. It has been proven useful in several settings. As a first example it corresponds to the Wasserstein distance in the space of probability distributions. Using this distance it is possible to compute means and barycentres [6, 7] or to perform a PCA in the space of probability measures [8]. This distance has also been used in subspace identification problems for analysing the differences between distributions [9], in graph based semi-supervised learning to propagate histogram labels across nodes [4] or as a way to define a loss function for multi-label learning [5]. As a second example OT enjoys a variety of bounds for the convergence rate of empirical to population measures which can be used to derive new probabilistic bounds for the performance of unsupervised learning algorithms such as k-means [2]. As a last example OT is a mean of interpolation between distributions [10] that has been used in Bayesian inference [11], color transfer [12] or domain adaptation [13]. On the computational side, despite some results with finite difference schemes [14], one of the major gain is the recent development of regularized versions that leads to efficient algorithms [3, 7, 15]. Most 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. OT formulations are based on the computation of a (probabilistic) coupling matrix that can be seen as a bi-partite graph between the bins of the distributions. This coupling, also called transportation matrix, corresponds to an empirical transport map which suffers from some drawbacks: it can only be applied to the examples used to learn it. In other words when a new dataset (or sample) is available, one has to recompute an OT problem to deal with the new instances which can be prohibitive for some applications in particular when the task is similar or related. From a machine learning standpoint, this also means that we do not know how to find a good approximation of a transport map computed from a small sample that can be generalized to unseen data. This is particularly critical when one considers medium or large scale applications such as image editing problems. In this paper, we propose to bridge this gap by learning an explicit transformation that can be interpreted as a good approximation of the transport map. As far as we know, this is the first approach that addresses directly this problem of out-of-sample mapping. Our formulation is based on classic regularized regression and admits two appealing interpretations. On the one hand, it can be seen as learning a transformation regularized by a transport map. On the other hand, we can see it as the computation of the transport map regularized w.r.t. the definition of a transformation (e.g. linear, non-linear, ...). This results in an optimization problem that jointly learns both the transport map and the transformation. This formulation can be efficiently solved thanks to alternating block-coordinate descent and actually benefits the two models: (i) we obtain smoother transport maps that must be compliant with a transformation that can be used on out-of-sample examples and (ii) the transformation is able to take into account some geometrical information captured by OT. See Figure 1 for an illustration. We provide some empirical evidence for the usefulness of our approach in domain adaptation and image editing. Beyond that, we think that this paper can open the door to new research on the generalization ability of OT. The rest of the paper is organized as follows. Section 2 introduces some notations and preliminaries in optimal transport. We present our approach in Section 3. Our experimental evaluation is given in Section 4 and we conclude in Section 5. 2 Background Monge problem Let ΩS ∈Rds and ΩT ∈Rdt be two separable metric spaces such that any probability measure on ΩS, respectively ΩT , is a Radon measure. By considering a cost function c : ΩS × ΩT →[0, ∞[, Monge’s formulation of the OT problem is to find a transport map T : ΩS →ΩT (also known as a push-forward operator) between two probability measures µS on ΩS and µT on ΩT realizing the infimum of the following function: inf Z ΩS c(x, T(x))dµS(x), T#µS = µT  . (1) When reaching this infimum, the corresponding map T is an optimal transport map. It associates one point from ΩS to a single point in ΩT . Therefore, the existence of this map is not always guaranteed, as when for example µS is a Dirac and µT is not. As such, the existence of solutions for this problem can in general not be established when µS and µT are supported on a different number of Diracs. Yet, in a machine learning context, data samples usually form discrete distributions, but can be seen as observations of a regular, continuous (with respect to the Lebesgue measure) underlying distribution, thus fulfilling existence conditions (see [1, Chapter 9]). As such, assuming the existence of T calls for a relaxation of the previous problem. Kantorovich relaxation The Kantorovitch formulation of OT [16] is a convex relaxation of the Monge problem. Let us define Π as the set of all probabilistic couplings in P(ΩS × ΩT ), the space of all joint distributions with marginals µS and µT . The Kantorovitch problem seeks for a general coupling γ ∈Π between ΩS and ΩT : γ0 = arg min γ∈Π Z ΩS×ΩT c(xs, xt)dγ(xs, xt). (2) The optimal coupling always exists [1, Theorem 4.1]. This leads to a simple formulation of the OT problem in the discrete case, i.e. whenever µS and µT are only accessible through discrete samples Xs = {xs i}ns i=1, and Xt = {xt i}nt i=1. The corresponding empirical distributions can be written as ˆµS = Pns i=1 ps iδxs i and ˆµT = Pnt i=1 pt iδxt i where δx is the Dirac function at location 2 Figure 1: Illustration of the mappings estimated on the clown dataset with a linear (top) and nonlinear (bottom) mapping (best viewed in color). x ∈Ω. ps i and pt i are probability masses associated to the i-th sample and belong to the probability simplex, i.e. Pns i=1 ps i = Pnt i=1 pt i = 1. Let ˆΠ be the set of probabilistic couplings between the two empirical distributions defined as ˆΠ =  γ ∈(R+)ns×nt| γ1nt = ˆµS, γT 1ns = ˆµT where 1n is a n-dimensional vector of ones. Problem 2 becomes: γ0 = arg min γ∈ˆΠ ⟨γ, C⟩F , (3) where ⟨·, ·⟩F is the Frobenius dot product1 and C ≥0 is the cost matrix related to the function c. Barycentric mapping Once the probabilistic coupling γ0 has been computed, one needs to map the examples from ΩS to ΩT . This mapping can be conveniently expressed with respect to the set of examples Xt as the following barycentric mapping [11, 13, 12]: c xs i = arg min x∈ΩT nt X j=1 γ0(i, j)c(x, xt j), (4) where xs i is a given source sample and c xs i is its corresponding image. When the cost function is the squared ℓ2 distance, i.e. c(x, x′) = ∥x −x′∥2 2, this barycentre corresponds to a weighted average and the sample is mapped into the convex hull of the target examples. For all source samples, this barycentric mapping can therefore be expressed as: c Xs = Bγ0(Xs) = diag(γ01nt)−1γ0Xt. (5) In the rest of the paper we will focus on a uniform sampling, i.e. the examples are drawn i.i.d. from µS and µT , whence c Xs = nsγ0Xt. The main drawback of the mapping (5) is that it does not allow the projection of out-of-sample examples which do not have been seen during the learning process of γ0. It means that to transport a new example xs ∼ΩS one has to compute the coupling matrix γ0 again using this new example. Also, while some authors consider specific regularization of γ [3, 13] to control the nature of the coupling, inducing specific properties of the transformation T (i.e. regularity, divergence free, etc.) is hard to achieve. In the next section we present a relaxation of the OT problem, which consists in jointly learning γ and T. We derive the corresponding optimization problem, and show its usefulness in specific scenarios. 3 Contributions 3.1 Joint learning of T and γ In this paper we propose to solve the problem of optimal transport by jointly learning the matrix γ and the transformation function T. First of all, we denote H the space of transformations from ΩT 1⟨A, B⟩F = Tr(AT B) 3 to ΩT and using a slight abuse of notations Xs and Xt are matrices where each line is an example respectively drawn from ΩS and ΩT . We propose the following optimisation problem: arg min T ∈H,γ∈ˆΠ f(γ, T) = 1 nsdt ∥T(Xs) −nsγXt∥2 F + λγ max(C) ⟨γ, C⟩F + λT dsdt R(T) (6) where T(Xs) is a short-hand for the application of T on each example in Xs, R(·) is a regularization term on T and λγ, λT are hyper-parameters controlling the trade-off between the three terms in the optimization problem. The first term in (6) depends on both T and γ and controls the closeness between the transformation induced by T and the barycentric interpolation obtained from γ. The second term only depends on γ and corresponds to the standard optimal transport loss. The third term regularizes T to ensure a better generalization. A standard approach to solve problem (6) is to use block-coordinate descent (BCD) [17], where the idea is to alternatively optimize for T and γ. In the next theorem we show that under some mild assumptions on the regularization term R(·) and the function space H this problem is jointly convex. Note that in this case we are guaranteed to converge to the optimal solution only if we are strictly convex w.r.t. T and γ. While this is not the case for γ, the algorithm works well in practice and a small regularization term can be added if theoretical convergence is required. The proof of the following theorem can be found in the supplementary. Theorem 1. Let H be a convex space and R(·) be a convex function. Problem (6) is jointly convex in T and γ. As discussed above we propose to solve optimization problem (6) using a block coordinate descent approach. As such we need to find an efficient way to solve: (i) for γ when T is fixed and (ii) for T when γ is fixed. To solve the problem w.r.t. γ with a fixed T, a common approach is to use the Frank-Wolfe algorithm [12, 18]. It is a procedure for solving any convex constrained optimization problem with a convex and continuously differentiable objective function over a compact convex subset of any vector space. This algorithm can find an ϵ approximation of the optimal solution in O(1/ϵ) iterations [19]. A detailed algorithm is given in the supplementary material. In the next section we discuss the solution of the minimization w.r.t. T with fixed γ for different functional spaces. 3.2 Choosing H In the previous subsection we presented our method when considering a general set of transformations H. In this section we propose several possibilities for the choice of a convex set H. On the one hand, we propose to define H as a set of linear transformations from ΩS to ΩT . On the other hand, using the kernel trick, we propose to consider non-linear transformations. A summary of the approach can be found in Algorithm 1. Linear transformations A first way to define H is to consider linear transformations induced by a ds × dt real matrix L: H = n T : ∃L ∈Rds×dt, ∀xs ∈ΩS, T(xs) = xsT L o . (7) Furthermore, we define R(T) = ∥L −I∥2 F where I is the identity matrix. We choose to bias L toward I in order to ensure that the examples are not moved too far away from their initial position. In this case we can rewrite optimization problem (6) as: arg min L∈Rds×dt,γ∈ˆΠ 1 nsdt ∥XsL −nsγXt∥2 F + λγ max(C) ⟨γ, C⟩F + λT dsdt ∥L −I∥2 F . (8) According to Algorithm 1 a part of our procedure requires to solve optimization problem (8) when γ is fixed. One solution is to use the following closed form for L: L =  1 nsdt XT s Xs + λT dsdt I −1  1 nsdt XT s nsγXt + λT dsdt I  (9) where (·)−1 is the matrix inverse (Moore-Penrose pseudo-inverse when the matrix is singular). In the previous definition of H, we considered non biased linear transformations. However it is sometimes desirable to add a bias to the transformation. The equations being very similar in spirit to the non biased case we refer the interested reader to the supplementary material. 4 Algorithm 1: Joint Learning of L and γ. input :Xs, Xt source and target examples and λγ, λT hyper parameters. output:L, γ. 1 begin 2 Initialize k = 0, γ0 ∈ˆΠ and L0 = I 3 repeat 4 Learn γk+1 solving problem (6) with fixed Lk using a Frank-Wolfe approach. 5 Learn Lk+1 using Equation (9), (12) or their biased counterparts with fixed γk+1. 6 Set k = k + 1. 7 until convergence Non-linear transformations In some cases a linear transformation is not sufficient to approximate the transport map. Hence, we propose to consider non-linear transformations. Let φ be a non-linear function associated to a kernel function k : ΩS × ΩS →R such that k(xs, xs′) = φ(xs), φ(xs′) H, we can define H for a given set of examples Xs as: H = n T : ∃L ∈Rns×dt∀xs ∈ΩS, T(xs) = kXs(xsT )L o (10) where kXs(xsT ) is a short-hand for the vector k(xs, xs 1) k(xs, xs 2) · · · k(xs, xs ns) where xs 1, · · · , xs ns ∈Xs. In this case optimization problem (6) becomes: arg min L∈Rns×dt,γ∈ˆΠ 1 nsdt ∥kXs(Xs)L −nsγXt∥2 F + λγ max(C) ⟨γ, C⟩F + λT nsdt ∥kXs(·)L∥2 F . (11) where kXs(·) is a short-hand for the vector k(·, xs 1) · · · k(·, xs ns) = φ(xs 1) · · · φ(xs ns) . As in the linear case there is a closed form solution for L when γ is fixed: L =  1 nsdt kXs(Xs) + λT d2 I −1 1 nsdt nsγXt. (12) As in the linear case it might be interesting to use a bias (Presented in the supplementary material). 3.3 Discussion on the quality of the transport map approximation In this section we propose to discuss some theoretical considerations about our framework and more precisely on the quality of the learned transformation T. To assess this quality we consider the Frobenius norm between T and the true transport map, denoted T ∗, that we would obtain if we could solve Monge’s problem. Let Bˆγ be the empirical barycentric mapping of Xs using the probabilistic coupling ˆγ learned between Xs and Xt. Similarly let Bγ0 be the theoretical barycentric mapping associated with the probabilistic coupling γ0 learned on µS, µT the whole distributions and which corresponds to the solution of Kantorovich’s problem. Using a slight abuse of notations we denote by Bˆγ(xs) and Bγ0(xs) the projection of xs ∈Xs by these barycentric mappings. Using the triangle inequality, some standard properties on the square function, the definition of H and [20, Theorem 2], we have with high probability that (See the supplementary material for a justification): E xs∼ΩS ∥T(xs) −T ∗(xs)∥2 F ≤4 X xs∈Xs ∥T(xs) −Bˆγ(xs)∥2 F + O  1 √ns  + 4 X xs∈Xs ∥Bˆγ(xs) −Bγ0(xs)∥2 F + 2 E xs∼ΩS ∥Bγ0(xs) −T ∗(xs)∥2 F . (13) From Inequality 13 we assess the quality of the learned transformation T w.r.t. three key quantities. The first quantity, P xs∈Xs ∥T(xs) −Bˆγ(xs)∥2 F, is a measure of the difference between the learned transformation and the empirical barycentric mapping. We minimize it in Problem (6). The second and third quantities are theoretical and hard to bound because, as far as we know, there is a lack of theoretical results related to these terms in the literature. Nevertheless, we expect P xs∈Xs ∥Bˆγ(xs) −Bγ0(xs)∥2 F to decrease uniformly with respect to the number of examples as it corresponds to a measure of how well the empirical barycentric mapping estimates the theoretical one. Similarly, we expect Exs∼ΩS ∥Bγ0(xs) −T ∗(xs)∥2 F to be small as it characterizes that the theoretical barycentric mapping is a good approximation of the true transport map. This depends of course on the expressiveness of the set H considered. We think that this discussion opens up new theoretical perspectives for OT in Machine Learning but these are beyond the scope of this paper. 5 Table 1: Accuracy on the Moons dataset. Color-code: the darker the result, the better. Angle 1NN GFK SA OT L1L2 OTE OTLin OTLinB OTKer OTKerB T γ T γ T γ T γ 10 100.0 99.9 100.0 97.9 99.6 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 20 93.1 95.8 93.1 95.0 98.7 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 100.0 30 84.0 92.5 84.0 90.6 98.4 100.0 99.8 99.9 99.8 99.9 100.0 100.0 100.0 100.0 40 77.1 90.8 74.4 83.7 95.8 100.0 98.3 98.7 98.1 98.5 99.7 99.7 99.6 99.7 50 61.7 90.2 73.1 77.8 87.7 87.3 97.8 97.6 97.5 97.5 99.1 99.2 99.1 99.1 60 41.2 79.4 72.3 71.0 88.3 86.3 96.4 97.2 95.8 97.0 96.6 96.8 96.6 96.8 70 23.1 61.0 72.3 64.5 89.0 77.5 88.0 94.7 88.2 94.3 80.8 81.5 82.5 83.1 80 20.7 36.2 72.3 57.3 73.6 58.8 76.9 81.0 76.6 80.7 74.0 74.1 73.9 74.2 90 19.4 43.1 34.2 51.0 58.1 51.3 67.9 68.0 67.1 68.1 56.3 55.8 57.6 55.4 4 Experiments 4.1 Domain Adaptation Datasets We consider two domain adaptation (DA) datasets, namely Moons [21] and OfficeCaltech [22]. The Moons dataset is a binary classification task where the source domain corresponds to two intertwined moons, each one representing a class. The target domain is built by rotating the source domain with an angle ranging from 10 to 90 degrees. It leads to 9 different adaptation tasks of increasing difficulty. The examples are two dimensional and we consider 300 source and target examples for training and 1000 target examples for testing. The Office-Caltech dataset is a 10 class image classification task with 4 domains corresponding to images coming from different sources: amazom (A), dslr (D), webcam (W) and Caltech10 (C). There are 12 adaptation tasks where each domain is in turn considered as the source or the target (denoted source →target). To represent the images we use the deep learning features of size 4096 named decaf6 [23]. During the training process we consider all the examples from the source domain and half of the examples from the target domain, the other half being used as the test set. Methods We consider 6 baselines. The first one is a simple 1-Nearest-Neighbour (1NN) using the original source examples only. The second and third ones are two widely used DA approaches, namely Geodesic Flow Kernel (GFK) [22] and Subspace Alignment (SA) [24]. The fourth to sixth baselines are OT based approaches: the classic OT method (OT), OT with entropy based regularization (OTE) [3] and OT with ℓ1ℓ2 regularization (L1L2) [13]. We present the results of our approach with the linear (OTLin) and kernel (OTKer) versions of T and their biased counterpart (*B). For OT based methods the idea is to (i) compute the transport map between the source and the target, (ii) project the source examples and (iii) classify the target examples using a 1NN on the projected source. Experimental Setup We consider the following experimental setup for all the methods and datasets. All the results presented in this section are averaged over 10 trials. For each trial we consider three sets of examples, a labelled source training set denoted Xs, ys, an unlabelled target training set denoted Xtrain t and a labelled target testing set Xtest t . The model is learned on Xs, ys and Xtrain t and evaluated on Xtest t with a 1NN learned on Xs, ys. All the hyper-parameters are tuned according to a grid search on the source and target training instances using a circular validation procedure derived from [21, 25] and described in the supplementary material. For GFK and SA we choose the dimension of the subspace d ∈{3, 6, . . . , 30}, for L1L2 and OTE we set the parameter for entropy regularization in {10−6, 10−5, . . . , 105}, for L1L2 we choose the class related parameter η ∈{10−5, 10−4, . . . , 102}, for all our methods we choose λT , λγ ∈{10−3, 10−2, . . . , 100}. The results on the Moons and Office-Caltech datasets are respectively given in Table 1 and 2. A first important remark is that the coupling γ and the transformation T almost always obtain the same results. It shows that our method is able to learn a good approximation T of the transport map induced by γ. In terms of accuracy our approach tends to give the best results. It shows that we are effectively able to move closer the distributions in a relevant way. For the Moons dataset, the last 6 approaches (including ours) based on OT obtain similar results until 40 degrees while the other methods fail to obtain good results at 20 degrees. Beyond 50 degrees, our approaches give significantly better results than the others. Furthermore they are more stable when the difficulty of the problem increases which 6 Table 2: Accuracy on the Office-Caltech dataset. Color-code: the darker the result, the better. Task 1NN GFK SA OT L1L2 OTE OTLin OTLinB OTKer OTKerB T γ T γ T γ T γ D →W 89.5 93.3 95.6 77.0 95.7 95.7 97.3 97.3 97.3 97.3 98.4 98.5 98.5 98.5 D →A 62.5 77.2 88.5 70.8 74.9 74.8 85.7 85.7 85.8 85.8 89.9 89.9 89.5 89.5 D →C 51.8 69.7 79.0 68.1 67.8 68.0 77.2 77.2 77.4 77.4 69.1 69.2 69.3 69.3 W →D 99.2 99.8 99.6 74.1 94.4 94.4 99.4 99.4 99.8 99.8 97.2 97.2 96.9 96.9 W →A 62.5 72.4 79.2 67.6 71.3 71.3 81.5 81.5 81.4 81.4 78.5 78.3 78.5 78.8 W →C 59.5 63.7 55.0 63.1 67.8 67.8 75.9 75.9 75.4 75.4 72.7 72.7 65.1 63.3 A →D 65.2 75.9 83.8 64.6 70.1 70.5 80.6 80.6 80.4 80.5 65.6 65.5 71.9 71.5 A →W 56.8 68.0 74.6 66.8 67.2 67.3 74.6 74.6 74.4 74.4 66.4 64.8 70.0 68.9 A →C 70.1 75.7 79.2 70.4 74.1 74.3 81.8 81.8 81.6 81.6 84.4 84.4 84.5 84.5 C →D 75.9 79.5 85.0 66.0 69.8 70.2 87.1 87.1 87.2 87.2 70.1 70.0 78.6 78.6 C →W 65.2 70.7 74.4 59.2 63.8 63.8 78.3 78.3 78.5 78.5 80.0 80.4 73.5 73.4 C →A 85.8 87.1 89.3 75.2 76.6 76.7 89.9 89.9 89.7 89.7 82.4 82.2 83.6 83.5 Mean 70.3 77.8 81.9 68.6 74.5 74.6 84.1 84.1 84.1 84.1 79.6 79.4 80.0 79.7 can be interpreted as a benefit from our regularization. In the supplementary material we propose an illustration of the transformation learned by our approach. For Office-Caltech, our methods are significantly better than other approaches which illustrates the potential of our method for difficult tasks. To conclude, forcing OT to simultaneously learn coupling and transformation seems beneficial. 4.2 Seamless copy in images with gradient adaptation We propose here a direct application of our mapping estimation in the context of image editing. While several papers using OT are focusing on color adaptation [12, 26], we explore here a new variant in the domain of image editing: the seamless editing or cloning in images. In this context, one may desire to import a region from a given source image to a target image. As a direct copy of the region leads to inaccurate results in the final image nearby the boundaries of the copied selection, a very popular method, proposed by P´erez and co-workers [27], allows to seamlessly blend the target image and the selection. This technique, coined as Poisson Image Editing, operates in the gradient domain of the image. Hence, the gradients of the selection operate as a guidance field for an image reconstruction based on membrane interpolation with appropriate boundary conditions extracted from the target image (See the supplementary material for more details). Though appealing, this technique is prone to errors due local contrast change or false colors resulting from the integration. While some solutions combining both gradient and color domains exist [28], this editing technique usually requires the source and target images to have similar colors and contrast. Here, we propose to enhance the genericity of this technique by forcing the gradient distribution from the source image to follow the gradient distribution in the target image. As a result, the seamless cloning not only blends smoothly the copied region in the target domain, but also constraints the color dynamics to that of the target image. Hence, a part of the style of the target image is preserved. We start by learning a transfer function Ts→t : R6 →R6 with our method, where 6 denotes the vertical and horizontal components of gradient per color, and we then directly solve the same system as [27]. When dealing with images, the number of source and target gradients are largely exceeding tens of thousands and it is mandatory to consider methods that scale appropriately. As such, our technique can readily learn the transfer function Ts→t over a limited set of gradients and generalizes appropriately to unseen gradients. Three illustrations of this method are proposed in a context of face swapping in Figure 2. As one can observe, the original method of Poisson image editing [27] (3rd column) tends to preserve the color dynamics of the original image and fails in copying the style of the target image. Our method was tested with a linear and kernel version of Ts→t, that was learned with only 500 gradients sampled randomly from both sources (λT = 10−2, λT = 103 for respectively the linear and kernel versions, and λγ = 10−7 for both cases). As a general qualitative comment, one can observe that the kernel version of Ts→t is better at preserving the dynamics of the gradient, while the linear version tends to flatten the colors. In this low-dimensional space, this illustrates the need of a non-linear transformation. Regarding the computational time, the gradient adaptation is of the same 7 Figure 2: Illustrations of seamless copies with gradient adaptation. Each row is composed of the source image, the corresponding selection zone Ωdescribed as a binary mask, and the target image. We compare here the two linear (4th column) and kernel (5th column) versions of the map Ts→t with the original method of [27] (2nd column) (best viewed in color). order of magnitude as the Poisson equation solving, and each example is computed in less than 30s on a standard personal laptop. In the supplementary material we give other examples of the method. 5 Conclusion In this paper we proposed a jointly convex approach to learn both the coupling γ and a transformation T approximating the transport map given by γ. It allowed us to apply a learned transport to a set of out-of-samples examples not seen during the learning process. Furthermore, jointly learning the coupling and the transformation allowed us to regularize the transport by enforcing a certain smoothness on the transport map. We also proposed several possibilities to choose H the set of possible transformations. We presented some theoretical considerations on the generalization ability of the learned transformation T. Hence we discussed that under the assumption that the barycentric mapping generalizes well and is a good estimate of the true transformation, then T learned with our method should be a good approximation of the true transformation. We have shown that our approach is efficient in practice on two different tasks: domain adaptation and image editing. The framework presented in this paper opens the door to several perspectives. First, from a theoretical standpoint the bound proposed raises some questions on the generalization ability of the barycentric mapping and on the estimation of the quality of the true barycentric mapping with respect to the target transformation. On a more practical side, note that in recent years regularized OT has encountered a growing interest and several methods have been proposed to control the behaviour of the transport. As long as these regularization terms are convex, one could imagine using them in our framework. Another perspective could be to use our framework in a mini-batch setting where instead of learning from the whole dataset we can estimate a single function T from several couplings γ optimized on different splits of the examples. As a last example we believe that our framework could allow the use of the notion of OT in deep architectures as, contrary to the coupling γ, the function T can be used on out-of-samples examples. Acknowledgments This work was supported in part by the french ANR project LIVES ANR-15-CE23-0026-03. 8 References [1] C. Villani. Optimal transport: old and new. Grund. der mathematischen Wissenschaften. Springer, 2009. [2] G. Canas and L. Rosasco. Learning probability measures with respect to optimal transport metrics. In NIPS. 2012. [3] M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In NIPS, 2013. [4] J. Solomon, R. Rustamov, G. Leonidas, and A. Butscher. Wasserstein propagation for semi-supervised learning. In ICML, 2014. [5] C. Frogner, C. Zhang, H. Mobahi, M. Araya, and T. Poggio. Learning with a Wasserstein loss. In NIPS. 2015. [6] M. Cuturi and A. Doucet. Fast computation of Wasserstein barycenters. In ICML, 2014. [7] J.-D. Benamou, G. Carlier, M. Cuturi, L. Nenna, and G. Peyr´e. Iterative Bregman projections for regularized transportation problems. SISC, 2015. [8] V. Seguy and M. Cuturi. Principal geodesic analysis for probability measures under the optimal transport metric. In NIPS. 2015. [9] J. Mueller and T. Jaakkola. Principal differences analysis: Interpretable characterization of differences between distributions. In NIPS. 2015. [10] R. McCann. A convexity principle for interacting gases. Advances in Mathematics, 128(1), 1997. [11] S. Reich. A nonparametric ensemble transform method for bayesian inference. SISC, 2013. [12] S. Ferradans, N. Papadakis, G. Peyr´e, and J.-F. Aujol. Regularized discrete optimal transport. SIIMS, 2014. [13] N. Courty, R. Flamary, and D. Tuia. Domain adaptation with regularized optimal transport. In ECML PKDD, 2014. [14] J.-D. Benamou, B. D Froese, and A. M Oberman. Numerical solution of the optimal transportation problem using the Monge–Amp`ere equation. Journal of Computational Physics, 260, 2014. [15] M. Cuturi and G. Peyr´e. A smoothed dual approach for variational Wasserstein problems. SIIMS, 2016. [16] L. Kantorovich. On the translocation of masses. C.R. (Doklady) Acad. Sci. URSS (N.S.), 37, 1942. [17] P. Tseng. Convergence of a block coordinate descent method for nondifferentiable minimization. Journal of Optimization Theory and Applications, 109(3), 2001. [18] M. Frank and P. Wolfe. An algorithm for quadratic programming. NRL, 3(1-2), 1956. [19] M. Jaggi. Revisiting Frank-Wolfe: Projection-free sparse convex optimization. In ICML, 2013. [20] M. Perrot and A. Habrard. Regressive virtual metric learning. In NIPS, 2015. [21] L. Bruzzone and M. Marconcini. Domain adaptation problems: A DASVM classification technique and a circular validation strategy. IEEE PAMI, 32(5), 2010. [22] B. Gong, Y. Shi, F. Sha, and K. Grauman. Geodesic flow kernel for unsupervised domain adaptation. In CVPR, 2012. [23] J. Donahue, Y. Jia, O. Vinyals, J. Hoffman, N. Zhang, E. Tzeng, and T. Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In ICML, 2014. [24] B. Fernando, A. Habrard, M. Sebban, and T. Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In ICCV, 2013. [25] E. Zhong, W. Fan, Q. Yang, O. Verscheure, and J. Ren. Cross validation framework to choose amongst models and datasets for transfer learning. In ECML PKDD, 2010. [26] J. Solomon, F. De Goes, G. Peyr´e, M. Cuturi, A. Butscher, A. Nguyen, T. Du, and L. Guibas. Convolutional Wasserstein distances. ACM Trans. on Graphics, 34(4), 2015. [27] P. P´erez, M. Gangnet, and A. Blake. Poisson image editing. ACM Trans. on Graphics, 22(3), 2003. [28] F. Deng, S. J. Kim, Y.-W. Tai, and M. Brown. ACCV, chapter Color-Aware Regularization for Gradient Domain Image Manipulation. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. 9
2016
89
6,551
Achieving Budget-optimality with Adaptive Schemes in Crowdsourcing Ashish Khetan and Sewoong Oh Department of ISE, University of Illinois at Urbana-Champaign Email: {khetan2,swoh}@illinois.edu Abstract Adaptive schemes, where tasks are assigned based on the data collected thus far, are widely used in practical crowdsourcing systems to efficiently allocate the budget. However, existing theoretical analyses of crowdsourcing systems suggest that the gain of adaptive task assignments is minimal. To bridge this gap, we investigate this question under a strictly more general probabilistic model, which has been recently introduced to model practical crowdsourcing datasets. Under this generalized Dawid-Skene model, we characterize the fundamental trade-off between budget and accuracy. We introduce a novel adaptive scheme that matches this fundamental limit. A given budget is allocated over multiple rounds. In each round, a subset of tasks with high enough confidence are classified, and increasing budget is allocated on remaining ones that are potentially more difficult. On each round, decisions are made based on the leading eigenvector of (weighted) non-backtracking operator corresponding to the bipartite assignment graph. We further quantify the gain of adaptivity, by comparing the tradeoff with the one for non-adaptive schemes, and confirm that the gain is significant and can be made arbitrarily large depending on the distribution of the difficulty level of the tasks at hand. 1 Introduction Crowdsourcing platforms provide labor markets in which pieces of micro-tasks are electronically distributed to a pool of workers. In typical crowdsourcing scenarios, such as those on Amazon’s Mechanical Turk, a requester posts a collection of tasks, and a batch is picked up by any worker who is willing to complete it. The worker is subsequently rewarded for each task he/she completes. However, some workers are spammers trying to make easy money. Moreover, since the reward is small and tasks are tedious, errors are common even among those who try. To correct for the errors, a common approach is to introduce redundancy by assigning each task to multiple workers and aggregating their responses using some schemes such as majority voting. A fundamental problem of interest is how to maximize the accuracy of thus inferred solutions, while using as small number of repetitions as possible. There are two challenges in achieving such an optimal tradeoff between accuracy and the budget: (a) we need a scheme for deciding which tasks to assign to which workers; and (b) at the same time infer the true solutions from their responses. Since the workers are fleeting, the requester has no control over who gets to work on which tasks. It is impossible to make a trust relationship with the workers. In particular, it does not make sense to explore reliable workers, and exploit them in subsequent steps. Each arriving worker is completely new and you may never get him back. Nevertheless, by comparing responses from multiple workers, we can estimate the true answer to the task, and use it in subsequent steps to learn the reliability of the workers. Our beliefs on the true answers as well as the difficulty of the tasks and the reliability of the workers can be iteratively refined, and one can potentially choose to assign more workers to the more difficult tasks. We would like to understand such intricate interplay of task assignment and inference. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Setup. We have m binary classification tasks to be completed by workers. We assume a recent generalization of the Dawid-Skene model introduced in [22] to model the responses, which captures the heterogeneity in the tasks as well as the workers. Precisely, each new arriving worker is parametrized by a quality parameter pj ∈[0, 1] (for the j-th arriving worker), which is i.i.d. according to some prior distribution F. Each task is parametrized by a difficulty parameter qi ∈[0, 1] (for the i-th task), which is drawn i.i.d. according to some prior distribution G . When a worker j is assigned a task i, the task is perceived as a positive task with probability qi, and as a negative task otherwise. Hence, if qi is close to a half then it is confusing and difficult to correctly classify, and easy if close to one or zero. When task i is assigned to worker j, the response is a noisy perception of the task: Aij =  1, w.p. qipj + ¯qi¯pj, −1, w.p. ¯qipj + qi¯pj. , (1) where ¯qi = 1−qi and ¯pj = 1−pj. With probability pj, the worker answers truthfully as he perceives the task, and otherwise gives the opposite answer. Hence, if pj is close to one then he tells the truth (in his opinion) and if it is close to half he gives random answers. If it is zero, he is also reliable, in the sense that a requester who can correctly decode his reliability can extract the truths exactly. We define the ground truth of a task as what the majority of the workers agree on, had we asked all the workers. Accordingly, we assume that EF[pj] > 1/2 and the true labels are defined as ti = I{qi>(1/2)} −I{qi<(1/2)} . Otherwise, we do not impose any condition on the distribution of pj’s. However, we assume qi’s are discrete random variables with support at K points. Our results do not directly depend on this support size K, and therefore K can be made arbitrarily large. Note that we focus on only binary tasks with two types of classes, and also the workers are assumed to be symmetric, i.e. the error probability does not depend on the perceived label of the task. The original Dawid-Skene model introduced in [3] and analyzed in [9] is a special case, when all tasks are equally easy, i.e. qi’s are either one or zero. This makes inference easier as all tasks are perceived their true class; the only source of error is in workers’ noisy responses. We assume the following task assignment scenario to model practical crowdsourcing systems. It is a discrete time system, where at the beginning of each time step the requester can create a batch of tasks. This batch is picked up by a new arriving worker, and his/her responses are collected. To model real-world constraints we assume there is a limit on how many tasks a single worker can complete, which we denote by r. The requester (also called task master) has no control over who is arriving next, but he has control over which of the m tasks are to be solved by the next arriving worker. This allows for adaptive task assignment schemes, where the requester can choose to include those tasks that he is most uncertain about based on all the history of responses collected thus far. We consider all randomized task assignment schemes, whose expected number of assignment per task is ℓ, and all inference algorithms. We study the minimax rate when the nature chooses the worst case priors F and G (from a family of priors parametrized by average worker reliability β and average task difficulty λ defined in (2)), and we choose the best possible adaptive task assignment together with the best possible inference algorithm. We further propose a novel adaptive approach that achieves this minimax rate up to a constant factor. Our approach is different from existing adaptive schemes in [5], where there are multiple types of tasks and the main source of uncertainty is which type the next arriving worker is expert on. Golden tasks with known answers are used to explore expertise and tasks are assigned accordingly. Related work. Existing work on crowdsourcing systems study the standard Dawid-Skene (DS) model [3], where all tasks are equally difficult and hence qi ∈{0, 1} for all tasks. Several inference algorithms have been proposed [3, 17, 6, 16, 4, 7, 11, 23, 10, 21, 2, 8, 14], and the question of task assignment is addressed in [9], where the minimax rate on the probability of error is characterized and a matching task assignment scheme and an inference algorithm are proposed. Perhaps surprisingly, for the standard DS model, a non-adaptive task assignment scheme achieves the fundamental limit. Namely, given m tasks and a total budget for mℓresponses, the requester first constructs a bipartite task-assignment graph with m task nodes, n = mℓ/r worker nodes, and edges drawn uniformly at random with degree ℓfor the task nodes and r for the worker nodes. Then, j-th arriving worker is assigned a batch of r tasks that are adjacent to the j-th worker node. Together with an inference algorithm explained in detail in Section 2, this achieves a near-optimal performance. Namely, to achieve an average probability of error ε, it is sufficient to have total budget O((m/β) log(1/ε)), where β = EF[(2pj −1)2] is the quality of the workers defined in (2). Perhaps surprisingly, no adaptive assignment can improve upon it. Even the best adaptive scheme and the best inference 2 algorithm still requires Ω((m/β) log(1/ε)) total budget. Hence, there is no gain in adaptivity. This negative result relies crucially in the fact that under the standard DS model, all tasks are inherently equally difficult. Hence, adaptively assigning more workers to relatively more ambiguous tasks has only a marginal gain. However, simple adaptive schemes are widely used in practice, where significant gains are achieved; in real-world systems, tasks are widely heterogeneous. To capture such varying difficulties in the tasks, generalizations of the DS model were proposed in [19, 18, 22, 15] and significant improvement has been reported on inference problems for real datasets. The generalized DS model serves as the missing piece in bridging the gap between practical gains of adaptivity and theoretical limitations of adaptivity. We investigate the fundamental question of “do adaptive task assignments improve accuracy?” under this generalized Dawid-Skene model of Eq. (1). Contributions. To investigate the gain of adaptivity, we first characterize the fundamental lower bound on the budget required to achieve a target accuracy. To match this fundamental limit, we introduce a novel adaptive task assignment scheme. Our approach consists of multiple rounds of non-adaptive schemes, and we provide sharp analyses on the performance at each round, which guides the design of the task assignment in each round adaptively using the data from previous rounds. The proposed adaptive task assignment is simple to apply in practice, and numerical simulations confirm the superiority compared to state-of-the-art non-adaptive schemes. Under a certain assumption on the choice of parameters in the algorithm, which requires a moderate access to an oracle, we can prove that the performance of the proposed adaptive scheme matches that of the fundamental limit up to a constant factor. Finally, we quantify the gain of adaptivity by proving a strictly larger lower bound on the budget required for any non-adaptive schemes. Precisely, we show that the minimax rate on the budget required to achieve a target average error rate of ε scales as Θ((m/λβ) log(1/ε)). The dependence on the prior F and G are solely captured in β (the quality of the crowd as a whole) and λ (the quality of the tasks as a whole). We show that the fundamental tradeoff for non-adaptive schemes is Θ((m/λminβ) log(1/ε)), requiring a factor of λ/λmin larger budget for non-adaptive schemes. This factor of λ/λmin is precisely how much we gain by adaptivity, and this gain can be made arbitrarily large in the worst case distribution G . 2 Main Results The following quantities are fundamental in capturing the dependence of the minimax rate on the distribution of task difficulties and worker reliabilities: λ ≡EG  1 (2qi −1)2 −1 , α ≡EG [(2qi −1)2], and β ≡EF[(2pj −1)2] . (2) Let n denote the total number of workers used, and Tj denote the set of all tasks assigned to worker j ∈[n] and Wi denote the set of all workers assigned to task i ∈[m] until the adaptive task assignment scheme has terminated. We consider discrete distribution G with K types of tasks of varying difficulty levels. Define effective difficulty level of each task i to be λi ≡(2qi −1)2, and λmin = mini∈[m] λi. A task with a small λi is more difficult, since qi close to 1/2 means the task is more ambiguous. Let δa denote fraction of total tasks having difficulty level λa for a ∈[K] such that P a∈[K] δa = 1, and δmax ≡maxa∈[K] δa, δmin ≡mina∈[K] δa. 2.1 Fundamental limit under the adaptive scenario We prove a lower bound on the minimax error rate: the error that is achieved by the best inference algorithm ˆt using the best adaptive task assignment scheme τ under a worst case worker distribution F and the worst-case true answers t for the given distribution of difficulty level λi’s. Note that given λi, either qi = (1 + √λi)/2 in which case ti = 1 or qi = (1 −√λi)/2 and ti = −1. Let Tℓbe the set of all task assignment schemes that use at most mℓqueries in total, and let Fβ be the set of all the worker distributions such that expectation of worker quality is β, i.e. Fβ ≡{F|EF[(2pj−1)2] = β}. Then we can show the following lower bound on the minimax rate on the probability of error. A proof of this theorem is provided in Section 4 in the supplementary material. Theorem 2.1. When β < 1, there exists a positive constant C′ such that for each task i ∈[m], min τ∈Tℓ,ˆt max t∈{±1}m,F∈Fβ P[ti ̸= ˆti|λi] ≥ 1 2e−C′λiβ E[|Wi| | λi] . 3 This proves a lower bound on per task probability of error that decays exponentially with exponent scaling as λiβE[|Wi| | λi]. The easier the task (λi large), the more reliable the workers are (β large), and the more workers assigned to that task (|Wi| large), the smaller the achievable error. To get a lower bound on the average probability of error, suppose we know the difficulties of the tasks and assign ℓa workers to tasks of difficulty λa. With average budget constraint P a∈[K] ℓaδa ≤ℓ, min τ∈Tℓ,ˆt max t∈{±1}m,F∈Fβ 1 m m X i=1 P[ti ̸= ˆti] ≥ min ℓa:P a∈[K] δaℓa=ℓ K X a=1 1 2δae−C′ℓaλaβ (3) = 1 2e−C′ℓλβ  K X a=1 δae−λ P a̸=a′(δa′/λa′) log(λa/λa′)  , where the equality follows from solving the optimization problem. Note that the summand in the bound does not depend upon the budget ℓ, and it is lower bounded by δmin > 0. The error scales as e−C′ℓλβ, where λ = 1/(E[1/λi]) as defined in (2), and captures how difficult the set of tasks are collectively. This gives a lower bound on the budget Γ required to achieve error ε; there exists a constant C′′ such that if Γε ≤ C′′ m λβ log δmin ε  , (4) then no task assignment scheme (adaptive or not) with any inference algorithm can achieve error less than ϵ. Intuitively, β captures the (collective) quality of the workers as specified by F and λ captures the (collective) difficulty of the tasks as specified by G . This recovers the known fundamental limit for standard DS model where all tasks have λi = 1 and hence λ = 1 in [9]: Γε > C′′′ m β log 1 ϵ  . 2.2 Upper bound on the achievable error rate We present an adaptive task assignment scheme and an iterative inference algorithm that asymptotically achieve an error rate of C1e−(Cδ/4)ℓλβ, when m grows large and ℓ= Θ(log m) where C1 = log2(2δmax/δmin) log2(λ1/λK). This matches the lower bound in (3) and the expected number of queries (or task-worker assignments) is bounded by mℓ. Comparing it to a fundamental lower bound in Theorem 2.1 establishes the near-optimality of our approach, and the sufficient condition to achieve average error ε is for the average total budget to be larger than, Γε ≥ C′ m λβ log C1 ε  . (5) 2.2.1 Adaptive algorithm Since difficulty level is varying across the tasks, it is intuitive to assign fewer workers to easy tasks and more workers to hard tasks. Suppose we know the difficulty levels, then optimizing the lower bound (3) over ˜ℓi’s, it suggests to assign ˜ℓi ≃ℓ(λ/λi) workers to the task i with difficulty λi, when given a fixed budget of ℓworkers per task on average. However, the difficulty levels are not known. Non-adaptive schemes can be arbitrarily worse (see Theorem 2.4). We propose a novel approach of adaptively assigning workers in multiple rounds, refining our belief on λi, and making decisions on the tasks with higher confidence. The main algorithmic component is the sub-routine in line 8-13 of Algorithm 1. For a choice of the (per task) budget ℓt, we collect responses according to a (ℓt, rt = ℓt) regular random graph on |M| tasks and |M| workers. The leading eigen-vector of the non-backtracking operator on this bipartite graph, weighted by the ±1 responses reveals a noisy observation of the true class and the difficulty levels of the tasks. Let x ∈R|M| denote the top left eigenvector, computed as per Algorithm 2. Then the i-th entry xi asymptotically converges in the large number of tasks m limit to a Gaussian random variable with mean proportional to the difficulty level (2qi −1), with mean and variance specified in Lemma 5.1 in the the supplementary material. This non-backtracking operator approach to crowdsourcing was first introduced in [7] for the standard DS model, is a single-round non-adaptive scheme, and uses a threshold of zero to classify tasks based on the sign of xi’s. We generalize their analysis to this generalized DS model in Theorem 2.3 for finite sample regime, and further give a sharper characterization based on central limit theorem in the asymptotic regime (Lemma 5.1 in the supplementary material). 4 This provides us a sub-routine that reveals (2qi −1)’s we want, corrupted by additive Gaussian noise. This resembles the setting in racing algorithms introduced in [12] where the goal is to choose the variable (i.e. task) with largest mean (i.e. easiest) with minimal budget. However, our goal is to identify the sign of the mean of the variables (i.e. classes) with sufficient accuracy. The key idea is to classify the easier tasks first with minimal budget, and then classify the remaining more difficult tasks with more budget allocated per task. We can set a threshold Xt,u at each round, and make a permanent decision on a subset of tasks that have large xi’s in absolute value, since those are the tasks we are most confident about in its class, i.e. sign(2qi −1). We are now left to choose the budget ℓt and the threshold Xt,u for each round. We prescribe a choice using following notations. Assume that λa’s are indexed such that λ1 > λ2 > . . . > λK. For simplicity, assume that λK = λ12−(T −1) for some T ∈Z+ \ {1}. Given the distribution {λa, δa}a∈[K], we first bin it to get another distribution {˜λa, ˜δa}a∈[T ] which is supported at most at T points. We take ˜λ1 = λ1 and ˜λa+1 = ˜λa2−1 for each a ∈[T −1]. ˜δa is the total fraction of tasks whose difficulty λi is smaller than λ12−(a−2) and larger than λ12−(a−1). Precisely, ˜δa = P a′∈[K] δa′I  λ1/2(a−1) ≤λa′ < λ1/2(a−2) , for a ∈[T] . The choice of 2 for the ratio of ˜λa’s is arbitrary and can be further optimized for a given distribution of λi’s. For ease of notations in writing the algorithm, we re-index the binned distribution to get {˜λa, ˜δa}a∈[ ˜T ], for ˜T ≤T, such that ˜δa ̸= 0 for all a ∈˜T. Note that ˜T ≤⌈log2(λ1/λK)⌉. We start with a set of all tasks M = [m]. A fraction of tasks are classified in each round and the un-classified ones are taken to the next round. At round t ∈{1, . . . , ˜T}, our goal is to classify sufficient fraction of those tasks in the same difficulty group {i ∈M : λi = λt} to be classified with desired level of accuracy. If ℓt is too low and/or threshold Xt,u too small, then misclassification rate will be too large. If ℓt is too large, we are wasting our budget unnecessarily. If Xt,u is too large, not enough tasks will be classified. We choose ℓt = ℓCδ˜λ/˜λt and an appropriate Xt,u to ensure that the misclassification probability is at most C1e−(Cδ/4)λβℓbased on the central limit theorem on the leading eigen vector (see (21) in the supplementary material). We run this sub-routine st = max{0, ⌈log2(˜δt(1 + γt)/˜δt+1γt+1)⌉} times to ensure that enough fraction from t-th group is classified. We make sure that the expected number of unclassified tasks is at most equal to the number of tasks in the next group, i.e., difficulty level λi = λt+1. We provide a near-optimal performance guarantee for γt = 1 for all t ∈[ ˜T], and γt provides an extra degree of freedom for practitioners to further optimize the efficiency. Note that statistically, the fraction of the t-th group (i.e. tasks with difficulty ˜λt) that get classified before the t-th round is very small as the threshold set in these rounds is more than their absolute mean message. Most tasks with ˜λt will get classified in round t. Further, the binning of the original given distribution to get {˜λa, ˜δa} ensures that ℓt+1 ≥2ℓt. It ensures that the total extraneous budget spent on ˜λt tasks is not more than a constant times the allocated budget of those tasks, and the constant can be made one, by changing the initial choice of ℓ1 by a constant factor. 2.2.2 Performance Guarantee Since we are not wasting any budget on any of the tasks, with the right choice of the constant Cδ, we are guaranteed that this algorithm uses at most mℓassignments in expectation. One caveat is that, the threshold Xt,u depends on αt,u = (1/|M|) P i∈[M] λi, which is the average difficulty of the remaining tasks. As the remaining tasks are changing over the course of the algorithm, we need to estimate this value in each sub-routine. We provide an estimator of αt,u in Algorithm 3 (in the supplementary material) that only uses the sampled responses that are already collected. All numerical results are based on this estimator. However, analyzing the sensitivity of the performance with respect to the estimation error in αt,u is quite challenging, and for a theoretical analysis, we assume we have access to an oracle that provides the exact value of αt,u, replacing Algorithm 3. Theorem 2.2. Suppose Algorithm 3 returns the exact value of αt,u = (1/|M|) P i∈[M] λi. With the choice of γa = 1 for all a ∈[ ˜T] and Cδ = (4 + ⌈log(2δmax/δmin)⌉)−1 for any given distribution of task difficulty {λa, δa}a∈[K] of m tasks and an average number of workers per task ℓ= Θ(log m), the expected number of queries made by Algorithm 1 is asymptotically bounded by limm→∞ P t∈[ ˜T ],u∈st ℓtE[|Mt,u|]/(mℓ) ≤1, where Mt,u is the number of tasks remaining at round 5 (t, u). Further, Algorithm 1 returns estimates {ˆti}i∈[m] that asymptotically achieves, lim m→∞ 1 m m X i=1 P[ti ̸= ˆti] ≤ C1e−(Cδ/4)ℓλβ , (6) where C1 = log2(2δmax/δmin) log2(λ1/λK) for λβ scaling as 1/ℓsuch that ℓλβ = Θ(1). A proof of this theorem is provided in Section 5 in the supplementary material. This shows the nearoptimal sufficient condition of our approach in (5). The constant Cδ can be improved by optimizing over the choice of γa’s by minimizing the expected number of queries that the algorithm makes. Algorithm 1 Adaptive Task Assignment and Inference Algorithm Require: m, {˜λa, ˜δa}a∈[ ˜T ], ℓ, Cδ, {γa}a∈[ ˜T ], α, β, µ = E[2pj −1] Ensure: Estimate {ˆti}i∈[m] 1: M ←{1, 2, · · · , m}, ˜λ =  P a∈[ ˜T ](˜δa/˜λa) −1 2: for all t = 1, 2, · · · , ˜T do 3: ℓt ←(ℓCδ˜λ)/˜λt, rt ←ℓt 4: st ←max n 0, l log  ˜δt(1+γt) ˜δt+1γt+1 m o I{t < ˜T} + 1 I{t = ˜T} 5: for all u = 1, 2, · · · , st do 6: if M ̸= ∅then 7: n ←|M| , k ← p log |M| 8: Draw E ∈{0, 1}|M|×n ∼(ℓt, rt)-regular random graph 9: Collect answers {Ai,j ∈{1, −1}}(i,j)∈E 10: {xi}i∈M ←Algorithm 2  E, {Ai,j}(i,j)∈E, k  11: αt,u ←Algorithm 3 [E, {Ai,j}(i,j)∈E, ℓt, rt] 12: Xt,u ← p˜λtµℓt (ℓt −1)(rt −1)αt,uβ k−1I{t < ˜T} + 0 I{t = ˜T} 13: ˆti = I{xi > Xt,u} −I{xi < −Xt,u} i∈M, M ←{i ∈M : |xi| ≤Xt,u} 14: end if 15: end for 16: end for Algorithm 2 Message-Passing Algorithm Require: E ∈{0, 1}|M|×n, {Aij ∈{1, −1}}(i,j)∈E, kmax Ensure: {xi ∈R}i∈[|M|] 1: for all (i, j) ∈E do 2: Initialize y(0) j→i with random Zj→i ∼N(1, 1) 3: end for 4: for all k = 1, 2, · · · , kmax do 5: for all (i, j) ∈E do 6: x(k) i→j ←P j′∈Wi\j Aij′yk−1 j′→i 7: end for 8: for all (i, j) ∈E do 9: y(k) j→i ←P i′∈Tj\i Ai′jxk i′→j 10: end for 11: end for 12: for all i ∈[m] do 13: xi ←P j∈Wi Aijykmax−1 j→i 14: end for In Figure 1, we compare performance of our algorithm with majority voting and also non-adaptive version of our Algorithm 1, where we assign to each task ℓ(the given budget) number of workers in 6 one round and set classification threshold Xt,u = 0 so as to classify all the tasks. This non-adaptive special case has been introduced for the standard DS model in [9]. We make a slight modification to Algorithm 1. In the final round, when the classification threshold is set to zero, we include all the responses collected thus far when running the message passing Algorithm 2, and not just the fresh samples collected in that round. This creates dependencies between rounds, which makes the analysis challenging. However, in practice we see improved performance and it allows us to use the given fixed budget efficiently. We run synthetic experiments with m = 1800 and fix n = 1800 for the non-adaptive version. The crowds are generated from the spammer-hammer model with hammer probability equal to 0.3. In the left panel, we take difficulty level λa to be uniformly distributed over {1, 1/4, 1/16}, that gives λ = 1/7. In the right panel, we take λa = 1 with probability 3/4, otherwise we take it to be 1/4 or 1/16 with equal probability, that gives λ = 4/13. As predicted from the theoretical analysis, our adaptive algorithm improves significantly over its non-adaptive version. In particular, for the left panel, the non-adaptive algorithm’s error scaling depends on smallest λi that is 1/16 while for the adaptive algorithm it scales with λ = 1/7. In the figure, it can be seen that the adaptive algorithm requires approximately (7/16)ℓqueries to acheive the same error as achieved by the non-adaptive one using ℓqueries. This gap widens in the right panel to approximately (13/64) as predicted, and the adaptive algorithm achieves zero error as the number of queries increase. For a fair comparison with the non-adaptive version, we fix total budget to be mℓand assign workers in each round until the budget is exhausted. Cδ is 1 and st = 1 for t ∈{1, 2, 3}. 1e-006 1e-005 0.0001 0.001 0.01 0.1 50 100 150 200 250 300 350 Majority voting Non-adaptive Adaptive probability of error number of queries per task ℓ 1e-006 1e-005 0.0001 0.001 0.01 0.1 50 100 150 200 250 300 Majority voting Non-adaptive Adaptive probability of error number of queries per task ℓ Figure 1: Algorithm 1 improves significantly over its non-adaptive version and majority voting. 2.3 Achievable error rate under the non-adaptive scenario Consider a non-adaptive version of our approach where we apply it for one round using an (ℓ, r) random regular graph, where ℓis the given budget. Naturally, the classification threshold is set to Xt,u = 0 so as to classify all the tasks. We provide a sharp upper bound on the achieved error, that holds for all (non-asymptotic) regimes of m. Define σ2 k as σ2 k ≡ 2β µ2ˆℓˆr(αβ)2k−1 + 3  1 + 1 ˆrαβ 1 −1/ ˆℓˆr(αβ)2k−1 1 −1/ ˆℓˆr(αβ)2 . (7) This captures the effective variance in the sub-Gaussian tail of the messages xi’s after k iterations of the inference algorithm (Algorithm 2), as shown in the proof of the following theorem (see the supplementary material in Section 6). Theorem 2.3. For any ℓ> 1 and r > 1, suppose m tasks are assigned according to a random (ℓ, r)-regular graph drawn from the configuration model. If µ > 0, ˆℓˆrα2β2 > 1, and ˆrα > 1, then for any t ∈{±1}m, the estimate ˆti = sign(xi) after k iterations of Algorithm 2 achieves P  ti ̸= ˆt(k) i λi  ≤ e−ℓβλi/(2σ2 k) + 3ℓr m (ˆℓˆr)2k−2. (8) Therefore, the average error rate is bounded by 1 m m X i=1 P[ti ̸= ˆt(k) i ] ≤ EG  e −ℓβλi 2σ2 k  + 3ℓr m (ˆℓˆr)2k−2. (9) 7 The second term, which is the probability that the resulting (ℓ, r) regular random graph is not locally tree-like, can be made small for large m as long as k = O(√log m) (which is the choice we make in Algorithm 1). Hence, the dominant term in the error bound is the first term. Further, when we run our algorithm for large enough numbers of iterations, σ2 k converges linearly to a finite limit σ2 ∞≡limk→∞σ2 k such that σ2 ∞= 3 1+1/(ˆrαβ)  (ˆℓˆrαβ)2/((ˆℓˆrαβ)2 −1), which for large enough ˆrαβ and ˆℓˆr is upper bounded by a constant. Hence, for a wide range of parameters, the average error in (9) is dominated by EG  e−ℓβλi/2σ2 k = P a δae−Cℓβλa. When all δ’s are strictly positive, the error is dominated by the difficult tasks with λmin = mina λa, as illustrated in Figure 2. Hence, it is sufficient to have budget Γε ≥C′′m/(λminβ) log(1/ε) to achieve an average error of ε > 0. Such a scaling is also necessary as we show in the next section. This is further illustrated in Figure 2. The error decays exponentially in ℓand β as predicted, but the rate of decay crucially hinges on the difficulty level. We run synthetic experiments with m = n = 1000 and the crowds are generated from the spammer-hammer model where pj = 1 with probability β and 1/2 otherwise. We fix β = 0.3 and vary ℓin the left figure and fix ℓ= 30 and vary β in the right figure. We let qi’s take values in {0.6, 0.8, 1} with equal probability such that α = 1.4/3. The error rate of each task grouped by their difficulty is plotted in the dashed lines, matching predicted e−Ω(ℓβ(2qi−1)2). The average error rates in solid lines are dominated by those of the difficult tasks, which is a universal drawback for all non-adaptive schemes. 1e-005 0.0001 0.001 0.01 0.1 1 0 5 10 15 20 25 30 q = 1.0 q = 0.8 q = 0.6 Mean Error probability of error number of queries per task ℓ 1e-005 0.0001 0.001 0.01 0.1 1 0 0.1 0.2 0.3 0.4 q = 1.0 q = 0.8 q = 0.6 Mean Error probability of error crowd quality β Figure 2: Non-adaptive schemes suffer as average error is dominated by difficult tasks. 2.4 Fundamental limit under the non-adaptive scenario Theorem 2.3 implies that it suffices to assign ℓ≥(c/(βλi)) log(1/ε) to achieve an error smaller than ε for a task i. We show in the following theorem that this scaling is also necessary. Hence, applying one round of Algorithm 1 is near-optimal in the non-adaptive scenario compared to a minimax rate where the nature chooses the worst distribution of worker pj’s among the set of distributions with the same β. We provide a proof of the theorem in Section 7 in the supplementary material. Theorem 2.4. There exists a positive constant C′ and a distribution F of workers with average reliability E[(2pj −1)2] = β s.t. when λi < 1, if the number of workers assigned to task i by any non-adaptive task assignment scheme is less than (C′/(βλi)) log(1/ϵ), then no algorithm can achieve conditional probability of error on task i less than ϵ for any m and r. Since in this non-adaptive scheme, task assignments are done a priori, there are on average ℓworkers assigned to any set of tasks of the same difficulty. Hence, if the total budget is less than Γε ≤ C′ m λminβ log δmin ε , (10) then no algorithm can achieve average error less than ε, where λmin = mina λa. Compared to the adaptive case in (4) (nearly achieved in (5)), the gain of adaptivity is a factor of λ/λmin. The RHS is negative when δmin < ε, and can be tightened to C′(m/λaβ) log(Pa b=1 δb/ε) where a is the smallest integer such that Pa b=1 δb > ε. Acknowledgements This work is supported by NSF SaTC award CNS-1527754, and NSF CISE award CCF-1553452. 8 References [1] N. Alon and J. H. Spencer. The probabilistic method. John Wiley and Sons, 2004. [2] N. Dalvi, A. Dasgupta, R. Kumar, and V. Rastogi. Aggregating crowdsourced binary ratings. In Proceedings of the 22nd international conference on World Wide Web, pages 285–294, 2013. [3] A. P. Dawid and A. M. Skene. Maximum likelihood estimation of observer error-rates using the em algorithm. Applied statistics, pages 20–28, 1979. [4] A. Ghosh, S. Kale, and P. McAfee. Who moderates the moderators?: crowdsourcing abuse detection in user-generated content. In Proceedings of the 12th ACM conference on Electronic commerce, pages 167–176. ACM, 2011. [5] C. Ho, S. Jabbari, and J. W. Vaughan. Adaptive task assignment for crowdsourced classification. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pages 534–542, 2013. [6] R. Jin and Z. Ghahramani. Learning with multiple labels. In Advances in neural information processing systems, pages 921–928, 2003. [7] 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. [8] D. R. Karger, S. Oh, and D. Shah. Efficient crowdsourcing for multi-class labeling. In Proceedings of the ACM SIGMETRICS/international conference on Measurement and modeling of computer systems, pages 81–92, 2013. [9] D. R. Karger, S. Oh, and D. Shah. Budget-optimal task allocation for reliable crowdsourcing systems. Operations Research, 62:1–24, 2014. [10] H. Li and B. Yu. Error rate bounds and iterative weighted majority voting for crowdsourcing. arXiv preprint arXiv:1411.4086, 2014. [11] Q. Liu, J. Peng, and A. Ihler. Variational inference for crowdsourcing. In Advances in Neural Information Processing Systems 25, pages 701–709, 2012. [12] O. Maron and A. W. Moore. Hoeffding races: Accelerating model selection search for classification and function approximation. Robotics Institute, page 263, 1993. [13] M. Mezard and A. Montanari. Information, physics, and computation. Oxford University Press, 2009. [14] J. Ok, S. Oh, J. Shin, and Y. Yi. Optimality of belief propagation for crowdsourced classification. In International Conference on Machine Learning, 2016. [15] N. B. Shah, S. Balakrishnan, and M. J. Wainwright. A permutation-based model for crowd labeling: Optimal estimation and robustness. arXiv preprint arXiv:1606.09632, 2016. [16] V. S Sheng, F. Provost, and P. G. Ipeirotis. Get another label? improving data quality and data mining using multiple, noisy labelers. In Proceedings of the 14th ACM SIGKDD, pages 614–622. ACM, 2008. [17] P. Smyth, U. Fayyad, M. Burl, P. Perona, and P. Baldi. Inferring ground truth from subjective labelling of venus images. In NIPS, pages 1085–1092, 1995. [18] P. Welinder, S. Branson, S. Belongie, and P. Perona. The multidimensional wisdom of crowds. In Advances in Neural Information Processing Systems, pages 2424–2432, 2010. [19] J. Whitehill, P. Ruvolo, T. Wu, J. Bergsma, and J. Movellan. Whose vote should count more: Optimal integration of labels from labelers of unknown expertise. In Advances in Neural Information Processing Systems, volume 22, pages 2035–2043, 2009. [20] D. Williams. Probability with martingales. Cambridge university press, 1991. [21] Y. Zhang, X. Chen, D. Zhou, and M. I. Jordan. Spectral methods meet em: A provably optimal algorithm for crowdsourcing. In Advances in neural information processing systems, pages 1260–1268, 2014. [22] D. Zhou, Q. Liu, J. C. Platt, C. Meek, and N. B. Shah. Regularized minimax conditional entropy for crowdsourcing. arXiv preprint arXiv:1503.07240, 2015. [23] D. Zhou, J. Platt, S. Basu, and Y. Mao. Learning from the wisdom of crowds by minimax entropy. In Advances in Neural Information Processing Systems 25, pages 2204–2212, 2012. 9
2016
9
6,552
Greedy Feature Construction Dino Oglic† ‡ dino.oglic@uni-bonn.de †Institut für Informatik III Universität Bonn, Germany Thomas Gärtner ‡ thomas.gaertner@nottingham.ac.uk ‡School of Computer Science The University of Nottingham, UK Abstract We present an effective method for supervised feature construction. The main goal of the approach is to construct a feature representation for which a set of linear hypotheses is of sufficient capacity – large enough to contain a satisfactory solution to the considered problem and small enough to allow good generalization from a small number of training examples. We achieve this goal with a greedy procedure that constructs features by empirically fitting squared error residuals. The proposed constructive procedure is consistent and can output a rich set of features. The effectiveness of the approach is evaluated empirically by fitting a linear ridge regression model in the constructed feature space and our empirical results indicate a superior performance of our approach over competing methods. 1 Introduction Every supervised learning algorithm with the ability to generalize from training examples to unseen data points has some type of inductive bias [5]. The bias can be defined as a set of assumptions that together with the training data explain the predictions at unseen points [25]. In order to simplify theoretical analysis of learning algorithms, the inductive bias is often represented by a choice of a hypothesis space (e.g., the inductive bias of linear regression models is the assumption that the relationship between inputs and outputs is linear). The fundamental limitation of learning procedures with an a priori specified hypothesis space (e.g., linear models or kernel methods with a preselected kernel) is that they can learn good concept descriptions only if the hypothesis space selected beforehand is large enough to contain a good solution to the considered problem and small enough to allow good generalization from a small number of training examples. As finding a good hypothesis space is equivalent to finding a good set of features [5], we propose an effective supervised feature construction method to tackle this problem. The main goal of the approach is to embed the data into a feature space for which a set of linear hypotheses is of sufficient capacity. The motivation for this choice of hypotheses is in the desire to exploit the scalability of existing algorithms for training linear models. It is for their scalability that these models are frequently a method of choice for learning on large scale data sets (e.g., the implementation of linear SVM [13] has won the large scale learning challenge at ICML 2008 and KDD CUP 2010). However, as the set of linear hypotheses defined on a small or moderate number of input features is usually of low capacity these methods often learn inaccurate descriptions of target concepts. The proposed approach surmounts this and exploits the scalability of existing algorithms for training linear models while overcoming their low capacity on input features. The latter is achieved by harnessing the information contained in the labeled training data and constructing features by empirically fitting squared error residuals. We draw motivation for our approach by considering the minimization of the expected squared error using functional gradient descent (Section 2.1). In each step of the descent, the current estimator is updated by moving in the direction of the residual function. We want to mimic this behavior by constructing a feature representation incrementally so that for each step of the descent we add a feature which approximates well the residual function. In this constructive process, we select our features from a predetermined set of basis functions which can be chosen so that a high capacity set 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. of linear hypotheses corresponds to the constructed feature space (Section 2.2). In our theoretical analysis of the approach, we provide a convergence rate for this constructive procedure (Section 2.3) and give a generalization bound for the empirical fitting of residuals (Section 2.4). The latter is needed because the feature construction is performed based on an independent and identically distributed sample of labeled examples. The approach, presented in Section 2.5, is highly flexible and allows for an extension of a feature representation without complete re-training of the model. As it performs similar to gradient descent, a stopping criteria based on an accuracy threshold can be devised and the algorithm can then be simulated without specifying the number of features a priori. In this way, the algorithm can terminate sooner than alternative approaches for simple hypotheses. The method is easy to implement and can be scaled to millions of instances with a parallel implementation. To evaluate the effectiveness of our approach empirically, we compare it to other related approaches by training linear ridge regression models in the feature spaces constructed by these methods. Our empirical results indicate a superior performance of the proposed approach over competing methods. The results are presented in Section 3 and the approaches are discussed in Section 4. 2 Greedy feature construction In this section, we present our feature construction approach. We start with an overview where we introduce the problem setting and motivate our approach by considering the minimization of the expected squared error using functional gradient descent. Following this, we define a set of features and demonstrate that the approach can construct a rich set of hypotheses. We then show that our greedy constructive procedure converges and give a generalization bound for the empirical fitting of residuals. The section concludes with a pseudo-code description of our approach. 2.1 Overview We consider a learning problem with the squared error loss function where the goal is to find a mapping from a Euclidean space to the set of reals. In these problems, it is typically assumed that a sample z = ((x1, y1) , . . . , (xm, ym)) of m examples is drawn independently from a Borel probability measure ρ defined on Z = X × Y , where X is a compact subset of a finite dimensional Euclidean space with the dot product ⟨·, ·⟩and Y ⊂R. For every x ∈X let ρ (y | x) be the conditional probability measure on Y and ρX be the marginal probability measure on X. For the sake of brevity, when it is clear from the context, we will write ρ instead of ρX. Let fρ(x) = R y dρ (y | x) be the bounded target/regression function of the measure ρ. Our goal is to construct a feature representation such that there exists a linear hypothesis on this feature space that approximates well the target function. For an estimator f of the function fρ we measure the goodness of fit with the expected squared error in ρ, Eρ (f) = R (f (x) −y)2 dρ. The empirical counterpart of the error, defined over a sample z ∈Zm, is denoted with Ez (f) = 1 m Pm i=1 (f (xi) −yi)2. Having defined the problem setting, we proceed to motivate our approach by considering the minimization of the expected squared error using functional gradient descent. For that, we first review the definition of functional gradient. For a functional F defined on a normed linear space and an element p from this space, the functional gradient ∇F (p) is the principal linear part of a change in F after it is perturbed in the direction of q, F (p + q) = F (p) + ψ (q) + ϵ ∥q∥, where ψ (q) is the linear functional with ∇F (p) as its principal linear part, and ϵ →0 as ∥q∥→0 [e.g., see Section 3.2 in 16]. In our case, the normed space is the Hilbert space of square integrable functions L2 ρ (X) and for the expected squared error functional on this space we have that it holds Eρ (f + ϵq) −Eρ (f) = ⟨2 (f −fρ), ϵq⟩L2ρ(X) + O ϵ2 . Hence, an algorithm for the minimization of the expected squared error using functional gradient descent on this space could be specified as ft+1 = νft + 2 (1 −ν) (fρ −ft) , where 0 ≤ν ≤1 denotes the learning rate and ft is the estimate at step t. The functional gradient direction 2 (fρ −ft) is the residual function at step t and the main idea behind our approach is to iteratively refine our feature representation by extending it with a new feature that matches the current residual function. In this way, for a suitable choice of learning rate ν, the functional descent would be performed through a convex hull of features and in each step we would have an estimate of the target function fρ expressed as a convex combination of the constructed features. 2 2.2 Greedy features We introduce now a set of features parameterized with a ridge basis function and hyperparameters controlling the smoothness of these features. As each subset of features corresponds to a set of hypotheses, in this way we specify a family of possible hypothesis spaces. For a particular choice of ridge basis function we argue below that the approach outlined in the previous section can construct a highly expressive feature representation (i.e., a hypothesis space of high capacity). Let C (X) be the Banach space of continuous functions on X with the uniform norm. For a Lipschitz continuous function φ : R →R, ∥φ∥∞≤1, and constants r, s, t > 0 let FΘ ⊂C (X), Θ = (φ, r, s, t), be a set of ridge-wave functions defined on the set X, FΘ =  a φ (⟨w, x⟩+ b) | w ∈Rd, a, b ∈R, |a| ≤r, ∥w∥2 ≤s, |b| ≤t . From this definition, it follows that for all g ∈FΘ it holds ∥g∥∞≤r. As a ridge-wave function g ∈FΘ is bounded and Lipschitz continuous, it is also square integrable in the measure ρ and g ∈L2 ρ (X). Therefore, FΘ is a subset of the Hilbert space of square integrable functions defined on X with respect to the probability measure ρ, i.e., FΘ ⊂L2 ρ (X). Taking φ (·) = cos (·) in the definition of FΘ we obtain a set of cosine-wave features Fcos =  a cos (⟨w, x⟩+ b) | w ∈Rd, a, b ∈R, |a| ≤r, ∥w∥2 ≤s, |b| ≤t . For this set of features the approach outlined in Section 2.1 can construct a rich set of hypotheses. To demonstrate this we make a connection to shift-invariant reproducing kernel Hilbert spaces and show that the approach can approximate any bounded function from any shift-invariant reproducing kernel Hilbert space. This means that a set of linear hypotheses defined by cosine features can be of high capacity and our approach can overcome the problems with the low capacity of linear hypotheses defined on few input features. A proof of the following theorem is provided in Appendix B. Theorem 1. Let Hk be a reproducing kernel Hilbert space corresponding to a continuous shiftinvariant and positive definite kernel k defined on a compact set X. Let µ be the positive and bounded spectral measure whose Fourier transform is the kernel k. For any probability measure ρ defined on X, it is possible to approximate any bounded function f ∈Hk using a convex combination of n ridge-wave functions from Fcos such that the approximation error in ∥·∥ρ decays with rate O (1/√n). 2.3 Convergence For the purpose of this paper, it suffices to show the convergence of ϵ-greedy sequences of functions (see Definition 1) in Hilbert spaces. We, however, choose to provide a stronger result which holds for ϵ-greedy sequences in uniformly smooth Banach spaces. In the remainder of the paper, co (S) and S will be used to denote the convex hull of elements from a set S and the closure of S, respectively. Definition 1. Let B be a Banach space with norm ∥·∥and let S ⊆B. An incremental sequence is any sequence {fn}n≥1 of elements of B such that f1 ∈S and for each n ≥1 there is some g ∈S so that fn+1 ∈co ({fn, g}). An incremental sequence is greedy with respect to an element f ∈co (S) if for all n ∈N it holds ∥fn+1 −f∥= inf {∥h −f∥| h ∈co ({fn, g}) , g ∈S} . Given a positive sequence of allowed slack terms {ϵn}n≥1, an incremental sequence {fn}n≥1 is called ϵ-greedy with respect to f if for all n ∈N it holds ∥fn+1 −f∥< inf {∥h −f∥| h ∈co ({fn, g}) , g ∈S} + ϵn. Having introduced the notion of an ϵ-greedy incremental sequence of functions, let us now relate it to our feature construction approach. In the outlined constructive procedure (Section 2.1), we proposed to select new features corresponding to the functional gradient at the current estimate of the target function. Now, if at each step of the functional gradient descent there exists a ridge-wave function from our set of features which approximates well the residual function (w.r.t. fρ) then this sequence of functions defines a descent through co (FΘ) which is an ϵ-greedy incremental sequence of functions with respect to fρ ∈co (FΘ). In Section 2.1, we have also demonstrated that FΘ is a subset of the Hilbert space L2 ρ (X) and this is by definition a Banach space. In accordance with Definition 1, we now consider under what conditions an ϵ-greedy sequence of functions from this space converges to any target function fρ ∈co (FΘ). Note that this relates to Theorem 1 which confirms the strength of the result by showing that the capacity of co (FΘ) is large. Before we show the convergence of our constructive procedure, we need to prove that an ϵ-greedy 3 incremental sequence of functions/features can be constructed in our setting. For that, we characterize the Banach spaces in which it is always possible to construct such sequences of functions/features. Definition 2. Let B be a Banach space, B∗the dual space of B, and f ∈B, f ̸= 0. A peak functional for f is a bounded linear operator F ∈B∗such that ∥F∥B∗= 1 and F (f) = ∥f∥B. The Banach space B is said to be smooth if for each f ∈B, f ̸= 0, there is a unique peak functional. The existence of at least one peak functional for all f ∈B, f ̸= 0, is guaranteed by the Hahn-Banach theorem [27]. For a Hilbert space H, for each element f ∈H, f ̸= 0, there exists a unique peak functional F = ⟨f,·⟩H/∥f∥H. Thus, every Hilbert space is a smooth Banach space. Donahue et al. [12, Theorem 3.1] have shown that in smooth Banach spaces – and in particular in the Hilbert space L2 ρ (X) – an ϵ-greedy incremental sequence of functions can always be constructed. However, not every such sequence of functions converges to the function with respect to which it was constructed. For the convergence to hold, a stronger notion of smoothness is needed. Definition 3. The modulus of smoothness of a Banach space B is a function τ : R+ 0 →R+ 0 defined as τ (r) = 1 2 sup∥f∥=∥g∥=1 (∥f + rg∥+ ∥f −rg∥) −1, where f, g ∈B. The Banach space B is said to be uniformly smooth if τ (r) ∈o (r) as r →0. We need to observe now that every Hilbert space is a uniformly smooth Banach space [12]. For the sake of completeness, we provide a proof of this proposition in Appendix B. Proposition 2. For any Hilbert space the modulus of smoothness is equal to τ (r) = √ 1 + r2 −1. Having shown that Hilbert spaces are uniformly smooth Banach spaces, we proceed with two results giving a convergence rate of an ϵ-greedy incremental sequence of functions. What is interesting about these results is the fact that a feature does not need to match exactly the residual function in a greedy descent step (Section 2.1); it is only required that condition (ii) from the next theorem is satisfied. Theorem 3. [Donahue et al., 12] Let B be a uniformly smooth Banach space having modulus of smoothness τ (u) ≤γut, with γ being a constant and t > 1. Let S be a bounded subset of B and let f ∈co (S). Let K > 0 be chosen such that ∥f −g∥≤K for all g ∈S, and let ϵ > 0 be a fixed slack value. If the sequences {fn}n≥1 ⊂co (S) and {gn}n≥1 ⊂S are chosen recursively so that: (i) f1 ∈ S, (ii) Fn (gn −f) ≤2γ((K+ϵ)t−Kt)/nt−1∥fn−f∥t−1, and (iii) fn+1 = n/n+1 fn + 1/n+1 gn, where Fn is the peak functional of fn −f, then it holds ∥fn −f∥≤(2γt) 1/t(K+ϵ) n1−1/t h 1 + (t−1) log2 n 2tn i1/t . The following corollary gives a convergence rate for an ϵ-greedy incremental sequence of functions constructed according to Theorem 3 with respect to fρ ∈co (FΘ). As this result (a proof is given in Appendix B) holds for all such sequences of functions, it also holds for our constructive procedure. Corollary 4. Let {fn}n≥1 ⊂co (FΘ) be an ϵ-greedy incremental sequence of functions constructed according to the procedure described in Theorem 3 with respect to a function f ∈co (FΘ) . Then, it holds ∥fn −f∥ρ ≤ (K+ϵ)√ 2+log2 n/2n √n . 2.4 Generalization bound In step t + 1 of the empirical residual fitting, based on a sample {(xi, yi −ft (xi))}m i=1, the approach selects a ridge-wave function from FΘ that approximates well the residual function (fρ −ft). In the last section, we have specified in which cases such ridge-wave functions can be constructed and provided a convergence rate for this constructive procedure. As the convergence result is not limited to target functions from FΘ and co (FΘ), we give a bound on the generalization error for hypotheses from F = co (FΘ), where the closure is taken with respect to C (X). Before we give a generalization bound, we show that our hypothesis space F is a convex and compact set of functions. The choice of a compact hypothesis space is important because it guarantees that a minimizer of the expected squared error Eρ and its empirical counterpart Ez exists. In particular, a continuous function attains its minimum and maximum value on a compact set and this guarantees the existence of minimizers of Eρ and Ez. Moreover, for a hypothesis space that is both convex and compact, the minimizer of the expected squared error is unique as an element of L2 ρ (X). A simple proof of the uniqueness of such a minimizer in L2 ρ (X) and the continuity of the functionals Eρ and Ez can be found in [9]. For the sake of completeness, we provide a proof in Appendix A as Proposition A.2. The following proposition (a proof is given in Appendix B) shows that our hypothesis space is a convex and compact subset of the metric space C (X). 4 Algorithm 1 GREEDYDESCENT Input: sample z = {(xi, yi)}s i=1, initial estimates at sample points {f0,i}s i=1, ridge basis function φ, maximum number of descent steps p, regularization parameter λ, and precision ϵ 1: W ←∅ 2: for k = 1, 2, . . . , p do 3: wk, ck ←arg minw,c=(c′,c′′) Ps i=1 c′fk−1,i + c′′φ w⊤xi  −yi 2 + λΩ(c, w) 4: W ←W ∪{wk} and fk,i ←c′ kfk−1,i + c′′ kφ w⊤ k xi  , i = 1, . . . , s 5: if |Ez(fk)−Ez(fk−1)|/max{Ez(fk),Ez(fk−1)} < ϵ then EXIT FOR LOOP end if 6: end for 7: return W Proposition 5. The hypothesis space F is a convex and compact subset of the metric space C(X). Moreover, the elements of this hypothesis space are Lipschitz continuous functions. Having established that the hypothesis space is a compact set, we can now give a generalization bound for learning with this hypothesis space. The fact that the hypothesis space is compact implies that it is also a totally bounded set [27], i.e., for all ϵ > 0 there exists a finite ϵ-net of F. This, on the other hand, allows us to derive a sample complexity bound by using the ϵ-covering number of a space as a measure of its capacity [21]. The following theorem and its corollary (proofs are provided in Appendix B) give a generalization bound for learning with the hypothesis space F. Theorem 6. Let M > 0 such that, for all f ∈F, |f (x) −y| ≤M almost surely. Then, for all ϵ > 0 P [Eρ (fz) −Eρ (f ∗) ≤ϵ] ≥1 −N (F, ϵ/24M, ∥·∥∞) exp (−mϵ/288M 2) , where fz and f ∗are the minimizers of Ez and Eρ on the set F, z ∈Zm, and N (F, ϵ, ∥·∥∞) denotes the ϵ-covering number of F w.r.t. C (X). Corollary 7. For all ϵ > 0 and all δ > 0, with probability 1 −δ, a minimizer of the empirical squared error on the hypothesis space F is (ϵ, δ)-consistent when the number of samples m ∈ Ω r (Rs + t) Lφ 1 ϵ2 + 1 ϵ ln 1 δ  . Here, R is the radius of a ball containing the set of instances X in its interior, Lφ is the Lipschitz constant of a function φ, and r, s, and t are hyperparameters of FΘ. 2.5 Algorithm Algorithm 1 is a pseudo-code description of the outlined approach. To construct a feature space with a good set of linear hypotheses the algorithm takes as input a set of labeled examples and an initial empirical estimate of the target function. A dictionary of features is specified with a ridge basis function and the smoothness of individual features is controlled with a regularization parameter. Other parameters of the algorithm are the maximum allowed number of descent steps and a precision term that defines the convergence of the descent. As outlined in Sections 2.1 and 2.3, the algorithm works by selecting a feature that matches the residual function at the current estimate of the target function. For each selected feature the algorithm also chooses a suitable learning rate and performs a functional descent step (note that we are inferring the learning rate instead of setting it to 1/n+1 as in Theorem 3). To avoid solving these two problems separately, we have coupled both tasks into a single optimization problem (line 3) – we fit a linear model to a feature representation consisting of the current empirical estimate of the target function and a ridge function parameterized with a d-dimensional vector w. The regularization term Ωis chosen to control the smoothness of the new feature and avoid over-fitting. The optimization problem over the coefficients of the linear model and the spectrum of the ridge basis function is solved by casting it as a hyperparameter optimization problem [20]. For the sake of completeness, we have provided a detailed derivation in Appendix C. While the hyperparameter optimization problem is in general non-convex, Theorem 3 indicates that a globally optimal solution is not (necessarily) required and instead specifies a weaker condition. To account for the non-convex nature of the problem and compensate for the sequential generation of features, we propose to parallelize the feature construction process by running several instances of the greedy descent simultaneously. A pseudo-code description of this parallelized approach is given in Algorithm 2. The algorithm takes as input parameters required for running the greedy descent and some parameters specific to the parallelization scheme – number of data passes and available machines/cores, regularization parameter for the fitting of linear models in the constructed feature space, and cut-off parameter for the elimination of redundant features. The whole process is started by adding a bias feature and setting the initial empirical estimates at sample points to the mean value of the outputs (line 1). Following this, the algorithm mimics stochastic gradient descent and makes 5 Algorithm 2 GREEDY FEATURE CONSTRUCTION (GFC) Input: sample z = {(xi, yi)}m i=1, ridge basis function φ, number of data passes T, maximum number of greedy descent steps p, number of machines/cores M, regularization parameters λ and ν, precision ϵ, and feature cut-off threshold η 1: W ←{0} and f0,k ← 1 m Pm i=1 yi, k = 1, . . . , m 2: for i = 1, . . . , T do 3: for j = 1, 2, . . . , M parallel do 4: Sj ∼U{1,2,...,m} and W ←W ∪GREEDYDESCENT  {(xk, yk)}k∈Sj ,  fi−1,k k∈Sj , φ, p, λ, ϵ  5: end for 6: a∗←arg mina Pm k=1 P|W | l=1 alφ w⊤ l xk  −yk 2 + ν ∥a∥2 2 7: W ←W \  wl ∈W | |a∗ l | < η, 1 ≤l ≤|W| and fi,k ←P|W | l=1 a∗ l φ w⊤ l xk  , k = 1, . . . , m 8: end for 9: return (W, a∗) a specified number of passes through the data (line 2). In the first step of each pass, the algorithm performs greedy functional descent in parallel using a pre-specified number of machines/cores M (lines 3-5). This step is similar to the splitting step in parallelized stochastic gradient descent [32]. Greedy descent is performed on each of the machines for a maximum number of iterations p and the estimated parameter vectors are added to the set of constructed features W (line 4). After the features have been learned the algorithm fits a linear model to obtain the amplitudes (line 6). To fit a linear model, we use least square regression penalized with the l2-norm because it can be solved in a closed form and cross-validation of the capacity parameter involves optimizing a 1-dimensional objective function [20]. Fitting of the linear model can be understood as averaging of the greedy approximations constructed on different chunks of the data. At the end of each pass, the empirical estimates at sample points are updated and redundant features are removed (line 7). One important detail in the implementation of Algorithm 1 is the data splitting between the training and validation samples for the hyperparameter optimization. In particular, during the descent we are more interested in obtaining a good spectrum than the amplitude because a linear model will be fit in Algorithm 2 over the constructed features and the amplitude values will be updated. For this reason, during the hyperparameter optimization over a k-fold splitting in Algorithm 1, we choose a single fold as the training sample and a batch of folds as the validation sample. 3 Experiments In this section, we assess the performance of our approach (see Algorithm 2) by comparing it to other feature construction approaches on synthetic and real-world data sets. We evaluate the effectiveness of the approach with the set of cosine-wave features introduced in Section 2.2. For this set of features, our approach is directly comparable to random Fourier features [26] and á la carte [31]. The implementation details of the three approaches are provided in Appendix C. We address here the choice of the regularization term in Algorithm 1: To control the smoothness of newly constructed features, we penalize the objective in line 3 so that the solutions with the small L2 ρ (X) norm are preferred. For this choice of regularization term and cosine-wave features, we empirically observe that the optimization objective is almost exclusively penalized by the l2 norm of the coefficient vector c. Following this observation, we have simulated the greedy descent with Ω(c, w) = ∥c∥2 2. We now briefly describe the data sets and the experimental setting. The experiments were conducted on three groups of data sets. The first group contains four UCI data sets on which we performed parameter tuning of all three algorithms (Table 1, data sets 1-4). The second group contains the data sets with more than 5000 instances available from Luís Torgo [28]. The idea is to use this group of data sets to test the generalization properties of the considered algorithms (Table 1, data sets 5-10). The third group contains two artificial and very noisy data sets that are frequently used in regression tree benchmark tests. For each considered data set, we split the data into 10 folds; we refer to these splits as the outer cross-validation folds. In each step of the outer cross-validation, we use nine folds as the training sample and one fold as the test sample. For the purpose of the hyperparameter tuning we split the training sample into five folds; we refer to these splits as the inner cross-validation folds. We run all algorithms on identical outer cross-validation folds and construct feature representations with 100 and 500 features. The performance of the algorithms is assessed by comparing the root mean squared error of linear ridge regression models trained in the constructed feature spaces and the average time needed for the outer cross-validation of one fold. 6 Table 1: To facilitate the comparison between data sets we have normalized the outputs so that their range is one. The accuracy of the algorithms is measured using the root mean squared error, multiplied by 100 to mimic percentage error (w.r.t. the range of the outputs). The mean and standard deviation of the error are computed after performing 10-fold cross-validation. The reported walltime is the average time it takes a method to cross-validate one fold. To assess whether a method performs statistically significantly better than the other on a particular data set we perform the paired Welch t-test [29] with p = 0.05. The significantly better results for the considered settings are marked in bold. DATASET m d n = 100 n = 500 GFC ALC GFC ALC ERROR WALLTIME ERROR WALLTIME ERROR WALLTIME ERROR WALLTIME parkinsons tm (total) 5875 21 2.73 (±0.19) 00 : 03 : 49 0.78 (±0.13) 00 : 05 : 19 2.20 (±0.27) 00 : 04 : 15 0.31 (±0.17) 00 : 27 : 15 ujindoorloc (latitude) 21048 527 3.17 (±0.15) 00 : 21 : 39 6.19 (±0.76) 01 : 21 : 58 3.04 (±0.19) 00 : 36 : 49 6.99 (±0.97) 02 : 23 : 15 ct-slice 53500 380 2.93 (±0.10) 00 : 52 : 05 3.82 (±0.64) 03 : 31 : 25 2.59 (±0.10) 01 : 24 : 41 2.73 (±0.29) 06 : 11 : 12 Year Prediction MSD 515345 90 10.06 (±0.09) 01 : 20 : 12 9.94 (±0.08) 05 : 29 : 14 10.01 (±0.08) 01 : 30 : 28 9.92 (±0.07) 11 : 58 : 41 delta-ailerons 7129 5 3.82 (±0.24) 00 : 01 : 23 3.73 (±0.20) 00 : 05 : 13 3.79 (±0.25) 00 : 01 : 57 3.73 (±0.24) 00 : 25 : 14 kinematics 8192 8 5.18 (±0.09) 00 : 04 : 02 5.03 (±0.23) 00 : 11 : 28 4.65 (±0.11) 00 : 04 : 44 5.01 (±0.76) 00 : 38 : 53 cpu-activity 8192 21 2.65 (±0.12) 00 : 04 : 23 2.68 (±0.27) 00 : 09 : 24 2.60 (±0.16) 00 : 04 : 24 2.62 (±0.15) 00 : 25 : 13 bank 8192 32 9.83 (±0.27) 00 : 01 : 39 9.84 (±0.30) 00 : 12 : 48 9.83 (±0.30) 00 : 02 : 01 9.87 (±0.42) 00 : 49 : 48 pumadyn 8192 32 3.44 (±0.10) 00 : 02 : 24 3.24 (±0.07) 00 : 13 : 17 3.30 (±0.06) 00 : 02 : 27 3.42 (±0.15) 00 : 57 : 33 delta-elevators 9517 6 5.26 (±0.17) 00 : 00 : 57 5.28 (±0.18) 00 : 07 : 07 5.24 (±0.17) 00 : 01 : 04 5.23 (±0.18) 00 : 32 : 30 ailerons 13750 40 4.67 (±0.18) 00 : 02 : 56 4.89 (±0.43) 00 : 16 : 34 4.51 (±0.12) 00 : 02 : 11 4.77 (±0.40) 01 : 05 : 07 pole-telecom 15000 26 7.34 (±0.29) 00 : 10 : 45 7.16 (±0.55) 00 : 20 : 34 5.55 (±0.15) 00 : 11 : 37 5.20 (±0.51) 01 : 39 : 22 elevators 16599 18 3.34 (±0.08) 00 : 03 : 16 3.37 (±0.55) 00 : 21 : 20 3.12 (±0.20) 00 : 04 : 06 3.13 (±0.24) 01 : 20 : 58 cal-housing 20640 8 11.55 (±0.24) 00 : 05 : 49 12.69 (±0.47) 00 : 11 : 14 11.17 (±0.25) 00 : 06 : 16 12.70 (±1.01) 01 : 01 : 37 breiman 40768 10 4.01 (±0.03) 00 : 02 : 46 4.06 (±0.04) 00 : 13 : 52 4.01 (±0.03) 00 : 03 : 04 4.03 (±0.03) 01 : 04 : 16 friedman 40768 10 3.29 (±0.09) 00 : 06 : 07 3.37 (±0.46) 00 : 18 : 43 3.16 (±0.03) 00 : 07 : 04 3.25 (±0.09) 01 : 39 : 37 An extensive summary containing the results of experiments with the random Fourier features approach (corresponding to Gaussian, Laplace, and Cauchy kernels) and different configurations of á la carte is provided in Appendix D. As the best performing configuration of á la carte on the development data sets is the one with Q = 5 components, we report in Table 1 the error and walltime for this configuration. From the walltime numbers we see that our approach is in both considered settings – with 100 and 500 features – always faster than á la carte. Moreover, the proposed approach is able to generate a feature representation with 500 features in less time than required by á la carte for a representation of 100 features. In order to compare the performance of the two methods with respect to accuracy, we use the Wilcoxon signed rank test [30, 11]. As our approach with 500 features is on all data sets faster than á la carte with 100 features, we first compare the errors obtained in these experiments. For 95% confidence, the threshold value of the Wilcoxon signed rank test with 16 data sets is T = 30 and from our results we get the T-value of 28. As the T-value is below the threshold, our algorithm can with 95% confidence generate in less time a statistically significantly better feature representation than á la carte. For the errors obtained in the settings where both methods have the same number of features, we obtain the T-values of 60 and 42. While in the first case for the setting with 100 features the test is inconclusive, in the second case our approach is with 80% confidence statistically significantly more accurate than á la carte. To evaluate the performance of the approaches on individual data sets, we perform the paired Welch t-test [29] with p = 0.05. Again, the results indicate a good/competitive performance of our algorithm compared to á la carte. 4 Discussion In this section, we discuss the advantages of the proposed method over the state-of-the-art baselines in learning fast shift-invariant kernels and other related approaches. Flexibility. The presented approach is a highly flexible supervised feature construction method. In contrast to an approach based on random Fourier features [26], the proposed method does not require a spectral measure to be specified a priori. In the experiments (details can be found in Appendix D), we have demonstrated that the choice of spectral measure is important as, for the considered measures (corresponding to Gaussian, Laplace, and Cauchy kernels), the random Fourier features approach is outperformed on all data sets. The second competing method, á la carte, is more flexible when it comes to the choice of spectral measure and works by approximating it with a mixture of Gaussians. However, the number of components and features per component needs to be specified beforehand or cross-validated. In contrast, our approach mimics functional gradient descent and can be simulated without specifying the size of the feature representation beforehand. Instead, a stopping criteria (see, e.g., Algorithm 1) based on the successive decay of the error can be devised. As a result, the proposed approach terminates sooner than the alternative approaches for simple concepts/hypothesis. The proposed method is also easy to implement (for the sake of completeness, the hyperparameter gradients are provided in Appendix C.1) and allows us to extend the existing feature representation without complete re-training of the model. We note that the approaches based on random Fourier 7 features are also simple to implement and can be re-trained efficiently with the increase in the number of features [10]. Á la carte, on the other hand, is less flexible in this regard – due to the number of hyperparameters and the complexity of gradients it is not straightforward to implement this method. Scalability. The fact that our greedy descent can construct a feature in time linear in the number of instances m and dimension of the problem d makes the proposed approach highly scalable. In particular, the complexity of the proposed parallelization scheme is dominated by the cost of fitting a linear model and the whole algorithm runs in time O T n3 + n2m + nmd  , where T denotes the number of data passes (i.e., linear model fits) and n number of constructed features. To scale this scheme to problems with millions of instances, it is possible to fit linear models using the parallelized stochastic gradient descent [32]. As for the choice of T, the standard setting in simulations of stochastic gradient descent is 5-10 data passes. Thus, the presented approach is quite robust and can be applied to large scale data sets. In contrast to this, the cost of performing a gradient step in the hyperparameter optimization of á la carte is O n3 + n2m + nmd  . In our empirical evaluation using an implementation with 10 random restarts, the approach needed at least 20 steps per restart to learn an accurate model. The required number of gradient steps and the cost of computing them hinder the application of á la carte to large scale data sets. In learning with random Fourier features which also run in time O n3 + n2m + nmd  , the main cost is the fitting of linear models – one for each pair of considered spectral and regularization parameters. Other approaches. Beside fast kernel learning approaches, the presented method is also related to neural networks parameterized with a single hidden layer. These approaches can be seen as feature construction methods jointly optimizing over the whole feature representation. A detailed study of the approximation properties of a hypothesis space of a single layer network with the sigmoid ridge function has been provided by Barron [4]. In contrast to these approaches, we construct features incrementally by fitting residuals and we do this with a set of non-monotone ridge functions as a dictionary of features. Regarding our generalization bound, we note that the past work on single layer neural networks contains similar results but in the context of monotone ridge functions [1]. As the goal of our approach is to construct a feature space for which linear hypotheses will be of sufficient capacity, the presented method is also related to linear models working with low-rank kernel representations. For instance, Fine and Scheinberg [14] investigate a training algorithm for SVMs using low-rank kernel representations. The difference between our approach and this method is in the fact that the low-rank decomposition is performed without considering the labels. Side knowledge and labels are considered by Kulis et al. [22] and Bach and Jordan [3] in their approaches to construct a low-rank kernel matrix. However, these approaches are not selecting features from a set of ridge functions, but find a subspace of a preselected kernel feature space with a good set of hypothesis. From the perspective of the optimization problem considered in the greedy descent (Algorithm 1) our approach can be related to single index models (SIM) where the goal is to learn a regression function that can be represented as a single monotone ridge function [19, 18]. In contrast to these models, our approach learns target/regression functions from the closure of the convex hull of ridge functions. Typically, these target functions cannot be written as single ridge functions. Moreover, our ridge functions do not need to be monotone and are more general than the ones considered in SIM models. In addition to these approaches and considered baseline methods, the presented feature construction approach is also related to methods optimizing expected loss functions using functional gradient descent [23]. However, while Mason et al. [23] focus on classification problems and hypothesis spaces with finite VC dimension, we focus on the estimation of regression functions in spaces with infinite VC dimension (e.g., see Section 2.2). In contrast to that work, we provide a convergence rate for our approach. Similarly, Friedman [15] has proposed a gradient boosting machine for greedy function estimation. In their approach, the empirical functional gradient is approximated by a weak learner which is then combined with previously constructed learners following a stagewise strategy. This is different from the stepwise strategy that is followed in our approach where previously constructed estimators are readjusted when new features are added. The approach in [15] is investigated mainly in the context of regression trees, but it can be adopted to feature construction. To the best of our knowledge, theoretical and empirical properties of this approach in the context of feature construction and shift-invariant reproducing kernel Hilbert spaces have not been considered so far. Acknowledgment: We are grateful for access to the University of Nottingham High Performance Computing Facility. A part of this work was also supported by the German Science Foundation (grant number GA 1615/1-1). 8 References [1] Martin Anthony and Peter L. Bartlett. Neural Network Learning: Theoretical Foundations. Cambridge University Press, 2009. [2] Nachman Aronszajn. Theory of reproducing kernels. Transactions of the American Math. Society, 1950. [3] Francis R. Bach and Michael I. Jordan. Predictive low-rank decomposition for kernel methods. In Proceedings of the 22nd International Conference on Machine Learning. [4] Andrew R. Barron. Universal approximation bounds for superpositions of a sigmoidal function. IEEE Transactions on Information Theory, 39(3), 1993. [5] Jonathan Baxter. A model of inductive bias learning. Journal of Artificial Intelligence Research, 12, 2000. [6] Alain Bertinet and Thomas C. Agnan. Reproducing Kernel Hilbert Spaces in Probability and Statistics. Kluwer Academic Publishers, 2004. [7] Salomon Bochner. Vorlesungen über Fouriersche Integrale. In Akademische Verlagsgesellschaft, 1932. [8] Bernd Carl and Irmtraud Stephani. Entropy, Compactness, and the Approximation of Operators. Cambridge University Press, 1990. [9] Felipe Cucker and Steve Smale. On the mathematical foundations of learning. Bulletin of the American Mathematical Society, 39, 2002. [10] Bo Dai, Bo Xie, Niao He, Yingyu Liang, Anant Raj, Maria-Florina Balcan, and Le Song. Scalable kernel methods via doubly stochastic gradients. In Advances in Neural Information Processing Systems 27. [11] Janez Demšar. Statistical comparisons of classifiers over multiple data sets. Journal of Machine Learning Research, 7, 2006. [12] Michael J. Donahue, Christian Darken, Leonid Gurvits, and Eduardo Sontag. Rates of convex approximation in non-Hilbert spaces. Constructive Approximation, 13(2), 1997. [13] Rong-En Fan, Kai-Wei Chang, Cho-Jui Hsieh, Xiang-Rui Wang, and Chih-Jen Lin. LIBLINEAR: A library for large linear classification. Journal of Machine Learning Research, 9, 2008. [14] Shai Fine and Katya Scheinberg. Efficient SVM training using low-rank kernel representations. Journal of Machine Learning Research, 2, 2002. [15] Jerome H. Friedman. Greedy function approximation: A gradient boosting machine. The Annals of Statistics, 29, 2000. [16] Israel M. Gelfand and Sergei V. Fomin. Calculus of variations. Prentice-Hall Inc., 1963. [17] Marc G. Genton. Classes of kernels for machine learning: A statistics perspective. Journal of Machine Learning Research, 2, 2002. [18] Sham M. Kakade, Varun Kanade, Ohad Shamir, and Adam T. Kalai. Efficient learning of generalized linear and single index models with isotonic regression. In Advances in Neural Information Processing Systems 24, 2011. [19] Adam T. Kalai and Ravi Sastry. The isotron algorithm: High-dimensional isotonic regression. In Proceedings of the Conference on Learning Theory, 2009. [20] Sathiya Keerthi, Vikas Sindhwani, and Olivier Chapelle. An efficient method for gradient-based adaptation of hyperparameters in SVM models. In Advances in Neural Information Processing Systems 19, 2006. [21] Andrey N. Kolmogorov and Vladimir M. Tikhomirov. ϵ-entropy and ϵ-capacity of sets in function spaces. Uspehi Matematicheskikh Nauk, 14(2), 1959. [22] Brian Kulis, Mátyás Sustik, and Inderjit Dhillon. Learning low-rank kernel matrices. In Proceedings of the 23rd International Conference on Machine Learning, 2006. [23] Llew Mason, Jonathan Baxter, Peter L. Bartlett, and Marcus Frean. Functional gradient techniques for combining hypotheses. In Advances in large margin classifiers. MIT Press, 1999. [24] Sebastian Mayer, Tino Ullrich, and Jan Vybiral. Entropy and sampling numbers of classes of ridge functions. Constructive Approximation, 42(2), 2015. [25] Tom M. Mitchell. Machine Learning. McGraw-Hill, 1997. [26] Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in Neural Information Processing Systems 20. [27] Walter Rudin. Functional Analysis. Int. Series in Pure and Applied Mathematics. McGraw-Hill Inc., 1991. [28] Luís Torgo. Repository with regression data sets. http://www.dcc.fc.up.pt/~ltorgo/ Regression/DataSets.html, accessed September 22, 2016. [29] Bernard L. Welch. The generalization of student’s problem when several different population variances are involved. Biometrika, 34(1/2), 1947. [30] Frank Wilcoxon. Individual comparisons by ranking methods. Biometrics Bulletin, 1(6), 1945. [31] Zichao Yang, Alexander J. Smola, Le Song, and Andrew G. Wilson. Á la carte—Learning fast kernels. In Proceedings of the 18th International Conference on Artificial Intelligence and Statistics, 2015. [32] Martin A. Zinkevich, Alex J. Smola, Markus Weimer, and Lihong Li. Parallelized stochastic gradient descent. In Advances in Neural Information Processing Systems 23, 2010. 9
2016
90
6,553
Dynamic Network Surgery for Efficient DNNs Yiwen Guo∗ Intel Labs China yiwen.guo@intel.com Anbang Yao Intel Labs China anbang.yao@intel.com Yurong Chen Intel Labs China yurong.chen@intel.com Abstract Deep learning has become a ubiquitous technology to improve machine intelligence. However, most of the existing deep models are structurally very complex, making them difficult to be deployed on the mobile platforms with limited computational power. In this paper, we propose a novel network compression method called dynamic network surgery, which can remarkably reduce the network complexity by making on-the-fly connection pruning. Unlike the previous methods which accomplish this task in a greedy way, we properly incorporate connection splicing into the whole process to avoid incorrect pruning and make it as a continual network maintenance. The effectiveness of our method is proved with experiments. Without any accuracy loss, our method can efficiently compress the number of parameters in LeNet-5 and AlexNet by a factor of 108× and 17.7× respectively, proving that it outperforms the recent pruning method by considerable margins. Code and some models are available at https://github.com/yiwenguo/Dynamic-Network-Surgery. 1 Introduction As a family of brain inspired models, deep neural networks (DNNs) have substantially advanced a variety of artificial intelligence tasks including image classification [13, 19, 11], natural language processing, speech recognition and face recognition. Despite these tremendous successes, recently designed networks tend to have more stacked layers, and thus more learnable parameters. For instance, AlexNet [13] designed by Krizhevsky et al. has 61 million parameters to win the ILSVRC 2012 classification competition, which is over 100 times more than that of LeCun’s conventional model [15] (e.g., LeNet-5), let alone the much more complex models like VGGNet [19]. Since more parameters means more storage requirement and more floating-point operations (FLOPs), it increases the difficulty of applying DNNs on mobile platforms with limited memory and processing units. Moreover, the battery capacity can be another bottleneck [9]. Although DNN models normally require a vast number of parameters to guarantee their superior performance, significant redundancies have been reported in their parameterizations [4]. Therefore, with a proper strategy, it is possible to compress these models without significantly losing their prediction accuracies. Among existing methods, network pruning appears to be an outstanding one due to its surprising ability of accuracy loss prevention. For instance, Han et al. [9] recently propose to make "lossless" DNN compression by deleting unimportant parameters and retraining the remaining ones (as illustrated in Figure 1(b)), somehow similar to a surgery process. However, due to the complex interconnections among hidden neurons, parameter importance may change dramatically once the network surgery begins. This leads to two main issues in [9] (and some other classical methods [16, 10] as well). The first issue is the possibility of irretrievable network ∗This work was done when Yiwen Guo was an intern at Intel Labs China supervised by Anbang Yao who is responsible for correspondence. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. damage. Since the pruned connections have no chance to come back, incorrect pruning may cause severe accuracy loss. In consequence, the compression rate must be over suppressed to avoid such loss. Another issue is learning inefficiency. As in the paper [9], several iterations of alternate pruning and retraining are necessary to get a fair compression rate on AlexNet, while each retraining process consists of millions of iterations, which can be very time consuming. In this paper, we attempt to address these issues and pursue the compression limit of the pruning method. To be more specific, we propose to sever redundant connections by means of continual network maintenance, which we call dynamic network surgery. The proposed method involves two key operations: pruning and splicing, conducted with two different purposes. Apparently, the pruning operation is made to compress network models, but over pruning or incorrect pruning should be responsible for the accuracy loss. In order to compensate the unexpected loss, we properly incorporate the splicing operation into network surgery, and thus enabling connection recovery once the pruned connections are found to be important any time. These two operations are integrated together by updating parameter importance whenever necessary, making our method dynamic. In fact, the above strategies help to make the whole process flexible. They are beneficial not only to better approach the compression limit, but also to improve the learning efficiency, which will be validated in Section 4. In our method, pruning and splicing naturally constitute a circular procedure and dynamically divide the network connections into two categories, akin to the synthesis of excitatory and inhibitory neurotransmitter in human nervous systems [17]. The rest of this paper is structured as follows. In Section 2, we introduce the related methods of DNN compression by briefly discussing their merits and demerits. In Section 3, we highlight our intuition of dynamic network surgery and introduce its implementation details. Section 4 experimentally analyses our method and Section 5 draws the conclusions. (a) (b) Figure 1: The pipeline of (a) our dynamic network surgery and (b) Han et al.’s method [9], using AlexNet as an example. [9] needs more than 4800K iterations to get a fair compression rate (9×), while our method runs only 700K iterations to yield a significantly better result (17.7×) with comparable prediction accuracy. 2 Related Works In order to make DNN models portable, a variety of methods have been proposed. Vanhoucke et al. [20] analyse the effectiveness of data layout, batching and the usage of Intel fixed-point instructions, making a 3× speedup on x86 CPUs. Mathieu et al. [18] explore the fast Fourier transforms (FFTs) on GPUs and improve the speed of CNNs by performing convolution calculations in the frequency domain. An alternative category of methods resorts to matrix (or tensor) decomposition. Denil et al. [4] propose to approximate parameter matrices with appropriately constructed low-rank decompositions. Their method achieves 1.6× speedup on the convolutional layer with 1% drop in prediction accuracy. Following similar ideas, some subsequent methods can provide more significant speedups [5, 22, 14]. Although matrix (or tensor) decomposition can be beneficial to DNN compression and speedup, these methods normally incur severe accuracy loss under high compression requirement. Vector quantization is another way to compress DNNs. Gong et al. [6] explore several such methods and point out the effectiveness of product quantization. HashNet proposed by Chen et al. [1] handles network compression by grouping its parameters into hash buckets. It is trained with a standard backpropagation procedure and should be able to make substantial storage savings. The recently 2 Figure 2: Overview of the dynamic network surgery for a model with parameter redundancy. proposed BinaryConnect [2] and Binarized Neural Networks [3] are able to compress DNNs by a factor of 32×, while a noticeable accuracy loss is sort of inevitable. This paper follows the idea of network pruning. It starts from the early work of LeCun et al.’s [16], which makes use of the second derivatives of loss function to balance training loss and model complexity. As an extension, Hassibi and Stork [10] propose to take non-diagonal elements of the Hessian matrix into consideration, producing compression results with less accuracy loss. In spite of their theoretical optimization, these two methods suffer from the high computational complexity when tackling large networks, regardless of the accuracy drop. Very recently, Han et al. [9] explore the magnitude-based pruning in conjunction with retraining, and report promising compression results without accuracy loss. It has also been validated that the sparse matrix-vector multiplication can further be accelerated by certain hardware design, making it more efficient than traditional CPU and GPU calculations [7]. The drawback of Han et al.’s method [9] is mostly its potential risk of irretrievable network damage and learning inefficiency. Our research on network pruning is partly inspired by [9], not only because it can be very effective to compress DNNs, but also because it makes no assumption on the network structure. In particular, this branch of methods can be naturally combined with many other methods introduced above, to further reduce the network complexity. In fact, Han et al. [8] have already tested such combinations and obtained excellent results. 3 Dynamic Network Surgery In this section, we highlight the intuition of our method and present its implementation details. In order to simplify the explanations, we only talk about the convolutional layers and the fully connected layers. However, as claimed in [8], our pruning method can also be applied to some other layer types as long as their underlying mathematical operations are inner products on vector spaces. 3.1 Notations First of all, we clarify the notations in this paper. Suppose a DNN model can be represented as {Wk : 0 ≤k ≤C}, in which Wk denotes a matrix of connection weights in the kth layer. For the fully connected layers with p-dimensional input and q-dimensional output, the size of Wk is simply qk × pk. For the convolutional layers with learnable kernels, we unfold the coefficients of each kernel into a vector and concatenate all of them to Wk as a matrix. In order to represent a sparse model with part of its connections pruned away, we use {Wk, Tk : 0 ≤ k ≤C}. Each Tk is a binary matrix with its entries indicating the states of network connections, i.e., whether they are currently pruned or not. Therefore, these additional matrices can be considered as the mask matrices. 3.2 Pruning and Splicing Since our goal is network pruning, the desired sparse model shall be learnt from its dense reference. Apparently, the key is to abandon unimportant parameters and keep the important ones. However, the parameter importance (i.e., the connection importance) in a certain network is extremely difficult 3 to measure because of the mutual influences and mutual activations among interconnected neurons. That is, a network connection may be redundant due to the existence of some others, but it will soon become crucial once the others are removed. Therefore, it should be more appropriate to conduct a learning process and continually maintain the network structure. Taking the kth layer as an example, we propose to solve the following optimization problem: min Wk,Tk L (Wk ⊙Tk) s.t. T(i,j) k = hk(W(i,j) k ), ∀(i, j) ∈I, (1) in which L(·) is the network loss function, ⊙indicates the Hadamard product operator, set I consists of all the entry indices in matrix Wk, and hk(·) is a discriminative function, which satisfies hk(w) = 1 if parameter w seems to be crucial in the current layer, and 0 otherwise. Function hk(·) is designed on the base of some prior knowledge so that it can constrain the feasible region of Wk ⊙Tk and simplify the original NP-hard problem. For the sake of topic conciseness, we leave the discussions of function hk(·) in Section 3.3. Problem (1) can be solved by alternately updating Wk and Tk through the stochastic gradient descent (SGD) method, which will be introduced in the following paragraphs. Since binary matrix Tk can be determined with the constraints in (1), we only need to investigate the update scheme of Wk. Inspired by the method of Lagrange Multipliers and gradient descent, we give the following scheme for updating Wk. That is, W(i,j) k ←W(i,j) k −β ∂ ∂(W(i,j) k T(i,j) k ) L (Wk ⊙Tk) , ∀(i, j) ∈I, (2) in which β indicates a positive learning rate. It is worth mentioning that we update not only the important parameters, but also the ones corresponding to zero entries of Tk, which are considered unimportant and ineffective to decrease the network loss. This strategy is beneficial to improve the flexibility of our method because it enables the splicing of improperly pruned connections. The partial derivatives in formula (2) can be calculated by the chain rule with a randomly chosen minibatch of samples. Once matrix Wk and Tk are updated, they shall be applied to re-calculate the whole network activations and loss function gradient. Repeat these steps iteratively, the sparse model will be able to produce excellent accuracy. The above procedure is summarized in Algorithm 1. Algorithm 1 Dynamic network surgery: the SGD method for solving optimization problem (1): Input: X: training datum (with or without label), {c Wk : 0 ≤k ≤C}: the reference model, α: base learning rate, f: learning policy. Output: {Wk, Tk : 0 ≤k ≤C}: the updated parameter matrices and their binary masks. Initialize Wk ←c Wk, Tk ←1, ∀0 ≤k ≤C, β ←1 and iter ←0 repeat Choose a minibatch of network input from X Forward propagation and loss calculation with (W0 ⊙T0),...,(WC ⊙TC) Backward propagation of the model output and generate ∇L for k = 0, ..., C do Update Tk by function hk(·) and the current Wk, with a probability of σ(iter) Update Wk by Formula (2) and the current loss function gradient ∇L end for Update: iter ←iter + 1 and β ←f(α, iter) until iter reaches its desired maximum Note that, the dynamic property of our method is shown in two aspects. On one hand, pruning operations can be performed whenever the existing connections seem to become unimportant. Yet, on the other hand, the mistakenly pruned connections shall be re-established if they once appear to be important. The latter operation plays a dual role of network pruning, and thus it is called "network splicing" in this paper. Pruning and splicing constitute a circular procedure by constantly updating the connection weights and setting different entries in Tk, which is analogical to the synthesis of excitatory and inhibitory neurotransmitter in human nervous system [17]. See Figure 2 for the overview of our method and the method pipeline can be found in Figure 1(a). 4 3.3 Parameter Importance Since the measure of parameter importance influences the state of network connections, function hk(·), ∀0 ≤k ≤C, can be essential to our dynamic network surgery. We have tested several candidates and finally found the absolute value of the input to be the best choice, as claimed in [9]. That is, the parameters with relatively small magnitude are temporarily pruned, while the others with large magnitude are kept or spliced in each iteration of Algorithm 1. Obviously, the threshold values have a significant impact on the final compression rate. For a certain layer, a single threshold can be set based on the average absolute value and variance of its connection weights. However, to improve the robustness of our method, we use two thresholds ak and bk by importing a small margin t and set bk as ak + t in Equation (3). For the parameters out of this range, we set their function outputs as the corresponding entries in Tk, which means these parameters will neither be pruned nor spliced in the current iteration. hk(W(i,j) k ) =      0 if ak > |W(i,j) k | T(i,j) k if ak ≤|W(i,j) k | < bk 1 if bk ≤|W(i,j) k | (3) 3.4 Convergence Acceleration Considering that Algorithm 1 is a bit more complicated than the standard backpropagation method, we shall take a few more steps to boost its convergence. First of all, we suggest slowing down the pruning and splicing frequencies, because these operations lead to network structure change. This can be done by triggering the update scheme of Tk stochastically, with a probability of p = σ(iter), rather than doing it constantly. Function σ(·) shall be monotonically non-increasing and satisfy σ(0) = 1. After a prolonged decrease, the probability p may even be set to zero, i.e., no pruning or splicing will be conducted any longer. Another possible reason for slow convergence is the vanishing gradient problem. Since a large percentage of connections are pruned away, the network structure should become much simpler and probably even much "thinner" by utilizing our method. Thus, the loss function derivatives are likely to be very small, especially when the reference model is very deep. We resolve this problem by pruning the convolutional layers and fully connected layers separately, in the dynamic way still, which is somehow similar to [9]. 4 Experimental Results In this section, we will experimentally analyse the proposed method and apply it on some popular network models. For fair comparison and easy reproduction, all the reference models are trained by the GPU implementation of Caffe package [12] with .prototxt files provided by the community.2 Also, we follow the default experimental settings for SGD method, including the training batch size, base learning rate, learning policy and maximal number of training iterations. Once the reference models are obtained, we directly apply our method to reduce their model complexity. A brief summary of the compression results are shown in Table 1. Table 1: Dynamic network surgery can remarkably reduce the model complexity of some popular networks, while the prediction error rate does not increase. model Top-1 error Parameters Iterations Compression LeNet-5 reference 0.91% 431K 10K LeNet-5 pruned 0.91% 4.0K 16K 108× LeNet-300-100 reference 2.28% 267K 10K LeNet-300-100 pruned 1.99% 4.8K 25K 56× AlexNet reference 43.42% 61M 450K AlexNet pruned 43.09% 3.45M 700K 17.7× 2Except for the simulation experiment and LeNet-300-100 experiments which we create the .prototxt files by ourselves, because they are not available in the Caffe model zoo. 5 4.1 The Exclusive-OR Problem To begin with, we consider an experiment on the synthetic data to preliminary testify the effectiveness of our method and visualize its compression quality. The exclusive-OR (XOR) problem can be a good option. It is a nonlinear classification problem as illustrated in Figure 3(a). In this experiment, we turn the original problem to a more complicated one as Figure 3(b), in which some Gaussian noises are mixed up with the original data (0, 0), (0, 1), (1, 0) and (1, 1). (a) (b) Figure 3: The Exclusive-OR (XOR) classification problem (a) without noise and (b) with noise. In order to classify these samples, we design a network model as illustrated in the left part of Figure 4(a), which consists of 21 connections and each of them has a weight to be learned. The sigmoid function is chosen as the activation function for all the hidden and output neurons. Twenty thousand samples were randomly generated for the experiment, in which half of them were used as training samples and the rest as test samples. By 100,000 iterations of learning, this three-layer neural network achieves a prediction error rate of 0.31%. The weight matrix of network connections between input and hidden neurons can be found in Figure 4(b). Apparently, its first and last row share the similar elements, which means there are two hidden neurons functioning similarly. Hence, it is appropriate to use this model as a compression reference, even though it is not very large. After 150,000 iterations, the reference model will be compressed into the right side of Figure 4(a), and the new connection weights and their masks are shown in Figure 4(b). The grey and green patches in T1 stand for those entries equal to one, and the corresponding connections shall be kept. In particular, the green ones indicate the connections were mistakenly pruned in the beginning but spliced during the surgery. The other patches (i.e., the black ones) indicate the corresponding connections are permanently pruned in the end. (a) (b) Figure 4: Dynamic network surgery on a three-layer neural network for the XOR problem. (a): The network complexity is reduced to be optimal. (b) The connection weights are updated with masks. The compressed model has a prediction error rate of 0.30%, which is slightly better than that of the reference model, even though 40% of its parameters are set to be zero. Note that, the remaining hidden neurons (excluding the bias unit) act as three different logic gates and altogether make up 6 the XOR classifier. However, if the pruning operations are conducted only on the initial parameter magnitude (as in [9]), then probably four hidden neurons will be finally kept, which is obviously not the optimal compression result. In addition, if we reduce the impact of Gaussian noises and enlarge the margin between positive and negative samples, then the current model can be further compressed, so that one more hidden neuron will be pruned by our method. So far, we have carefully explained the mechanism behind our method and preliminarily testified its effectiveness. In the following subsections, we will further test our method on three popular NN models and make quantitative comparisons with other network compression methods. 4.2 The MNIST database MNIST is a database of handwritten digits and it is widely used to experimentally evaluate machine learning methods. Same with [9], we test our method on two network models: LeNet-5 and LeNet300-100. LeNet-5 is a conventional CNN model which consists of 4 learnable layers, including 2 convolutional layers and 2 fully connected layers. It is designed by LeCun et al. [15] for document recognition. With 431K parameters to be learned, we train this model for 10,000 iterations and obtain a prediction error rate of 0.91%. LeNet-300-100, as described in [15], is a classical feedforward neural network with three fully connected layers and 267K learnable parameters. It is also trained for 10,000 iterations, following the same learning policy as with LeNet-5. The well trained LeNet-300-100 model achieves an error rate of 2.28%. With the proposed method, we are able to compress these two models. The same batch size, learning rate and learning policy are set as with the reference training processes, except for the maximal number of iterations, which is properly increased. The results are shown in Table 1. After convergence, the network parameters of LeNet-5 and LeNet-300-100 are reduced by a factor of 108× and 56×, respectively, which means less than 1% and 2% of the network connections are kept, while the prediction accuracies are as good or slightly better. Table 2: Compare our compression results on LeNet-5 and LeNet-300-100 with that of [9]. The percentage of remaining parameters after applying Han et al’s method [9] and our method are shown in the last two columns. Model Layer Params. Params.% [9] Params.% (Ours) LeNet-5 conv1 0.5K ∼66% 14.2% conv2 25K ∼12% 3.1% fc1 400K ∼8% 0.7% fc2 5K ∼19% 4.3% Total 431K ∼8% 0.9% LeNet-300-100 fc1 236K ∼8% 1.8% fc2 30K ∼9% 1.8% fc3 1K ∼26% 5.5% Total 267K ∼8% 1.8% To better demonstrate the advantage of our method, we make layer-by-layer comparisons between our compression results and Han et al.’s [9] in Table 2. To the best of our knowledge, their method is so far the most effective pruning method, if the learning inefficiency is not a concern. However, our method still achieves at least 4 times the compression improvement against their method. Besides, due to the significant advantage over Han et al.’s models [9], our compressed models will also be undoubtedly much faster than theirs. 4.3 ImageNet and AlexNet In the final experiment, we apply our method to AlexNet [13], which wins the ILSVRC 2012 classification competition. As with the previous experiments, we train the reference model first. 7 Without any data augmentation, we obtain a reference model with 61M well-learned parameters after 450K iterations of training (i.e., roughly 90 epochs). Then we perform the network surgery on it. AlexNet consists of 8 learnable layers, which is considered to be deep. So we prune the convolutional layers and fully connected layers separately, as previously discussed in Section 3.4. The training batch size, base learning rate and learning policy still keep the same with reference training process. We run 320K iterations for the convolutional layers and 380K iterations for the fully connected layers, which means 700K iterations in total (i.e., roughly 140 epochs). In the test phase, we use just the center crop and test our compressed model on the validation set. Table 3: The comparison of different compressed models, with Top-1 and Top-5 prediction error rate, the number of training epochs and the final compression rate shown in the table. Model Top-1 error Top-5 error Epochs Compression Fastfood 32 (AD) [21] 41.93% 2× Fastfood 16 (AD) [21] 42.90% 3.7× Naive Cut [9] 57.18% 23.23% 0 4.4× Han et al. [9] 42.77% 19.67% ≥960 9× Dynamic network surgery (Ours) 43.09% 19.99% ∼140 17.7× Table 3 compares the result of our method with some others. The four compared models are built by applying Han et al.’s method [9] and the adaptive fastfood transform method [21]. When compared with these "lossless" methods, our method achieves the best result in terms of the compression rate. Besides, after acceptable number of epochs, the prediction error rate of our model is comparable or even better than those models compressed from better references. In order to make more detailed comparisons, we compare the percentage of remaining parameters in our compressed model with that of Han et al.’s [9], since they achieve the second best compression rate. As shown in Table 4, our method compresses more parameters on almost every single layer in AlexNet, which means both the storage requirement and the number of FLOPs are better reduced when compared with [9]. Besides, our learning process is also much more efficient thus considerable less epochs are needed (as least 6.8 times decrease). Table 4: Compare our method with [9] on AlexNet. Layer Params. Params.% [9] Params.% (Ours) conv1 35K ∼84% 53.8% conv2 307K ∼38% 40.6% conv3 885K ∼35% 29.0% conv4 664K ∼37% 32.3% conv5 443K ∼37% 32.5% fc1 38M ∼9% 3.7% fc2 17M ∼9% 6.6% fc3 4M ∼25% 4.6% Total 61M ∼11% 5.7% 5 Conclusions In this paper, we have investigated the way of compressing DNNs and proposed a novel method called dynamic network surgery. Unlike the previous methods which conduct pruning and retraining alternately, our method incorporates connection splicing into the surgery and implements the whole process in a dynamic way. By utilizing our method, most parameters in the DNN models can be deleted, while the prediction accuracy does not decrease. The experimental results show that our method compresses the number of parameters in LeNet-5 and AlexNet by a factor of 108× and 17.7×, respectively, which is superior to the recent pruning method by considerable margins. Besides, the learning efficiency of our method is also better thus less epochs are needed. 8 References [1] Wenlin Chen, James T. Wilson, Stephen Tyree, Kilian Q. Weinberger, and Yixin Chen. Compressing neural networks with the hashing trick. In ICML, 2015. [2] Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. BinaryConnect: Training deep neural networks with binary weights during propagations. In NIPS, 2015. [3] Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained to +1 or -1. arXiv preprint arXiv:1602.02830v3, 2016. [4] Misha Denil, Babak Shakibi, Laurent Dinh, Marc’Aurelio Ranzato, and Nando de Freitas. Predicting parameters in deep learning. In NIPS, 2013. [5] Emily L. Denton, Wojciech Zaremba, Joan Bruna, Yann LeCun, and Rob Fergus. Exploiting linear structure within convolutional networks for efficient evaluation. In NIPS, 2014. [6] Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014. [7] Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A Horowitz, and William J. Dally. EIE: Efficient inference engine on compressed deep neural network. In ISCA, 2016. [8] Song Han, Huizi Mao, and William J. Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and Huffman coding. In ICLR, 2016. [9] Song Han, Jeff Pool, John Tran, and William J. Dally. Learning both weights and connections for efficient neural networks. In NIPS, 2015. [10] Babak Hassibi and David G. Stork. Second order derivatives for network pruning: Optimal brain surgeon. In NIPS, 1993. [11] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. [12] Yangqing Jia, Evan Shelhamer, Jeff Donahue, Sergey Karayev, Jonathan Long, Ross Girshick, Sergio Guadarrama, and Trevor Darrell. Caffe: Convolutional architecture for fast feature embedding. In ACM MM, 2014. [13] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. In NIPS, 2012. [14] Vadim Lebedev, Yaroslav Ganin, Maksim Rakhuba, Ivan Oseledets, and Victor Lempitsky. Speeding-up convolutional neural networks using fine-tuned cp-decomposition. In ICLR, 2015. [15] 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. [16] Yann LeCun, John S Denker, Sara A Solla, Richard E Howard, and Lawrence D Jackel. Optimal brain damage. In NIPS, 1989. [17] Harvey Lodish, Arnold Berk, S Lawrence Zipursky, Paul Matsudaira, David Baltimore, and James Darnell. Molecular Cell Biology: Neurotransmitters, Synapses, and Impulse Transmission. W. H. Freeman, 2000. [18] Michael Mathieu, Mikael Henaff, and Yann LeCun. Fast training of convolutional networks through FFTs. arXiv preprint arXiv:1312.5851, 2013. [19] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2014. [20] Vincent Vanhoucke, Andrew Senior, and Mark Z. Mao. Improving the speed of neural networks on CPUs. In NIPS Workshop, 2011. [21] Zichao Yang, Marcin Moczulski, Misha Denil, Nando de Freitas, Alex Smola, Le Song, and Ziyu Wang. Deep fried convnets. In ICCV, 2015. [22] Xiangyu Zhang, Jianhua Zou, Xiang Ming, Kaiming He, and Jian Sun. Efficient and accurate approximations of nonlinear convolutional networks. In CVPR, 2015. 9
2016
91
6,554
Graph Clustering: Block-models and model free results Yali Wan Department of Statistics University of Washington Seattle, WA 98195-4322, USA yaliwan@washington.edu Marina Meil˘a Department of Statistics University of Washington Seattle, WA 98195-4322, USA mmp@stat.washington.edu Abstract Clustering graphs under the Stochastic Block Model (SBM) and extensions are well studied. Guarantees of correctness exist under the assumption that the data is sampled from a model. In this paper, we propose a framework, in which we obtain “correctness” guarantees without assuming the data comes from a model. The guarantees we obtain depend instead on the statistics of the data that can be checked. We also show that this framework ties in with the existing model-based framework, and that we can exploit results in model-based recovery, as well as strengthen the results existing in that area of research. 1 Introduction: a framework for clustering with guarantees without model assumptions In the last few years, model-based clustering in networks has witnessed spectacular progress. At the central of intact are the so-called block-models, the Stochastic Block Model (SBM), DegreeCorrected SBM (DC-SBM) and Preference Frame Model (PFM). The understanding of these models has been advanced, especially in understanding the conditions when recovery of the true clustering is possible with small or no error. The algorithms for recovery with guarantees have also been improved. However, the impact of the above results is limited by the assumption that the observed data comes from the model. This paper proposes a framework to provide theoretical guarantees for the results of model based clustering algorithms, without making any assumption about the data generating process. To describe the idea, we need some notation. Assume that a graph G on n nodes is observed. A modelbased algorithm clusters G, and outputs clustering C and parameters M(G, C). The framework is as follows: if M(G, C) fits the data G well, then we shall prove that any other clustering C of G that also fits G well will be a small perturbation of C. If this holds, then C with model parameters M(G, C) can be said to capture the data structure in a meaningful way. We exemplify our approach by obtaining model-free guarantees for the SBM and PFM models. Moreover, we show that model-free and model-based results are intimately connected. 2 Background: graphs, clusterings and block models Graphs, degrees, Laplacian, and clustering Let G be a graph on n nodes, described by its adjacency matrix ˆA. Define ˆdi = n j=1 ˆAij the degree of node i, and ˆD = diag{ ˆdi} the diagonal matrix of the node degrees. The (normalized) Laplacian of G is defined as1 ˆL = ˆD−1/2 ˆA ˆD−1/2. In 1Rigorously speaking, the normalized graph Laplacian is I −ˆL [10]. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. extension, we define the degree matrix D and the Laplacian L associated to any matrix A ∈Rn×n, with Aij = Aji ≥0, in a similar way. Let C be a partitioning (clustering) of the nodes of G into K clusters. We use the shorthand notation i ∈k for “node i belongs to cluster k”. We will represent C by its n×K indicator matrix Z, defined by Zik = 1 if i ∈k, 0 otherwise, for i = 1, . . . n, k = 1, . . . K. (1) Note that ZT Z = diag{nk} with nk counting the number of nodes in cluster k, and ZT ˆAZ = [nkl]K k,l=1 with nkl counting the edges in G between clusters k and l. Moreover, for two indicator matrices Z, Z for clusterings C, C, (ZT Z)kk counts the number of points in the intersection of cluster k of C with cluster k of C, and (ZT ˆDZ)kk computes  i∈k∩k ˆdi the volume of the same intersection. “Block models” for random graphs (SBM, DC-SBM, PFM) This family of models contains Stochastic Block Models (SBM) [1, 18], Degree-Corrected SBM (DC-SBM) [17] and Preference Frame Models (PFM) [20]. Under each of these model families, a graph G with adjacency matrix ˆA over n nodes is generated by sampling its edges independently following the law ˆAij ∼Bernoulli(Aij), for all i > j. The symmetric matrix A = [Aij] describing the graph is the edge probability matrix. The three model families differ in the constraints they put on an acceptable A. Let C∗be a clustering. The entries of A are defined w.r.t C∗as follows (and we say that A is compatible with C∗). SBM : Aij = Bkl whenever i ∈k, j ∈l, with B = [Bkl] ∈RK×K symmetric and nonnegative. DC-SBM : Aij = wiwjBkl whenever i ∈k, j ∈l, with B as above and w1, . . . wn non-negative weights associated with the graph nodes. PFM : A satisfies D = diag(A1), D−1AZ = ZR where 1 denotes the vector of all ones, Z is the indicator matrix of C∗, and R is a stochastic matrix (R1 = 1, Rkl ≥0), the details are in [20] While perhaps not immediately obvious, the SBM is a subclass of the DC-SBM, and the latter a subclass of the PFM. Another common feature of block-models, that will be significant throughout this work is that for all three, Spectral Clustering algorithms [15] have been proved to work well estimating C∗. 3 Main theorem: blueprint and results for PFM, SBM Let M be a model class, such as SBM, DC-SBM, PFM, and denote M(G, C) ∈M to be a model that is compatible with C and is fitted in some way to graph G (we do not assume in general that this fit is optimal). Theorem 1 (Generic Theorem) We say that clustering C fits G well w.r.t M iff M(G, C) is “close to” G. If C fits G well w.r.t M, then (subject to other technical conditions) any other clustering C which also fits G well is close to C, i.e. dist(C, C) is small. In what follows, we will instantiate this Generic Theorem, and the concepts therein; in particular the following will be formally defined. (1) Model construction, i.e an algorithm to fit a model in M to (G, C). This is necessary since we want our results to be computable in practice. (2) A goodness of fit measure between M(C, G) and the data G. (3) A distance between clusterings. We adopt the widely used Misclassification Error (or Hamming) distance defined below. The Misclassification Error (ME) distance between two clusterings C, C over the same set of n points is dist(C, C) = 1 −1 n max π∈SK  i∈k∩π(k) 1, (2) where π ranges over all permutations of K elements SK, and π(k) indexes a cluster in C. If the points are weighted by their degrees, a natural measure on the node set, the Weighted ME (wME) 2 distance is dist ˆd(C, C) = 1 − 1 n i=1 ˆdi max π∈SK  i∈k∩π(k) ˆdi . (3) In the above,  i∈k∩k ˆdi represents the total weight of the set of points assigned to cluster k by C and to cluster k ( or π(k)) by C. Note that in the indicator matrix representation of clusterings, this is the (k, k) element of the matrix ZT ˆDZ ∈RK×K. While dist is more popular, we believe dist ˆd is more natural, especially when node degrees are dissimilar, as ˆd can be seen as a natural measure on the set of nodes, and dist ˆd is equivalent to the earth-mover’s distance. 3.1 Main result for PFM Constructing a model Given a graph G and a clustering C of its nodes, we wish to construct a PFM compatible with C, so that its Laplacian L satisfies that ||ˆL −L|| is small. Let the spectral decomposition of ˆL be ˆL = [ ˆY ˆYlow]  ˆΛ 0 0 ˆΛlow   ˆY T ˆY T low  = ˆY ˆΛ ˆY T + ˆYlow ˆΛlow ˆY T low (4) where ˆY ∈Rn×K, ˆYlow ∈Rn×(n−K), ˆΛ = diag(ˆλ1, · · · , ˆλK), ˆΛlow = diag(ˆλK+1, · · · , ˆλn). To ensure that the matrices ˆY , ˆYlow are uniquely defined we assume throughout the paper that ˆL’s K-th eigengap, i.e, |λK| −|λK+1|, is non-zero. Assumption 1 The eigenvalues of ˆL satisfy ˆλ1 = 1 ≥|ˆλ2| ≥. . . ≥|ˆλK| > |ˆλK+1| ≥. . . |ˆλn|. Denote the subspace spanned by the columns of M, for any M matrix, by R(M), and || || the Euclidean or spectral norm. PFM Estimation Algorithm Input Graph G with ˆA, ˆD, ˆL, ˆY , ˆΛ, clustering C with indicator matrix Z. Output (A, L) = PFM(G, C) 1. Construct an orthogonal matrix derived from Z. YZ = ˆD1/2ZC−1/2, with C = ZT ˆDZ the column normalization of Z. (5) Note Ckk =  i∈k ˆdi is the volume of cluster k. 2. Project YZ on ˆY and perform Singular Value Decomposition. F = Y T Z ˆY = UΣV T (6) 3. Change basis in R(YZ) to align with ˆY . Y = YZUV T . Complete Y to an orthonormal basis [Y B] of Rn. (7) 4. Construct Laplacian L and edge probability matrix A. L = Y ˆΛY T + (BBT )ˆL(BBT ), A = ˆD1/2L ˆD1/2. (8) Proposition 2 Let G, ˆA, ˆD, ˆL, ˆY , ˆΛ and Z be defined as above, and (A, L) = PFM(G, C). Then, 1. ˆD and L, or A define a PFM with degrees ˆd1:n. 2. The columns of Y are eigenvectors of L with eigenvalues ˆλ1:K. 3. ˆD1/21 is an eigenvector of both L and ˆL with eigenvalue ˆλ1 = 1. The proof is relegated to the Supplement, as are all the omitted proofs. PFM(G, C) is an estimator for the PFM parameters given the clustering. It is evidently not the Maximum Likelihood estimator, but we can show that it is consistent in the following sense. 3 Proposition 3 (Informal) Assume that G is sampled from a PFM with parameters D∗, L∗and compatible with C∗, and let L = PFM(G, C∗). Then, under standard recovery conditions for PFM (e.g [20]) ||L∗−L|| = o(1) w.r.t. n. Assumption 2 (Goodness of fit for PFM) ||ˆL −L|| ≤ε. PFM(G, C) instantiates M(G, C), and Assumption 2 instantiates the goodness of fit measure. It remains to prove an instance of Generic Theorem 1 for these choices. Theorem 4 (Main Result (PFM)) Let G be a graph with ˆd1:n, ˆD, ˆL, ˆλ1:n as defined, and ˆL satisfy Assumption 1. Let C, C be two clusterings with K clusters, and L, L be their corresponding Laplacians, defined as in (8), and satisfy Assumption 2 respectively. Set δ = (K−1)ε2 (|ˆλK|−|ˆλK+1|)2 and δ0 = mink Ckk/ maxk Ckk with C defined as in (5), where k indexes the clusters of C. Then, whenever δ ≤δ0, dist ˆd(C, C) ≤maxk Ckk  k Ckk δ, (9) with dist ˆd being the weighted ME distance (3). In the remainder of this section we outline the proof steps, while the partial results of Proposition 5, 6, 7 are proved in the Supplement. First, we apply the perturbation bound called the Sinus Theorem of Davis and Kahan, in the form presented in Chapter V of [19]. Proposition 5 Let ˆY , ˆλ1:n, Y be defined as usual. If Assumptions 1 and 2 hold, then || diag(sin θ1:K( ˆY , Y ))|| ≤ ε |ˆλK| −|ˆλK+1| = ε (10) where θ1:K are the canonical (or principal) angles between R( ˆY ) and R(Y ) (see e.g [8]). The next step concerns the closeness of Y, ˆY in Frobenius norm. Since Proposition 5 bounds the sinuses of the canonical angles, we exploit the fact that the cosines of the same angles are the singular values of F = Y T ˆY of (6). Proposition 6 Let M = Y Y T , ˆ M = ˆY ˆY T and F, ε as above. Assumptions 1 and 2 imply that 1. ||F||2 F = trace M ˆ M T ≥K −(K −1)ε2. 2. ||M −ˆ M||2 F ≤2(K −1)ε2. Now we show that all clusterings which satisfy Proposition 6 must be close to each other in the weighted ME distance. For this, we first need an intermediate result. Assume we have two clusterings C, C, with K clusters, for which we construct YZ, Y, L, M, respectively Y  Z, Y , L, M  as above. Then, the subspaces spanned by Y and Y  will be close. Proposition 7 Let ˆL satisfy Assumption 1 and let C, C represent two clusterings for which L, L satisfy Assumption 2. Then, ||Y T Z Y  Z||2 F ≥K −4(K −1)ε2 = K −δ The main result now follows from Proposition 7 and Theorem 9 of [13], as shown in the Supplement. This proof approach is different from the existing perturbation bounds for clustering, which all use counting arguments. The result of [13] is a local equivalence, which bounds the error we need in terms of δ defined above (“local” meaning the result only holds for small δ). 4 3.2 Main Theorem for SBM In this section, we offer an instantiation of Generic Theorem 1 for the case of the SBM. As before, we start with a model estimator, which in this case is the Maximum Likelihood estimator. SBM Estimation Algorithm Input Graph with ˆA, clustering C with indicator matrix Z. Output A = SBM(G, C) 1. Construct an orthogonal matrix derived from Z: YZ = ZC−1/2 with C = ZT Z. 2. Estimate the edge probabilities: B = C−1ZT ˆAZC−1. 3. Construct A from B by A = ZBZT . Proposition 8 Let ˜B = C1/2BC1/2 and denote the eigenvalues of ˜B, ordered by decreasing magnitude, by λ1:K. Let the spectral decomposition of ˜B be ˜B = UΛU T , with U an orthogonal matrix and Λ = diag(λ1:K). Then 1. A is a SBM. 2. λ1:K are the K principal eigenvalues of A. The remaining eigenvalues of A are zero. 3. A = Y ΛY T where Y = YZU. Assumption 3 (Eigengap) B is non-singular (or, equivalently, |λK| > 0. Assumption 4 (Goodness of fit for SBM) || ˆA −A|| ≤ε. With the model (SBM), estimator, and goodness of fit defined, we are ready for the main result. Theorem 9 (Main Result (SBM)) Let G be a graph with incidence matrix ˆA, and ˆλA K the K-th singular value of ˆA. Let C, C be two clusterings with K clusters, satisfying Assumptions 3 and 4. Set δ = 4Kε2 |ˆλA K|2 and δ0 = mink nk/ maxk nk, where k indexes the clusters of C. Then, whenever δ ≤δ0, dist(C, C) ≤δ maxk nk/n, where dist represents the ME distance (2). Note that the eigengap of ˆA, ˆΛA K is not bounded above, and neither is ε. Since the SBM is less flexible than the PFM, we expect that for the same data G, Theorem 9 will be more restrictive than Theorem 4. 4 The results in perspective 4.1 Cluster validation Theorems like 4, 9 can provide model free guarantees for clustering. We exemplify this procedure in the experimental Section 6, using standard spectral clustering as described in e.g [18, 17, 15]. What is essential is that all the quantities such as ε and δ are computable from the data. Moreover, if Y is available, then the bound in Theorem 4 can be improved. Proposition 10 Theorem 4 holds when δ is replaced by δY = K−< ˆ M, M >F +(K −1)(ε)2 + 2  2(K −1)ε|| ˆ M −M||F , with ε = ε/(|ˆλK| −|ˆλK+1|) and M, ˆ M defined in Proposition 6. 4.2 Using existing model-based recovery theorems to prove model-free guarantees We exemplify this by using (the proof of) Theorem 3 of [20] to prove the following. Theorem 11 (Alternative result based on [20] for PFM) Under the same conditions as in Theorem 4, dist ˆd(C, C) ≤δWM, with δWM = 128 Kε2 (|ˆλK|−|ˆλK+1|)2 . 5 It follows, too, that with the techniques in this paper, the error bound in [20] can be improved by a factor of 128. Similarly, if we use the results of [18] we obtain alternative model-free guarantee for the SBM. Assumption 5 (Alternative goodness of fit for SBM) ||ˆL2−L2||F ≤ε, where ˆL, L are the Laplacians of ˆA and A = SBM(G, C) respectively. Theorem 12 (Alternative result based on [18] for SBM) Under the same conditions as in Theorem 9, except for replacing Assumption 4 with 5, dist(C, C) ≤δRCY with δRCY = ε2 |ˆλK|4 16 maxk nk n . A problem with this result is that Assumption 5 is much stronger than 4 (being in Frobenius norm). The more recent results of [17] (with unspecified constants) in conjunction with our original Assumptions 3, 4, and the assumption that all clusters have equal sizes, give a bound of O(Kε2/ˆλ2 K) for the SBM; hence our model-free Theorem 9 matches this more restrictive model-based theorem. 4.3 Sanity checks and Extensions It can be easily verified that if indeed G is sampled from a SBM, or PFM, then for large enough n, and large enough model eigengap, Assumptions 1 and 2 (or 3 and 4) will hold. Some immediate extensions and variations of Theorems 4, 9 are possible. For example, one could replace the spectral norm by the Frobenius norm in Assumptions 2 and 4, which would simplify some of the proofs. However, using the Frobenius norm would be a much stronger assumption [18] Theorem 4 holds not just for simple graphs, but in the more general case when ˆA is a weighted graph (i.e. a similarity matrix). The theorems can be extended to cover the case when C is a clustering that is α-worse than C, i.e when ||L −ˆL|| ≥||L −ˆL||(1 −α). 4.4 Clusterability and resilience Our Theorems also imply the stability of a clustering to perturbations of the graph G. Indeed, let ˆL be the Laplacian of G, a perturbation of G. If ||ˆL −ˆL|| ≤ε, then ||ˆL −L|| ≤2ε, and (1) G is well fitted by a PFM whenever G is, and (2) C is δ stable w.r.t G, hence C is what some authors [9] call resilient. A graph G is clusterable when G can be fitted well by some clustering C∗. Much work [4, 7] has been devoted to showing that clusterability implies that finding a C close to C∗is computationally efficient. Such results can be obtained in our framework, by exploiting existing recovery theorems such as [18, 17, 20], which give recovery guarantees for Spectral Clustering, under the assumption of sampling from the model. For this, we can simply replace the model assumption with the assumption that there is a C∗for which L (or A) satisfies Assumptions 1 and 2 (or 3 and 4). 5 Related work To our knowledge, there is no work of the type of Theorem 1 in the literature on SBM, DC-SBM, PFM. The closest work is by [6] which guarantees approximate recovery assuming G is close to a DC-SBM. Spectral clustering is also used for loss-based clustering in (weighted) graphs and some stability results exist in this context. Even though they measure clustering quality by different criteria, so that the ε values are not comparable, we review them here. The recent paper of [16], Theorem 1.2 states that if the K-way Cheeger constant of G is ρ(k) ≤(1 −ˆλK+1)/(cK3) then the clustering error2 dist ˆd(C, Copt) ≤C/c = δP SZ. In the current proof, the constant C = 2 × 105; moreover, ρ(K) cannot be computed tractably. In [14], the bound δMSX depends on εMSX, the Normalized Cut scaled by the eigengap. Since both bounds refer to the result of spectral clustering, we can compare the relationship between δMSX and εMSX; for [14], this is δMSX = 2εMSX[1 −εMSX/(K −1)], 2The results is stronger, bounding the perturbation of each cluster individually by δP SZ, but it also includes a factor larger than 1, bounding the error of K-means algorithm. 6 which is about K −1 times larger than δ when  = MSX. In [5], dist(C, C) is defined in terms of ||Y T Z −Y  Z||2 F , and the loss is (closely related) to || ˆA −SBM(G, C)||2 F . The bound does not take into account the eigengap, that is, the stability of the subspace ˆY itself. Bootstrap for validating a clustering C was studied in [11] (see also references therein for earlier work). In [3] the idea is to introduce a statistics, and large deviation bounds for it, conditioned on sampling from a SBM (with covariates) and on a given C. 6 Experimental evaluation Experiment Setup Given G, we obtain a clustering C0 by spectral clustering [15]. Then we calculate clustering C by perturbing C0 with gradually increasing noise. For each C, we construct PFM (C, G)and SBM(C, G) model, and further compute , δ and δ0. If δ ≤δ0, C is guaranteed to be stable by the theorems. In the remainder of this section, we describe the data generating process for the simulated datasets and the results we obtained. PFM Datasets We generate from PFM model with K = 5, n = 10000, λ1:K = (1, 0.875, 0.75, 0.625, 0.5). eigengap = 0.48, n1:K = (2000, 2000, 2000, 2000, 2000). The stochastic matrix R and its stationary distribution ρ are shown below. We sample an adjacency matrix ˆA from A (shown below). ρ =  25 .12 .17 .18 .28  R =   .79 .02 .06 .03 .10 .03 .71 .23 .00 .02 .09 .16 .69 .00 .06 .04 .00 .00 .80 .16 .10 .01 .03 .11 .76   A ˆA Perturbed PFM Datasets A is obtained from the previous model by perturbing its principal subspace (details in Supplement). Then we sample ˆA from A. Lancichinetti-Fortunato-Radicchi (LFR) simulated matrix [12] The LFR benchmark graphs are widely used for community detection algorithms, due to heterogeneity in the distribution of node degree and community size. A LFR matrix is simulated with n = 10000, K = 4, nk = (2467, 2416, 2427, 2690) and µ = 0.2, where µ is the mixing parameter indicating the fraction of edges shared between a node and the other nodes from outside its community. Political Blogs Dataset A directed network A of hyperlinks between weblogs on US politics, compiled from online directories by Adamic and Glance [2], where each blog is assigned a political leaning, liberal or conservative, based on its blog content. The network A contains 1490 blogs. After erasing the disconnected nodes, n = 983. We study ˆA = ( AT A)3, which is a smoothed undirected graph. For AT A we find no guarantees. The first two data sets are expected to fit the PFM well, but not the SBM, while the LFR data is expected to be a good fit for a SBM. Since all bounds can be computed on weighted graphs as well, we have run the experiments also on the edge probability matrices A used to generate the PFM and perturbed PFM graphs. The results of these experiments are summarized in Figure 1. For all of the experiments, the clustering C is ensured to be stable by Theorem 4 as the unweighted error grows to a breaking point, then the assumptions of the theorem fail. In particular, the C0 is always stable in the PFM framework. 7 Comparing δ from Theorem 9 to that from Theorem 4, we find that Theorem 9 (guarantees for SBM) is much harder to satisfy. All δ values from Theorem 9 are above 1, and not shown.3 In particular, for the SBM model class, the C cannot be proved stable even for the LFR data. Note that part of the reason why with the PFM model very little difference from the clustering C0 can be tolerated for a clustering to be stable is that the large eigengap makes PFM(G, C) differ from PFM(G, C0) even for very small perturbations. By comparing the bounds for ˆA with the bounds for the “weighted graphs” A, we can evaluate that the sampling noise on δ is approximately equal to that of the clustering perturbation. Of course, the sampling noise varies with n, decreasing for larger graphs. Moreover, from Political Blogs data, we see that “smoothing” a graph, by e.g. taking powers of its adjacency matrix, has a stability inducing effect. Figure 1: Quantities , δ, δ0 from Theorem 4 plotted vs dist(C, C0) for various datasets: ˆ A denotes a simple graph, while A denotes a weighted graph (i.e. a non-negative matrix). For the Political Blogs: Truth means C0 is true clustering of [2], spectral means C0 is obtained from spectral clustering. For SBM, δ is always greater than δ0. 7 Discussion This paper makes several contributions. At a high level, it poses the problem of model free validation in the area of community detection in networks. The stability paradigm is not entirely new, but using it explicitly with model-based clustering (instead of cost-based) is. So is “turning around” the model-based recovery theorems to be used in a model-free framework. All quantities in our theorems are computable from the data and the clustering C, i.e do not contain undetermined constants, and do not depend on parameters that are not available. As with distribution-free results in general, making fewer assumptions allows for less confidence in the conclusions, and the results are not always informative. Sometimes this should be so, e.g when the data does not fit the model well. But it is also possible that the fit is good, but not good enough to satisfy the conditions of the theorems as they are currently formulated. This happens with the SBM bounds, and we believe tighter bounds are possible for this model. It would be particularly interesting to study the non-spectral, sharp thresholds of [1] from the point of view of model-free recovery. A complementary problem is to obtain negative guarantees (i.e that C is not unique up to perturbations). At the technical level, we obtain several different and model-specific stability results, that bound the perturbation of a clustering by the perturbation of a model. They can be used both in model-free and in existing or future model-based recovery guarantees, as we have shown in Section 3 and in the experiments. The proof techniques that lead to these results are actually simpler, more direct, and more elementary than the ones found in previous papers. 3We also computed δRCY but the bounds were not informative. 8 References [1] Emmanuel Abbe and Colin Sandon. Community detection in general stochastic block models: fundamental limits and efficient recovery algorithms. arXiv preprint arXiv:1503.00609, 2015. [2] Lada A Adamic and Natalie Glance. The political blogosphere and the 2004 us election: divided they blog. In Proceedings of the 3rd international workshop on Link discovery, pages 36–43. ACM, 2005. [3] Edoardo M. Airoldi, David S. Choi, and Patrick J. Wolfe. Confidence sets for network structure. Technical Report arXiv:1105.6245, 2011. [4] Pranjal Awasthi. Clustering under stability assumptions. In Encyclopedia of Algorithms, pages 331–335. 2016. [5] Francis Bach and Michael I. Jordan. Learning spectral clustering with applications to speech separation. Journal of Machine Learning Research, 7:1963–2001, 2006. [6] Maria-Florina Balcan, Christian Borgs, Mark Braverman, Jennifer Chayes, and Shang-Hua Teng. Finding endogenously formed communities. In Proceedings of the Twenty-Fourth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 767–783. SIAM, 2013. [7] Shai Ben-David. Computational feasibility of clustering under clusterability assumptions. CoRR, abs/1501.00437, 2015. [8] Rajendra Bhatia. Matrix analysis, volume 169. Springer Science & Business Media, 2013. [9] Yonatan Bilu and Nathan Linial. Are stable instances easy? CoRR, abs/0906.3162, 2009. [10] Fan RK Chung. Spectral graph theory, volume 92. American Mathematical Soc., 1997. [11] Brian Karrer, Elizaveta Levina, and M. E. J. Newman. Robustness of community structure in networks. Phys. Rev. E, 77:046119, Apr 2008. [12] Andrea Lancichinetti, Santo Fortunato, and Filippo Radicchi. Benchmark graphs for testing community detection algorithms. Physical review E, 78(4):046110, 2008. [13] Marina Meil˘a. Local equivalence of distances between clusterings – a geometric perspective. Machine Learning, 86(3):369–389, 2012. [14] Marina Meil˘a, Susan Shortreed, and Liang Xu. Regularized spectral learning. In Robert Cowell and Zoubin Ghahramani, editors, Proceedings of the Artificial Intelligence and Statistics Workshop(AISTATS 05), 2005. [15] A. Y. Ng, M. I. Jordan, and Y. Weiss. On spectral clustering: Analysis and an algorithm. In T. G. Dietterich, S. Becker, and Z. Ghahramani, editors, Advances in Neural Information Processing Systems 14, Cambridge, MA, 2002. MIT Press. [16] Richard Peng, He Sun, and Luca Zanetti. Partitioning well-clustered graphs with k-means and heat kernel. In Proceedings of the Annual Conference on Learning Theory (COLT), pages 1423–1455, 2015. [17] Tai Qin and Karl Rohe. Regularized spectral clustering under the degree-corrected stochastic blockmodel. In Advances in Neural Information Processing Systems, pages 3120–3128, 2013. [18] Karl Rohe, Sourav Chatterjee, and Bin Yu. Spectral clustering and the high-dimensional stochastic blockmodel. The Annals of Statistics, pages 1878–1915, 2011. [19] Gilbert W Stewart and Ji-guang Sun. Matrix perturbation theory, volume 175. Academic press New York, 1990. [20] Yali Wan and Marina Meila. A class of network models recoverable by spectral clustering. In Daniel Lee and Masashi Sugiyama, editors, Advances in Neural Information Processing Systems (NIPS), page (to appear), 2015. 9
2016
92
6,555
CMA-ES with Optimal Covariance Update and Storage Complexity Oswin Krause Dept. of Computer Science University of Copenhagen Copenhagen, Denmark oswin.krause@di.ku.dk Dídac R. Arbonès Dept. of Computer Science University of Copenhagen Copenhagen, Denmark didac@di.ku.dk Christian Igel Dept. of Computer Science University of Copenhagen Copenhagen, Denmark igel@di.ku.dk Abstract The covariance matrix adaptation evolution strategy (CMA-ES) is arguably one of the most powerful real-valued derivative-free optimization algorithms, finding many applications in machine learning. The CMA-ES is a Monte Carlo method, sampling from a sequence of multi-variate Gaussian distributions. Given the function values at the sampled points, updating and storing the covariance matrix dominates the time and space complexity in each iteration of the algorithm. We propose a numerically stable quadratic-time covariance matrix update scheme with minimal memory requirements based on maintaining triangular Cholesky factors. This requires a modification of the cumulative step-size adaption (CSA) mechanism in the CMA-ES, in which we replace the inverse of the square root of the covariance matrix by the inverse of the triangular Cholesky factor. Because the triangular Cholesky factor changes smoothly with the matrix square root, this modification does not change the behavior of the CMA-ES in terms of required objective function evaluations as verified empirically. Thus, the described algorithm can and should replace the standard CMA-ES if updating and storing the covariance matrix matters. 1 Introduction The covariance matrix adaptation evolution strategy, CMA-ES [Hansen and Ostermeier, 2001], is recognized as one of the most competitive derivative-free algorithms for real-valued optimization [Beyer, 2007; Eiben and Smith, 2015]. The algorithm has been successfully applied in many unbiased performance comparisons and numerous real-world applications. In machine learning, it is mainly used for direct policy search in reinforcement learning and hyperparameter tuning in supervised learning (e.g., see Gomez et al. [2008]; Heidrich-Meisner and Igel [2009a,b]; Igel [2010], and references therein). The CMA-ES is a Monte Carlo method for optimizing functions f : Rd →R. The objective function f does not need to be continuous and can be multi-modal, constrained, and disturbed by noise. In each iteration, the CMA-ES samples from a d-dimensional multivariate normal distribution, the search distribution, and ranks the sampled points according to their objective function values. The mean and the covariance matrix of the search distribution are then adapted based on the ranked points. Given the ranking of the sampled points, the runtime of one CMA-ES iteration is ω(d2) because the square root of the covariance matrix is required, which is typically computed by an eigenvalue decomposition. If the objective function can be evaluated efficiently and/or d is large, the computation of the matrix square root can easily dominate the runtime of the optimization process. Various strategies have been proposed to address this problem. The basic approach for reducing the runtime is to perform an update of the matrix only every τ ∈Ω(d) steps [Hansen and Ostermeier, 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. 1996, 2001], effectively reducing the time complexity to O(d2). However, this forces the algorithm to use outdated matrices during most iterations and can increase the amount of function evaluations. Furthermore, it leads to an uneven distribution of computation time over the iterations. Another approach is to restrict the model complexity of the search distribution [Poland and Zell, 2001; Ros and Hansen, 2008; Sun et al., 2013; Akimoto et al., 2014; Loshchilov, 2014, 2015], for example, to consider only diagonal matrices [Ros and Hansen, 2008]. However, this can lead to a drastic increase in function evaluations needed to approximate the optimum if the objective function is not compatible with the restriction, for example, when optimizing highly non-separable problems while only adapting the diagonal of the covariance matrix [Omidvar and Li, 2011]. More recently, methods were proposed that update the Cholesky factor of the covariance matrix instead of the covariance matrix itself [Suttorp et al., 2009; Krause and Igel, 2015]. This works well for some CMA-ES variations (e.g., the (1+1)-CMA-ES and the multi-objective MO-CMA-ES [Suttorp et al., 2009; Krause and Igel, 2015; Bringmann et al., 2013]), however, the original CMA-ES relies on the matrix square root, which cannot be replaced one-to-one by a Cholesky factor. In the following, we explore the use of the triangular Cholesky factorization instead of the square root in the standard CMA-ES. In contrast to previous attempts in this direction, we present an approach that comes with a theoretical justification for why it does not deteriorate the algorithm’s performance. This approach leads to the optimal asymptotic storage and runtime complexity when adaptation of the full covariance matrix is required, as is the case for non-separable ill-conditioned problems. Our CMA-ES variant, referred to as Cholesky-CMA-ES, reduces the runtime complexity of the algorithm with no significant change in the number of objective function evaluations. It also reduces the memory footprint of the algorithm. Section 2 briefly describes the original CMA-ES algorithm (for details we refer Hansen [2015]). In section 3 we propose our new method for approximating the step-size adaptation. We give a theoretical justification for the convergence of the new algorithm. We provide empirical performance results comparing the original CMA-ES with the new Cholesky-CMA-ES using various benchmark functions in section 4. Finally, we discuss our results and draw our conclusions. 2 Background Before we briefly describe the CMA-ES to fix our notation, we discuss some basic properties of using a Cholesky decomposition to sample from a multi-variate Gaussian distribution. Sampling from a d-dimensional multi-variate normal distribution N(m, Σ), m ∈Rd ,Σ ∈Rd×d is usually done using a decomposition of the covariance matrix Σ. This could be the square root of the matrix Σ = HH ∈Rd×d or a lower triangular Cholesky factorization Σ = AAT , which is related to the square root by the QR-decomposition H = AE where E is an orthogonal matrix. We can sample a point x from N(m, Σ) using a sample z ∼N(0, I) by x = Hz + m = AEz + m = Ay + m, where we set y = Ez. We have y ∼N(0, I) since E is orthogonal. Thus, as long as we are only interested in the value of x and do not need y, we can sample using the Cholesky factor instead of the matrix square root. 2.1 CMA-ES The CMA-ES has been proposed by Hansen and Ostermeier [1996, 2001] and its most recent version is described by Hansen [2015]. In the tth iteration of the algorithm, the CMA-ES samples λ points from a multivariate normal distribution N(mt, σ2 t · Ct), evaluates the objective function f at these points, and adapts the parameters Ct ∈Rd×d, mt ∈Rd, and σt ∈R+. In the following, we present the update procedure in a slightly simplified form (for didactic reasons, we refer to Hansen [2015] for the details). All parameters (µ, λ, ω, cσ, dσ, cc, c1, cµ) are set to their default values [Hansen, 2015, Table 1]. For a minimization task, the λ points are ranked by function value such that f(x1,t) ≤f(x2,t) ≤ · · · ≤f(xλ,t). The distribution mean is set to the weighted average mt+1 = Pµ i=1 ωixi,t. The weights depend only on the ranking, not on the function values directly. This renders the algorithm invariant under order-preserving transformation of the objective function. Points with smaller ranks (i.e., better objective function values) are given a larger weight ωi with Pλ i=1 ωi = 1. The weights are zero for ranks larger than µ < λ, which is typically µ = λ/2. Thus, points with function values worse than the median do not enter the adaptation process of the parameters. The covariance matrix 2 is updated using two terms, a rank-1 and a rank-µ update. For the rank-1 update, a long term average of the changes of mt is maintained pc,t+1 = (1 −cc)pc,t + p cc(2 −cc)µeff mt+1 −mt σt , (1) where µeff = 1/ Pµ i=1 ω2 i is the effective sample size given the weights. Note that pc,t is large when the algorithm performs steps in the same direction, while it becomes small when the algorithm performs steps in alternating directions.1 The rank-µ update estimates the covariance of the weighted steps xi,t −mt, 1 ≤i ≤µ. Combining rank-1 and rank-µ update gives the final update rule for Ct, which can be motivated by principles from information geometry [Akimoto et al., 2012]: Ct+1 = (1 −c1 −cµ)Ct + c1pc,t+1pT c,t+1 + cµ σ2 t µ X i=1 ωi (xi,t −mt) (xi,t −mt)T (2) So far, the update is (apart from initialization) invariant under affine linear transformations (i.e., x 7→Bx + b, B ∈GL(d, R)). The update of the global step-size parameter σt is based on the cumulative step-size adaptation algorithm (CSA). It measures the correlation of successive steps in a normalized coordinate system. The goal is to adapt σt such that the steps of the algorithm become uncorrelated. Under the assumption that uncorrelated steps are standard normally distributed, a carefully designed long term average over the steps should have the same expected length as a χ-distributed random variable, denoted by E{χ}. The long term average has the form pσ,t+1 = (1 −cσ)pσ,t + p cσ(2 −cσ)µeff C−1/2 t mt+1 −mt σt (3) with pσ,1 = 0. The normalization by the factor C−1/2 t is the main difference between equations (1) and (3). It is important because it corrects for a change of Ct between iterations. Without this correction, it is difficult to measure correlations accurately in the un-normalized coordinate system. For the update, the length of pσ,t+1 is compared to the expected length E{χ} and σt is changed depending on whether the average step taken is longer or shorter than expected: σt+1 = σt exp  cσ dσ ∥pσ,t+1∥ E{χ} −1  (4) This update is not proven to preserve invariance under affine linear transformations [Auger, 2015], and it is it conjectured that it does not. 3 Cholesky-CMA-ES In general, computing the matrix square root or the Cholesky factor from an n × n matrix has time complexity ω(d2) (i.e., scales worse than quadratically). To reduce this complexity, Suttorp et al. [2009] have suggested to replace the process of updating the covariance matrix and decomposing it afterwards by updates directly operating on the decomposition (i.e., the covariance matrix is never computed and stored explicitly, only its factorization is maintained). Krause and Igel [2015] have shown that the update of Ct in equation (2) can be rewritten as a quadratic-time update of its triangular Cholesky factor At with Ct = AtAT t . They consider the special case µ = λ = 1. We propose to extend this update to the standard CMA-ES, which leads to a runtime O(µd2). As typically µ = O(log(d)), this gives a large speed-up compared to the explicit recomputation of the Cholesky factor or the inverse of the covariance matrix. Unfortunately, the fast Cholesky update can not be applied directly to the original CMA-ES. To see this, consider the term st = C−1/2 t (mt+1 −mt) in equation (3). Rewriting pσ,t+1 in terms of st in a non-recursive fashion, we obtain pσ,t+1 = p cσ(2 −cσ)µeff t X k=1 (1 −cσ)t−k σk sk . 1Given cc, the factors in (1) are chosen to compensate for the change in variance when adding distributions. If the ranking of the points would be purely random, √µeff · (mt+1 −mt)/σt ∼N(0, Ct) and if Ct = I and pc,t ∼N(0, I) then pc,t+1 ∼N(0, I). 3 Algorithm 1: The Cholesky-CMA-ES. input :λ, µ, m1, ωi=1...µ, cσ, dσ, cc, c1 and cµ A1 = I, pc,1 = 0, pσ,1 = 0 for t = 1, 2, . . . do for i = 1, . . . , λ do xi,t = σtAtyi,t + mt, yi,t ∼N(0, I) Sort xi,t, i = 1, . . . , λ increasing by f(xi,t) mt+1 = Pµ i=1 ωixi,t pc,t+1 = (1 −cc)pc,t + p cc(2 −cc)µeff mt+1−mt σt // Apply formula (2) to At At+1 ←p1 −c1 −cµAt At+1 ←rankOneUpdate(At+1, c1, pc,t+1) for i = 1, . . . , µ do At+1 ←rankOneUpdate(At+1, cµωi, xi,t−mt σt ) // Update σ using ˆsk as in (5) pσ,t+1 = (1 −cσ)pσ,t + p cσ(2 −cσ)µeffA−1 t mt+1−mt σt σt+1 = σt exp  cσ dσ  ∥pσ,t+1∥ E{χ} −1  Algorithm 2: rankOneUpdate(A, β, v) input :Cholesky factor A ∈Rd×d of C, β ∈R, v ∈Rd output : Cholesky factor A′ of C + βvvT α ←v b ←1 for j = 1, . . . , d do A′ jj ← q A2 jj + β b α2 j γ ←A2 jjb + βα2 j for k = j + 1, . . . , d do αk ←αk −αj Ajj Akj A′ kj = A′ jj Ajj Akj + A′ jjβαj γ αk b ←b + β α2 j A2 jj By the RQ-decomposition, we can find C1/2 t = AtEt with Et being an orthogonal matrix and At lower triangular. When replacing st by ˆst = A−1 t (mt+1 −mt), we obtain pσ,t+1 = p cσ(2 −cσ)µeff t X k=1 (1 −cσ)t−k σk ET k ˆsk . Thus, replacing C−1/2 t by A−1 t introduces a new random rotation matrix ET t , which changes in every iteration. Obtaining Et from At can be achieved by the polar-decomposition, which is a cubic-time operation: currently there are no algorithms known that can update an existing polar decomposition from an updated Cholesky factor in less than cubic time. Thus, if our goal is to apply the fast Cholesky update, we have to perform the update without this correction factor pσ,t+1 ≈ p cσ(2 −cσ)µeff t X k=1 (1 −cσ)t−k σk ˆsk . (5) This introduces some error, but we will show in the following that we can expect this error to be small and to decrease over time as the algorithm converges to the optimum. For this, we need the following result: 4 Lemma 1. Consider the sequence of symmetric positive definite matrices ¯C∞ t=0 with ¯Ct = Ct(det Ct)−1/d. Assume that ¯Ct t→∞ −→¯C and that ¯C is symmetric positive definite with det ¯C = 1. Let ¯C1/2 t = ¯AtEt denote the RQ-decomposition of ¯C1/2 t , where Et is orthogonal and ¯At lower triangular. Then it holds ET t−1Et t→∞ −→I. Proof. Let ¯C = ¯AE, the RQ-decomposition of ¯C. As det ¯C ̸= 0, this decomposition is unique. Because the RQ-decomposition is continuous, it maps convergent sequences to convergent sequences. Therefore Et t→∞ −→E and thus, ET t−1Et t→∞ −→ET E = I. This result establishes that, when Ct converges to a certain shape (but not necessary to a certain scaling), At and thus Et will also converge (up to scaling). Thus, as we only need the norm of pσ,t+1, we can rotate the coordinate system and by multiplying with Et we obtain ∥pσ,t+1∥= ∥Etpσ,t+1∥= p cσ(2 −cσ)µeff t X k=1 (1 −cσ)t−k σk EtET k ˆsk . (6) Therefore, if EtET t−1 t→∞ −→I, the error in the norm will also vanish due to the exponential weighting in the summation. Note that this does not hold for any decomposition Ct = BtBT t . If we do not constrain Bt to be triangular and allow any matrix, we do not have a bijective mapping between Ct and Bt anymore and the introduction of d(d−1) 2 degrees of freedom (as, e.g., in the update proposed by Suttorp et al. [2009]) allows the creation of non-converging sequences of Et even for Ct = const. As the CMA-ES is a randomized algorithm, we cannot assume convergence of Ct. However, in simplified algorithms the expectation of Ct converges [Beyer, 2014]. Still, the reasoning behind Lemma 1 establishes that the error caused by replacing st by ˆst is small if Ct changes slowly. Equation (6) establishes that the error depends only on the rotation of coordinate systems. As the mapping from Ct to the triangular factor At is one-to-one and smooth, the coordinate system changes in every step will be small – and because of the exponentially decaying weighting, only the last few coordinate systems matter at a particular time step t. The Cholesky-CMA-ES algorithm is given in Algorithm 1. One can derive the algorithm from the standard CMA-ES by decomposing (2) into a number of rank-1 updates Ct+1 = (((αCt +β1v1vT 1 )+ β2v2vT 2 ) . . . ) and applying them to the Cholesky factor using Algorithm 2. Properties of the update rule. The O(µd2) complexity of the update in the Cholesky-CMAES is asymptotically optimal.2 Apart from the theoretical guarantees, there are several additional advantages compared to approaches using a non-triangular Cholesky factorization (e.g., Suttorp et al. [2009]). First, as only triangular matrices have to be stored, the storage complexity is optimal. Second, the diagonal elements of a triangular Cholesky factor are the square roots of the eigenvalues of the factorized matrix, that is, we get the eigenvalues of the covariance matrix for free. These are important, for example, for monitoring the conditioning of the optimization problem and, in particular, to enforce lower bounds on the variances of σtCt projected on its principal components. Third, a triangular matrix can be inverted in quadratic time. Thus, we can efficiently compute A−1 t from At when needed, instead of having two separate quadratic-time updates for A−1 t and At, which requires more memory and is prone to numerical instabilities. 4 Experiments and Results Experiments. We compared the Cholesky-CMA-ES with other CMA-ES variants.3 The reference CMA-ES implementation uses a delay strategy in which the matrix square root is computed every max n 1, 1 10d(c1+cµ) o iterations [Hansen, 2015], which equals one for the dimensions considered 2Actually, the complexity is related to the complexity of multiplying two µ × d matrices. We assume a naïve implementation of matrix multiplication. With a faster multiplication algorithm, the complexity can be reduced accordingly. 3We added our algorithm to the open-source machine learning library Shark [Igel et al., 2008] and used LAPACK for high efficiency. 5 Cholesky-CMA-ES Suttorp-CMA-ES CMA-ES/d CMA-ES-Ref Iterations 104 103 102 4 32 256 (a) Sphere 104 103 102 4 32 256 (b) Cigar 104 103 102 4 32 256 (c) Discus Iterations d 104 103 102 4 32 256 (d) Ellipsoid d 104 103 102 4 32 256 (e) Rosenbrock d 104 103 102 4 32 256 (f) DiffPowers Figure 1: Function evaluations required to reach f(x) < 10−14 over problem dimensionality (medians of 100 trials). The graphs for CMA-ES-Ref and Cholesky-CMA-ES overlap. Cholesky-CMA-ES Suttorp-CMA-ES CMA-ES/d CMA-ES-Ref time/s 103 1 10−3 4 32 256 (a) Sphere 103 1 10−3 4 32 256 (b) Cigar 103 1 10−3 4 32 256 (c) Discus time/s d 103 1 10−3 4 32 256 (d) Ellipsoid d 103 1 10−3 4 32 256 (e) Rosenbrock d 103 1 10−3 4 32 256 (f) DiffPowers Figure 2: Runtime in seconds over problem dimensionality. Shown are medians of 100 trials. Note the logarithmic scaling on both axes. 6 Name f(x) Sphere ∥x∥2 Rosenbrock Pd−1 i=0 100(xi+1 −x2 i )2 + (1 −xi)2 Discus x2 0 + Pd i=1 10−6x2 i Cigar 10−6x2 0 + Pd i=1 x2 i Ellipsoid Pd i=0 10 −6i d−1 x2 i Different Powers Pd i=0 |xi| 2+10i d−1 Table 1: Benchmark functions used in the experiments (additionally, a rotation matrix B transforms the variables, x 7→Bx) Cholesky-CMA-ES Suttorp-CMA-ES CMA-ES/d CMA-ES-Ref log f(mt) 102 10−6 10−14 0 10 20 (a) Sphere 102 10−6 10−14 0 30 60 (b) Cigar log f(mt) 102 10−6 10−14 0 200 400 (c) Discus 102 10−6 10−14 0 200 400 (d) DiffPowers log f(mt) time/s 102 10−6 10−14 0 200 400 (e) Ellipsoid time/s 102 10−6 10−14 0 200 400 (f) Rosenbrock Figure 3: Function value evolution over time on the benchmark functions with d = 128. Shown are single runs, namely those with runtimes closest to the corresponding median runtimes. 7 in our experiments. We call this variant CMA-ES-Ref. As an alternative, we experimented with delaying the update for d steps. We refer to this variant as CMA-ES/d. We also adapted the nontriangular Cholesky factor approach by Suttorp et al. [2009] to the state-of-the art implementation of the CMA-ES. We refer to the resulting algorithm as Suttorp-CMA-ES. We considered standard benchmark functions for derivative-free optimization given in Table 1. Sphere is considered to show that on a spherical function the step size adaption does not behave differently; Cigar/Discus/Ellipsoid model functions with different convex shapes near the optimum; Rosenbrock tests learning a function with d −1 bends, which lead to slowly converging covariance matrices in the optimization process; Diffpowers is an example of a function with arbitrarily bad conditioning. To test rotation invariance, we applied a rotation matrix to the variables, x 7→Bx, B ∈SO(d, R). This is done for every benchmark function, and a rotation matrix was chosen randomly at the beginning of each trial. All starting points were drawn uniformly from [0, 1], except for Sphere, where we sampled from N(0, I). For each function, we vary d ∈{4, 8, 16, . . . , 256}. Due to the long running times, we only compute CMA-ES-Ref up to d = 128. For the given range of dimensions, for every choice of d, we ran 100 trials from different initial points and monitored the number of iterations and the wall-clock time needed to sample a point with a function value below 10−14. For Rosenbrock we excluded the trials in which the algorithm did not converge to the global optimum. We further evaluated the algorithms on additional benchmark functions inspired by Stich and Müller [2012] and measured the change of rotation introduced by the Cholesky-CMA-ES at each iteration (Et), see supplementary material. Results. Figure 1 shows that CMA-ES-Ref and Cholesky-CMA-ES required the same amount of function evaluations to reach a given objective value. The CMA-ES/d required slightly more evaluations depending on the benchmark function. When considering the wall-clock runtime, the Cholesky-CMA-ES was significantly faster than the other algorithms. As expected from the theoretical analysis, the higher the dimensionality the more pronounced the differences, see Figure 2 (note logarithmic scales). For d = 64 the Cholesky-CMA-ES was already 20 times faster than the CMA-ES-Ref. The drastic differences in runtime become apparent when inspecting single trials. Note that for d = 256 the matrix size exceeded the L2 cache, which affected the performance of the Cholesky-CMA-ES and Suttorp-CMA-ES. Figure 3 plots the trials with runtimes closest to the corresponding median runtimes for d = 128. 5 Conclusion CMA-ES is a ubiquitous algorithm for derivative-free optimization. The CMA-ES has proven to be a highly efficient direct policy search algorithm and to be a useful tool for model selection in supervised learning. We propose the Cholesky-CMA-ES, which can be regarded as an approximation of the original CMA-ES. We gave theoretical arguments for why our approximation, which only affects the global step-size adaptation, does not impair performance. The Cholesky-CMA-ES achieves a better, asymptotically optimal time complexity of O(µd2) for the covariance update and optimal memory complexity. It allows for numerically stable computation of the inverse of the Cholesky factor in quadratic time and provides the eigenvalues of the covariance matrix without additional costs. We empirically compared the Cholesky-CMA-ES to the state-of-the-art CMA-ES with delayed covariance matrix decomposition. Our experiments demonstrated a significant increase in optimizaton speed. As expected, the Cholesky-CMA-ES needed the same amount of objective function evaluations as the standard CMA-ES, but required much less wall-clock time – and this speed-up increases with the search space dimensionality. Still, our algorithm scales quadratically with the problem dimensionality. If the dimensionality gets so large that maintaining a full covariance matrix becomes computationally infeasible, one has to resort to low-dimensional approximations [e.g., Loshchilov, 2015], which, however, bear the risk of a significant drop in optimization performance. Thus, we advocate our new Cholesky-CMA-ES for scaling up CMA-ES to large optimization problems for which updating and storing the covariance matrix is still possible, for example, for training neural networks in direct policy search. Acknowledgement. We acknowledge support from the Innovation Fund Denmark through the projects “Personalized breast cancer screening” (OK, CI) and “Cyber Fraud Detection Using Advanced Machine Learning Techniques” (DRA, CI). 8 References Y. Akimoto, Y. Nagata, I. Ono, and S. Kobayashi. Theoretical foundation for CMA-ES from information geometry perspective. Algorithmica, 64(4):698–716, 2012. Y. Akimoto, A. Auger, and N. Hansen. Comparison-based natural gradient optimization in high dimension. In Proceedings of the 16th Annual Genetic and Evolutionary Computation Conference (GECCO), pages 373–380. ACM, 2014. A. Auger. Analysis of Comparison-based Stochastic Continous Black-Box Optimization Algorithms. Habilitation thesis, Faculté des Sciences d’Orsay, Université Paris-Sud, 2015. H.-G. Beyer. Evolution strategies. Scholarpedia, 2(8):1965, 2007. H.-G. Beyer. Convergence analysis of evolutionary algorithms that are based on the paradigm of information geometry. Evolutionary Computation, 22(4):679–709, 2014. K. Bringmann, T. Friedrich, C. Igel, and T. Voß. Speeding up many-objective optimization by Monte Carlo approximations. Artificial Intelligence, 204:22–29, 2013. A. E. Eiben and Jim Smith. From evolutionary computation to the evolution of things. Nature, 521:476–482, 2015. F. Gomez, J. Schmidhuber, and R. Miikkulainen. Accelerated neural evolution through cooperatively coevolved synapses. Journal of Machine Learning Research, 9:937–965, 2008. N. Hansen and A. Ostermeier. Adapting arbitrary normal mutation distributions in evolution strategies: The covariance matrix adaptation. In Proceedings of IEEE International Conference on Evolutionary Computation (CEC 1996), pages 312–317. IEEE, 1996. N. Hansen and A. Ostermeier. Completely derandomized self-adaptation in evolution strategies. Evolutionary Computation, 9(2):159–195, 2001. N. Hansen. The CMA evolution strategy: A tutorial. Technical report, Inria Saclay – Île-de-France, Université Paris-Sud, LRI, 2015. V. Heidrich-Meisner and C. Igel. Hoeffding and Bernstein races for selecting policies in evolutionary direct policy search. In Proceedings of the 26th International Conference on Machine Learning (ICML 2009), pages 401–408, 2009. V. Heidrich-Meisner and C. Igel. Neuroevolution strategies for episodic reinforcement learning. Journal of Algorithms, 64(4):152–168, 2009. C. Igel, T. Glasmachers, and V. Heidrich-Meisner. Shark. Journal of Machine Learning Research, 9:993–996, 2008. C. Igel. Evolutionary kernel learning. In Encyclopedia of Machine Learning. Springer-Verlag, 2010. O. Krause and C. Igel. A more efficient rank-one covariance matrix update for evolution strategies. In Proceedings of the 2015 ACM Conference on Foundations of Genetic Algorithms (FOGA XIII), pages 129–136. ACM, 2015. I. Loshchilov. A computationally efficient limited memory CMA-ES for large scale optimization. In Proceedings of the 16th Annual Genetic and Evolutionary Computation Conference (GECCO), pages 397–404. ACM, 2014. I. Loshchilov. LM-CMA: An alternative to L-BFGS for large scale black-box optimization. Evolutionary Computation, 2015. M. N. Omidvar and X. Li. A comparative study of CMA-ES on large scale global optimisation. In AI 2010: Advances in Artificial Intelligence, volume 6464 of LNAI, pages 303–312. Springer, 2011. J. Poland and A. Zell. Main vector adaptation: A CMA variant with linear time and space complexity. In Proceedings of the 10th Annual Genetic and Evolutionary Computation Conference (GECCO), pages 1050–1055. Morgan Kaufmann Publishers, 2001. R. Ros and N. Hansen. A simple modification in CMA-ES achieving linear time and space complexity. In Parallel Problem Solving from Nature (PPSN X), pages 296–305. Springer, 2008. S. U. Stich and C. L. Müller. On spectral invariance of randomized Hessian and covariance matrix adaptation schemes. In Parallel Problem Solving from Nature (PPSN XII), pages 448–457. Springer, 2012. Y. Sun, T. Schaul, F. Gomez, and J. Schmidhuber. A linear time natural evolution strategy for non-separable functions. In 15th Annual Conference on Genetic and Evolutionary Computation Conference Companion, pages 61–62. ACM, 2013. T. Suttorp, N. Hansen, and C. Igel. Efficient covariance matrix update for variable metric evolution strategies. Machine Learning, 75(2):167–197, 2009. 9
2016
93
6,556
Feature selection in functional data classification with recursive maxima hunting Jos´e L. Torrecilla Computer Science Department Universidad Aut´onoma de Madrid 28049 Madrid, Spain joseluis.torrecilla@uam.es Alberto Su´arez Computer Science Department Universidad Aut´onoma de Madrid 28049 Madrid, Spain alberto.suarez@uam.es Abstract Dimensionality reduction is one of the key issues in the design of effective machine learning methods for automatic induction. In this work, we introduce recursive maxima hunting (RMH) for variable selection in classification problems with functional data. In this context, variable selection techniques are especially attractive because they reduce the dimensionality, facilitate the interpretation and can improve the accuracy of the predictive models. The method, which is a recursive extension of maxima hunting (MH), performs variable selection by identifying the maxima of a relevance function, which measures the strength of the correlation of the predictor functional variable with the class label. At each stage, the information associated with the selected variable is removed by subtracting the conditional expectation of the process. The results of an extensive empirical evaluation are used to illustrate that, in the problems investigated, RMH has comparable or higher predictive accuracy than standard dimensionality reduction techniques, such as PCA and PLS, and state-of-the-art feature selection methods for functional data, such as maxima hunting. 1 Introduction In many important prediction problems from different areas of application (medicine, environmental monitoring, etc.) the data are characterized by a function, instead of by a vector of attributes, as is commonly assumed in standard machine learning problems. Some examples of these types of data are functional magnetic resonance imaging (fMRI) (Grosenick et al., 2008) and near-infrared spectra (NIR) (Xiaobo et al., 2010). Therefore, it is important to develop methods for automatic induction that take into account the functional structure of the data (infinite dimension, high redundancy, etc.) (Ramsay and Silverman, 2005; Ferraty and Vieu, 2006). In this work, the problem of classification of functional data is addressed. For simplicity, we focus on binary classification problems (Ba´ıllo et al., 2011). Nonetheless, the proposed method can be readily extended to a multiclass setting. Let X(t), t ∈[0, 1] be a continuous stochastic process in a probability space (Ω, F, P). A functional datum Xn(t) is a realization of this process (a trajectory). Let {Xn(t), Yn}Ntrain n=1 , t ∈[0, 1] be a set of trajectories labeled by the dichotomous variable Yn ∈{0, 1}. These trajectories come from one of two different populations; either P0, when the label is Yn = 0, or P1, when the label is Yn = 1. For instance, the data could be the ECG’s from either healthy or sick persons (P0 and P1, respectively). The classification problem consist in deciding to which population a new unlabeled observation Xtest(t) belongs (e.g., to decide from his or her ECG whether a person is healthy or not). Specifically, we are interested in the problem of dimensionality reduction for functional data classification. The goal is to achieve the optimal discrimination performance using only a finite, small set of values from the trajectory as input to a standard classifier (in our work, k-nearest neighbors). 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. In general, to properly handle functional data, some kind of reduction of information is necessary. Standard dimensionality reduction methods in functional data analysis (FDA) are based on principal component analysis (PCA) (Ramsay and Silverman, 2005) or partial least squares (PLS) (Preda et al., 2007). In this work, we adopt a different approach based on variable selection (Guyon et al., 2006). The goal is to replace the complete function X(t) by a d-dimensional vector (X(t1), . . . , X(td)) for a set of “suitable chosen” points {t1, . . . , td} (for instance, instants in a heartbeat in ECG’s), where d is small. Most previous work on feature selection in supervised learning with functional data is quite recent and focuses on regression problems; for instance, on the analysis of fMRI images (Grosenick et al., 2008; Ryali et al., 2010) and NIR spectra (Xiaobo et al., 2010). In particular, adaptations of lasso and other embedded methods have been proposed to this end (see, e.g., Kneip and Sarda (2011); Zhou et al. (2013); Aneiros and Vieu (2014)). In most cases, functional data are simply treated as high-dimensional vectors for which the standard methods apply. Specifically, G´omez-Verdejo et al. (2009) propose feature extraction from the functional trajectories before applying a multivariate variable selector based on measuring the mutual information. Similarly, Fernandez-Lozano et al. (2015) compare different standard feature selection techniques for image texture classification. The method of minimum Redundancy Maximum Relevance (mRMR) introduced by Ding and Peng (2005) has been applied to functional data in Berrendero et al. (2016a). In that work distance correlation (Sz´ekely et al., 2007) is used instead of mutual information to measure nonlinear dependencies, with good results. A fully functional perspective is adopted in Ferraty et al. (2010) and Delaigle et al. (2012). In these articles, a wrapper approach is used to select the optimal set of instants in which the trajectories should be monitored by minimizing a cross-validation estimate of the classification error. Berrendero et al. (2015) introduce a filter selection procedure based on computing the Mahalanobis distance and Reproducing Kernel Hilbert Space techniques. Logistic regression models have been applied to the problem of binary classification with functional data in Lindquist and McKeague (2009) and McKeague and Sen (2010), assuming Brownian and fractional Brownian trajectories, respectively. Finally, the selection of intervals or elementary functions instead of variables is addressed in Li and Yu (2008); Fraiman et al. (2016) or Tian and James (2013). From the analysis of previous work one concludes that, in general, it is preferable, both in terms of accuracy and interpretability, to adopt a fully functional approach to the problem. In particular, if the data are characterized by functions that are continuous, values of the trajectory that are close to each other tend to be highly redundant and convey similar information. Therefore, if the value of the process at a particular instant has high discriminant capacity, one could think of discarding nearby values. This idea is exploited in maxima hunting (MH) (Berrendero et al., 2016b). In this work, we introduce recursive Maxima Hunting (RMH), a novel variable selection method for feature selection in functional data classification that takes advantage of the good properties of MH while addressing some of its deficiencies. The extension of MH consists in removing the information conveyed by each selected local maximum before searching for the next one in a recursive manner. The rest of the paper is organized as follows: Maxima hunting for feature selection in classification problems with functional data is introduced in Section 2. Recursive maxima hunting, which is the method proposed in this work, is described in Section 3. The improvements that can be obtained with this novel feature selection method are analyzed in an exhaustive empirical evaluations whose results are presented and discussed in Section 4. 2 Maxima Hunting Maxima hunting (MH) is a method for feature selection in functional classification based on measuring dependencies between values selected from {X(t), t ∈[0, 1]} and the response variable (Berrendero et al., 2016b). In particular, one selects the values {X(t1), . . . , X(td)} whose dependence with the class label (i.e., the response variable) is locally maximal. Different measures of dependency can be used for this purpose. In Berrendero et al. (2016b), the authors propose the distance correlation (Sz´ekely et al., 2007). The distance covariance between the random variables X ∈Rp and Y ∈Rq, whose components are assumed to have finite first-order moments, is V2(X, Y ) = Z Rp+q | ϕX,Y (u, v) −ϕX(u)ϕY (v) |2 w(u, v)dudv, (1) 2 where ϕX,Y , ϕX, ϕY are the characteristic functions of (X, Y ), X and Y , respectively, w(u, v) = (cpcq|u|1+p p |v|1+q q )−1, cd = π(1+d)/2 Γ((1+d)/2) is half the surface area of the unit sphere in Rd+1, and | · |d stands for the Euclidean norm in Rd. In terms of V2(X, Y ), the square of the distance correlation is R2(X, Y ) = ( V2(X,Y ) √ V2(X,X)V2(Y,Y ), V2(X)V2(Y ) > 0 0, V2(X)V2(Y ) = 0. (2) The distance correlation is a measure of statistical independence; that is, R2(X, Y ) = 0 if and only if X and Y are independent. Besides being defined for random variables of different dimensions, it has other valuable properties. In particular, it is rotationally invariant and scale equivariant (Sz´ekely and Rizzo, 2012). A further advantage over other measures of independence, such as the mutual information, is that the distance correlation can be readily estimated using a plug-in estimator that does not involve any parameter tuning. The almost sure convergence of the estimator V2 n is proved in Sz´ekely et al. (2007, Thm. 2). To summarize, in maxima hunting, one selects the d different local maxima of the distance correlation between X(t), the values of random process at different instants t ∈[0, 1], and the response variable X(ti) = argmax t∈[0,1] R2(X(t), Y ), i = 1, 2, . . . , d. (3) Maxima Hunting is easy to interpret. It is also well-motivated from the point of view of FDA, because it takes advantage of functional properties of the data, such as continuity, which implies that similar information is conveyed by the values of the function at neighboring points. In spite of the simplicity of the method, it naturally accounts for the relevance and redundancy trade-off in feature selection (Yu and Liu, 2004): the local maxima (3) are relevant for discrimination. Points around them, which do not maximize the distance correlation with the class label, are automatically excluded. Furthermore, it is also possible to derive a uniform convergence result, which provides additional theoretical support for the method. Finally, the empirical investigation carried out in Berrendero et al. (2016b) shows that MH performs well in standard benchmark classification problems for functional data. In fact, for some problems, one can show that the optimal (Bayes) classification rules depends only on the maxima of R2(X(t), Y ). However, maxima hunting presents also some limitations. First, it is not always a simple task to estimate the local maxima, especially in functions that are very smooth or that vary abruptly. Furthermore, there is no guarantee that different maxima are not redundant. In most cases, the local maxima of R2(X(t), Y ) are indeed relevant for classification. However, there are important points for which this quantity does not attain a maximum. As an example, consider the family of classification problems introduced in Berrendero et al. (2016b, Prop. 3), in which the goal is to discriminate trajectories generated by a standard Brownian motion process, B(t), and trajectories from the process B(t) + Φm,k(t), where Φm,k(t) = Z t 0 √ 2m−1 h I( 2k−2 2m , 2k−1 2m )(s) −I( 2k−1 2m , 2k 2m )(s) i ds, m, k ∈N, 1 ≤k ≤2m−1. (4) Assuming a balanced class distribution (P(Y = 0) = P(Y = 1) = 1/2), the optimal classification rule is g∗(x) = 1 if and only if X 2k−1 2m  −X 2k−2 2m  + X 2k−1 2m  −X 2k 2m  > 1 √ 2m+1 . The optimal classification error is L∗= 1 −normcdf  ∥Φ′ m,k(t)∥ 2  = 1 −normcdf 1 2  ≃0.3085, where, ∥· ∥denotes the L2[0, 1] norm, and normcdf(·) is the cumulative distribution function of the standard normal. The relevance function has a single maximum at X 2k−1 2m  . However, the Bayes classification rule involves three relevant variables, two of which are clearly not maxima of R2(X(t), Y ). In spite of the simplicity of these types of functional classification problems, they are important to analyze, because the set of functions Φm,k, with m > 0 and k > 0 form an orthonormal basis of the Dirichlet space D[0, 1], the space of continuous functions whose derivatives are in L2[0, 1]. Furthermore, this space is the reproducing kernel Hilbert space associated with Brownian motion and plays and important role in functional classification (M¨orters and Peres, 2010; Berrendero et al., 2015). In fact, any trend in the Brownian process can be approximated by a linear combination or by a mixture of Φm,k(t). 3 0 1/4 1/2 3/4 1 X(t) -2 -1 0 1 2 Initial step time 0 1/4 1/2 3/4 1 R2(X(t);Y ) 0 0,1 0 1/4 1/2 3/4 1 -2 -1 0 1 2 After -rst correction time 0 1/4 1/2 3/4 1 0 0.4 0 1/4 1/2 3/4 1 -2 -1 0 1 2 After second correction time 0 1/4 1/2 3/4 1 0 0.1 Figure 1: First row: Individual and average trajectories for the classification of B(t) vs. B(t) + 2Φ3,3(t) initially (left) and after the first (center) and second (right) corrections. Second row: Values of R2(X(t), Y ) as a function of t. The variables required for optimal classification are marked with vertical dashed lines. To illustrate the workings of maxima hunting and its limitations we analyze in detail the classification problem B(t) vs. B(t) + 2Φ3,3(t), which is of the type considered above. In this case, the optimal classification rule depends on the maximum X(5/8), and on X(1/2) and X(3/4), which are not maxima, and would therefore not be selected by the MH algorithm. The optimal error is L∗= 15.87%. To illustrate the importance of selecting all the relevant variables, we perform simulations in which we compare the accuracy of the linear Fisher discriminant with the maxima hunting selection, and with the optimal variable selection procedures. In these experiments, independent training and test samples of size 1000 are generated. The values reported are averages over 100 independent runs. Standard deviations are given between parentheses. The average prediction error when only the maximum of the trajectories is considered is 37.63%(1.44%). When all three variables are used the empirical error is 15.98%(1%), which is close to the Bayes error. When other points in addition to the maximum are used (i.e., (X(t1), X(5/8), X(t2), with t1 and t2 randomly chosen so that 0 ≤t1 < 5/8 < t2 ≤1) the average classification error is 22.32%(2.18%). In the top leftmost plot of Figure 1 trajectories from both classes, together with the corresponding averages (thick lines) are shown. The relevance function R2(X(t), Y ) is plotted below. The relevant variables, which are required for optimal classification, are marked by dashed vertical lines. 3 Recursive Maxima Hunting As a variable selection process, MH avoids, at least partially, the redundancy introduced by the continuity of the functions that characterize the instances. However, this local approach cannot detect redundancies among different local maxima. Furthermore, there could be points in the trajectory that do not correspond to maxima of the relevance function, but which are relevant when considered jointly with the maxima. The goal of recursive maxima hunting (RMH) is to select the maxima of R2(X(t), Y ) in a recursive manner by removing at each step the information associated to the most recently selected maximum. This avoids the influence of previously selected maxima, which can obscure ulterior dependencies. The influence of a selected variable X(t0) on the rest of the trajectory can be eliminated by subtracting the conditional expectation E(X(t)|X(t0)) from X(t). Assuming that the underlying process is Brownian E(X(t)|X(t0)) = min(t, t0) t0 X(t0), t ∈[0, 1]. (5) In the subsequent iterations, there are two intervals: [t, t0] and [t0, 1]. Conditioned on the value at X(t0), the process in the interval [t0, 1] is still Brownian motion. By contrast, for the interval [0, t0] the process is a Brownian bridge, whose conditional expectation is E(X(t)|X(t0) = min(t, t0) −t t0 t0(1 −t0) X(t0) =  t t0 X(t0), t < t0 1−t 1−t0 X(t0), t > t0. (6) As illustrated by the results in the experimental section, the Brownian hypothesis is a robust assumption. Nevertheless, if additional information on the underlying stochastic processes is available, it can 4 be incorporated to the algorithm during the calculation of the conditional expectation in Equations (5) and (6). The center and right plots in Figure 1 illustrate the behavior of RMH in the example described in the previous section. The top center plot diplays the trajectories and corresponding averages (thick lines) for both classes after applying the correction (5) with t0 = 5/8, which is the first maximum of the distance correlation function (bottom leftmost plot in Figure 1). The variable X(5/8) is clearly uninformative once this correction has been applied. The distance correlation R2(X(t), Y ) for the corrected trajectories is displayed in the bottom center plot. Also in this plot the relevant variables are marked by vertical dashed lines. It is clear that the subsequent local maxima at t = 1/2, in the subinterval [0, 5/8], and at t = 3/4, in the subinterval, and [5/8, 1] correspond to the remaining relevant variables. The last column shows the corresponding plots after the correction is applied anew (equations (6) with t0 = 1/2 in [0, 5/8] and (5) with t0 = 3/4 in [5/8, 1]). After this second correction, the discriminant information has been removed. In consequence, the distance correlation function, up to sample fluctuations, is zero. An important issue in the application of this method is how to decide when to stop the recursive search. The goal is to avoid including irrelevant and/or redundant variables. To address the first problem, we only include maxima that are sufficiently prominent R2(X(tmax), Y ) > s, where 0 < s < 1 can be used to gauge the relative importance of the maximum. Redundancy is avoided by excluding points around a selected maximum tmax for which R2(X(tmax), X(t)) ≥r, for some redundancy threshold 0 < r < 1, which is typically close to one. As a result of these two conditions only a finite (typically small) number of variables are selected. This data-driven stopping criterion avoids the need to set the number of selected variables beforehand or to determine this number by a costly validation procedure. The sensitivity of the results to the values of r and s will be studied in Section 4. Nonetheless, RMH has a good and robust performance for a wide range of reasonable values of these parameters (r close to 1 and s close to 0). The pseudocode of the RMH algorithm is given in Algorithm 1. Algorithm 1 Recursive Maxima Hunting 1: function RMH(X(t), Y ) 2: t∗←[ ] ▷Vector of selected points initially empty 3: RMH rec(X(t),Y ,0,1) ▷Recursive search of the maxima of R2(X(t), Y ) 4: return t∗ ▷Vector of selected points 5: end function 6: procedure RMH REC(X(t), Y, tinf, tsup) 7: tmax ← argmax tinf ≤t≤tsup  R2(X(t), Y ) 8: if R2(X(tmax), Y ) > s then 9: t∗←[t∗tmax] ▷Include tmax in t∗the vector of selected points 10: X(t) ←X(t) −E(X(t) | X(tmax)), t ∈[tinf, tsup] ▷Correction of type (5) or (6) as required 11: else 12: return 13: end if 14: ▷Exclude redundant points to the left of tmax 15: t− max ← max tinf ≤t<tmax  t : R2 (X(tmax), X(t)) ≤r 16: if t− max > tinf then 17: RMH rec(X(t), Y, tinf, t− max) ▷Recursion on left subinterval 18: end if 19: ▷Exclude redundant points to the right of tmax 20: t+ max ← min tmax<t≤tsup  t : R2 (X(tmax), X(t)) ≤r 21: if t+ max < tsup then 22: RMH rec(X(t), Y, t+ max, tsup) ▷Recursion on right subinterval 23: end if 24: return 25: end procedure 5 4 Empirical study To assess the performance of RMH, we have carried out experiments in simulated and real-world data in which it is compared with some well-established dimensionality reduction methods, such as PCA (Ramsay and Silverman, 2005) and partial least squares (Delaigle and Hall, 2012b), and with Maxima Hunting (Berrendero et al., 2016b). In these experiments, k-nearest neighbors (kNN) with the Euclidean distance is used for classification. kNN has been selected because it is a simple, nonparametric classifier with reasonable overall predictive accuracy. The value k in kNN is selected by 10-fold CV from integers in [1, √Ntrain], where Ntrain is the size of the training set. Since RMH is a filter method for variable selection, the results are expected to be similar when other types of classifiers are used. As a reference, the results of kNN using complete trajectories (i.e., without dimensionality reduction) are also reported. This approach is referred to as Base. Note that, in this case, the performance of kNN need not be optimal because of the presence of irrelevant attributes. RMH requires determining the values of two hyperparameters: the redundancy threshold r (0 < r < 1 typically close to 1), and the relevance threshold s (0 < s < 1 typically close to 0). Through extensive simulations we have observed that RMH is quite robust for a wide range of appropriate values of these parameters. In particular, the results are very similar for values of r in the interval [0.75, 0.95]. The predictive accuracy is somewhat more sensitive to the choice of s: If the value of s is too small, irrelevant variables can be selected. If s is too large, it is possible that relevant points are excluded. For most of the experiments performed, the optimal values of s are between 0.025 and 0.1. In view of these observations, the experiments are made using r = 0.8. The value of s is selected from the set {0.025, 0.05, 0.1} by 10-fold CV. A more careful determination of r and s is beneficial, especially in some extreme problems (e.g., with very smooth or with rapidly-varying trajectories). In RMH, the number of selected variables, which is not determined beforehand, depends indirectly on the values of r and s. In the other methods, the number of selected variables is determined using 10-fold CV, with maximum of 30. A first batch of experiments is carried out on simulated data generated from the model  P0 : B(t) , t ∈[0, 1] P1 : B(t) + m(t) , t ∈[0, 1] , where B(t) is standard Brownian motion, m(t) is a deterministic trend, and P(Y = 0) = P(Y = 1) = 1/2. Using Berrendero et al. (2015, Theorem 2), it is possible to compute the optimal classification rules g∗and the corresponding Bayes errors L∗. To ensure a wide coverage, we consider two problems in which the Bayes rule depends only on a few variables and two problems in which complete trajectories are needed for optimal classification: (i) Peak: m(t) = 2Φ3,3(t). The optimal rule depends only on X(1/2), X(5/8) and X(3/4). The Bayes error is L∗≃0.1587. This is the example analyzed in the previous section. (ii) Peak2: m(t) = 2Φ3,2(t) + 3Φ3,3(t) −2Φ2,2(t). The optimal rule depends only on X(1/4), X(3/8), X(1/2), X(5/8), X(3/4), and X(1). The Bayes error is L∗≃0.0196. (iii) Square: m(t) = 2t2. The Bayes error is L∗≃0.1241. (iv) Sin: m(t) = 1/2 sin(2φt). The Bayes error is L∗≃0.1333. In Figure 2 we have plotted some trajectories corresponding to class 1 instances, together with their corresponding averages (thick lines). Class 0 trajectories are realizations of a standard Brownian process. In these experiments, training samples of different sizes (Ntrain = {50, 100, 200, 500, 1000}) and an independent test set of size 1000 are generated. The trajectories are discretized in 200 points. Half of the trajectories belong to each class in both the training and test sets. The values reported are averages over 200 independent repetitions. Figure 3 displays the average classification error (first row) and the average number of selected variable /components (second row) as a function of the training sample size for each model and classification method. Horizontal dashed lines are used to indicate the Bayes error level in the different problems. From the results reported in Figure 3, one concludes that RMH has the best overall performance. It is always more accurate than the Base method. This observation justifies performing variable selection not only for the sake of dimensionality reduction, but also to improve the classification accuracy. RMH is also better than the original MH in all the problems investigated: there is both an improvement of the prediction error, and a reduction of the numeber of variables used for classification. In peak and peak2, problems in which the relevant variables are known, RMH generally selects the correct ones. As expected, PLS performs better than PCA. However, both MH and RMH outperform these projection methods, except in sin, where their accuracies are similar. Both PLS and RMH are effective dimensionality reduction methods with comparable performance. 6 −3 −2 −1 0 1 2 3 X(t) | Y = 1 Peak −3 −2 −1 0 1 2 3 Peak2 −3 −2 −1 0 1 2 3 Square −3 −2 −1 0 1 2 3 Sin Figure 2: Class 1 trajectories and averages (thick lines) for the different synthetic problems. 50 100 200 500 1000 0 0.05 0.1 0.15 0.2 0.25 0.3 Peak2 50 100 200 500 1000 0 5 10 15 20 Ntrain 50 100 200 500 1000 0.15 0.2 0.25 0.3 0.35 0.4 0.45 Classification error Peak 50 100 200 500 1000 0 5 10 15 20 Ntrain Number of variables 50 100 200 500 1000 0.14 0.16 0.18 0.2 0.22 0.24 0.26 Sin PCA PLS MH RMH Base L* 50 100 200 500 1000 0 5 10 15 20 Ntrain 50 100 200 500 1000 0.12 0.14 0.16 0.18 0.2 0.22 0.24 Square 50 100 200 500 1000 0 5 10 15 20 Ntrain Figure 3: Average classification error (first row) and average number of selected variables/components (second row) as a function of the size of the training. However, the components selected in PLS are, in general, more difficult to interpret because they involve whole trajectories. Finally, the accuracy of RMH is very close to the Bayes level for higher sample sizes, even when the optimal rule requires using complete trajectories (square and sin). To assess the performance of RMH in real-world functional classification problems, we have carried out a second batch of experiments in four datasets, which are commonly used as benchmarks in the FDA literature. Instances in Growth correspond to curves of the heights of 54 girls and 38 boys from the Berkeley Growth Study. Observations are discretized in 31 non-equidistant ages between 1 and 18 years (Ramsay and Silverman, 2005; Mosler and Mozharovskyi, 2014). The Tecator dataset consists of 215 near-infrared absorbance spectra of finely chopped meat. The spectral curves consist of 100 equally spaced points. The class labels are determined in terms of fat content (above or below 20%). The curves are fairly smooth. In consequence, we have followed the general recommendation and used the second derivative for classification (Ferraty and Vieu, 2006; Galeano et al., 2014). The Phoneme data consists of 4509 log-periodograms observed at 256 equidistant points. Here, we consider the binary problem of distinguishing between the phonemes “aa” (695) and “ao” (1022) (Galeano et al., 2014). Following Delaigle and Hall (2012a), the curves are smoothed with a local linear method and truncated to the first 50 variables. The Medflies are records of daily egg-laying patterns of a thousand flies. The goal is to discriminate between short- and long-lived flies. Following Mosler and Mozharovskyi (2014), curves equal to zero are excluded. There are 512 30-day curves (starting from day 5) of flies who live at most 34 days, 266 of these are long-lived (reach the day 44). The classes in Growth and Tecator are well separated. In consequence, they are relatively easy problems. By contrast, Phoneme and Medflies are notoriously difficult classification tasks. Some trajectories of each problem and each class, together with the corresponding averages (thick lines), are plotted in Figure 4. To estimate the classification error, the datasets are partitioned at random into a training set (with 2/3 of the observations) and a test set (1/3). This procedure is repeated 200 times. The boxplots of the results for each dataset and method are shown in Figure 5. Errors are shown in first row and the number of selected variables/components in the second one. From 7 10 20 30 50 100 150 200 X(t) | Y = 0 Growth 10 20 30 50 100 150 200 X(t) | Y = 1 20 40 60 80 100 −4 −2 0 2 4 x 10−3 Tecator 20 40 60 80 100 −4 −2 0 2 4 x 10−3 10 20 30 40 50 10 15 20 25 Phoneme 10 20 30 40 50 10 15 20 25 5 10 15 20 25 30 0 50 100 150 Medflies 5 10 15 20 25 30 0 50 100 150 Figure 4: Trajectories for each of the classes and their corresponding averages (thick lines). PCA PLS MH RMH Base 0 0.05 0.1 0.15 0.2 0.25 0.3 Classification error Growth PCA PLS MH RMH 0 2 4 6 8 10 12 Number of variables PCA PLS MH RMH Base 0 0.02 0.04 0.06 0.08 Tecator PCA PLS MH RMH 0 5 10 15 PCA PLS MH RMH Base 0.16 0.18 0.2 0.22 0.24 Phoneme PCA PLS MH RMH 0 2 4 6 8 10 12 PCA PLS MH RMH Base 0.3 0.4 0.5 0.6 Medflies PCA PLS MH RMH 0 5 10 15 20 25 30 Figure 5: Classification error (first row) and number of variables/components selected (second row) by RMH. these results we observe that, in general, dimensionality reduction is effective: the accuracy of the four considered methods is similar or better than the Base method, in which complete trajectories are used for classification. In particular, Base does not perform well when the trajectories are not smooth (Medflies). The best overall performance corresponds to RMH. In the easy problems (Growth and Tecator), all methods behave similarly and give good results. In Growth, RMH is slightly more accurate. However, it tends to select more variables than the other methods. In the more difficult problems, (Phoneme and Medflies), RMH yields very accurate predictions while selecting only two variables. In these problems it exhibits the best performance, except in Phoneme, where Base is more accurate. The variables selected by RMH and MH are directly interpretable, which is an advantage over projection-based methods (PCA, PLS). Finally, let us point out that the accuracy of RMH is comparable and often better that state-of-the-art functional classification methods. See, for instance, Berrendero et al. (2016a); Delaigle et al. (2012); Delaigle and Hall (2012a); Mosler and Mozharovskyi (2014); Galeano et al. (2014). In most of these works no dimensionality reduction is applied. Nevertheless, these comparisons must be done carefully because the evaluation protocol and the classifiers used vary in the different studies. In any case, RMH is a filter method, which means that it could be more effective if used in combination with other types of classifiers or adapted and used as a wrapper or, even, as an embedded variable selection method. Acknowledgments The authors thank Dr. Jos´e R. Berrendero for his insightful suggestions. We also acknowledge financial support from the Spanish Ministry of Economy and Competitiveness, project TIN201342351-P and from the Regional Government of Madrid, CASI-CAM-CM project (S2013/ICE-2845). 8 References Aneiros, G. and P. Vieu (2014). Variable selection in infinite-dimensional problems. Statistics & Probability Letters 94, 12–20. Ba´ıllo, A., A. Cuevas, and R. Fraiman (2011). Classification methods for functional data, pp. 259–297. Oxford: Oxford University Press. Berrendero, J. R., A. Cuevas, and J. L. Torrecilla (2015). On near perfect classification and functional Fisher rules via reproducing kernels. arXiv:1507.04398, 1–27. Berrendero, J. R., A. Cuevas, and J. L. Torrecilla (2016a). The mRMR variable selection method: a comparative study for functional data. Journal of Statistical Computation and Simulation 86(5), 891–907. Berrendero, J. R., A. Cuevas, and J. L. Torrecilla (2016b). Variable selection in functional data classification: a maxima hunting proposal. Statistica Sinica 26(2), 619–638. Delaigle, A. and P. Hall (2012a). Achieving near perfect classification for functional data. Journal of the Royal Statistical Society B 74(2), 267–286. Delaigle, A. and P. Hall (2012b). Methodology and theory for partial least squares applied to functional data. The Annals of Statistics 40(1), 322–352. Delaigle, A., P. Hall, and N. Bathia (2012). Componentwise classification and clustering of functional data. Biometrika 99(2), 299–313. Ding, C. and H. Peng (2005). Minimum redundancy feature selection from microarray gene expression data. Journal of Bioinformatics and Computational Biology 3(2), 185–205. Fernandez-Lozano, C., J. A. Seoane, M. Gestal, T. R. Gaunt, J. Dorado, and C. Campbell (2015). Texture classification using feature selection and kernel-based techniques. Soft Computing 19(9), 2469–2480. Ferraty, F., P. Hall, and P. Vieu (2010). Most-predictive design points for functional data predictors. Biometrika 97(4), 807–824. Ferraty, F. and P. Vieu (2006). Nonparametric Functional Data Analysis: Theory and Practice. Springer. Fraiman, R., Y. Gim´enez, and M. Svarc (2016). Feature selection for functional data. Journal of Multivariate Analysis 146, 191–208. Galeano, P., E. Joseph, and R. E. Lillo (2014). The Mahalanobis distance for functional data with applications to classification. Technometrics 57(2), 281–291. G´omez-Verdejo, V., M. Verleysen, and J. Fleury (2009). Information-theoretic feature selection for functional data classification. Neurocomputing 72(16), 3580–3589. Grosenick, L., S. Greer, and B. Knutson (2008). Interpretable classifiers for FMRI improve prediction of purchases. Neural Systems and Rehabilitation Engineering, IEEE Transactions on 16(6), 539–548. Guyon, I., S. Gunn, M. Nikravesh, and L. A. Zadeh (2006). Feature Extraction: Foundations and Applications. Springer. Kneip, A. and P. Sarda (2011). Factor models and variable selection in high-dimensional regression analysis. The Annals of Statistics 39(5), 2410–2447. Li, B. and Q. Yu (2008). Classification of functional data: A segmentation approach. Computational Statistics & Data Analysis 52(10), 4790–4800. Lindquist, M. A. and I. W. McKeague (2009). Logistic regression with Brownian-like predictors. Journal of the American Statistical Association 104(488), 1575–1585. McKeague, I. W. and B. Sen (2010). Fractals with point impact in functional linear regression. Annals of Statistics 38(4), 2559. M¨orters, P. and Y. Peres (2010). Brownian Motion. Cambridge University Press. Mosler, K. and P. Mozharovskyi (2014). Fast DD-classification of functional data. Statistical Papers 55, 49–59. Preda, C., G. Saporta, and C. L´ev´eder (2007). PLS classification of functional data. Computational Statistics 22(2), 223–235. Ramsay, J. O. and B. W. Silverman (2005). Functional Data Analysis. Springer. Ryali, S., K. Supekar, D. A. Abrams, and V. Menon (2010). Sparse logistic regression for whole-brain classification of fMRI data. NeuroImage 51(2), 752–764. Sz´ekely, G. J. and M. L. Rizzo (2012). On the uniqueness of distance covariance. Statistics & Probability Letters 82(12), 2278–2282. Sz´ekely, G. J., M. L. Rizzo, and N. K. Bakirov (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics 35(6), 2769–2794. Tian, T. S. and G. M. James (2013). Interpretable dimension reduction for classifying functional data. Computational Statistics & Data Analysis 57(1), 282–296. Xiaobo, Z., Z. Jiewen, M. J. Povey, M. Holmes, and M. Hanpin (2010). Variables selection methods in near-infrared spectroscopy. Analytica Chimica Acta 667(1), 14–32. Yu, L. and H. Liu (2004). Efficient feature selection via analysis of relevance and redundancy. The Journal of Machine Learning Research 5, 1205–1224. Zhou, J., N.-Y. Wang, and N. Wang (2013). Functional linear model with zero-value coefficient function at sub-regions. Statistica Sinica 23(1), 25–50. 9
2016
94
6,557
CYCLADES: Conflict-free Asynchronous Machine Learning Xinghao Pan⇤, Maximilian Lam⇤, Stephen Tu⇤, Dimitris Papailiopoulos⇤, Ce Zhang†, Michael I. Jordan⇤‡, Kannan Ramchandran⇤, Chris Re†, Benjamin Recht⇤‡ Abstract We present CYCLADES, a general framework for parallelizing stochastic optimization algorithms in a shared memory setting. CYCLADES is asynchronous during model updates, and requires no memory locking mechanisms, similar to HOGWILD!-type algorithms. Unlike HOGWILD!, CYCLADES introduces no conflicts during parallel execution, and offers a black-box analysis for provable speedups across a large family of algorithms. Due to its inherent cache locality and conflictfree nature, our multi-core implementation of CYCLADES consistently outperforms HOGWILD!-type algorithms on sufficiently sparse datasets, leading to up to 40% speedup gains compared to HOGWILD!, and up to 5⇥gains over asynchronous implementations of variance reduction algorithms. 1 Introduction Following the seminal work of HOGWILD! [17], many studies have demonstrated that near linear speedups are achievable on several machine learning tasks via asynchronous, lock-free implementations [25, 13, 8, 16]. In all of these studies, classic algorithms are parallelized by simply running parallel and asynchronous model updates without locks. These lock-free, asynchronous algorithms exhibit speedups even when applied to large, non-convex problems, as demonstrated by deep learning systems such as Google’s Downpour SGD [6] and Microsoft’s Project Adam [4]. While these techniques have been remarkably successful, many of the above papers require delicate and tailored analyses to quantify the benefits of asynchrony for each particular learning task. Moreover, in non-convex settings, we currently have little quantitative insight into how much speedup is gained from asynchrony. In this work, we present CYCLADES, a general framework for lock-free, asynchronous machine learning algorithms that obviates the need for specialized analyses. CYCLADES runs asynchronously and maintains serial equivalence, i.e., it produces the same outcome as the serial algorithm. Since it returns the same output as a serial implementation, any algorithm parallelized by our framework inherits the correctness proof of the serial counterpart without modifications. Additionally, if a particular serially run heuristic is popular, but does not have a rigorous analysis, CYCLADES still guarantees that its execution will return a serially equivalent output. CYCLADES achieves serial equivalence by partitioning updates among cores, in a way that ensures that there are no conflicts across partitions. Such a partition can always be found efficiently by leveraging a powerful result on graph phase transitions [12]. When applied to our setting, this result guarantees that a sufficiently small sample of updates will have only a logarithmic number of conflicts. This allows us to evenly partition model updates across cores, with the guarantee that all conflicts are localized within each core. Given enough problem sparsity, CYCLADES guarantees a nearly linear ⇤Department of Electrical Engineering and Computer Science, UC Berkeley, Berkeley, CA. †Department of Computer Science, Stanford University, Palo Alto, CA. ‡Department of Statistics, UC Berkeley, Berkeley, CA. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. speedup, while inheriting all the qualitative properties of the serial counterpart of the algorithm, e.g., proofs for rates of convergence. Enforcing a serially equivalent execution in CYCLADES comes with additional practical benefits. Serial equivalence is helpful for hyperparameter tuning, or locating the best model produced by the asynchronous execution, since experiments are reproducible, and solutions are easily verifiable. Moreover, a CYCLADES program is easy to debug because bugs are repeatable and we can examine the step-wise execution to localize them. A significant benefit of the update partitioning in CYCLADES is that it induces considerable access locality compared to the more unstructured nature of the memory accesses during HOGWILD!. Cores will access the same data points and read/write the same subset of model variables. This has the additional benefit of reducing false sharing across cores. Because of these gains, CYCLADES can actually outperform HOGWILD! in practice on sufficiently sparse problems, despite appearing to require more computational overhead. Remarkably, because of the added locality, even a single threaded implementation of CYCLADES can actually be faster than serial SGD. In our SGD experiments for matrix completion and word embedding problems, CYCLADES can offer a speedup gain of up to 40% compared to that of HOGWILD!. Furthermore, for variance reduction techniques such as SAGA [7] and SVRG [11], CYCLADES yields better accuracy and more significant speedups, with up to 5⇥ performance gains over HOGWILD!-type implementations. 2 The Algorithmic Family of Stochastic-Updates We study parallel asynchronous iterative algorithms on the computational model used by [17]: several cores have access to the same shared memory, and each of them can read and update components of the shared memory. In this work, we consider a family of randomized algorithms that we refer to as Stochastic Updates (SU). The main algorithmic component of SU focuses on updating small subsets of a model variable x, according to prefixed access patterns, as sketched by Alg. 1. Algorithm 1 Stochastic Updates 1: Input: x; f1, . . . , fn; T 2: for t = 1 : T do 3: sample i ⇠D 4: xSi = ui(xSi, fi) 5: Output: x In Alg. 1, Si is a subset of the coordinates in x, each function fi operates on the subset Si of coordinates, and ui is a local update function that computes a vector with support on Si using as input xSi and fi. Moreover, T is the total number of iterations, and D is the distribution with support {1, . . . , n} from which we draw i. Several machine learning algorithms belong to the SU algorithmic family, such as stochastic gradient descent (SGD), with or without weight decay and regularization, variance-reduced learning algorithms like SAGA and SVRG, and even some combinatorial graph algorithms. In our supplemental material, we explain how these algorithms can be phrased in the SU language. ... ... u1 u2 un x1 x2 xd u1 u2 un sample conflict graph Figure 1: In the bipartite graph, an update ui is linked to variable xj when it needs to read/write it. From Gu we obtain the conflict graph Gc, whose max degree is ∆. If that is small, we expect that it is possible to parallelize updates without too many conflicts. CYCLADES exploits this intuition. The updates conflict graph A useful construct for our developments is the conflict graph between updates, which can be generated from the bipartite graph between the updates and the model variables. We define these graphs below, and provide an illustrative sketch in Fig. 1. Definition 1. Let Gu denote the bipartite update-variable graph between the n updates and the d model variables. An update ui is linked to a variable xj, if ui requires to read/write xj. Let Eu denote the number of edges in the bipartite graph, ∆L the max left degree of Gu, and ∆L the average left degree. Finally, we denote by Gc the conflict graph on the n updates. Two vertices in Gc are linked, if the corresponding updates share at least one variable in Gu. We also denote as ∆the max vertex degree of Gc. We stress that the conflict graph is never constructed, but is a useful for understanding CYCLADES. Our Main Result By exploiting the structure of the above graphs and through a light-weight sampling and allocation of updates, CYCLADES guarantees the following result for SU algorithms, which we establish in the following sections. Theorem 1 (informal). Let an SU algorithm A be defined through n update rules, where the conflict max degree between the n updates is ∆, and the sampling distribution D is uniform with (or without) replacement from {1, . . . , n}. Moreover, assume that we wish to run A for T = ⇥(n) iterations, and 2 that ∆L ∆L pn. Then on up to P = ˜O( n ∆·∆L ) cores, CYCLADES guarantees a e⌦(P) speedup over A, while outputting the same solution x as A would do after the same random set of T iterations.4 We now provide two examples of how these guarantees translate for specific problem cases. Example 1. In many applications we seek to minimize: minx 1 n Pn i=1 `i(aT i x) where ai represents the ith data point, x is the parameter vector, and `i is a loss. Several problems can be formulated in this way, such as logistic regression, least squares, binary classification, etc. If we tackle the above problem using SGD, or techniques like SVRG and SAGA, then (as we show in the supplemental) the update sparsity is determined by the gradient of a single sampled data point ai. Here, we will have ∆L = maxi ||ai||0, and ∆will be equal to the maximum number of data points ai that share at least one feature. As a toy example, let n d = ⇥(1) and let the non-zero support of ai be of size nδ and uniformly distributed. Then, one can show that with high probability ∆= eO(n1/2+δ) and hence CYCLADES achieves an e⌦(P) speedup on up to P = eO(n1/2−2δ) cores. Example 2. Consider the generic optimization minxi,yj,i2[n] Pm i=1 Pm j=1 φi,j(xi, yj), which captures several problems like matrix completion and factorization [17], word embeddings [2], graph k-way cuts [17], etc. Assume that we aim to minimize the above by sampling a single function φi,j and then updating xi and yj using SGD. Here, the number of update functions is proportional to n = m2, and each gradient update with respect to the sampled function φi,j(xi, yj) is only interacting with the variables xi and yj, i.e., only two variable vectors out of the 2m vectors (i.e., ∆L = 2). This also implies a conflict degree of at most ∆= 2m. Here, CYCLADES can provably guarantee an e⌦(P) speedup for up to P = O(m) cores. In our experiments we test CYCLADES on several problems including least squares, classification with logistic models, matrix factorization, and word embeddings, and several algorithms including SGD, SVRG, and SAGA. We show that in most cases it can significantly outperform the HOGWILD! implementation of these algorithms, if the data is sparse. Remark 1. We would like to note that there are several cases where there might be a few outlier updates with extremely high conflict degree. In the supplemental material, we prove that if there are no more than O(nδ) vertices of high conflict degree ∆o, and the rest of the vertices have max degree at most ∆, then the result of Theorem 1 still holds in expectation. In the following section, we establish the theory of CYCLADES and provide the details behind our parallelization framework. 3 CYCLADES: Shattering Dependencies CYCLADES consists of three computational components as shown in Fig. 2. Allocation Sample Batch + Connected Components Core1 Core 2 Core p Asynchronous and Lock-free Stochastic Updates Core1 Core 2 Core p SU SU SU Batch Synchronization sample C.C. conflict-graph Figure 2: CYCLADES samples updates, finds conflict-groups, and allocates them across cores. Each core asynchronously updates the model, without access conflicts. This is possible by processing the conflicting updates within the same core. It starts by sampling (according to a distribution D) a number of B updates from the graph shown in Fig. 1, and assigns a label to each of them (a processing order). After sampling, it computes the connected components of the sampled subgraph induced by the B sampled updates, to determine the conflict groups. Once the conflicts groups are formed, it allocates them across P cores. Finally, each core processes locally the conflict groups of updates that it has been assigned, following the order that each update has been labeled with. The above process is then repeated, for as many iterations as needed. The key component of CYCLADES is to carry out the sampling in such a way that we have as many connected components as possible, and all of them of small size, provably. In the next subsections, we explain how each part is carried out, and provide theoretical guarantees for each of them individually, which we combine at the end of this section for our main theorem. 4e⌦(·) and eO(·) hide polylog factors. 3 A key technical aspect that we exploit in CYCLADES is that appropriate sampling and allocation of updates can lead to near optimal parallelization of SU algorithms. To do that we expand upon the following result established in [12]. Theorem 2. Let G be a graph on n vertices, with max degree ∆. Let us sample each vertex independently with probability p = 1−✏ ∆and define as G0 the induced subgraph on the sampled vertices. Then, the largest connected component of G0 has size at most 4 ✏2 log n, with high probability. The above result pays homage to the giant component phase transition phenomena in random Erdos-Renyi graphs. What is surprising is that similar phase transitions apply to any given graph! In practice, for most SU algorithms of interest, the sampling distribution of updates is either with or without replacement from the n updates. As it turns out, morphing Theorem 2 into a with-/withoutreplacement result is not straightforward. We defer the analysis needed to the supplemental material, and present our main theorem about graph sampling here. Theorem 3. Let G be a graph on n vertices, with max degree ∆. Let us sample B = (1−✏)n ∆ vertices with or without replacement, and define as G0 the induced subgraph on the sampled vertices. Then, the largest connected component of G0 has size at most O( log n ✏2 ), with high probability. The key idea from the above is that if one samples no more than B = (1−✏) n ∆updates, then there will be at least O (✏2B/log n) conflict groups to allocate across cores, each of size at most O # log n/✏2$ . Since there are no conflicts between different conflict-groups, the processing of updates per any single group will never interact with the variables corresponding to the updates of another conflict group. The next step of CYCLADES is to form and allocate the connected components (CCs) across cores, efficiently. We address this in the following subsection. In the following, for brevity we focus on the with-replacement sampling case, but the results can be extended to the without-replacement case. Identifying groups of conflict In CYCLADES, we sample batches of updates of size B multiple times, and for each batch we need to identify the conflict groups across the updates. Let us refer to Gi u as the subgraph induced by the ith sampled batch of updates on the update-variable graph Gu. In the following we always assume that we sample nb = c · ∆/(1 −✏) batches, where c ≥1 is a constant. This number of batches results in a constant number of passes over the dataset. Then, identifying the conflict groups in Gi u can be done with a connected components (CC) algorithm. The main question we need to address is what is the best way to parallelize this graph partitioning part. In the supplemental, we provide the details of this part, and prove the following result: Lemma 1. Let the number of cores be P = O( n ∆∆L ) and let ∆L ∆L pn. Then, the overall computation of CCs for nb = c · ∆ 1−✏batches, each of size B = (1 −✏) n ∆, costs no more than O(Eu/P log2 n). Allocating updates to cores Once we compute the CCs (i.e., the conflicts groups of the sampled updates), we have to allocate them across cores. Once a core has been assigned with CCs, it will process the updates included in these CCs, according to the order that each update has been labeled with. Due to Theorem 3, each connected component will contain at most O( log n ✏2 ) updates. Assuming that the cost of the j-th update in the batch is wj, the cost of a single connected component C will be wC = P j2C wj. To proceed with characterizing the maximum load among the P cores, we assume that the cost of a single update ui, for i 2 {1, . . . , n}, is proportional to the out-degree of that update —according to the update-variable graph Gu— times a constant cost which we shall refer to as . Hence, wj = O(dL,j · ), where dL,j is the degree of the j-th left vertex of Gu. In the supplemental material, we establish that a near-uniform allocation of CCs according to their weights leads to the following guarantee. Lemma 2. Let the number of cores by bounded as P = O( n ∆∆L ), and let ∆L ∆L pn. Then, computing the stochastic updates across all nb = c · ∆ 1−✏batches can be performed in time O( E log2 n P · ), with high probability, where is the per edge cost for computing one of the n updates defined on Gu. Stitching the pieces together Now that we have described the sampling, conflict computation, and allocation strategies, we are ready to put all the pieces together and detail CYCLADES in full. Let us assume that we sample a total number of nb = c · ∆ 1−✏batches of size B = (1 −✏) n ∆, and that each update is sampled uniformly at random. For the i-th batch let us denote as Ci 1, . . . Ci mi the connected 4 components on the induced subgraph Gi u. Due to Theorem 3, each connected component C contains a number of at most O( log n ✏2 ) updates; each update carries an ID (the order of which it would have been sampled by the serial algorithm). Using the above notation, we give the pseudocode for CYCLADES in Alg. 2. Note that the inner loop that is parallelized (i.e., the SU processing loop in lines 6 – 9), can be performed asynchronously; cores do not have to synchronize, and do not need to lock any memory variables, as they are all accessing non-overlapping subset of x. This also provides for better cache coherence. Moreover, each core potentially accesses the same coordinates several times, leading to good cache locality. These improved cache locality and coherence properties experimentally lead to substantial performance gains as we see in the next section. We can now combine the results of the previous subsection to obtain our main theorem for CYCLADES. Theorem 4. Let us assume any given update-variable graph Gu with ∆L and ∆L, such that ∆L ∆L pn, and with induced max conflict degree ∆. Then, CYCLADES on P = O( n ∆·∆L ) cores, with batch sizes B = (1 −✏) n ∆can execute T = c · n updates, for any constant c ≥1, selected uniformly at random with replacement, in time O # Eu· P · log2 n $ , with high probability. Algorithm 2 CYCLADES 1: Input: Gu, nb. 2: Sample nb subgraphs G1 u, . . . , Gnb u from Gu 3: Compute in parallel CCs for sampled graphs 4: for batch i = 1 : nb do 5: Allocation of Ci 1, . . . Ci mi to P cores 6: for each core in parallel do 7: for each allocated component C do 8: for each ordered update j from C do 9: xSj = uj(xSj, fj) 10: Output: x Observe that CYCLADES bypasses the need to establish convergence guarantees for the parallel algorithm. Hence, it could be the case for an applications of interest that we cannot analyze how a serial SU algorithm performs in terms of say the accuracy of the solution, but CYCLADES can still provide black box guarantees for speedup, since our analysis is completely oblivious to the qualitative performance of the serial algorithm. This is in contrast to recent studies similar to [5], where the authors provide speedup guarantees via a convergence-to-optimal proof for an asynchronous SGD on a nonconvex problem. Unfortunately these proofs can become complicated on a wider range of nonconvex objectives. In the following section we show that CYCLADES is not only useful theoretically, but can consistently outperform HOGWILD! on sufficiently sparse datasets. 4 Evaluation We implemented CYCLADES5 in C++ and tested it on a variety of problems, and a number of stochastic updates algorithms, and compared against their HOGWILD! (i.e., asynchronous, lock-free) implementations. Since CYCLADES is intended to be a general SU parallelization framework, we do not compare against algorithms tailored to specific applications, nor do we expect CYCLADES to outperform every such highly-tuned, well-designed, specific algorithms. Our experiments were conducted on a machine with 72 CPUs (Intel(R) Xeon(R) CPU E7-8870 v3, 2.10 GHz) on 4 NUMA nodes, each with 18 CPUs, and 1TB of memory. We ran CYCLADES and HOGWILD! with 1, 4, 8, 16 and 18 threads pinned to CPUs on a single NUMA node (i.e., the maximum physical number of cores per single node), to can avoid well-known cache coherence and scaling issues across nodes [24]. Dataset # datapoints # features av. sparsity / datapoint Comments NH2010 48,838 48,838 4.8026 Topological graph DBLP 5,425,964 5,425,964 3.1880 Authorship network MovieLens ⇠10M 82,250 200 10M movie ratings EN-Wiki 20,207,156 213,272 200 Subset of english Wikipedia dump. Table 1: Details of datasets used in our experiments. In our experiments, we measure overall running times which include the overheads for computing connected components and allocating work in CYCLADES. We also compute the objective value at the end of each epoch (i.e., one full pass over the data). We measure the speedups for each algorithm as time of the parallel algorithm to reach ✏objective time of the serial algorithm to reach ✏objective where ✏was chosen to be the smallest objective value that is achievable by all parallel algorithms on every choice of number of threads. The serial algorithm used for comparison is HOGWILD! running serially on one thread. In Table 1 we list some details of the datasets that we use in our experiments. We tune our constant stepsizes so to maximize convergence 5Code is available at https://github.com/amplab/cyclades. 5 without diverging, and use one random data reshuffling across all epochs. Batch sizes are picked to optimize performance for CYCLADES. (a) Least Sq., DBLP, SAGA (b) Graph Eig., nh2010, SVRG (c) Mat. Comp., 10M, `2SGD (d) Word2Vec, EN-Wiki, SGD Figure 3: Convergence of CYCLADES and HOGWILD! in terms of overall running time with 1, 8, 16, 18 threads. CYCLADES is initially slower, but ultimately reaches convergence faster than HOGWILD!. (a) Least Sq., DBLP, SAGA (b) Graph Eig., nh2010, SVRG (c) Mat. Comp., 10M, `2SGD (d) Word2Vec, EN-Wiki, SGD Figure 4: Speedup of CYCLADES and HOGWILD! versus number of threads. On multiple threads, CYCLADES always reaches ✏objective faster than HOGWILD!. In some cases CYCLADES is faster than HOGWILD! even on 1 thread, due to better cache locality. In Figs. 4(a) and 4(b), CYCLADES exhibits significant gains since HOGWILD! suffers from asynchrony noise, and we had to use comparatively smaller stepsizes to prevent it from diverging. Figure 5: Convergence of CYCLADES and HOGWILD! on least squares using SAGA, with 16 threads, on DBLP dataset. HOGWILD! diverges with γ > 10−5; thus, we were only able to use a smaller step size γ = 10−5 for HOGWILD! on multiple threads. For HOGWILD! on 1 thread (and CYCLADES on any number of threads), we could use a larger stepsize of γ = 3 ⇥10−4. Least squares via SAGA The first problem we consider is least squares: minx minx 1 n Pn i=1(aT i x −bi)2 which we will solve using the SAGA algorithm [7], an incrimental gradient algorithm with faster than SGD rates on convex, or strongly convex functions. In SAGA, we initialize gi = rfi(x0) and iterate the following two steps xk+1 = xk −γ · (rfsk(xk) −gsk + 1 n Pn i=1 gi) and gsk = rfsk(xk), where fi(x) = (aT i x −bi)2. In the above iteration it is useful to observe that the updates can be performed in a sparse and “lazy” way, as we explain in detail in our supplemental material. The stepsizes chosen for each of CYCLADES and HOGWILD! were largest such that the algorithms did not diverge. We used the DBLP and NH2010 datasets for this experiment, and set A as the adjacency matrix of each graph. For NH2010, the values of b were set to population living in the Census Block. For DBLP we used synthetic values: we set b = A˜x + 0.1˜z, where ˜x and ˜z were generated randomly. The SAGA algorithm was run for 500 epochs for each dataset. When running SAGA for least squares, we found that HOGWILD! was divergent with the large stepsizes that we were using for CYCLADES (Fig. 5). Thus, in the multi-thread setting, we were only able to use smaller stepsizes for HOGWILD!, which resulted in slower convergence than CYCLADES, as seen in Fig. 3(a). The effects of a smaller stepsize for HOGWILD! are also manifested in terms of speedups in Fig. 4(a), since HOGWILD! takes a longer time to converge to an ✏objective value. Graph eigenvector via SVRG Given an adjacency matrix A, the top eigenvector of AT A is useful in several applications such as spectral clustering, principle component analysis, and others. In a 6 recent work, [10] proposes an algorithm for computing the top eigenvector of AT A by running intermediate SVRG steps to approximate the shift-and-invert iteration. Specifically, at each step SVRG is used to solve: min Pn i=1 # 1 2xT # λ nI −aiaT i $ x −1 nbT x $ , where ai is the i-th column of A. According to [10], if we initialize y = x0 and assume kaik = 1, we have to iterate the following updates xk+1 = xk −γ · n · (rfsk(xk) −rfsk(y)) + γ · rf(y) where after every T iterations we update y = xk, and the stochastic gradients are of the form rfi(x) = # λ nI −aiaT i $ x −1 nb. We apply CYCLADES to the above SVRG iteration (see supplemental) for parallelizing this problem. We run experiments on two graphs: DBLP and and NH2010. We ran SVRG for 50 and 100 epochs for NH2010 and DBLP respectively. The convergence of SVRG for graph eigenvectors is shown in Fig. 3(b). CYCLADES starts off slower than HOGWILD!, but always produces results equivalent to the convergence on a single thread. HOGWILD! does not exhibit the same behavior on multiple threads as it does serially; due to asynchrony causes HOGWILD! to converge slower on multiple threads. This effect is clearly seen on Figs. 4(b), where HOGWILD! fails to converge faster than the serial counterpart, and CYCLADES attains a significantly better speedup on 16 threads. Matrix completion and word embeddings via SGD In matrix completion we are given a partially observed matrix M, and wish to factorize it as M ⇡UV where U and V are low rank matrices with dimensions n⇥r and r ⇥m respectively. This may be achieved by optimizing min P (i,j)2⌦(Mi,j − Ui,·V·,j)2 + λ 2 (kUk2 F + kVk2 F ) where ⌦is the set of observed entries, which can be approximated by SGD on the observed samples. The regularized objective can be optimized by weighted SGD. In our experiments, we chose a rank of r = 100, and ran SGD and weighted SGD for 200 epochs. We used the MovieLens 10M dataset containing 10M ratings for 10K movies by 72K users. Our second task that uses SGD is word embeddings, which aim to represent the meaning of a word w via a vector vw 2 Rd. A recent work by [2] proposes to solve: min{vw},C P w,w0 Aw,w0(log(Aw,w0) −kvw + vw0k2 2 −C)2, where Aw,w0 is the number of times words w and w0 co-occur within ⌧words in the corpus. In our experiments we set ⌧= 10 following the suggested recipe of the aforementioned paper. We can approximate the solution to the above problem, by obtaining one using SGD: we can repeatedly sample entries Aw,w0 from A and update the corresponding vectors vw, vw0. Then, at the end of each full pass over the data, we update the constant C by its locally optimal value, which can be calculated in closed form. In our experiments, we optimized for a word embedding of dimension d = 100, and tested on a 80MB subset of the English Wikipedia dump. For our experiments, we run SGD for 200 epochs. Figs. 3(c) and 3(d) show the convergence for the matrix completion and word embeddings problems. CYCLADES is initially slower than HOGWILD! due to the overhead of computing connected components. However, due to better cache locality and convergence properties, CYCLADES is able to reach a lower objective value in less time than HOGWILD!. In fact, we observe that CYCLADES is faster than HOGWILD! when both are run serially, demonstrating that the gains from (temporal) cache locality outweigh the coordination overhead of CYCLADES. These results are reflected in the speedups of CYCLADES and HOGWILD! (Figs. 4(c) and 4(d)). CYCLADES consistently achieves a better speedup (up to 11⇥on 18 threads) compared to that of HOGWILD! (up to 9⇥on 18 threads). Partitioning and allocation costs5 The cost of partitioning and allocation5 for CYCLADES is given in Table 2, relatively to the time that HOGWILD! takes to complete a single pass over the dataset. For matrix completion and the graph eigenvector problem, on 18 threads, CYCLADES takes the equivalent of 4-6 epochs of HOGWILD! to complete its partitioning, as the problem is either very sparse or the updates are expensive. For solving least squares using SAGA and word embeddings using SGD, the cost of partitioning is equivalent to 11-14 epochs of HOGWILD! on 18 threads. However, we point out that partitioning and allocation5 is a one-time cost which becomes cheaper with more stochastic update epochs. Additionally, note that this cost can become amortized due to the extra experiments one has to run for hyperparameter tuning, since the graph partitioning is identical across different stepsizes one might want to test. Binary classification and dense coordinates Here we explore settings where CYCLADES is expected to perform poorly due to the inherent density of updates (i.e., for data sets with dense features). In particular, we test CYCLADES on a classification problem for text based data. Specifically, we run classification for the URL dataset [15] contains ⇠2.4M URLs, labeled as either benign or malicious, 5It has come to our attention post submission that parts of our partitioning and allocation code could be further parallelized. We refer the reader to our arXiv paper 1605.09721 for the latest results. 7 # Least Squares Graph Eig. Mat. Comp. Word2Vec threads SAGA, DBLP SVRG, NH2010 `2-SGD, MovieLens SGD, EN-Wiki 1 2.2245 0.9039 0.5507 0.5299 18 14.1792 4.7639 5.5270 3.9362 Table 2: Ratio of the time that CYCLADES consumes for partition and allocation over the time that HOGWILD! takes for 1 full pass over the dataset. On 18 threads, CYCLADES takes between 4-14 HOGWILD! epochs to perform partitioning. Note however, this computational effort is only required once per dataset. and 3.2M features, including bag-of-words representation of tokens in the URL. For this classification task, we used a logistic regression model, trained using SGD. By its power-law nature, the dataset consists of a small number of extremely dense features which occur in nearly all updates. Since CYCLADES explicitly avoids conflicts, it has a schedule of SGD updates that leads to poor speedups. Figure 6: Speedups of CYCLADES and HOGWILD! on 16 threads, for different percentage of dense features filtered. When only a very small number of features are filtered, CYCLADES is almost serial. However, as we increase the percentage from 0.016% to 0.048%, the speedup of CYCLADES improves and almost catches up with HOGWILD!. However, we observe that most conflicts are caused by a small percentage of the densest features. If these features are removed from the dataset, CYCLADES is able to obtain much better speedups. The speedups that are obtained by CYCLADES and HOGWILD! on 16 threads for different filtering percentages are shown in Figure 6. Full results of the experiment are presented in the supplemental material. CYCLADES fails to get much speedup when nearly all the features are used. However, as more dense features are removed, CYCLADES obtains a better speedup, almost equalling HOGWILD!’s speedup when 0.048% of the densest features are filtered. 5 Related work The end of Moore’s Law coupled with recent advances in parallel and distributed computing technologies have triggered renewed interest in parallel stochastic optimization [26, 9, 1, 22]. Much of this contemporary work is built upon the foundational work of Bertsekas, Tsitsiklis et al. [3, 23]. Inspired by HOGWILD!’s success at achieving nearly linear speedups for a variety of machine learning tasks, several authors developed other lock-free and asynchronous optimization algorithms, such as parallel stochastic coordinate descent [13]. Additional work in first order optimization and beyond [8, 21, 5], has further demonstrated that linear speedups are generically possible in the asynchronous shared-memory setting. Other machine learning algorithms that have been parallelized using concurrency control, including non-parametric clustering [18], submodular maximization [19], and correlation clustering [20]. Sparse, graph-based parallel computation are supported by systems like GraphLab [14]. These frameworks require computation to be written in a specific programming model with associative, commutative operations. GraphLab and PowerGraph support serializable execution via locking mechanisms, this is in contrast to our partition-and-allocate coordination which allows us to provide guarantees on speedup. 6 Conclusion We presented CYCLADES, a general framework for lock-free parallelization of stochastic optimization algorithms, while maintaining serial equivalence. Our framework can be used to parallelize a large family of stochastic updates algorithms in a conflict-free manner, thereby ensuring that the parallelized algorithm produces the same result as its serial counterpart. Theoretical properties, such as convergence rates, are therefore preserved by the CYCLADES-parallelized algorithm, and we provide a single unified theoretical analysis that guarantees near linear speedups. By eliminating conflicts across processors within each batch of updates, CYCLADES is able to avoid all asynchrony errors and conflicts, and leads to better cache locality and cache coherence than HOGWILD!. These features of CYCLADES translate to near linear speedups in practice, where it can outperform HOGWILD!-type of implementations by up to a factor of 5⇥, in terms of speedups. In the future, we intend to explore hybrids of CYCLADES with HOGWILD!, pushing the boundaries of what is possible in a shared-memory setting. We are also considering solutions for scaling out in a distributed setting, where the cost of communication is significantly higher. 8 References [1] A. Agarwal and J. C. Duchi. Distributed delayed stochastic optimization. In NIPS, pages 873–881, 2011. [2] S. Arora, Y. Li, Y. Liang, T. Ma, and A. Risteski. Rand-walk: A latent variable model approach to word embeddings. arXiv:1502.03520, 2015. [3] D. P. Bertsekas and J. N. Tsitsiklis. Parallel and distributed computation: numerical methods, volume 23. Prentice hall Englewood Cliffs, NJ, 1989. [4] T. Chilimbi, Y. Suzue, J. Apacible, and K. Kalyanaraman. Project adam: Building an efficient and scalable deep learning training system. In USENIX OSDI, 2014. [5] C. De Sa, C. Zhang, K. Olukotun, and C. Ré. Taming the wild: A unified analysis of hogwild!-style algorithms. arXiv:1506.06438, 2015. [6] J. Dean, G. Corrado, R. Monga, K. Chen, M. Devin, M. Mao, A. Senior, P. Tucker, K. Yang, Q. V. Le, et al. Large scale distributed deep networks. In NIPS 2012. [7] A. Defazio, F. Bach, and S. Lacoste-Julien. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. In NIPS, pages 1646–1654, 2014. [8] J. Duchi, M. I. Jordan, and B. McMahan. Estimation, optimization, and parallelism when data is sparse. In NIPS, pages 2832–2840, 2013. [9] R. Gemulla, E. Nijkamp, P. J. Haas, and Y. Sismanis. Large-scale matrix factorization with distributed stochastic gradient descent. In Proceedings of the 17th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 69–77. ACM, 2011. [10] C. Jin, S. M. Kakade, C. Musco, P. Netrapalli, and A. Sidford. Robust shift-and-invert preconditioning: Faster and more sample efficient algorithms for eigenvector computation. arXiv:1510.08896, 2015. [11] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In NIPS, pages 315–323, 2013. [12] M. Krivelevich. The phase transition in site percolation on pseudo-random graphs. The Electronic Journal of Combinatorics, 23(1):1–12, 2016. [13] J. Liu and S. J. Wright. Asynchronous stochastic coordinate descent: Parallelism and convergence properties. SIAM Journal on Optimization, 25(1):351–376, 2015. [14] Y. Low, J. E. Gonzalez, A. Kyrola, D. Bickson, C. E. Guestrin, and J. Hellerstein. Graphlab: A new framework for parallel machine learning. arXiv:1408.2041, 2014. [15] J. Ma, L. K. Saul, S. Savage, and G. M. Voelker. Identifying suspicious urls: an application of large-scale online learning. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 681–688. ACM, 2009. [16] H. Mania, X. Pan, D. Papailiopoulos, B. Recht, K. Ramchandran, and M. I. Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. arXiv:1507.06970, 2015. [17] F. Niu, B. Recht, C. Re, and S. Wright. Hogwild: A lock-free approach to parallelizing stochastic gradient descent. In NIPS, pages 693–701, 2011. [18] X. Pan, J. E. Gonzalez, S. Jegelka, T. Broderick, and M. I. Jordan. Optimistic concurrency control for distributed unsupervised learning. In NIPS 26. 2013. [19] X. Pan, S. Jegelka, J. E. Gonzalez, J. K. Bradley, and M. I. Jordan. Parallel double greedy submodular maximization. In NIPS 27. 2014. [20] X. Pan, D. Papailiopoulos, S. Oymak, B. Recht, K. Ramchandran, and M. I. Jordan. Parallel correlation clustering on big graphs. In NIPS, pages 82–90, 2015. [21] S. J. Reddi, A. Hefny, S. Sra, B. Póczos, and A. Smola. On variance reduction in stochastic gradient descent and its asynchronous variants. arXiv:1506.06840, 2015. [22] P. Richtárik and M. Takáˇc. Parallel coordinate descent methods for big data optimization. arXiv:1212.0873, 2012. [23] J. N. Tsitsiklis, D. P. Bertsekas, and M. Athans. Distributed asynchronous deterministic and stochastic gradient optimization algorithms. IEEE transactions on automatic control, 31(9):803–812, 1986. [24] C. Zhang and C. Ré. Dimmwitted: A study of main-memory statistical analytics. Proceedings of the VLDB Endowment, 7(12):1283–1294, 2014. [25] Y. Zhuang, W.-S. Chin, Y.-C. Juan, and C.-J. Lin. A fast parallel sgd for matrix factorization in shared memory systems. In Proceedings of the 7th ACM conference on Recommender systems, pages 249–256. ACM, 2013. [26] M. Zinkevich, J. Langford, and A. J. Smola. Slow learners are fast. In NIPS, pages 2331–2339, 2009. 9
2016
95
6,558
Proximal Stochastic Methods for Nonsmooth Nonconvex Finite-Sum Optimization Sashank J. Reddi Carnegie Mellon University sjakkamr@cs.cmu.edu Suvrit Sra Massachusetts Institute of Technology suvrit@mit.edu Barnabás Póczos Carnegie Mellon University bapoczos@cs.cmu.edu Alexander J. Smola Carnegie Mellon University alex@smola.org Abstract We analyze stochastic algorithms for optimizing nonconvex, nonsmooth finite-sum problems, where the nonsmooth part is convex. Surprisingly, unlike the smooth case, our knowledge of this fundamental problem is very limited. For example, it is not known whether the proximal stochastic gradient method with constant minibatch converges to a stationary point. To tackle this issue, we develop fast stochastic algorithms that provably converge to a stationary point for constant minibatches. Furthermore, using a variant of these algorithms, we obtain provably faster convergence than batch proximal gradient descent. Our results are based on the recent variance reduction techniques for convex optimization but with a novel analysis for handling nonconvex and nonsmooth functions. We also prove global linear convergence rate for an interesting subclass of nonsmooth nonconvex functions, which subsumes several recent works. 1 Introduction We study nonconvex, nonsmooth, finite-sum optimization problems of the form min x2Rd F(x) := f(x) + h(x), where f(x) := 1 n n X i=1 fi(x), (1) and each fi : Rd ! R is smooth (possibly nonconvex) for all i 2 {1, . . . , n} , [n], while h : Rd ! R is nonsmooth but convex and relatively simple. Such finite-sum optimization problems are fundamental to machine learning when performing regularized empirical risk minimization. While there has been extensive research in solving nonsmooth convex finite-sum problems (i.e., each fi is convex for i 2 [n]) [4, 16, 31], our understanding of their nonsmooth nonconvex counterparts is surprisingly limited. We hope to amend this situation (at least partially), given the widespread importance of nonconvexity throughout machine learning. A popular approach to handle nonsmoothness in convex problems is via proximal operators [14, 25], but as we will soon see, this approach does not work so easily for the nonconvex problem (1). Nevertheless, recall that proper closed convex function h, the proximal operator is defined as prox⌘h(x) := argmin y2Rd ⇣ h(y) + 1 2⌘ky −xk2⌘ , for ⌘> 0. (2) The power of proximal operators lies in how they generalize projections: e.g., if h is the indicator function IC(x) of a closed convex set C, then proxIC(x) ⌘projC(x) ⌘argminy2C ky −xk. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. Throughout this paper, we assume that the proximal operator of h is easy to compute. This is true for many applications in machine learning and statistics including `1 regularization, box-constraints, simplex constraints, among others [2, 18]. Similar to other algorithms, we also assume access to a proximal oracle (PO) that takes a point x 2 Rd and returns the output of (2). In addition to the number of PO calls, to describe our complexity results we use the incremental first-order oracle (IFO) model.1 For a function f = 1 n P i fi, an IFO takes an index i 2 [n] and a point x 2 Rd, and returns the pair (fi(x), rfi(x)). A standard (batch) method for solving (1) is the proximal-gradient method (PROXGD) [13], first studied for (batch) nonconvex problems in [5]. This method performs the following iteration: xt+1 = prox⌘h(xt −⌘rf(xt)), t = 0, 1, . . . , (3) where ⌘> 0 is a step size. The following convergence rate for PROXGD was proved recently. Theorem (Informal). [7]: The number of IFO and PO calls made by the proximal gradient method (3) to reach ✏close to a stationary point is O(n/✏) and O(1/✏), respectively. We refer the reader to [7] for details. The key point to note here is that the IFO complexity of (3) is O(n/✏). This is due to the fact that a full gradient rf needs to be computed at each iteration (3), which requires n IFO calls. When n is large, this high cost per iteration is prohibitive. A more practical approach is offered by proximal stochastic gradient (PROXSGD), which performs the iteration xt+1 = prox⌘th ✓ xt −⌘t |It| X i2It rfi(xt) ◆ , t = 0, 1, . . . , (4) where It (referred to as minibatch) is a randomly chosen set (with replacement) from [n] and ⌘t is a step size. Non-asymptotic convergence of PROXSGD was also shown recently, as noted below. Theorem (Informal). [7]: The number of IFO and PO calls made by PROXSGD, i.e., iteration (4), to reach ✏close to a stationary point is O(1/✏2) and O(1/✏) respectively. For achieving this convergence, we impose batch sizes |It| that increase and step sizes ⌘t that decrease with 1/✏. Notice that the PO complexity of PROXSGD is similar to PROXGD, but its IFO complexity is independent of n; though, this benefit comes at the cost of an extra 1/✏factor. Furthermore, the step size must decrease with 1/✏(or alternatively decay with the number of iterations of the algorithm). The same two aspects are also seen for convex stochastic gradient, in both the smooth and proximal versions. However, in the nonconvex setting there is a key third and more important aspect: the minibatch size |It| increases with 1/✏. To understand this aspect, consider the case where |It| is a constant (independent of both n and ✏), typically the choice used in practice. In this case, the above convergence result no longer holds and it is not clear if PROXSGD even converges to a stationary point at all! To clarify, a decreasing step size ⌘t trivially ensures convergence as t ! 1, but the limiting point is not necessarily stationary. On the other hand, increasing |It| with 1/✏can easily lead to |It| ≥n for reasonably small ✏, which effectively reduces the algorithm to (batch) PROXGD. This dismal news does not apply to the convex setting, where PROXSGD is known to converge (in expectation) to an optimal solution using constant minibatch sizes |It|. Furthermore, this problem does not afflict smooth nonconvex problems (h ⌘0), where convergence with constant minibatches is known [6, 21, 22]. Thus, there is a fundamental gap in our understanding of stochastic methods for nonsmooth nonconvex problems. Given the ubiquity of nonconvex models in machine learning, bridging this gap is important. We do so by analyzing stochastic proximal methods with guaranteed convergence for constant minibatches, and faster convergence with minibatches independent of 1/✏. Main Contributions We state our main contributions below and list the key complexity results in Table 1. • We analyze nonconvex proximal versions of the recently proposed stochastic algorithms SVRG and SAGA [4, 8, 31], hereafter referred to as PROXSVRG and PROXSAGA, respectively. We show convergence of these algorithms with constant minibatches. To the best of our knowledge, this is the first work to present non-asymptotic convergence rates for stochastic methods that apply to nonsmooth nonconvex problems with constant (hence more realistic) minibatches. 1Introduced in [1] to study lower bounds of deterministic algorithms for convex finite-sum problems. 2 • We show that by carefully choosing the minibatch size (to be sublinearly dependent on n but still independent of 1/✏), we can achieve provably faster convergence than both proximal gradient and proximal stochastic gradient. We are not aware of any earlier results on stochastic methods for the general nonsmooth nonconvex problem that have faster convergence than proximal gradient. • We study a nonconvex subclass of (1) based on the proximal extension of Polyak-Łojasiewicz inequality [9]. We show linear convergence of PROXSVRG and PROXSAGA to the optimal solution for this subclass. This includes the recent results proved in [27, 32] as special cases. Ours is the first stochastic method with provable global linear convergence for this subclass of problems. 1.1 Related Work The literature on finite-sum problems is vast; so we summarize only a few closely related works. Convex instances of (1) have been long studied [3, 15] and are fairly well-understood. Remarkable recent progress for smooth convex instances of (1) is the creation of variance reduced (VR) stochastic methods [4, 8, 26, 28]. Nonsmooth proximal VR stochastic algorithms are studied in [4, 31] where faster convergence rates for both strongly convex and non-strongly convex cases are proved. Asynchronous VR frameworks are developed in [20]; lower-bounds are studied in [1, 10]. In contrast, nonconvex instances of (1) are much less understood. Stochastic gradient for smooth nonconvex problems is analyzed in [6], and only very recently, convergence results for VR stochastic methods for smooth nonconvex problems were obtained in [21, 22]. In [11], the authors consider a VR nonconvex setting different from ours, namely, where the loss is (essentially strongly) convex but hard thresholding is used. We build upon [21, 22], and focus on handling nonsmooth convex regularizers (h 6⌘0 in (1)).2 Incremental proximal gradient methods for this class were also considered in [30] but only asymptotic convergence was shown. The first analysis of a projection version of nonconvex SVRG is due to [29], who considers the special problem of PCA. Perhaps, the closest to our work is [7], where convergence of minibatch nonconvex PROXSGD method is studied. However, typical to the stochastic gradient method, the convergence is slow; moreover, no convergence for constant minibatches is provided. 2 Preliminaries We assume that the function h(x) in (1) is lower semi-continuous (lsc) and convex. Furthermore, we also assume that its domain dom(h) = {x 2 Rd|h(x) < +1} is closed. We say f is L-smooth if there is a constant L such that krf(x) −rf(y)k Lkx −yk, 8 x, y 2 Rd. Throughout, we assume that the functions fi in (1) are L-smooth, so that krfi(x) −rfi(y)k  Lkx −yk for all i 2 [n]. Such an assumption is typical in the analysis of first-order methods. One crucial aspect of the analysis for nonsmooth nonconvex problems is the convergence criterion. For convex problems, typically the optimality gap F(x) −F(x⇤) is used as a criterion. It is unreasonable to use such a criterion for general nonconvex problems due to their intractability. For smooth nonconvex problems (i.e., h ⌘0), it is typical to measure stationarity, e.g., using krFk. This cannot be used for nonsmooth problems, but a fitting alternative is the gradient mapping3 [17]: G⌘(x) := 1 ⌘[x −prox⌘h(x −⌘rf(x))]. (5) When h ⌘0 this mapping reduces to G⌘(x) = rf(x) = rF(x), the gradient of function F at x. We analyze our algorithms using the gradient mapping (5) as described more precisely below. Definition 1. A point x output by stochastic iterative algorithm for solving (1) is called an ✏-accurate solution, if E[kG⌘(x)k2] ✏for some ⌘> 0. Our goal is to obtain efficient algorithms for achieving an ✏-accurate solution, where efficiency is measured using IFO and PO complexity as functions of 1/✏and n. 2More recently, the authors have also developed VR Frank-Wolfe methods for handling constrained problems that do not admit easy projection operators [24]. 3This mapping has also been used in the analysis of nonconvex proximal methods in [6, 7, 30]. 3 Algorithm IFO PO IFO (PL) PO (PL) Constant minibatch? PROXSGD O ! 1/✏2" O (1/✏) O ! 1/✏2" O (1/✏) ? PROXGD O (n/✏) O (1/✏) O (nlog(1/✏)) O (log(1/✏)) − PROXSVRG O(n + (n2/3/✏)) O(1/✏) O((n + n2/3) log(1/✏)) O(log(1/✏)) p PROXSAGA O(n + (n2/3/✏)) O(1/✏) O((n + n2/3) log(1/✏)) O(log(1/✏)) p Table 1: Table comparing the best IFO and PO complexity of different algorithms discussed in the paper. The complexity is measured in terms of the number of oracle calls required to achieve an ✏-accurate solution. The IFO (PL) and PO (PL) represents the IFO and PO complexity of PL functions (see Section 4 for a formal definition). The results marked in red are the contributions of this paper. In the table, “constant minibatch” indicates whether stochastic algorithm converges using a constant minibatch size. To the best of our knowledge, it is not known if PROXSGD converges on using constant minibatches for nonconvex nonsmooth optimization. Also, we are not aware of any specific convergence results for PROXSGD in the context of PL functions. 3 Algorithms We focus on two algorithms: (a) proximal SVRG (PROXSVRG) and (b) proximal SAGA (PROXSAGA). 3.1 Nonconvex Proximal SVRG We first consider a variant of PROXSVRG [31]; pseudocode of this variant is stated in Algorithm 1. When F is strongly convex, SVRG attains linear convergence rate as opposed to sublinear convergence of SGD [8]. Note that, while SVRG is typically stated with b = 1, we use its minibatch variant with batch size b. The specific reasons for using such a variant will become clear during the analysis. While some other algorithms have been proposed for reducing the variance in the stochastic gradients, SVRG is particularly attractive because of its low memory requirement; it requires just O(d) extra memory in comparison to SGD for storing the average gradient (gs in Algorithm 1), while algorithms like SAG and SAGA incur O(nd) storage cost. In addition to its strong theoretical results, SVRG is known to outperform SGD empirically while being more robust to selection of step size. For convex problems, PROXSVRG is known to inherit these advantages of SVRG [31]. We now present our analysis of nonconvex PROXSVRG, starting with a result for batch size b = 1. Theorem 1. Let b = 1 in Algorithm 1. Let ⌘= 1/(3Ln), m = n and T be a multiple of m. Then the output xa of Algorithm 1 satisfies the following bound: E[kG⌘(xa)k2] 18Ln2 3n −2 ✓F(x0) −F(x⇤) T ◆ , where x⇤is an optimal solution of (1). Theorem 1 shows that PROXSVRG converges for constant minibatches of size b = 1. This result is in strong contrast to PROXSGD whose convergence with constant minibatches is still unknown. However, the result delivered by Theorem 1 is not stronger than that of PROXGD. The following corollary to Theorem 1 highlights this point. Corollary 1. To obtain an ✏-accurate solution, with b = 1 and parameters from Theorem 1, the IFO and PO complexities of Algorithm 1 are O(n/✏) and O(n/✏), respectively. Corollary 1 follows upon noting that each inner iteration (Step 7) of Algorithm 1 has an effective IFO complexity of O(1) since m = n. This IFO complexity includes the IFO calls for calculating the average gradient at the end of each epoch. Furthermore, each inner iteration also invokes the proximal oracle, whereby the PO complexity is also O(n/✏). While the IFO complexity of constant minibatch PROXSVRG is same as PROXGD, we see that its PO complexity is much worse. This is due to the fact that n IFO calls correspond to one PO call in PROXGD, while one IFO call in PROXSVRG corresponds to one PO call. Consequently, we do not gain any theoretical advantage by using constant minibatch PROXSVRG over PROXGD. 4 Algorithm 1: Nonconvex PROXSVRG ! x0, T, m, b, ⌘ " 1: Input: ˜x0 = x0 m = x0 2 Rd, epoch length m, step sizes ⌘> 0, S = dT/me, minibatch size b 2: for s = 0 to S −1 do 3: xs+1 0 = xs m 4: gs+1 = 1 n Pn i=1 rfi(˜xs) 5: for t = 0 to m −1 do 6: Uniformly randomly pick It ⇢{1, . . . , n} (with replacement) such that |It| = b 7: vs+1 t = 1 b P it2It(rfit(xs+1 t ) −rfit(˜xs)) + gs+1 8: xs+1 t+1 = prox⌘h(xs+1 t −⌘vs+1 t ) 9: end for 10: ˜xs+1 = xs+1 m 11: end for 12: Output: Iterate xa chosen uniformly at random from {{xs+1 t }m−1 t=0 }S−1 s=0 . The key question is therefore: can we modify the algorithm to obtain better theoretical guarantees? To answer this question, we prove the following main convergence result. For ease of theoretical exposition, we assume n2/3 to be an integer. This is only for convenience in stating our theoretical results and all the results in the paper hold for the general case. Theorem 2. Suppose b = n2/3 in Algorithm 1. Let ⌘= 1/(3L), m = bn1/3c and T be a multiple of m. Then for the output xa of Algorithm 1, we have: E[kG⌘(xa)k2] 18L(F(x0) −F(x⇤)) T , where x⇤is an optimal solution to (1). Rewriting Theorem 2 in terms of the IFO and PO complexity, we obtain the following corollary. Corollary 2. Let b = n2/3 and set parameters as in Theorem 2. Then, to obtain an ✏-accurate solution the IFO and PO complexities of Algorithm 1 are O(n + n2/3/✏) and O(1/✏), respectively. The above corollary is due to the following observations. From Theorem 2, it can be seen that the total number of inner iterations (across all epochs) of Algorithm 1 to obtain an ✏-accurate solution is O(1/✏). Since each inner iteration of Algorithm 2 involves a call to the PO, we obtain a PO complexity of O(1/✏). Further, since b = n2/3 IFO calls are made at each inner iteration, we obtain a net IFO complexity of O(n2/3/✏). Adding the IFO calls for the calculation of the average gradient (and noting that T is a multiple of m), as well as noting that S ≥1, we obtain a total cost of O(n + n2/3/✏). A noteworthy aspect of Corollary 2 is that its PO complexity matches PROXGD, but its IFO complexity is significantly decreased to O(n + n2/3/✏) as opposed to O(n/✏) in PROXGD. 3.2 Nonconvex Proximal SAGA In the previous section, we investigated PROXSVRG for solving (1). Note that PROXSVRG is not a fully “incremental" algorithm since it requires calculation of the full gradient once per epoch. An alternative to PROXSVRG is the algorithm proposed in [4] (popularly referred to as SAGA). We build upon the work of [4] to develop PROXSAGA, a nonconvex proximal variant of SAGA. The pseudocode for PROXSAGA is presented in Algorithm 2. The key difference between Algorithm 1 and 2 is that PROXSAGA, unlike PROXSVRG, avoids computation of the full gradient. Instead, it maintains an average gradient vector gt, which changes at each iteration (refer to [20]). However, such a strategy entails additional storage costs. In particular, for implementing Algorithm 2, we must store the gradients {rfi(↵t i)}n i=1, which in general can cost O(nd) in storage. Nevertheless, in some scenarios common to machine learning (see [4]), one can reduce the storage requirements to O(n). Whenever such an implementation of PROXSAGA is possible, it can perform similar to or even better than PROXSVRG [4]; hence, in addition to theoretical interest, it is of significant practical value. We remark that PROXSAGA in Algorithm 2 differs slightly from [4]. In particular, it uses minibatches where two sets It, Jt are sampled at each iteration as opposed to one in [4]. This is mainly for the ease of theoretical analysis. 5 Algorithm 2: Nonconvex PROXSAGA ! x0, T, b, ⌘ " 1: Input: x0 2 Rd, ↵0 i = x0 for i 2 [n], step size ⌘> 0, minibatch size b 2: g0 = 1 n Pn i=1 rfi(↵0 i ) 3: for t = 0 to T −1 do 4: Uniformly randomly pick sets It, Jt from [n] (with replacement) such that |It| = |Jt| = b 5: vt = 1 b P it2It(rfit(xt) −rfit(↵t it)) + gt 6: xt+1 = prox⌘h(xt −⌘vt) 7: ↵t+1 j = xt for j 2 Jt and ↵t+1 j = ↵t j for j /2 Jt 8: gt+1 = gt −1 n P jt2Jt(rfjt(↵t jt) −rfjt(↵t+1 jt )) 9: end for 10: Output: Iterate xa chosen uniformly random from {xt}T −1 t=0 . We prove that as in the convex case, nonconvex PROXSVRG and PROXSAGA share similar theoretical guarantees. In particular, our first result for PROXSAGA is a counterpart to Theorem 1 for PROXSVRG. Theorem 3. Suppose b = 1 in Algorithm 2. Let ⌘= 1/(5Ln). Then for the output xa of Algorithm 2 after T iterations, the following stationarity bound holds: E[kG⌘(xa)k2] 50Ln2 5n −2 F(x0) −F(x⇤) T , where x⇤is an optimal solution of (1). Theorem 3 immediately leads to the following corollary. Corollary 3. The IFO and PO complexity of Algorithm 3 for b = 1 and parameters specified in Theorem 3 to obtain an ✏-accurate solution are O(n/✏) and O(n/✏) respectively. Similar to Theorem 2 for PROXSVRG, we obtain the following main result for PROXSAGA. Theorem 4. Suppose b = n2/3 in Algorithm 2. Let ⌘= 1/(5L). Then for the output xa of Algorithm 2 after T iterations, the following holds: E[kG⌘(xa)k2] 50L(F(x0) −F(x⇤)) 3T , where x⇤is an optimal solution of Problem (1). Rewriting this result in terms of IFO and PO access, we obtain the following important corollary. Corollary 4. Let b = n2/3 and set parameters as in Theorem 4. Then, to obtain an ✏-accurate solution the IFO and PO complexities of Algorithm 2 are O(n + n2/3/✏) and O(1/✏), respectively. The above result is due to Theorem 4 and because each iteration of PROXSAGA requires O(n2/3) IFO calls. The number of PO calls is only O(1/✏), since make one PO call for every n2/3 IFO calls. Discussion: It is important to note the role of minibatches in Corollaries 2 and 4. Minibatches are typically used for reducing variance and promoting parallelism in stochastic methods. But unlike previous works, we use minibatches as a theoretical tool to improve convergence rates of both nonconvex PROXSVRG and PROXSAGA. In particular, by carefully selecting the minibatch size, we can improve the IFO complexity of the algorithms described in the paper from O(n/✏) (similar to PROXGD) to O(n2/3/✏) (matching the smooth nonconvex case). Furthermore, the PO complexity is also improved in a similar manner by using the minibatch size mentioned in Theorems 2 and 4. 4 4 Extensions We discuss some extensions of our approach in this section. Our first extension is to provide convergence analysis for a subclass of nonconvex functions that satisfy a specific growth condition popularly known as the Polyak-Łojasiewicz (PL) inequality. In the context of gradient descent, 4We refer the readers to the full version [23] for a more general convergence analysis of the algorithms. 6 PL-SVRG:(x0, K, T, m, ⌘) for k = 1 to K do xk = ProxSVRG(xk−1, T, m, b, ⌘) ; end Output: xK PL-SAGA:(x0, K, T, m, ⌘) for k = 1 to K do xk = ProxSAGA(xk−1, T, b, ⌘) ; end Output: xK Figure 1: PROXSVRG and PROXSAGA variants for PL functions. this inequality was proposed by Polyak in 1963 [19], who showed global linear convergence of gradient descent for functions that satisfy the PL inequality. Recently, in [9] the PL inequality was generalized to nonsmooth functions and used for proving linear convergence of proximal gradient. The generalization presented in [9] considers functions F(x) = f(x)+h(x) that satisfy the following: µ(F(x) −F(x⇤)) 1 2Dh(x, µ), where µ > 0 and Dh(x, µ) := −2µ miny ⇥ hrf(x), y −xi + µ 2 ky −xk2 + h(y) −h(x) ⇤ . (6) An F that satisfies (6) is called a µ-PL function. When h ⌘0, condition (6) reduces to the usual PL inequality. The class of µ-PL functions includes several other classes as special cases. It subsumes strongly convex functions, covers fi(x) = g(a> i x) with only g being strongly convex, and includes functions that satisfy a optimal strong convexity property [12]. Note that the µ-PL functions also subsume the recently studied special case where fi’s are nonconvex but their sum f is strongly convex. Hence, it encapsulates the problems of [27, 32]. The algorithms in Figure 1 provide variants of PROXSVRG and PROXSAGA adapted to optimize µ-PL functions. We show the following global linear convergence result of PL-SVRG and PL-SAGA in Figure 1 for PL functions. For simplicity, we assume = (L/µ) > n1/3. When f is strongly convex, is referred to as the condition number, in which case > n1/3 corresponds to the high condition number regime. Theorem 5. Suppose F is a µ-PL function. Let b = n2/3, ⌘= 1/5L, m = bn1/3c and T = d30e. Then for the output xK of PL-SVRG and PL-SAGA (in Figure 1), the following holds: E[F(xK) −F(x⇤)] [F(x0) −F(x⇤)] 2K , where x⇤is an optimal solution of (1). The following corollary on IFO and PO complexity of PL-SVRG and PL-SAGA is immediate. Corollary 5. When F is a µ-PL function, then the IFO and PO complexities of PL-SVRG and PL-SAGA with the parameters specified in Theorem 5 to obtain an ✏-accurate solution are O((n + n2/3) log(1/✏)) and O(log(1/✏)), respectively. Note that proximal gradient also has global linear convergence for PL functions, as recently shown in [9]. However, its IFO complexity is O(n log(1/✏)), which is much worse than that of PL-SVRG and PL-SAGA (Corollary 5). Other extensions: While we state our results for specific minibatch sizes, a more general convergence analysis is provided for any minibatch size b n2/3 (Theorems 6 and 7 in the Appendix). Moreover, our results can be easily generalized to the case where non-uniform sampling is used in Algorithm 1 and Algorithm 2. This is useful when the functions fi have different Lipschitz constants. 5 Experiments We present our empirical results in this section. For our experiments, we study the problem of non-negative principal component analysis (NN-PCA). More specifically, for a given set of samples {zi}n i=1, we solve the following optimization problem: min kxk1, x≥0 −1 2x> n X i=1 ziz> i ! x. (7) 7 # grad/n 0 5 10 15 f(x) ! f(^x) 10-15 10-10 10-5 SGD SAGA SVRG # grad/n 0 5 10 15 f(x) ! f(^x) 10-15 10-10 10-5 SGD SAGA SVRG # grad/n 0 5 10 15 f(x) ! f(^x) 10-15 10-10 10-5 SGD SAGA SVRG # grad/n 0 5 10 15 f(x) ! f(^x) 10-15 10-10 10-5 SGD SAGA SVRG Figure 2: Non-negative principal component analysis. Performance of PROXSGD, PROXSVRG and PROXSAGA on ’rcv1’ (left), ’a9a’(left-center), ’mnist’ (right-center) and ’aloi’ (right) datasets. Here, the y-axis is the function suboptimality i.e., f(x)−f(ˆx) where ˆx represents the best solution obtained by running gradient descent for long time and with multiple restarts. The problem of NN-PCA is, in general, NP-hard. This variant of the standard PCA problem can be written in the form (1) with fi(x) = −(x>zi)2 for all i 2 [n] and h(x) = IC(x) where C is the convex set {x 2 Rd|kxk 1, x ≥0}. In our experiments, we compare PROXSGD with nonconvex PROXSVRG and PROXSAGA. The choice of step size is important to PROXSGD. The step size of PROXSGD is set using the popular t-inverse step size choice of ⌘t = ⌘0(1 + ⌘0bt/nc)−1 where ⌘0, ⌘0 > 0. For PROXSVRG and PROXSAGA, motivated by the theoretical analysis, we use a fixed step size. The parameters of the step size in each of these methods are chosen so that the method gives the best performance on the objective value. In our experiments, we include the value ⌘0 = 0, which corresponds to PROXSGD with fixed step size. For PROXSVRG, we use the epoch length m = n. We use standard machine learning datasets in LIBSVM for all our experiments 5. The samples from each of these datasets are normalized i.e. kzik = 1 for all i 2 [n]. Each of these methods is initialized by running PROXSGD for n iterations. Such an initialization serves two purposes: (a) it provides a reasonably good initial point, typically beneficial for variance reduction techniques [4, 26]. (b) it provides a heuristic for calculating the initial average gradient g0 [26]. In our experiments, we use b = 1 in order to demonstrate the performance of the algorithms with constant minibatches. We report the objective function value for the datasets. In particular, we report the suboptimality in objective function i.e., f(xs+1 t ) −f(ˆx) (for PROXSVRG) and f(xt) −f(ˆx) (for PROXSAGA). Here ˆx refers to the solution obtained by running proximal gradient descent for a large number of iterations and multiple random initializations. For all the algorithms, we compare the aforementioned criteria against for the number of effective passes through the dataset i.e., IFO complexity divided by n. For PROXSVRG, this includes the cost of calculating the full gradient at the end of each epoch. Figure 2 shows the performance of the algorithms on NN-PCA problem (see Section D of the Appendix for more experiments). It can be seen that the objective value for PROXSVRG and PROXSAGA is much lower compared to PROXSGD, suggesting faster convergence for these algorithms. We observed a significant gain consistently across all the datasets. Moreover, the selection of step size was much simpler for PROXSVRG and PROXSAGA than that for PROXSGD. We did not observe any significant difference in the performance of PROXSVRG and PROXSAGA for this particular task. 6 Final Discussion In this paper, we presented fast stochastic methods for nonsmooth nonconvex optimization. In particular, by employing variance reduction techniques, we show that one can design methods that can provably perform better than PROXSGD and proximal gradient descent. Furthermore, in contrast to PROXSGD, the resulting approaches have provable convergence to a stationary point with constant minibatches; thus, bridging a fundamental gap in our knowledge of nonsmooth nonconvex problems. We proved that with a careful selection of minibatch size, it is possible to theoretically show superior performance to proximal gradient descent. Our empirical results provide evidence for a similar conclusion even with constant minibatches. Thus, we conclude with an important open problem of developing stochastic methods with provably better performance than proximal gradient descent with constant minibatch size. Acknowledgment: SS acknowledges support of NSF grant: IIS-1409802. 5The datasets can be downloaded from https://www.csie.ntu.edu.tw/~cjlin/ libsvmtools/datasets. 8 References [1] A. Agarwal and L. Bottou. A lower bound for the optimization of finite sums. arXiv:1410.0723, 2014. [2] F. Bach, R. Jenatton, J. Mairal, and G. Obozinski. Convex optimization with sparsity-inducing norms. In S. Sra, S. Nowozin, and S. J. Wright, editors, Optimization for Machine Learning. MIT Press, 2011. [3] Léon Bottou. Stochastic gradient learning in neural networks. Proceedings of Neuro-Nımes, 91(8), 1991. [4] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. SAGA: A fast incremental gradient method with support for non-strongly convex composite objectives. In NIPS 27, pages 1646–1654. 2014. [5] Masao Fukushima and Hisashi Mine. A generalized proximal point algorithm for certain non-convex minimization problems. International Journal of Systems Science, 12(8):989–1000, 1981. [6] Saeed Ghadimi and Guanghui Lan. Stochastic first- and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013. [7] Saeed Ghadimi, Guanghui Lan, and Hongchao Zhang. Mini-batch stochastic approximation methods for nonconvex stochastic composite optimization. Mathematical Programming, 155(1-2):267–305, 2014. [8] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In NIPS 26, pages 315–323. 2013. [9] Hamed Karimi, Julie Nutini, and Mark W. Schmidt. Linear convergence of gradient and proximal-gradient methods under the polyak-łojasiewicz condition. In Machine Learning and Knowledge Discovery in Databases - European Conference, ECML PKDD 2016, pages 795–811, 2016. [10] G. Lan and Y. Zhou. An optimal randomized incremental gradient method. arXiv:1507.02000, 2015. [11] Xingguo Li, Tuo Zhao, Raman Arora, Han Liu, and Jarvis Haupt. Stochastic variance reduced optimization for nonconvex sparse learning. In ICML, 2016. arXiv:1605.02711. [12] Ji Liu and Stephen J. Wright. Asynchronous stochastic coordinate descent: Parallelism and convergence properties. SIAM Journal on Optimization, 25(1):351–376, January 2015. [13] Hisashi Mine and Masao Fukushima. A minimization method for the sum of a convex function and a continuously differentiable function. Journal of Optimization Theory and Applications, 33(1):9–23, 1981. [14] J. J. Moreau. Fonctions convexes duales et points proximaux dans un espace hilbertien. C. R. Acad. Sci. Paris Sér. A Math., 255:2897–2899, 1962. [15] Arkadi Nemirovski and D Yudin. Problem Complexity and Method Efficiency in Optimization. John Wiley and Sons, 1983. [16] Yu Nesterov. Efficiency of coordinate descent methods on huge-scale optimization problems. SIAM Journal on Optimization, 22(2):341–362, 2012. [17] Yurii Nesterov. Introductory Lectures On Convex Optimization: A Basic Course. Springer, 2003. [18] N. Parikh and S. Boyd. Proximal algorithms. Foundations and Trends in Optimization, 1(3):127–239, 2014. [19] B.T. Polyak. Gradient methods for the minimisation of functionals. USSR Computational Mathematics and Mathematical Physics, 3(4):864–878, January 1963. [20] Sashank Reddi, Ahmed Hefny, Suvrit Sra, Barnabas Poczos, and Alex J Smola. On variance reduction in stochastic gradient descent and its asynchronous variants. In NIPS 28, pages 2629–2637, 2015. [21] Sashank J. Reddi, Ahmed Hefny, Suvrit Sra, Barnabás Póczos, and Alexander J. Smola. Stochastic variance reduction for nonconvex optimization. In Proceedings of the 33nd International Conference on Machine Learning, ICML 2016, New York City, NY, USA, June 19-24, 2016, pages 314–323, 2016. [22] Sashank J. Reddi, Suvrit Sra, Barnabás Póczos, and Alexander J. Smola. Fast incremental method for nonconvex optimization. CoRR, abs/1603.06159, 2016. [23] Sashank J. Reddi, Suvrit Sra, Barnabás Póczos, and Alexander J. Smola. Fast stochastic methods for nonsmooth nonconvex optimization. CoRR, abs/1605.06900, 2016. [24] Sashank J. Reddi, Suvrit Sra, Barnabás Póczos, and Alexander J. Smola. Stochastic frank-wolfe methods for nonconvex optimization. In 54th Annual Allerton Conference on Communication, Control, and Computing, Allerton 2016, 2016. [25] R Tyrrell Rockafellar. Monotone operators and the proximal point algorithm. SIAM journal on control and optimization, 14(5):877–898, 1976. [26] Mark W. Schmidt, Nicolas Le Roux, and Francis R. Bach. Minimizing Finite Sums with the Stochastic Average Gradient. arXiv:1309.2388, 2013. [27] Shai Shalev-Shwartz. SDCA without duality. CoRR, abs/1502.06177, 2015. [28] Shai Shalev-Shwartz and Tong Zhang. Stochastic dual coordinate ascent methods for regularized loss. The Journal of Machine Learning Research, 14(1):567–599, 2013. [29] Ohad Shamir. A stochastic PCA and SVD algorithm with an exponential convergence rate. arXiv:1409.2848, 2014. [30] Suvrit Sra. Scalable nonconvex inexact proximal splitting. In NIPS, pages 530–538, 2012. [31] Lin Xiao and Tong Zhang. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. [32] Zeyuan Allen Zhu and Yang Yuan. Improved svrg for non-strongly-convex or sum-of-non-convex objectives. CoRR, abs/1506.01972, 2015. 9
2016
96
6,559
Spectral Learning of Dynamic Systems from Nonequilibrium Data Hao Wu and Frank Noé Department of Mathematics and Computer Science Freie Universität Berlin Arnimallee 6, 14195 Berlin {hao.wu,frank.noe}@fu-berlin.de Abstract Observable operator models (OOMs) and related models are one of the most important and powerful tools for modeling and analyzing stochastic systems. They exactly describe dynamics of finite-rank systems and can be efficiently and consistently estimated through spectral learning under the assumption of identically distributed data. In this paper, we investigate the properties of spectral learning without this assumption due to the requirements of analyzing large-time scale systems, and show that the equilibrium dynamics of a system can be extracted from nonequilibrium observation data by imposing an equilibrium constraint. In addition, we propose a binless extension of spectral learning for continuous data. In comparison with the other continuous-valued spectral algorithms, the binless algorithm can achieve consistent estimation of equilibrium dynamics with only linear complexity. 1 Introduction In the last two decades, a collection of highly related dynamic models including observable operator models (OOMs) [1–3], predictive state representations [4–6] and reduced-rank hidden Markov models [7, 8], have become powerful and increasingly popular tools for analysis of dynamic data. These models are largely similar, and all can be learned by spectral methods in a general framework of multiplicity automata, or equivalently sequential systems [9, 10]. In contrast with the other commonly used models such as Markov state models [11, 12], Langevin models [13, 14], traditional hidden Markov models (HMMs) [15, 16], Gaussian process state-space models [17, 18] and recurrent neural networks [19], the spectral learning based models can exactly characterize the dynamics of a stochastic system without any a priori knowledge except the assumption of finite dynamic rank (i.e., the rank of Hankel matrix) [10, 20], and the parameter estimation can be efficiently performed for discrete-valued systems without solving any intractable inverse or optimization problem. We focus in this paper only on stochastic systems without control inputs and all spectral learning based models can be expressed in the form of OOMs for such systems, so we will refer to them as OOMs below. In most literature on spectral learning, the observation data are assumed to be identically (possibly not independently) distributed so that the expected values of observables associated with the parameter estimation can be reliably computed by empirical averaging. However, this assumption can be severely violated due to the limit of experimental technique or computational capacity in many practical situations, especially where metastable physical or chemical processes are involved. A notable example is the distributed computing project Folding@home [21], which explores protein folding processes that occur on the timescales of microseconds to milliseconds based on molecular dynamics simulations on the order of nanoseconds in length. In such a nonequilibrium case where distributions of observation data are time-varying and dependent on initial conditions, it is still unclear 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. if promising estimates of OOMs can be obtained. In [22], a hybrid estimation algorithm was proposed to improve spectral learning of large-time scale processes by using both dynamic and static data, but it still requires assumption of identically distributed data. One solution to reduce the statistical bias caused by nonequilibrium data is to discard the observation data generated before the system reaches steady state, which is a common trick in applied statistics [23]. Obviously, this way suffers from substantial information loss and is infeasible when observation trajectories are shorter than mixing times. Another possible way would be to learn OOMs by likelihood-based estimation instead of spectral methods, but there is no effective maximum likelihood or Bayesian estimator of OOMs until now. The maximum pseudo-likelihood estimator of OOMs proposed in [24] demands high computational cost and its consistency is yet unverified. Another difficulty for spectral approaches is learning with continuous data, where density estimation problems are involved. The density estimation can be performed by parametric methods such as the fuzzy interpolation [25] and the kernel density estimation [8]. But these methods would reduce the flexibility of OOMs for dynamic modeling because of their limited expressive capacity. Recently, a kernel embedding based spectral algorithm was proposed to cope with continuous data [26], which avoids explicit density estimation and learns OOMs in a nonparametric manner. However, the kernel embedding usually yields a very large computational complexity, which greatly limits practical applications of this algorithm to real-world systems. The purpose of this paper is to address the challenge of spectral learning of OOMs from nonequilibrium data for analysis of both discrete- and continuous-valued systems. We first provide a modified spectral method for discrete-valued stochastic systems which allows us to consistently estimate the equilibrium dynamics from nonequilibrium data, and then extend this method to continuous observations in a binless manner. In comparison with the existing learning methods for continuous OOMs, the proposed binless spectral method does not rely on any density estimator, and can achieve consistent estimation with linear computational complexity in data size even if the assumption of identically distributed observations does not hold. Moreover, some numerical experiments are provided to demonstrate the capability of the proposed methods. 2 Preliminaries 2.1 Notation In this paper, we use P to denote probability distribution for discrete random variables and probability density for continuous random variables. The indicator function of event e is denoted by 1e and the Dirac delta function centered at x is denoted by δx (·). For a given process {at}, we write the subsequence (ak, ak+1, . . . , ak′) as ak:k′, and E∞[at] ≜limt→∞E[at] means the equilibrium expected value of at if the limit exists. In addition, the convergence in probability is denoted by p→. 2.2 Observable operator models An m-dimensional observable operator model (OOM) with observation space O can be represented by a tuple M = (ω, {Ξ(x)}x∈O, σ), which consists of an initial state vector ω ∈R1×m, an evaluation vector σ ∈Rm×1 and an observable operator matrix Ξ(x) ∈Rm×m associated to each element x ∈O. M defines a stochastic process {xt} in O as P (x1:t|M) = ωΞ(x1:t)σ (1) under the condition that ωΞ(x1:t)σ ≥0, ωΞ(O)σ = 1 and ωΞ(x1:t)σ = ωΞ(x1:t)Ξ(O)σ hold for all t and x1:t ∈Ot [10], where Ξ(x1:t) ≜Ξ(x1) . . . Ξ(xt) and Ξ(A) ≜ ´ A dx Ξ (x). Two OOMs M and M′ are said to be equivalent if P (x1:t|M) ≡P (x1:t|M′). 3 Spectral learning of OOMs 3.1 Algorithm Here and hereafter, we only consider the case that the observation space O is a finite set. (Learning with continuous observations will be discussed in Section 4.2.) A large number of largely similar 2 Algorithm 1 General procedure for spectral learning of OOMs INPUT: Observation trajectories generated by a stochastic process {xt} in O OUTPUT: ˆ M = (ˆω, {ˆΞ(x)}x∈O, ˆσ) PARAMETER: m: dimension of the OOM. D1, D2: numbers of feature functions. L: order of feature functions. 1: Construct feature functions φ1 = (ϕ1,1, . . . , ϕ1,D1)⊤and φ2 = (ϕ2,1, . . . , ϕ2,D2)⊤, where each ϕi,j is a mapping from OL to R and D1, D2 ≥m. 2: Approximate ¯φ1 ≜E [φ1(xt−L:t−1)] , ¯φ2 ≜E [φ2(xt:t+L−1)] (5) C1,2 ≜E  φ1(xt−L:t−1)φ2(xt:t+L−1)⊤ (6) C1,3 (x) ≜E  1xt=x · φ1(xt−L:t−1)φ2(xt+1:t+L)⊤ , ∀x ∈O (7) by their empirical means ˆ¯φ1, ˆ¯φ2, ˆC1,2 and ˆC1,3 (x) over observation data. 3: Compute F1 = UΣ−1 ∈RD1×m and F2 = V ∈RD2×m from the truncated singular value decomposition ˆC1,2 ≈UΣV⊤, where Σ ∈Rm×m is a diagonal matrix contains the top m singular values of ˆC1,2, and U and V consist of the corresponding m left and right singular vectors of ˆC1,2. 4: Compute ˆσ = F⊤ 1 ˆ¯φ1 (8) ˆΞ(x) = F⊤ 1 ˆC1,3(x)F2, ∀x ∈O (9) ˆω = ˆ¯φ⊤ 2 F2 (10) spectral methods have been developed, and the generic learning procedure of these methods is summarized in Algorithm 1 by omitting details of algorithm implementation and parameter choice [27, 7, 28]. For convenience of description and analysis, we specify in this paper the formula for calculating ˆ¯φ1, ˆ¯φ2, ˆC1,2 and ˆC1,3 (x) in Line 2 of Algorithm 1 as follows: ˆ¯φ1 = 1 N N X n=1 φ1(⃗s 1 n), ˆ¯φ2 = 1 N N X n=1 φ2(⃗s 2 n) (2) ˆC1,2 = 1 N N X n=1 φ1(⃗s 1 n)φ2(⃗s 2 n)⊤ (3) ˆC1,3 (x) = 1 N N X n=1 1s2n=xφ1(⃗s 1 n)φ2(⃗s 3 n)⊤, ∀x ∈O (4) Here {(⃗s 1 n, s2 n,⃗s 3 n)}N n=1 is the collection of all subsequences of length (2L + 1) appearing in observation data (N = T −2L for a single observation trajectory of length T). If an observation subsequence xt−L:t+L is denoted by (⃗s 1 n, s2 n,⃗s 3 n) with some n, then ⃗s 1 n = xt−L:t−1 and ⃗s 3 n = xt+1:t+L represents the prefix and suffix of xt−L:t+L of length L, s2 n = xt is the intermediate observation value, and ⃗s 2 n = xt:t+L−1 is an “intermediate part” of the subsequence of length L starting from time t (see Fig. 1 for a graphical illustration). Algorithm 1 is much more efficient than the commonly used likelihood-based learning algorithms and does not suffer from local optima issues. In addition, and more importantly, this algorithm can be shown to be consistent if (⃗s 1 n, s2 n,⃗s 3 n) are (i) independently sampled from M or (ii) obtained from a finite number of trajectories which have fully mixed so that all observation triples are identically distributed (see, e.g., [8, 3, 10] for related works). However, the asymptotic correctness of OOMs learned from short trajectories starting from nonequilibrium states has not been formally determined. 3 ݔ௧ି௅ ⋯ ݔ௧ିଵ ݔ௧ ݔ௧ାଵ ⋯ ݔ௧ା௅ ݏԦ௡ଵ ݏԦ௡ଷ ݏ௡ଶ ݏԦ௡ଶ Figure 1: Illustration of variables ⃗s 1 n, s2 n, ⃗s 3 n and ⃗s 2 n used in Eqs. (2)-(4) with (⃗s 1 n, s2 n,⃗s 3 n) = xt−L:t+L. 3.2 Theoretical analysis We now analyze statistical properties of the spectral algorithm without the assumption of identically distributed observations. Before stating our main result, some assumptions on observation data are listed as follows: Assumption 1. The observation data consists of I independent trajectories of length T produced by a stochastic process {xt}, and the data size tends to infinity with (i) I →∞and T = T0 or (ii) T →∞and I = I0. Assumption 2. {xt} is driven by an m-dimensional OOM M = (ω, {Ξ(x)}x∈O, σ), and 1 T ′ T ′ X t=1 ft p→E∞[f (xt:t+l−1)] = E∞[f (xt:t+l−1) |x1:k] (11) as T ′ →∞for all k, l, x1:k and f : Ol 7→R. Assumption 3. The rank of the limit of ˆC1,2 is not less than m. Notice that Assumption 2 only states the asymptotic stationarity of {xt} and marginal distributions of observation triples are possibly time dependent if ω ̸= ωΞ (O). Assumption 3 ensures that the limit of ˆ M given by Algorithm 1 is well defined, which generally holds for minimal OOMs (see [10]). Based on the above assumptions, we have the following theorem concerning the statistical consistency of the OOM learning algorithm (see Appendix A.1 for proof): Theorem 1. Under Assumptions 1-3, there exists an OOM M′ = (ω′, {Ξ′(x)}x∈O, σ′) which is equivalent to ˆ M and satisfies σ′ p→σ, Ξ′(x) p→Ξ(x), ∀x ∈O (12) This theorem is central in this paper, which implies that the spectral learning algorithm can achieve consistent estimation of all parameters of OOMs except initial state vectors even for nonequilibrium data. (ˆω p→ω′ does not hold in most cases except when {xt} is stationary.). It can be further generalized according to requirements in more complicated situations where, for example, observation trajectories are generated with multiple different initial conditions (see Appendix A.2). 4 Spectral learning of equilibrium OOMs In this section, applications of spectral learning to the problem of recovering equilibrium properties of dynamic systems from nonequilibrium data will be highlighted, which is an important problem in practice especially for thermodynamic and kinetic analysis in computational physics and chemistry. 4.1 Learning from discrete data According to the definition of OOMs, the equilibrium dynamics of an OOM M = (ω, {Ξ(x)}x∈O, σ) can be described by an equilibrium OOM Meq = (ωeq, {Ξ(x)}x∈O, σ) as lim t→∞P (xt+1:t+k = z1:k|M) = P (x1:t = z1:k|Meq) (13) if the equilibrium state vector ωeq = lim t→∞ωΞ(O)t (14) 4 exists. From (13) and (14), we have  ωeqΞ(O) = limt→∞ωeqΞ(O)t+1 = ωeq ωeqσ = limt→∞ P x∈O P (xt+1 = x) = 1 (15) The above equilibrium constraint of OOMs motivates the following algorithm for learning equilibrium OOMs: Perform Algorithm 1 to get ˆΞ (x) and ˆσ and calculate ˆωeq by a quadratic programming problem ˆωeq = arg min w∈{w|wˆσ=1} wˆΞ(O) −w 2 (16) (See Appendix A.3 for a closed-form expression of the solution to (16).) The existence and uniqueness of ωeq are shown in Appendix A.3, which yield the following theorem: Theorem 2. Under Assumptions 1-3, the estimated equilibrium OOM ˆ Meq = (ˆωeq, {ˆΞ(x)}x∈O, ˆσ) provided by Algorithm 1 and Eq. (16) satisfies P  x1:l = z1:l| ˆ Meq  p→lim t→∞P (xt+1:t+l = z1:l) (17) for all l and z1:l. Remark 1. ˆωeq can also be computed as an eigenvector of ˆΞ(O). But the eigenvalue problem possibly yields numerical instability and complex values because of statistical noise, unless some specific feature functions φ1, φ2 are selected so that ˆωeq ˆΞ(O) = ˆωeq can be exactly solved in the real field [29]. 4.2 Learning from continuous data A straightforward way to extend spectral algorithms to handle continuous data is based on the coarse-graining of the observation space. Suppose that {xt} is a stochastic process in a continuous observation space O ⊂Rd, and O is partitioned into J discrete bins B1, . . . , BJ. Then we can utilize the algorithm in Section 4.1 to approximate the equilibrium transition dynamics between bins as lim t→∞P (xt+1 ∈Bj1, . . . , xt+l ∈Bjl) ≈ˆωeq ˆΞ (Bj1) . . . ˆΞ (Bjl) ˆσ (18) and obtain a binned OOM ˆ Meq = (ˆωeq, {ˆΞ(x)}x∈O, ˆσ) for the continuous dynamics of {xt} with ˆΞ(x) = ˆΞ(B (x)) vol(B (x)) (19) by assuming the observable operator matrices are piecewise constant on bins, where B (x) denotes the bin containing x and vol(B) is the volume of B. Conventional wisdom dictates that the number of bins is a key parameter for the coarse-graining strategy and should be carefully chosen for the balance of statistical noise and discretization error. However, we will show in what follows that it is justifiable to increase the number of bins to infinity. Let us consider the limit case where J →∞and bins are infinitesimal with maxj vol(Bj) →0. In this case, ˆΞ(x) = lim vol(B(x))→0 ˆΞ(B (x)) vol(B (x)) =  ˆ Ws2nδs2n (x) , x = s2 n 0, otherwise (20) where ˆ Ws2n = 1 N F⊤ 1 φ1(⃗s 1 n)φ2(⃗s 3 n)⊤F2 (21) according to (9) in Algorithm 1. Then ˆ Meq becomes a binless OOM over sample points X = {s2 n}N n=1 and can be estimated from data by Algorithm 2, where the feature functions can be selected as indicator functions, radial basis functions or other commonly used activation functions for singlelayer neural networks in order to digest adequate dynamic information from observation data. The binless algorithm presented here can be efficiently implemented in a linear computational complexity O(N), and is applicable to more general cases where observations are strings, graphs or other structured variables. Unlike the other spectral algorithms for continuous data, it does not require 5 Algorithm 2 Procedure for learning binless equilibrium OOMs INPUT: Observation trajectories generated by a stochastic process {xt} in O ⊂Rd OUTPUT: Binless OOM ˆ M = (ˆω, {ˆΞ(x)}x∈O, ˆσ) 1: Construct feature functions φ1 : RLd 7→RD1 and φ2 : RLd 7→RD2 with D1, D2 ≥m. 2: Calculate ˆ¯φ1, ˆ¯φ2, ˆC1,2 by (2) and (3). 3: Compute F1 = UΣ−1 ∈RD1×m and F2 = V ∈RD2×m from the truncated singular value decomposition ˆC1,2 ≈UΣV⊤. 4: Compute ˆσ, ˆω and ˆΞ(x) = P z∈X ˆ Wzδz (x) by (8), (16) and (21), where ˆΞ(O) = ´ O dx ˆΞ(x) = P z∈X ˆ Wz. that the observed dynamics coincides with some parametric model defined by feature functions. Lastly but most importantly, as stated in the following theorem, this algorithm can be used to consistently extract static and kinetic properties of a dynamic system in equilibrium from nonequilibrium data (see Appendix A.3 for proof): Theorem 3. Provided that the observation space O is a closed set in Rd, feature functions φ1, φ2 are bounded on OL, and Assumptions 1-3 hold, the binless OOM given by Algorithm 2 satisfies E h g (x1:r) | ˆ Meq i p→E∞[g (xt+1:t+r)] (22) with E h g (x1:r) | ˆ Meq i = X x1:r∈X r g (x1:r) ˆω ˆ Wz1 . . . ˆ Wzr ˆσ (23) (i) for all continuous functions g : Or 7→R. (ii) for all bounded and Borel measurable functions g : Or 7→R, if there exist positive constants ¯ξ and ξ so that ∥Ξ (x)∥≤¯ξ and limt→∞P (xt+1:t+r = z1:r) ≥ξ for all x ∈O and z1:r ∈Or. 4.3 Comparison with related methods It is worth pointing out that the spectral learning investigated in this section is an ideal tool for analysis of dynamic properties of stochastic processes, because the related quantities, such as stationary distributions, principle components and time-lagged correlations, can be easily computed from parameters of discrete OOMs or binless OOMs. For many popular nonlinear dynamic models, including Gaussian process state-space models [17] and recurrent neural networks [19], the computation of such quantities is intractable or time-consuming. The major disadvantage of spectral learning is that the estimated OOMs are usually only “approximately valid” and possibly assign “negative probabilities” to some observation sequences. So it is difficult to apply spectral methods to prediction, filtering and smoothing of signals where the Bayesian inference is involved. 5 Applications In this section, we evaluate our algorithms on two diffusion processes and the molecular dynamics of alanine dipeptide, and compare them to several alternatives. The detailed settings of simulations and algorithms are provided in Appendix B. Brownian dynamics Let us consider a one-dimensional diffusion process driven by the Brownian dynamics dxt = −∇V (xt)dt + p 2β−1dWt (24) with observations generated by yt =  1, xt ∈I 0, xt ∈II 6 True OOM Empirical HMM EQ-OOM ݔ trajectory length trajectory length ݔ histogram (a) (b) (c) (d) I II Figure 2: Comparison of modeling methods for a one-dimensional diffusion process. (a) Potential function. (b) Estimates of the difference between equilibrium probabilities of I and II given by the traditional OOM, HMM and the equilibrium OOM (EQ-OOM) obtained from the proposed algorithm with O = {I, II}. (c) Estimates of the probability difference given by the empirical estimator, HMM and the proposed binless OOM with O = [0, 2]. (d) Stationary histograms of {xt} with 100 uniform bins estimated from trajectories with length 50. The length of each trajectory is T = 50 ∼1000 and the number of trajectories is [105/T]. Error bars are standard deviations over 30 independent experiments. The potential function V (x) is shown in Fig. 2(a), which contains two potential wells I, II. In this example, all simulations are performed by starting from a uniform distribution on [0, 0.2], which implies that simulations are highly nonequilibrium and it is difficult to accurately estimate the equilibrium probabilities ProbI = E∞[1xt∈I] = E∞[yt] and ProbII = E∞[1xt∈II] = 1 −E∞[yt] of the two potential wells from the simulation data. We first utilize the traditional spectral learning without enforcing equilibrium, expectation–maximization based HMM learning and the proposed discrete spectral algorithm to estimate ProbI and ProbII based on {yt}, and the estimation results with different simulation lengths are summarized in Fig. 2(b). It can be seen that, in contrast to with the other methods, the spectral algorithm for equilibrium OOMs effectively reduce the statistical bias in the nonequilibrium data, and achieves statistically correct estimation at T = 300. Figs. 2(c) and 2(d) plot estimates of stationary distribution of {xt} obtained from {xt} directly, where the empirical estimator calculates statistics through averaging over all observations. In this case, the proposed binless OOM significantly outperform the other methods, and its estimates are very close to true values even for extremely small short trajectories. Fig. 3 provides an example of a two-dimensional diffusion process. The dynamics of this process can also be represented in the form of (24) and the potential function is shown in Fig. 3(a). The goal of this example is to estimate the first time-structure based independent component wTICA [30] of this process from simulation data. Here wTICA is a kinetic quantity of the process and is the solution to the generalized eigenvalue problem Cτw = λC0w with the largest eigenvalue, where C0 is the covariance matrix of {xt} in equilibrium and Cτ = E∞  xtx⊤ t+τ  −E∞[xt] E∞  x⊤ t  is the equilibrium time-lagged covariance matrix. The simulation data are also nonequilibrium with all simulations starting from the uniform distribution on [−2, 0] × [−2, 0]. Fig. 3(b) displays the estimation errors of wTICA obtained from different learning methods, which also demonstrates the superiority of the binless spectral method. Alanine dipeptide Alanine dipeptide is a small molecule which consists of two alanine amino acid units, and its configuration can be described by two backbone dihedral angles. Fig. 4(a) shows the potential profile of the alanine dipeptide with respect to the two angles, which contains five metastable 7 coord 1 coord 2 trajectory length error of (a) (b) Empirical HMM EQ-OOM Figure 3: Comparison of modeling methods for a two-dimensional diffusion process. (a) Potential function. (b) Estimation error of wTICA ∈R2 of the first TIC with lag time 100. Length of each trajectory is T = 200 ∼2500 and the number of trajectories is [105/T]. Error bars are standard deviations over 30 independent experiments. angle 1 angle 2 simulation time (ns) error of (a) (b) Empirical HMM EQ-OOM I I II II III IV V V Figure 4: Comparison of modeling methods for molecular dynamics of alanine dipeptide. (a) Reduced free energy. (b) Estimation error of π, where the horizontal axis denotes the total simulation time T × I. Length of each trajectory is T = 10ns and the number of trajectories is I = 150 ∼1500. Error bars are standard deviations over 30 independent experiments. states {I, II, III, IV, V}. We perform multiple short molecular dynamics simulations starting from the metastable state IV, where each simulation length is 10ns, and utilizes different methods to approximate the stationary distribution π = (ProbI, ProbII, . . . , ProbV) of the five metastable states. As shown in Fig. 4(b), the proposed binless algorithm yields lower estimation error compared to each of the alternatives. 6 Conclusion In this paper, we investigated the statistical properties of the general spectral learning procedure for nonequilibrium data, and developed novel spectral methods for learning equilibrium dynamics from nonequilibrium (discrete or continuous) data. The main ideas of the presented methods are to correct the model parameters by the equilibrium constraint and to handle continuous observations in a binless manner. Interesting directions of future research include analysis of approximation error with finite data size and applications to controlled systems. Acknowledgments This work was funded by Deutsche Forschungsgemeinschaft (SFB 1114) and European Research Council (starting grant “pcCells”). References [1] H. Jaeger, “Observable operator models for discrete stochastic time series,” Neural Comput., vol. 12, no. 6, pp. 1371–1398, 2000. [2] M.-J. Zhao, H. Jaeger, and M. Thon, “A bound on modeling error in observable operator models and an associated learning algorithm,” Neural Comput., vol. 21, no. 9, pp. 2687–2712, 2009. [3] H. Jaeger, “Discrete-time, discrete-valued observable operator models: a tutorial,” tech. rep., International University Bremen, 2012. [4] M. L. Littman, R. S. Sutton, and S. Singh, “Predictive representations of state,” in Adv. Neural. Inf. Process. Syst. 14 (NIPS 2001), pp. 1555–1561, 2001. 8 [5] S. Singh, M. James, and M. Rudary, “Predictive state representations: A new theory for modeling dynamical systems,” in Proc. 20th Conf. Uncertainty Artif. Intell. (UAI 2004), pp. 512–519, 2004. [6] E. Wiewiora, “Learning predictive representations from a history,” in Proc. 22nd Intl. Conf. on Mach. Learn. (ICML 2005), pp. 964–971, 2005. [7] D. Hsu, S. M. Kakade, and T. Zhang, “A spectral algorithm for learning hidden Markov models,” in Proc. 22nd Conf. Learning Theory (COLT 2009), pp. 964–971, 2005. [8] S. Siddiqi, B. Boots, and G. Gordon, “Reduced-rank hidden Markov models,” in Proc. 13th Intl. Conf. Artif. Intell. Stat. (AISTATS 2010), vol. 9, pp. 741–748, 2010. [9] A. Beimel, F. Bergadano, N. H. Bshouty, E. Kushilevitz, and S. Varricchio, “Learning functions represented as multiplicity automata,” J. ACM, vol. 47, no. 3, pp. 506–530, 2000. [10] M. Thon and H. Jaeger, “Links between multiplicity automata, observable operator, models and predictive state representations — a unified learning framework,” J. Mach. Learn. Res., vol. 16, pp. 103–147, 2015. [11] J.-H. Prinz, H. Wu, M. Sarich, B. Keller, M. Senne, M. Held, J. D. Chodera, C. Schütte, and F. Noé, “Markov models of molecular kinetics: Generation and validation,” J. Chem. Phys., vol. 134, p. 174105, 2011. [12] G. R. Bowman, V. S. Pande, and F. Noé, An introduction to Markov state models and their application to long timescale molecular simulation. Springer, 2013. [13] A. Ruttor, P. Batz, and M. Opper, “Approximate Gaussian process inference for the drift function in stochastic differential equations,” in Adv. Neural. Inf. Process. Syst. 26 (NIPS 2013), pp. 2040–2048, 2013. [14] N. Schaudinnus, B. Bastian, R. Hegger, and G. Stock, “Multidimensional langevin modeling of nonoverdamped dynamics,” Phys. Rev. Lett., vol. 115, no. 5, p. 050602, 2015. [15] L. R. Rabiner, “A tutorial on hidden markov models and selected applications in speech recognition,” Proc. IEEE, vol. 77, no. 2, pp. 257–286, 1989. [16] F. Noé, H. Wu, J.-H. Prinz, and N. Plattner, “Projected and hidden markov models for calculating kinetics and metastable states of complex molecules,” J. Chem. Phys., vol. 139, p. 184114, 2013. [17] R. D. Turner, M. P. Deisenroth, and C. E. Rasmussen, “State-space inference and learning with Gaussian processes,” in Proc. 13th Intl. Conf. Artif. Intell. Stat. (AISTATS 2010), pp. 868–875, 2010. [18] S. S. T. S. Andreas Svensson, Arno Solin, “Computationally efficient bayesian learning of Gaussian process state space models,” in Proc. 19th Intl. Conf. Artif. Intell. Stat. (AISTATS 2016), pp. 213–221, 2016. [19] S. Hochreiter and J. Schmidhuber, “Long short-term memory,” Neural Comp., vol. 9, no. 8, pp. 1735–1780, 1997. [20] H. Wu, J.-H. Prinz, and F. Noé, “Projected metastable markov processes and their estimation with observable operator models,” J. Chem. Phys., vol. 143, no. 14, p. 144101, 2015. [21] M. Shirts and V. S. Pande, “Screen savers of the world unite,” Science, vol. 290, pp. 1903–1904, 2000. [22] T.-K. Huang and J. Schneider, “Spectral learning of hidden Markov models from dynamic and static data,” in Proc. 30th Intl. Conf. on Mach. Learn. (ICML 2013), pp. 630–638, 2013. [23] M. K. Cowles and B. P. Carlin, “Markov chain monte carlo convergence diagnostics: a comparative review,” J. Am. Stat. Assoc., vol. 91, no. 434, pp. 883–904, 1996. [24] N. Jiang, A. Kulesza, and S. Singh, “Improving predictive state representations via gradient descent,” in Proc. 30th AAAI Conf. Artif. Intell. (AAAI 2016), 2016. [25] H. Jaeger, “Modeling and learning continuous-valued stochastic processes with OOMs,” Tech. Rep. GMD-102, German National Research Center for Information Technology (GMD), 2001. [26] B. Boots, S. M. Siddiqi, G. Gordon, and A. Smola, “Hilbert space embeddings of hidden markov models,” in Proc. 27th Intl. Conf. on Mach. Learn. (ICML 2010), 2010. [27] M. Rosencrantz, G. Gordon, and S. Thrun, “Learning low dimensional predictive representations,” in Proc. 22nd Intl. Conf. on Mach. Learn. (ICML 2004), pp. 88–95, ACM, 2004. [28] B. Boots, Spectral Approaches to Learning Predictive Representations. PhD thesis, Carnegie Mellon University, 2012. [29] H. Jaeger, M. Zhao, and A. Kolling, “Efficient estimation of OOMs,” in Adv. Neural. Inf. Process. Syst. 18 (NIPS 2005), pp. 555–562, 2005. [30] G. Perez-Hernandez, F. Paul, T. Giorgino, G. De Fabritiis, and F. Noé, “Identification of slow molecular order parameters for markov model construction,” J. Chem. Phys., vol. 139, no. 1, p. 015102, 2013. 9
2016
97
6,560
Dimension-Free Iteration Complexity of Finite Sum Optimization Problems Yossi Arjevani Weizmann Institute of Science Rehovot 7610001, Israel yossi.arjevani@weizmann.ac.il Ohad Shamir Weizmann Institute of Science Rehovot 7610001, Israel ohad.shamir@weizmann.ac.il Abstract Many canonical machine learning problems boil down to a convex optimization problem with a finite sum structure. However, whereas much progress has been made in developing faster algorithms for this setting, the inherent limitations of these problems are not satisfactorily addressed by existing lower bounds. Indeed, current bounds focus on first-order optimization algorithms, and only apply in the often unrealistic regime where the number of iterations is less than O(d/n) (where d is the dimension and n is the number of samples). In this work, we extend the framework of Arjevani et al. [3, 5] to provide new lower bounds, which are dimension-free, and go beyond the assumptions of current bounds, thereby covering standard finite sum optimization methods, e.g., SAG, SAGA, SVRG, SDCA without duality, as well as stochastic coordinate-descent methods, such as SDCA and accelerated proximal SDCA. 1 Introduction Many machine learning tasks reduce to Finite Sum Minimization (FSM) problems of the form min w∈Rd F(w) := 1 n n X i=1 fi(w), (1) where fi are L-smooth and µ-strongly convex. In recent years, a major breakthrough was made when a linear convergence rate was established for this setting (SAG [16] and SDCA [18]), and since then, many methods have been developed to achieve better convergence rate. However, whereas a large body of literature is devoted for upper bounds, the optimal convergence rate with respect to the problem parameters is not quite settled. Let us discuss existing lower bounds for this setting, along with their shortcomings, in detail. One approach to obtain lower bounds for this setting is to consider the average of carefully handcrafted functions defined on n disjoint sets of variables. This approach was taken by Agarwal and Bottou [1] who derived a lower bound for FSM under the first-order oracle model (see Nemirovsky and Yudin [12]). In this model, optimization algorithms are assumed to access a given function by issuing queries to an external first-order oracle procedure. Upon receiving a query point in the problem domain, the oracle reports the corresponding function value and gradient. The construction used by Agarwal and Bottou consisted of n different quadratic functions which are adversarially determined based on the first-order queries being issued during the optimization process. The resulting bound in this case does not apply to stochastic algorithms, rendering it invalid for current state-of-the-art methods. Another instantiation of this approach was made by Lan [10] who considered n disjoint copies of a quadratic function proposed by Nesterov in [13, Section 2.1.2]. This technique is based on the assumption that any iterate generated by the optimization algorithm lies in the span of previously acquired gradients. 30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. This assumption is rather permissive and is satisfied by many first-order algorithms, e.g., SAG and SAGA [6]. However, the lower bound stated in the paper faces limitations in a few aspects. First, the validity of the derived bound is restricted to d/n iterations. In many datasets, even if d, n are very large, d/n is quite small. Accordingly, the admissible regime of the lower bound is often not very interesting. Secondly, it is not clear how the proposed construction can be expressed as a Regularized Loss Minimization (RLM) problem with linear predictors (see Section 4). This suggests that methods specialized in dual RLM problems, such as SDCA and accelerated proximal SDCA [19], can not be addressed by this bound. Thirdly, at least the formal theorem requires assumptions (such as querying in the span of previous gradients, or sampling from a fixed distribution over the individual functions), which are not met by some state-of-the-art methods, such as coordinate descent methods, SVRG [9] and without-replacements sampling algorithms [15]. Another relevant approach in this setting is to model the functional form of the update rules. This approach was taken by Arjevani et al. [3] where new iterates are assumed to be generated by a recurrent application of some fixed linear transformation. Although this method applies to SDCA and produces a tight lower bound of ˜Ω((n + 1/λ) ln(1/ϵ)), its scope is rather limited. In recent work, Arjevani and Shamir [5] considerably generalized parts of this framework by introducing the class of first-order oblivious optimization algorithms, whose step sizes are scheduled regardless of the function under consideration, and deriving tight lower bounds for general smooth convex minimization problems (note that obliviousness rules out, e.g., quasi-Newton methods where gradients obtained at each iteration are multiplied by matrices which strictly depend on the function at hand, see Definition 2 below). In this work, building upon the framework of oblivious algorithms, we take a somewhat more abstract point of view which allows us to easily incorporate coordinate-descent methods, as well as stochastic algorithms. Our framework subsumes the vast majority of optimization methods for machine learning problems, in particular, it applies to SDCA, accelerated proximal SDCA, SDCA without duality [17], SAG, SAGA, SVRG and acceleration schemes [7, 11]), as well as to a large number of methods for smooth convex optimization (i.e., FSM with n = 1), e.g., (stochastic) Gradient descent (GD), Accelerated Gradient Descent (AGD, [13]), the Heavy-Ball method (HB, [14]) and stochastic coordinate descent. Under this structural assumption, we derive lower bounds for FSM (1), according to which the iteration complexity, i.e., the number of iterations required to obtain an ϵ-optimal solution in terms of function value, is at least1 ˜Ω(n + p n(κ −1) ln(1/ϵ)), (2) where κ denotes the condition number of F(w) (that is, the smoothness parameter over the strong convexity parameter). To the best of our knowledge, this is the first tight lower bound to address all the algorithms mentioned above. Moreover, our bound is dimension-free and thus applies to settings in machine learning which are not covered in the current literature (e.g., when n is Ω(d)). We also derive a dimension-free nearly-optimal lower bound for smooth convex optimization of Ω  (L(δ −2)/ϵ)1/δ , for any δ ∈(2, 4), which holds for any oblivious stochastic first-order algorithm. It should be noted that our lower bounds remain valid under any source of randomness which may be introduced into the optimization process (by the oracle or by the optimization algorithm). In particular, our bounds hold in cases where the variance of the iterates produced by the algorithm converges to zero, a highly desirable property of optimization algorithms in this setting. Two implications can be readily derived from this lower bound. First, obliviousness forms a real barrier for optimization algorithms, and whereas non-oblivious algorithms may achieve a super-linear convergence rate at later stages of the optimization process (e.g., quasi-newton), or practically zero error after Θ(d) iterations (e.g. Center of Gravity method, MCG), oblivious algorithms are bound to linear convergence indefinitely, as demonstrated by Figure 1. We believe that this indicates that a major progress can be made in solving machine learning problems by employing non-oblivious methods for settings where d ≪n. It should be further noted that another major advantage of 1Following standard conventions, here tilde notation hides logarithmic factors in the parameters of a given class of optimization problems, e.g., smoothness parameter and number of components. 2 non-oblivious algorithms is their ability to obtain optimal convergence rates without an explicit specification of the problem parameters (e.g., [5, Section 4.1]). Number of Iterations 0 500 1000 1500 2000 2500 Error 10-8 10-6 10-4 10-2 100 102 104 GD AGD HB L-BFGS Lower Bound Figure 1: Comparison of first-order methods based on the function used by Nesterov in [13, Section 2.1.2] over R500. Whereas L-BFGS (with a memory size of 100) achieves a super-linear convergence rate after Θ(d) iterations, the convergence rate of GD, AGD and HB remains linear as predicted by our bound. Secondly, many practitioners have noticed that oftentimes sampling the individual functions without replacement at each iteration performs better than sampling with replacement (e.g., [18, 15], see also [8, 20]). The fact that our lower bound holds regardless of how the individual functions are sampled and is attained using with-replacement sampling (e.g., accelerated proximal SDCA), implies that, in terms of iteration complexity, one should expect to gain no more than log factors in the problem parameters when using one method over the other (it is noteworthy that when comparing with and without replacement samplings, apart from iteration complexity, other computational resources, such as limited communication in distributed settings [4], may significantly affect the overall runtime). 2 Framework 2.1 Motivation Due to difficulties which arise when studying the complexity of general optimization problems under discrete computational models, it is common to analyze the computational hardness of optimization algorithms by modeling the way a given algorithm interacts with the problem instances (without limiting its computational resources). In the seminal work of Nemirovsky and Yudin [12], it is shown that algorithms which access the function at hand exclusively by querying a first-order oracle require at least ˜Ω min  d, √κ ln(1/ϵ)  , µ > 0 (3) ˜Ω(min{d ln(1/ϵ), p L/ϵ}), µ = 0 oracle calls to obtain an ϵ-optimal solution, where L and µ are the smoothness and the strong convexity parameter, respectively (note that, here and throughout this section we refer to FSM problems with n = 1). This lower bound is tight and its dimension-free part is attained by Nesterov’s well-known accelerated gradient descent, and by MCG otherwise. The fact that this approach is based on information considerations alone is very appealing and renders it valid for any first-order algorithm. However, discarding the resources needed for executing a given algorithm, in particular the per-iteration cost (in time and space), the complexity boundaries drawn by this approach are too crude from a computational point of view. Indeed, the per-iteration cost of MCG, the only method known with oracle complexity of O(d ln(1/ϵ)), is excessively high, rendering it prohibitive for high-dimensional problems. We are thus led into the question of how well can a given optimization algorithm perform assuming that its per-iteration cost is constrained? Arjevani et al. [3, 5] adopted a more structural approach 3 where instead of modeling how information regarding the function at hand is being collected, one models the update rules according to which iterates are being generated. Concretely, they proposed the framework of p-CLI optimization algorithms where, roughly speaking, new iterates are assumed to form linear combinations of the previous p iterates and gradients, and the coefficients of these linear combinations are assumed to be either stationary (i.e., remain fixed throughout the optimization process) or oblivious. Based on this structural assumption, they showed that the iteration complexity of minimizing smooth and strongly convex functions is ˜Ω(√κ ln(1/ϵ)). The fact that this lower bound is stronger than (3), in the sense that it does not depend on the dimension, confirms that controlling the functional form of the update rules allows one to derive tighter lower bounds. The framework of p-CLIs forms the nucleus of our formulation below. 2.2 Definitions When considering lower bounds one must be very precise as to the scope of optimization algorithms to which they apply. Below, we give formal definitions for oblivious stochastic CLI optimization algorithms and iteration complexity (which serves as a crude proxy for their computational complexity). Definition 1 (Class of Optimization Problems). A class of optimization problems is an ordered triple (F, I, Of), where F is a family of functions defined over some domain designated by domF, I is the side-information given prior to the optimization process and Of is a suitable oracle which upon receiving x ∈domF and θ in the parameter set Θ, returns Of(x, θ) ⊆dom(F) for a given f ∈F (we shall omit the subscript in Of when f is clear from the context). For example, in FSM, F contains functions as defined in (1), the side-information contains the smoothness parameter L, the strong convexity parameter µ and the number of components n (although it carries a crucial effect on the iteration complexity, e.g., [5], in this work, we shall ignore the sideinformation and assume that all the parameters of the class are given). We shall assume that both first-order and coordinate-descent oracles (see 10,11 below) are allowed to be used during the optimization process. Formally, this is done by introducing an additional parameter which indicates which oracle is being addressed. This added degree of freedom does not violate our lower bounds. We now turn to rigorously define CLI optimization algorithms. Note that, compared with the definition of first-order p-CLIs provided in [5], here, in order to handle coordinate-descent and first-order oracles in a unified manner, we base our formulation on general oracle procedures. Definition 2 (CLI). An optimization algorithm is called a Canonical Linear Iterative (CLI) optimization algorithm over a class of optimization problems (F, I, Of), if given an instance f ∈F and initialization points {w(0) i }i∈J ⊆dom(F), where J is some index set, it operates by iteratively generating points such that for any i ∈J , w(k+1) i ∈ X j∈J Of  w(k) j ; θ(k) ij  , k = 0, 1, . . . (4) holds, where θ(k) ij ∈Θ are parameters chosen, stochastically or deterministically, by the algorithm, possibly depending on the side-information. If the parameters do not depend on previously acquired oracle answers, we say that the given algorithm is oblivious. Lastly, algorithms with |J | ≤p, for some p ∈N, are denoted by p-CLI. Note that assigning different weights to different terms in (4) can be done through θ(k) ij ∈Θ (e.g., oracle 10 below). This allows a succinct definition for obliviousness. Lastly, we define iteration complexity. Definition 3 (Iteration Complexity). The iteration complexity of a given CLI w.r.t. a given problem class (F, I, Of) is defined to be the minimal number of iterations K such that E[f(w(k) 1 ) − min w∈domF f(w)] < ϵ, ∀f ∈F, k ≥K where the expectation is taken over all the randomness introduced into the optimization process (choosing w(k) 1 merely serves as a convention and is not necessary for our bounds to hold). 4 2.3 Proof Technique - Deriving Lower Bounds via Approximation Theory Consider the following parametrized class of L-smooth and µ-strongly convex optimization problems, min w∈R fη(w) := ηw2 2 −w, η ∈[µ, L]. (5) Clearly, the minimizer of fη are w∗(η) := 1/η, with norm bounded by 1/µ. For simplicity, we will consider a special case, namely, vanilla gradient descent (GD) with step size 1/L, which produces new iterates as follows w(k+1)(η) = w(k)(η) −1 Lf ′ η(w(k)(η)) =  1 −η L  w(k)(η) + 1 L. Setting the initialization point to be w(0)(η) = 0, we derive an explicit expression for w(k)(η): w(k)(η) = 1 L k−1 X i=0 (−1)i  k i + 1  (η/L)i. (6) 1 1.5 2 2.5 3 3.5 4 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Approximating polynomials GD, w(1)(2) GD, w(2)(2) GD, w(3)(2) GD, w(4)(2) AGD, w(1)(2) AGD, w(2)(2) AGD, w(3)(2) AGD, w(4)(2) 1/2 Figure 2: The first four iterates of GD and AGD, which form polynomials in η, the parameter of problem (5), are compared to 1/η over [1, 4]. It turns out that each w(k)(η) forms a univariate polynomial whose degree is at most k. Furthermore, since fη(w) are L-smooth µ-strongly convex for any η ∈[µ, L], standard convergence analysis for GD (e.g., [13], Theorem 2.1.14) guarantees that |w(k)(η) −w∗(η)| ≤(1 −2/(1 + κ)) k 2 |w∗(η)|, where κ denotes the condition number. Substituting Equation (6) for w(k)(η) yields max η∈[µ,L] 1 L k−1 X i=0 (−1)i  k i + 1  (η/L)i −1/η ≤1 µ  1 − 2 1 + κ  k 2 . Thus, we see that the faster the convergence rate of a given optimization algorithm is, the better the induced sequence of polynomials (w(k)(η))k≥0 approximate 1/η w.r.t. the maximum norm ∥· ∥L∞([µ,L]) over [µ, L]. In Fig. 2, we compare the first 4 polynomials induced by GD and AGD. Not surprisingly, AGD polynomials approximates 1/η better than those of GD. Now, one may ask, assuming that iterates of a given optimization algorithm A for (5) can be expressed as polynomials sk(η) whose degree does not exceed the iteration number, just how fast can these iterates converge to the minimizer? Since the convergence rate is bounded from below by ∥sk(η) −1/η∥L∞([µ,L]), we may address the following question instead: min s(η)∈Pk ∥s(η) −1/η∥L∞([µ,L]), (7) where Pk denotes the set of univariate polynomials whose degree does not exceed k. Problem (7) and other related settings are main topics of study in approximation theory. Accordingly, our technique 5 for proving lower bounds makes an extensive use of tools borrowed from this area. Specifically, in a paper from 1899 [21] Chebyshev showed that min s(η)∈Pk s(η) − 1 η −c L∞([−1,1]) ≥(c − √ c2 −1)k c2 −1 , c > 1, (8) by which we derive the following theorem (see Appendix A.1 for a detailed proof). Theorem 1. The number of iterations required by A to get an ϵ-optimal solution is ˜Ω(√κ ln(1/ϵ)). In the following sections, we apply oblivious CLI on various parameterized optimization problems so that the resulting iterates are polynomials in the problem parameters. We then apply arguments similar to the above A similar reduction, from optimization problems to approximation problems, was used before in a few contexts to analyze the iteration complexity of deterministic CLIs (e.g., [5, Section 3], see also Conjugate Gradient convergence analysis [14]). But, what if we allow random algorithms? should we expect the same iteration complexity? To answer this, we use Yao’s minimax principle according to which the performance of a given stochastic optimization algorithm w.r.t. its worst input are bounded from below by the performance of the best deterministic algorithm w.r.t. distributions over the input space. Thus, following a similar reduction one can show that the convergence rate of stochastic algorithms is bounded from below by min s(η)∈Pk Z L µ |s(η) −1/η| 1 L −µdη. (9) That is, a lower bound for the stochastic case can be attained by considering an approximation problem w.r.t. weighted L1 with the uniform distribution over [µ, L]. Other approximation problems considered in this work involve L2-norm and different distributions. We provide a schematic description of our proof technique in Scheme 2.1. SCHEME 2.1 FROM OPTIMIZATION PROBLEMS TO APPROXIMATION PROBLEMS GIVEN A CLASS OF FUNCTIONS F, A SUITABLE ORACLE O AND A SEQUENCE OF SETS OF FUNCTION Sk OVER SOME PARAMETERS SET H. CHOOSE A SUBSET OF FUNCTIONS {fη ∈F|η ∈H}, S.T. wk(η) ∈Sk. COMPUTE THE MINIMIZER w∗(η) FOR ANY fη BOUND FROM BELOW THE BEST APPROXIMATION FOR w∗(η) W.R.T. Sk AND A NORM ∥· ∥, I.E., min{∥s(η) −w∗(η)∥| s(η) ∈Sk} 3 Lower Bound for Finite Sums Minimization Methods Having described our analytic approach, we now turn to present some concrete applications, starting with iteration complexity lower bounds in the context of FSM problems (1). In what follows, we derive a lower bound on the iteration complexity of oblivious (possibly stochastic) CLI algorithms equipped with first-order and coordinate-descent oracles for FSM. Strictly speaking, we focus on optimization algorithms equipped with both generalized first order oracle, O(w; A, B, c, j) = A∇fj(w) + Bw + c, A, B ∈Rd×d, c ∈Rd, j ∈[n], (10) and steepest coordinate-descent oracle O(w; i, j) = w + t∗ei, t∗∈argmin t∈R fj(w1, . . . , wi−1, wi + t, wi+1, . . . , wd), j ∈[n], (11) where ei denotes the i’th unit vector. We remark that coordinate-descent steps w.r.t. partial gradients can be implemented using (10) by setting A to be some principal minor of the unit matrix. It should be further noted that our results below hold for scenarios where the optimization algorithm is free to call a different oracle at different iterations. First, we sketch the proof of the lower bound for deterministic oblivious CLIs. Following Scheme 2.1, we restrict our attention to a parameterized subset of problems. We assume2 d > 1 and denote by 2Clearly, in order to derive a lower bound for coordinate-descent algorithms, we must assume d > 1. If only a first-order oracle is allowed, then the same lower bound as in Theorem 2 can be derived for d = 1. 6 HFSM the set of all (η1, . . . , ηn) ∈Rn such that all the entries equal −(L −µ)/2, except for some j ∈[n], for which ηj ∈[−(L −µ)/2, (L −µ)/2]. Now, given η := (η1, . . . , ηn) ∈HFSM we define Fη(w) := 1 n n X i=1 1 2w⊤Qηiw −q⊤w  , where (12) Qηi :=        L+µ 2 ηi ηi L+µ 2 µ ... µ        , q :=        Rµ √ 2 Rµ √ 2 0 ... 0        . It is easy to verify that the minimizers of (12) are w∗(η) =   Rµ √ 2  L+µ 2 + 1 n Pn i=1 ηi , Rµ √ 2  L+µ 2 + 1 n Pn i=1 ηi , 0, . . . , 0   ⊤ . (13) We would like to show that the coordinates of the iterates of deterministic oblivious CLIs, which minimize Fη using first-order and coordinate-descent oracles, form multivariate polynomials in η of total degrees (the maximal sum of powers over all the terms) which does not exceed the iteration number. Indeed, if the coordinates of w(k) i (η) are multivariate polynomial in η of total degree at most k, then the coordinates of the vectors returned by both oracles First-order oracle: O(w(k) j ; A, B, c, j) = A(Qηjw(k) i −q) + Bw(k) i + c, (14) Coordinate-descent oracle: O(w(k) j ; i, j) = I −(1/(Qηj)ii)ei(Qηj)i,∗  w(k) i −qi/(Qηj)iiei, are multivariate polynomials of total degree of at most k + 1, as all the parameters (A, B, C, i and j) do not depend on η (due to obliviousness) and the rest of the terms (Qηj, q, I, 1/(Qηj)ii, (Qηj)i,∗, ei and qi) are either linear in ηj or constants. Now, since the next iterates are generated simply by summing up all the oracle answers, they also form multivariate polynomials of total degree of at most k + 1. Thus, denoting the first coordinate of w(k) 1 (η) by s(η) and using Inequality (8), we get the following bound max η∈HFSM ∥w(k) 1 (η) −w∗(η)∥≥ s(η) − Rµ √ 2  L+µ 2 + 1 n Pn i=1 ηi  L∞([µ,L]) (15) ≥Ω(1)   q κ−1 n + 1 −1 q κ−1 n + 1 + 1   k/n , (16) where Ω(1) designates a constant which does not depend on k (but may depend on the problem parameters). Lastly, this implies that for any deterministic oblivious CLI and any iteration number, there exists some η ∈HFSM such that the convergence rate of the algorithm, when applied on Fη, is bounded from below by Inequality (16). We note that, as opposed to other related lower bounds, e.g., [10], our proof is non-constructive. As discussed in subsection 2.3, this type of analysis can be extended to stochastic algorithms by considering (15) w.r.t. other norms such as weighted L1-norm. We now arrive at the following theorem whose proof, including the corresponding logarithmic factors and constants, can be found in Appendix A.2. Theorem 2. The iteration complexity of oblivious (possibly stochastic) CLIs for FSM (1) equipped with first-order (10) and coordinate-descent oracles (11), is bounded from below by ˜Ω(n + p n(κ −1) ln(1/ϵ)). The lower bound stated in Theorem 2 is tight and is attained by, e.g., SAG combined with an acceleration scheme (e.g., [11]). Moreover, as mentioned earlier, our lower bound does not depend on the problem dimension (or equivalently, holds for any number of iterations, regardless of d and 7 n), and covers coordinate descent methods with stochastic or deterministic coordinate schedule (in the special case where n = 1, this gives a lower bound for minimizing smooth and strongly convex functions by performing steepest coordinate descent steps). Also, our bound implies that using mini-batches for tackling FSM does not reduce the overall iteration complexity. Lastly, it is noteworthy that the n term in the lower bound above holds for any algorithm accompanied with an incremental oracle, which grants access to at most one individual function each time. We also derive a nearly-optimal lower bound for smooth non-strongly convex functions for the more restricted setting of n = 1 and first-order oracle. The parameterized subset of functions we use (see Scheme 2.1) is gη(x) := η 2 ∥x∥2 −Rηe⊤ 1 x, η ∈(0, L]. The corresponding minimizer (as a function of η) is x∗(η) = Re1, and in this case we seek to approximate it w.r.t. L2-norm using k-degree univariate polynomials whose constant term vanishes. The resulting bound is dimension-free and improves upon other bounds for this setting (e.g. [5]) in that it applies to deterministic algorithms, as well as to stochastic algorithms (see A.3 for proof). Theorem 3. The iteration complexity of any oblivious (possibly stochastic) CLI for L-smooth convex functions equipped with a first-order oracle, is bounded from below by Ω  (L(δ −2)/ϵ)1/δ , δ ∈(2, 4). 4 Lower Bound for Dual Regularized Loss Minimization with Linear Predictors The form of functions (12) discussed in the previous section does not readily adapt to general RLM problems with linear predictors, i.e., min w∈Rd P(w) := 1 n n X i=1 φi(⟨xi, w⟩) + λ 2 ∥w∥2 , (17) where the loss functions φi are L-smooth and convex, the samples x1, . . . , xn are d-dimensional vectors in Rd and λ is some positive constant. Thus, dual methods which exploit the added structure of this setting through the dual problem [18], min α∈Rn D(α) = 1 n n X i=1 φ∗ i (−αi) + λ 2 1 λn n X i=1 xiαi 2 , (18) such as SDCA and accelerated proximal SDCA, are not covered by Theorem 2. Accordingly, in this section, we address the iteration complexity of oblivious (possibly stochastic) CLI algorithms equipped with dual RLM oracles: O(α; t, j) = α + t∇jD(α)ej, t ∈R, j ∈[n], (19) O(α; j) = α + t∗ej, t∗= argmin t∈R D(α1, . . . , αj−1, αj + t, αj+1, . . . , αd), j ∈[n], Following Scheme 2.1, we first describe the relevant parametrized subset of RLM problems. For the sake of simplicity, we assume that n is even (the proof for odd n holds mutatis mutandis). We denote by HRLM the set of all (ψ1, . . . , ψn/2) ∈Rn/2 such that all entries are 0, except for some j ∈[n/2], for which ψj ∈[−π/2, π/2]. Now, given ψ ∈HRLM, we set Pψ (defined in 17) as follows φi(w) = 1 2(w + 1)2, xψ,i = cos(ψ(i+1)/2)ei + sin(ψ(i+1)/2)ei+1 i is odd ei o.w. . We state below the corresponding lower bound, whose proof, including logarithmic factors and constants, can be found in Appendix A.4. Theorem 4. The iteration complexity of oblivious (possibly stochastic) CLIs for RLM (17) equipped with dual RLM oracles (19) is bounded from below by ˜Ω(n + p nL/λ ln(1/ϵ)). This bound is tight w.r.t. the class of oblivious CLIs and is attained by accelerated proximal SDCA. As mentioned earlier, a tighter lower bound of ˜Ω((n + 1/λ) ln(1/ϵ)) is known for SDCA [3], suggesting that a tighter bound might hold for the more restricted set of stationary CLIs (for which the oracle parameters remain fixed throughout the optimization process). 8
2016
98
6,561
Hierarchical Object Representation for Open-Ended Object Category Learning and Recognition S.Hamidreza Kasaei, Ana Maria Tomé, Luís Seabra Lopes IEETA - Instituto de Engenharia Electrónica e Telemática de Aveiro University of Aveiro, Averio, 3810-193, Portugal {seyed.hamidreza, ana, lsl}@ua.pt Abstract Most robots lack the ability to learn new objects from past experiences. To migrate a robot to a new environment one must often completely re-generate the knowledgebase that it is running with. Since in open-ended domains the set of categories to be learned is not predefined, it is not feasible to assume that one can pre-program all object categories required by robots. Therefore, autonomous robots must have the ability to continuously execute learning and recognition in a concurrent and interleaved fashion. This paper proposes an open-ended 3D object recognition system which concurrently learns both the object categories and the statistical features for encoding objects. In particular, we propose an extension of Latent Dirichlet Allocation to learn structural semantic features (i.e. topics) from low-level feature co-occurrences for each category independently. Moreover, topics in each category are discovered in an unsupervised fashion and are updated incrementally using new object views. The approach contains similarities with the organization of the visual cortex and builds a hierarchy of increasingly sophisticated representations. Results show the fulfilling performance of this approach on different types of objects. Moreover, this system demonstrates the capability of learning from few training examples and competes with state-of-the-art systems. 1 Introduction Open-ended learning theory in cognitive psychology has been a topic of considerable interest for many researchers. The general principle is that humans learn to recognize object categories ceaselessly over time. This ability allows them to adapt to new environments, by enhancing their knowledge from the accumulation of experiences and the conceptualization of new object categories [1]. In humans there is evidence of hierarchical models for object recognition in cortex [2]. Moreover, in humans object recognition skills and the underlying capabilities are developed concurrently [2]. In hierarchical recognition theories, the human sequentially processes information about the target object leading to the recognition result. This begins with lower level cortical processors such as the elementary visual cortex and go “up” to the inferotemporal cortex (IT) where recognition occurs. Taking this as inspiration, an autonomous robot will process visual information continuously, and perform learning and recognition concurrently. In other words, apart from learning from a batch of labelled training data, the robot should continuously update and learn new object categories while working in the environment in an open-ended manner. In this paper, “open-ended” implies that the set of object categories to be learned is not known in advance. The training instances are extracted from on-line experiences of a robot, and thus become gradually available over time, rather than completely available at the beginning of the learning process. Classical object recognition systems are often designed for static environments i.e. training (offline) and testing (online) are two separated phases. If limited training data is used, this might lead to non-discriminative object representations and, as a consequence, to poor object recog30th Conference on Neural Information Processing Systems (NIPS 2016), Barcelona, Spain. nition performance. Therefore, building a discriminative object representation is a challenging step to improve object recognition performance. Moreover, time and memory efficiency is also important. Comparing 3D directly based their local features is computationally expensive. Topic modelling is suitable for open-ended learning because, not only it provides short object descriptions (i.e. optimizing memory), but also enables efficient processing of large collections. category layer view layer topic layer BoW layer feature layer Figure 1: The proposed multi layer object representation being tested on a service robot. It consists of five layers of hierarchy including feature layer, BoW layer, topic layer, object view layer and category layer. This paper proposes a 3D object recognition system capable of learning both object categories as well as the topics used to encode them concurrently and in an open-ended manner. We propose an extension of Latent Dirichlet Allocation to learn incrementally topics for each category independently. Moreover, topics in each category are discovered in an unsupervised fashion and updated incrementally using new object views. As depicted in Fig.1, the approach is designed to be used by a service robot working in a domestic environment. Fig.1(left), shows a PR2 robot looking at some objects on the table. Fig.1(right) shows the point cloud of the scene obtained through the robot’s Kinect and the used representations. Tabletops objects are tracked (signed by different colors) and processed through a hierarchy of five layers. For instance, to describe an object view, in the feature layer, a spin-image shape descriptor [3] is used to represent the local shapes of the object in different key points; afterwards, in the Bag-of-Words (BoW) layer, the given object view is described by histograms of local shape features, as defined in Bag-of-Words models; in the topic layer, each topic is defined as a discrete distribution over visual words and each object view is described as a random mixture over latent topics of the category and stores them into the memory (view layer). Finally, the category model is updated by adding the obtained representation (category layer). The remainder of this paper is organized as follows. In section2, we discuss related works. Section3 provides a system overview. The methodology for constructing visual words dictionary is presented in section4. Section5 describes the proposed object representation. Object category learning and recognition are then explained in section6. Evaluation of the proposed system is presented in section7. Finally, conclusions are presented and future research is discussed. 2 Related work One of the important tasks in the field of assistive and service robots is to achieve human-like object category learning and recognition. Riesenhuber and Poggio [2] proposed a hierarchical approach for object recognition consistent with physiological data, in which objects are modelled in a hierarchy of increasingly sophisticated representations. Sivic et al. [4] proposed an approach to discover objects in images using Probabilistic Latent Semantic Indexing (pLSI) modelling [5]. Blei et al. [6] argued that the pLSI is incomplete in that it provides no probabilistic model at the level of documents. They extended the pLSI model calling the approach Latent Dirichlet Allocation (LDA). Similar to pLSI and LDA, we discover topics in an unsupervised fashion. Unlike our approach in this paper, pLSI and LDA do not incorporate class information. Several works have been presented to incorporate a class label in the generative model [7][8][9]. Blei et al. [7] extend LDA and proposed Supervised LDA (sLDA). The sLDA was first used for supervised text prediction. Later, Wang et al. [8] extended sLDA to classification problems. Another popular extension of LDA is the classLDA (cLDA) [9]. Similar to our approach, the only supervision used by sLDA and cLDA is the category label of each training object. However, there are two main differences. First, the learned topics in sLDA and cLDA are shared among all categories, while we propose to learn specific topics per category. Second, the sLDA and cLDA approaches follow a standard train-and-test procedure (i.e. set of classes, train and test data are known or available in 2 advance), our approach can incrementally update topics using new observations and the set of classes is continuously growing. There are some topic-supervised approaches e.g. Labeled LDA [10] and semiLDA [11] that consider class labels for topics. On one hand, these approaches need tens of hours of manual annotation. On the other hand, a human can not provide a specific category label for a 3D local shape description (e.g. a spin-images [3]). There are some LDA approaches that support incremental learning of object categories. The difference between incremental and open-ended learning is that the set of classes is predefined in incremental learning, while in open-ended learning the set of classes is continuously growing. Banerjee et al. proposed [12] online LDA (o-LDA) that is a simple modification of batch collapsed Gibbs sampler. The o-LDA first applies the batch Gibbs sampler to the full dataset and then samples new topics for each newly observed word using information observed so far. Canini et al. [13] extended o-LDA and proposed an incremental Gibbs sampler for LDA (here referred to as I-LDA). The I-LDA does not need a batch initialization phase like o-LDA. In o-LDA and I-LDA, the number of categories is fixed, while in our approach the number of categories is growing. Moreover, o-LDA and I-LDA are used to discover topics shared among all categories, while our approach is used to discover specific topics per category. Currently, a popular approach in object recognition is deep learning. However, there are several limitations to use Deep Neural Networks (DNN) in open-ended domains. Deep networks are incremental by nature but not open-ended, since the inclusion of novel categories enforces a restructuring in the topology of the network. Moreover, DNN usually needs a lot of training data and long training times to obtain an acceptable accuracy. Schwarz et.al [14] used DNN for 3D object category learning. They clearly showed that the performance of DNN degrades when the size of dataset is reduced. 3 System overview The main motivation of this work is to achieve a multi-layered object representation that builds an increasingly complex object representation (see Fig. 1). Particularly, a statistical model is used to get structural semantic features from low-level feature co-occurrences. The basic idea is that each object view is described as a random mixture over a set of latent topics, and each topic is defined as a discrete distribution over visual words (i.e. local shape features). It must be pointed out that we are using shape features rather than semantic properties to encode the statistical structure of object categories [15]. It is easier to explain the details using an example. We start by selecting a category label, for example Mug. To represent a new instance of Mug, a distribution over Mug topics is drawn that will specify which intermediate topics should be selected for generating each visual words of the object. According to this distribution, a particular topic is selected out of the mixture of possible topics of the Mug category for generating each visual word in the object. For instance, a Mug usually has a handle, and a “handle” topic refers to some visual words that occur frequently together in handles. The process of drawing both the topic and visual word is repeated several times to choose a set of visual words that would construct a Mug. We use statistical inference techniques for inverting this process to automatically find out a set of topics for each category from a collection of instances. In other words, we try to learn a model for each category (a set of latent variables) that explains how each object obtains its visual words. In our approach, the characteristics of surfaces belonging to objects are described by local shape features called spin-images [3]. 4 Dictionary construction Comparing 3D objects based on their local features is computationally expensive. The topic modelling approach directly addresses this concern. It requires a dictionary with V visual words. Usually, the dictionary is created via off-line clustering of training data, while in open-ended learning, there is no training data available at the beginning of the learning process. To cope with this limitation, we propose that the robot freely explores several scenes and collects several object experiences. In general, object exploration is a challenging task because of ill-definition of the objects [16]. Since a system of boolean equations can represent any expression or any algorithm, it is particularly well suited for encoding the world and object candidates. Similar to Collet’s work [16], we have used boolean algebra based on the three logical operators, namely AND ∧, OR ∨and NOT ¬. A set of constraints, C, is then defined. Each constraint has been implemented as a function that returns either true or false (see Table 1). 3 Table 1: List of used constraints with a short description for each one. Constraints Description Ctable: “is this candidate on a table?” The interest object candidate is placed on top of a table. Ctrack: “is this candidate being tracked?” This constraint is used to infer that the segmented object is already being tracked or not. Csize: “is this candidate manipulatable?” Reject large object candidate. Cinstructor: “is this candidate part of the instructor’s body?” Reject candidates that are belong to the user’s body. Crobot: “is this candidate part of the robot’s body?” Reject candidates that are belong to the robot’s body. Cedge: “is this candidate near to the edge of the table?” Reject candidates that are near to the edge of the table. Ckey_view: “is this candidate a key view?” Only key-views are stored into Perceptual Memory. Note that, storing all object views while the object is static would lead to unnecessary accumulation of highly redundant data. Therefore, Ckey_view is used to optimize memory usage and computation while keeping potentially relevant and distinctive information. An object view is selected as a key view whenever the tracking of an object is initialized (Ctrack), or when it becomes static again after being moved. In case the hands are detected near the object, storing key views are postponed until the hands are withdrawn [17]. Using these constraints, boolean expressions, ψ, are built to encode object candidates for the Object Exploration and Object Recognition purposes (see equations 1 and 2). ψexploration = Ctable ∧Ctrack ∧Ckey_view ∧¬(Cinstructor ∨Crobot), (1) ψrecognition = Ctable ∧Ctrack ∧¬ (Cinstructor ∨Crobot ∨Cedge), (2) The basic perception infrastructure, which is strongly based on the Point Cloud Library (PCL), has been described in detail in previous publications [18][19]. A table is detected by finding the dominant plane in the point cloud. This is done using the RANSAC algorithm. The extraction of polygonal prisms mechanism is used for collecting the points which lie directly above the table. Afterwards, an Euclidean Cluster Extraction algorithm is used to segment each scene into individual clusters. Every cluster that satisfies the exploration expression is selected. The output of this object exploration is a pool of object candidates. Subsequently, to construct a pool of features, spin-images [3] are computed for the selected points extracted from the pool of object candidates. We computed around 32000 spin-images from the point cloud of the 194 objects views. Finally, the dictionary is constructed by clustering the features using the k-means algorithm. The centers of the V extracted clusters are used as visual words, wt (1 ≤t ≤V ). A video of the robot exploring an environment1 is available at: https://youtu.be/MwX3J6aoAX0. 5 Object representation A hierarchical system is presented which follows the organization of the visual cortex and builds an increasingly complex object representation. Plasticity and learning can occurr at all layers and certainly at the top-most layers of the hierarchy. In this paper, object view representation in the feature layer involves two main phases: keypoint extraction and computation of spin images for the keypoints. For keypoint extraction, a voxelized grid approach is used to obtain a smaller set of points by taking only the nearest neighbor point for each voxel center. Afterwards, the spin-image descriptor is used to encode the surrounding shape in each keypoint using the original point cloud (i.e. feature layer). Subsequently, the spin images go “up” to the BoW layer where each spin image is assigned to a visual word by searching for the nearest neighbor in the dictionary. Afterwards, each object is represented as a set of visual words. The obtained representation is then presented as input to the topic layer. The LDA model consists of three levels’ parameters including category-level parameters (i.e. α), which are sampled once in the process of generating a category of objects; object-level variables (i.e. θd), which are sampled once per object, and word-level variables (i.e. zd,n and wd,n), which are sampled every time a feature is extracted. The variables θ, φ and z are latent variables that should be inferred. Assume everything is observed and a category label is selected for each object; i.e. each object belongs to one category. The joint distribution of all hidden and observed variables for a category is defined as follows: p(c)(w, z, θ, φ|α, β) = K Y z=1 p(c)(φz|β) |c| Y d=1 p(c)(θd|α) N Y n=1 p(c)(zd,n|θd)p(c)(wd,n|zd,n, φ), (3) 1The ROS bag file used in this video was created by the Knowledge-Based Systems Group, Institute of Computer Science, University of Osnabrueck. 4 where α and β are Dirichlet prior hyper-parameters that affect the sparsity of distributions, and K is the number of topics, |c| is the number of known objects in the category c and N is the number of words in the object d. Each θd represents an instance of category c in topic-space as a Cartesian histogram (i.e. topic layer), w represents an object as a vector of visual words, w = {w1, w2, ..., wN}, where each entry represents one of the V words of the dictionary (i.e. BoW layer). z is a vector of topics and zi = 1 means wi was generated form ith topic. It should be noticed that there is a topic for each word and φ is a K × V matrix, which represents word-probability matrix for each topic, where V is the size of dictionary and φi,j = p(c)(wi|zj); thus, the posterior distributions of the latent variables given the observed data is computed as follows: p(c)(z, θ, φ|w, α, β) = p(c)(w, z, θ, φ|α, β) p(c)(w|α, β) , (4) Unfortunately, the denominator of the equation 4 is intractable and can not be computed exactly. A collapsed Gibbs sampler is used to solve the inference problem. Since θ and φ can be derived from zi, they are integrated out from the sampling procedure. In this work, for each category an incremental LDA model is created. Whenever a new training instance is presented, the collapsed Gibbs sampling is employed to update the parameters of the model. The collapsed Gibbs sampler is used to estimate the probability of topic zi being assigned to a word wi, given all other topics assigned to all other words: p(c)(zi = k|z¬i, w) ∝p(c)(zi = k|z¬i) × p(c)(wi|z¬i, w¬i) ∝ nd,k,¬i + α [PK k=1 nd,k + α] −1 × n(c) w,k,¬i + β PV w=1 n(c) w,k + β , (5) where z¬i means all hidden variables expect zi and z = {zi, z¬i}. nd,k is the number of times topic k is assigned to some visual word in object d and n(c) w,k shows the number of times visual word w assigned to topic k. In addition, the denominator of the p(c)(zi = k|z¬i) is omitted because it does not depend on zi. The multinomial parameter sets θ(c) and φ(c) can be estimated using the following equations: θ(c) k,d = nd,k + α nd + Kα, and φ(c) w,k = n(c) w,k + β n(c) k + V β . (6) where n(c) k is the number of times a word assigned to topic k in category c and nd is the number of words exist in the object d. Since in this approach, what happens next depends only on the current state of the system and not on the sequence of previous states, whenever a new object view, θ(c) d , is added to the category c, n(c) k and n(c) w,k are updated incrementally. 6 Object category learning and recognition Whenever a new object view is added to a category [17], the object conceptualizer retrieves the current model of the category as well as representation of the new object view, and creates a new, or updates the existing category. To exemplify the strength of object representation, an instance-based learning approach is used in the current system, i.e. object categories are represented by sets of known instances. The instance-based approach is used because it is a baseline method for category representation. However, more advanced approaches like Bayesian approach can be easily adapted. An advantage of the instance based approach is to facilitate incremental learning in an open-ended fashion. Similarly, a baseline recognition mechanism in the form of a nearest neighbour classifier with a simple thresholding approach are used to recognize a given object view. The query object view, Oq, is first represented using the topic distribution of each category, θ(c) q . Afterwards, to assess the dissimilarity between the query object and stored instances of category c, θp, the symmetric Kullback Leibler divergence, i.e. DKL(θ(c) q , θp), is used to measure the difference between two distributions. Subsequently, the minimum distance between the query object and all instances of the category c, is considered as the Object-Category Distance, OCD(.): OCD(θ(c) q , c) = min θp∈c DKL(θ(c) q , θp), c ∈{1, . . . , C}. (7) 5 Consequently, the query object is classified based on the minimum OCD(.). If, for all categories, the OCD(.) is larger than a given Classification Threshold (e.g. CT= 0.75), then the object is classified as unknown; otherwise, it is classified as the category that has the highest similarity. 7 Experimental results The proposed approach was evaluated using a standard cross-validation protocol as well as an open-ended protocol. We also report on a demonstration of the system. 7.1 Off-line evaluation An object dataset has been used [18], which contains 339 views of 10 categories of objects. The system has five different parameters that must be well selected to provide a good balance between recognition performance and memory usage. To examine the performance of different configurations of the proposed approach, 10-fold cross-validation has been used. A total of 180 experiments were performed for different values of five parameters of the system, namely the voxel size (VS), which determines the number of keypoints extracted from each object view, the image width (IW) and support length (SL) of spin images, the dictionary size (DS) and the number of topics (NT). Results are presented in Table 2. The parameters that obtained the best average accuracy was selected as the default configuration: VS=0.03, IW=4 and SL=0.05, DS=90 and NT=30. In all experiments, the number of iterations for Gibbs sampling was 30 and α and β parameters were set to 1 and 0.1 respectively. The accuracy of the proposed system with the default configuration was 0.87. Therefore, this configuration displays a good balance between recognition performance and memory usage. The remaining results were obtained using this configuration. Table 3: Object recognition performance Representation Accuracy Feature Layer 0.12 BoW Layer 0.79 Topic Layer (shared topics) 0.79 Topic Layer (our approach) 0.87 The accuracy of the system in each layer has been calculated individually. For comparison, the accuracy of a topic layer with topics shared among all categories is also computed. Results are presented in Table 3. One important observation is that the overall performance of the recognition system based on topic modelling is promising and the proposed representation is capable of providing distinctive representation for the given object. Moreover, it was observed that the discriminative power of the proposed representation was better than the other layers. In addition, independent topics for each category provides better representation than shared topics for all categories. Furthermore, it has been observed that the discriminative power of shared topics depends on the order of introduction of categories. The accuracy of object recognition based on pure shape features (i.e. feature layer) is very low. The BoW representation obtains an acceptable performance. The topic layer provides a good balance between memory usage and descriptiveness with 30 floats (i.e. NT=30). The length of the BoW layer is around three times larger than the representation of the topic layer. The feature layer is the less compact representation. These results show the hierarchical object representation builds an increasingly complex representation. 7.2 Open-ended evaluation The off-line evaluation methodologies (e.g k-fold cross validation, etc.) are not well suited to evaluate open-ended learning systems, because they do not abide to the simultaneous nature of learning and recognition. Those methodologies imply that the set of categories must be predefined. An evaluation protocol for open-ended learning systems was proposed in [20]. The idea is to emulate the interactions of a recognition system with the surrounding environment over long periods of time. A simulated teacher was developed to follow the evaluation protocol and autonomously interact with the recognition system using three basic actions including: teach, for teaching a new object category; ask, to ask the system what is the category of an object view; and correct, for providing Table 2: Object recognition performance for different parameters Parameters VS(m) IW (bins) SL(m) DS (visual words) NT Values 0.03 0.04 4 8 0.04 0.05 0.06 50 60 70 80 90 30 40 50 Avg. Accuracy(%) 85 81 83 83 82 83 83 82 82 83 84 84 84 83 82 6 0 20 40 60 80 100 120 140 160 180 200 0 0.2 0.4 0.6 0.8 1 1.2 Iterations Accuracy pitcher capnotebook stapler potato bag-food onionplatewater-bottle hand-towel camera calculator cell-phone scissors instant-noodles shampoo bell-pepper jar-food Exp3 Figure 2: Evolution of accuracy vs. number of question/correction iterations in the first 200 iterations of the third experiment. Vertical red lines and labels indicate when and which categories are introduced to the system. corrective feedback, i.e. the ground truth label of a misclassified object view. The idea is that, for each newly taught category, the simulated teacher repeatedly picks unseen object views of the currently known categories from a dataset and presents them to the system. It progressively estimates the recognition accuracy of the system and, in case this accuracy exceeds a given threshold (marked by the horizontal line in Fig.2), introduces an additional object category (marked by the vertical lines and labels in Fig.2). This way, the system is trained, and at the same time the accuracy of the system is continuously estimated. The simulated teacher must be connected to an object dataset. In this work, the simulated teacher was connected to the largest available dataset namely RGB-D Object Dataset consisting of 250,000 views of 300 common household objects, organized into 51 categories [21]. Table 4: Summary of experiments. EXP# #QCI #TLC #AIC GCA (%) APA (%) 1 1740 39 18.38 65 71 2 803 30 11.07 69 79 3 1099 35 13.20 67 77 4 1518 38 16.29 66 73 5 1579 42 15.12 67 72 Since the performance of an openended learning system is not limited to the object recognition accuracy, when an experiment is carried out, learning performance is evaluated using three distinct measures, including: (i) the number of learned categories at the end of an experiment (TLC), an indicator of How much does it learn?; (ii) The number of question / correction iterations (QCI) required to learn those categories and the average number of stored instances per category (AIC), indicators of How fast does it learn? (see Fig.3 (right)); (iii) Global classification accuracy (GCA), an accuracy computed using all predictions in a complete experiment, and the average protocol accuracy (APA), indicators of How well does it learn? (see Fig.3 (left)). Since the order of the categories introduced may have an affect on the performance of the system, five experiments were carried out in which categories were introduced in random sequences. Results are reported in Table 4. Figure 2 shows the performance of the system in the initial 200 iterations of the third experiment. By comparing all experiments, it is visible that in the fifth experiment, the system learned more categories than other experiments. Figure 3 (left) shows the global classification accuracy obtained by the proposed approach as a function of the number of learned categories. In experiments 1, 4, 5, the accuracy first decreases, and then starts slightly going up again as more categories are introduced. This is expected since the number of categories known by the system makes the classification task more difficult. However, as the number of learned categories increases, also the number of instances per category increases, which augments the category models (topics) and therefore improves performance of the system. Fig.3 (right) gives a measure of how fast the learning occurred in each of the experiments and shows the number of question/correction iterations required to learn a certain number of categories. Our approach learned faster than that of Schwarz et. al [14] approach, i.e. our approach requires much less examples than Schwarz’s work. Furthermore, we achieved accuracy around 75% while storing less than 20 instances per category (see Table 4), while Schwarz et.al [14] stored more than 1000 training instances per category (see Fig.8 in [14]). In addition, they clearly showed the performance of DNN degrades when the size of dataset is reduced. 0 5 10 15 20 25 30 35 40 45 0.5 0.6 0.7 0.8 0.9 1 Number of learned categories Global classification accuracy Exp1 Exp2 Exp3 Exp4 Exp5 0 200 400 600 800 1000 1200 1400 1600 1800 0 5 10 15 20 25 30 35 40 45 Iterations Number of learned categories 1740 803 1099 1518 1579 Exp1 Exp2 Exp3 Exp4 Exp5 Figure 3: System performance during simulated user experiments. 7 (a) (b) (c) Figure 4: Three snapshots showing object recognition results in two scenarios: first two snapshots show the proposed system supports (a) classical learning from a batch of train labelled data and (b) open-ended learning from on-line experiences. Snapshot (c) shows object recognition results on a scene of Washington scene dataset. 7.3 System demonstration To show the strength of object representation, a real demonstration was performed, in which the proposed approach has been integrated in the object perception system presented in [18]. In this demonstration a table is in front of a robot and two users interact with the system. Initially, the system only had prior knowledge about the Vase and Dish categories, learned from batch data (i.e. set of observations with ground truth labels), and there is no information about other categories (i.e. Mug, Bottle, Spoon). Throughout this session, the system must be able to recognize instances of learned categories and incrementally learn new object categories. Figure4 illustrates the behaviour of the system: (a) The instructor puts object TID6 (a Mug) on the table. It is classified as Unknown because mugs are not known to the system; Instructor labels TID6 as a Mug. The system conceptualizes Mug and TID6 is correctly recognized. The instructor places a Vase on the table. The system has learned Vase category from batch data, therefore, the Vase is properly recognized (Fig.4 (a)). (b) Later, another Mug is placed on the table. This particular Mug had not been previously seen, but the system can recognize it, because the Mug category was previously taught (Fig.4 (b)). This demonstration shows that the system is capable of using prior knowledge to recognize new objects in the scene and learn about new object categories in an open-ended fashion. A video of this demonstration is available at: https://youtu.be/J0QOc_Ifde4. Another demonstration has been performed using Washington RGB-D Scenes Dataset v2. This dataset consists of 14 scenes containing a subset of the objects in the RGB-D Object Dataset, including bowls, caps, mugs, and soda cans and cereal boxes. Initially, the system had no prior knowledge. The four first objects are introduced to the system using the first scene and the system conceptualizes those categories. The system is then tested using the second scene of the dataset and it can recognize all objects except cereal boxes, because this category was not previously taught. The instructor provided corrective feedback and the system conceptualized the cereal boxes category. Afterwards, all objects are classified correctly in all 12 remaining scenes (Fig.4 (c)). This evaluation illustrates the process of acquiring categories in an open-ended fashion. A video of this demonstration is online at: https://youtu.be/pe29DYNolBE. 8 Conclusion This paper presented a multi-layered object representation to enhance a concurrent 3D object category learning and recognition. In this work, for optimizing the recognition process and memory usage, each object view was hierarchically described as a random mixture over a set of latent topics, and each topic was defined as a discrete distribution over visual words. This paper focused in detail on unsupervised object exploration to construct a dictionary and concentrated on supervised open-ended object category learning using an extension of topic modelling. We transform objects from bag-ofwords space into a local semantic space and used distribution over distribution representation for providing powerful representation and deal with the semantic gap between low-level features and high-level concepts. Results showed that the proposed system supports classical learning from a batch of train labelled data and open-ended learning from actual experiences of a robot. Acknowledgements This work was funded by National Funds through FCT project PEst-OE/EEI/UI0127/2016 and FCT scholarship SFRH/BD/94183/2013. 8 References [1] Sungmoon Jeong and Minho Lee. Adaptive object recognition model using incremental feature representation and hierarchical classification. Neural Networks, 25:130–140, 2012. [2] Maximilian Riesenhuber and Tomaso Poggio. Hierarchical models of object recognition in cortex. Nature neuroscience, 2(11):1019–1025, 1999. [3] AE. Johnson and M. Hebert. Using spin images for efficient object recognition in cluttered 3D scenes. Pattern Analysis and Machine Intelligence, IEEE Transactions on, 21(5):433–449, May 1999. [4] Josef Sivic, Bryan C Russell, Alexei Efros, Andrew Zisserman, William T Freeman, et al. Discovering objects and their location in images. In Computer Vision, 2005. ICCV 2005. Tenth IEEE International Conference on, volume 1, pages 370–377. IEEE, 2005. [5] Thomas Hofmann. Probabilistic latent semantic indexing. In Proceedings of the 22nd annual international ACM SIGIR conference on Research and development in information retrieval, pages 50–57. ACM, 1999. [6] David M Blei, Andrew Y Ng, and Michael I Jordan. Latent dirichlet allocation. the Journal of machine Learning research, 3:993–1022, 2003. [7] Jon D Mcauliffe and David M Blei. Supervised topic models. In Advances in neural information processing systems, pages 121–128, 2008. [8] Chong Wang, David Blei, and Fei-Fei Li. Simultaneous image classification and annotation. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 1903–1910. IEEE, 2009. [9] Li Fei-Fei and Pietro Perona. A bayesian hierarchical model for learning natural scene categories. In Computer Vision and Pattern Recognition, 2005. CVPR 2005. IEEE Computer Society Conference on, volume 2, pages 524–531. IEEE, 2005. [10] Daniel Ramage, David Hall, Ramesh Nallapati, and Christopher D Manning. Labeled lda: A supervised topic model for credit attribution in multi-labeled corpora. In Proceedings of the 2009 Conference on Empirical Methods in Natural Language Processing: Volume 1-Volume 1, pages 248–256, 2009. [11] Yang Wang, Payam Sabzmeydani, and Greg Mori. Semi-latent dirichlet allocation: A hierarchical model for human action recognition. In Human Motion–Understanding, Modeling, Capture and Animation, pages 240–254. Springer, 2007. [12] Arindam Banerjee and Sugato Basu. Topic models over text streams: A study of batch and online unsupervised learning. In SDM, volume 7, pages 437–442. SIAM, 2007. [13] Kevin R Canini, Lei Shi, and Thomas L Griffiths. Online inference of topics with latent dirichlet allocation. In International conference on artificial intelligence and statistics, pages 65–72, 2009. [14] Max Schwarz, Hannes Schulz, and Sven Behnke. RGB-D object recognition and pose estimation based on pre-trained convolutional neural network features. In Robotics and Automation (ICRA), 2015 IEEE International Conference on, pages 1329–1335. IEEE, 2015. [15] Jiye G Kim, Irving Biederman, Mark D Lescroart, and Kenneth J Hayworth. Adaptation to objects in the lateral occipital complex (loc): shape or semantics? Vision research, 49(18):2297–2305, 2009. [16] Alvaro Collet, Bo Xiong, Corina Gurau, Martial Hebert, and Siddhartha S Srinivasa. Herbdisc: Towards lifelong robotic object discovery. The International Journal of Robotics Research, 34(1):3–25, 2015. [17] Gi Hyun Lim, M. Oliveira, V. Mokhtari, S. Hamidreza Kasaei, A. Chauhan, L. Seabra Lopes, and A.M. Tome. Interactive teaching and experience extraction for learning about objects and robot activities. In Robot and Human Interactive Communication, The 23rd IEEE International Symposium on, 2014. [18] S Hamidreza Kasaei, Miguel Oliveira, Gi Hyun Lim, Luís Seabra Lopes, and Ana Maria Tomé. Interactive open-ended learning for 3d object recognition: An approach and experiments. Journal of Intelligent & Robotic Systems, 80(3):537–553, 2015. [19] Miguel Oliveira, Luís Seabra Lopes, Gi Hyun Lim, S. Hamidreza Kasaei, Ana Maria Tomé, and Aneesh Chauhan. 3D object perception and perceptual learning in the RACE project. Robotics and Autonomous Systems, 75, Part B:614 – 626, 2016. [20] Aneesh Chauhan and Luís Seabra Lopes. Using spoken words to guide open-ended category formation. Cognitive processing, 12(4):341–354, 2011. [21] K. Lai, Liefeng Bo, Xiaofeng Ren, and D. Fox. A large-scale hierarchical multi-view RGB-D object dataset. In Robotics and Automation (ICRA), 2011 IEEE International Conference on, pages 1817–1824, 2011. 9
2016
99
6,562
Real Time Image Saliency for Black Box Classifiers Piotr Dabkowski pd437@cam.ac.uk University of Cambridge Yarin Gal yarin.gal@eng.cam.ac.uk University of Cambridge and Alan Turing Institute, London Abstract In this work we develop a fast saliency detection method that can be applied to any differentiable image classifier. We train a masking model to manipulate the scores of the classifier by masking salient parts of the input image. Our model generalises well to unseen images and requires a single forward pass to perform saliency detection, therefore suitable for use in real-time systems. We test our approach on CIFAR-10 and ImageNet datasets and show that the produced saliency maps are easily interpretable, sharp, and free of artifacts. We suggest a new metric for saliency and test our method on the ImageNet object localisation task. We achieve results outperforming other weakly supervised methods. 1 Introduction Current state of the art image classifiers rival human performance on image classification tasks, but often exhibit unexpected and unintuitive behaviour [6, 13]. For example, we can apply a small perturbation to the input image, unnoticeable to the human eye, to fool a classifier completely [13]. Another example of an unexpected behaviour is when a classifier fails to understand a given class despite having high accuracy. For example, if “polar bear” is the only class in the dataset that contains snow, a classifier may be able to get a 100% accuracy on this class by simply detecting the presence of snow and ignoring the bear completely [6]. Therefore, even with perfect accuracy, we cannot be sure whether our model actually detects polar bears or just snow. One way to decouple the two would be to find snow-only or polar-bear-only images and evaluate the model’s performance on these images separately. An alternative is to use an image of a polar bear with snow from the dataset and apply a saliency detection method to test what the classifier is really looking at [6, 11]. Saliency detection methods show which parts of a given image are the most relevant to the model for a particular input class. Such saliency maps can be obtained for example by finding the smallest region whose removal causes the classification score to drop significantly. This is because we expect the removal of a patch which is not useful for the model not to affect the classification score much. Finding such a salient region can be done iteratively, but this usually requires hundreds of iterations and is therefore a time-consuming process. In this paper we lay the groundwork for a new class of fast and accurate model-based saliency detectors, giving high pixel accuracy and sharp saliency maps (an example is given in figure 1). We propose a fast, model agnostic, saliency detection method. Instead of iteratively obtaining saliency maps for each input image separately, we train a model to predict such a map for any input image in a single feed-forward pass. We show that this approach is not only orders-of-magnitude faster than iterative methods, but it also produces higher quality saliency masks and achieves better localisation results. We assess this with standard saliency benchmarks and introduce a new saliency measure. Our proposed model is able to produce real-time saliency maps, enabling new applications such as video-saliency which we comment on in our Future Research section. 2 Related work Since the rise of CNNs in 2012 [5] numerous methods of image saliency detection have been proposed. One of the earliest such methods is a gradient-based approach introduced in [11] which computes the gradient of the class with respect to the image and assumes that salient regions are at locations 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) Input Image (b) Generated saliency map (c) Image multiplied by the mask (d) Image multiplied by inverted mask Figure 1: An example of explanations produced by our model. The top row shows the explanation for the "Egyptian cat" while the bottom row shows the explanation for the "Beagle". Note that produced explanations can precisely both highlight and remove the selected object from the image. with high gradient magnitude. Other similar backpropagation-based approaches have been proposed, for example Guided Backpropagation [12] or Excitation Backprop [16]. While the gradient-based methods are fast enough to be applied in real-time, they produce explanations of limited quality [16] and they are hard to improve and build upon. Zhou et al. [17] proposed an approach that iteratively removes patches of the input image (by setting them to the mean colour) such that the class score is preserved. After a sufficient number of iterations, we are left with salient parts of the original image. The maps produced by this method are easily interpretable, but unfortunately, the iterative process is very time consuming and not acceptable for real-time saliency detection. In another work, Cao et al. [1] introduced an optimisation method that aims to preserve only a fraction of network activations such that the class score is maximised. Again, after the iterative optimisation process, only activations that are relevant remain and their spatial location in the CNN feature map indicate salient image regions. Very recently (and in parallel to this work), another optimisation based method was proposed [2]. Similarly to Cao et al. [1], Fong and Vedaldi [2] also propose to use gradient descent to optimise for the salient region, but the optimisation is done only in the image space and the classifier model is treated as a black box. Essentially Fong and Vedaldi [2]’s method tries to remove as little from the image as possible, and at the same time to reduce the class score as much as possible. A removed region is then a minimally salient part of the image. This approach is model agnostic and the produced maps are easily interpretable because the optimisation is done in the image space and the model is treated as a black box. We next argue what conditions a good saliency model should satisfy, and propose a new metric for saliency. 3 Image Saliency and Introduced Evidence Image saliency is relatively hard to define and there is no single obvious metric that could measure the quality of the produced map. In simple terms, the saliency map is defined as a summarised explanation of where the classifier “looks” to make its prediction. There are two slightly more formal definitions of saliency that we can use: • Smallest sufficient region (SSR) — smallest region of the image that alone allows a confident classification, 2 • Smallest destroying region (SDR) — smallest region of the image that when removed, prevents a confident classification. Similar concepts were suggested in [2]. An example of SSR and SDR is shown in figure 2. It can be seen that SSR is very small and has only one seal visible. Given this SSR, even a human would find it difficult to recognise the preserved image. Nevertheless, it contains some characteristic for “seal” features such as parts of the face with whiskers, and the classifier is over 90% confident that this image should be labeled as a “seal”. On the other hand, SDR has a much stronger and larger region and quite successfully removes all the evidence for seals from the image. In order to be as informative as possible, we would like to find a region that performs well as both SSR and SDR. Figure 2: From left to right: the input image; smallest sufficient region (SSR); smallest destroying region (SDR). Regions were found using the mask optimisation procedure from [2]. Both SDR and SSR remove some evidence from the image. There are few ways of removing evidence, for example by blurring the evidence, setting it to a constant colour, adding noise, or by completely cropping out the unwanted parts. Unfortunately, each one of these methods introduces new evidence that can be used by the classifier as a side effect. For example, if we remove a part of the image by setting it to the constant colour green then we may also unintentionally provide evidence for “grass” which in turn may increase the probability of classes appearing often with grass (such as “giraffe”). We discuss this problem and ways of minimising introduced evidence next. 3.1 Fighting the Introduced Evidence As mentioned in the previous section, by manipulating the image we always introduce some extra evidence. Here, let us focus on the case of applying a mask M to the image X to obtain the edited image E. In the simplest case we can simply multiply X and M element-wise: E = X ⊙M (1) This operation sets certain regions of the image to a constant “0” colour. While setting a larger patch of the image to “0” may sound rather harmless (perhaps following the assumption that the mean of all colors carries very little evidence), we may encounter problems when the mask M is not smooth. The mask M, in the worst case, can be used to introduce a large amount of additional evidence by generating adversarial artifacts (a similar observation was made in [2]). An example of such a mask is presented in figure 3. Adversarial artifacts generated by the mask are very small in magnitude and almost imperceivable for humans, but they are able to completely destroy the original prediction of the classifier. Such adversarial masks provide very poor saliency explanations and therefore should be avoided. Figure 3: The adversarial mask introduces very small perturbations, but can completely alter the classifier’s predictions. From left to right: an image which is correctly recognised by the classifier with a high confidence as a "tabby cat"; a generated adversarial mask; an original image after application of the mask that is no longer recognised as a "tabby cat". 3 There are a few ways to make the introduction of artifacts harder. For example, we may change the way we apply a mask to reduce the amount of unwanted evidence due to specifically-crafted masks: E = X ⊙M + A ⊙(1 −M) (2) where A is an alternative image. A can be chosen to be for example a highly blurred version of X. In such case mask M simply selectively adds blur to the image X and therefore it is much harder to generate high-frequency-high-evidence artifacts. Unfortunately, applying blur does not eliminate existing evidence very well, especially in the case of images with low spatial frequencies like a seashore or mountains. Another reasonable choice of A is a random constant colour combined with high-frequency noise. This makes the resulting image E more unpredictable at regions where M is low and therefore it is slightly harder to produce a reliable artifact. Even with all these measures, adversarial artifacts may still occur and therefore it is necessary to encourage smoothness of the mask M for example via a total variation (TV) penalty. We can also directly resize smaller masks to the required size as resizing can be seen as a smoothness mechanism. 3.2 A New Saliency Metric A standard metric to evaluate the quality of saliency maps is the localisation accuracy of the saliency map. However, it should be noted that saliency is not equivalent to localisation. For example, in order to recognise a dog we usually just need to see its head; legs and body are mostly irrelevant for the recognition process. Therefore, saliency map for a dog will usually only include its head while the localisation box always includes a whole dog with not-salient details like legs and tail. The saliency of the object highly overlaps with its localisation and therefore localisation accuracy still serves as a useful metric, but in order to better assess the quality and interpretability of the produced saliency maps, we introduce a new, highly tuned metric. According to the SSR objective, we require that the classifier is able to still recognise the object from the produced saliency map and that the preserved region is as small as possible. In order to make sure that the preserved region is free from adversarial artifacts, instead of masking we can crop the image. We propose to find the tightest rectangular crop that contains the entire salient region and to feed that rectangular region to the classifier to directly verify whether it is able to recognise the requested class. We define our saliency metric simply as: s(a, p) = log(˜a) −log(p) (3) with ˜a = max(a, 0.05). Here a is the area of the rectangular crop as a fraction of the total image size and p is the probability of the requested class returned by the classifier based on the cropped region. The metric is almost a direct translation of the SSR. We threshold the area at 0.05 in order to prevent instabilities at low area fractions. Good saliency detectors will be able to significantly reduce the crop size without reducing the classification probability, and therefore a low value for the saliency metric is a characteristic of good saliency detectors. Interpreting this metric following information theory, this measure can be seen as the relative amount of information between an indicator variable with probability p and an indicator variable with probability a — or the concentration of information in the cropped region. Because most image classifiers accept only images of a fixed size and the crop can have an arbitrary size, we resize the crop to the required size disregarding aspect ratio. This seems to work well in practice, but it should be noted that the proposed saliency metric works best with classifiers that are largely invariant to the scale and aspect ratio of the object. 3.3 The Saliency Objective Taking the previous conditions into consideration, we want to find a mask M that is smooth and performs well at both SSR and SDR; examples of such masks can be seen in figure 1. Therefore, more formally, given class c of interest, and an input image X, to find a saliency map M for class c, our objective function L is given by: L(M) = λ1TV(M) + λ2AV(M) −log(fc(Φ(X, M))) + λ3fc(Φ(X, 1 −M))λ4 (4) where fc is a softmax probability of the class c of the black box image classifier and TV(M) is the total variation of the mask defined simply as: TV(M) = X i,j (Mij −Mij+1)2 + X i,j (Mij −Mi+1j)2, (5) 4 AV(M) is the average of the mask elements, taking value between 0 and 1, and λi are regularisers. Finally, the function Φ removes the evidence from the image as introduced in the previous section: Φ(X, M) = X ⊙M + A ⊙(1 −M). (6) In total, the objective function is composed of 4 terms. The first term enforces mask smoothness, the second term encourages that the region is small. The third term makes sure that the classifier is able to recognise the selected class from the preserved region. Finally, the last term ensures that the probability of the selected class, after the salient region is removed, is low (note that the inverted mask 1 −M is applied). Setting λ4 to a value smaller than 1 (e.g. 0.2) helps reduce this probability to very small values. 4 Masking Model The mask can be found iteratively for a given image-class pair by directly optimising the objective function from equation 4. In fact, this is the method used by [2] which was developed in parallel to this work, with the only difference that [2] only optimises the mask iteratively and for SDR (so they don’t include the third term of our objective function). Unfortunately, iteratively finding the mask is not only very slow, as normally more than 100 iterations are required, but it also causes the mask to greatly overfit to the image and a large TV penalty is needed to prevent adversarial artifacts from forming. Therefore, the produced masks are blurry, imprecise, and overfit to the specific image rather than capturing the general behaviour of the classifier (see figure 2). For the above reasons, we develop a trainable masking model that can produce the desired masks in a single forward pass without direct access to the image classifier after training. The masking model receives an image and a class selector as inputs and learns to produce masks that minimise our objective function (equation 4). In order to succeed at this task, the model must learn which parts of the input image are considered salient by the black box classifier. In theory, the model can still learn to develop adversarial masks that perform well on the objective function, but in practice it is not an easy task, because the model itself acts as some sort of a “regulariser” determining which patterns are more likely and which are less. Figure 4: Architecture diagram of the masking model. In order to make our masks sharp and precise, we adopt a U-Net architecture [8] so that the masking model can use feature maps from multiple resolutions. The architecture diagram can be seen in figure 4. For the encoder part of the U-Net we use ResNet-50 [3] pre-trained on ImageNet [9]. It should be noted that our U-Net is just a model that is trained to predict the saliency map for the given black-box classifier. We use a pre-trained ResNet as a part of this model in order to speed up the training, however, as we show in our CIFAR-10 experiment in section 5.3 the masking model can also be trained completely from scratch. The ResNet-50 model contains feature maps of five different scales, where each subsequent scale block downsamples the input by a factor of two. We use the ResNet’s feature map from Scale 5 (which corresponds to downsampling by a factor of 32) and pass it through the feature filter. The purpose of the feature filter is to attenuate spatial locations which contents do not correspond to 5 the selected class. Therefore, the feature filter performs the initial localisation, while the following upsampling blocks fine-tune the produced masks. The output of the feature filter Y at spatial location i, j is given by: Yij = Xijσ(XT ijCs) (7) where Xij is the output of the Scale 5 block at spatial location i, j; Cs is the embedding of the selected class s and σ(·) is the sigmoid nonlinearity. Class embedding C can be learned as part of the overall objective. The upsampler blocks take the lower resolution feature map as input and upsample it by a factor of two using transposed convolution [15], afterwards they concatenate the upsampled map with the corresponding feature map from ResNet and follow that with three bottleneck blocks [3]. Finally, to the output of the last upsampler block (Upsampler Scale 2) we apply 1x1 convolution to produce a feature map with just two channels — C0, C1. The mask Ms is obtained from: Ms = abs(C0) abs(C0) + abs(C1) (8) We use this nonstandard nonlinearity because sigmoid and tanh nonlinearities did not optimise properly and the extra degree of freedom from two channels greatly improved training. The mask Ms has resolution four times lower than the input image and has to be upsampled by a factor of four with bilinear resize to obtain the final mask M. The complexity of the model is comparable to that of ResNet-50 and it can process more than a hundred 224x224 images per second on a standard GPU (which is sufficient for real-time saliency detection). 4.1 Training process We train the masking model to directly minimise the objective function from equation 4. The weights of the pre-trained ResNet encoder (red blocks in figure 4) are kept fixed during the training. In order to make the training process work properly, we introduce few optimisations. First of all, in the naive training process, the ground truth label would always be supplied as a class selector. Unfortunately, under such setting, the model learns to completely ignore the class selector and simply always masks the dominant object in the image. The solution to this problem is to sometimes supply a class selector for a fake class and to apply only the area penalty term of the objective function. Under this setting, the model must pay attention to the class selector, as the only way it can reduce loss in case of a fake label is by setting the mask to zero. During training, we set the probability of the fake label occurrence to 30%. One can also greatly speed up the embedding training by ensuring that the maximal value of σ(XT ijCs) from equation 7 is high in case of a correct label and low in case of a fake label. Finally, let us consider again the evidence removal function Φ(X, M). In order to prevent the model from adapting to any single evidence removal scheme the alternative image A is randomly generated every time the function Φ is called. In 50% of cases the image A is the blurred version of X (we use a Gaussian blur with σ = 10 to achieve a strong blur) and in the remainder of cases, A is set to a random colour image with the addition of a Gaussian noise. Such a random scheme greatly improves the quality of the produced masks as the model can no longer make strong assumptions about the final look of the image. 5 Experiments In the ImageNet saliency detection experiment we use three different black-box classifiers: AlexNet [5], GoogleNet [14] and ResNet-50 [3]. These models are treated as black boxes and for each one we train a separate masking model. The selected parameters of the objective function are λ1 = 10, λ2 = 10−3, λ3 = 5, λ4 = 0.3. The first upsampling block has 768 output channels and with each subsequent upsampling block we reduce the number of channels by a factor of two. We train each masking model as described in section 4.1 on 250,000 images from the ImageNet training set. During the training process, a very meaningful class embedding was learned and we include its visualisation in the Appendix. Example masks generated by the saliency models trained on three different black box image classifiers can be seen in figure 5, where the model is tasked to produce a saliency map for the ground truth 6 (a) Input Image (b) Model & AlexNet (c) Model & GoogleNet (d) Model & ResNet-50 (e) Grad [11] (f) Mask [2] Figure 5: Saliency maps generated by different methods for the ground truth class. The ground truth classes, starting from the first row are: Scottish terrier, chocolate syrup, standard schnauzer and sorrel. Columns b, c, d show the masks generated by our masking models, each trained on a different black box classifier (from left to right: AlexNet, GoogleNet, ResNet-50). Last two columns e, f show saliency maps for GoogleNet generated respectively by gradient [11] and the recently introduced iterative mask optimisation approach [2]. label. In figure 5 it can be clearly seen that the quality of masks generated by our models clearly outperforms alternative approaches. The masks produced by models trained on GoogleNet and ResNet are sharp and precise and would produce accurate object segmentations. The saliency model trained on AlexNet produces much stronger and slightly larger saliency regions, possibly because AlexNet is a less powerful model which needs more evidence for successful classification. Additional examples can be seen in the appendix A. 5.1 Weakly supervised object localisation As discussed in section 3.2 a standard method to evaluate produced saliency maps is by object localisation accuracy. It should be noted that our model was not provided any localisation data during training and was trained using only image-class label pairs (weakly supervised training). We adopt the localisation accuracy evaluation protocol from [1] and provide the ground truth label to the masking model. Afterwards, we threshold the produced saliency map at 0.5 and the tightest bounding box that contains the whole saliency map is set as the final localisation box. The localisation box has to have IOU greater than 0.5 with any of the ground truth bounding boxes in order to consider the localisation successful, otherwise, it is counted as an error. The calculated error rates for the three models are presented in table 1. The lowest localisation error of 36.7% was achieved by the saliency model trained on the ResNet-50 black box, this is a good achievement considering the fact that our method was not given any localisation training data and that a fully supervised approach employed by VGG [10] achieved only slightly lower error of 34.3%. The localisation error of the model trained on GoogleNet is very similar to the one trained on ResNet. This is not surprising because both models produce very similar saliency masks (see figure 5). The AlexNet trained model, on the other hand, has a considerably higher localisation error which is probably a result of AlexNet needing larger image contexts to make a successful prediction (and therefore producing saliency masks which are slightly less precise). We also compared our object localisation errors to errors achieved by other weakly supervised methods and existing saliency detection techniques. As a baseline we calculated the localisation error 7 Alexnet [5] GoogleNet [14] ResNet-50 [3] Localisation Err (%) 39.8 36.9 36.7 Table 1: Weakly supervised bounding box localisation error on ImageNet validation set for our masking models trained with different black box classifiers. of the centrally placed rectangle which spans half of the image area — which we name "Center". The results are presented in table 2. It can be seen that our model outperforms other approaches, sometimes by a significant margin. It also performs significantly better than the baseline (centrally placed box) and iteratively optimised saliency masks. Because a big fraction of ImageNet images have a large, dominant object in the center, the localisation accuracy of the centrally placed box is relatively high and it managed to outperform two methods from the previous literature. Center Grad [11] Guid [12] CAM [18] Exc [16] Feed [1] Mask [2] This Work 46.3 41.7 42.0 48.1 39.0 38.7 43.1 36.9 Table 2: Localisation errors(%) on ImageNet validation set for popular weakly supervised methods. Error rates were taken from [2] which recalculated originally reported results using few different mask thresholding techniques and achieved slightly lower error rates. For a fair comparison, all the methods follow the same evaluation protocol of [1] and produce saliency maps for GoogleNet classifier [14]. 5.2 Evaluating the saliency metric To better assess the interpretability of the produced masks we calculate the saliency metric introduced in section 3.2 for selected saliency methods and present the results in the table 3. We include a few baseline approaches — the "Central box" introduced in the previous section, and the "Max box" which simply corresponds to a box spanning the whole image. We also calculate the saliency metric for the ground truth bounding boxes supplied with the data, and in case the image contains more than one ground truth box the saliency metric is set as the average over all the boxes. Table 3 shows that our model achieves a considerably better saliency metric than other saliency approaches. It also significantly outperforms max box and center box baselines and is on par with ground truth boxes which supports the claim that the interpretability of the localisation boxes generated by our model is similar to that of the ground truth boxes. Localisation Err (%) Saliency Metric Ground truth boxes (baseline) 0.00 0.284 Max box (baseline) 59.7 1.366 Center box (baseline) 46.3 0.645 Grad [11] 41.7 0.451 Exc [16] 39.0 0.415 Masking model (this work) 36.9 0.318 Table 3: ImageNet localisation error and the saliency metric for GoogleNet. 5.3 Detecting saliency of CIFAR-10 To verify the performance of our method on a completely different dataset we implemented our saliency detection model for the CIFAR-10 dataset [4]. Because the architecture described in section 4 specifically targets high-resolution images and five downsampling blocks would be too much for 32x32 images, we modified the architecture slightly and replaced the ResNet encoder with just 3 downsampling blocks with 5 convolutional layers each. We also reduced the number of bottleneck blocks in each upsampling block from 3 to 1. Unlike before, with this experiment, we did not use a pre-trained masking model, but instead a randomly initialised one. We used a FitNet [7] trained to 92% validation accuracy as a black box classifier to train the masking model. All the training parameters were used following the ImageNet model. 8 Figure 6: Saliency maps generated by our model for images from CIFAR-10 validation set. The masking model was trained for 20 epochs. Saliency maps for sample images from the validation set are shown in figure 6. It can be seen that the produced maps are clearly interpretable and a human could easily recognise the original objects after masking. This confirms that the masking model works as expected even at low resolution and that FitNet model, used as a black box learned correct representations for the CIFAR-10 classes. More interestingly, this shows that the masking model does not need to rely on a pre-trained model which might inject its own biases into the generated masks. 6 Conclusion and Future Research In this work, we have presented a new, fast, and accurate saliency detection method that can be applied to any differentiable image classifier. Our model is able to produce 100 saliency masks per second, sufficient for real-time applications. We have shown that our method outperforms other weakly supervised techniques at the ImageNet localisation task. We have also developed a new saliency metric that can be used to assess the quality of explanations produced by saliency detectors. Under this new metric, the quality of explanations produced by our model outperforms other popular saliency detectors and is on par with ground truth bounding boxes. The model-based nature of our technique means that our work can be extended by improving the architecture of the masking network, or by changing the objective function to achieve any desired properties for the output mask. Future work includes modifying the approach to produce high quality, weakly supervised, image segmentations. Moreover, because our model can be run in real-time, it can be used for video saliency detection to instantly explain decisions made by black-box classifiers such as the ones used in autonomous vehicles. Lastly, our model might have biases of its own — a fact which does not seem to influence the model performance in finding biases in other black boxes according to the various metrics we used. It would be interesting to study the biases embedded into our masking model itself, and see how these affect the generated saliency masks. 9 References [1] Chunshui Cao, Xianming Liu, Yi Yang, Yinan Yu, Jiang Wang, Zilei Wang, Yongzhen Huang, Liang Wang, Chang Huang, Wei Xu, Deva Ramanan, and Thomas S. Huang. Look and think twice: Capturing top-down visual attention with feedback convolutional neural networks. pages 2956–2964, 2015. doi: 10.1109/ICCV.2015.338. URL http://dx.doi.org/10.1109/ICCV.2015.338. [2] Ruth Fong and Andrea Vedaldi. Interpretable Explanations of Black Boxes by Meaningful Perturbation. arXiv preprint arXiv:1704.03296, 2017. [3] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. URL http://arxiv.org/abs/1512.03385. [4] Alex Krizhevsky. Learning Multiple Layers of Features from Tiny Images. Master’s thesis, 2009. URL http://www.cs.toronto.edu/~{}kriz/learning-features-2009-TR.pdf. [5] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 1097–1105. Curran Associates, Inc., 2012. URL http://papers.nips.cc/paper/ 4824-imagenet-classification-with-deep-convolutional-neural-networks.pdf. [6] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1135–1144. ACM, 2016. [7] Adriana Romero, Nicolas Ballas, Samira Ebrahimi Kahou, Antoine Chassang, Carlo Gatta, and Yoshua Bengio. FitNets: Hints for Thin Deep Nets. CoRR, abs/1412.6550, 2014. URL http://arxiv.org/ abs/1412.6550. [8] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. CoRR, abs/1505.04597, 2015. URL http://arxiv.org/abs/1505.04597. [9] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211–252, 2015. doi: 10.1007/s11263-015-0816-y. [10] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. CoRR, abs/1409.1556, 2014. URL http://arxiv.org/abs/1409.1556. [11] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. CoRR, abs/1312.6034, 2013. URL http://arxiv.org/ abs/1312.6034. [12] Jost Tobias Springenberg, Alexey Dosovitskiy, Thomas Brox, and Martin A. Riedmiller. Striving for simplicity: The all convolutional net. CoRR, abs/1412.6806, 2014. URL http://arxiv.org/abs/1412. 6806. [13] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. CoRR, abs/1312.6199, 2013. URL http: //arxiv.org/abs/1312.6199. [14] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. CoRR, abs/1409.4842, 2014. URL http://arxiv.org/abs/1409.4842. [15] Matthew D. Zeiler and Rob Fergus. Visualizing and Understanding Convolutional Networks. CoRR, abs/1311.2901, 2013. URL http://arxiv.org/abs/1311.2901. [16] Jianming Zhang, Zhe Lin, Jonathan Brandt, Xiaohui Shen, and Stan Sclaroff. Top-down neural attention by excitation backprop. 2016. URL https://www.robots.ox.ac.uk/~vgg/rg/papers/zhang_eccv16. pdf. [17] Bolei Zhou, Aditya Khosla, Àgata Lapedriza, Aude Oliva, and Antonio Torralba. Object Detectors Emerge in Deep Scene CNNs. CoRR, abs/1412.6856, 2014. URL http://arxiv.org/abs/1412.6856. [18] Bolei Zhou, Aditya Khosla, Àgata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. CoRR, abs/1512.04150, 2015. URL http://arxiv.org/abs/1512.04150. 10
2017
1
6,563
Accelerated consensus via Min-Sum Splitting Patrick Rebeschini Department of Statistics University of Oxford patrick.rebeschini@stats.ox.ac.uk Sekhar Tatikonda Department of Electrical Engineering Yale University sekhar.tatikonda@yale.edu Abstract We apply the Min-Sum message-passing protocol to solve the consensus problem in distributed optimization. We show that while the ordinary Min-Sum algorithm does not converge, a modified version of it known as Splitting yields convergence to the problem solution. We prove that a proper choice of the tuning parameters allows Min-Sum Splitting to yield subdiffusive accelerated convergence rates, matching the rates obtained by shift-register methods. The acceleration scheme embodied by Min-Sum Splitting for the consensus problem bears similarities with lifted Markov chains techniques and with multi-step first order methods in convex optimization. 1 Introduction Min-Sum is a local message-passing algorithm designed to distributedly optimize an objective function that can be written as a sum of component functions, each of which depends on a subset of the decision variables. Due to its simplicity, Min-Sum has emerged as canonical protocol to address large scale problems in a variety of domains, including signal processing, statistics, and machine learning. For problems supported on tree graphs, the Min-Sum algorithm corresponds to dynamic programming and is guaranteed to converge to the problem solution. For arbitrary graphs, the ordinary Min-Sum algorithm may fail to converge, or it may converge to something different than the problem solution [28]. In the case of strictly convex objective functions, there are known sufficient conditions to guarantee the convergence and correctness of the algorithm. The most general condition requires the Hessian of the objective function to be scaled diagonally dominant [28, 25]. While the Min-Sum scheme can be applied to optimization problems with constraints, by incorporating the constraints into the objective function as hard barriers, the known sufficient conditions do not apply in this case. In [34], a generalization of the traditional Min-Sum scheme has been proposed, based on a reparametrization of the original objective function. This algorithm is called Splitting, as it can be derived by creating equivalent graph representations for the objective function by “splitting” the nodes of the original graph. In the case of unconstrained problems with quadratic objective functions, where Min-Sum is also known as Gaussian Belief Propagation, the algorithm with splitting has been shown to yield convergence in settings where the ordinary Min-Sum does not converge [35]. To date, a theoretical investigation of the rates of convergence of Min-Sum Splitting has not been established. In this paper we establish rates of convergence for the Min-Sum Splitting algorithm applied to solve the consensus problem, which can be formulated as an equality-constrained problem in optimization. The basic version of the consensus problem is the network averaging problem. In this setting, each node in a graph is assigned a real number, and the goal is to design a distributed protocol that allows the nodes to iteratively exchange information with their neighbors so to arrive at consensus on the average across the network. Early work include [42, 41]. The design of distributed algorithms to solve the averaging problem has received a lot of attention recently, as consensus represents a widely-used primitive to compute aggregate statistics in a variety of fields. Applications include, for instance, estimation problems in sensor networks, distributed tracking and localization, multi-agents coordination, and distributed inference [20, 21, 9, 19]. Consensus is typically combined with some 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. form of local optimization over a peer-to-peer network, as in the case of iterative subgradient methods [29, 40, 17, 10, 6, 16, 39]. In large-scale machine learning, consensus is used as a tool to distribute the minimization of a loss function over a large dataset into a network of processors that can exchange and aggregate information, and only have access to a subset of the data [31, 11, 26, 3]. Classical algorithms to solve the network averaging problem involve linear dynamical systems supported on the nodes of the graph. Even when the coefficients that control the dynamics are optimized, these methods are known to suffer from a “diffusive” rate of convergence, which corresponds to the rate of convergence to stationarity exhibited by the “diffusion” random walk naturally associated to a graph [44, 2]. This rate is optimal for graphs with good expansion properties, such as complete graphs or expanders. In this case the convergence time, i.e., the number of iterations required to reach a prescribed level of error accuracy ε > 0 in the ℓ2 norm relative to the initial condition, scales independently of the dimension of the problem, as Θ(log 1/ε). For graphs with geometry this rate is suboptimal [7], and it does not yield a convergence time that matches the lower bound Ω(D log 1/ε), where D is the graph diameter [37, 36]. For example, in both cycle graphs and in grid-like topologies the number of iterations scale like Θ(D2 log 1/ε) (if n is the number of nodes, D ∼n in a cycle and D ∼√n in a two-dimensional torus). Θ(D2 log 1/ε) is also the convergence time exhibited in random geometric graphs, which represent the relevant topologies for many applications in sensor networks [9]. In [7] it was established that for a class of graphs with geometry (polynomial growth or finite doubling dimension), the mixing time of any reversible Markov chain scales at least like D2, embodying the fact that symmetric walks on these graphs take D2 steps to travel distances of orderD. Min-Sum schemes to solve the consensus problem have been previously investigated in [27]. The authors show that the ordinary Min-Sum algorithm does not converge in graphs with cycles. They investigate a modified version of it that uses a soft barrier function to incorporate the equality constrains into the objective function. In the case of d-regular graphs, upon a proper choice of initial conditions, the authors show that the algorithm they propose reduces to a linear process supported on the directed edges of the graph, and they characterize the convergence time of the algorithm in terms of the Cesàro mixing time of a Markov chain defined on the set of directed edges of the original graph. In the case of cycle graphs (i.e., d = 2), they prove that the mixing time scales like O(D), which yields the convergence time O(D/ε log 1/ε). See Theorem 4 and Theorem 5 in [27]. In the case of (d/2)-dimensional tori (D ∼n2/d), they conjecture that the mixing time is Θ(D2(d−1)/d), but do not present bounds for the convergence time. See Conjecture 1 in [27]. For other graph topologies, they leave the mixing time (and convergence time) achieved by their method as an open question. In this paper we show that the Min-Sum scheme based on splitting yields convergence to the consensus solution, and we analytically establish rates of convergence for any graph topology. First, we show that a certain parametrization of the Min-Sum protocol for consensus yields a linear message-passing update for any graph and for any choice of initial conditions. Second, we show that the introduction of the splitting parameters is not only fundamental to guarantee the convergence and correctness of the Min-Sum scheme in the consensus problem, but that proper tuning of these parameters yields accelerated (i.e., “subdiffusive”) asymptotic rates of convergence. We establish a square-root improvement for the asymptotic convergence time over diffusive methods, which allows Min-Sum Splitting to scale like O(D log(D/ε)) for cycles and tori. Our results show that Min-Sum schemes are competitive and get close to the optimal rate O(D log(1/ε)) recently established for some algorithms based on Nesterov’s acceleration [30, 36]. The main tool used for the analysis involves the construction of an auxiliary linear process supported on the nodes of the original graph to track the evolution of the Min-Sum Splitting algorithm, which is instead supported on the directed edges. This construction allows us to relate the convergence time of the Min-Sum scheme to the spectral gap of the matrix describing the dynamics of the auxiliary process, which is easier to analyze than the matrix describing the dynamics on the edges as in [27]. In the literature, overcoming the suboptimal convergence rate of classical algorithms for network averaging consensus has motivated the design of several accelerated methods. Two main lines of research have been developed, and seem to have evolved independently of each others: one involves lifted Markov chains techniques, see [37] for a review, the other involves accelerated first order methods in convex optimization, see [13] for a review. Another contribution of this paper is to show that Min-Sum Splitting bears similarities with both types of accelerated methods. On the one hand, Min-Sum can be seen as a process on a lifted space, which is the space of directed edges in the original graph. Here, splitting is seen to introduce a directionality in the message exchange of the ordinary Min-Sum protocol that is analogous to the directionality introduced in non-reversible 2 random walks on lifted graphs to achieve faster convergence to stationarity. The advantage of the Min-Sum algorithm over lifted Markov chain methods is that no lifted graph needs to be constructed. On the other hand, the directionality induced on the edges by splitting translates into a memory term for the auxiliary algorithm running on the nodes. This memory term, which allows nodes to remember previous values and incorporate them into the next update, directly relates the Min-Sum Splitting algorithm to accelerated multi-step first order methods in convex optimization. In particular, we show that a proper choice of the splitting parameters recovers the same matrix that support the evolution of shift-register methods used in numerical analysis for linear solvers, and, as a consequence, we recover the same accelerated rate of convergence for consensus [45, 4, 24]. To summarize, the main contributions of this paper are: 1. First connection of Min-Sum schemes with lifted Markov chains techniques and multi-step methods in convex optimization. 2. First proof of how the directionality embedded in Belief Propagation protocols can be tuned and exploited to accelerate the convergence rate towards the problem solution. 3. First analysis of convergence rates for Min-Sum Splitting. New proof technique based on the introduction of an auxiliary process to track the evolution of the algorithm on the nodes. 4. Design of a Min-Sum protocol for the consensus problem that achieves better convergence rates than the ones established (and conjectured) for the Min-Sum method in [27]. Our results motivate further studies to generalize the acceleration due to splittings to other problems. The paper is organized as follows. In Section 2 we introduce the Min-Sum Splitting algorithm in its general form. In Section 3 we describe the consensus problem and review the classical diffusive algorithms. In Section 4 we review the main accelerated methods that have been proposed in the literature. In Section 5 we specialize the Min-Sum Splitting algorithm to the consensus problem, and show that a proper parametrization yields a linear exchange of messages supported on the directed edges of the graph. In Section 6 we derive the auxiliary message-passing algorithm that allows us to track the evolution of the Min-Sum Splitting algorithm via a linear process with memory supported on the nodes of the graph. In Section 7 we state Theorem 1, which shows that a proper choice of the tuning parameters recovers the rates of shift-registers. Proofs are given in the supplementary material. 2 The Min-Sum Splitting algorithm The Min-Sum algorithm is a distributed routine to optimize a cost function that is the sum of components supported on a given graph structure. Given a simple graph G = (V, E) with n := |V | vertices and m := |E| edges, let us assume that we are given a set of functions φv : R →R ∪{∞}, for each v ∈V , and φvw = φwv : R × R →R ∪{∞}, for each {v, w} ∈E, and that we want to solve the following problem over the decision variables x = (xv)v∈V ∈RV : minimize X v∈V φv(xv) + X {v,w}∈E φvw(xv, xw). (1) The Min-Sum algorithm describes an iterative exchange of messages—which are functions of the decision variables—associated to each directed edge in G. Let E := {(v, w) ∈V ×V : {v, w} ∈E} be the set of directed edges associated to the undirected edges in E (each edge in E corresponds to two edges in E). In this work we consider the synchronous implementation of the Min-Sum algorithm where at any given time step s, each directed edge (v, w) ∈E supports two messages, ˆξs vw, ˆµs vw : R →R ∪{∞}. Messages are computed iteratively. Given an initial choice of messages ˆµ0 = (ˆµ0 vw)(v,w)∈E, the Min-Sum scheme that we investigate in this paper is given in Algorithm 1. Henceforth, for each v ∈V , let N(v) := {w ∈V : {v, w} ∈E} denote the neighbors of node v. The formulation of the Min-Sum scheme given in Algorithm 1, which we refer to as Min-Sum Splitting, was introduced in [34]. This formulation admits as tuning parameters the real number δ ∈R and the symmetric matrix Γ = (Γvw)v,w∈V ∈RV ×V . Without loss of generality, we assume that the sparsity of Γ respects the structure of the graph G, in the sense that if {v, w} ̸∈E then Γvw = 0 (note that Algorithm 1 only involves summations with respect to nearest neighbors in the graph). The choice of δ = 1 and Γ = A, where A is the adjacency matrix defined as Avw := 1 if {v, w} ∈E and Avw := 0 otherwise, yields the ordinary Min-Sum algorithm. For 3 Algorithm 1: Min-Sum Splitting Input: Messages ˆµ0 = (ˆµ0 vw)(v,w)∈E; parameters δ ∈R and Γ ∈RV ×V symmetric; time t ≥1. for s ∈{1, . . . , t} do ˆξs wv = φv/δ −ˆµs−1 wv + P z∈N (v) Γzv ˆµs−1 zv , (w, v) ∈E; ˆµs wv = minz∈R{φvw( · , z)/Γvw + (δ −1)ˆξs wv + δˆξs vw(z)}, (w, v) ∈E; µt v = φv + δ P w∈N (v) Γwv ˆµt wv, v ∈V ; Output: xt v = arg minz∈R µt v(z), v ∈V . an arbitrary choice of strictly positive integer parameters, Algorithm 1 can be seen to correspond to the ordinary Min-Sum algorithm applied to a new formulation of the original problem, where an equivalent objective function is obtained from the original one in (1) by splitting each term φvw into Γvw ∈N \ {0} terms, and each term φv into δ ∈N \ {0} terms. Namely, minimize P v∈V Pδ k=1 φk v(xv) + P {v,w}∈E PΓvw k=1 φk vw(xv, xw), with φk v := φv/δ and φk vw := φvw/Γvw.1 Hence the reason for the name “splitting” algorithm. Despite this interpretation, Algorithm 1 is defined for any real choice of parameters δ and Γ. In this paper we investigate the convergence behavior of the Min-Sum Splitting algorithm for some choices of δ and Γ, in the case of the consensus problem that we define in the next section. 3 The consensus problem and standard diffusive algorithms Given a simple graph G = (V, E) with n := |V | nodes, for each v ∈V let φv : R →R ∪{∞} be a given function. The consensus problem is defined as follows: minimize X v∈V φv(xv) subject to xv = xw, {v, w} ∈E. (2) We interpret G as a communication graph where each node represents an agent, and each edge represent a communication channel between neighbor agents. Each agent v is given the function φv, and agents collaborate by iteratively exchanging information with their neighbors in G with the goal to eventually arrive to the solution of problem (2). The consensus problem amounts to designing distributed algorithms to solve problem (2) that respect the communication constraints encoded by G. A classical setting investigated in the literature is the least-square case yielding the network averaging problem, where for a given b ∈RV we have2 φv(z) := 1 2z2 −bvz and the solution of problem (2) is ¯b := 1 n P v∈V bv. In this setup, each agent v ∈V is given a number bv, and agents want to exchange information with their neighbors according to a protocol that allows each of them to eventually reach consensus on the average ¯b across the entire network. Classical algorithms to solve this problem involve a linear exchange of information of the form xt = Wxt−1 with x0 = b, for a given matrix W ∈RV ×V that respects the topology of the graph G (i.e., Wvw ̸= 0 only if {v, w} ∈E or v = w), so that W t →11T /n for t →∞, where 1 is the all ones vector. This linear iteration allows for a distributed exchange of information among agents, as at any iteration each agent v ∈V only receives information from his/her neighbors N(v) via the update: xt v = Wvvxt−1 v + P w∈N (v) Wvwxt−1 w . The original literature on this problem investigates the case where the matrix W has non-negative coefficients and represents the transition matrix of a random walk on the nodes of the graph G, so that Wvw is interpreted as the probability that a random walk at node v visits node w in the next time step. A popular choice is given by the Metropolis-Hastings method [37], which involved the doubly-stochastic matrix W MH defined as W MH vw := 1/(2dmax) if {v, w} ∈E, W MH vw := 1 −dv/(2dmax) if w = v, and W MH vw := 0 otherwise, where dv := |N(v)| is the degree of node v, and dmax := maxv∈V dv is the maximum degree of the graph G. 1As mentioned in [34], one can also consider a more general formulation of the splitting algorithm with δ →(δv)v∈V ∈R (possibly also with time-varying parameters). The current choice of the algorithm is motivated by the fact that in the present case the output of the algorithm can be tracked by analyzing a linear system on the nodes of the graph, as we will show in Section 5. 2In the literature, the classical choice is φv(z) := 1 2 P v∈V (z −bv)2, which yields the same results as the quadratic function that we define in the main text, as constant terms in the objective function do not alter the optimal point of the problem but only the optimal value of the objective function. 4 In [44], necessary and sufficient conditions are given for a generic matrix W to satisfy W t →11T /n, namely, 1T W = 1T , W1 = 1, and ρ(W −11T /n) < 1, where ρ(M) denotes the spectral radius of a given matrix M. The authors show that the problem of choosing the optimal symmetric matrix W that minimizes ρ(W −11T /n) = ∥W −11T /n∥— where ∥M∥denotes the spectral norm of a matrix M that coincides with ρ(M) if M is symmetric — is a convex problem and it can be cast as a semi-definite program. Typically, the optimal matrix involves negative coefficients, hence departing from the random walk interpretation. However, even the optimal choice of symmetric matrix is shown to yield a diffusive rate of convergence, which is already attained by the matrix W MH [7]. This rate corresponds to the speed of convergence to stationarity achieved by the diffusion random walk, defined as the Markov chain with transition matrix diag(d)−1A, where diag(d) ∈RV ×V is the degree matrix, i.e., diagonal with diag(d)vv := dv, and A ∈RV ×V is the adjacency matrix, i.e., symmetric with Avw := 1 if {v, w} ∈E, and Avw := 0 otherwise. For instance, the condition ∥W −11T /n∥t ≤ε, where ∥· ∥is the ℓ2 norm, yields a convergence time that scales like t ∼Θ(D2 log(1/ε)) in cycle graphs and tori [33], where D is the graph diameter. The authors in [7] established that for a class of graphs with geometry (polynomial growth or finite doubling dimension) the mixing time of any reversible Markov chain scales at least like D2, and it is achieved by Metropolis-Hastings [37]. 4 Accelerated algorithms To overcome the diffusive behavior typical of classical consensus algorithms, two main types of approaches have been investigated in the literature, which seem to have been developed independently. The first approach involves the construction of a lifted graph bG = (bV , bE) and of a linear system supported on the nodes of it, of the form ˆxt = c W ˆxt−1, where c W ∈RbV ×bV is the transition matrix of a non-reversible Markov chain on the nodes of bG. This approach has its origins in the work of [8] and [5], where it was observed for the first time that certain non-reversible Markov chains on properly-constructed lifted graphs yield better mixing times than reversible chains on the original graphs. For some simple graph topologies, such as cycle graphs and two-dimensional grids, the construction of the optimal lifted graphs is well-understood already from the works in [8, 5]. A general theory of lifting in the context of Gossip algorithms has been investigated in [18, 37]. However, this construction incurs additional overhead, which yield non-optimal computational complexity, even for cycle graphs and two-dimensional grids. Typically, lifted random walks on arbitrary graph topologies are constructed on a one-by-one case, exploiting the specifics of the graph at hand. This is the case, for instance, for random geometric graphs [22, 23]. The key property that allows non-reversible lifted Markov chains to achieve subdiffusive rates is the introduction of a directionality in the process to break the diffusive nature of reversible chains. The strength of the directionality depends on global properties of the original graph, such as the number of nodes [8, 5] or the diameter [37]. See Figure 1. 1/2 1/2 (a) 1−1/n 1/n 1−1/n 1/n (b) 1 1 (c) ≈1−1/n ≈−1/n (d) Figure 1: (a) Symmetric Markov chain W on the nodes of the ring graph G. (b) Non-reversible Markov chain c W on the nodes of the lifted graph bG [8]. (c) Ordinary Min-Sum algorithm on the directed edges E associated to G (i.e., bK(δ, Γ), Algorithm 2, with δ = 1 and Γ = A, where A is the adjacency matrix of G). (d) Min-Sum Splitting bK(δ, Γ), Algorithm 2, with δ = 1, Γ = γW, γ = 2/(1 + p 1 −ρ2 W ) as in Theorem 1. Here, ρW is Θ(1 −1/n2) and γ ≈2(1 −1/n) for n large. The matrix bK(δ, Γ) has negative entries, departing from the Markov chain interpretation. This is also the case for the optimal tuning in classical consensus schemes [44] and for the ADMM lifting in [12]. The second approach involves designing linear updates that are supported on the original graph G and keep track of a longer history of previous iterates. This approach relies on the fact that the original consensus update xt = Wxt−1 can be interpreted as a primal-dual gradient ascent method to solve problem (2) with a quadratic objective function [32]. This allows the implementation of accelerated 5 gradient methods. To the best of our knowledge, this idea was first introduced in [14], and since then it has been investigated in many other papers. We refer to [13, 24], and references in there, for a review and comparison of multi-step accelerated methods for consensus. The simplest multi-step extension of gradient methods is Polyak’s “heavy ball,” which involves adding a “momentum” term to the standard update and yields a primal iterate of the form xt = Wxt−1 + γ(xt−1 −xt−2). Another popular multi-step method involves Nesterov’s acceleration, and yields xt = (1 + γ)Wxt−1 −γWxt−2. Aligned with the idea of adding a momentum term is the idea of adding a shift register term, which yields xt = (1 + γ)Wxt−1 −γxt−2. For our purposes, we note that these methods can be written as  xt xt−1  = K  xt−1 xt−2  , (3) for a certain matrix K ∈R2n×2n. As in the case of lifted Markov chains techniques, also multi-step methods are able to achieve accelerated rates by exploiting some form of global information: the choice of the parameter γ that yields subdiffusive rates depends on the eigenvalues of W. Remark 1. Beyond lifted Markov chains techniques and accelerated first order methods, many other algorithms have been proposed to solve the consensus problem. The literature is vast. As we focus on Min-Sum schemes, an exhaustive literature review on consensus is beyond the scope of our work. Of particular interest for our results is the distributed ADMM approach [3, 43, 38]. Recently in [12], for a class of unconstrained problems with quadratic objective functions, it has been shown that message-passing ADMM schemes can be interpreted as lifting of gradient descent techniques. This prompts for further investigation to connect Min-Sum, ADMM, and accelerated first order methods. In the next two sections we show that Min-Sum Splitting bears similarities with both types of accelerated methods described above. On the one hand, in Section 5 we show that the estimates xt v’s of Algorithm 1 applied to the network averaging problem can be interpreted as the result of a linear process supported on a lifted space, i.e., the space E of directed edges associated to the undirected edges of G. On the other hand, in Section 6 we show that the estimates xt v’s can be seen as the result of a linear multi-step process supported on the nodes of G, which can be written as in (3). Later on, in Section 7 and Section 8, we will see that the similarities just described go beyond the structure of the processes, and they extend to the acceleration mechanism itself. In particular, the choice of splitting parameters that yields subdiffusive convergence rates, matching the asymptotic rates of shift register methods, is also shown to depend on global information about G. 5 Min-Sum Splitting for consensus We apply Min-Sum Splitting to solve network averaging. We show that in this case the messagepassing protocol is a linear exchange of parameters associated to the directed edges in E. Given δ ∈R and Γ ∈RV ×V symmetric, let ˆh(δ) ∈RE be the vector defined as ˆh(δ)wv := bw + (1 −1/δ)bv, and let bK(δ, Γ) ∈RE×E be matrix defined as bK(δ, Γ)wv,zu :=              δΓzw if u = w, z ∈N(w) \ {v}, δ(Γvw −1) if u = w, z = v, (δ −1)Γzv if u = v, z ∈N(v) \ {w}, (δ −1)(Γwv −1) if u = v, z = w, 0 otherwise. (4) Consider Algorithm 2 with initial conditions ˆR0 = ( ˆR0 vw)(v,w)∈E ∈RE, ˆr0 = (ˆr0 vw)(v,w)∈E ∈RE. Algorithm 2: Min-Sum Splitting, consensus problem, quadratic case Input: ˆR0, ˆr0 ∈RE; δ ∈R, Γ ∈RV ×V symmetric; bK(δ, Γ) defined in (5); t ≥1. for s ∈{1, . . . , t} do ˆRs = (2 −1/δ)1 + bK(δ, Γ) ˆRs−1; ˆrs = ˆh(δ) + bK(δ, Γ)ˆrs−1; Output: xt v := bv+δ P w∈N (v) Γwv ˆrt wv 1+δ P w∈N (v) Γwv ˆ Rtwv , v ∈V . 6 Proposition 1. Let δ ∈R and Γ ∈RV ×V symmetric be given. Consider Algorithm 1 applied to problem (2) with φv(z) := 1 2z2−bvz and with quadratic initial messages: ˆµ0 vw(z) = 1 2 ˆR0 vwz2−ˆr0 vwz, for some ˆR0 vw > 0 and ˆr0 vw ∈R. Then, the messages will remain quadratic, i.e., ˆµs vw(z) = 1 2 ˆRs vwz2− ˆrs vwz for any s ≥1, and the parameters evolve as in Algorithm 2. If 1 + δ P w∈N (v) Γwv ˆRt wv > 0 for any v ∈V and t ≥1, then the output of Algorithm 2 coincides with the output of Algorithm 1. 6 Auxiliary message-passing scheme We show that the output of Algorithm 2 can be tracked by a new message-passing scheme that corresponds to a multi-step linear exchange of parameters associated to the nodes of G. This auxiliary algorithm represents the main tool to establish convergence rates for the Min-Sum Splitting protocol, i.e., Theorem 1 below. The intuition behind the auxiliary process is that while Algorithm 1 (hence, Algorithm 2) involves an exchange of messages supported on the directed edges E, the computation of the estimates xt v’s only involve the belief functions µt v’s, which are supported on the nodes of G. Due to the simple nature of the pairwise equality constraints in the consensus problem, in the present case a reparametrization allows to track the output of Min-Sum via an algorithm that directly updates the belief functions on the nodes of the graph, which yields Algorithm 3. Given δ ∈R and Γ ∈Rn×n symmetric, define the matrix K(δ, Γ) ∈R2n×2n as K(δ, Γ) :=  (1 −δ)I −(1 −δ)diag(Γ1) + δΓ δI δI −δdiag(Γ1) + (1 −δ)Γ (1 −δ)I  , (5) where I ∈RV ×V is the identity matrix and diag(Γ1) ∈RV ×V is diagonal with (diag(Γ1))vv = (Γ1)v = P w∈N (v) Γvw. Consider Algorithm 3 with initial conditions R0, r0, Q0, q0 ∈RV . Algorithm 3: Auxiliary message-passing Input: R0, r0, Q0, q0 ∈RV ; δ ∈R, Γ ∈RV ×V symmetric; K(δ, Γ) defined in (5); t ≥1. for s ∈{1, . . . , t} do  rs qs  = K(δ, Γ)  rs−1 qs−1  ;  Rs Qs  = K(δ, Γ)  Rs−1 Qs−1  ; Output: xt v := rt v/Rt v, v ∈V . Proposition 2. Let δ ∈R and Γ ∈RV ×V symmetric be given. The output of Algorithm 2 with initial conditions ˆR0, ˆr0 ∈RE is the output of Algorithm 3 with R0 v := 1 + δ P w∈N (v) Γwv ˆR0 wv, Q0 v := 1 −δ P w∈N (v) Γwv ˆR0 wv, r0 v := bv + δ P w∈N (v) Γwvˆr0 wv, and q0 v := bv −δ P w∈N (v) Γvwˆr0 vw. Proposition 2 shows that upon proper initialization, the outputs of Algorithm 2 and Algorithm 3 are equivalent. Hence, Algorithm 3 represents a tool to investigate the convergence behavior of the Min-Sum Splitting algorithm. Analytically, the advantage of the formulation given in Algorithm 3 over the one given in Algorithm 2 is that the former involves two coupled systems of n equations whose convergence behavior can explicitly be linked to the spectral properties of the n × n matrix Γ, as we will see in Theorem 1 below. On the contrary, the linear system of 2m equations in Algorithm 2 does not seem to exhibit an immediate link to the spectral properties of Γ. In this respect, we note that the previous paper that investigated Min-Sum schemes for consensus, i.e., [27], characterized the convergence rate of the algorithm under consideration — albeit only in the case of d-regular graphs, and upon initializing the quadratic terms to the fix point — in terms of the spectral gap of a matrix that controls a linear system of 2m equations. However, the authors only list results on the behavior of this spectral gap in the case of cycle graphs, i.e., d = 2, and present a conjecture for 2d-tori. 7 Accelerated convergence rates for Min-Sum Splitting We investigate the convergence behavior of the Min-Sum Splitting algorithm to solve problem (2) with quadratic objective functions. Henceforth, without loss of generality, let b ∈RV be given with 0 < bv < 1 for each v ∈V , and let φv(z) := 1 2z2 −bvz. Define ¯b := P v∈V bv/n. Recall from [27] that the ordinary Min-Sum algorithm (i.e., Algorithm 2 with δ = 1 and Γ = A, where A is the adjacency matrix of the graph G) does not converge if the graph G has a cycle. 7 We now show that a proper choice of the tuning parameters allows Min-Sum Splitting to converge to the problem solution in a subdiffusive way. The proof of this result, which is contained in the supplementary material, relies on the use of the auxiliary method defined in Algorithm 3 to track the evolution of the Min-Sum Splitting scheme. Here, recall that ∥x∥denotes the ℓ2 norm of a given vector x, ∥M∥denotes the ℓ2 matrix norm of the given matrix M, and ρ(M) its spectral radius. Theorem 1. Let W ∈RV ×V be a symmetric matrix with W1 = 1 and ρW := ρ(W −11T /n) < 1. Let δ = 1 and Γ = γW, with γ = 2/(1 + p 1 −ρ2 W ). Let xt be the output at time t of Algorithm 2 with initial conditions ˆR0 = ˆr0 = 0. Define K :=  γW I (1 −γ)I 0  , K∞:= 1 (2 −γ)n  11T 11T (1 −γ)11T (1 −γ)11T  . (6) Then, for any v ∈V we have limt→∞xt v = ¯b and ∥xt −¯b1∥≤4 √ 2n 2−γ ∥(K −K∞)t∥. The asymptotic rate of convergence is given by ρK := ρ(K −K∞) = limt→∞∥(K −K∞)t∥1/t = q (1− p 1−ρ2 W )/(1+ p 1−ρ2 W ) < ρW < 1, which satisfies 1 2 p 1/(1 −ρW ) ≤1/(1 −ρK) ≤ p 1/(1 −ρW ). Theorem 1 shows that the choice of splitting parameters δ = 1 and Γ = γW, where γ and W are defined as in the statement of the theorem, allows the Min-Sum Splitting scheme to achieve the asymptotic rate of convergence that is given by the second largest eigenvalue in magnitude of the matrix K defined in (6), i.e., the quantity ρK. The matrix K is the same matrix that describes shift-register methods for consensus [45, 4, 24]. In fact, the proof of Theorem 1 relies on the spectral analysis previously established for shift-registers, which can be traced back to [15]. See also [13, 24]. Following [27], let us consider the absolute measure of error given by ∥xt −¯b1∥/√n (recall that we assume 0 < bv < 1 so that ∥b∥≤√n). From Theorem 1 it follows that, asymptotically, we have ∥xt −¯b1∥/√n ≲4 √ 2ρt K/(2 −γ). If we define the asymptotic convergence time as the minimum time t so that, asymptotically, ∥xt −¯b1∥/√n ≲ε, then the Min-Sum Splitting scheme investigated in Theorem 1 has an asymptotic convergence time that is O(1/(1−ρK) log{[1/(1−ρK)]/ε}). Given the last bound in Theorem 1, this result achieves (modulo logarithmic terms) a square-root improvement over the convergence time of diffusive methods, which scale like Θ(1/(1 −ρW ) log 1/ε). For cycle graphs and, more generally, for higher-dimensional tori — where 1/(1 −ρW ) is Θ(D2) so that 1/(1−ρK) is Θ(D) [33, 1] — the convergence time is O(D log D/ε), where D is the graph diameter. As prescribed by Theorem 1, the choice of γ that makes the Min-Sum scheme achieve a subdiffusive rate depends on global properties of the graph G. Namely, γ depends on the quantity ρW , the second largest eigenvalue in magnitude of the matrix W. This fact connects the acceleration mechanism induced by splitting in the Min-Sum scheme to the acceleration mechanism of lifted Markov chains techniques (see Figure 1) and multi-step first order methods, as described in Section 4. It remains to be investigated how choices of splitting parameters different than the ones investigated in Theorem 1 affect the convergence behavior of the Min-Sum Splitting algorithm. 8 Conclusions The Min-Sum Splitting algorithm has been previously observed to yield convergence in settings where the ordinary Min-Sum protocol does not converge [35]. In this paper we proved that the introduction of splitting parameters is not only fundamental to guarantee the convergence of the Min-Sum scheme applied to the consensus problem, but that proper tuning of these parameters yields accelerated convergence rates. As prescribed by Theorem 1, the choice of splitting parameters that yields subdiffusive rates involves global type of information, via the spectral gap of a matrix associated to the original graph (see the choice of γ in Theorem 1). The acceleration mechanism exploited by Min-Sum Splitting is analogous to the acceleration mechanism exploited by lifted Markov chain techniques — where the transition matrix of the lifted random walks is typically chosen to depend on the total number of nodes in the graph [8, 5] or on its diameter [37] (global pieces of information) — and to the acceleration mechanism exploited by multi-step gradient methods — where the momentum/shift-register term is chosen as a function of the eigenvalues of a matrix supported on the original graph [13] (again, a global information). Prior to our results, this connection seems to have not been established in the literature. Our findings motivate further studies to generalize the acceleration due to splittings to other problem instances, beyond consensus. 8 Acknowledgements This work was partially supported by the NSF under Grant EECS-1609484. References [1] David Aldous and James Allen Fill. Reversible markov chains and random walks on graphs, 2002. Unfinished monograph, recompiled 2014, available at http://www.stat.berkeley. edu/~aldous/RWG/book.html. [2] S. Boyd, A. Ghosh, B. Prabhakar, and D. Shah. Randomized gossip algorithms. IEEE Transactions on Information Theory, 52(6):2508–2530, 2006. [3] Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, and Jonathan Eckstein. Distributed optimization and statistical learning via the alternating direction method of multipliers. Found. Trends Mach. Learn., 3(1):1–122, 2011. [4] Ming Cao, Daniel A. Spielman, and Edmund M. Yeh. Accelerated gossip algorithms for distributed computation. Proc. 44th Ann. Allerton Conf. Commun., Contr., Computat, pages 952 – 959, 2006. [5] Fang Chen, László Lovász, and Igor Pak. Lifting markov chains to speed up mixing. In Proceedings of the Thirty-first Annual ACM Symposium on Theory of Computing, pages 275– 281, 1999. [6] J. Chen and A. H. Sayed. Diffusion adaptation strategies for distributed optimization and learning over networks. IEEE Transactions on Signal Processing, 60(8):4289–4305, 2012. [7] P. Diaconis and L. Saloff-Coste. Moderate growth and random walk on finite groups. Geometric & Functional Analysis GAFA, 4(1):1–36, 1994. [8] Persi Diaconis, Susan Holmes, and Radford M. Neal. Analysis of a nonreversible markov chain sampler. The Annals of Applied Probability, 10(3):726–752, 2000. [9] A. G. Dimakis, S. Kar, J. M. F. Moura, M. G. Rabbat, and A. Scaglione. Gossip algorithms for distributed signal processing. Proceedings of the IEEE, 98(11):1847–1864, 2010. [10] John C. Duchi, Alekh Agarwal, and Martin J. Wainwright. Dual averaging for distributed optimization: Convergence analysis and network scaling. IEEE Trans. Automat. Contr., 57(3):592– 606, 2012. [11] Pedro A. Forero, Alfonso Cano, and Georgios B. Giannakis. Consensus-based distributed support vector machines. J. Mach. Learn. Res., 11:1663–1707, 2010. [12] G. França and J. Bento. Markov chain lifting and distributed admm. IEEE Signal Processing Letters, 24(3):294–298, 2017. [13] E. Ghadimi, I. Shames, and M. Johansson. Multi-step gradient methods for networked optimization. IEEE Transactions on Signal Processing, 61(21):5417–5429, 2013. [14] Bhaskar Ghosh, S. Muthukrishnan, and Martin H. Schultz. First and second order diffusive methods for rapid, coarse, distributed load balancing (extended abstract). In Proceedings of the Eighth Annual ACM Symposium on Parallel Algorithms and Architectures, pages 72–81, 1996. [15] Gene H. Golub and Richard S. Varga. Chebyshev semi-iterative methods, successive overrelaxation iterative methods, and second order richardson iterative methods. Numer. Math., 3(1):147–156, 1961. [16] D. Jakoveti´c, J. Xavier, and J. M. F. Moura. Fast distributed gradient methods. IEEE Transactions on Automatic Control, 59(5):1131–1146, May 2014. [17] Björn Johansson, Maben Rabi, and Mikael Johansson. A randomized incremental subgradient method for distributed optimization in networked systems. SIAM Journal on Optimization, 20(3):1157–1170, 2010. 9 [18] K. Jung, D. Shah, and J. Shin. Distributed averaging via lifted markov chains. IEEE Transactions on Information Theory, 56(1):634–647, 2010. [19] S. Kar, S. Aldosari, and J. M. F. Moura. Topology for distributed inference on graphs. IEEE Transactions on Signal Processing, 56(6):2609–2613, 2008. [20] V. Lesser, C. Ortiz, and M. Tambe, editors. Distributed Sensor Networks: A Multiagent Perspective (Edited book), volume 9. Kluwer Academic Publishers, 2003. [21] Dan Li, K. D. Wong, Yu Hen Hu, and A. M. Sayeed. Detection, classification, and tracking of targets. IEEE Signal Processing Magazine, 19(2):17–29, 2002. [22] W. Li and H. Dai. Accelerating distributed consensus via lifting markov chains. In 2007 IEEE International Symposium on Information Theory, pages 2881–2885, 2007. [23] W. Li, H. Dai, and Y. Zhang. Location-aided fast distributed consensus in wireless networks. IEEE Transactions on Information Theory, 56(12):6208–6227, 2010. [24] Ji Liu, Brian D.O. Anderson, Ming Cao, and A. Stephen Morse. Analysis of accelerated gossip algorithms. Automatica, 49(4):873–883, 2013. [25] Dmitry M. Malioutov, Jason K. Johnson, and Alan S. Willsky. Walk-sums and belief propagation in gaussian graphical models. J. Mach. Learn. Res., 7:2031–2064, 2006. [26] G. Mateos, J. A. Bazerque, and G. B. Giannakis. Distributed sparse linear regression. IEEE Transactions on Signal Processing, 58(10):5262–5276, 2010. [27] C. C. Moallemi and B. Van Roy. Consensus propagation. IEEE Transactions on Information Theory, 52(11):4753–4766, 2006. [28] Ciamac C. Moallemi and Benjamin Van Roy. Convergence of min-sum message-passing for convex optimization. Information Theory, IEEE Transactions on, 56(4):2041–2050, 2010. [29] A. Nedic and A. Ozdaglar. Distributed subgradient methods for multi-agent optimization. IEEE Transactions on Automatic Control, 54(1):48–61, 2009. [30] A. Olshevsky. Linear Time Average Consensus on Fixed Graphs and Implications for Decentralized Optimization and Multi-Agent Control. ArXiv e-prints (1411.4186), 2014. [31] J. B. Predd, S. R. Kulkarni, and H. V. Poor. A collaborative training algorithm for distributed learning. IEEE Transactions on Information Theory, 55(4):1856–1871, 2009. [32] M. G. Rabbat, R. D. Nowak, and J. A. Bucklew. Generalized consensus computation in networked systems with erasure links. In IEEE 6th Workshop on Signal Processing Advances in Wireless Communications, 2005., pages 1088–1092, 2005. [33] Sébastien Roch. Bounding fastest mixing. Electron. Commun. Probab., 10:282–296, 2005. [34] N. Ruozzi and S. Tatikonda. Message-passing algorithms: Reparameterizations and splittings. IEEE Transactions on Information Theory, 59(9):5860–5881, 2013. [35] Nicholas Ruozzi and Sekhar Tatikonda. Message-passing algorithms for quadratic minimization. Journal of Machine Learning Research, 14:2287–2314, 2013. [36] Kevin Scaman, Francis Bach, Sébastien Bubeck, Yin Tat Lee, and Laurent Massoulié. Optimal algorithms for smooth and strongly convex distributed optimization in networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pages 3027–3036, 2017. [37] Devavrat Shah. Gossip algorithms. Foundations and Trends R⃝in Networking, 3(1):1–125, 2009. [38] W. Shi, Q. Ling, K. Yuan, G. Wu, and W. Yin. On the linear convergence of the ADMM in decentralized consensus optimization. IEEE Transactions on Signal Processing, 62(7):1750– 1761, 2014. 10 [39] Wei Shi, Qing Ling, Gang Wu, and Wotao Yin. Extra: An exact first-order algorithm for decentralized consensus optimization. SIAM Journal on Optimization, 25(2):944–966, 2015. [40] S. Sundhar Ram, A. Nedi´c, and V. V. Veeravalli. Distributed stochastic subgradient projection algorithms for convex optimization. Journal of Optimization Theory and Applications, 147(3):516–545, 2010. [41] J. Tsitsiklis, D. Bertsekas, and M. Athans. Distributed asynchronous deterministic and stochastic gradient optimization algorithms. IEEE Transactions on Automatic Control, 31(9):803–812, 1986. [42] John N. Tsitsiklis. Problems in Decentralized Decision Making and Computation. PhD thesis, Department of EECS, MIT, 1984. [43] E. Wei and A. Ozdaglar. Distributed alternating direction method of multipliers. In 2012 IEEE 51st IEEE Conference on Decision and Control (CDC), pages 5445–5450, 2012. [44] Lin Xiao and Stephen Boyd. Fast linear iterations for distributed averaging. Systems & Control Letters, 53(1):65 – 78, 2004. [45] David M Young. Second-degree iterative methods for the solution of large linear systems. Journal of Approximation Theory, 5(2):137 – 148, 1972. 11
2017
10
6,564
Parallel Streaming Wasserstein Barycenters Matthew Staib MIT CSAIL mstaib@mit.edu Sebastian Claici MIT CSAIL sclaici@mit.edu Justin Solomon MIT CSAIL jsolomon@mit.edu Stefanie Jegelka MIT CSAIL stefje@mit.edu Abstract Efficiently aggregating data from different sources is a challenging problem, particularly when samples from each source are distributed differently. These differences can be inherent to the inference task or present for other reasons: sensors in a sensor network may be placed far apart, affecting their individual measurements. Conversely, it is computationally advantageous to split Bayesian inference tasks across subsets of data, but data need not be identically distributed across subsets. One principled way to fuse probability distributions is via the lens of optimal transport: the Wasserstein barycenter is a single distribution that summarizes a collection of input measures while respecting their geometry. However, computing the barycenter scales poorly and requires discretization of all input distributions and the barycenter itself. Improving on this situation, we present a scalable, communication-efficient, parallel algorithm for computing the Wasserstein barycenter of arbitrary distributions. Our algorithm can operate directly on continuous input distributions and is optimized for streaming data. Our method is even robust to nonstationary input distributions and produces a barycenter estimate that tracks the input measures over time. The algorithm is semi-discrete, needing to discretize only the barycenter estimate. To the best of our knowledge, we also provide the first bounds on the quality of the approximate barycenter as the discretization becomes finer. Finally, we demonstrate the practical effectiveness of our method, both in tracking moving distributions on a sphere, as well as in a large-scale Bayesian inference task. 1 Introduction A key challenge when scaling up data aggregation occurs when data comes from multiple sources, each with its own inherent structure. Sensors in a sensor network may be configured differently or placed far apart, but each individual sensor simply measures a different view of the same quantity. Similarly, user data collected by a server in California will differ from that collected by a server in Europe: the data samples may be independent but are not identically distributed. One reasonable approach to aggregation in the presence of multiple data sources is to perform inference on each piece independently and fuse the results. This is possible when the data can be distributed randomly, using methods akin to distributed optimization [52, 53]. However, when the data is not split in an i.i.d. way, Bayesian inference on different subsets of observed data yields slightly different “subset posterior” distributions for each subset that must be combined [33]. Further complicating matters, data sources may be nonstationary. How can we fuse these different data sources for joint analysis in a consistent and structure-preserving manner? We address this question using ideas from the theory of optimal transport. Optimal transport gives us a principled way to measure distances between measures that takes into account the underlying space on which the measures are defined. Intuitively, the optimal transport distance between two distributions measures the amount of work one would have to do to move all mass from one distribution to the other. Given J input measures {µj}J j=1, it is natural, in this setting, to ask for a measure ⌫that minimizes the total squared distance to the input measures. This measure ⌫is called the Wasserstein 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. barycenter of the input measures [1], and should be thought of as an aggregation of the input measures which preserves their geometry. This particular aggregation enjoys many nice properties: in the earlier Bayesian inference example, aggregating subset posterior distributions via their Wasserstein barycenter yields guarantees on the original inference task [47]. If the measures µj are discrete, their barycenter can be computed relatively efficiently via either a sparse linear program [2], or regularized projection-based methods [16, 7, 51, 17]. However, 1. these techniques scale poorly with the support of the measures, and quickly become impractical as the support becomes large. 2. When the input measures are continuous, to the best of our knowledge the only option is to discretize them via sampling, but the rate of convergence to the true (continuous) barycenter is not well-understood. These two confounding factors make it difficult to utilize barycenters in scenarios like parallel Bayesian inference where the measures are continuous and a fine approximation is needed. These are the primary issues we work to address in this paper. Given sample access to J potentially continuous distributions µj, we propose a communicationefficient, parallel algorithm to estimate their barycenter. Our method can be parallelized to J worker machines, and the messages sent between machines are merely single integers. We require a discrete approximation only of the barycenter itself, making our algorithm semi-discrete, and our algorithm scales well to fine approximations (e.g. n ⇡106). In contrast to previous work, we provide guarantees on the quality of the approximation as n increases. These rates apply to the general setting in which the µj’s are defined on manifolds, with applications to directional statistics [46]. Our algorithm is based on stochastic gradient descent as in [22] and hence is robust to gradual changes in the distributions: as the µj’s change over time, we maintain a moving estimate of their barycenter, a task which is not possible using current methods without solving a large linear program in each iteration. We emphasize that we aggregate the input distributions into a summary, the barycenter, which is itself a distribution. Instead of performing any single domain-specific task such as clustering or estimating an expectation, we can simply compute the barycenter of the inputs and process it later any arbitrary way. This generality coupled with the efficiency and parallelism of our algorithm yields immediate applications in fields from large scale Bayesian inference to e.g. streaming sensor fusion. Contributions. 1. We give a communication-efficient and fully parallel algorithm for computing the barycenter of a collection of distributions. Although our algorithm is semi-discrete, we stress that the input measures can be continuous, and even nonstationary. 2. We give bounds on the quality of the recovered barycenter as our discretization becomes finer. These are the first such bounds we are aware of, and they apply to measures on arbitrary compact and connected manifolds. 3. We demonstrate the practical effectiveness of our method, both in tracking moving distributions on a sphere, as well as in a real large-scale Bayesian inference task. 1.1 Related work Optimal transport. A comprehensive treatment of optimal transport and its many applications is beyond the scope of our work. We refer the interested reader to the detailed monographs by Villani [49] and Santambrogio [42]. Fast algorithms for optimal transport have been developed in recent years via Sinkhorn’s algorithm [15] and in particular stochastic gradient methods [22], on which we build in this work. These algorithms have enabled several applications of optimal transport and Wasserstein metrics to machine learning, for example in supervised learning [21], unsupervised learning [34, 5], and domain adaptation [14]. Wasserstein barycenters in particular have been applied to a wide variety of problems including fusion of subset posteriors [47], distribution clustering [51], shape and texture interpolation [45, 40], and multi-target tracking [6]. When the distributions µj are discrete, transport barycenters can be computed relatively efficiently via either a sparse linear program [2] or regularized projection-based methods [16, 7, 51, 17]. In settings like posterior inference, however, the distributions µj are likely continuous rather than discrete, and the most obvious viable approach requires discrete approximation of each µj. The resulting discrete barycenter converges to the true, continuous barycenter as the approximations become finer [10, 28], but the rate of convergence is not well-understood, and finely approximating each µj yields a very large linear program. Scalable Bayesian inference. Scaling Bayesian inference to large datasets has become an important topic in recent years. There are many approaches to this, ranging from parallel Gibbs sampling [38, 26] 2 to stochastic and streaming algorithms [50, 13, 25, 12]. For a more complete picture, we refer the reader to the survey by Angelino et al. [3]. One promising method is via subset posteriors: instead of sampling from the posterior distribution given by the full data, the data is split into smaller tractable subsets. Performing inference on each subset yields several subset posteriors, which are biased but can be combined via their Wasserstein barycenter [47], with provable guarantees on approximation quality. This is in contrast to other methods that rely on summary statistics to estimate the true posterior [33, 36] and that require additional assumptions. In fact, our algorithm works with arbitrary measures and on manifolds. 2 Background Let (X, d) be a metric space. Given two probability measures µ 2 P(X) and ⌫2 P(X) and a cost function c : X ⇥X ! [0, 1), the Kantorovich optimal transport problem asks for a solution to inf ⇢Z X⇥X c(x, y)dγ(x, y) : γ 2 ⇧(µ, ⌫) # (1) where ⇧(µ, ⌫) is the set of measures on the product space X ⇥X whose marginals evaluate to µ and ⌫, respectively. Under mild conditions on the cost function (lower semi-continuity) and the underlying space (completeness and separability), problem (1) admits a solution [42]. Moreover, if the cost function is of the form c(x, y) = d(x, y)p, the optimal transportation cost is a distance metric on the space of probability measures. This is known as the Wasserstein distance and is given by Wp(µ, ⌫) = ✓ inf γ2⇧(µ,⌫) Z X⇥X d(x, y)pdγ(x, y) ◆1/p . (2) Optimal transport has recently attracted much attention in machine learning and adjacent communities [21, 34, 14, 39, 41, 5]. When µ and ⌫are discrete measures, problem (2) is a linear program, although faster regularized methods based on Sinkhorn iteration are used in practice [15]. Optimal transport can also be computed using stochastic first-order methods [22]. Now let µ1, . . . , µJ be measures on X. The Wasserstein barycenter problem, introduced by Agueh and Carlier [1], is to find a measure ⌫2 P(X) that minimizes the functional F[⌫] := 1 J J X j=1 W 2 2 (µj, ⌫). (3) Finding the barycenter ⌫is the primary problem we address in this paper. When each µj is a discrete measure, the exact barycenter can be found via linear programming [2], and many of the regularization techniques apply for approximating it [16, 17]. However, the problem size grows quickly with the size of the support. When the measures µj are truly continuous, we are aware of only one strategy: sample from each µj in order to approximate it by the empirical measure, and then solve the discrete barycenter problem. We directly address the problem of computing the barycenter when the input measures can be continuous. We solve a semi-discrete problem, where the target measure is a finite set of points, but we do not discretize any other distribution. 3 Algorithm We first provide some background on the dual formulation of optimal transport. Then we derive a useful form of the barycenter problem, provide an algorithm to solve it, and prove convergence guarantees. Finally, we demonstrate how our algorithm can easily be parallelized. 3.1 Mathematical preliminaries The primal optimal transport problem (1) admits a dual problem [42]: OTc(µ, ⌫) = sup v 1-Lipschitz {EY ⇠⌫[v(Y )] + EX⇠µ[vc(X)]} , (4) 3 where vc(x) = infy2X {c(x, y) −v(y)} is the c-transform of v [49]. When ⌫= Pn i=1 wiδyi is discrete, problem (4) becomes the semi-discrete problem OTc(µ, ⌫) = max v2Rn {hw, vi + EX⇠µ[h(X, v)]} , (5) where we define h(x, v) = vc(x) = mini=1,...,n{c(x, yi) −vi}. Semi-discrete optimal transport admits efficient algorithms [31, 29]; Genevay et al. [22] in particular observed that given sample oracle access to µ, the semi-discrete problem can be solved via stochastic gradient ascent. Hence optimal transport distances can be estimated even in the semi-discrete setting. 3.2 Deriving the optimization problem Absolutely continuous measures can be approximated arbitrarily well by discrete distributions with respect to Wasserstein distance [30]. Hence one natural approach to the barycenter problem (3) is to approximate the true barycenter via discrete approximation: we fix n support points {yi}n i=1 2 X and search over assignments of the mass wi on each point yi. In this way we wish to find the discrete distribution ⌫n = Pn i=1 wiδyi with support on those n points which optimizes min w2∆n F(w) = min w2∆n 1 J J X j=1 W 2 2 (µj, ⌫n) (6) = min w2∆n 8 < : 1 J J X j=1 max vj2Rn + hw, vji + EXj⇠µj[h(Xj, vj)] 9 = ; . (7) where we have defined F(w) := F[⌫n] = F[Pn i=1 wiδyi] and used the dual formulation from equation (5). in Section 4, we discuss the effect of different choices for the support points {yi}n i=1. Noting that the variables vj are uncoupled, we can rearrange to get the following problem: min w2∆n max v1,...,vJ 1 J J X j=1 ⇥ hw, vji + EXj⇠µj[h(Xj, vj)] ⇤ . (8) Problem (8) is convex in w and jointly concave in the vj, and we can compute an unbiased gradient estimate for each by sampling Xj ⇠µj. Hence, we could solve this saddle-point problem via simultaneous (sub)gradient steps as in Nemirovski and Rubinstein [37]. Such methods are simple to implement, but in the current form we must project onto the simplex ∆n at each iteration. This requires only O(n log n) time [24, 32, 19] but makes it hard to decouple the problem across each distribution µj. Fortunately, we can reformulate the problem in a way that avoids projection entirely. By strong duality, Problem (8) can be written as max v1,...,vJ min w2∆n 8 < : * 1 J J X j=1 vj, w + + 1 J J X j=1 EXj⇠µj[h(Xj, vj)] 9 = ; (9) = max v1,...,vJ 8 < :min i 8 < : 1 J J X j=1 vj i 9 = ; + 1 J J X j=1 EXj⇠µj[h(Xj, vj)] 9 = ; . (10) Note how the variable w disappears: for any fixed vector b, minimization of hb, wi over w 2 ∆n is equivalent to finding the minimum element of b. The optimal w can also be computed in closed form when the barycentric cost is entropically regularized as in [9], which may yield better convergence rates but requires dense updates that, e.g., need more communication in the parallel setting. In either case, we are left with a concave maximization problem in v1, . . . , vJ, to which we can directly apply stochastic gradient ascent. Unfortunately the gradients are still not sparse and decoupled. We obtain sparsity after one final transformation of the problem: by replacing each PJ j=1 vj i with a variable si and enforcing this equality with a constraint, we turn problem (10) into the constrained problem max s,v1,...,vJ 1 J J X j=1 1 J min i si + EXj⇠µj[h(Xj, vj)] 5 s.t. s = J X j=1 vj. (11) 3.3 Algorithm and convergence 4 Algorithm 1 Subgradient Ascent s, v1, . . . , vJ 0n loop Draw j ⇠Unif[1, . . . , J] Draw x ⇠µj iW argmini{c(x, yi) −vj i } iM argmini si vj iW vj iW −γ . Gradient update siM siM + γ/J . Gradient update vj iW vj iW + γ/2 . Projection vj iM vj iM + γ/(2J) . Projection siW siW −γ/2 . Projection siM siM −γ/(2J) . Projection end loop We can now solve this problem via stochastic projected subgradient ascent. This is described in Algorithm 1; note that the sparse adjustments after the gradient step are actually projections onto the constraint set with respect to the `1 norm. Derivation of this sparse projection step is given rigorously in Appendix A. Not only do we have an optimization algorithm with sparse updates, but we can even recover the optimal weights w from standard results in online learning [20]. Specifically, in a zero-sum game where one player plays a no-regret learning algorithm and the other plays a best-response strategy, the average strategies of both players converge to optimal: Theorem 3.1. Perform T iterations of stochastic subgradient ascent on u = (s, v1, . . . , vJ) as in Algorithm 1, and use step size γ = R 4 p T , assuming kut −u⇤k1 R for all t. Let it be the minimizing index chosen at iteration t, and write wT = 1 T PT t=1 eit. Then we can bound E[F(wT ) −F(w⇤)] 4R/ p T. (12) The expectation is with respect to the randomness in the subgradient estimates gt. Theorem 3.1 is proved in Appendix B. The proof combines the zero-sum game idea above, which itself comes from [20], with a regret bound for online gradient descent [54, 23]. 3.4 Parallel Implementation The key realization which makes our barycenter algorithm truly scalable is that the variables s, v1, . . . , vJ can be separated across different machines. In particular, the “sum” or “coupling” variable s is maintained on a master thread which runs Algorithm 2, and each vj is maintained on a worker thread running Algorithm 3. Each projected gradient step requires first selecting distribution j. The algorithm then requires computing only iW = argmini{c(xj, yi) −vj i } and iM = argmini si, and then updating s and vj in only those coordinates. Hence only a small amount of information (iW and iM) need pass between threads. Note also that this algorithm can be adapted to the parallel shared-memory case, where s is a variable shared between threads which make sparse updates to it. Here we will focus on the first master/worker scenario for simplicity. Where are the bottlenecks? When there are n points in the discrete approximation, each worker’s task of computing argmini{c(xj, yi) −vj i } requires O(n) computations of c(x, y). The master must iteratively find the minimum element siM in the vector s, then update siM , and decrease element siW . These can be implemented respectively as the “find min”, “delete min” then “insert,” and “decrease min” operations in a Fibonacci heap. All these operations together take amortized O(log n) time. Hence, it takes O(n) time it for all J workers to each produce one gradient sample in parallel, and only O(J log n) time for the master to process them all. Of course, communication is not free, but the messages are small and our approach should scale well for J ⌧n. This parallel algorithm is particularly well-suited to the Wasserstein posterior (WASP) [48] framework for merging Bayesian subset posteriors. In this setting, we split the dataset X1, . . . , Xk into J subsets S1, . . . , SJ each with k/J data points, distribute those subsets to J different machines, then each machine runs Markov Chain Monte Carlo (MCMC) to sample from p(✓|Si), and we aggregate these posteriors via their barycenter. The most expensive subroutine in the worker thread is actually sampling from the posterior, and everything else is cheap in comparison. In particular, the machines need not even share samples from their respective MCMC chains. One subtlety is that selecting worker j truly uniformly at random each iteration requires more synchronization, hence our gradient estimates are not actually independent as usual. Selecting worker threads as they are available will fail to yield a uniform distribution over j, as at the moment worker 5 j finishes one gradient step, the probability that worker j is the next available is much less than 1/J: worker j must resample and recompute iW , whereas other threads would have a head start. If workers all took precisely the same amount of time, the ordering of worker threads would be determinstic, and guarantees for without-replacement sampling variants of stochastic gradient ascent would apply [44]. In practice, we have no issues with our approach. 4 Consistency Algorithm 2 Master Thread Input: index j, distribution µ, atoms {yi}i=1,...,N, number J of distributions, step size γ Output: barycenter weights w c 0n s 0n iM 1 loop iW message from worker j Send iM to worker j ciM ciM + 1 siM siM + γ/(2J) siW siW −γ/2 iM argmini si end loop return w c/(Pn i=1 ci) Algorithm 3 Worker Thread Input: index j, distribution µ, atoms {yi}i=1,...,N, number J of distributions, step size γ v 0n loop Draw x ⇠µ iW argmini{c(x, yi) −vi} Send iW to master iM message from master viM viM + γ/(2J) viW viW −γ/2 end loop Prior methods for estimating the Wasserstein barycenter ⌫⇤of continuous measures µj 2 P(X) involve first approximating each µj by a measure µj,n that has finite support on n points, then computing the barycenter ⌫⇤ n of {µj,n} as a surrogate for ⌫⇤. This approach is consistent, in that if µj,n ! µj as n ! 1, then also ⌫⇤ n ! ⌫⇤. This holds even if the barycenter is not unique, both in the Euclidean case [10, Theorem 3.1] as well as when X is a Riemannian manifold [28, Theorem 5.4]. However, it is not known how fast the approximation ⌫⇤ n approaches the true barycenter ⌫⇤, or even how fast the barycentric distance F[⌫⇤ n] approaches F[⌫n]. In practice, not even the approximation ⌫⇤ n is computed exactly: instead, support points are chosen and ⌫⇤ n is constrained to have support on those points. There are various heuristic methods for choosing these support points, ranging from mesh grids of the support, to randomly sampling points from the convex hull of the supports of µj , or even optimizing over the support point locations. Yet we are unaware of any rigorous guarantees on the quality of these approximations. While our approach still involves approximating the barycenter ⌫⇤by a measure ⌫⇤ n with fixed support, we are able to provide bounds on the quality of this approximation as n ! 1. Specifically, we bound the rate at which F[⌫⇤ n] ! F[⌫n]. The result is intuitive, and appeals to the notion of an ✏-cover of the support of the barycenter: Definition 4.1 (Covering Number). The ✏-covering number of a compact set K ⇢X, with respect to the metric g, is the minimum number N✏(K) of points {xi}N✏(K) i=1 2 K needed so that for each y 2 K, there is some xi with g(xi, y) ✏. The set {xi} is called an ✏-covering. Definition 4.2 (Inverse Covering Radius). Fix n 2 Z+. We define the n-inverse covering radius of compact K ⇢X as the value ✏n(K) = inf{✏> 0 : N✏(K) n}, when n is large enough so the infimum exists. Suppose throughout this section that K ⇢Rd is endowed with a Riemannian metric g, where K has diameter D. In the specific case where g is the usual Euclidean metric, there is an ✏-cover for K with at most C1✏−d points, where C1 depends only on the diameter D and dimension d [43]. Reversing the inequality, K has an n-inverse covering radius of at most ✏C2n−1/d when n takes the correct form. We now present and then prove our main result: Theorem 4.1. Suppose the measures µj are supported on K, and suppose µ1 is absolutely continuous with respect to volume. Then the barycenter ⌫⇤is unique. Moreover, for each empirical approximation size n, if we choose support points {yi}i=1,...,n that constitute a 2✏n(K)-cover of K, it follows that F[⌫⇤ n] −F[⌫⇤] O(✏n(K) + n−1/d), where ⌫⇤ n = Pn i=1 w⇤ i δyi for w⇤solving Problem (8). Remark 4.1. Absolute continuity is only needed to reason about approximating the barycenter with an N point discrete distribution. If the input distributions are themselves discrete distributions, 6 so is the barycenter, and we can strengthen our result. For large enough n, we actually have W2(⌫⇤ n, ⌫⇤) 2✏n(K) and therefore F[⌫⇤ n] −F[⌫⇤] O(✏n(K)). Corollary 4.1 (Convergence to ⌫⇤). Suppose the measures µj are supported on K, with µ1 absolutely continuous with respect to volume. Let ⌫⇤be the unique minimizer of F. Then we can choose support points {yi}i=1,...,n such that some subsequence of ⌫⇤ n = Pn i=1 w⇤ i δyi converges weakly to ⌫⇤. Proof. By Theorem 4.1, we can choose support points so that F[⌫⇤ n] ! F[⌫⇤]. By compactness, the sequence ⌫⇤ n admits a convergent subsequence ⌫⇤ nk ! ⌫for some measure ⌫. Continuity of F allows us to pass to the limit limk!1 F[⌫⇤ nk] = F[limk!1 ⌫⇤ nk]. On the other hand, limk!1 F[⌫⇤ nk] = F[⌫⇤], and F is strictly convex [28], thus ⌫⇤ nk ! ⌫⇤weakly. Before proving Theorem 4.1, we need smoothness of the barycenter functional F with respect to Wasserstein-2 distance: Lemma 4.1. Suppose we are given measures {µj}J j=1, ⌫, and {⌫n}1 n=1 supported on K, with ⌫n ! ⌫. Then, F[⌫n] ! F[⌫], with |F[⌫n] −F[⌫]| 2D · W2(⌫n, ⌫). Proof of Theorem 4.1. Uniqueness of ⌫⇤follows from Theorem 2.4 of [28]. From Theorem 5.1 in [28] we know further that ⌫⇤is absolutely continuous with respect to volume. Let N > 0, and let ⌫N be the discrete distribution on N points, each with mass 1/N, which minimizes W2(⌫N, ⌫⇤). This distribution satisfies W2(⌫N, ⌫⇤) CN −1/d [30], where C depends on K, the dimension d, and the metric. With our “budget” of n support points, we can construct a 2✏n(K)-cover as long as n is sufficiently large. Then define a distribution ⌫n,N with support on the 2✏n(K)-cover as follows: for each x in the support of ⌫N, map x to the closest point x0 in the cover, and add mass 1/N to x0. Note that this defines not only the distribution ⌫n,N, but also a transport plan between ⌫N and ⌫n,N. This map moves N points of mass 1/N each a distance at most 2✏n(K), so we may bound W2(⌫n,N, ⌫N)  p N · 1/N · (2✏n(K))2 = 2✏n(K). Combining these two bounds, we see that W2(⌫n,N, ⌫⇤) W2(⌫n,N, ⌫N) + W2(⌫N, ⌫⇤) (13) 2✏n(K) + CN −1/d. (14) For each n, we choose to set N = n, which yields W2(⌫n,n, ⌫⇤) 2✏n(K) + Cn−1/d. Applying Lemma 4.1, and recalling that ⌫⇤is the minimizer of J, we have F[⌫n,n] −F[⌫⇤] 2D · (2✏n(K) + Cn−1/d) = O(✏n(K) + n−1/d). (15) However, we must have F[⌫⇤ n] F[⌫n,n], because both are measures on the same n point 2✏n(K)cover, but ⌫⇤ n has weights chosen to minimize J. Thus we must also have F[⌫⇤ n] −F[⌫⇤] F[⌫n,n] −F[⌫⇤] O(✏n(K) + n−1/d). The high-level view of the above result is that choosing support points yi to form an ✏-cover with respect to the metric g, and then optimizing over their weights wi via our stochastic algorithm, will give us a consistent picture of the behavior of the true barycenter. Also note that the proof above requires an ✏-cover only of the support of v⇤, not all of K. In particular, an ✏-cover of the convex hull of the supports of µj is sufficient, as this must contain the barycenter. Other heuristic techniques to efficiently focus a limited budget of n points only on the support of ⌫⇤are advantageous and justified. While Theorem 4.1 is a good start, ideally we would also be able to provide a bound on W2(⌫⇤ n, ⌫⇤). This would follow readily from sharpness of the functional F[⌫], or even the discrete version F(w), but it is not immediately clear how to achieve such a result. 5 Experiments We demonstrate the applicability of our method on two experiments, one synthetic and one performing a real inference task. Together, these showcase the positive traits of our algorithm: speed, parallelization, robustness to non-stationarity, applicability to non-Euclidean domains, and immediate performance benefit to Bayesian inference. We implemented our algorithm in C++ using MPI, and our code is posted at github.com/mstaib/stochastic-barycenter-code. Full experiment details are given in Appendix D. 7 Figure 1: The Wasserstein barycenter of four von Mises-Fisher distributions on the unit sphere S2. From left to right, the figures show the initial distributions merging into the Wasserstein barycenter. As the input distributions are moved along parallel paths on the sphere, the barycenter accurately tracks the new locations as shown in the final three figures. 5.1 Von Mises-Fisher Distributions with Drift We demonstrate computation and tracking of the barycenter of four drifting von Mises-Fisher distributions on the unit sphere S2. Note that W2 and the barycentric cost are now defined with respect to geodesic distance on S2. The distributions are randomly centered, and we move the center of each distribution 3⇥10−5 radians (in the same direction for all distributions) each time a sample is drawn. A snapshot of the results is shown in Figure 1. Our algorithm is clearly able to track the barycenter as the distributions move. 5.2 Large Scale Bayesian Inference 50 100 150 200 250 300 25 30 35 40 45 Figure 2: Convergence of our algorithm with n ⇡104 for different stepsizes. In each case we recover a better approximation than what was possible with the LP for any n, in as little as ⇡30 seconds. We run logistic regression on the UCI skin segmentation dataset [8]. The 245057 datapoints are colors represented in R3, each with a binary label determing whether that color is a skin color. We split consecutive blocks of the dataset into 127 subsets, and due to locality in the dataset, the data in each subsets is not identically distributed. Each subset is assigned one thread of an InfiniBand cluster on which we simultaneously sample from the subset posterior via MCMC and optimize the barycenter estimate. This is in contrast to [47], where the barycenter can be computed via a linear program (LP) only after all samplers are run. Since the full dataset is tractable, we can compare the two methods via W2 distance to the posterior of the full dataset, which we can estimate via the large-scale optimal transport algorithm in [22] or by LP depending on the support size. For each method, we fix n barycenter support points on a mesh determined by samples from the subset posteriors. After 317 seconds, or about 10000 iterations per subset posterior, our algorithm has produced a barycenter on n ⇡104 support points with W2 distance about 26 from the full posterior. Similarly competitive results hold even for n ⇡105 or 106, though tuning the stepsize becomes more challenging. Even in the 106 case, no individual 16 thread node used more than 2GB of memory. For n ⇡104, over a wide range of stepsizes we can in seconds approximate the full posterior better than is possible with the LP as seen in Figure 2 by terminating early. In comparsion, in Table 1 we attempt to compute the barycenter LP as in [47] via Mosek [4], for varying values of n. Even n = 480 is not possible on a system with 16GB of memory, and feasible values of n result in meshes too sparse to accurately and reliably approximate the barycenter. Specifically, there are several cases where n increases but the approximation quality actually decreases: the subset posteriors are spread far apart, and the barycenter is so small relative to the required bounding box that likely only one grid point is close to it, and how close this grid point is depends on the specific mesh. To avoid this behavior, one must either use a dense grid (our approach), or invent a better method for choosing support points that will still cover the barycenter. In terms of compute time, entropy regularized methods may have faired better than the LP for finer meshes but would still 8 Table 1: Number of support points n versus computation time and W2 distance to the true posterior. Compared to prior work, our algorithm handles much finer meshes, producing much better estimates. Linear program from [47] This paper n 24 40 60 84 189 320 396 480 104 time (s) 0.5 0.97 2.9 6.1 34 163 176 out of memory 317 W2 41.1 59.3 50.0 34.3 44.3 53.7 45 out of memory 26.3 not give the same result as our method. Note also that the LP timings include only optimization time, whereas in 317 seconds our algorithm produces samples and optimizes. 6 Conclusion and Future Directions We have proposed an original algorithm for computing the Wasserstein barycenter of arbitrary measures given a stream of samples. Our algorithm is communication-efficient, highly parallel, easy to implement, and enjoys consistency results that, to the best of our knowledge, are new. Our method has immediate impact on large-scale Bayesian inference and sensor fusion tasks: for Bayesian inference in particular, we obtain far finer estimates of the Wasserstein-averaged subset posterior (WASP) [47] than was possible before, enabling faster and more accurate inference. There are many directions for future work: we have barely scratched the surface in terms of new applications of large-scale Wasserstein barycenters, and there are still many possible algorithmic improvements. One implication of Theorem 3.1 is that a faster algorithm for solving the concave problem (11) immediately yields faster convergence to the barycenter. Incorporating variance reduction [18, 27] is a promising direction, provided we maintain communication-efficiency. Recasting problem (11) as distributed consensus optimization [35, 11] would further help scale up the barycenter computation to huge numbers of input measures. Acknowledgements We thank the anonymous reviewers for their helpful suggestions. We also thank MIT Supercloud and the Lincoln Laboratory Supercomputing Center for providing computational resources. M. Staib acknowledges Government support under and awarded by DoD, Air Force Office of Scientific Research, National Defense Science and Engineering Graduate (NDSEG) Fellowship, 32 CFR 168a. J. Solomon acknowledges funding from the MIT Research Support Committee (“Structured Optimization for Geometric Problems”), as well as Army Research Office grant W911NF-12-R-0011 (“Smooth Modeling of Flows on Graphs”). This research was supported by NSF CAREER award 1553284 and The Defense Advanced Research Projects Agency (grant number 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] M. Agueh and G. Carlier. Barycenters in the Wasserstein Space. SIAM J. Math. Anal., 43(2):904–924, January 2011. ISSN 0036-1410. doi: 10.1137/100805741. [2] Ethan Anderes, Steffen Borgwardt, and Jacob Miller. Discrete Wasserstein barycenters: Optimal transport for discrete data. Math Meth Oper Res, 84(2):389–409, October 2016. ISSN 1432-2994, 1432-5217. doi: 10.1007/s00186-016-0549-x. [3] Elaine Angelino, Matthew James Johnson, and Ryan P. Adams. Patterns of scalable bayesian inference. Foundations and Trends R⃝in Machine Learning, 9(2-3):119–247, 2016. ISSN 1935-8237. doi: 10.1561/ 2200000052. URL http://dx.doi.org/10.1561/2200000052. [4] MOSEK ApS. The MOSEK optimization toolbox for MATLAB manual. Version 8.0.0.53., 2017. URL http://docs.mosek.com/8.0/toolbox/index.html. [5] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. 2017. [6] M. Baum, P. K. Willett, and U. D. Hanebeck. On Wasserstein Barycenters and MMOSPA Estimation. IEEE Signal Process. Lett., 22(10):1511–1515, October 2015. ISSN 1070-9908. doi: 10.1109/LSP.2015.2410217. 9 [7] J. Benamou, G. Carlier, M. Cuturi, L. Nenna, and G. Peyré. Iterative Bregman Projections for Regularized Transportation Problems. SIAM J. Sci. Comput., 37(2):A1111–A1138, January 2015. ISSN 1064-8275. doi: 10.1137/141000439. [8] Rajen Bhatt and Abhinav Dhall. Skin segmentation dataset. UCI Machine Learning Repository. [9] Jérémie Bigot, Elsa Cazelles, and Nicolas Papadakis. Regularization of barycenters in the Wasserstein space. arXiv:1606.01025 [math, stat], June 2016. [10] Emmanuel Boissard, Thibaut Le Gouic, and Jean-Michel Loubes. Distribution’s template estimate with Wasserstein metrics. Bernoulli, 21(2):740–759, May 2015. ISSN 1350-7265. doi: 10.3150/13-BEJ585. [11] 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. [12] Tamara Broderick, Nicholas Boyd, Andre Wibisono, Ashia C Wilson, and Michael I Jordan. Streaming Variational Bayes. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 1727–1735. Curran Associates, Inc., 2013. [13] Tianqi Chen, Emily Fox, and Carlos Guestrin. Stochastic gradient hamiltonian monte carlo. 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 1683–1691, Bejing, China, 22–24 Jun 2014. PMLR. URL http://proceedings.mlr.press/v32/cheni14.html. [14] N. Courty, R. Flamary, D. Tuia, and A. Rakotomamonjy. Optimal Transport for Domain Adaptation. IEEE Trans. Pattern Anal. Mach. Intell., PP(99):1–1, 2016. ISSN 0162-8828. doi: 10.1109/TPAMI.2016. 2615921. [15] Marco 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. [16] Marco Cuturi and Arnaud Doucet. Fast Computation of Wasserstein Barycenters. pages 685–693, 2014. [17] Marco Cuturi and Gabriel Peyré. A Smoothed Dual Approach for Variational Wasserstein Problems. SIAM J. Imaging Sci., 9(1):320–343, January 2016. doi: 10.1137/15M1032600. [18] Aaron Defazio, Francis Bach, and Simon Lacoste-Julien. Saga: A fast incremental gradient method with support for non-strongly convex composite objectives. In Advances in Neural Information Processing Systems, pages 1646–1654, 2014. [19] John Duchi, Shai Shalev-Shwartz, Yoram Singer, and Tushar Chandra. Efficient projections onto the l 1-ball for learning in high dimensions. In Proceedings of the 25th International Conference on Machine Learning, pages 272–279. ACM, 2008. [20] Yoav Freund and Robert E. Schapire. Adaptive Game Playing Using Multiplicative Weights. Games and Economic Behavior, 29(1):79–103, October 1999. ISSN 0899-8256. doi: 10.1006/game.1999.0738. [21] Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya, and Tomaso A Poggio. Learning with a Wasserstein Loss. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, Advances in Neural Information Processing Systems 28, pages 2053–2061. Curran Associates, Inc., 2015. [22] Aude Genevay, Marco Cuturi, Gabriel Peyré, and Francis 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] Elad Hazan. Introduction to Online Convex Optimization. OPT, 2(3-4):157–325, August 2016. ISSN 2167-3888, 2167-3918. doi: 10.1561/2400000013. [24] Michael Held, Philip Wolfe, and Harlan P. Crowder. Validation of subgradient optimization. Mathematical Programming, 6(1):62–88, December 1974. ISSN 0025-5610, 1436-4646. doi: 10.1007/BF01580223. [25] Matthew D Hoffman, David M Blei, Chong Wang, and John William Paisley. Stochastic variational inference. Journal of Machine Learning Research, 14(1):1303–1347, 2013. 10 [26] Matthew Johnson, James Saunderson, and Alan Willsky. Analyzing hogwild parallel gaussian gibbs sampling. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 2715–2723. Curran Associates, Inc., 2013. URL http://papers.nips.cc/paper/ 5043-analyzing-hogwild-parallel-gaussian-gibbs-sampling.pdf. [27] Rie Johnson and Tong Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In Advances in Neural Information Processing Systems, pages 315–323, 2013. [28] Young-Heon Kim and Brendan Pass. Wasserstein barycenters over Riemannian manifolds. Advances in Mathematics, 307:640–683, February 2017. ISSN 0001-8708. doi: 10.1016/j.aim.2016.11.026. [29] Jun Kitagawa, Quentin Mérigot, and Boris Thibert. Convergence of a Newton algorithm for semi-discrete optimal transport. arXiv:1603.05579 [cs, math], March 2016. [30] Benoît Kloeckner. Approximation by finitely supported measures. ESAIM Control Optim. Calc. Var., 18 (2):343–359, 2012. ISSN 1292-8119. [31] Bruno Lévy. A Numerical Algorithm for L2 Semi-Discrete Optimal Transport in 3D. ESAIM Math. Model. Numer. Anal., 49(6):1693–1715, November 2015. ISSN 0764-583X, 1290-3841. doi: 10.1051/m2an/ 2015055. [32] C. Michelot. A finite algorithm for finding the projection of a point onto the canonical simplex of /n. J Optim Theory Appl, 50(1):195–200, July 1986. ISSN 0022-3239, 1573-2878. doi: 10.1007/BF00938486. [33] Stanislav Minsker, Sanvesh Srivastava, Lizhen Lin, and David Dunson. Scalable and Robust Bayesian Inference via the Median Posterior. In PMLR, pages 1656–1664, January 2014. [34] Grégoire Montavon, Klaus-Robert Müller, and Marco Cuturi. Wasserstein Training of Restricted Boltzmann Machines. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 3718–3726. Curran Associates, Inc., 2016. [35] Angelia Nedic and Asuman Ozdaglar. Distributed subgradient methods for multi-agent optimization. IEEE Transactions on Automatic Control, 54(1):48–61, 2009. [36] Willie Neiswanger, Chong Wang, and Eric P. Xing. Asymptotically exact, embarrassingly parallel mcmc. In Proceedings of the Thirtieth Conference on Uncertainty in Artificial Intelligence, UAI’14, pages 623–632, Arlington, Virginia, United States, 2914. AUAI Press. ISBN 978-0-9749039-1-0. URL http://dl.acm.org/citation.cfm?id=3020751.3020816. [37] Arkadi Nemirovski and Reuven Y. Rubinstein. An Efficient Stochastic Approximation Algorithm for Stochastic Saddle Point Problems. In Moshe Dror, Pierre L’Ecuyer, and Ferenc Szidarovszky, editors, Modeling Uncertainty, number 46 in International Series in Operations Research & Management Science, pages 156–184. Springer US, 2005. ISBN 978-0-7923-7463-3 978-0-306-48102-4. doi: 10.1007/0-306-48102-2_8. [38] David Newman, Padhraic Smyth, Max Welling, and Arthur U. Asuncion. Distributed inference for latent dirichlet allocation. In J. C. Platt, D. Koller, Y. Singer, and S. T. Roweis, editors, Advances in Neural Information Processing Systems 20, pages 1081–1088. Curran Associates, Inc., 2008. URL http://papers. nips.cc/paper/3330-distributed-inference-for-latent-dirichlet-allocation.pdf. [39] Gabriel Peyré, Marco Cuturi, and Justin Solomon. Gromov-Wasserstein Averaging of Kernel and Distance Matrices. In PMLR, pages 2664–2672, June 2016. [40] Julien Rabin, Gabriel Peyré, Julie Delon, and Marc Bernot. Wasserstein Barycenter and Its Application to Texture Mixing. In Scale Space and Variational Methods in Computer Vision, pages 435–446. Springer, Berlin, Heidelberg, May 2011. doi: 10.1007/978-3-642-24785-9_37. [41] Antoine Rolet, Marco Cuturi, and Gabriel Peyré. Fast Dictionary Learning with a Smoothed Wasserstein Loss. In PMLR, pages 630–638, May 2016. [42] Filippo Santambrogio. Optimal Transport for Applied Mathematicians, volume 87 of Progress in Nonlinear Differential Equations and Their Applications. Springer International Publishing, Cham, 2015. ISBN 978-3-319-20827-5 978-3-319-20828-2. doi: 10.1007/978-3-319-20828-2. [43] Shai Shalev-Shwartz and Shai Ben-David. Understanding Machine Learning: From Theory to Algorithms. Cambridge university press, 2014. 11 [44] Ohad Shamir. Without-replacement sampling for stochastic gradient methods. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 46–54. Curran Associates, Inc., 2016. URL http://papers.nips.cc/paper/ 6245-without-replacement-sampling-for-stochastic-gradient-methods.pdf. [45] Justin Solomon, Fernando de Goes, Gabriel Peyré, Marco Cuturi, Adrian Butscher, Andy Nguyen, Tao Du, and Leonidas Guibas. Convolutional Wasserstein Distances: Efficient Optimal Transportation on Geometric Domains. ACM Trans Graph, 34(4):66:1–66:11, July 2015. ISSN 0730-0301. doi: 10.1145/2766963. [46] Suvrit Sra. Directional Statistics in Machine Learning: A Brief Review. arXiv:1605.00316 [stat], May 2016. [47] Sanvesh Srivastava, Volkan Cevher, Quoc Dinh, and David Dunson. WASP: Scalable Bayes via barycenters of subset posteriors. In Guy Lebanon and S. V. N. Vishwanathan, editors, Proceedings of the Eighteenth International Conference on Artificial Intelligence and Statistics, volume 38 of Proceedings of Machine Learning Research, pages 912–920, San Diego, California, USA, 09–12 May 2015. PMLR. URL http: //proceedings.mlr.press/v38/srivastava15.html. [48] Sanvesh Srivastava, Cheng Li, and David B. Dunson. Scalable Bayes via Barycenter in Wasserstein Space. arXiv:1508.05880 [stat], August 2015. [49] Cédric Villani. Optimal Transport: Old and New. Number 338 in Grundlehren der mathematischen Wissenschaften. Springer, Berlin, 2009. ISBN 978-3-540-71049-3. OCLC: ocn244421231. [50] 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. [51] J. Ye, P. Wu, J. Z. Wang, and J. Li. Fast Discrete Distribution Clustering Using Wasserstein Barycenter With Sparse Support. IEEE Trans. Signal Process., 65(9):2317–2332, May 2017. ISSN 1053-587X. doi: 10.1109/TSP.2017.2659647. [52] Yuchen Zhang, John C Duchi, and Martin J Wainwright. Communication-efficient algorithms for statistical optimization. Journal of Machine Learning Research, 14:3321–3363, 2013. [53] Yuchen Zhang, John Duchi, and Martin Wainwright. Divide and conquer kernel ridge regression: A distributed algorithm with minimax optimal rates. Journal of Machine Learning Research, 16:3299–3340, 2015. URL http://jmlr.org/papers/v16/zhang15d.html. [54] Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pages 928–936, 2003. 12
2017
100
6,565
Adaptive Accelerated Gradient Converging Method under Hölderian Error Bound Condition Mingrui Liu, Tianbao Yang Department of Computer Science The University of Iowa, Iowa City, IA 52242 mingrui-liu, tianbao-yang@uiowa.edu Abstract Recent studies have shown that proximal gradient (PG) method and accelerated gradient method (APG) with restarting can enjoy a linear convergence under a weaker condition than strong convexity, namely a quadratic growth condition (QGC). However, the faster convergence of restarting APG method relies on the potentially unknown constant in QGC to appropriately restart APG, which restricts its applicability. We address this issue by developing a novel adaptive gradient converging methods, i.e., leveraging the magnitude of proximal gradient as a criterion for restart and termination. Our analysis extends to a much more general condition beyond the QGC, namely the Hölderian error bound (HEB) condition. The key technique for our development is a novel synthesis of adaptive regularization and a conditional restarting scheme, which extends previous work focusing on strongly convex problems to a much broader family of problems. Furthermore, we demonstrate that our results have important implication and applications in machine learning: (i) if the objective function is coercive and semialgebraic, PG’s convergence speed is essentially o( 1 t ), where t is the total number of iterations; (ii) if the objective function consists of an ℓ1, ℓ∞, ℓ1,∞, or huber norm regularization and a convex smooth piecewise quadratic loss (e.g., square loss, squared hinge loss and huber loss), the proposed algorithm is parameter-free and enjoys a faster linear convergence than PG without any other assumptions (e.g., restricted eigen-value condition). It is notable that our linear convergence results for the aforementioned problems are global instead of local. To the best of our knowledge, these improved results are first shown in this work. 1 Introduction We consider the following smooth composite optimization: min x∈Rd F(x) ≜f(x) + g(x), (1) where g(x) is a proper lower semi-continuous convex function and f(x) is a continuously differentiable convex function, whose gradient is L-Lipschitz continuous. The above problem has been studied extensively in literature and many algorithms have been developed with convergence guarantee. In particular, by employing the proximal mapping associated with g(x), i.e., Pηg(u) = arg min x∈Rd 1 2∥x −u∥2 2 + ηg(x), (2) proximal gradient (PG) and accelerated proximal gradient (APG) methods have been developed for solving (1) with O(1/ϵ) and O(1/√ϵ) 1 iteration complexities for finding an ϵ-optimal solution. 1For the moment, we neglect the constant factor. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Table 1: Summary of iteration complexities in this work under the HEB condition with θ ∈(0, 1/2], where G(x) denotes the proximal gradient, C(1/ϵα) = max(1/ϵα, log(1/ϵ)) and eO(·) suppresses a logarithmic term. If θ > 1/2, all algorithms can converge with finite steps of proximal mapping. rAPG stands for restarting APG. ∗mark results available for certain subclasses of problems. algo. PG rAPG adaAGC F(x) −F∗≤ϵ O c2LC 1 ϵ1−2θ  O  c √ LC  1 ϵ1/2−θ  * ∥G(x)∥2 ≤ϵ O  c 1 1−θ LC  1 ϵ 1−2θ 1−θ  – eO  c 1 2(1−θ) √ LC  1 ϵ 1−2θ 2(1−θ)  requires θ No Yes Yes requires c No Yes No When either f(x) or g(x) is strongly convex, both PG and APG can enjoy a linear convergence, i.e., the iteration complexity is improved to be O(log(1/ϵ)). Recently, a wave of studies try to generalize the linear convergence to problems without strong convexity but under certain structured condition of the objective function or more generally a quadratic growth condition [8, 32, 21, 23, 7, 31, 3, 15, 9, 29, 4, 24, 26, 25]. Earlier work along the line dates back to [12, 13, 14]. An example of the structured condition is such that f(x) = h(Ax) where h(·) is strongly convex function and ∇h(x) is Lipschitz continuous on any compact set, and g(x) is a polyhedral function. Under such a structured condition, a local error bound condition can be established [12, 13, 14], which renders an asymptotic (local) linear convergence for the proximal gradient method. A quadratic growth condition (QGC) prescribes that the objective function satisfies for any x ∈Rd 2: α 2 ∥x −x∗∥2 2 ≤F(x) −F(x∗), where x∗denotes a closest point to x in the optimal set. Under such a quadratic growth condition, several recent studies have established the linear convergence of PG, APG and many other algorithms (e.g., coordinate descent methods) [3, 15, 4, 9, 29]. A notable result is that PG enjoys an iteration complexity of O( L α log(1/ϵ)) without knowing the value of α, while a restarting version of APG studied in [15] enjoys an improved iteration complexity of O( q L α log(1/ϵ)) hinging on the value of α to appropriately restart APG periodically. Other equivalent conditions or more restricted conditions are also considered in several studies to show the linear convergence of (proximal) gradient method and other methods [9, 15, 29, 30]. In this paper, we extend this line of work to a more general error bound condition, i.e., the Hölderian error bound (HEB) condition on a compact sublevel set Sξ = {x ∈Rd : F(x) −F(x∗) ≤ξ}: there exists θ ∈(0, 1] and 0 < c < ∞such that ∥x −x∗∥2 ≤c(F(x) −F(x∗))θ, ∀x ∈Sξ. (3) Note that when θ = 1/2 and c = p 1/α, the HEB reduces to the QGC. In the sequel, we will refer to C = Lc2 as condition number of the problem. It is worth mentioning that Bolte et al. [3] considered the same condition or an equivalent Kurdyka - Łojasiewicz inequality but they only focused on descent methods that bear a sufficient decrease condition for each update consequentially excluding APG. In addition, they do not provide explicit iteration complexity under the general HEB condition. As a warm-up and motivation, we will first present a straightforward analysis to show that PG is automatically adaptive and APG can be made adaptive to the HEB by restarting. In particular if F(x) satisfies a HEB condition on the initial sublevel set, PG has an iteration complexity of O(max( C ϵ1−2θ , C log( 1 ϵ ))) 3, and restarting APG enjoys an iteration complexity of O(max( √ C ϵ1/2−θ , √ C log( 1 ϵ ))) for the convergence of objective value, where C = Lc2 is the condition number. These two results resemble but generalize recent works that establish linear convergence of PG and restarting APG under the QGC - a special case of HEB. Although enjoying faster convergence, restarting APG has a critical caveat: it requires the knowledge of constant c in HEB to restart APG, which is usually difficult to compute or estimate. In this paper, we make nontrivial contributions to 2It can be relaxed to a fixed domain as done in this work. 3When θ > 1/2, all algorithms can converge in finite steps. 2 obtain faster convergence of the proximal gradient’s norm under the HEB condition by developing an adaptive accelerated gradient converging method. The main results of this paper are summarized in Table 1. The contributions of this paper are: (i) we extend the analysis of PG and restarting APG under the quadratic growth condition to more general HEB condition, and establish the adaptive iteration complexities of both algorithms; (ii) to enjoy faster convergence of restarting APG and to eliminate the algorithmic dependence on the unknown parameter c, we propose and analyze an adaptive accelerated gradient converging (adaAGC) method. The developed algorithms and theory have important implication and applications in machine learning. Firstly, if the considered objective function is also coercive and semi-algebraic (e.g., a norm regularized problem in machine learning with a semi-algebraic loss function), then PG’s convergence speed is essentially o(1/t) instead of O(1/t), where t is the total number of iterations. Secondly, for solving ℓ1, ℓ∞or ℓ1,∞regularized smooth loss minimization problems including least-squares loss, squared hinge loss and huber loss, the proposed adaAGC method enjoys a linear convergence and a square root dependence on the “condition" number. In contrast to previous work, the proposed algorithm is parameter free and does not rely on any restricted conditions (e.g., the restricted eigen-value conditions). 2 Notations and Preliminaries In this section, we present some notations and preliminaries. In the sequel, we let ∥·∥p (p ≥1) denote the p-norm of a vector. A function g(x) : Rd →(−∞, ∞] is a proper function if g(x) < +∞for at least one x. g(x) is lower semi-continuous at a point x0 if lim infx→x0 g(x) = g(x0). A function F(x) is coercive if and only if F(x) →∞as ∥x∥2 →∞. We will also refer to semi-algebraic set and semi-algebraic function several times in the paper, which are standard concepts in mathematics [2]. Due to limit of space, we present the definitions in the supplement. Denote by N the set of all positive integers. A function h(x) is a real polynomial if there exists r ∈N such that h(x) = P 0≤|α|≤r λαxα, where λα ∈R and xα = xα1 1 . . . xαd d , αj ∈N ∪{0}, |α| = Pd j=1 αj and r is referred to as the degree of h(x). A continuous function f(x) is said to be a piecewise convex polynomial if there exist finitely many polyhedra P1, . . . , Pk with ∪k j=1Pj = Rn such that the restriction of f on each Pj is a convex polynomial. Let fj be the restriction of f on Pj. The degree of a piecewise convex polynomial function f denoted by deg(f) is the maximum of the degree of each fj. If deg(f) = 2, the function is referred to as a piecewise convex quadratic function. Note that a piecewise convex polynomial function is not necessarily a convex function [10]. A function f(x) is L-smooth w.r.t ∥· ∥2 if it is differentiable and has a Lipschitz continuous gradient with the Lipschitz constant L, i.e., ∥∇f(x) −∇f(y)∥2 ≤L∥x −y∥2, ∀x, y. Let ∂g(x) denote the subdifferential of g at x. Denote by ∥∂g(x)∥2 = minu∈∂g(x) ∥u∥2. A function g(x) is α-strongly convex w.r.t ∥· ∥2 if it satisfies for any u ∈∂g(y) such that g(x) ≥g(y) + u⊤(x −y) + α 2 ∥x − y∥2 2, ∀x, y. Denote by η > 0 a positive scalar, and let Pηg be the proximal mapping associated with ηg(·) defined in (2). Given an objective function F(x) = f(x) + g(x), where f(x) is L-smooth and convex, g(x) is a simple non-smooth function which is closed and convex, define a proximal gradient Gη(x) as: Gη(x) = 1 η (x −x+ η ), where x+ η = Pηg(x −η∇f(x)). When g(x) = 0, we have Gη(x) = ∇f(x), i.e., the proximal gradient is the gradient. It is known that x is an optimal solution iff Gη(x) = 0. If η = 1/L, for simplicity we denote by G(x) = G1/L(x) and x+ = Pg/L(x −∇f(x)/L). Let F∗denote the optimal objective value to minx∈Rd F(x) and Ω∗denote the optimal set. Denote by Sξ = {x : F(x) −F∗≤ξ} the ξ-sublevel set of F(x). Let D(x, Ω) = miny∈Ω∥x −y∥2. The proximal gradient (PG) method solves the problem (1) by the update xt+1 = Pηg(xt −η∇f(xt)), (4) with η ≤1/L starting from some initial solution x1 ∈Rd. It can be shown that PG has an iteration complexity of O( LD(x1,Ω∗)2 ϵ ). Nevertheless, accelerated proximal gradient (APG) converges faster than PG. There are many variants of APG in literature [22] including the well-known FISTA [1]. The 3 Algorithm 1: ADG x0 ∈Ω, A0 = 0, v0 = x0 for t = 0, . . . , T do Find at+1 from quadratic equation a2 At+a = 2 1+αAt L Set At+1 = At + at+1 Set yt = At At+1 xt + at+1 At+1 vt Compute xt+1 = Pg/L(yt −∇f(yt)/L) Compute vt+1 = arg minx Pt+1 τ=1 aτ∇f(xτ)⊤x + At+1g(x) + 1 2∥x −x0∥2 2 simplest variant adopts the following update yt = xt + βt(xt −xt−1), xt+1 = Pηg(yt −η∇f(yt)), where η ≤1/L and βt is an appropriate sequence (e.g. βt = t−1 t+2). APG enjoys an iteration complexity of O( √ LD(x1,Ω∗) √ϵ ) [22]. Furthermore, if f(x) is both L-smooth and α-strongly convex, one can set βt = √ L−√α √ L+√α and deduce a linear convergence [16, 11] with a better dependence on the condition number than that of PG. If g(x) is α-strongly convex and f(x) is L-smooth, Nesterov [17] proposed a different variant based on dual averaging, which is referred to accelerated dual gradient (ADG) method and will be useful for our development. The key steps are presented in Algorithm 1. 2.1 Hölderian error bound (HEB) condition Definition 1 (Hölderian error bound (HEB)). A function F(x) is said to satisfy a HEB condition on the ξ-sublevel set if there exist θ ∈(0, 1] and 0 < c < ∞such that for any x ∈Sξ dist(x, Ω∗) ≤c(F(x) −F∗)θ. (5) The HEB condition is closely related to the Łojasiewicz inequality or more generally KurdykaŁojasiewicz (KL) inequality in real algebraic geometry. It has been shown that when functions are semi-algebraic and continuous, the above inequality is known to hold on any compact set [3]. We refer the readers to [3] for more discussions on HEB and KL inequalities. In the remainder of this section, we will review some previous results to demonstrate that HEB is a generic condition that holds for a broad family of problems of interest. The following proposition states that any proper, coercive, convex, lower-semicontinuous and semi-algebraic functions satisfy the HEB condition. Proposition 1. [3] Let F(x) be a proper, coercive, convex, lower semicontinuous and semi-algebraic function. Then there exists θ ∈(0, 1] and 0 < c < ∞such that F(x) satisfies the HEB on any ξ-sublevel set. Example: Most optimization problems in machine learning with an objective that consists of an empirical loss that is semi-algebraic (e.g., hinge loss, squared hinge loss, absolute loss, square loss) and a norm regularization ∥· ∥p (p ≥1 is a rational) or a norm constraint are proper, coercive, lower semicontinuous and semi-algebraic functions. Next two propositions exhibit the value θ for piecewise convex quadratic functions and piecewise convex polynomial functions. Proposition 2. [10] Let F(x) be a piecewise convex quadratic function on Rd. Suppose F(x) is convex. Then for any ξ > 0, there exists 0 < c < ∞such that D(x, Ω∗) ≤c(F(x) −F∗)1/2, ∀x ∈ Sξ. Many problems in machine learning are piecewise convex quadratic functions, which will be discussed more in Section 5. Proposition 3. [10] Let F(x) be a piecewise convex polynomial function on Rd. Suppose F(x) is convex. Then for any ξ > 0, there exists c > 0 such that D(x, Ω∗) ≤c(F(x) − F∗) 1 (deg(F )−1)d+1 , ∀x ∈Sξ. 4 Algorithm 2: restarting APG (rAPG) Input: the number of stages K and x0 ∈Ω for k = 1, . . . , K do Set yk 1 = xk−1 and xk 1 = xk−1 for τ = 1, . . . , tk do Update xk τ+1 = Pg/L(yk τ −∇f(yk τ)/L) Update yk τ+1 = xk τ+1 + τ τ+3(xk τ+1 −xk τ) Let xk = xk tk+1 and update tk Output: xK Indeed, for a polyhedral constrained convex polynomial, we can have a tighter result, as shown below. Proposition 4. [27] Let F(x) be a convex polynomial function on Rd with degree m. If P ⊂Rd is a polyhedral set, then the problem minx∈P F(x) admits a global error bound: ∀x ∈P there exists 0 < c < ∞such that D(x, Ω∗) ≤c h (F(x) −F∗) + (F(x) −F∗) 1 m i . (6) From the global error bound (6), one can easily derive the HEB condition (3). As an example, an ℓ1 constrained ℓp norm regression below [19] satisfies the HEB condition (3) with θ = 1 p: min ∥x∥1≤s F(x) ≜1 n n X i=1 (a⊤ i x −bi)p, p ∈2N. (7) Many previous papers have considered a family of structured smooth composite functions F(x) = h(Ax)+g(x), where g(x) is a polyhedral function and h(·) is a smooth and strongly convex function on any compact set. Suppose the optimal set of the above problem is non-empty and compact (e.g., the function is coercive) so is the sublevel set Sξ, and it can been shown that such a function satisfies HEB with θ = 1/2 on any sublevel set Sξ [15, Theorem 10]. Examples of h(u) include logistic loss h(u) = P i log(1 + exp(−ui)) and square loss h(u) = ∥u∥2 2. Finally, we note that there exist problems that admit HEB with θ > 1/2. A trivial example is given by F(x) = 1 2∥x∥2 2 +∥x∥p p with p ∈[1, 2), which satisfies HEB with θ = 1/p ∈(1/2, 1]. An interesting non-trivial family of problems is that f(x) = 0 and g(x) is a piece-wise linear functions according to Proposition 3. PG or APG applied to such family of problems is closely related to proximal point algorithm [20]. Explorations of such algorithmic connection is not the focus of this paper. 3 PG and restarting APG under HEB As a warm-up and motivation of the major contribution presented in next section, we present a convergence result of PG and a restarting APG under the HEB condition. The analysis is mostly straightforward and is included in the supplement. We first present a result of PG using the update (4). Theorem 1. Suppose F(x0) −F∗≤ϵ0 and F(x) satisfies HEB on Sϵ0. The iteration complexity of PG with option I (which returns the last solution, see the supplementary material) for achieving F(xt) −F∗≤ϵ is O(c2Lϵ2θ−1 0 ) if θ > 1/2, and is O(max{ c2L ϵ1−2θ , c2L log( ϵ0 ϵ )}) if θ ≤1/2. Next, we show that APG can be made adaptive to HEB by periodically restarting given c and θ. This is similar to [15] under the QGC. The steps of restarting APG (rAPG) are presented in Algorithm 2, where we employ the simplest variant of APG. Theorem 2. Suppose F(x0) −F∗≤ϵ0 and F(x) satisfies HEB on Sϵ0. By running Algorithm 2 with K = ⌈log2 ϵ0 ϵ ⌉and tk = ⌈2c √ Lϵθ−1/2 k−1 ⌉, we have F(xK) −F∗≤ϵ. The iteration complexity of rAPG is O(c √ Lϵ1/2−θ 0 ) if θ > 1/2, and if θ ≤1/2 it is O(max{ c √ L ϵ1/2−θ , c √ L log( ϵ0 ϵ )}). From Algorithm 2, we can see that rAPG requires the knowledge of c besides θ to restart APG. However, for many problems of interest, the value of c is unknown, which makes rAPG impractical. To address this issue, we propose to use the magnitude of the proximal gradient as a measure for restart and termination. It is worth mentioning the difference between the development in this paper and previous studies. Previous work [16, 11] have considered strongly convex optimization 5 problems where the strong convexity parameter is unknown, where they also use the magnitude of the proximal gradient as a measure for restart and termination. However, in order to achieve faster convergence under the HEB condition without the strong convexity, we have to introduce a novel technique of adaptive regularization that adapts to the HEB. With a novel synthesis of the adaptive regularization and a conditional restarting that searchs for the c, we are able to develop practical adaptive accelerated gradient methods. We also notice a recent work [6] that proposed unconditional restarted accelerated gradient methods under QGC. Their restart of APG/FISTA does not involve evaluation of the gradient or the objective value but rather depends on a restarting frequency parameter and a convex combination parameter for computing the restarting solution, which can be set based on a rough estimate of the strong convexity parameter. As a result, their linear convergence (established for distance of solutions to the optimal set) heavily depends on the rough estimate of the strong convexity parameter. Before diving into the details of the proposed algorithm, we will first present a variant of PG as a baseline for comparison motivated by [18] for smooth problems, which enjoys a faster convergence than the vanilla PG in terms of the proximal gradient’s norm. The idea is to return a solution that achieves the minimum magnitude of the proximal gradient, i.e., min1≤τ≤t ∥G(xτ)∥2. The convergence of min1≤τ≤t ∥G(xτ)∥2 under HEB is presented in the following theorem. Theorem 3. Suppose F(x0) −F∗≤ϵ0 and F(x) satisfies HEB on Sϵ0. The iteration complexity of PG (option II, which returns the solution with historically minimal proximal gradient, see the supplementary material) for achieving min1≤τ≤t ∥G(xτ)∥2 ≤ϵ, is O(c 1 1−θ L max{1/ϵ 1−2θ 1−θ , log( ϵ0 ϵ )}) if θ ≤1/2, and is O(c2Lϵ2θ−1 0 ) if θ > 1/2. The final theorem in this section summarizes an o(1/t) convergence result of PG for minimizing a proper, coercive, convex, lower semicontinuous and semi-algebraic function, which could be interesting of its own. Theorem 4. Let F(x) be a proper, coercive, convex, lower semicontinuous and semi-algebraic functions. Then PG (with option I and option II) converges at a speed of o(1/t) for F(x) −F∗and G(x), respectively, where t is the total number of iterations. Remark: This can be easily proved by combining Proposition 1 and Theorems 1, 3. 4 Adaptive Accelerated Gradient Converging Methods We first present a key lemma for our development that serves the foundation of the adaptive regularization and conditional restarting. Lemma 1. Assume F(x) satisfies HEB for any x ∈Sξ with θ ∈(0, 1]. If θ ∈(0, 1/2], then for any x ∈Sξ, we have D(x, Ω∗) ≤2 L∥G(x)∥2 + c 1 1−θ 2 θ 1−θ ∥G(x)∥ θ 1−θ 2 . If θ ∈(1/2, 1], then for any x ∈Sξ, we have D(x, Ω∗) ≤ 2 L + 2c2ξ2θ−1 ∥G(x)∥2. A building block of the proposed algorithm is to solve a problem of the following style by employing the Algorithm 1 (i.e., Nesterov’s ADG): Fδ(x) = F(x) + δ 2∥x −x0∥2 2 = f(x) + g(x) + δ 2∥x −x0∥2 2, (8) which consists of a L-smooth function f(x) and a δ-strongly convex function gδ(x) = g(x)+ δ 2∥x− x0∥2 2. A key result for our development of conditional restarting is the following theorem for each call of Algorithm 1 for solving the above problem. Theorem 5. By running the Algorithm 1 for minimizing f(x) + gδ(x) with an initial solution x0, for t ≥ q L 2δ log L δ  we have ∥G(xt+1)∥2 ≤ p L(L + δ)∥x0 −x∗∥2 h 1 + p δ/(2L) i−t + 2 √ 2δ∥x0 −x∗∥2. where x∗is any optimal solution to the original problem. Finally, we present the proposed adaptive accelerated gradient converging (adaAGC) method for solving the smooth composite optimization in Algorithm 3 and prove the main theorem of this section. 6 Algorithm 3: adaAGC for solving (1) Input: x0 ∈Ωand c0 and γ > 1 Let ce = c0 and ε0 = ∥G(x0)∥2 for k = 1, . . . , K do for s = 1, . . . , do Let δk be given in (9) and gδk(x) = g(x) + δk 2 ∥x −xk−1∥2 2 A0 = 0, v0 = xk−1, xk 0 = xk−1 for t = 0, . . . do Let at+1 be the root of a2 At+a = 2 1+δkAt L Set At+1 = At + at+1 Set yt = At At+1 xk t + at+1 At+1 vt Compute xk t+1 = Pgδk /L(yt −∇f(yt)/L) Compute vt+1 = arg minx 1 2∥x −xk−1∥2 2 + Pt+1 τ=1 aτ∇f(xk τ)⊤x + At+1gδk(x) if ∥G(xk t+1)∥2 ≤εk−1/2 then let xk = xk t+1 and εk = εk−1/2 // step S1 break the enclosing two for loops if τ = ⌈ q 2L δk log √ L(L+δk) δk ⌉then // condition (*) let ce = γce and break the enclosing for loop // step S2 Output: xK The adaAGC runs with multiple stages (k = 1, . . . , K). We start with an initial guess c0 of the parameter c in the HEB. With the current guess ce of c, at the k-th stage adaAGC employs ADG to solve a problem of (8) with an adaptive regularization parameter δk being δk =        min L 32, ε 1−2θ 1−θ k−1 16c1/(1−θ) e 2 θ 1−θ ! if θ ∈(0, 1/2] min  L 32, 1 32c2eϵ2θ−1 0  if θ ∈(1/2, 1] (9) The condition (*) specifies the condition for restarting with an increased value of ce. When the flow enters step S2 before step S1 for each s, it means that the current guess ce is not sufficiently large according to Theorem 5 and Lemma 1, then we increase ce and repeat the same process (next iteration for s). We refer to this machinery as conditional restarting. We present the main result of this section in the following theorem. Theorem 6. Suppose F(x0) −F∗≤ϵ0, F(x) satisfies HEB on Sϵ0 and c0 ≤c. Let ε0 = ∥G(x0)∥2, K = ⌈log2( ε0 ϵ )⌉, p = (1 −2θ)/(1 −θ) for θ ∈(0, 1/2]. The iteration complexity of Algorithm 3 for having ∥G(xK)∥2 ≤ϵ is eO √ Lc 1 2(1−θ) max( 1 ϵp/2 , log(ε0/ϵ)  if θ ∈(0, 1/2], and eO( √ Lcϵθ−1/2 0 ) if θ ∈(1/2, 1], where eO(·) suppresses a log term depending on c, c0, L, γ. We sketch the idea of the proof here: for each k, we can bound the number of cycles (indexd by s in the algorithm) in order to enter step S1 denoted by sk. We can bound sk ≤logγ(c/c0) + 1 and then total number of iterations across all stages is bounded by PK k=1 sktk where tk = ⌈ q 2L δk log √ L(L+δk) δk ⌉. Before ending this section, we would like to remark that if the smoothness parameter L is unknown, one can also employ the backtracking technique pairing with each update to search for L [17]. 4.1 Convergence of Objective Gap In this subsection, we show that the convergence of the proximal gradient also implies the convergence of the objective gap F(x)−F∗for certain subclasses of the general problems that we have considered. Our first result applies to the case when F(x) satisfies the HEB with θ ∈(0, 1) and the nonsmooth part g(x) is absent, i.e., F(x) = f(x). In this case, we can establish the convergence of the objective gap, since the objective gap can be bounded by a function of the magnitude of gradient, 7 i.e., f(x) −f∗≤c1/(1−θ)∥∇f(x)∥1/(1−θ) 2 (c.f. the proof of Lemma 2 in the supplement). One can easily prove the following result. Theorem 7. Assume F(x) = f(x) and the same conditions in Theorem 6 hold. The iteration complexity of Algorithm 3 for having F(xK) −F(x∗) ≤ϵ is eO √ Lc max( 1 ϵ1/2−θ , log(ε0/ϵ)  if θ ∈(0, 1/2], and eO( √ Lcϵθ−1/2 0 ) if θ ∈(1/2, 1), where eO(·) suppresses a log term depending on c, c0, L, γ. Remark Note that the above iteration complexity of adaAGC is the same as that of rAPG (shown in Table 1), where the later is established under the knowledge of c. Our second result applies to a subclass of the general problems where either g(x) or f(x) is µ-strongly convex or F(x) = f(x) + g(x), where f(x) = h(Ax) with h(·) being a strongly convex function and g(x) is the indicator function of a polyhedral set Ω= {x : Cx ≤b}. Examples include square loss minimization under an ℓ1 or ℓ∞constraint [15, Theorem 8]. It has been shown that in the last case, for any x ∈dom(F), there exists µ > 0 such that f(x∗) ≥f(x) + ∇f(x)⊤(x∗−x) + µ 2 ∥x −x∗∥2 2, (10) where x∗is the closest optimal solution to x, and the HEB condition of F(x) with θ = 1/2 and c = p 2/µ holds [15, Theorem 1]. In the three cases mentioned above, we can establish that F(x+) −F∗≤O(1/µ)∥G(x)∥2 2, where x+ = Pg/L(x −∇f(x)/L), and the following result. Theorem 8. Assume f(x) or g(x) is µ-strongly convex, or f(x) = h(Ax) and g(x) is the indicator function of a polyhedral set such that (10) holds for some µ > 0, and other conditions in Theorem 6 hold. The iteration complexity of Algorithm 3 for having F(x+ K) −F(x∗) ≤ϵ is eO p L/µ log(ε0/√µϵ)  , where eO(·) suppresses a log term depending on µ, c0, L, γ. 5 Applications and Experiments In this section, we present some applications of our theorems and algorithms in machine learning. In particular, we consider the regularized problems with a smooth loss: min x∈Rd 1 n n X i=1 ℓ(x⊤ai, bi) + λR(x), (11) where (ai, bi), i = 1, . . . , n denote a set of training examples, R(x) could be the ℓ1 norm ∥x∥1, the ℓ∞norm ∥x∥∞, or a huber norm [28], or the ℓ1,p norm PK k=1 ∥xk∥p, where k is the k-th component vector of x. Next, we present several results about the HEB condition to cover a broad family of loss functions that enjoy the faster convergence of adaAGC. Corollary 1. Assume the loss function ℓ(z, b) is nonnegative, convex, smooth and piecewise quadratic, then the problems in (11) with ℓ1 norm, ℓ∞norm, Huber norm and ℓ1,∞norm regularization satisfy the HEB condition with θ = 1/2 on any sublevel set Sξ with ξ > 0. Hence adaAGC has a global linear convergence in terms of the proximal gradient’s norm and a square root dependence on the condition number. Remark: The above corollary follows directly from Proposition 2 and Theorem 6. If the loss function is a logistic loss and the regularizer is a polyhedral function (e.g., ℓ1, ℓ∞and ℓ1,∞norm), we can prove the same result. Examples of convex, smooth and piecewise convex quadratic loss functions include: square loss: ℓ(z, b) = (z −b)2 for b ∈R; squared hinge loss: ℓ(z, b) = max(0, 1 −bz)2 for b ∈{1, −1}; and huber loss: ℓ(z, b) = ρ(|z −b| −ρ 2) if |z −b| > ρ, and ℓ(z, b) = (z −b)2/2 if |z −b| ≤ρ, for b ∈R. Experimental Results We conduct some experiments to demonstrate the effectiveness of adaAGC for solving problems of type (1). Specifically, we compare adaAGC, PG with option II that returns the solution with historically minimal proximal gradient, FISTA, unconditional restarting FISTA (urFISTA) [6] for optimizing the squared hinge loss (classification), square loss (regression), huber loss (with ρ = 1) (regression) with ℓ1 and ℓ∞regularization, which are cases of (11), and we also consider the ℓ1 constrained ℓp norm regression (7) with varying p. We use three datasets from the LibSVM website [5], which are splice (n = 1000, d = 60) for classification, and bodyfat 8 Table 2: squared hinge loss with ℓ1 norm (left) and ℓ∞norm (right) regularization on splice data Algorithm ϵ = 10−4 ϵ = 10−5 ϵ = 10−6 ϵ = 10−7 ϵ = 10−4 ϵ = 10−5 ϵ = 10−6 ϵ = 10−7 PG 2040 2040 2040 2040 3514 3724 3724 3724 FISTA 1289 1289 1289 1289 5526 5526 5526 5526 urFISTA 1666 2371 2601 3480 1674 2379 2605 3488 adaAGC 1410 1410 1410 1410 2382 2382 2382 2382 FISTA > adaAGC > PG > urFISTA adaAGC > urFISTA > PG > FISTA Table 3: square loss with ℓ1 norm (left) and ℓ∞norm (right) regularization on cpusmall data Algorithm ϵ = 10−4 ϵ = 10−5 ϵ = 10−6 ϵ = 10−7 ϵ = 10−4 ϵ = 10−5 ϵ = 10−6 ϵ = 10−7 PG 109298 159908 170915 170915 139505 204120 210874 210874 FISTA 6781 16387 23779 23779 6610 16418 20082 20082 urFISTA 18278 26706 35173 43603 18276 26704 35169 43601 adaAGC 9571 12623 13575 13575 9881 13033 13632 13632 adaAGC > FISTA > urFISTA > PG adaAGC > FISTA > urFISTA > PG Table 4: ℓ1 regularized huber loss (left) and ℓ1 constrained square loss (right) on bodyfat data Algorithm ϵ = 10−4 ϵ = 10−5 ϵ = 10−6 ϵ = 10−7 ϵ = 10−4 ϵ = 10−5 ϵ = 10−6 ϵ = 10−7 PG 258723 423181 602043 681488 1006880 1768482 2530085 2632578 FISTA 6630 25020 74416 124261 15805 66319 180977 181176 urFISTA 6855 12662 17994 23933 138359 235081 331203 426341 adaAGC 16976 16980 23844 25697 23054 33818 44582 48127 urFISTA > adaAGC > FISTA > PG adaAGC> FISTA > urFISTA > PG Table 5: ℓ1 constrained ℓp norm regression on bodyfat data (ϵ = 10−3) Algorithm p = 2 p = 4 p = 6 p = 8 PG 250869 (1) 979401 (3.90) 1559753 (6.22) 4015665 (16.00) adaAGC 8710 (1) 17494 (2.0) 22481 (2.58) 33081 (3.80) (n = 252, d = 14), cpusmall (n = 8192, d = 12) for regression. For problems covered by (11), we fix λ = 1 n, and the parameter s in (7) is set to s = 100. We use the backtracking in PG, adaAGC and FISTA to search for the smoothness parameter. In adaAGC, we set c0 = 2, γ = 2 for the ℓ1 constrained ℓp norm regression and c0 = 10, γ = 2 for the rest problems. For fairness, for urFISTA and adaAGC, we use the same initial estimate of unknown parameter (i.e., c). Each algorithm starts at the same initial point, which is set to be zero, and we stop each algorithm when the norm of its proximal gradient is less than a prescribed threshold ϵ and report the total number of proximal mappings. The results are presented in the Tables 2–5. It indicates that adaAGC converges faster than PG and FISTA (except for solving squared hinge loss with ℓ1 norm regularization) when ϵ is very small, which is consistent with the theoretical results. Note that urFISTA sometimes has better performance than adaAGC but is worse than adaAGC in most cases. It is notable that for some problems (see Table 2) the number of proximal mappings is the same value for achieving different precision ϵ. This is because that value is the minimum number of proximal mappings such that the magnitude of the proximal gradient suddenly becomes zero. In Table 5, the numbers in parenthesis indicate the increasing factor in the number of proximal mappings compared to the base case p = 2, which show that increasing factors of adaAGC are approximately the square root of that of PG and thus are consistent with our theory. 6 Conclusions In this paper, we have considered smooth composite optimization problems under a general Hölderian error bound condition. We have established adaptive iteration complexity to the Hölderian error bound condition of proximal gradient and accelerated proximal gradient methods. To eliminate the dependence on the unknown parameter in the error bound condition and enjoy the faster convergence of accelerated proximal gradient method, we have developed a novel parameter-free adaptive accelerated gradient converging method using the magnitude of the (proximal) gradient as a measure for restart and termination. We have also considered a broad family of norm regularized problems in machine learning and showed faster convergence of the proposed adaptive accelerated gradient converging method. Acknowledgments We thank the anonymous reviewers for their helpful comments. M. Liu and T. Yang are partially supported by National Science Foundation (IIS-1463988, IIS-1545995). 9 References [1] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM J. Img. Sci., 2:183–202, 2009. [2] E. Bierstone and P. D. Milman. Semianalytic and subanalytic sets. Publications Mathématiques de l’Institut des Hautes Études Scientifiques, 67(1):5–42, 1988. [3] J. Bolte, T. P. Nguyen, J. Peypouquet, and B. Suter. From error bounds to the complexity of first-order descent methods for convex functions. CoRR, abs/1510.08234, 2015. [4] D. Drusvyatskiy and A. S. Lewis. Error bounds, quadratic growth, and linear convergence of proximal methods. arXiv:1602.06661, 2016. [5] R.-E. Fan and C.-J. Lin. Libsvm data: Classification, regression and multi-label. URL: http://www. csie. ntu. edu. tw/cjlin/libsvmtools/datasets, 2011. [6] O. Fercoq and Z. Qu. Restarting accelerated gradient methods with a rough strong convexity estimate. arXiv preprint arXiv:1609.07358, 2016. [7] P. Gong and J. Ye. Linear convergence of variance-reduced projected stochastic gradient without strong convexity. CoRR, abs/1406.1102, 2014. [8] K. Hou, Z. Zhou, A. M. So, and Z. Luo. On the linear convergence of the proximal gradient method for trace norm regularization. In Advances in Neural Information Processing Systems (NIPS), pages 710–718, 2013. [9] H. Karimi, J. Nutini, and M. W. Schmidt. Linear convergence of gradient and proximalgradient methods under the polyak-łojasiewicz condition. In Machine Learning and Knowledge Discovery in Databases - European Conference (ECML-PKDD), pages 795–811, 2016. [10] G. Li. Global error bounds for piecewise convex polynomials. Math. Program., 137(1-2):37–64, 2013. [11] Q. Lin and L. Xiao. An adaptive accelerated proximal gradient method and its homotopy continuation for sparse optimization. In Proceedings of the International Conference on Machine Learning, (ICML), pages 73–81, 2014. [12] Z.-Q. Luo and P. Tseng. On the convergence of coordinate descent method for convex differentiable minization. Journal of Optimization Theory and Applications, 72(1):7–35, 1992. [13] Z.-Q. Luo and P. Tseng. On the linear convergence of descent methods for convex essenially smooth minization. SIAM Journal on Control and Optimization, 30(2):408–425, 1992. [14] Z.-Q. Luo and P. Tseng. Error bounds and convergence analysis of feasible descent methods: a general approach. Annals of Operations Research, 46:157–178, 1993. [15] I. Necoara, Y. Nesterov, and F. Glineur. Linear convergence of first order methods for nonstrongly convex optimization. CoRR, abs/1504.06298, 2015. [16] Y. Nesterov. Introductory lectures on convex optimization : a basic course. Applied optimization. Kluwer Academic Publ., 2004. [17] Y. Nesterov. Gradient methods for minimizing composite objective function. Core discussion papers, Universite catholique de Louvain, Center for Operations Research and Econometrics (CORE), 2007. [18] Y. Nesterov. How to make the gradients small. Optima 88, 2012. [19] H. Nyquist. The optimal lp norm estimator in linear regression models. Communications in Statistics - Theory and Methods, 12(21):2511–2524, 1983. [20] R. T. Rockafellar. Monotone operators and the proximal point algorithm. SIAM J. on Control and Optimization, 14, 1976. 10 [21] A. M. So. Non-asymptotic convergence analysis of inexact gradient methods for machine learning without strong convexity. CoRR, abs/1309.0113, 2013. [22] P. Tseng. On accelerated proximal gradient methods for convex-concave optimization. submitted to SIAM Journal on Optimization, 2008. [23] P. Wang and C. Lin. Iteration complexity of feasible descent methods for convex optimization. Journal of Machine Learning Research, 15(1):1523–1548, 2014. [24] Y. Xu, Q. Lin, and T. Yang. Stochastic convex optimization: Faster local growth implies faster global convergence. In International Conference on Machine Learning, pages 3821–3830, 2017. [25] Y. Xu, Y. Yan, Q. Lin, and T. Yang. Homotopy smoothing for non-smooth problems with lower complexity than O(1/ϵ). In Advances In Neural Information Processing Systems 29 (NIPS), pages 1208–1216, 2016. [26] T. Yang and Q. Lin. Rsg: Beating subgradient method without smoothness and strong convexity. CoRR, abs/1512.03107, 2016. [27] W. H. Yang. Error bounds for convex polynomials. SIAM Journal on Optimization, 19(4):1633– 1647, 2009. [28] O. Zadorozhnyi, G. Benecke, S. Mandt, T. Scheffer, and M. Kloft. Huber-norm regularization for linear prediction models. In Machine Learning and Knowledge Discovery in Databases European Conference (ECML-PKDD), pages 714–730, 2016. [29] H. Zhang. New analysis of linear convergence of gradient-type methods via unifying error bound conditions. CoRR, abs/1606.00269, 2016. [30] H. Zhang. The restricted strong convexity revisited: analysis of equivalence to error bound and quadratic growth. Optimization Letters, pages 1–17, 2016. [31] Z. Zhou and A. M. So. A unified approach to error bounds for structured convex optimization problems. CoRR, abs/1512.03518, 2015. [32] Z. Zhou, Q. Zhang, and A. M. So. L1p-norm regularization: Error bounds and convergence rate analysis of first-order methods. In Proceedings of the 32nd International Conference on Machine Learning, (ICML), pages 1501–1510, 2015. 11
2017
101
6,566
What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision? Alex Kendall University of Cambridge agk34@cam.ac.uk Yarin Gal University of Cambridge yg279@cam.ac.uk Abstract There are two major types of uncertainty one can model. Aleatoric uncertainty captures noise inherent in the observations. On the other hand, epistemic uncertainty accounts for uncertainty in the model – uncertainty which can be explained away given enough data. Traditionally it has been difficult to model epistemic uncertainty in computer vision, but with new Bayesian deep learning tools this is now possible. We study the benefits of modeling epistemic vs. aleatoric uncertainty in Bayesian deep learning models for vision tasks. For this we present a Bayesian deep learning framework combining input-dependent aleatoric uncertainty together with epistemic uncertainty. We study models under the framework with per-pixel semantic segmentation and depth regression tasks. Further, our explicit uncertainty formulation leads to new loss functions for these tasks, which can be interpreted as learned attenuation. This makes the loss more robust to noisy data, also giving new state-of-the-art results on segmentation and depth regression benchmarks. 1 Introduction Understanding what a model does not know is a critical part of many machine learning systems. Today, deep learning algorithms are able to learn powerful representations which can map high dimensional data to an array of outputs. However these mappings are often taken blindly and assumed to be accurate, which is not always the case. In two recent examples this has had disastrous consequences. In May 2016 there was the first fatality from an assisted driving system, caused by the perception system confusing the white side of a trailer for bright sky [1]. In a second recent example, an image classification system erroneously identified two African Americans as gorillas [2], raising concerns of racial discrimination. If both these algorithms were able to assign a high level of uncertainty to their erroneous predictions, then the system may have been able to make better decisions and likely avoid disaster. Quantifying uncertainty in computer vision applications can be largely divided into regression settings such as depth regression, and classification settings such as semantic segmentation. Existing approaches to model uncertainty in such settings in computer vision include particle filtering and conditional random fields [3, 4]. However many modern applications mandate the use of deep learning to achieve state-of-the-art performance [5], with most deep learning models not able to represent uncertainty. Deep learning does not allow for uncertainty representation in regression settings for example, and deep learning classification models often give normalised score vectors, which do not necessarily capture model uncertainty. For both settings uncertainty can be captured with Bayesian deep learning approaches – which offer a practical framework for understanding uncertainty with deep learning models [6]. In Bayesian modeling, there are two main types of uncertainty one can model [7]. Aleatoric uncertainty captures noise inherent in the observations. This could be for example sensor noise or motion noise, resulting in uncertainty which cannot be reduced even if more data were to be collected. On the other hand, epistemic uncertainty accounts for uncertainty in the model parameters – uncertainty 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. (a) Input Image (b) Ground Truth (c) Semantic Segmentation (d) Aleatoric Uncertainty (e) Epistemic Uncertainty Figure 1: Illustrating the difference between aleatoric and epistemic uncertainty for semantic segmentation on the CamVid dataset [8]. Aleatoric uncertainty captures noise inherent in the observations. In (d) our model exhibits increased aleatoric uncertainty on object boundaries and for objects far from the camera. Epistemic uncertainty accounts for our ignorance about which model generated our collected data. This is a notably different measure of uncertainty and in (e) our model exhibits increased epistemic uncertainty for semantically and visually challenging pixels. The bottom row shows a failure case of the segmentation model when the model fails to segment the footpath due to increased epistemic uncertainty, but not aleatoric uncertainty. which captures our ignorance about which model generated our collected data. This uncertainty can be explained away given enough data, and is often referred to as model uncertainty. Aleatoric uncertainty can further be categorized into homoscedastic uncertainty, uncertainty which stays constant for different inputs, and heteroscedastic uncertainty. Heteroscedastic uncertainty depends on the inputs to the model, with some inputs potentially having more noisy outputs than others. Heteroscedastic uncertainty is especially important for computer vision applications. For example, for depth regression, highly textured input images with strong vanishing lines are expected to result in confident predictions, whereas an input image of a featureless wall is expected to have very high uncertainty. In this paper we make the observation that in many big data regimes (such as the ones common to deep learning with image data), it is most effective to model aleatoric uncertainty, uncertainty which cannot be explained away. This is in comparison to epistemic uncertainty which is mostly explained away with the large amounts of data often available in machine vision. We further show that modeling aleatoric uncertainty alone comes at a cost. Out-of-data examples, which can be identified with epistemic uncertainty, cannot be identified with aleatoric uncertainty alone. For this we present a unified Bayesian deep learning framework which allows us to learn mappings from input data to aleatoric uncertainty and compose these together with epistemic uncertainty approximations. We derive our framework for both regression and classification applications and present results for per-pixel depth regression and semantic segmentation tasks (see Figure 1 and the supplementary video for examples). We show how modeling aleatoric uncertainty in regression can be used to learn loss attenuation, and develop a complimentary approach for the classification case. This demonstrates the efficacy of our approach on difficult and large scale tasks. The main contributions of this work are; 1. We capture an accurate understanding of aleatoric and epistemic uncertainties, in particular with a novel approach for classification, 2. We improve model performance by 1 −3% over non-Bayesian baselines by reducing the effect of noisy data with the implied attenuation obtained from explicitly representing aleatoric uncertainty, 3. We study the trade-offs between modeling aleatoric or epistemic uncertainty by characterizing the properties of each uncertainty and comparing model performance and inference time. 2 2 Related Work Existing approaches to Bayesian deep learning capture either epistemic uncertainty alone, or aleatoric uncertainty alone [6]. These uncertainties are formalised as probability distributions over either the model parameters, or model outputs, respectively. Epistemic uncertainty is modeled by placing a prior distribution over a model’s weights, and then trying to capture how much these weights vary given some data. Aleatoric uncertainty on the other hand is modeled by placing a distribution over the output of the model. For example, in regression our outputs might be modeled as corrupted with Gaussian random noise. In this case we are interested in learning the noise’s variance as a function of different inputs (such noise can also be modeled with a constant value for all data points, but this is of less practical interest). These uncertainties, in the context of Bayesian deep learning, are explained in more detail in this section. 2.1 Epistemic Uncertainty in Bayesian Deep Learning To capture epistemic uncertainty in a neural network (NN) we put a prior distribution over its weights, for example a Gaussian prior distribution: W ∼N(0, I). Such a model is referred to as a Bayesian neural network (BNN) [9–11]. Bayesian neural networks replace the deterministic network’s weight parameters with distributions over these parameters, and instead of optimising the network weights directly we average over all possible weights (referred to as marginalisation). Denoting the random output of the BNN as f W(x), we define the model likelihood p(y|f W(x)). Given a dataset X = {x1, ..., xN}, Y = {y1, ..., yN}, Bayesian inference is used to compute the posterior over the weights p(W|X, Y). This posterior captures the set of plausible model parameters, given the data. For regression tasks we often define our likelihood as a Gaussian with mean given by the model output: p(y|f W(x)) = N(f W(x), σ2), with an observation noise scalar σ. For classification, on the other hand, we often squash the model output through a softmax function, and sample from the resulting probability vector: p(y|f W(x)) = Softmax(f W(x)). BNNs are easy to formulate, but difficult to perform inference in. This is because the marginal probability p(Y|X), required to evaluate the posterior p(W|X, Y) = p(Y|X, W)p(W)/p(Y|X), cannot be evaluated analytically. Different approximations exist [12–15]. In these approximate inference techniques, the posterior p(W|X, Y) is fitted with a simple distribution q∗ θ(W), parameterised by θ. This replaces the intractable problem of averaging over all weights in the BNN with an optimisation task, where we seek to optimise over the parameters of the simple distribution instead of optimising the original neural network’s parameters. Dropout variational inference is a practical approach for approximate inference in large and complex models [15]. This inference is done by training a model with dropout before every weight layer, and by also performing dropout at test time to sample from the approximate posterior (stochastic forward passes, referred to as Monte Carlo dropout). More formally, this approach is equivalent to performing approximate variational inference where we find a simple distribution q∗ θ(W) in a tractable family which minimises the Kullback-Leibler (KL) divergence to the true model posterior p(W|X, Y). Dropout can be interpreted as a variational Bayesian approximation, where the approximating distribution is a mixture of two Gaussians with small variances and the mean of one of the Gaussians is fixed at zero. The minimisation objective is given by [16]: L(θ, p) = −1 N N X i=1 log p(yi|f c Wi(xi)) + 1 −p 2N ||θ||2 (1) with N data points, dropout probability p, samples c Wi ∼q∗ θ(W), and θ the set of the simple distribution’s parameters to be optimised (weight matrices in dropout’s case). In regression, for example, the negative log likelihood can be further simplified as −log p(yi|f c Wi(xi)) ∝ 1 2σ2 ||yi −f c Wi(xi)||2 + 1 2 log σ2 (2) for a Gaussian likelihood, with σ the model’s observation noise parameter – capturing how much noise we have in the outputs. Epistemic uncertainty in the weights can be reduced by observing more data. This uncertainty induces prediction uncertainty by marginalising over the (approximate) weights posterior distribution. 3 For classification this can be approximated using Monte Carlo integration as follows: p(y = c|x, X, Y) ≈1 T T X t=1 Softmax(f c Wt(x)) (3) with T sampled masked model weights c Wt ∼q∗ θ(W), where qθ(W) is the Dropout distribution [6]. The uncertainty of this probability vector p can then be summarised using the entropy of the probability vector: H(p) = −PC c=1 pc log pc. For regression this epistemic uncertainty is captured by the predictive variance, which can be approximated as: Var(y) ≈σ2 + 1 T T X t=1 f c Wt(x)T f c Wt(xt) −E(y)T E(y) (4) with predictions in this epistemic model done by approximating the predictive mean: E(y) ≈ 1 T PT t=1 f c Wt(x). The first term in the predictive variance, σ2, corresponds to the amount of noise inherent in the data (which will be explained in more detail soon). The second part of the predictive variance measures how much the model is uncertain about its predictions – this term will vanish when we have zero parameter uncertainty (i.e. when all draws c Wt take the same constant value). 2.2 Heteroscedastic Aleatoric Uncertainty In the above we captured model uncertainty – uncertainty over the model parameters – by approximating the distribution p(W|X, Y). To capture aleatoric uncertainty in regression, we would have to tune the observation noise parameter σ. Homoscedastic regression assumes constant observation noise σ for every input point x. Heteroscedastic regression, on the other hand, assumes that observation noise can vary with input x [17, 18]. Heteroscedastic models are useful in cases where parts of the observation space might have higher noise levels than others. In non-Bayesian neural networks, this observation noise parameter is often fixed as part of the model’s weight decay, and ignored. However, when made data-dependent, it can be learned as a function of the data: LNN(θ) = 1 N N X i=1 1 2σ(xi)2 ||yi −f(xi)||2 + 1 2 log σ(xi)2 (5) with added weight decay parameterised by λ (and similarly for l1 loss). Note that here, unlike the above, variational inference is not performed over the weights, but instead we perform MAP inference – finding a single value for the model parameters θ. This approach does not capture epistemic model uncertainty, as epistemic uncertainty is a property of the model and not of the data. In the next section we will combine these two types of uncertainties together in a single model. We will see how heteroscedastic noise can be interpreted as model attenuation, and develop a complimentary approach for the classification case. 3 Combining Aleatoric and Epistemic Uncertainty in One Model In the previous section we described existing Bayesian deep learning techniques. In this section we present novel contributions which extend this existing literature. We develop models that will allow us to study the effects of modeling either aleatoric uncertainty alone, epistemic uncertainty alone, or modeling both uncertainties together in a single model. This is followed by an observation that aleatoric uncertainty in regression tasks can be interpreted as learned loss attenuation – making the loss more robust to noisy data. We follow that by extending the ideas of heteroscedastic regression to classification tasks. This allows us to learn loss attenuation for classification tasks as well. 3.1 Combining Heteroscedastic Aleatoric Uncertainty and Epistemic Uncertainty We wish to capture both epistemic and aleatoric uncertainty in a vision model. For this we turn the heteroscedastic NN in §2.2 into a Bayesian NN by placing a distribution over its weights, with our construction in this section developed specifically for the case of vision models1. We need to infer the posterior distribution for a BNN model f mapping an input image, x, to a unary output, ˆy ∈R, and a measure of aleatoric uncertainty given by variance, σ2. We approximate the posterior over the BNN with a dropout variational distribution using the tools of §2.1. As before, 1Although this construction can be generalised for any heteroscedastic NN architecture. 4 we draw model weights from the approximate posterior c W ∼q(W) to obtain a model output, this time composed of both predictive mean as well as predictive variance: [ˆy, ˆσ2] = f c W(x) (6) where f is a Bayesian convolutional neural network parametrised by model weights c W. We can use a single network to transform the input x, with its head split to predict both ˆy as well as ˆσ2. We fix a Gaussian likelihood to model our aleatoric uncertainty. This induces a minimisation objective given labeled output points x: LBNN(θ) = 1 D X i 1 2 ˆσ−2 i ||yi −ˆyi||2 + 1 2 log ˆσ2 i (7) where D is the number of output pixels yi corresponding to input image x, indexed by i (additionally, the loss includes weight decay which is omitted for brevity). For example, we may set D = 1 for image-level regression tasks, or D equal to the number of pixels for dense prediction tasks (predicting a unary corresponding to each input image pixel). ˆσ2 i is the BNN output for the predicted variance for pixel i. This loss consists of two components; the residual regression obtained with a stochastic sample through the model – making use of the uncertainty over the parameters – and an uncertainty regularization term. We do not need ‘uncertainty labels’ to learn uncertainty. Rather, we only need to supervise the learning of the regression task. We learn the variance, σ2, implicitly from the loss function. The second regularization term prevents the network from predicting infinite uncertainty (and therefore zero loss) for all data points. In practice, we train the network to predict the log variance, si := log ˆσ2 i : LBNN(θ) = 1 D X i 1 2 exp(−si)||yi −ˆyi||2 + 1 2si. (8) This is because it is more numerically stable than regressing the variance, σ2, as the loss avoids a potential division by zero. The exponential mapping also allows us to regress unconstrained scalar values, where exp(−si) is resolved to the positive domain giving valid values for variance. To summarize, the predictive uncertainty for pixel y in this combined model can be approximated using: Var(y) ≈1 T T X t=1 ˆy2 t −  1 T T X t=1 ˆyt 2 + 1 T T X t=1 ˆσ2 t (9) with {ˆyt, ˆσ2 t }T t=1 a set of T sampled outputs: ˆyt, ˆσ2 t = f c Wt(x) for randomly masked weights c Wt ∼q(W). 3.2 Heteroscedastic Uncertainty as Learned Loss Attenuation We observe that allowing the network to predict uncertainty, allows it effectively to temper the residual loss by exp(−si), which depends on the data. This acts similarly to an intelligent robust regression function. It allows the network to adapt the residual’s weighting, and even allows the network to learn to attenuate the effect from erroneous labels. This makes the model more robust to noisy data: inputs for which the model learned to predict high uncertainty will have a smaller effect on the loss. The model is discouraged from predicting high uncertainty for all points – in effect ignoring the data – through the log σ2 term. Large uncertainty increases the contribution of this term, and in turn penalizes the model: The model can learn to ignore the data – but is penalised for that. The model is also discouraged from predicting very low uncertainty for points with high residual error, as low σ2 will exaggerate the contribution of the residual and will penalize the model. It is important to stress that this learned attenuation is not an ad-hoc construction, but a consequence of the probabilistic interpretation of the model. 3.3 Heteroscedastic Uncertainty in Classification Tasks This learned loss attenuation property of heteroscedastic NNs in regression is a desirable effect for classification models as well. However, heteroscedastic NNs in classification are peculiar models because technically any classification task has input-dependent uncertainty. Nevertheless, the ideas above can be extended from regression heteroscedastic NNs to classification heteroscedastic NNs. 5 For this we adapt the standard classification model to marginalise over intermediate heteroscedastic regression uncertainty placed over the logit space. We therefore explicitly refer to our proposed model adaptation as a heteroscedastic classification NN. For classification tasks our NN predicts a vector of unaries fi for each pixel i, which when passed through a softmax operation, forms a probability vector pi. We change the model by placing a Gaussian distribution over the unaries vector: ˆxi|W ∼N(f W i , (σW i )2) ˆpi = Softmax(ˆxi). (10) Here f W i , σW i are the network outputs with parameters W. This vector f W i is corrupted with Gaussian noise with variance (σW i )2 (a diagonal matrix with one element for each logit value), and the corrupted vector is then squashed with the softmax function to obtain pi, the probability vector for pixel i. Our expected log likelihood for this model is given by: log EN (ˆxi;f W i ,(σW i )2)[ˆpi,c] (11) with c the observed class for input i, which gives us our loss function. Ideally, we would want to analytically integrate out this Gaussian distribution, but no analytic solution is known. We therefore approximate the objective through Monte Carlo integration, and sample unaries through the softmax function. We note that this operation is extremely fast because we perform the computation once (passing inputs through the model to get logits). We only need to sample from the logits, which is a fraction of the network’s compute, and therefore does not significantly increase the model’s test time. We can rewrite the above and obtain the following numerically-stable stochastic loss: ˆxi,t = f W i + σW i ϵt, ϵt ∼N(0, I) Lx = X i log 1 T X t exp(ˆxi,t,c −log X c′ exp ˆxi,t,c′) (12) with xi,t,c′ the c′ element in the logit vector xi,t. This objective can be interpreted as learning loss attenuation, similarly to the regression case. We next assess the ideas above empirically. 4 Experiments In this section we evaluate our methods with pixel-wise depth regression and semantic segmentation. An analysis of these results is given in the following section. To show the robustness of our learned loss attenuation – a side-effect of modeling uncertainty – we present results on an array of popular datasets, CamVid, Make3D, and NYUv2 Depth, where we set new state-of-the-art benchmarks. For the following experiments we use the DenseNet architecture [19] which has been adapted for dense prediction tasks by [20]. We use our own independent implementation of the architecture using TensorFlow [21] (which slightly outperforms the original authors’ implementation on CamVid by 0.2%, see Table 1a). For all experiments we train with 224 × 224 crops of batch size 4, and then fine-tune on full-size images with a batch size of 1. We train with RMS-Prop with a constant learning rate of 0.001 and weight decay 10−4. We compare the results of the Bayesian neural network models outlined in §3. We model epistemic uncertainty using Monte Carlo dropout (§2.1). The DenseNet architecture places dropout with p = 0.2 after each convolutional layer. Following [22], we use 50 Monte Carlo dropout samples. We model aleatoric uncertainty with MAP inference using loss functions (8) and (12 in the appendix), for regression and classification respectively (§2.2). However, we derive the loss function using a Laplacian prior, as opposed to the Gaussian prior used for the derivations in §3. This is because it results in a loss function which applies a L1 distance on the residuals. Typically, we find this to outperform L2 loss for regression tasks in vision. We model the benefit of combining both epistemic uncertainty as well as aleatoric uncertainty using our developments presented in §3. 4.1 Semantic Segmentation To demonstrate our method for semantic segmentation, we use two datasets, CamVid [8] and NYU v2 [23]. CamVid is a road scene understanding dataset with 367 training images and 233 test images, of day and dusk scenes, with 11 classes. We resize images to 360 × 480 pixels for training and evaluation. In Table 1a we present results for our architecture. Our method sets a new state-of-the-art 6 CamVid IoU SegNet [28] 46.4 FCN-8 [29] 57.0 DeepLab-LFOV [24] 61.6 Bayesian SegNet [22] 63.1 Dilation8 [30] 65.3 Dilation8 + FSO [31] 66.1 DenseNet [20] 66.9 This work: DenseNet (Our Implementation) 67.1 + Aleatoric Uncertainty 67.4 + Epistemic Uncertainty 67.2 + Aleatoric & Epistemic 67.5 (a) CamVid dataset for road scene segmentation. NYUv2 40-class Accuracy IoU SegNet [28] 66.1 23.6 FCN-8 [29] 61.8 31.6 Bayesian SegNet [22] 68.0 32.4 Eigen and Fergus [32] 65.6 34.1 This work: DeepLabLargeFOV 70.1 36.5 + Aleatoric Uncertainty 70.4 37.1 + Epistemic Uncertainty 70.2 36.7 + Aleatoric & Epistemic 70.6 37.3 (b) NYUv2 40-class dataset for indoor scenes. Table 1: Semantic segmentation performance. Modeling both aleatoric and epistemic uncertainty gives a notable improvement in segmentation accuracy over state of the art baselines. Make3D rel rms log10 Karsch et al. [33] 0.355 9.20 0.127 Liu et al. [34] 0.335 9.49 0.137 Li et al. [35] 0.278 7.19 0.092 Laina et al. [26] 0.176 4.46 0.072 This work: DenseNet Baseline 0.167 3.92 0.064 + Aleatoric Uncertainty 0.149 3.93 0.061 + Epistemic Uncertainty 0.162 3.87 0.064 + Aleatoric & Epistemic 0.149 4.08 0.063 (a) Make3D depth dataset [25]. NYU v2 Depth rel rms log10 δ1 δ2 δ3 Karsch et al. [33] 0.374 1.12 0.134 Ladicky et al. [36] 54.2% 82.9% 91.4% Liu et al. [34] 0.335 1.06 0.127 Li et al. [35] 0.232 0.821 0.094 62.1% 88.6% 96.8% Eigen et al. [27] 0.215 0.907 61.1% 88.7% 97.1% Eigen and Fergus [32] 0.158 0.641 76.9% 95.0% 98.8% Laina et al. [26] 0.127 0.573 0.055 81.1% 95.3% 98.8% This work: DenseNet Baseline 0.117 0.517 0.051 80.2% 95.1% 98.8% + Aleatoric Uncertainty 0.112 0.508 0.046 81.6% 95.8% 98.8% + Epistemic Uncertainty 0.114 0.512 0.049 81.1% 95.4% 98.8% + Aleatoric & Epistemic 0.110 0.506 0.045 81.7% 95.9% 98.9% (b) NYUv2 depth dataset [23]. Table 2: Monocular depth regression performance. Comparison to previous approaches on depth regression dataset NYUv2 Depth. Modeling the combination of uncertainties improves accuracy. on this dataset with mean intersection over union (IoU) score of 67.5%. We observe that modeling both aleatoric and epistemic uncertainty improves over the baseline result. The implicit attenuation obtained from the aleatoric loss provides a larger improvement than the epistemic uncertainty model. However, the combination of both uncertainties improves performance even further. This shows that for this application it is more important to model aleatoric uncertainty, suggesting that epistemic uncertainty can be mostly explained away in this large data setting. Secondly, NYUv2 [23] is a challenging indoor segmentation dataset with 40 different semantic classes. It has 1449 images with resolution 640 × 480 from 464 different indoor scenes. Table 1b shows our results. This dataset is much harder than CamVid because there is significantly less structure in indoor scenes compared to street scenes, and because of the increased number of semantic classes. We use DeepLabLargeFOV [24] as our baseline model. We observe a similar result (qualitative results given in Figure 4); we improve baseline performance by giving the model flexibility to estimate uncertainty and attenuate the loss. The effect is more pronounced, perhaps because the dataset is more difficult. 4.2 Pixel-wise Depth Regression We demonstrate the efficacy of our method for regression using two popular monocular depth regression datasets, Make3D [25] and NYUv2 Depth [23]. The Make3D dataset consists of 400 training and 134 testing images, gathered using a 3-D laser scanner. We evaluate our method using the same standard as [26], resizing images to 345 × 460 pixels and evaluating on pixels with depth less than 70m. NYUv2 Depth is taken from the same dataset used for classification above. It contains RGB-D imagery from 464 different indoor scenes. We compare to previous approaches for Make3D in Table 2a and NYUv2 Depth in Table 2b, using standard metrics (for a description of these metrics please see [27]). These results show that aleatoric uncertainty is able to capture many aspects of this task which are inherently difficult. For example, in the qualitative results in Figure 5 and 6 we observe that aleatoric uncertainty is greater for large depths, reflective surfaces and occlusion boundaries in the image. These are common failure modes of monocular depth algorithms [26]. On the other hand, these qualitative results show that epistemic uncertainty captures difficulties due to lack of data. For 7 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0.88 0.90 0.92 0.94 0.96 0.98 1.00 Precision Aleatoric Uncertainty Epistemic Uncertainty (a) Classification (CamVid) 0.0 0.2 0.4 0.6 0.8 1.0 Recall 0 1 2 3 4 Precision (RMS Error) Aleatoric Uncertainty Epistemic Uncertainty (b) Regression (Make3D) Figure 2: Precision Recall plots demonstrating both measures of uncertainty can effectively capture accuracy, as precision decreases with increasing uncertainty. 0.0 0.2 0.4 0.6 0.8 1.0 Probability 0.0 0.2 0.4 0.6 0.8 1.0 Frequency Aleatoric, MSE = 0.031 Epistemic, MSE = 0.00364 (a) Regression (Make3D) 0.0 0.2 0.4 0.6 0.8 1.0 Probability 0.0 0.2 0.4 0.6 0.8 1.0 Precision Non-Bayesian, MSE = 0.00501 Aleatoric, MSE = 0.00272 Epistemic, MSE = 0.007 Epistemic+Aleatoric, MSE = 0.00214 (b) Classification (CamVid) 0.0 0.2 0.4 0.6 0.8 1.0 Probability 0.0 0.2 0.4 0.6 0.8 1.0 Precision Non-Bayesian, MSE = 0.00501 Aleatoric, MSE = 0.00272 Epistemic, MSE = 0.007 Epistemic+Aleatoric, MSE = 0.00214 Figure 3: Uncertainty calibration plots. This plot shows how well uncertainty is calibrated, where perfect calibration corresponds to the line y = x, shown in black. We observe an improvement in calibration mean squared error with aleatoric, epistemic and the combination of uncertainties. example, we observe larger uncertainty for objects which are rare in the training set such as humans in the third example of Figure 5. In summary, we have demonstrated that our model can improve performance over non-Bayesian baselines by implicitly learning attenuation of systematic noise and difficult concepts. For example we observe high aleatoric uncertainty for distant objects and on object and occlusion boundaries. 5 Analysis: What Do Aleatoric and Epistemic Uncertainties Capture? In §4 we showed that modeling aleatoric and epistemic uncertainties improves prediction performance, with the combination performing even better. In this section we wish to study the effectiveness of modeling aleatoric and epistemic uncertainty. In particular, we wish to quantify the performance of these uncertainty measurements and analyze what they capture. 5.1 Quality of Uncertainty Metric Firstly, in Figure 2 we show precision-recall curves for regression and classification models. They show how our model performance improves by removing pixels with uncertainty larger than various percentile thresholds. This illustrates two behaviors of aleatoric and epistemic uncertainty measures. Firstly, it shows that the uncertainty measurements are able to correlate well with accuracy, because all curves are strictly decreasing functions. We observe that precision is lower when we have more points that the model is not certain about. Secondly, the curves for epistemic and aleatoric uncertainty models are very similar. This shows that each uncertainty ranks pixel confidence similarly to the other uncertainty, in the absence of the other uncertainty. This suggests that when only one uncertainty is explicitly modeled, it attempts to compensate for the lack of the alternative uncertainty when possible. Secondly, in Figure 3 we analyze the quality of our uncertainty measurement using calibration plots from our model on the test set. To form calibration plots for classification models, we discretize our model’s predicted probabilities into a number of bins, for all classes and all pixels in the test set. We then plot the frequency of correctly predicted labels for each bin of probability values. Better performing uncertainty estimates should correlate more accurately with the line y = x in the calibration plots. For regression models, we can form calibration plots by comparing the frequency of residuals lying within varying thresholds of the predicted distribution. Figure 3 shows the calibration of our classification and regression uncertainties. 8 Train Test Aleatoric Epistemic dataset dataset RMS variance variance Make3D / 4 Make3D 5.76 0.506 7.73 Make3D / 2 Make3D 4.62 0.521 4.38 Make3D Make3D 3.87 0.485 2.78 Make3D / 4 NYUv2 0.388 15.0 Make3D NYUv2 0.461 4.87 (a) Regression Train Test Aleatoric Epistemic logit dataset dataset IoU entropy variance (×10−3) CamVid / 4 CamVid 57.2 0.106 1.96 CamVid / 2 CamVid 62.9 0.156 1.66 CamVid CamVid 67.5 0.111 1.36 CamVid / 4 NYUv2 0.247 10.9 CamVid NYUv2 0.264 11.8 (b) Classification Table 3: Accuracy and aleatoric and epistemic uncertainties for a range of different train and test dataset combinations. We show aleatoric and epistemic uncertainty as the mean value of all pixels in the test dataset. We compare reduced training set sizes (1, 1⁄2, 1⁄4) and unrelated test datasets. This shows that aleatoric uncertainty remains approximately constant, while epistemic uncertainty decreases the closer the test data is to the training distribution, demonstrating that epistemic uncertainty can be explained away with sufficient training data (but not for out-of-distribution data). 5.2 Uncertainty with Distance from Training Data In this section we show two results: 1. Aleatoric uncertainty cannot be explained away with more data, 2. Aleatoric uncertainty does not increase for out-of-data examples (situations different from training set), whereas epistemic uncertainty does. In Table 3 we give accuracy and uncertainty for models trained on increasing sized subsets of datasets. This shows that epistemic uncertainty decreases as the training dataset gets larger. It also shows that aleatoric uncertainty remains relatively constant and cannot be explained away with more data. Testing the models with a different test set (bottom two lines) shows that epistemic uncertainty increases considerably on those test points which lie far from the training sets. These results reinforce the case that epistemic uncertainty can be explained away with enough data, but is required to capture situations not encountered in the training set. This is particularly important for safety-critical systems, where epistemic uncertainty is required to detect situations which have never been seen by the model before. 5.3 Real-Time Application Our model based on DenseNet [20] can process a 640×480 resolution image in 150ms on a NVIDIA Titan X GPU. The aleatoric uncertainty models add negligible compute. However, epistemic models require expensive Monte Carlo dropout sampling. For models such as ResNet [4], this is possible to achieve economically because only the last few layers contain dropout. Other models, like DenseNet, require the entire architecture to be sampled. This is difficult to parallelize due to GPU memory constraints, and often results in a 50× slow-down for 50 Monte Carlo samples. 6 Conclusions We presented a novel Bayesian deep learning framework to learn a mapping to aleatoric uncertainty from the input data, which is composed on top of epistemic uncertainty models. We derived our framework for both regression and classification applications. We showed that it is important to model aleatoric uncertainty for: • Large data situations, where epistemic uncertainty is explained away, • Real-time applications, because we can form aleatoric models without expensive Monte Carlo samples. And epistemic uncertainty is important for: • Safety-critical applications, because epistemic uncertainty is required to understand examples which are different from training data, • Small datasets where the training data is sparse. However aleatoric and epistemic uncertainty models are not mutually exclusive. We showed that the combination is able to achieve new state-of-the-art results on depth regression and semantic segmentation benchmarks. The first paragraph in this paper posed two recent disasters which could have been averted by realtime Bayesian deep learning tools. Therefore, we leave finding a method for real-time epistemic uncertainty in deep learning as an important direction for future research. 9 References [1] NHTSA. PE 16-007. Technical report, U.S. Department of Transportation, National Highway Traffic Safety Administration, Jan 2017. Tesla Crash Preliminary Evaluation Report. [2] Jessica Guynn. Google photos labeled black people ’gorillas’. USA Today, 2015. [3] Andrew Blake, Rupert Curwen, and Andrew Zisserman. A framework for spatiotemporal control in the tracking of visual contours. International Journal of Computer Vision, 11(2):127–145, 1993. [4] Xuming He, Richard S Zemel, and Miguel ´A Carreira-Perpi˜n´an. Multiscale conditional random fields for image labeling. In Computer vision and pattern recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE computer society conference on, volume 2, pages II–II. IEEE, 2004. [5] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016. [6] Y. Gal. Uncertainty in Deep Learning. PhD thesis, University of Cambridge, 2016. [7] Armen Der Kiureghian and Ove Ditlevsen. Aleatory or epistemic? does it matter? Structural Safety, 31 (2):105–112, 2009. [8] Gabriel J Brostow, Julien Fauqueur, and Roberto Cipolla. Semantic object classes in video: A highdefinition ground truth database. Pattern Recognition Letters, 30(2):88–97, 2009. [9] John Denker and Yann LeCun. Transforming neural-net output levels to probability distributions. In Advances in Neural Information Processing Systems 3. Citeseer, 1991. [10] David JC MacKay. A practical Bayesian framework for backpropagation networks. Neural Computation, 4(3):448–472, 1992. [11] Radford M Neal. Bayesian learning for neural networks. PhD thesis, University of Toronto, 1995. [12] Alex Graves. Practical variational inference for neural networks. In Advances in Neural Information Processing Systems, pages 2348–2356, 2011. [13] Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural network. In ICML, 2015. [14] Jos´e Miguel Hern´andez-Lobato, Yingzhen Li, Daniel Hern´andez-Lobato, Thang Bui, and Richard E Turner. Black-box alpha divergence minimization. In Proceedings of The 33rd International Conference on Machine Learning, pages 1511–1520, 2016. [15] Yarin Gal and Zoubin Ghahramani. Bayesian convolutional neural networks with Bernoulli approximate variational inference. ICLR workshop track, 2016. [16] Michael I Jordan, Zoubin Ghahramani, Tommi S Jaakkola, and Lawrence K Saul. An introduction to variational methods for graphical models. Machine learning, 37(2):183–233, 1999. [17] David A Nix and Andreas S Weigend. Estimating the mean and variance of the target probability distribution. In Neural Networks, 1994. IEEE World Congress on Computational Intelligence., 1994 IEEE International Conference On, volume 1, pages 55–60. IEEE, 1994. [18] Quoc V Le, Alex J Smola, and St´ephane Canu. Heteroscedastic Gaussian process regression. In Proceedings of the 22nd international conference on Machine learning, pages 489–496. ACM, 2005. [19] Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016. [20] Simon J´egou, Michal Drozdzal, David Vazquez, Adriana Romero, and Yoshua Bengio. The one hundred layers tiramisu: Fully convolutional densenets for semantic segmentation. arXiv preprint arXiv:1611.09326, 2016. [21] 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. In Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI). Savannah, Georgia, USA, 2016. [22] Alex Kendall, Vijay Badrinarayanan, and Roberto Cipolla. Bayesian SegNet: Model uncertainty in deep convolutional encoder-decoder architectures for scene understanding. arXiv preprint arXiv:1511.02680, 2015. [23] Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from rgbd images. In European Conference on Computer Vision, pages 746–760. Springer, 2012. [24] Liang-Chieh Chen, George Papandreou, Iasonas Kokkinos, Kevin Murphy, and Alan L Yuille. Semantic image segmentation with deep convolutional nets and fully connected crfs. arXiv preprint arXiv:1412.7062, 2014. 10 [25] Ashutosh Saxena, Min Sun, and Andrew Y Ng. Make3d: Learning 3d scene structure from a single still image. IEEE transactions on pattern analysis and machine intelligence, 31(5):824–840, 2009. [26] Iro Laina, Christian Rupprecht, Vasileios Belagiannis, Federico Tombari, and Nassir Navab. Deeper depth prediction with fully convolutional residual networks. In 3D Vision (3DV), 2016 Fourth International Conference on, pages 239–248. IEEE, 2016. [27] David Eigen, Christian Puhrsch, and Rob Fergus. Depth map prediction from a single image using a multi-scale deep network. In Advances in neural information processing systems, pages 2366–2374, 2014. [28] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. SegNet: A deep convolutional encoderdecoder architecture for scene segmentation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017. [29] Evan Shelhamer, Jonathon Long, and Trevor Darrell. Fully convolutional networks for semantic segmentation. IEEE transactions on pattern analysis and machine intelligence, 2016. [30] Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015. [31] Abhijit Kundu, Vibhav Vineet, and Vladlen Koltun. Feature space optimization for semantic video segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3168–3175, 2016. [32] David Eigen and Rob Fergus. Predicting depth, surface normals and semantic labels with a common multi-scale convolutional architecture. In Proceedings of the IEEE International Conference on Computer Vision, pages 2650–2658, 2015. [33] Kevin Karsch, Ce Liu, and Sing Bing Kang. Depth extraction from video using non-parametric sampling. In European Conference on Computer Vision, pages 775–788. Springer, 2012. [34] Miaomiao Liu, Mathieu Salzmann, and Xuming He. Discrete-continuous depth estimation from a single image. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 716–723, 2014. [35] Bo Li, Chunhua Shen, Yuchao Dai, Anton van den Hengel, and Mingyi He. Depth and surface normal estimation from monocular images using regression on deep features and hierarchical crfs. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 1119–1127, 2015. [36] Lubor Ladicky, Jianbo Shi, and Marc Pollefeys. Pulling things out of perspective. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 89–96, 2014. 11
2017
102
6,567
Reconstruct & Crush Network Erinç Merdivan1,2, Mohammad Reza Loghmani3 and Matthieu Geist4 1 AIT Austrian Institute of Technology GmbH, Vienna, Austria 2 LORIA (Univ. Lorraine & CNRS), CentraleSupélec, Univ. Paris-Saclay, 57070 Metz, France 3 Vision4Robotics lab, ACIN, TU Wien, Vienna, Austria 4 Université de Lorraine & CNRS, LIEC, UMR 7360, Metz, F-57070 France erinc.merdivan@ait.ac.at, loghmani@acin.tuwien.ac.at matthieu.geist@univ-lorraine.fr Abstract This article introduces an energy-based model that is adversarial regarding data: it minimizes the energy for a given data distribution (the positive samples) while maximizing the energy for another given data distribution (the negative or unlabeled samples). The model is especially instantiated with autoencoders where the energy, represented by the reconstruction error, provides a general distance measure for unknown data. The resulting neural network thus learns to reconstruct data from the first distribution while crushing data from the second distribution. This solution can handle different problems such as Positive and Unlabeled (PU) learning or covariate shift, especially with imbalanced data. Using autoencoders allows handling a large variety of data, such as images, text or even dialogues. Our experiments show the flexibility of the proposed approach in dealing with different types of data in different settings: images with CIFAR-10 and CIFAR-100 (not-in-training setting), text with Amazon reviews (PU learning) and dialogues with Facebook bAbI (next response classification and dialogue completion). 1 Introduction The main purpose of machine learning is to make inferences about unknown data based on encoded dependencies between variables learned from known data. Energy-based learning [16] is a framework that achieves this goal by using an energy function that maps each point of an input space to a single scalar, called energy. The fact that energy-based models are not subject to the normalizability condition of probabilistic models makes them a flexible framework for dealing with tasks such as prediction or classification. In the recent years, with the advancement of deep learning, astonishing results have been achieved in classification [15, 25, 8, 26]. These solutions focus on the standard setting, in which the classifier learns to discriminate between K classes, based on the underlying assumption that the training and test samples belong to the same distribution. This assumption is violated in many applications in which the dynamic nature [6] or the high cardinality [19] of the problem prevent the collection of a representative training set. In the literature, this problem is referred to as covariate shift [7, 24]. In this work, we address the covariate shift problem by explicitly learning features that define the intrinsic characteristics of a given class of data rather than features that discriminate between different classes. The aim is to distinguish between samples of a positive class (A) and samples that do not belong to this class (¬A), even when test samples are not drawn from the same distribution as the training samples. We achieve this goal by introducing an energy-based model that is adversarial regarding data: it minimizes the energy for a given data distribution (the positive samples) while maximizing the energy for another given data distribution (the negative or unlabeled samples). The model is instantiated with autoencoders because of their ability to learn data manifolds. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. In summary, our contributions are the following: • a simple energy-based model dealing with the A/¬A classification problem by providing a distance measure of unknown data as the energy value; • a general framework that can deal with a large variety of data (images, text and sequential data) by using features extracted from an autoencoder architecture; • a model that implicitly addresses the imbalanced classification problem; • state-of-the-art results for the dialogue completion task on the Facebook bAbI dataset and competitive results for the general A/¬A classification problem using different datasets such as CIFAR-10, CIFAR-100 and Amazon Reviews. The next section introduces the proposed “reconstruct & crush” network, section 3 positions our approach compared to related works, section 4 presents the experimental results on the aforementioned problems and section 5 draws the conclusions. 2 Model Let define ppos as the probability distribution producing positive samples, xpos ∼ppos. Similarly, write pneg the distribution of negative samples, xneg ∼pneg. More generally, these negative samples can be unlabeled samples (possibly containing positive samples). This case will be considered empirically, but we keep this notation for now. Let N denote a neural network that takes as input a sample x and outputs a (positive) energy value E: N(x) = E ∈R+. The proposed approach aims at learning a network N that assign low energy values to positive samples (N(xpos) small for xpos ∼ppos) and high energy values for negative samples (N(xneg) high for xneg ∼pneg). Let m > 0 be a user-defined margin, we propose to use the following loss LN and associated risk RN: L(xpos, xneg; N) = N(xpos) + max(0, m −N(xneg)) R(N) = Expos∼ppos,xneg∼pnegL(xpos, xneg) = Expos∼ppos[N(xpos)] + Exneg∼pneg[max(0, m −N(xneg))]. (1) Ideally, minimizing this risk amounts to have no reconstruction error over positive samples and a reconstruction error greater than m (in expectation) over negative samples. The second term of the risk acts as a regularizer that enforces the network to assign a low energy only to positive samples. The choice of the margin m will affect the behavior of the network: if m is too small a low energy will be assigned to all inputs (both positive and negative), while if m is too large assigning a large energy to negative samples can prevent from reconstructing the positive ones. We specialize our model with autoencoders, that are a natural choice to represent energy-based models. An autoencoder is composed of two parts, the encoder (Enc) that projects the data into an encoding space, and the decoder (Dec) that reconstructs the data from this projection: Enc :X →Z Dec :Z →X argmin Enc,Dec ∥x−Dec(Enc(x))∥2. Here, X is the space of the input data (either positive or negative) and Z is the space of encoded data. In this setting, the reconstruction error of a sample x can be interpreted as the energy value associated to that sample: N(x) = ∥x −Dec(Enc(x))∥2 = E. Our resulting reconstruct & crush network (RCN) is thus trained to assign a low reconstruction error to xpos (reconstruct) and an high reconstruction error to xneg (crush). Any stochastic gradient descent method can be used to optimize the risk of Eq. (1), the mini-batches of positive and negative samples being sampled independently from the corresponding distributions. 2 3 Related work With the diffusion of deep neural networks, autoencoders have received a new wave of attention due to their use for layer-wise pretraining [1]. Although the concept of autoencoders goes back to the 80s [23, 3, 10], many variations have been proposed more recently, such as denoising autoencoder [27], stacked autoencoders [9] or variational autoencoders [13]. Despite the use of autoencoders for pretraining is not a common practice anymore, various researches still take advantage of their properties. In energy-based generative adversarial networks (EBGAN) [30], an autoencoder architecture is used to discriminate between real samples and "fake" ones produced by the generator. Despite not being a generative model, our method shares with EBGAN the interpretation of the reconstruction error provided by the autoencoder as energy value and the fundamentals of the discriminator loss. However, instead of the samples produced by the generator network, we use negative or unlabeled samples to push the autoencoder to discover the data manifold during training. In other words, EBGAN searches for a generative model by training adversarial networks, while in our framework the network tries to make two distributions adversarial. The use of unlabeled data (that could contain both positive and negative samples) together with positive samples during training is referred to as PU (Positive and Unlabeled) learning [5, 17]. In the literature, works in the PU learning setting [29, 18] focus on text-based applications. Instead, we show in the experiments that our work can be applied to different type of data such as images, text and sequential data. Similarly to our work, [11] uses the reconstruction error as a measure to differentiate between positive and negative samples. However they train their network with either positive or negative data only. In addition, instead of end-to-end training, they provide a two-stage process in which a classifier is trained to discriminate between positive and negative samples based on the reconstruction error. In the context of dialogue management systems, the score proposed in [21] has been used as a quality measure of the response. Nevertheless, [19] shows that this score fails when a correct response, that largely diverges from the ground truth, is given. The energy value of the RCN is a valid score to discriminate between good and bad responses, as we show in section 4.4. 4 Experimental results In this section, we experiment the proposed RCN on various tasks with various kind of data. We consider a not-in-training setting for CIFAR-10 and CIFAR-100 (sections 4.1 and 4.2), a PU learning setting for the amazon reviews dataset (section 4.3) and a dialogue completion setting for the Facebook bAbI dataset (section 4.4). For an illustrative purpose, we also provide examples of reconstructed and crushed images from CIFAR-10 and CIFAR-100 in figure 1, corresponding to experiments of sections 4.1 and 4.2. 4.1 CIFAR-10 CIFAR-10 consists of 60k 32x32 color images in 10 classes, with 6k images per class. There are 50k training images and 10k test images [14]. We converted the images to gray-scale and used 5k images per class. This set of experiments belong to the not-in-training setting [6]: the training set contains positive and negative samples and the test set belongs to a different distribution than the training set. The “automobile” class is used as the positive class (A) and the rest of the classes are considered to be the negative class (¬A) (binary classification problem). All the training samples are used for training, except for those belonging to the “ship” class. Test samples of “automobile” and “ship” are used for testing. It is worth noticing that the size of positive and negative training sets is highly imbalanced: 5k positive samples and 40k negative samples. In this experiment, we show the superior performances of our network with respect to standard classifiers in dealing with images of an unseen class. Since we are dealing with a binary classification problem, we define a threshold T for the energy value. This threshold is used in RCN to distinguish between the positive and the negative class. For our autoencoder, we used a convolutional network defined as: (32)3c1s-(32)3c1s-(64)3c2s-(64)3c2-(32)3c1s-512f-1024f, where “(32)3c1s” denotes 3 Figure 1: Illustrations of Reconstructed and Crushed images by RCN from CIFAR10 and CIFAR100. a convolution layer with 32 output feature maps, kernel size 3 and stride 1, and “512f” denotes a fully-connected layer with 512 hidden units. The size of the last layer corresponds to the size of the images (32x32=1024). For standard classification we add on top of the last layer another fully-connected layer with 2 output neurons (A/¬A). The choice of the architectures for standard classifier and autoencoder is driven by necessity of fair comparison. ReLU activation functions are used for all the layers except for the last fully-connected layer of the standard classifier in which a Softmax function is used. These models are implemented in Tensorflow and trained with the adam optimizer [12] (learning rate of 0.0004) and a mini-batch size of 100 samples. The margin m was set to 1.0 and the threshold T to 0.5. Table 1 shows the true positive rate (TPR=#(correctly classified cars)/#cars) and the true negative rate (TNR=#(correctly classified ships)/#ships) obtained by the standard classifier (CNN / CNN-reduced) and our network (RCN). CNN-reduced shows the performance of the standard classifier when using the same amount of positive and negative samples. It can be noticed that RCN presents the best TNR and a TPR comparable to the one of CNN-reduced. These results shows that RCN is a better solution when dealing with not-in-training data. In addition, the TPR and TNR of our method is comparable despite the imbalanced training set. Figure 2 clearly shows that not-in-training samples (ship images) are positioned between positive in-training samples (automobile images) and in-training-negative samples (images from all classes except automobile and ship). It can be noticed that negative in-training samples have a reconstruction loss close to margin value 1.0. Table 1: Performances of standard classifier (CNN / CNN-reduced) and our method (RCN) on CIFAR-10. The positive class corresponds to "automobile" and the negative class corresponds to "ship" (unseen during the training phase). Method True Positive Rate True Negative Rate CNN-reduced 0.82 0.638 CNN 0.74 0.755 RCN 0.81 0.793 4 Figure 2: Mean reconstruction error over the epochs of positive in-training, negative in-training and negative not-in-training samples of CIFAR-10. 4.2 CIFAR-100 CIFAR-100 is similar to CIFAR-10, except it has 100 classes containing 600 images each (500 for training and 100 for testing) [14]. The 100 classes in the CIFAR-100 are grouped into 20 super-classes with 5 classes each. Each image comes with a pair of labels: the class and the super-class. In this set of experiments, the “food containers” super-class is used as the positive class (A) and the all the other super-classes are considered to be the negative class (¬A) (binary classification problem). During training, 4 out of 5 classes belonging to the “food containers” super-class (“bottles”, “bowls”, “cans”, “cups”) are used as the positive training set and 4 out of 5 classes belonging to the “flowers” super-class (“orchids”, “poppies”, “roses”, “sunflowers”) are used as the negative training set. At test time, two in-training classes (“cups” and “sunflowers”), two not-in-training classes belonging to “food containers” (“plates”) and “flowers” (“tulips”) and two not-in-training classes belonging to external super-classes (“keyboard” and “chair”) are used. In this experiment, we show the superior performances of our network with respect to standard classifiers in dealing with data coming from unknown distributions and from unseen modes of the same distributions as the training data. The same networks and parameters of section 4.1 are used here. Table 2 shows the true positive rate (TPR=#(correctly classified plates)/#plates) and the true negative rate (TNR=#(correctly classified tulips)/#tulips) obtained by the standard classifier (CNN) and our network (RCN). It can be noticed that RCN presents the best results both for TNR and for TPR. These results shows that RCN is a better solution when dealing with not-in-training data coming from unseen modes of the data distribution. It is worth noticing that only 4k samples (2k positive and 2k negative) have been used during training. Figure 3 clearly shows the effectiveness of the learning procedure of our framework: the networks assigns low energy value (close to 0) to positive samples, high energy value (close to m) to negative samples related to the negative training set and medium energy value (close to m/2) to negative samples unrelated to the negative training set. Table 2: Performances of the standard classifier (CNN) and our method (RCN) on CIFAR-100. The positive class corresponds to "plates" and the negative class corresponds to "tulips". Method True Positive Rate True Negative Rate CNN 0.718 0.81 RCN 0.861 0.853 5 Figure 3: Mean reconstruction error over the epochs of positive in-training and not-in-training (blue), negative in-training and not-in-training (red) and not-in-training unrelated (green,black) of CIFAR-100. 4.3 Amazon review Amazon reviews is a dataset containing product reviews (ratings, text, helpfulness votes) and metadata (descriptions, category information, price, brand, and image features) from Amazon, including 142.8 million reviews spanning [20]. Here, we only use the ratings and text features. This set of experiments belong to the PU learning setting: the training set contains positive and unlabeled data. The positive training set contains 10k "5-star" reviews and the unlabeled training set contains 10k unlabeled review (containing both positive and negative review). The test set is composed of 10k samples: 5k "5-star" (positive) reviews and 5k "1-star" (negative) reviews. The aim here is to show that RCN performs well in the PU learning setting with unlabeled sets with different positive/negative samples ratio. For handling the text data, we used the pretrained Glove word-embedding [22] with 100 feature dimensions. We set the maximum number of words in a sentence to 40 and zero-padded shorter sentences. For our autoencoder, we used a 1-dimensional (1D) convolutional network defined as: (128)7c1s(128)7c1s-(128)3c1s-(128)3c1-(128)3c1s-2048f-4000f, where “(128)7c1s” denotes a 1D convolution layer with 128 output feature maps, kernel size 7 and stride 1. ReLU activation functions are used for all the layers. These models are implemented in Tensorflow and trained with the adam optimizer (learning rate of 0.0004) and a mini-batch size of 100 samples. The margin m was set to 0.85 and the threshold T to 0.425. Table 3 shows the results of different well-established PU learning methods, together with ours (RCN), on the Amazon review dataset. In can be noticed that, despite the fact that the architecture of our method is not specifically designed for handling the PU learning setting, it shows comparable results to the other methods, even when unlabeled training data with a considerable amount of positive samples (50%) are used. Table 4 presents some examples from the test set. It can be noticed that positive comments are assigned a low reconstruction error (energy) and vice-versa. 4.4 Facebook bAbI dialogue Facebook bAbI dialogue is a dataset containing dialogues related to 6 different tasks in which the user books a table in a restaurant with the help of a bot [2]. For each task 1k training and 1k test dialogues are provided. Each dialogue has 4 to 11 turns between the user and the bot for a total of 6 Table 3: F-measure of positive samples obtained with Roc-SVM [28], Roc-EM [18], Spy-SVM [18], NB-SVM [18], NB-EM [18] and RCN (ours). The scores are obtained on two different configuration of the unlabeled training set: one containing 5% of positive samples and one containing 50% of positive samples. Method F-measure for pos. samples (%5-%95) F-measure for pos. samples (%50-%50) Roc-SVM [28] 0.92 0.89 Roc-EM [18] 0.91 0.90 Spy-SVM [18] 0.92 0.89 NB-SVM [18] 0.92 0.86 NB-EM [18] 0.91 0.86 RCN 0.90 0.83 Table 4: Examples of positive (5/5 score) and negative (1/5 score) reviews from Amazon review with the corresponding reconstruction error assigned from RCN. Review Score Error excellent funny fast reading i would recommend to all my friends 5/5 0.00054 this is easily one of my favorite books in the series i highly recommend it 5/5 0.00055 super book liked the sequence and am looking forward to a sequel keeping the s and characters would be nice 5/5 0.00060 i truly enjoyed all the action and the characters in this book the interactions between all the characters keep you drawn in to the book 5/5 0.00066 this book was the worst zombie book ever not even worth the review 1/5 1.00627 way too much sex and i am not a prude i did not finish and then deleted the book 1/5 1.00635 in reality it rates no stars it had a political agenda in my mind it was a waste my money 1/5 1.00742 fortunately this book did not cost much in time or money it was very poorly written an ok idea poorly executed and poorly developed 1/5 1.00812 ∼6k turns in each set (training and test) for task 1 and ∼9.5k turns in each set for task 2. Here, we consider the training and test data associated to tasks 1 and 2 because the other tasks require querying Knowledge Base (KB) upon user request: this is out of the scope of the paper. In task 1, the user requests to make a new reservation in a restaurant by defining a query that can contain from 0 to 4 required fields (cuisine type, location, number of people and price range) and the bot asks questions for filling the missing fields. In task 2, the user requests to update a reservation in a restaurant between 1 and 4 times. The training set is built in such a way that, for each turn in a dialogue, together with the positive (correct) response, 100 possible negative responses are selected from the candidate set (set of all bot responses in the Facebook bAbI dialogue dataset with a total of 4212 samples). The test set is built in such a way that, for each turn in a dialogue, all possible negative responses are selected from the candidate set. More precisely, for task 1, the test set contains approximately 6k positive and 25 million negative dialogue history-reply pairs, while for task 2, it contains approximately 9k positive and 38 million negative pairs. For our autoencoder, we use a gated recurrent unit (GRU) [4] with 1024 hidden units and a projection layer on top of it in order to replicate the input sequence in output. An upper limit of 100 was set for 7 the sequence length and a feature size of 50 was selected for word embeddings. The GRU uses ReLU activation and a dropout of 0.1. This model is implemented in Tensorflow and trained with the adam optimizer (learning rate of 0.0004) and a mini-batch size of 100 samples. In this experiments, our network equals the state-of-the-art performance of memory networks presented in [2] by achieving 100% accuracy both for next response classification and for dialogue completion where dialogue is considered as completed if all responses within the dialogue are correctly chosen. 5 Conclusions We have introduced a simple energy-based model, adversarial regarding data by minimizing the energy of positive data and maximizing the energy of negative data. The model is instantiated with autoencoders where the specific architecture depends on the considered task, thus providing a family of RCNs. Such an approach can address various covariate shift problems, such as not-in-training and positive and unlabeled learning and various types of data. The efficiency of our approach has been studied with exhaustive experiments on CIFAR-10, CIFAR100, the Amazon reviews dataset and the Facebook bAbI dialogue dataset. These experiments showed that RCN can obtain state-of-the art results for the dialogue completion task and competitive results for the general A/¬A classification problem. These outcomes suggest that the energy value provided by RCN can be used to asses the quality of response given the dialogue history. Future works will extend the RCN to the multi-class classification setting. These results suggest that the energy value provided by RCN can be used to assess the quality of the response given the dialogue history. We plan to study further this aspect in the near future, in order to provide an alternative metric for dialogue systems evaluation. Acknowledgments This work has been funded by the European Union Horizon2020 MSCA ITN ACROSSING project (GA no. 616757). The authors would like to thank the members of the project’s consortium for their valuable inputs. References [1] Y. Bengio. Learning deep architectures for ai. Foundations and trends in Machine Learning, 2(1):1–127, 2009. [2] A. Bordes and J. Weston. Learning end-to-end goal-oriented dialog. arXiv:1605.07683, 2016. [3] H. Bourlard and Y. Kamp. Auto-association by multilayer perceptrons and singular value decomposition. Biological Cybernetics, 59(4):291–294, 1988. [4] K. Cho, B. van Merrienboer, D. Bahdanau, and Y. Bengio. On the properties of neural machine translation: Encoder-decoder approaches. arXiv preprint arXiv:1409.1259, 2014. [5] F. Denis. Pac learning from positive statistical queries. Algorithmic Learning Theory,112–126, 1998. [6] F. Geli and L. Bing. Social media text classification under negative covariate shift. EMNLP, 2015. [7] W.H. Greene. Sample selection bias as a specification error: A comment. Econometrica: Journal of the Econometric Society, pages 795–798, 1981. [8] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. CVPR, 2016. [9] G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. 8 [10] G.E. Hinton and R.S. Zemel. Autoencoders, minimum description length and helmholtz free energy. NIPS, 1994. [11] N. Japkowicz, C. Myers, and M. Gluck. A novelty detection approach to classification. IJCAI, 1995. [12] D. Kingma and J. Ba. Adam: A method for stochastic optimization. ICLR, 2015. [13] D. Kingma and M. Welling. Auto-encoding variational bayes. ICLR, 2013. [14] A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009. [15] A. Krizhevsky, I. Sutskever, and G. E Hinton. Imagenet classification with deep convolutional neural networks. NIPS, 2012. [16] Y. LeCun, S. Chopra, R. Hadsell, M. Ranzato, and F.J. Huang. A tutorial on energy-based learning. Technical report, MIT Press, 2006. [17] X. Li and L. Bing. Learning from positive and unlabeled examples with different data distributions. ECML, 2005. [18] B Liu, Y. Dai, X. Li, W-S. Lee, and P. Yu. Building text classifiers using positive and unlabeled examples. ICDM, 2003. [19] C. Liu, R. Lowe, I.V. Serban, M. Noseworthy, L. Charlin, and J. Pineau. How not to your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. EMNLP, 2016. [20] J. McAuley and J. Leskovec. Hidden factors and hidden topics: understanding rating dimensions with review text. RecSys, 2013. [21] K. Papineni, S. Roukos, T. Ward, and W. Zhu. Bleu: a method for automatic evaluation of machine translation. ACL, 2002. [22] J. Pennington, R. Socher, and C. D. Manning. Glove: Global vectors for word representation. EMNLP, 2014. [23] D.E. Rumelhart, G.E. Hinton, and R.J. Williams. Learning representations by back-propagating errors. Cognitive Modeling, 5(3):1, 1988. [24] H. Shimodaira. Improving predictive inference under covariate shift by weighting the loglikelihood function. Journal of Statistical Planning and Inference, 90(2):227–244, 2000. [25] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. [26] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. CVPR, 2015. [27] P. Vincent, H. Larochelle, Y. Bengio, and P. Manzagol. Extracting and composing robust features with denoising autoencoders. ACM, 2008. [28] Li X. and Liu B. Learning to classify text using positive and unlabeled data. IJCAI, 2003. [29] H. Yu, J. Han, and K. Chang. Pebl: Positive example based learning for web page classification using svm. KDD, 2002. [30] J. Zhao, M. Mathieu, and Y. LeCun. Energy-based generative adversarial networks. ICLR, 2017. 9
2017
103
6,568
Permutation-based Causal Inference Algorithms with Interventions Yuhao Wang Laboratory for Information and Decision Systems and Institute for Data, Systems and Society Massachusetts Institute of Technology Cambridge, MA 02139 yuhaow@mit.edu Liam Solus Department of Mathematics KTH Royal Institute of Technology Stockholm, Sweden solus@kth.se Karren Dai Yang Institute for Data, Systems and Society and Broad Institute of MIT and Harvard Massachusetts Institute of Technology Cambridge, MA 02139 karren@mit.edu Caroline Uhler Laboratory for Information and Decision Systems and Institute for Data, Systems and Society Massachusetts Institute of Technology Cambridge, MA 02139 cuhler@mit.edu Abstract Learning directed acyclic graphs using both observational and interventional data is now a fundamentally important problem due to recent technological developments in genomics that generate such single-cell gene expression data at a very large scale. In order to utilize this data for learning gene regulatory networks, efficient and reliable causal inference algorithms are needed that can make use of both observational and interventional data. In this paper, we present two algorithms of this type and prove that both are consistent under the faithfulness assumption. These algorithms are interventional adaptations of the Greedy SP algorithm and are the first algorithms using both observational and interventional data with consistency guarantees. Moreover, these algorithms have the advantage that they are nonparametric, which makes them useful also for analyzing non-Gaussian data. In this paper, we present these two algorithms and their consistency guarantees, and we analyze their performance on simulated data, protein signaling data, and single-cell gene expression data. 1 Introduction Discovering causal relations is a fundamental problem across a wide variety of disciplines including computational biology, epidemiology, sociology, and economics [5, 18, 20, 22]. DAG models can be used to encode causal relations in terms of a directed acyclic graph (DAG) G, where each node is associated to a random variable and the arrows represent their causal influences on one another. The non-arrows of G encode a collection of conditional independence (CI) relations through the socalled Markov properties. While DAG models are extraordinarily popular within the aforementioned research fields, it is in general a difficult task to recover the underlying DAG G from samples from the joint distribution on the nodes. In fact, since different DAGs can encode the same set of CI relations, from observational data alone the underlying DAG G is in general only identifiable up to Markov equivalence, and interventional data is needed to identify the complete DAG. In recent years, the new drop-seq technology has allowed obtaining high-resolution observational single-cell gene expression data at a very large scale [12]. In addition, earlier this year this technology 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. was combined with the CRISPR/Cas9 system into perturb-seq, a technology that allows obtaining high-throughput interventional gene expression data [4]. An imminent question now is how to make use of a combination of observational and interventional data (of the order of 100,000 cells / samples on 20,000 genes / variables) in the causal discovery process. Therefore, the development of efficient and consistent algorithms using both observational and interventional data that are implementable within genomics is now a crucial goal. This is the purpose of the present paper. The remainder of this paper is structured as follows: In Section 2 we discuss related work. Then in Section 3, we recall fundamental facts about DAG models and causal inference that we will use in the coming sections. In Section 4, we present the two algorithms and discuss their consistency guarantees. In Section 5, we analyze the performance of the two algorithms on both simulated and real datasets. We end with a short discussion in Section 6. 2 Related Work Causal inference algorithms based on observational data can be classified into three categories: constraint-based, score-based, and hybrid methods. Constraint-based methods, such as the PC algorithm [22], treat causal inference as a constraint satisfaction problem and rely on CI tests to recover the model via its Markov properties. Score-based methods, on the other hand, assign a score function such as the Bayesian Information Criterion (BIC) to each DAG and optimize the score via greedy approaches. An example is the prominent Greedy Equivalence Search (GES) [14]. Hybrid methods either alternate between score-based and constraint-based updates, as in Max-Min Hill-Climbing [26], or use score functions based on CI tests, as in the recently introduced Greedy SP algorithm [23]. Based on the growing need for efficient and consistent algorithms that accommodate observational and interventional data [4], it is natural to consider extensions of the previously described algorithms that can accommodate interventional data. Such options have been considered in [8], in which the authors propose GIES, an extension of GES that accounts for interventional data. This algorithm can be viewed as a greedy approach to ℓ0-penalized maximum likelihood estimation with interventional data, an otherwise computationally infeasible score-based approach. Hence GIES is a parametric approach (relying on Gaussianity) and while it has been applied to real data [8, 9, 15], we will demonstrate via an example in Section 3 that it is in general not consistent. In this paper, we assume causal sufficiency, i.e., that there are no latent confounders in the data-generating DAG. In addition, we assume that the interventional targets are known. Methods such as ACI [13], HEJ [10], COmbINE [25] and ICP [15] allow for latent confounders with possibly unknown interventional targets. In addition, other methods have been developed specifically for the analysis of gene expression data [19]. A comparison of the method presented here and some of these methods in the context of gene expression data is given in the Supplementary Material. The main purpose of this paper is to provide the first algorithms (apart from enumerating all DAGs) for causal inference based on observational and interventional data with consistency guarantees. These algorithms are adaptations of the Greedy SP algorithm [23]. As compared to GIES, another advantage of these algorithms is that they are nonparametric and hence do not assume Gaussianity, a feature that is crucial for applications to gene expression data which is inherently non-Gaussian. 3 Preliminaries DAG models. Given a DAG G = ([p], A) with node set [p] := {1, . . . , p} and a collection of arrows A, we associate the nodes of G to a random vector (X1, . . . , Xp) with joint probability distribution P. For a subset of nodes S ⊂[p], we let PaG(S), AnG(S), ChG(S), DeG(S), and NdG(S), denote the parents, ancestors, children, descendants, and nondescendants of S in G. Here, we use the typical graph theoretical definitions of these terms as given in [11]. By the Markov property, the collection of non-arrows of G encode a set of CI relations Xi ⊥⊥XNd(i)\ Pa(i) | XPa(i). A distribution P is said to satisfy the Markov assumption (a.k.a. be Markov) with respect to G if it entails these CI relations. A fundamental result about DAG models is that the complete set of CI relations implied by the Markov assumption for G is given by the d-separation relations in G [11, Section 3.2.2]; i.e., P satisfies the Markov assumption with respect to G if and only if XA ⊥⊥XB | XC in P whenever A and B are 2 1 2 3 4 5 6 7 1 2 3 4 5 6 7 Figure 1: A generating DAG (left) and its GIES local maxima (right) for which GIES is not consistent. d-separated in G given C. The faithfulness assumption is the assertion that the only CI relations entailed by P are those implied by d-separation in G. Two DAGs G and H with the same set of d-separation statements are called Markov equivalent, and the complete set of DAGs that are Markov equivalent to G is called its Markov equivalence class (MEC), denoted [G]. The MEC of G is represented combinatorially by a partially directed graph bG := ([p], D, E), called its CP-DAG or essential graph [1]. The arrows D are precisely those arrows in G that have the same orientation in all members of [G], and the edges E represent those arrows that change direction between distinct members of the MEC. In [2], the authors give a transformational characterization of the members of [G]. An arrow i →j in G is called a covered arrow if PaG(j) = PaG(i) ∪{i}. Two DAGs G and H are Markov equivalent if and only if there exists a sequence of covered arrow reversals transforming G into H [2]. This transformational characterization plays a fundamental role in GES [14], GIES [8], Greedy SP [23], as well as the algorithms we introduce in this paper. Learning from Interventions. In this paper, we consider multiple interventions. Given an ordered list of subsets of [p] denoted by I := {I1, I2, . . . , IK}, for each Ij we generate an interventional distribution, denoted Pj, by forcing the random variables Xi for i ∈Ij to the value of some independent random variables. We assume throughout that Ij = ∅for some j, i.e., that we have access to a combination of observational and interventional data. If P is Markov with respect to G = ([p], A), then the intervention DAG of Ij is the subDAG Gj := ([p], Aj) where Aj = {(i, j) ∈A : j /∈Ij}; i.e., Gj is given by removing the incoming arrows to all intervened nodes in G. Notice that Pj is always Markov with respect to Gj. This fact allows us to naturally extend the notions of Markov equivalence and essential graphs to the interventional setting, as described in [8]. Two DAGs G and H are I-Markov equivalent for the collection of interventions I if they have the same skeleton and the same set of immoralities, and if Gj and Hj have the same skeleton for all j = 1, . . . , K [8, Theorem 10]. Hence, any two I-Markov equivalent DAGs lie in the same MEC. The I-Markov equivalence class (I-MEC) of G is denoted [G]I. The I-essential graph of G is the partially directed graph bGI := [p], ∪K j=1Dj, ∪K j=1Ej , where bGj = ([p], Dj, Ej). The arrows of bGI are called I-essential arrows of G. Greedy Interventional Equivalence Search (GIES). GIES is a three-phase score-based algorithm: In the forward phase, GIES initializes with an empty I-essential graph bG0. Then it sequentially steps from one I-essential graph bGi to a larger one bGi+1 given by adding a single arrow to bGi. In the backward phase, it steps from one essential graph bGi to a smaller one bGi+1 containing precisely one less arrow than bGi. In the turning phase, the algorithm reverses the direction of arrows. It first considers reversals of non-I-essential arrows and then the reversal of I-essential arrows, allowing it to move between I-MECs. At each step in all phases the maximal scoring candidate is chosen, and the phase is only terminated when no higher-scoring I-essential graph exists. GIES repeatedly executes the forward, backward, and turning phases, in that order, until no higher-scoring I-essential graph can be found. It is amenable to any score that is constant on an I-MEC, such as the BIC. The question whether GIES is consistent, was left open in [8]. We now prove that GIES is in general not consistent; i.e., if nj i.i.d. samples are drawn from the interventional distribution Pj, then even as n1 + · · · + nK →∞and under the faithfulness assumption, GIES may not recover the optimal I-MEC with probability 1. Consider the data-generating DAG depicted on the left in Figure 1. 3 Algorithm 1: Input: Observations ˆX, an initial permutation π0, a threshold δn > PK k=1 λnk, and a set of interventional targets I = {I1, . . . , IK}. Output: A permutation π and its minimal I-MAP Gπ. 1 Set Gπ := argmax G consistent with π Score(G); 2 Using a depth-first search approach with root π, search for a permutation πs with Score(Gπs) > Score(Gπ) that is connected to π through a sequence of permutations π0 = π, π1, · · · , πs−1, πs, where each permutation πk is produced from πk−1 by a transposition that corresponds to a covered edge in Gπk−1 such that Score(Gπk) > Score(Gπk−1) −δn. If no such Gπs exists, return π and Gπ; else set π := πs and repeat. Suppose we take interventions I consisting of I1 = ∅, I2 = {4}, I3 = {5}, and that GIES arrives at the DAG G depicted on the right in Figure 1. If the data collected grows as n1 = Cn2 = Cn3 for some constant C > 1, then we can show that the BIC score of G is a local maximum with probability 1 2 as n1 tends to infinity. The proof of this fact relies on the observation that GIES must initialize the turning phase at G, and that G contains precisely one covered arrow 5 →4, which is colored red in Figure 1. The full proof is given in the Supplementary Material. Greedy SP. In this paper we adapt the hybrid algorithm Greedy SP to provide consistent algorithms that use both interventional and observational data. Greedy SP is a permutation-based algorithm that associates a DAG to every permutation of the random variables and greedily updates the DAG by transposing elements of the permutation. More precisely, given a set of observed CI relations C and a permutation π = π1 · · · πp, the Greedy SP algorithm assigns a DAG Gπ := ([p], Aπ) to π via the rule πi →πj ∈Aπ ⇐⇒ i < j and πi ̸⊥⊥πj | {π1, . . . , πmax(i,j)}\{πi, πj}, for all 1 ≤i < j ≤p. The DAG Gπ is a minimal I-MAP (independence map) with respect to C, since any DAG Gπ is Markov with respect to C and any proper subDAG of Gπ encodes a CI relation that is not in C [17]. Using a depth-first search approach, the algorithm reverses covered edges in Gπ, takes a linear extension τ of the resulting DAG and re-evaluates against C to see if Gτ has fewer arrows than Gπ. If so, the algorithm reinitializes at τ, and repeats this process until no sparser DAG can be recovered. In the observational setting, Greedy SP is known to be consistent whenever the data-generating distribution is faithful to the sparsest DAG [23]. 4 Two Permutation-Based Algorithms with Interventions We now introduce our two interventional adaptations of Greedy SP and prove that they are consistent under the faithfulness assumption. In the first algorithm, presented in Algorithm 1, we use the same moves as Greedy SP, but we optimize with respect to a new score function that utilizes interventional data, namely the sum of the interventional BIC scores. To be more precise, for a collection of interventions I = {I1, . . . , IK}, the new score function is Score(G) := K X k=1  maximize (A,Ω)∈Gk ℓk  ˆXk; A, Ω  − K X k=1 λnk|Gk|, where ℓk denotes the log-likelihood of the interventional distribution Pk, (A, Ω) are any parameters consistent with Gk, |G| denotes the number of arrows in G, and λnk = log nk nk . When Algorithm 1 has access to observational and interventional data, then uniform consistency follows using similar techniques to those used to prove uniform consistency of Greedy SP in [23]. A full proof of the following consistency result for Algorithm 1 is given in the Supplementary Material. Theorem 4.1. Suppose P is Markov with respect to an unknown I-MAP Gπ∗. Suppose also that observational and interventional data are drawn from P for a collection of interventional targets I = {I1 := ∅, I2, . . . , IK}. If Pk is faithful to (Gπ∗)k for all k ∈[K], then Algorithm 1 returns the I-MEC of the data-generating DAG Gπ∗almost surely as nk →∞for all k ∈[K]. 4 Algorithm 2: Interventional Greedy SP (IGSP) Input: A collection of interventional targets I = {I1, . . . , IK} and a starting permutation π0. Output: A permutation π and its minimal I-MAP Gπ. 1 Set G := Gπ0; 2 Using a depth-first-search approach with root π, search for a minimal I-MAP Gτ with |G| > |Gτ| that is connected to G by a list of I-covered edge reversals. Along the search, prioritize the I-covered edges that are also I-contradicting edges. If such Gτ exists, set G := Gτ, update the number of I-contradicting edges, and repeat this step. If not, output Gτ with |G| = |Gτ| that is connected to G by a list of I-covered edges and minimizes the number of I-contradicting edges. A problematic feature of Algorithm 1 from a computational perspective is the the slack parameter δn. In fact, if this parameter were not included, then Algorithm 1 would not be consistent. This can be seen via an application of Algorithm 1 to the example depicted in Figure 1. Using the same set-up as the inconsistency example for GIES, suppose that the left-most DAG G in Figure 1 is the data generating DAG, and that we draw nk i.i.d. samples from the interventional distribution Pk for the collection of targets I = {I1 = ∅, I2 = {4}, I3 = {5}}. Suppose also that n1 = Cn2 = Cn3 for some constant C > 1, and now additionally assume that we initialize Algorithm 1 at the permutation π = 1276543. Then the minimal I-MAP Gπ is precisely the DAG presented on the right in Figure 1. This DAG contains one covered arrow, namely 5 →4. Reversing it produces the minimal I-MAP Gτ for τ = 1276453. Computing the score difference Score(Gτ) −Score(Gπ) using [16, Lemma 5.1] shows that as n1 tends to infinity, Score(Gτ) < Score(Gπ) with probability 1 2. Hence, Algorithm 1 would not be consistent without the slack parameter δn. This calculation can be found in the Supplementary Material. Our second interventional adaptation of the Greedy SP algorithm, presented in Algorithm 2, leaves the score function the same (i.e., the number of edges of the minimal I-MAP), but restricts the possible covered arrow reversals that can be queried at each step. In order to describe this restricted set of moves we provide the following definitions. Definition 4.2. Let I = {I1, . . . , IK} be a collection of interventions, and for i, j ∈[p] define the collection of indices Ii\j := {k ∈[K] : i ∈Ik and j ̸∈Ik}. For a minimal I-MAP Gπ we say that a covered arrow i →j ∈Gπ is I-covered if Ii\j = ∅ or i →j ̸∈(Gk)π for all k ∈Ii\j. Definition 4.3. We say that an arrow i →j ∈Gπ is I-contradicting if the following three conditions hold: (a) Ii\j ∪Ij\i ̸= ∅, (b) Ii\j = ∅or i ⊥⊥j in distribution Pk for all k ∈Ii\j, (c) Ij\i = ∅or there exists k ∈Ij\i such that i ̸⊥⊥j in distribution Pk. In the observational setting, GES and Greedy SP utilize covered arrow reversals to transition between members of a single MEC as well as between MECs [2, 3, 23]. Since an I-MEC is characterized by the skeleta and immoralities of each of its interventional DAGs, I-covered arrows represent the natural candidate for analogous transitionary moves between I-MECs in the interventional setting. It is possible that reversing an I-covered edge i →j in a minimal I-MAP Gπ results in a new minimal I-MAP Gτ that is in the same I-MEC as Gπ. Namely, this happens when i →j is a non-I-essential edge in Gπ. Similar to Greedy SP, Algorithm 2 implements a depth-first-search approach that allows for such I-covered arrow reversals, but it prioritizes those I-covered arrow reversals that produce a minimal I-MAP Gτ that is not I-Markov equivalent to Gπ. These arrows are I-contradicting arrows. The result of this refined search via I-covered arrow reversal is an algorithm that is consistent under the faithfulness assumption. Theorem 4.4. Algorithm 2 is consistent under the faithfulness assumption. The proof of Theorem 4.4 is given in the Supplementary Material. When only observational data is available, Algorithm 2 boils down to greedy SP. We remark that the number of queries conducted in a given step of Algorithm 2 is, in general, strictly less than in the purely observational setting. That is to say, I-covered arrows generally constitute a strict subset of the covered arrows in a DAG. At first 5 (a) p = 10, K = 1 (b) p = 10, K = 2 (c) p = 20, K = 1 (d) p = 20, K = 2 Figure 2: The proportion of consistently estimated DAGs for 100 Gaussian DAG models on p nodes with K single-node interventions. glance, keeping track of the I-covered edges may appear computationally inefficient. However, at each step we only need to update this list locally; so the computational complexity of the algorithm is not drastically impacted by this procedure. Hence, access to interventional data is beneficial in two ways: it allows to reduce the search directions at every step and it often allows to estimate the true DAG more accurately, since an I-MEC is in general smaller than an MEC. Note that in this paper all the theoretical analysis are based on the low-dimensional setting, where p ≪n. The high-dimensional consistency of greedy SP is shown in [23], and it is not difficult to see that the same high-dimensional consistency guarantees also apply to IGSP. 5 Evaluation In this section, we compare Algorithm 2, which we call Interventional Greedy SP (IGSP) with GIES on both simulated and real data. Algorithm 1 is of interest from a theoretical perspective, but it is computationally inefficient since it requires performing two variable selection procedures per update. Therefore, it will not be analyzed in this section. The code utilized for the following experiments can be found at https://github.com/yuhaow/sp-intervention. 5.1 Simulations Our simulations are conducted for linear structural equation models with Gaussian noise: (X1, . . . , Xp)T = ((X1, . . . , Xp)A)T + ϵ, where ϵ ∼N(0, 1p) and A = (aij)p i,j=1 is an upper-triangular matrix of edge weights with aij ̸= 0 if and only if i →j is an arrow in the underlying DAG G∗. For each simulation study we generated 100 realizations of an (Erdös-Renyi) random p-node Gaussian DAG model for p ∈{10, 20} with an expected edge density of 1.5. The collections of interventional targets I = {I0 := ∅, I1, . . . , IK} always consist of the empty set I0 together with K = 1 or 2. For p = 10, the size of each intervention set was 5 for K = 1 and 4 for K = 2. For p = 20, the size was increased up to 10 and 8 to keep the proportion of intervened nodes constant. In each study, we compared GIES with Algorithm 2 for n samples for each intervention with n = 103, 104, 105. Figure 2 shows the proportion of consistently estimated DAGs as distributed by choice of cut-off parameter for partial correlation tests. Interestingly, although GIES is not consistent on random DAGs, in some cases it performs better than IGSP, in particular for smaller sample sizes. However, as implied by the consistency guarantees given in Theorem 4.4, IGSP performs better as the sample size increases. We also conducted a focused simulation study on models for which the data-generating DAG G is that depicted on the left in Figure 1, for which GIES is not consistent. In this simulation study, we took 100 realizations of Gaussian models for the data-generating DAG G for which the nonzero edge-weights aij were randomly drawn from [−1, −c, ) ∪(c, 1] for c = 0.1, 0.25, 0.5. The interventional targets were I = {I0 = ∅, I1}, where I1 was uniformly at random chosen to be {4}, {5}, {4, 5}. Figure 3 shows, for each choice of c, the proportion of times G was consistently estimated as distributed by the choice of cut-off parameter for the partial correlation tests. We see from these plots that as expected from our theoretical results GIES recovers G at a lower rate than Algorithm 2. 6 (a) c = 0.1 (b) c = 0.25 (c) c = 0.5 Figure 3: Proportion of times the DAG G from Figure 1 (left) is consistently estimated under GIES and Algorithm 2 for Gaussian DAG models with edge-weights drawn from [−1, −c) ∪(c, 1]. 5.2 Application to Real Data In the following, we report results for studies conducted on two real datasets coming from genomics. The first dataset is the protein signaling dataset of Sachs et al. [21], and the second is the single-cell gene expression data generated using perturb-seq in [4]. Analysis of protein signaling data. The dataset of Sachs et al. [21] consists of 7466 measurements of the abundance of phosphoproteins and phospholipids recorded under different experimental conditions in primary human immune system cells. The different experimental conditions are generated using various reagents that inhibit or activate signaling nodes, and thereby correspond to interventions at different nodes in the protein signaling network. The dataset is purely interventional and most interventions take place at more than one target. Since some of the experimental perturbations effect receptor enzymes instead of the measured signaling molecules, we consider only the 5846 measurements in which the perturbations of receptor enzymes are identical. In this way, we can define the observational distribution to be that of molecule abundances in the model where only the receptor enzymes are perturbed. This results in 1755 observational measurements and 4091 interventional measurements. Table E.2 in the Supplementary Material summarizes the number of samples as well as the targets for each intervention. For this dataset we compared the GIES results reported in [9] with Algorithm 2 using both, a linear Gaussian and a kernel-based independence criterium [6, 24]. A crucial advantage of Algorithm 2 over GIES is that it is nonparametric and does not require Gaussianity. In particular, it supports kernel-based CI tests that are in general able to deal better with non-linear relationships and non-Gaussian noise, a feature that is typical of datasets such as this one. For the GIES algorithm we present the results of [8] in which the authors varied the number of edge additions, deletions, and reversals as tuning parameters. For the linear Gaussian and kernel-based implementations of IGSP our tuning parameter is the cut-off value for the CI tests, just as in the simulated data studies in Section 5.1. Figure 4 reports our results for thirteen different cut-off values in [10−4, 0.7], which label the corresponding points in the plots. The linear Gaussian and kernel-based implementations of IGSP are comparable and generally both outperform GIES. The Supplementary Material contains a comparison of the results obtained by IGSP on this dataset to other recent methods that allow also for latent confounders, such as ACI, COmbINE and ICP. Analysis of perturb-seq gene expression data. We analyzed the performance of GIES and IGSP on perturb-seq data published by Dixit et al. [4]. The dataset contains observational data as well as interventional data from ∼30,000 bone marrow-derived dendritic cells (BMDCs). Each data point contains gene expression measurements of 32,777 genes, and each interventional data point comes from a cell where a single gene has been targeted for deletion using the CRISPR/Cas9 system. After processing the data for quality, the data consists of 992 observational samples and 13,435 interventional samples from eight gene deletions. The number of samples collected under each of the eight interventions is shown in the Supplementary Material. These interventions were chosen based 7 (a) Directed edge recovery (b) Skeleton recovery Figure 4: ROC plot of the models estimated from the data [21] using GIES as reported in [8] and the linear Gaussian and kernel-based versions of IGSP with different cut-off values for the CI tests. The solid line indicates the accuracy achieved by random guessing. on empirical evidence that the gene deletion was effective1. We used GIES and IGSP to learn causal DAGs over 24 of the measured genes, including the ones targeted by the interventions, using both observational and interventional data. We followed [4] in focusing on these 24 genes, as they are general transcription factors known to regulate each other as well as numerous other genes [7]. We evaluated the learned causal DAGs based on their accuracy in predicting the true effects of each of the interventions (shown in Figure 5(a)) when leaving out the data for that intervention. Specifically, if the predicted DAG indicates an arrow from gene A to gene B, we count this as a true positive if knocking out gene A caused a significant change2 in the distribution of gene B, and a false positive otherwise. For each inference algorithm and for every choice of the tuning parameters, we learned eight causal DAGs, each one trained with one of the interventional datasets being left out. We then evaluated each algorithm based on how well the causal DAGs are able to predict the corresponding held-out interventional data. As seen in Figure 5(b), IGSP predicted the held-out interventional data better than GIES (as implemented in the R-package pcalg) and random guessing, for a number of choices of the cut-off parameter. The true and reconstructed networks for both genomics datasets are shown in the Supplementary Material. 6 Discussion We have presented two hybrid algorithms for causal inference using both observational and interventional data and we proved that both algorithms are consistent under the faithfulness assumption. These algorithms are both interventional adaptations of the Greedy SP algorithm and are the first algorithms of this type that have consistency guarantees. While Algorithm 1 suffers a high level of inefficiency, IGSP is implementable and competitive with the state-of-the-art, i.e., GIES. Moreover, IGSP has the distinct advantage that it is nonparametric and therefore does not require a linear Gaussian assumption on the data-generating distribution. We conducted real data studies for protein signaling and single-cell gene expression datasets, which are typically non-linear with non-Gaussian noise. In general, IGSP outperformed GIES. This purports IGSP as a viable method for analyzing the new high-resolution datasets now being produced by procedures such as perturb-seq. An important 1An intervention was considered effective if the distribution of the gene expression levels of the deleted gene is significantly different from the distribution of its expression levels without intervention, based on a Wilcoxon Rank-Sum test with α = 0.05. Ineffective interventions on a gene are typically due to poor targeting ability of the guide-RNA designed for that gene. 2Based on a Wilcoxon Rank-Sum test with α = 0.05, which is approximately equivalent to a q-value of magnitude ≥3 in Figure 5(a) 8 (a) True effects of gene deletions (b) Causal effect prediction accuracy rate Figure 5: (a) Heatmap of the true effects of each gene deletion on each measured gene. The q-value has the same magnitude as the log p-value of the Wilcoxon rank-sum test between the distributions of observational data and the interventional data. Positive and negative q-values indicate increased and decreased abundance as a result of deletion respectively. (b) ROC plot of prediction accuracy by the causal DAGs learned by IGSP and GIES. The solid line indicates the accuracy achieved by random guessing. challenge for future work is to make these algorithms scale to 20,000 nodes, i.e., the typical number of genes in such studies. In addition, in future work it would be interesting to extend IGSP to allow for latent confounders. An advantage of not allowing for latent confounders is that a DAG is usually more identifiable. For example, if we consider a DAG with two observable nodes, a DAG without confounders is fully identifiable by intervening on only one of the two nodes, but the same is not true for a DAG with confounders. Acknowledgements Yuhao Wang was supported by DARPA (W911NF-16-1-0551) and ONR (N00014-17-1-2147). Liam Solus was supported by an NSF Mathematical Sciences Postdoctoral Research Fellowship (DMS - 1606407). Karren Yang was supported by the MIT Department of Biological Engineering. Caroline Uhler was partially supported by DARPA (W911NF-16-1-0551), NSF (1651995) and ONR (N00014-17-1-2147). We thank Dr. Sofia Triantafillou from the University of Crete for helping us run COmbINE. References [1] S. A. Andersson, D. Madigan, and M. D. Perlman. A characterization of Markov equivalence classes for acyclic digraphs. The Annals of Statistics 25.2 (1997): 505-541. [2] D. M. Chickering. A transformational characterization of equivalent Bayesian network structures. Proceedings of the Eleventh Conference on Uncertainty in Artificial Intelligence. Morgan Kaufmann Publishers Inc., 1995. [3] D. M. Chickering. Optimal structure identification with greedy search. Journal of Machine Learning Research 3.Nov (2002): 507-554. [4] A. Dixit, O. Parnas, B. Li, J. Chen, C. P. Fulco, L. Jerby-Arnon, N. D. Marjanovic, D. Dionne, T. Burks, R. Raychowdhury, B. Adamson, T. M. Norman, E. S. Lander, J. S. Weissman, N. Friedman and A. Regev. Perturb-seq: dissecting molecular circuits with scalable single-cell RNA profiling of pooled genetic screens. Cell 167.7 (2016): 1853-1866. 9 [5] N. Friedman, M. Linial, I. Nachman and D. Peter. Using Bayesian networks to analyze expression data. Journal of Computational Biology 7.3-4 (2000): 601–620. [6] K. Fukumizu, A. Gretton, X. Sun, and B. Schölkopf. Kernel measures of conditional dependence. Advances in Neural Information Processing Systems. 2008. [7] M. Garber, N. Yosef, A Goren, R Raychowdhury, A. Thielke, M. Guttman, J. Robinson, B. Minie, N. Chevrier, Z. Itzhaki, R. Blecher-Gonen, C. Bornstein, D. Amann-Zalcenstein, A. Weiner, D. Friedrich, J. Meldrim, O. Ram, C. Chang, A. Gnirke, S. Fisher, N. Friedman, B. Wong, B. E. Bernstein, C. Nusbaum, N. Hacohen, A. Regev, and I. Amit. A high throughput Chromatin ImmunoPrecipitation approach reveals principles of dynamic gene regulation in mammals Mol. Cell. 447.5 (2012): 810-822 [8] A. Hauser and P. Bühlmann. Characterization and greedy learning of interventional Markov equivalence classes of directed acyclic graphs. Journal of Machine Learning Research 13.Aug (2012): 2409-2464. [9] A. Hauser and P. Bühlmann. Jointly interventional and observational data: estimation of interventional Markov equivalence classes of directed acyclic graphs. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 77.1 (2015): 291-318. [10] A. Hyttinen, F. Eberhardt, and M. Järvisalo. Constraint-based Causal Discovery: Conflict Resolution with Answer Set Programming. UAI. 2014. [11] S. L. Lauritzen. Graphical Models. Oxford University Press, 1996. [12] E. Z. Macosko, A. Basu, R. Satija, J. Nemesh, K. Shekhar, M. Goldman, I. Tirosh, A. R. Bialas, N. Kamitaki, E. M. Martersteck, J. J. Trombetta, D. A. Weitz, J. R. Sanes, A. K. Shalek, A. Regev, and S. A. McCarroll. Highly parallel genome-wide expression profiling of individual cells using nanoliter droplets. Cell 161.5 (2015): 1202-1214. [13] S. Magliacane, T. Claassen, and J. M. Mooij. Ancestral causal inference. Advances In Neural Information Processing Systems. 2016. [14] C. Meek. Graphical Models: Selecting causal and statistical models. Diss. PhD thesis, Carnegie Mellon University, 1997. [15] N. Meinshausen, A. Hauser, J. M. Mooij, J. Peters, P. Versteeg, and P. Bühlmann. Methods for causal inference from gene perturbation experiments and validation. Proceedings of the National Academy of Sciences, USA. 113.27 (2016): 7361-7368. [16] P. Nandy, A. Hauser, and M. H. Maathuis. High-dimensional consistency in score-based and hybrid structure learning. ArXiv preprint arXiv: 1507.02608 (2015). [17] J. Pearl. Probabilistic Reasoning in Intelligent Systems. Morgan Kaufman, San Mateo, 1988. [18] J. Pearl. Causality: Models, Reasoning, and Inference. Cambridge University Press, Cambridge, 2000. [19] A. Rau, F. Jaffrézic, and G. Nuel. Joint estimation of causal effects from observational and intervention gene expression data. BMC Systems Biology 7.1 (2013): 111. [20] J. M. Robins, M. A. Hernán and B. Brumback. Marginal structural models and causal inference in epidemiology. Epidemiology 11.5 (2000): 550-560. [21] K. Sachs, O. Perez, D. Pe’er, D. A. Lauffenburger and G. P. Nolan. Causal protein-signaling networks derived from multiparameter single-cell data. Science 308.5721 (2005): 523-529. [22] P. Spirtes, C. N. Glymour and R. Scheines. Causation, Prediction, and Search. MIT Press, Cambridge, 2001. [23] L. Solus, Y. Wang, C. Uhler, and L. Matejovicova. Consistency guarantees for permutationbased causal inference algorithms. ArXiv preprint arXiv: 1702.03530 (2017). [24] R. E. Tillman, A. Gretton, and P. Spirtes. Nonlinear directed acyclic structure learning with weakly additive noise model. Advances in neural information processing systems. 2009. [25] S. Triantafillou and I. Tsamardinos. Constraint-based causal discovery from multiple interventions over overlapping variable sets. Journal of Machine Learning Research 16 (2015): 2147-2205. [26] I. Tsamardinos, L. E. Brown, and C. F. Aliferis. The max-min hill-climbing Bayesian network structure learning algorithm. Machine Learning 65.1 (2006): 31-78. 10
2017
104
6,569
Deep Dynamic Poisson Factorization Model Chengyue Gong Department of Information Management Peking University cygong@pku.edu.cn Win-bin Huang Department of Information Management Peking University huangwb@pku.edu.cn Abstract A new model, named as deep dynamic poisson factorization model, is proposed in this paper for analyzing sequential count vectors. The model based on the Poisson Factor Analysis method captures dependence among time steps by neural networks, representing the implicit distributions. Local complicated relationship is obtained from local implicit distribution, and deep latent structure is exploited to get the long-time dependence. Variational inference on latent variables and gradient descent based on the loss functions derived from variational distribution is performed in our inference. Synthetic datasets and real-world datasets are applied to the proposed model and our results show good predicting and fitting performance with interpretable latent structure. 1 Introduction There has been growing interest in analyzing sequentially observed count vectors x1, x2,. . . , xT . Such data appears in many real world applications, such as recommend systems, text analysis, network analysis and time series analysis. Analyzing such data should conquer the computational or statistical challenges, since they are often high-dimensional, sparse, and with complex dependence across the time steps. For example, when analyzing the dynamic word count matrix of research papers, the amount of words used is large and many words appear only few times. Although we know the trend that one topic may encourage researchers to write papers about related topics in the following year, the relationship among each time step and each topic is still hard to analyze completely. Bayesian factor analysis model has recently reached success in modeling sequentially observed count matrix. They assume the data is Poisson distributed, and model the data under Poisson Factorize Analysis (PFA). PFA factorizes a count matrix, where Φ ∈RV ×K + is the loading matrix and Θ ∈RT ×K + is the factor score matrix. The assumption that θt ∼Gamma(θt−1, βt) is then included [1, 2] to smooth the transition through time. With property of the Gamma-Poisson distribution and Gamma-NB process, inference via MCMC is used in these models. Considering the lack of ability to capture the relationship between factors, a transition matrix is included in Poisson-Gamma Dynamical System (PGDS) [2]. However, these models may still have some shortcomings in exploring the long-time dependence among the time steps, as the independence assumption is made on θt−1 and θt+1 if θt is given. In text analysis problem, temporal Dirichlet process [3] is used to catch the time dependence on each topic using a given decay rate. This method may have weak points in analyzing other data with different pattern long-time dependence, such as fanatical data and disaster data [3]. Deep models, which are also called hierarchical models in Bayesian learning field, are widely used in Bayesian models to fit the deep relationship between latent variables. Examples of this include the nested Chinese Restaurant Process [4], nest hierarchical Dirichlet process [5], deep Gaussian process [6, 7] and so on. Some models based on neural network structure or recurrent structure is also used, such as the Deep Exponential Families [8], the Deep Poisson Factor Analysis based on RBM or SBN [9, 10], the Neural Autoregressive Density Estimator based on neural networks [11], Deep Poisson 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. θ0 θ1 θ2 θ3 θ4 θ5 (a) θ0 θ1 θ2 θ3 θ4 θ5 (b) θ0 θ1 θ2 θ3 θ4 θ5 (d) h0 (0) h1 (0) h2 (0) h3 (0) h4 (0) h5 (0) θ0 θ1 θ2 θ3 θ4 θ5 h0 (0) h1 (0) h2 (0) h3 (0) h4 (0) h5 (0) (c) Figure 1: The visual representation of our model. In (a), the structure of one-layer model is shown. (b) shows the transmission of the posterior information. The prior and posterior distributions between interfacing layers are shown in (c) and (d). Factor Modeling with a recurrent structure based on PFA using a Bernoulli-Poisson link [12], Deep Latent Dirichlet Allocation uses stochastic gradient MCMC [23]. These models capture the deep relationship among the shallow models, and often outperform shallow models. In this paper, we present the Deep Dynamic Poisson Factor Analysis (DDPFA) model. Based on PFA, our model includes recurrent neural networks to represent implicit distributions, in order to learn complicated relationship between different factors among short time. Deep structure is included in order to capture the long-time dependence. An inference algorithm based on variational inference is used for inferring the latent variables. Parameters in the neural networks are learnt according to a loss function based on the variational distributions. Finally, the DDPFA model is used on several synthetic and real-world datasets, and excellent results are obtained in prediction and fitting tasks. 2 Deep Dynamic Poisson Factorization Model Assume that V -dimensional sequentially observed count data x1, x2,..., xT are represented as a V × T count matrix X, a count data xvt ∈{0, 1, . . .} is generated by the proposed DDPFA model as follows: xvt ∼Poisson(PK k=1 θtkφvkλkψv) (1) where the latent variables θtk, φvk, λk and ψv are all positive variables. φk represents the strength of the kth component and is treated as factor. θtk represents the strength of the kth component at the tth time step. Feature-wise variable ψv captures the sparsity of the vth feature and λk recognizes the importance of the kth component. According to the regular setting in [2, 13-16], the factorization is regarded as X ∼Poisson(ΦΘT ). Λ and Ψ can be absorbed into Θ. In this paper, in order to extract the sparsity of vth feature or kth component and impose a feature-wise or temporal smoothness constraint, Ψ and Λ are included in our model. The additive property of the Poisson distribution is used to decompose the observed count of xvt as K latent counts xvtk, k ∈{0, . . . , K}. In this way, the model is rewritten as: xvt = PK k=1 xvtk and xvtk ∼Poisson(θtkφvkλkψv) (2) Capturing the complicated temporal dependence of Θ is the major purpose in this paper. In the previous work, transition via Gamma-Gamma-Poisson distribution structure is used, where θt ∼ Gamma(θt−1, βt) [1]. Non-homogeneous Poisson process over time to model the stochastic transition over different features is exploited in Poisson process models [17-19]. These models are then trained via MCMC or variational inference. However, it is rough for these models to catch complicated time dependence because of the weak points in their shallow structure in time dimension. In order to capture the complex time dependence over Θ, a deep and long-time dependence model with a dynamic structure over time steps is proposed. The first layer over Θ is as follows: θt ∼p(θt|h(0) t−c, ..., h(0) t ) (3) 2 where c is the size of a window for analysis, and the latent variables in the nth layer, n ≤N, are indicated as follows: h(n) t ∼p(h(n) t |h(n+1) t−c , ..., h(n+1) t ) and h(N) t ∼p(h(N) t |h(N) t−c−1, ..., h(N) t−1) (4) where the implicit probability distribution p(h(n) t |·) is modeled as a recurrent neural network. Probability AutoEncoder with an auxiliary posterior distribution p(h(n) t |h(n−1) t , . . . , h(n−1) t+c ), also modeled as a neural network, is exploited in our training phase. h(n) t is a K-dimensional latent variable in the nth layer at the tth time step. Specially, in the nth layer, h(N) t is generated from a Gamma distribution with h(N) t−c−1:t−1 as the prior information. This structure is illustrated in Figure 1. Finally, prior parameters are placed over other latent variables for Bayesian inference. These variables are generated as: φvk ∼Gamma(αφ, βφ) andλk ∼Gamma(αλ, βλ) and ψv ∼Gamma(αψ, βψ). Although Dirichlet distribution is often used as prior distribution [13, 14, 15] over φvk in previous works, a Gamma distribution is exploited in our model due to the including of feature-wise parameter ψv and the purpose for obtaining feasible factor strength of φk. In real world applications, like recommendation systems, the observed binary count data can be formulated by the proposed DDPFA model with a Bernoulli-Poisson link [1]. The distribution of b given λ is called Bernoulli-Poisson distribution as: b = 1(x > 1), x ∼Poisson(λ) and the linking distribution is rewritten as: f(b|x, λ) = e−λ(1−b)(1 −e−λ) b. The conditional posterior distribution is then (x|b, λ) ∼b · Poisson+(λ), where Poisson+(λ) is a truncated Poisson distribution, so the MCMC or VI methods can be used to do inference. Non-count real-valued matrix can also be linked to a latent count matrix via a compound Poisson distribution or a Gamma belief network [20]. 3 Inference There are many classical inference approaches for Bayesian probabilistic model, such as Monte Carlo methods and variational inference. In the proposed method, variational inference is exploited because the implicit distribution is regarded as prior distribution over Θ. Two stages of inference in our model are adopted: the first stage updates latent variables by the coordinate-ascent method with a fixed implicit distribution, and the parameters in neural networks are learned in the second one. Mean-field Approximation: In order to obtain mean-field VI, all variables are independent and governed by its own variational distribution. The joint distribution of the variational distribution is written as: q(Θ, Φ, Ψ, Λ, H) = Q v,t,n,k q(φvk|φ∗ vk)q(ψk|ψ∗ k)q(θtk|θ∗ tk)q(λk|λ∗ k)q(h(n) tk |h(n)∗ tk ) (5) where y∗represents the prior variational parameter of the variable y. The variational parameters ν are fitted to minimize the KL divergence: ν = argminν∗KL(p(Θ, Φ, Ψ, Λ, H|X)||q(Θ, Φ, Ψ, Λ, H|ν)) (6) The variational distribution q(·|ν∗) is then used as a proxy for the posterior. The objective actually is equal to maximize the evidence low bound (ELBO) [19]. The optimization can be performed by a coordinate-ascent method or a variational-EM method. As a result, each variational parameter can be optimized iteratively while the remaining parameters of the model are set to fixed value. Due to Eq. 2, the conditional distribution of (xvt1, . . . , xvtk) is a multinomial while its parameter is normalized set of rates [19] and formulated as: (xvt1, . . . , xvtk)|θt, φv, λ, ψv ∼Mult(xvt·; θtφvλφv/P k θtkφvkλkψv) (7) Given the auxiliary variables xvtk, the Poisson factorization model is a conditional conjugate model. The complete conditional of the latent variables is Gamma distribution and shown as: φvk|Θ, Λ, Ψ, α, β, X ∼Gamma(αφ + xv·k, βφ + λkψvθ·k) λk|Θ, Φ, Φ, α, β, X ∼Gamma(αλ + x··k, βθ + θ·k P v ψvφvk) ψv|Θ, Λ, Φ, α, β, X ∼Gamma(αψ + xv··, βψ + P k λkφvkθ·k) (8) 3 Generally, these distributions are derived from conjugate properties between Poisson and Gamma distribution. The posterior distribution of θtk described in Eq. 3 can be a Gamma distribution while the prior h(0) t−c:t is given as: θtk|Ψ, Λ, Φ, h(0), β, X ∼Gamma(αθtk + xv·k, βθ + λk P v ψvφvk) (9) where αθtk is calculated through a recurrent neural network with (h(0) t−c, ..., h(0) t ) as its inputs. Then the posterior distribution of h(0) tk described in Eq. 4 is given as: h(0) tk |Θ, h(1), β, X ∼Gamma(αh(0) tk + γh(0) tk , βh) (10) where αh(n) tk is the prior information given by the (n + 1)th layer, γh(n) tk is the posterior information given by the (n −1)th layer. Here, the notation h(−1) tk is equal to θtk. αh(n) tk is calculated through a recurrent neural network using (h(n+1) t−c , ..., h(n+1) t ) as its inputs. γh(n) tk is calculated through a recurrent neural network using (h(n−1) t+c , ..., h(n−1) t ) as its inputs. Therefore, the distribution mentioned in Eq. 9 can be regarded as an implicit conditional distribution of θtk given (h(0) t−c, ..., h(0) t ). And the distribution in Eq. 10 is an implicit distribution of αh(n) tk given (h(n+1) t−c , ..., h(n+1) t ) and (h(n−1) t+c , ..., h(n−1) t ). Variational Inference: Mean field variational inference can approximate the latent variables while all parameters of a neural network are given. If the observed data satisfies xvt > 0, the auxiliary variables xvtk can be updated by: xvtk ∝exp{Ψ(θshp tk ) −logθrte tk + Ψ(λshp k ) −logλrte k + Ψ(φshp vk ) −logφrte vk + Ψ(ψshp v ) −logψrte v } (11) where Ψ(·) is the digamma function. Variables with the superscript “shp” indicate the shape parameter of Gamma distribution, and those with the superscript “rte” are the rate parameter of it. This update comes from the expectation of the logarithm of a Gamma variable as ⟨logθ⟩= Ψ(θshp) −log(θrte). Here, θ is generated from a Gamma distribution and ⟨·⟩represents the expectation of the variable. Calculation of the expectation of the variable, obeyed Gamma distribution, is noted as ⟨θ⟩= θshp/θrte. Variables can be updated by mean-field method as: φvk ∼Gamma(αφ + ⟨xv·k⟩, βφ + ⟨λk⟩⟨ψv⟩⟨θ·k⟩) λk ∼Gamma(αλ + ⟨x··k⟩, βθ + ⟨θ·k⟩P v ⟨ψv⟩⟨φvk⟩) ψv ∼Gamma(αψ + ⟨xv··⟩, βψ + P k ⟨λk⟩⟨φvk⟩⟨θ·k⟩) (12) The latent variables in the deep structure can also be updated by mean-field method: θtk ∼Gamma(αθtk + ⟨xv·k⟩, βθ + ⟨λk⟩P v ⟨ψv⟩⟨φvk⟩) (13) h(n) tk ∼Gamma(αh(n) tk + γh(n) tk , βh) (14) where αh(n) t = ffeed(⟨hn+1⟩), αh(N) t = ffeed(⟨hN t−c−1:t−1⟩) and γh(n) t = fback(⟨hn−1⟩), γh(N) t = fback(⟨hN t+c+1:t+1⟩). ffeed(·) is the neural network constructing the prior distribution and fback(·) is the neural network constructing the posterior distribution. Probability AutoEncoder: This stage of the inference is to update the parameters of the neural networks. The bottom layer is used by us as an example. Given all latent variables, these parameters can be approximated by p(θt|h(0) t−c, ..., h(0) t ) and p(h(0) t |θt+c, ..., θt). p(θ(n) t |h(0) t−c, ..., h(0) t ) = Gamma(αθt, βh) is modeled by a RNN with the inputs (h(0) t−c, ..., h(0) t ) and the outputs, αθt. The 4 p(h(0) t |θt+c, ..., θt) is also modeled as a RNN with the inputs (θt+c, ..., θt) and the outputs ,γh(0) t . With the posterior distribution from Θ to H(0) and the prior distribution from H(0) to Θ, the probability of Θ should be maximized. The loss function of these two neural networks is as follows: max W { R p(Θ|H(0))p(H(0)|Θ)dH(0)} (15) where W represents the parameters in neural networks. Because the integration in Eq. 15 is intractable, a new loss function should include auxiliary variational variables H(0)′. Assume that H(0)′ is generated by Θ, the optimization can be regarded as maximizing the probability of Θ with minimal difference between H(0)′ and H(0) as max W {p(Θ|H(0))} and min W {KL(p(H(0)′|Θ)||p(H(0)|H(1))} Then approximating the variables generated from a distribution by its expectation, the loss function, similar to variational AutoEncoder [21], can be simplified to: min W {∥⟨p(H(0)′|Θ)⟩−⟨p(H(0)|H(1))⟩∥2 + ∥Θ −⟨p(Θ|H(0))⟩∥2} (16) Since only a few samples are drawn from one certain distrbution, which means sampling all latent variables is high-cost and useless, differentiable variational Bayes is not suitable. As a result, we focus more on fitting data than generating data. In our objective, the first term, a regularization, encourages the data to be reconstructed from the latent variables, and the second term encourages the decoder to fit the data. The parameters in the networks for nth and (n + 1)th layer are trained by the loss function: min W {∥⟨p(H(n+1)′|H(n))⟩−⟨p(H(n)|H(n+1))⟩∥2 + ∥H(n) −⟨p(H(n)|H(n+1))⟩∥2} (17) In order to make the convergence more stable, the term of Θ in the first layer is collapsed into X by using the fixed latent variables approximated by mean-field VI, and the loss function is as follows: min W {∥⟨p(H(0)′|Θ)⟩−⟨p(H(0)|H(1))⟩∥2 + ∥X −⟨Ψ⟩⟨Λ⟩⟨Φ⟩⟨p(Θ|H(0))⟩∥2} (18) After the layer-wise training, all the parameters in neural networks are jointly trained by the fine-tuning trick in stacked AutoEncoder [22]. 4 Experiments In this section, four multi-dimensional synthetic datasets and five real-world datasets are exploited to examine the performance of the proposed model. Besides, the results of three existed methods, PGDS, LSTM, and PFA, are compared with results of our model. PGDS is a dynamic Poisson-Gamma system mentioned in Section 1, and LSTM is a classical time sequence model. In order to prove the deep relationship learnt by the deep structure can improve the performance, a simple PFA model is also included as a baseline. All hyperparameters of PGDS set in [2] are used in this paper. 1000 times gibbs sampling iterations for PGDS is performed, 100 iterations used mean-field VI for PFA is performed, and 400 epochs is executed for LSTM. The parameters in the proposed DDPFA model are set as follows:α(λ,φ,ψ) = 1, β(λ,φ,ψ) = 2, α(θ,h) = 1, β(θ,h) = 1. The iterations is set to 100. The stochastic gradient descent for the neural networks is executed 10 epochs in each iteration. The size of the window is 4. Hyperparameters of PFA are set as the same to our model. Data in the last time step is exploited as the predicting target in a prediction task. Mean squared error (MSE) between the ground truth and the estimated value and the predicted mean squared error (PMSE) between the ground truth and the predicted value in next time step are exploited to evaluate the performance of each model. 4.1 Synthetic Datasets The multi-dimensional synthetic datasets are obtained by using the following functions where the subscript stands for the index of dimension: 5 Table 1: The result on the synthetic data Data Measure DDPFA PGDS LSTM PFA SDS1 MSE 0.15 ± 0.01 1.48 ± 0.00 2.02 ± 0.23 1.61 ± 0.00 PMSE 2.07 ± 0.02 5.96 ± 0.00 2.94 ± 0.31 SDS2 MSE 0.06 ± 0.01 3.38 ± 0.00 1.83 ± 0.04 4.42 ± 0.00 PMSE 2.01 ± 0.02 3.50 ± 0.01 2.41 ± 0.06 SDS3 MSE 0.10 ± 0.02 1.62 ± 0.00 1.13 ± 0.06 1.34 ± 0.00 PMSE 2.14 ± 0.04 4.33 ± 0.01 3.03 ± 0.05 SDS4 MSE 0.15 ± 0.03 2.92 ± 0.00 4.30 ± 0.26 0.25 ± 0.00 PMSE 1.48 ± 0.04 6.41 ± 0.01 4.67 ± 0.24 SDS1:f1(t) = f2(t) = t, f3(t) = f4(t) = t + 1 on the interval t = [1 : 1 : 6]. SDS2:f1(t) = t (mod 2), f2(t) = 2t (mod 2) + 2, f3(t) = t on the interval t = [1 : 1 : 20]. SDS3:f1(t) = f2(t) = t, f3(t) = f4(t) = t + 1, f5(t) = I(4|t) on the interval t = [1 : 1 : 20], where I is an indicator function. SDS4:f1(t) = t (mod 2), f2(t) = 2t (mod 2) + 2, f3(t) = t (mod 10) on the interval t = [1 : 1 : 100]. The number of factor is set to K = 3, and the number of the layers is 2. Both fitting and predicting tasks are performed in each model. The hidden layer of LSTM is 4 and the size in each layer is 20. In Table 1, it is obviously that DDPFA has the best performance in fitting and prediction task of all the datasets. Note that the complex relationship learnt from the time steps helps the model catch more time patterns according to the results of DDPFA, PGDS and PFA. LSTM performs worse in SDS4 because the noise in the synthetic data and the long time steps make the neural network difficult to memorize enough information. 4.2 Real-world Datasets Five real-world datasets are used as follows: Integrated Crisis Early Warning System (ICEWS): ICEWS is an international relations event data set extracted from news corpora used in [2]. We therefore treated undirected pairs of countries i ↔j as features and created a count matrix for the year 2003. The number of events for each pair during each day time step is counted, and all pairs with fewer than twenty-five total events is discarded, leaving T = 365, V = 6197, and 475646 events for the matrix. NIPS corpus (NIPS): NIPS corpus contains the text of every NIPS conference paper from the year 1987 to 2003. We created a single count matrix with one column per year. The dataset is downloaded from Gal’s page 1, with T = 17, V = 14036, with 3280697 events for the matrix. Ebola corpus (EBOLA)2 : EBOLA corpus contains the data for the 2014 Ebola outbreak in West Africa every day from Mar 22th, 2014 to Jan 5th 2015, each column represents the cases or deaths in a West Africa country. After data cleaning, the dataset is with T = 122, V = 16. International Disaster(ID)3 : The International Disaster dataset contains essential core data on the occurrence and effects of over 22,000 mass disasters in the world from 1900 to the present day. A count matrix with T = 115 and V = 12 is built from the events of disasters occurred in Europe from the year 1902 to 2016, classified according to their disaster types. Annual Sheep Population(ASP)4 : The Annual Sheep Population contains the sheep population in England & Wales from the year 1867 to 1939 yearly. The data matrix is with T = 73, V = 1. 1http://ai.stanford.edu/gal/data.html 2https://github.com/cmrivers/ebola/blob/master/country_timeseries.csv 3http://www.emdat.be/ 4https://datamarket.com/data/list/?q=provider:tsdl 6 Table 2: The result on the real-world data Data Measure DDPFA PGDS LSTM PFA ICEWS MSE 3.05 ± 0.02 3.21 ± 0.01 4.53 ± 0.04 3.70 ± 0.01 PMSE 0.96 ± 0.03 0.97 ± 0.02 6.30 ± 0.03 NIPS MSE 51.14 ± 0.03 54.71 ± 0.08 1053.12 ± 39.01 69.05 ± 0.43 PMSE 289.21 ± 0.02 337.60 ± 0.10 1728.04 ± 38.42 EBOLA MSE 381.82 ± 0.13 516.57 ± 0.01 4892.34 ± 10.21 1493.32 ± 0.21 PMSE 490.32 ± 0.12 1071.01 ± 0.01 5839.26 ± 11.92 ID MSE 1.59 ± 0.01 3.45 ± 0.00 11.19 ± 1.32 4.41 ± 0.01 PMSE 5.18 ± 0.01 10.44 ± 0.00 10.37 ± 1.54 ASP MSE 14.17 ± 0.02 2128.47 ± 0.02 17962.47 ± 14.12 388.02 ± 0.01 PMSE 21.23 ± 0.04 760.42 ± 0.02 21324.72 ± 17.48 (a) PGDS (b) DDPFA Figure 2: The visual of the factor strength in each time step of the ICEWS data, the data is normalized each time step. In (a), the result of PGDS shows the factors are shrunk to some local time steps. In (b), the result of DDPFA shows the factors are not taking effects locally. We set K = 3 for ID and ASP datasets, while set K = 10 for the others. The size of the hidden layers of the LSTM is 40. The settings of remainder parameters here are the same as those in the above experiment. The results of the experiment are shown in Table 2. Table 2 shows the results of four different models on the five datasets, and the proposed model DDPFA has satisfying performance in most experiments although the DDPFA’s result in ICEWS prediction task is not good enough. While smoothed data obtained from the transition matrix in PGDS performs well in this prediction task. However, In EBOLA and ASP datasets, PGDS fails in catching complicated time dependence. And it is a tough challenge for LSTM network to memorize enough useful patterns while its input data includes long-time patterns or the dimension of the data is particular high. According to the observation in Figure 2, it can be shown that the factors learnt by our model are not activated locally compared to PGDS. Natrually, in real-world data, it is impossible that only one factor happens in one time step. For example, in the ICEWS dataset, the connection between Israel and Occupied Palestinian Territory still remains strong during the Iraq War or other accidents. Figure 2(a) reveals that several factors at a certain time step are not captured by PGDS. In Figure 3, the changes of two meaningful factors in ICEWS is shown. These two factor, respectively, indicate Israel-Palestinian conflict and six-party talks. The long-time activation of factors is shown in thi figure, since DDPFA model can capture weak strength along time. In Table 3, we show the performance of our model with different sizes. From the table, performance cannot be improved distinctly by adding more layers or adding more variables in upper layer. It is also noticed that expanding the dimension in bottom layer is more useful than in upper layers. The results reveal two problems of proposed DDPFA: "pruning" and uselessness of adding network layers. 7 (a) (b) Figure 3: The visual of the top two factors of the ICEWS data generated by DDPFA method. In (a), ’Japan–Russian Federation’, ’North Korea–United States’, ’Russian Federation–United States’, ’South Korea–United States’, and ’China–Russian Federation’ are the largest features due to their loading weights. This factor stands for six-party talks and other accidents about it. In (b), ’Israel–Occupied Palestinian Territory’, ’Israel–United States’, ’Occupied Palestinian Territory–United States’ are the largest features and it stands for the Israeli-Palestinian conflict. Table 3: MSE on real datasets with different sizes. Size ICEWS NIPS EBOLA 10-10-10 2.94 51.24 382.17 10-10-10 (ladder structure) 2.88 49.81 379.08 10-10 3.05 51.14 381.82 32-32-32 2.95 50.12 379.64 32-32-32 (ladder structure) 2.86 49.26 377.81 32-64-64 2.93 50.18 380.01 64-32-32 2.90 50.04 378.87 [25] notices hierarchical latent variable models do not take advantage of the structure, and gives such a conclusion that only using the bottom latent layer of hierarchical variational autoencoders should be enough. In order to solve this problem, the ladder-like architecture, in which each layer combines independent variables with latent variables depend on the upper layers, is used in our model. It is noticed that using ladder architecture could reach much better results from Table 3. Another problem, "pruning", is a phenomenon where the optimizer severs connections between most of the latent variables and the data [24]. In our experiments, it is noticed that some dimenisions in the latent layers only contain data noise. This problem is also found in differentiable variational Bayes and solved by using auxiliary MCMC strcuture [24]. Therefore, we believe this problem is caused by MF-variational inference used in our model and we hope it can be solved if we try other inference methods. 5 Summary A new model, called DDPFA, is proposed to obtain long-time and complicated dependence in time series count data. Inference in DDPFA is based on variational method for estimating the latent variables and approximating parameters in neural networks. In order to show the performance of the proposed model, four multi-dimensional synthetic datasets and five real-world datasets, ICEWS, NIPS corpus, EBOLA, International Disaster and Annual Sheep Population, are used, and the performance of three existed methods, PGDS, LSTM, and PFA, are compared. According to our experimental results, DDPFA has better effectivity and interpretability in sequential count analysis. 8 References [1] A. Ayan, J. Ghosh, & M. Zhou. Nonparametric Bayesian Factor Analysis for Dynamic Count Matrices. AISTATS, 2015. [2] A. Schein, M. Zhou, & H. Wallach. Poisson–Gamma Dynamical Systems. NIPS, 2016. [3] A. Ahmed, & E. Xing. Dynamic Non-Parametric Mixture Models and The Recurrent Chinese Restaurant Process. SDM, 2008. [4] D. M. Blei, D. M. Griffiths, M. I. Jordan, & J. B. Tenenbaum. Hierarchical topic models and the nested Chinese restaurant process. NIPS, 2004. [5] J. Paisley, C. Wang, D. M. Blei, & M. I. Jordan. Nested hierarchical Dirichlet processes. PAMI, 2015. [6] T. D. Bui, D. Hernándezlobato, Y. Li, & et al. Deep Gaussian Processes for Regression using Approximate Expectation Propagation. ICML, 2016. [7] T. D. Bui, D. Thang, E. Richard, & et al. A unifying framework for sparse Gaussian process approximation using Power Expectation Propagation. arXiv:1605.07066. [8] R. Ranganath, L. Tang, L. Charlin, & D. M. Blei. Deep exponential families. AISTATS, 2014. [9] Z. Gan, C. Chen, R. Henao, D. Carlson, & L. Carin. Scalable deep Poisson factor analysis for topic modeling. ICML, 2015. [10] Z. Gan, R. Henao, D. Carlson, & L. Carin. Learning deep sigmoid belief networks with data augmentation. AISTATS, 2015. [11] H. Larochelle & S. Lauly. A neural autoregressive topic model. NIPS, 2012. [12] H. Ricardo, Z. Gan, J. Lu & L. Carin. Deep Poisson Factor Modeling. NIPS, 2015. [13] M. Zhou & L. Carin. Augment-and-conquer negative binomial processes. NIPS, pages 2546–2554, 2012. [14] M. Zhou, L. Hannah, D. Dunson, & L. Carin. Beta-negative binomial process and Poisson factor analysis. AISTATS, 2012. [15] M. Zhou & L. Carin. Negative binomial process count and mixture modeling. IEEE Transactions on Pattern Analysis and Machine Intelligence, 37(2):307–320, 2015. [16] M. Zhou. Nonparametric Bayesian negative binomial factor analysis. arXiv:1604.07464. [17] S. A. Hosseini, K. Alizadeh, A. Khodadadi, & et al. Recurrent Poisson Factorization for Temporal Recommendation. KDD, 2017. [18] P. Gopalan, J. M. Hofman, & D. M. Blei. Scalable Recommendation with Hierarchical Poisson Factorization. UAI, 2015. [19] P. Gopalan, J. M. Hofman, & D. M. Blei. Scalable Recommendation with Poisson Factorization. arXiv:1311.1704. [20] M. Zhou, Y. Cong, & B. Chen. Augmentable gamma belief networks. Journal of Machine Learning Research, 17(163):1–44, 2016. [21] D. P. Kingma & W. Max. Auto-encoding variational Bayes. ICLR, 2014. [22] Y. Bengio, P. Lamblin, D. Popovici, & H. Larochelle. Greedy layer-wise training of deep networks. NIPS, 2006. [23] Y. Cong, B. Chen, H. Liu, and M. Zhou, Deep latent Dirichlet allocation with topic-layer-adaptive stochastic gradient Riemannian MCMC. ICML, 2017. [24] S. Zhao, J. Song, S. Ermon. Learning Hierarchical Features from Generative Models. ICML, 2017. [25] M. Hoffman. Learning Deep Latent Gaussian Models with Markov Chain Monte Carlo. ICML, 2017. 9
2017
105
6,570
Scalable Generalized Linear Bandits: Online Computation and Hashing Kwang-Sung Jun UW-Madison kjun@discovery.wisc.edu Aniruddha Bhargava UW-Madison aniruddha@wisc.edu Robert Nowak UW-Madison rdnowak@wisc.edu Rebecca Willett UW-Madison willett@discovery.wisc.edu Abstract Generalized Linear Bandits (GLBs), a natural extension of the stochastic linear bandits, has been popular and successful in recent years. However, existing GLBs scale poorly with the number of rounds and the number of arms, limiting their utility in practice. This paper proposes new, scalable solutions to the GLB problem in two respects. First, unlike existing GLBs, whose per-time-step space and time complexity grow at least linearly with time t, we propose a new algorithm that performs online computations to enjoy a constant space and time complexity. At its heart is a novel Generalized Linear extension of the Online-to-confidence-set Conversion (GLOC method) that takes any online learning algorithm and turns it into a GLB algorithm. As a special case, we apply GLOC to the online Newton step algorithm, which results in a low-regret GLB algorithm with much lower time and memory complexity than prior work. Second, for the case where the number N of arms is very large, we propose new algorithms in which each next arm is selected via an inner product search. Such methods can be implemented via hashing algorithms (i.e., “hash-amenable”) and result in a time complexity sublinear in N. While a Thompson sampling extension of GLOC is hash-amenable, its regret bound for d-dimensional arm sets scales with d3/2, whereas GLOC’s regret bound scales with d. Towards closing this gap, we propose a new hashamenable algorithm whose regret bound scales with d5/4. Finally, we propose a fast approximate hash-key computation (inner product) with a better accuracy than the state-of-the-art, which can be of independent interest. We conclude the paper with preliminary experimental results confirming the merits of our methods. 1 Introduction This paper considers the problem of making generalized linear bandits (GLBs) scalable. In the stochastic GLB problem, a learner makes successive decisions to maximize her cumulative rewards. Specifically, at time t the learner observes a set of arms Xt ⊆Rd. The learner then chooses an arm xt ∈Xt and receives a stochastic reward yt that is a noisy function of xt: yt = µ(x⊤ t θ∗) + ηt, where θ∗∈Rd is unknown, µ:R→R is a known nonlinear mapping, and ηt ∈R is some zero-mean noise. This reward structure encompasses generalized linear models [29]; e.g., Bernoulli, Poisson, etc. The key aspect of the bandit problem is that the learner does not know how much reward she would have received, had she chosen another arm. The estimation on θ∗is thus biased by the history of the selected arms, and one needs to mix in exploratory arm selections to avoid ruling out the optimal arm. This is well-known as the exploration-exploitation dilemma. The performance of a learner is evaluated by its regret that measures how much cumulative reward she would have gained additionally if she had known the true θ∗. We provide backgrounds and formal definitions in Section 2. A linear case of the problem above (µ(z) = z) is called the (stochastic) linear bandit problem. Since the first formulation of the linear bandits [7], there has been a flurry of studies on the problem [11, 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 34, 1, 9, 5]. In an effort to generalize the restrictive linear rewards, Filippi et al. [15] propose the GLB problem and provide a low-regret algorithm, whose Thompson sampling version appears later in Abeille & Lazaric [3]. Li et al. [27] evaluates GLBs via extensive experiments where GLBs exhibit lower regrets than linear bandits for 0/1 rewards. Li et al. [28] achieves a smaller regret bound when the arm set Xt is finite, though with an impractical algorithm. However, we claim that all existing GLB algorithms [15, 28] suffer from two scalability issues that limit their practical use: (i) under a large time horizon and (ii) under a large number N of arms. First, existing GLBs require storing all the arms and rewards appeared so far, {(xs, ys)}t s=1, so the space complexity grows linearly with t. Furthermore, they have to solve a batch optimization problem for the maximum likelihood estimation (MLE) at each time step t whose per-time-step time complexity grows at least linearly with t. While Zhang et al. [41] provide a solution whose space and time complexity do not grow over time, they consider a specific 0/1 reward with the logistic link function, and a generic solution for GLBs is not provided. Second, existing GLBs have linear time complexities in N. This is impractical when N is very large, which is not uncommon in applications of GLBs such as online advertisements, recommendation systems, and interactive retrieval of images or documents [26, 27, 40, 21, 25] where arms are items in a very large database. Furthermore, the interactive nature of these systems requires prompt responses as users do not want to wait. This implies that the typical linear time in N is not tenable. Towards a sublinear time in N, locality sensitive hashings [18] or its extensions [35, 36, 30] are good candidates as they have been successful in fast similarity search and other machine learning problems like active learning [22], where the search time scales with N ρ for some ρ < 1 (ρ is usually optimized and often ranges from 0.4 to 0.8 depending on the target search accuracy). Leveraging hashing in GLBs, however, relies critically on the objective function used for arm selections. The function must take a form that is readily optimized using existing hashing algorithms.1 For example, algorithms whose objective function (a function of each arm x ∈Xt) can be written as a distance or inner product between x and a query q are hash-amenable as there exist hashing methods for such functions. To be scalable to a large time horizon, we propose a new algorithmic framework called Generalized Linear Online-to-confidence-set Conversion (GLOC) that takes in an online learning (OL) algorithm with a low ‘OL’ regret bound and turns it into a GLB algorithm with a low ‘GLB’ regret bound. The key tool is a novel generalization of the online-to-confidence-set conversion technique used in [2] (also similar to [14, 10, 16, 41]). This allows us to construct a confidence set for θ∗, which is then used to choose an arm xt according to the well-known optimism in the face of uncertainty principle. By relying on an online learner, GLOC inherently performs online computations and is thus free from the scalability issues in large time steps. While any online learner equipped with a low OL regret bound can be used, we choose the online Newton step (ONS) algorithm and prove a tight OL regret bound, which results in a practical GLB algorithm with almost the same regret bound as existing inefficient GLB algorithms. We present our proposed algorithms and their regret bounds in Section 3. Algorithm Regret Hash-amenable GLOC ˜O(d √ T)  GLOC-TS ˜O(d3/2√ T)  QGLOC ˜O(d5/4√ T)  Table 1: Comparison of GLBs algorithms for d-dimensional arm sets T is the time horizon. QGLOC achieves the smallest regret among hash-amenable algorithms. For large number N of arms, our proposed algorithm GLOC is not hash-amenable, to our knowledge, due to its nonlinear criterion for arm selection. As the first attempt, we derive a Thompson sampling [5, 3] extension of GLOC (GLOC-TS), which is hash-amenable due to its linear criterion. However, its regret bound scales with d3/2 for d-dimensional arm sets, which is far from d of GLOC. Towards closing this gap, we propose a new algorithm Quadratic GLOC (QGLOC) with a regret bound that scales with d5/4. We summarize the comparison of our proposed GLB algorithms in Table 1. In Section 4, we present GLOC-TS, QGLOC, and their regret bound. Note that, while hashing achieves a time complexity sublinear in N, there is a nontrivial overhead of computing the projections to determine the hash keys. As an extra contribution, we reduce this overhead by proposing a new sampling-based approximate inner product method. Our proposed sampling method has smaller variance than the state-of-the-art sampling method proposed by [22, 24] when the vectors are normally distributed, which fits our setting where projection vectors are indeed normally distributed. Moreover, our method results in thinner tails in the distribution of estimation 1 Without this designation, no currently known bandit algorithm achieves a sublinear time complexity in N. 2 error than the existing method, which implies a better concentration. We elaborate more on reducing the computational complexity of QOFUL in Section 5. 2 Preliminaries We review relevant backgrounds here. A refers to a GLB algorithm, and B refers to an online learning algorithm. Let Bd(S) be the d-dimensional Euclidean ball of radius S, which overloads the notation B. Let A·i be the i-th column vector of a matrix A. Define ||x||A := √ x⊤Ax and vec(A) := [A·1; A·2; · · · ; A·d] ∈Rd2 Given a function f : R →R, we denote by f ′ and f ′′ its first and second derivative, respectively. We define [N] := {1, 2, . . . , N}. Generalized Linear Model (GLM) Consider modeling the reward y as one-dimensional exponential family such as Bernoulli or Poisson. When the feature vector x is believed to correlate with y, one popular modeling assumption is the generalized linear model (GLM) that turns the natural parameter of an exponential family model into x⊤θ∗where θ∗is a parameter [29]: P(y | z = x⊤θ∗) = exp yz −m(z) g(τ) + h(y, τ)  , (1) where τ ∈R+ is a known scale parameter and m, g, and h are normalizers. It is known that m′(z) = E[y | z] =: µ(z) and m′′(z) = Var(y | z). We call µ(z) the inverse link function. Throughout, we assume that the exponential family being used in a GLM has a minimal representation, which ensures that m(z) is strictly convex [38, Prop. 3.1]. Then, the negative log likelihood (NLL) ℓ(z, y) := −yz + m(z) of a GLM is strictly convex. We refer to such GLMs as the canonical GLM. In the case of Bernoulli rewards y ∈{0, 1}, m(z) = log(1 + exp(z)), µ(z) = (1 + exp(−z))−1, and the NLL can be written as the logistic loss: log(1 + exp(−y′(x⊤ t θ∗))), where y′ = 2y −1. Generalized Linear Bandits (GLB) Recall that xt is the arm chosen at time t by an algorithm. We assume that the arm set Xt can be of an infinite cardinality, although we focus on finite arm sets in hashing part of the paper (Section 4). One can write down the reward model (1) in a different form: yt = µ(x⊤ t θ∗) + ηt, (2) where ηt is conditionally R-sub-Gaussian given xt and {(xs, ηs)}t−1 s=1. For example, Bernoulli reward model has ηt as 1 −µ(x⊤ t θ∗) w.p. µ(x⊤ t θ∗) and −µ(x⊤ t θ∗) otherwise. Assume that ||θ∗||2 ≤S, where S is known. One can show that the sub-Gaussian scale R is determined by µ: R = supz∈(−S,S) p µ′(z) ≤ √ L, where L is the Lipschitz constant of µ. Throughout, we assume that each arm has ℓ2-norm at most 1: ||x||2 ≤1, ∀x ∈Xt, ∀t. Let xt,∗:= maxx∈Xt x⊤θ∗. The performance of a GLB algorithm A is analyzed by the expected cumulative regret (or simply regret): RegretA T := PT t=1 µ(x⊤ t,∗θ∗) −µ((xA t )⊤θ∗), where xA t makes the dependence on A explicit. We remark that our results in this paper hold true for a strictly larger family of distributions than the canonical GLM, which we call the non-canonical GLM and explain below. The condition is that the reward model follows (2) where the R is now independent from µ that satisfies the following: Assumption 1. µ is L-Lipschitz on [−S, S] and continuously differentiable on (−S, S). Furthermore, infz∈(−S,S) µ′(z) = κ for some finite κ > 0 (thus µ is strictly increasing). Define µ′(z) at ±S as their limits. Under Assumption 1, m is defined to be an integral of µ. Then, one can show that m is κ-strongly convex on B1(S). An example of the non-canonical GLM is the probit model for 0/1 reward where µ is the Gaussian CDF, which is popular and competitive to the Bernoulli GLM as evaluated by Li et al. [27]. Note that canonical GLMs satisfy Assumption 1. 3 Generalized Linear Bandits with Online Computation We describe and analyze a new GLB algorithm called Generalized Linear Online-to-confidence-set Conversion (GLOC) that performs online computations, unlike existing GLB algorithms. GLOC employs the optimism in the face of uncertainty principle, which dates back to [7]. That is, we maintain a confidence set Ct (defined below) that traps the true parameter θ∗with high probability (w.h.p.) and choose the arm with the largest feasible reward given Ct−1 as a constraint: (xt, ˜θt) := arg max x∈Xt,θ∈Ct−1 ⟨x, θ⟩ (3) The main difference between GLOC and existing GLBs is in the computation of the Ct’s. Prior methods involve “batch" computations that involve all past observations, and so scale poorly with 3 t. In contrast, GLOC takes in an online learner B, and uses B as a co-routine instead of relying on a batch procedure to construct a confidence set. Specifically, at each time t GLOC feeds the loss function ℓt(θ) := ℓ(x⊤ t θ, yt) into the learner B which then outputs its parameter prediction θt. Let Xt ∈Rt×d be the design matrix consisting of x1, . . . , xt. Define Vt := λI + X⊤ t Xt, where λ is the ridge parameter. Let zt := x⊤ t θt and zt := [z1; · · · ; zt]. Let bθt := V −1 t X⊤ t zt be the ridge regression estimator taking zt as responses. Theorem 1 below is the key result for constructing our confidence set Ct, which is a function of the parameter predictions {θs}t s=1 and the online (OL) regret bound Bt of the learner B. All the proofs are in the supplementary material (SM). Theorem 1. (Generalized Linear Online-to-Confidence-Set Conversion) Suppose we feed loss functions {ℓs(θ)}t s=1 into online learner B. Let θs be the parameter predicted at time step s by B. Assume that B has an OL regret bound Bt: ∀θ ∈Bd(S), ∀t ≥1, Pt s=1 ℓs(θs) −ℓs(θ) ≤Bt . (4) Let α(Bt) := 1+ 4 κBt + 8R2 κ2 log( 2 δ q 1 + 2 κBt + 4R4 κ4δ2 ). Then, with probability (w.p.) at least 1−δ, ∀t ≥1, ||θ∗−bθt||2 Vt ≤α(Bt) + λS2 −  ||zt||2 2 −bθ ⊤ t X⊤ t zt  =: βt . (5) Note that the center of the ellipsoid is the ridge regression estimator on the predicted natural parameters zs = x⊤ s θs rather than the rewards. Theorem 1 motivates the following confidence set: Ct := {θ ∈Rd : ||θ −bθt||2 Vt ≤βt} (6) which traps θ∗for all t ≥1, w.p. at least 1 −δ. See Algorithm 1 for pseudocode. One way to solve the optimization problem (3) is to define the function θ(x) := maxθ∈Ct−1 x⊤θ, and then use the Lagrangian method to write: xGLOC t := arg max x∈Xt x⊤bθt−1 + p βt−1||x||V −1 t−1 . (7) We prove the regret bound of GLOC in the following theorem. Theorem 2. Let {βt} be a nondecreasing sequence such that βt ≥βt. Then, w.p. at least 1 −δ, RegretGLOC T = O  L q βT dT log T  Algorithm 1 GLOC 1: Input: R > 0, δ ∈(0, 1), S > 0, λ > 0, κ > 0, an online learner B with known regret bounds {Bt}t≥1. 2: Set V0 = λI. 3: for t = 1, 2, . . . do 4: Compute xt by solving (3). 5: Pull xt and then observe yt. 6: Receive θt from B. 7: Feed into B the loss ℓt(θ) = ℓ(x⊤ t θ, yt). 8: Update Vt = Vt−1 + xtx⊤ t and zt = x⊤ t θt 9: Compute bθt = V −1 t X⊤ t zt and βt as in (5). 10: Define Ct as in (6). 11: end for Algorithm 2 ONS-GLM 1: Input: κ > 0, ϵ > 0, S > 0. 2: A0 = ϵI. 3: Set θ1 ∈Bd(S) arbitrarily. 4: for t = 1, 2, 3, . . . do 5: Output θt . 6: Observe xt and yt. 7: Incur loss ℓ(x⊤ t θt, yt) . 8: At = At−1 + xtx⊤ t 9: θ′ t+1 = θt − ℓ′(x⊤ t θt,yt) κ A−1 t xt 10: θt+1 = arg minθ∈Bd(S) ||θ −θ′ t+1||2 At 11: end for Although any low-regret online learner can be combined with GLOC, one would like to ensure that βT is O(polylog(T)) in which case the total regret can be bounded by ˜O( √ T). This means that we must use online learners whose OL regret grows logarithmically in T such as [20, 31]. In this work, we consider the online Newton step (ONS) algorithm [20]. Online Newton Step (ONS) for Generalized Linear Models Note that ONS requires the loss functions to be α-exp-concave. One can show that ℓt(θ) is α-exp-concave [20, Sec. 2.2]. Then, GLOC can use ONS and its OL regret bound to solve the GLB problem. However, motivated by the fact that the OL regret bound Bt appears in the radius √βt of the confidence set while a tighter confidence set tends to reduce the bandit regret in practice, we derive a tight data-dependent OL regret bound tailored to GLMs. We present our version of ONS for GLMs (ONSGLM) in Algorithm 2. ℓ′(z, y) is the first derivative w.r.t. z and the parameter ϵ is for inverting matrices conveniently (usually ϵ = 1 or 0.1). The only difference from the original ONS [20] is that we rely on the strong convexity of m(z) instead of the α-exp-concavity of the loss thanks to the GLM structure.2 Theorem 3 states that we achieve the desired polylogarithmic regret in T. 2 A similar change to ONS has been applied in [16, 41]. 4 Theorem 3. Define gs := ℓ′(x⊤ s θs, ys). The regret of ONS-GLM satisfies, for any ϵ > 0 and t ≥1, Pt s=1 ℓs(θs) −ℓs(θ∗) ≤ 1 2κ Pt s=1 g2 s||xs||2 A−1 s + 2κS2ϵ =: BONS t , where BONS t = O( L2+R2 log(t) κ d log t), ∀t ≥1 w.h.p. If maxs≥1 |ηs| is bounded by ¯R w.p. 1, BONS t = O( L2+ ¯ R2 κ d log t). We emphasize that the OL regret bound is data-dependent. A confidence set constructed by combining Theorem 1 and Theorem 3 directly implies the following regret bound of GLOC with ONS-GLM. Corollary 1. Define βONS t by replacing Bt with BONS t in (5). With probability at least 1 −2δ, ∀t ≥1, θ∗∈CONS t := n θ ∈Rd : ||θ −bθt||2 Vt ≤βONS t o . (8) Corollary 2. Run GLOC with CONS t . Then, w.p. at least 1 −2δ, ∀T ≥1, RegretGLOC T = ˆO  L(L+R) κ d √ T log3/2(T)  where ˆO ignores log log(t). If |ηt| is bounded by ¯R, RegretGLOC T = ˆO  L(L+ ¯ R) κ d √ T log(T)  . We make regret bound comparisons ignoring log log T factors. For generic arm sets, our dependence on d is optimal for linear rewards [34]. For the Bernoulli GLM, our regret has the same order as Zhang et al. [41]. One can show that the regret of Filippi et al. [15] has the same order as ours if we use their assumption that the reward yt is bounded by Rmax. For unbounded noise, Li et al. [28] have regret O((LR/κ)d √ T log T), which is √log T factor smaller than ours and has LR in place of L(L + R). While L(L + R) could be an artifact of our analysis, the gap is not too large for canonical GLMs. Let L be the smallest Lipschitz constant of µ. Then, R = √ L. If L ≤1, R satisfies R > L, and so L(L + R) = O(LR). If L > 1, then L(L + R) = O(L2), which is larger than LR = O(L3/2). For the Gaussian GLM with known variance σ2, L = R = 1.3 For finite arm sets, SupCB-GLM of Li et al. [28] achieves regret of ˜O(√dT log N) that has a better scaling with d but is not a practical algorithm as it wastes a large number of arm pulls. Finally, we remark that none of the existing GLB algorithms are scalable to large T. Zhang et al. [41] is scalable to large T, but is restricted to the Bernoulli GLM; e.g., theirs does not allow the probit model (non-canonical GLM) that is popular and shown to be competitive to the Bernoulli GLM [27]. Discussion The trick of obtaining a confidence set from an online learner appeared first in [13, 14] for the linear model, and then was used in [10, 16, 41]. GLOC is slightly different from these studies and rather close to Abbasi-Yadkori et al. [2] in that the confidence set is a function of a known regret bound. This generality frees us from re-deriving a confidence set for every online learner. Our result is essentially a nontrivial extension of Abbasi-Yadkori et al. [2] to GLMs. One might have notice that Ct does not use θt+1 that is available before pulling xt+1 and has the most up-to-date information. This is inherent to GLOC as it relies on the OL regret bound directly. One can modify the proof of ONS-GLM to have a tighter confidence set Ct that uses θt+1 as we show in SM Section E. However, this is now specific to ONS-GLM, which looses generality. 4 Hash-Amenable Generalized Linear Bandits We now turn to a setting where the arm set is finite but very large. For example, imagine an interactive retrieval scenario [33, 25, 6] where a user is shown K images (e.g., shoes) at a time and provides relevance feedback (e.g., yes/no or 5-star rating) on each image, which is repeated until the user is satisfied. In this paper, we focus on showing one image (i.e., arm) at a time.4 Most existing algorithms require maximizing an objective function (e.g., (7)), the complexity of which scales linearly with the number N of arms. This can easily become prohibitive for large numbers of images. Furthermore, the system has to perform real-time computations to promptly choose which image to show the user in the next round. Thus, it is critical for a practical system to have a time complexity sublinear in N. One naive approach is to select a subset of arms ahead of time, such as volumetric spanners [19]. However, this is specialized for an efficient exploration only and can rule out a large number of good arms. Another option is to use hashing methods. Locality-sensitive hashing and Maximum 3 The reason why R is not σ here is that the sufficient statistic of the GLM is y/σ, which is equivalent to dealing with the normalized reward. Then, σ appears as a factor in the regret bound. 4 One image at a time is a simplification of the practical setting. One can extend it to showing multiple images at a time, which is a special case of the combinatorial bandits of Qin et al. [32]. 5 Inner Product Search (MIPS) are effective and well-understood tools but can only be used when the objective function is a distance or an inner product computation; (7) cannot be written in this form. In this section, we consider alternatives to GLOC which are compatible with hashing. Thompson Sampling We present a Thompson sampling (TS) version of GLOC called GLOC-TS that chooses an arm xt = arg maxx∈Xt x⊤˙θt where ˙θt ∼N(bθt−1, βt−1V −1 t−1). TS is known to perform well in practice [8] and can solve the polytope arm set case in polynomial time5 whereas algorithms that solve an objective function like (3) (e.g., [1]) cannot since they have to solve an NP-hard problem [5]. We present the regret bound of GLOC-TS below. Due to space constraints, we present the pseudocode and the full version of the result in SM. Theorem 4. (Informal) If we run GLOC-TS with ˙θt ∼N(bθt−1, βONS t−1 V −1 t−1), RegretGLOC-TS T = ˆO  L(L+R) κ d3/2√ T log3/2(T)  w.h.p. If ηt is bounded by ¯R, then ˆO  L(L+ ¯ R) κ d3/2√ T log(T)  . Notice that the regret now scales with d3/2 as expected from the analysis of linear TS [4], which is higher than scaling with d of GLOC. This is concerning in the interactive retrieval or product recommendation scenario since the relevance of the shown items is harmed, which makes us wonder if one can improve the regret without loosing the hash-amenability. Quadratic GLOC We now propose a new hash-amenable algorithm called Quadratic GLOC (QGLOC). Recall that GLOC chooses the arm xGLOC by (7). Define r = minx∈X ||x||2 and mt−1 := min x:||x||2∈[r,1] ||x||V −1 t−1 , (9) which is r times the square root of the smallest eigenvalue of V −1 t−1. It is easy to see that mt−1 ≤ ||x||V −1 t−1 for all x ∈X and that mt−1 ≥r/ √ t + λ using the definition of Vt−1. There is an alternative way to define mt−1 without relying on r, which we present in SM. Let c0 > 0 be the exploration-exploitation tradeoff parameter (elaborated upon later). At time t, QGLOC chooses the arm xQGLOC t := arg max x∈Xt ⟨bθt−1, x⟩+ β1/4 t−1 4c0mt−1 ||x||2 V −1 t−1 = arg max x∈Xt ⟨qt, φ(x)⟩, (10) where qt = [bθt−1; vec( β1/4 t−1 4c0mt−1 V −1 t−1)] ∈Rd+d2 and φ(x) := [x; vec(xx⊤)]. The key property of QGLOC is that the objective function is now quadratic in x, thus the name Quadratic GLOC, and can be written as an inner product. Thus, QGLOC is hash-amenable. We present the regret bound of QGLOC (10) in Theorem 5. The key step of the proof is that the QGLOC objective function (10) plus c0β3/4mt−1 is a tight upper bound of the GLOC objective function (7). Theorem 5. Run QGLOC with CONS t . Then, w.p. at least 1 −2δ, RegretQGLOC T = O  1 c0 L+R κ 1/2 + c0 L+R κ 3/2 Ld5/4√ T log2(T)  . By setting c0 = L+R κ −1/2, the regret bound is O( L(L+R) κ d5/4√ T log2(T)). Note that one can have a better dependence on log T when ηt is bounded (available in the proof). The regret bound of QGLOC is a d1/4 factor improvement over that of GLOC-TS; see Table 1. Furthermore, in (10) c0 is a free parameter that adjusts the balance between the exploitation (the first term) and exploration (the second term). Interestingly, the regret guarantee does not break down when adjusting c0 in Theorem 5. Such a characteristic is not found in existing algorithms but is attractive to practitioners, which we elaborate in SM. Maximum Inner Product Search (MIPS) Hashing While MIPS hashing algorithms such as [35, 36, 30] can solve (10) in time sublinear in N, these necessarily introduce an approximation error. Ideally, one would like the following guarantee on the error with probability at least 1 −δH: Definition 1. Let X ⊆Rd′ satisfy |X| < ∞. A data point ˜x ∈X is called cH-MIPS w.r.t. a given query q if it satisfies ⟨q, ˜x⟩≥cH · maxx∈X ⟨q, x⟩for some cH < 1. An algorithm is called cH-MIPS if, given a query q ∈Rd′, it retrieves x ∈X that is cH-MIPS w.r.t. q. Unfortunately, existing MIPS algorithms do not directly offer such a guarantee, and one must build a series of hashing schemes with varying hashing parameters like Har-Peled et al. [18]. Under the fixed budget setting T, we elaborate our construction that is simpler than [18] in SM. 5ConfidenceBall1 algorithm of Dani et al. [11] can solve the problem in polynomial time as well. 6 Time and Space Complexity Our construction involves saving Gaussian projection vectors that are used for determining hash keys and saving the buckets containing pointers to the actual arm vectors. The time complexity for retrieving a cH-MIPS solution involves determining hash keys and evaluating inner products with the arms in the retrieved buckets. Let ρ∗< 1 be an optimized value for the hashing (see [35] for detail). The time complexity for d′-dimensional vectors is O  log  log(dT ) log(c−1 H )  N ρ∗log(N)d′ , and the space complexity (except the original data) is O  log(dT ) log(c−1 H )N ρ∗(N + log(N)d′)  . While the time and space complexity grows with the time horizon T, the dependence is mild; log log(T) and log(T), respectively. QGLOC uses d′ = d + d2,6 and GLOC-TS uses d′ = d′. While both achieve a time complexity sublinear in N, the time complexity of GLOC-TS scales with d that is better than scaling with d2 of QGLOC. However, GLOC-TS has a d1/4-factor worse regret bound than QGLOC. Discussion While it is reasonable to incur small errors in solving the arm selection criteria like (10) and sacrifice some regret in practice, the regret bounds of QGLOC and GLOC-TS do not hold anymore. Though not the focus of our paper, we prove a regret bound under the presence of the hashing error in the fixed budget setting for QGLOC; see SM. Although the result therein has an inefficient space complexity that is linear in T, it provides the first low regret bound with time sublinear in N, to our knowledge. 5 Approximate Inner Product Computations with L1 Sampling L2 L1 -5 0 5 100 101 102 103 d 0.7 0.8 0.9 1 (a) (b) Figure 1: (a) A box plot of estimators. L1 and L2 have the same variance, but L2 has thicker tails. (b) The frequency of L1 inducing smaller variance than L2 in 1000 trials. After 100 dimensions, L1 mostly has smaller variance than L2. While hashing allows a time complexity sublinear in N, it performs an additional computation for determining the hash keys. Consider a hashing with U tables and length-k hash keys. Given a query q and projection vectors a(1), . . . , a(Uk), the hashing computes q⊤a(i), ∀i ∈[Uk] to determine the hash key of q. To reduce such an overhead, approximate inner product methods like [22, 24] are attractive since hash keys are determined by discretizing the inner products; small inner product errors often do not alter the hash keys. In this section, we propose an improved approximate inner product method called L1 sampling which we claim is more accurate than the sampling proposed by Jain et al. [22], which we call L2 sampling. Consider an inner product q⊤a. The main idea is to construct an unbiased estimate of q⊤a. That is, let p ∈Rd be a probability vector. Let ik i.i.d. ∼Multinomial(p) and Gk := qikaik/pik, k ∈[m] . (11) It is easy to see that EGk = q⊤a. By taking 1 m Pm k=1 Gk as an estimate of q⊤a, the time complexity is now O(mUk) rather than O(d′Uk). The key is to choose the right p. L2 sampling uses p(L2) := [q2 i /||q||2 2]i. Departing from L2, we propose p(L1) that we call L1 sampling and define as follows: p(L1) := [|q1|; · · · ; |qd′|]/||q||1 . (12) We compare L1 with L2 in two different point of view. Due to space constraints, we summarize the key ideas and defer the details to SM. The first is on their concentration of measure. Lemma 1 below shows an error bound of L1 whose failure probability decays exponentially in m. This is in contrast to decaying polynomially of L2 [22], which is inferior.7 Lemma 1. Define Gk as in (11) with p = p(L1). Then, given a target error ϵ > 0, P 1 m Pm k=1 Gk −q⊤a ≥ϵ  ≤2 exp  − mϵ2 2||q||2 1||a||2max  (13) To illustrate such a difference, we fix q and a in 1000 dimension and apply L2 and L1 sampling 20K times each with m = 5 where we scale down the L2 distribution so its variance matches that of L1. 6 Note that this does not mean we need to store vec(xx⊤) since an inner product with it is structured. 7 In fact, one can show a bound for L2 that fails with exponentially-decaying probability. However, the bound introduces a constant that can be arbitrarily large, which makes the tails thick. We provide details on this in SM. 7 Algorithm Cum. Regret QGLOC 266.6 (±19.7) QGLOC-Hash 285.0 (±30.3) GLOC-TS 277.0 (±36.1) GLOC-TS-Hash 289.1 (±28.1) (a) (b) (c) Figure 2: Cumulative regrets with confidence intervals under the (a) logit and (b) probit model. (c) Cumulative regrets with confidence intervals of hash-amenable algorithms. Figure 1(a) shows that L2 has thicker tails than L1. Note this is not a pathological case but a typical case for Gaussian q and a. This confirms our claim that L1 is safer than L2. Another point of comparison is the variance of L2 and L1. We show that the variance of L1 may or may not be larger than L2 in SM; there is no absolute winner. However, if q and a follow a Gaussian distribution, then L1 induces smaller variances than L2 for large enough d; see Lemma 9 in SM. Figure 1(b) confirms such a result. The actual gap between the variance of L2 and L1 is also nontrivial under the Gaussian assumption. For instance, with d = 200, the average variance of Gk induced by L2 is 0.99 whereas that induced by L1 is 0.63 on average. Although a stochastic assumption on the vectors being inner-producted is often unrealistic, in our work we deal with projection vectors a that are truly normally distributed. 6 Experiments We now show our experiment results comparing GLB algorithms and hash-amenable algorithms. GLB Algorithms We compare GLOC with two different algorithms: UCB-GLM [28] and Online Learning for Logit Model (OL2M) [41].8 For each trial, we draw θ∗∈Rd and N arms (X) uniformly at random from the unit sphere. We set d = 10 and Xt = X, ∀t ≥1. Note it is a common practice to scale the confidence set radius for bandits [8, 27]. Following Zhang et al. [41], for OL2M we set the squared radius γt = c log(det(Zt)/det(Z1)), where c is a tuning parameter. For UCB-GLM, we set the radius as α = √cd log t. For GLOC, we replace βONS t with c Pt s=1 g2 s||xs||2 A−1 s . While parameter tuning in practice is nontrivial, for the sake of comparison we tune c ∈{101, 100.5, . . . , 10−3} and report the best one. We perform 40 trials up to time T = 3000 for each method and compute confidence bounds on the regret. We consider two GLM rewards: (i) the logit model (the Bernoulli GLM) and (ii) the probit model (non-canonical GLM) for 0/1 rewards that sets µ as the probit function. Since OL2M is for the logit model only, we expect to see the consequences of model mismatch in the probit setting. For GLOC and UCB-GLM, we specify the correct reward model. We plot the cumulative regret under the logit model in Figure 2(a). All three methods perform similarly, and we do not find any statistically significant difference based on paired t test. The result for the probit model in Figure 2(b) shows that OL2M indeed has higher regret than both GLOC and UCB-GLM due to the model mismatch in the probit setting. Specifically, we verify that at t = 3000 the difference between the regret of UCB-GLM and OL2M is statistically significant. Furthermore, OL2M exhibits a significantly higher variance in the regret, which is unattractive in practice. This shows the importance of being generalizable to any GLM reward. Note we observe a big increase in running time for UCB-GLM compared to OL2M and GLOC. Hash-Amenable GLBs To compare hash-amenable GLBs, we use the logit model as above but now with N=100,000 and T=5000. We run QGLOC, QGLOC with hashing (QGLOC-Hash), GLOC-TS, and GLOC-TS with hashing (GLOC-TS-Hash), where we use the hashing to compute the objective function (e.g., (10)) on just 1% of the data points and save a significant amount of computation. Details on our hashing implementation is found in SM. Figure 2(c) summarizes the result. We observe that QGLOC-Hash and GLOC-TS-Hash increase regret from QGLOC and GLOC-TS, respectively, but only moderately, which shows the efficacy of hashing. 7 Future Work In this paper, we have proposed scalable algorithms for the GLB problem: (i) for large time horizon T and (ii) for large number N of arms. There exists a number of interesting future work. First, 8We have chosen UCB-GLM over GLM-UCB of Filippi et al. [15] as UCB-GLM has a lower regret bound. 8 we would like to extend the GLM rewards to the single index models [23] so one does not need to know the function µ ahead of time under mild assumptions. Second, closing the regret bound gap between QGLOC and GLOC without loosing hash-amenability would be interesting: i.e., develop a hash-amenable GLB algorithm with O(d √ T) regret. In this direction, a first attempt could be to design a hashing scheme that can directly solve (7) approximately. Acknowledgments This work was partially supported by the NSF grant IIS-1447449 and the MURI grant 2015-05174-04. The authors thank Yasin Abbasi-Yadkori and Anshumali Shrivastava for providing constructive feedback and Xin Hunt for her contribution at the initial stage. References [1] Abbasi-Yadkori, Yasin, Pal, David, and Szepesvari, Csaba. Improved Algorithms for Linear Stochastic Bandits. Advances in Neural Information Processing Systems (NIPS), pp. 1–19, 2011. [2] Abbasi-Yadkori, Yasin, Pal, David, and Szepesvari, Csaba. Online-to-Confidence-Set Conversions and Application to Sparse Stochastic Bandits. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), 2012. [3] Abeille, Marc and Lazaric, Alessandro. Linear Thompson Sampling Revisited. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), volume 54, pp. 176–184, 2017. [4] Agrawal, Shipra and Goyal, Navin. Thompson Sampling for Contextual Bandits with Linear Payoffs. CoRR, abs/1209.3, 2012. [5] Agrawal, Shipra and Goyal, Navin. Thompson Sampling for Contextual Bandits with Linear Payoffs. In Proceedings of the International Conference on Machine Learning (ICML), pp. 127–135, 2013. [6] Ahukorala, Kumaripaba, Medlar, Alan, Ilves, Kalle, and Glowacka, Dorota. Balancing Exploration and Exploitation: Empirical Parameterization of Exploratory Search Systems. In Proceedings of the ACM International Conference on Information and Knowledge Management (CIKM), pp. 1703–1706, 2015. [7] Auer, Peter and Long, M. Using Confidence Bounds for Exploitation-Exploration Trade-offs. Journal of Machine Learning Research, 3:397–422, 2002. [8] Chapelle, Olivier and Li, Lihong. An Empirical Evaluation of Thompson Sampling. In Advances in Neural Information Processing Systems (NIPS), pp. 2249–2257, 2011. [9] Chu, Wei, Li, Lihong, Reyzin, Lev, and Schapire, Robert E. Contextual Bandits with Linear Payoff Functions. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), volume 15, pp. 208–214, 2011. [10] Crammer, Koby and Gentile, Claudio. Multiclass Classification with Bandit Feedback Using Adaptive Regularization. Mach. Learn., 90(3):347–383, 2013. [11] Dani, Varsha, Hayes, Thomas P, and Kakade, Sham M. Stochastic Linear Optimization under Bandit Feedback. In Proceedings of the Conference on Learning Theory (COLT), pp. 355–366, 2008. [12] Datar, Mayur, Immorlica, Nicole, Indyk, Piotr, and Mirrokni, Vahab S. Locality-sensitive Hashing Scheme Based on P-stable Distributions. In Proceedings of the Twentieth Annual Symposium on Computational Geometry, pp. 253–262, 2004. [13] Dekel, Ofer, Gentile, Claudio, and Sridharan, Karthik. Robust selective sampling from single and multiple teachers. In In Proceedings of the Conference on Learning Theory (COLT), 2010. [14] Dekel, Ofer, Gentile, Claudio, and Sridharan, Karthik. Selective sampling and active learning from single and multiple teachers. Journal of Machine Learning Research, 13:2655–2697, 2012. 9 [15] Filippi, Sarah, Cappe, Olivier, Garivier, Aurélien, and Szepesvári, Csaba. Parametric Bandits: The Generalized Linear Case. In Advances in Neural Information Processing Systems (NIPS), pp. 586–594. 2010. [16] Gentile, Claudio and Orabona, Francesco. On Multilabel Classification and Ranking with Bandit Feedback. Journal of Machine Learning Research, 15:2451–2487, 2014. [17] Guo, Ruiqi, Kumar, Sanjiv, Choromanski, Krzysztof, and Simcha, David. Quantization based Fast Inner Product Search. Journal of Machine Learning Research, 41:482–490, 2016. [18] Har-Peled, Sariel, Indyk, Piotr, and Motwani, Rajeev. Approximate nearest neighbor: towards removing the curse of dimensionality. Theory of Computing, 8:321–350, 2012. [19] Hazan, Elad and Karnin, Zohar. Volumetric Spanners: An Efficient Exploration Basis for Learning. Journal of Machine Learning Research, 17(119):1–34, 2016. [20] Hazan, Elad, Agarwal, Amit, and Kale, Satyen. Logarithmic Regret Algorithms for Online Convex Optimization. Mach. Learn., 69(2-3):169–192, 2007. [21] Hofmann, Katja, Whiteson, Shimon, and de Rijke, Maarten. Contextual Bandits for Information Retrieval. In NIPS Workshop on Bayesian Optimization, Experimental Design and Bandits: Theory and Applications, 2011. [22] Jain, Prateek, Vijayanarasimhan, Sudheendra, and Grauman, Kristen. Hashing Hyperplane Queries to Near Points with Applications to Large-Scale Active Learning. In Advances in Neural Information Processing Systems (NIPS), pp. 928–936, 2010. [23] Kalai, Adam Tauman and Sastry, Ravi. The Isotron Algorithm: High-Dimensional Isotonic Regression. In Proceedings of the Conference on Learning Theory (COLT), 2009. [24] Kannan, Ravindran, Vempala, Santosh, and Others. Spectral algorithms. Foundations and Trends in Theoretical Computer Science, 4(3–4):157–288, 2009. [25] Konyushkova, Ksenia and Glowacka, Dorota. Content-based image retrieval with hierarchical Gaussian Process bandits with self-organizing maps. In 21st European Symposium on Artificial Neural Networks, 2013. [26] Li, Lihong, Chu, Wei, Langford, John, and Schapire, Robert E. A Contextual-Bandit Approach to Personalized News Article Recommendation. Proceedings of the International Conference on World Wide Web (WWW), pp. 661–670, 2010. [27] Li, Lihong, Chu, Wei, Langford, John, Moon, Taesup, and Wang, Xuanhui. 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, pp. 19–36, 2012. [28] Li, Lihong, Lu, Yu, and Zhou, Dengyong. Provable Optimal Algorithms for Generalized Linear Contextual Bandits. CoRR, abs/1703.0, 2017. [29] McCullagh, P and Nelder, J A. Generalized Linear Models. London, 1989. [30] Neyshabur, Behnam and Srebro, Nathan. On Symmetric and Asymmetric LSHs for Inner Product Search. Proceedings of the International Conference on Machine Learning (ICML), 37: 1926–1934, 2015. [31] Orabona, Francesco, Cesa-Bianchi, Nicolo, and Gentile, Claudio. Beyond Logarithmic Bounds in Online Learning. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), volume 22, pp. 823–831, 2012. [32] Qin, Lijing, Chen, Shouyuan, and Zhu, Xiaoyan. Contextual Combinatorial Bandit and its Application on Diversified Online Recommendation. In SDM, pp. 461–469, 2014. [33] Rui, Yong, Huang, T S, Ortega, M, and Mehrotra, S. Relevance feedback: a power tool for interactive content-based image retrieval. IEEE Transactions on Circuits and Systems for Video Technology, 8(5):644–655, 1998. 10 [34] Rusmevichientong, Paat and Tsitsiklis, John N. Linearly Parameterized Bandits. Math. Oper. Res., 35(2):395–411, 2010. [35] Shrivastava, Anshumali and Li, Ping. Asymmetric LSH ( ALSH ) for Sublinear Time Maximum Inner Product Search ( MIPS ). Advances in Neural Information Processing Systems 27, pp. 2321–2329, 2014. [36] Shrivastava, Anshumali and Li, Ping. Improved Asymmetric Locality Sensitive Hashing (ALSH) for Maximum Inner Product Search (MIPS). In Proceedings of the Conference on Uncertainty in Artificial Intelligence (UAI), pp. 812–821, 2015. [37] Slaney, Malcolm, Lifshits, Yury, and He, Junfeng. Optimal parameters for locality-sensitive hashing. Proceedings of the IEEE, 100(9):2604–2623, 2012. [38] Wainwright, Martin J and Jordan, Michael I. Graphical Models, Exponential Families, and Variational Inference. Found. Trends Mach. Learn., 1(1-2):1–305, 2008. [39] Wang, Jingdong, Shen, Heng Tao, Song, Jingkuan, and Ji, Jianqiu. Hashing for Similarity Search: A Survey. CoRR, abs/1408.2, 2014. [40] Yue, Yisong, Hong, Sue Ann Sa, and Guestrin, Carlos. Hierarchical exploration for accelerating contextual bandits. Proceedings of the International Conference on Machine Learning (ICML), pp. 1895–1902, 2012. [41] Zhang, Lijun, Yang, Tianbao, Jin, Rong, Xiao, Yichi, and Zhou, Zhi-hua. Online Stochastic Linear Optimization under One-bit Feedback. In Proceedings of the International Conference on Machine Learning (ICML), volume 48, pp. 392–401, 2016. 11
2017
106
6,571
Experimental Design for Learning Causal Graphs with Latent Variables Murat Kocaoglu⇤ Department of Electrical and Computer Engineering The University of Texas at Austin, USA mkocaoglu@utexas.edu Karthikeyan Shanmugam⇤ IBM Research NY, USA karthikeyan.shanmugam2@ibm.com Elias Bareinboim Department of Computer Science and Statistics Purdue University, USA eb@purdue.edu Abstract We consider the problem of learning causal structures with latent variables using interventions. Our objective is not only to learn the causal graph between the observed variables, but to locate unobserved variables that could confound the relationship between observables. Our approach is stage-wise: We first learn the observable graph, i.e., the induced graph between observable variables. Next we learn the existence and location of the latent variables given the observable graph. We propose an efficient randomized algorithm that can learn the observable graph using O(d log2 n) interventions where d is the degree of the graph. We further propose an efficient deterministic variant which uses O(log n + l) interventions, where l is the longest directed path in the graph. Next, we propose an algorithm that uses only O(d2 log n) interventions that can learn the latents between both nonadjacent and adjacent variables. While a naive baseline approach would require O(n2) interventions, our combined algorithm can learn the causal graph with latents using O(d log2 n + d2 log (n)) interventions. 1 Introduction Causality shapes how we view, understand, and react to the world around us. It is arguably a key ingredient in building intelligent systems that are autonomous and can act efficiently in complex environments. Not surprisingly, the task of automating the learning of cause-and-effect relationships have attracted great interest in the artificial intelligence and machine learning communities. This effort has led to a general theoretical and algorithmic understanding of the assumptions under which causeand-effect relationships can be inferred from data. These results have started to percolate through the applied fields ranging from genetics to medicine, from psychology to economics [5, 26, 33, 25]. The endeavour of algorithmically learning causal relations may have started from the independent discovery of the IC [35] and PC algorithms [33], which almost identically, and contrary to previously held beliefs, showed the feasibility of recovering these relations from purely observational, nonexperimental data. A plethora of methods followed this breakthrough, and now we understand, at least in principle, the limits of what can be inferred from purely observational data, including (not exhaustively) [31, 14, 21, 27, 19, 13]. There are a number of assumptions that have been considered about the data-generating model when attempting to unveil the causal structure. One of the most ⇤Equal contribution. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. popular assumptions is that the data-generating model is causally sufficient, which means that no latent (unmeasured) variable affects more than one observed variable. In practice, this is a very stringent condition since the existence of latents affecting more than one observed variable, and generating what is called confounding bias, is one of the main concerns of empirical scientists. The problem of causation is deemed challenging in most of the empirical fields because scientists recognize that not all the variables influencing the observed phenomenon can be measured. The general question that arises is then how much of the observed behavior of the system is truly causal, or whether it is due to some external, unobserved forces [26, 5]. To account for the latent variables in the context of structural learning, the IC* [35] and FCI [33] algorithms were introduced, which showed the possibility of recovering causal structures even when latent variables may be confounding the observed behavior 2. One of the main challenges faced by these algorithms is that although some ancestral relations as well as certain causal edges can be learned [36, 7], many observationally equivalent architectures cannot be distinguished. Despite the practical challenges when collecting the data (e.g., finite samples, selection bias, missing data), we now have a complete characterization of what structures are recoverable from observational data based on conditional independence constraints [33, 2, 37]. Inferences will be constrained within an equivalence class. Initial works leveraged ideas of experimental design and the availability of interventional data to move from the equivalence class to a specific graph, but almost exclusively considering causally sufficient systems [9, 15, 11, 12, 30, 18]. For causally insufficient systems, there is a growing interest in identifying experimental quantities and structures based on partially observed interventional data [4, 32, 29, 28, 24, 16, 8, 34, 22], but without the goal of designing the optimal set of interventions. Perhaps the most relevant paper to our setup is [23]. Authors identify the experiments needed to learn the causal graph under latents, given the output of FCI algorithm. However, they are not interested in minimizing the number of experiments. In this paper, we propose the first efficient non-parametric algorithm for learning a causal graph with latent variables. It is known that log(n) interventions are necessary (across all graphs) and sufficient to learn a causal graph without latent variables [12], and we show, perhaps surprisingly, that there exists an algorithm that can learn any causal graph with latent variables which requires poly(log n) interventions when the observable graph is sparse. More specifically, our contributions are as follow: • We introduce a deterministic 3 algorithm that can learn any causal graph and the existence and location of the latent variables using O(d log(n) + l) interventions, where d is the largest node degree and l is the longest directed path of the causal graph. • We design a randomized algorithm that can learn the observable graph and all the latent variables using O(d log2(n) + d2 log(n)) interventions with high probability, where d is the largest node degree. The first algorithm is useful in practical settings where the longest directed path is not very deep, e.g., O(log(n)). This includes bipartite, time-series, and relational type of domains where the underlying causal topology is somewhat sparse. As an example application, consider the problem of inferring the causal effect of a set of genes on a set of phenotypes, that could be cast as learning a bipartite causal system. For the more general setting, we introduce a randomized algorithm that with high probability is capable of unveiling the true causal structure. Background We assume for simplicity that all the random variables are discrete. We use the language of Structural Causal Models (SCM) [26, pp. 204-207]. Formally, an SCM M is a 4-tuple hU, V, F, P(u)i, where U is a set of exogenous (unobserved, latent) variables, V is a set of endogenous (measured) variables. We partition the set of exogenous variables into two disjoint sets: Exogenous variables with one observable child, denoted by E, exogenous variables with two observable children, denoted by L. F = {fi} is a collection of functions such that each endogenous variable Vi 2 V is determined by a function fi 2 F: Each fi is a mapping from the respective domain of the exogenous variables associated with Vi and a set of observable variables associated with Vi, called PAi, into Vi. The 2Hereafter, latent variable refers to any unmeasured variable that affects more than one observed variable. 3We assume access to an oracle that outputs a size-O(d2 log (n)) independent set cover for the non-edges of a given graph. This oracle can be implemented using another randomized algorithm as we explain in Section 5. 2 set of exogenous variables associated with Vi can be divided into two classes, the one with a single observable child, denoted by Ei 2 E, and those with two observable children, denoted by Li ✓L. Hence fi maps from the domain of Ei [ PAi [ Li to Vi. The entire set F forms a mapping from U to V. The uncertainty is encoded through a product probability distribution over the exogenous variables P(E, L). For simplicity we refer to L as the set of latents, and E as the set of exogenous variables. Within the structural semantics, performing an action S = s is represented through the do-operator, do(S = s), which encodes the operation of replacing the original equation of S by the constant s and induces a submodel MS (also for when S is not a singleton). We denote the post-interventional distribution by PS(·). For a detailed discussion on the properties of structural models, we refer readers to [5, 23, 24, Ch. 7]. Define D` = (V [ L, E`) to be the causal graph with latents. We define the observable graph to be the induced subgraph on V which is D = (V, E). In practice, we use an independent random variable Wi taking values uniformly at random in the state space of Vi, to implement an intervention do(Vi). A conditional independence statement, e.g., X is independent from Y given Z ⇢V with respect to causal model MS, in shown by (X ?? Y |Z)MS, or (X ?? Y |Z)S when the causal model is clear from the context. These conditional independencies are with respect to the post-interventional joint probability distribution PS(·). In this paper, we assume that an oracle to conditional independence (CI) tests is available. The mutilated or post-interventional causal graph, denoted D`[S] = (V [ L, E`[S]), is identical to D` except that all the incoming edges incident on any vertex in the interventional set S is absent, i.e., E`[S] = E` −{(Y, V ) : V 2 S, (Y, V ) 2 E`}. We define the transitive closure, denoted Dtc, of an observable causal DAG D as follows: If there is a directed path from Vi to Vj in D, there is a directed edge from Vi to Vj in Dtc. Essentially, a directed edge in Dtc represents an ancestral relation in D. For any DAG D = (V, E), a set of nodes S ⇢V d-separates two nodes a and b if and only if S blocks all paths between a and b. ‘Blocking’ is a graphical criterion associated with d-separation 4. A probability distribution is said to be faithful (or stable) to a graph, if and only if every conditional independence statement can be read off from the graph using d-separation, see [26, Ch. 2] for a review. We assume that faithfulness holds in the observational and post-interventional distributions following [12]. Results and outline of the paper The skeleton of the proposed learning algorithms can be split into 3 steps, namely: ; (a) −! Transitive Closure (b) −! Observable graph (c) −! Observable graph with Latent variables Each step requires different tools and graph theoretic concepts: (a) We use a pairwise independence test under interventions that reveals the ancestral relations. This is combined in an efficient manner with separating systems to discover the transitive closure of D in O(log n) interventions. (b) We rely on the transitive reduction of directed acyclic graphs that can be efficiently computed only from their transitive closure. A key property we observe is that the transitive reduction reveals a subset of the true edges. For our randomized algorithm, we use a sequence of transitive reductions computed from transitive closures (obtained using step (a)) of different post-interventional graphs. (c) Given the observable graph, it is possible to discover latents between non-adjacent nodes using CI tests under suitable interventions. We use an edge-clique cover on the complement graph to optimize the number of experiments. For latents between adjacent nodes, we use a relatively unknown test called the do-see test, i.e., leveraging the equivalence between observing and intervening on the node. We implement it using induced matching cover of the observable graph. The modularity of our approach allows us to solve subproblems: given the ancestral graph, we can use (b) to discover the observable graph D. If D is known, we can learn the latents with (c). Some pictorial illustrations of the main results in the technical sections are found in the full version [20]. 2 Identifying the Observable Graph: A simple baseline We discuss a natural and a simple deterministic baseline algorithm that finds the observable graph with experiments when confounders are present. To our knowledge, a provably complete algorithm 4For convenience, detailed definitions of blocking and non-blocking paths are provided in the full version [20]. 3 that recovers the observable graph under this setting and is superior than this simple baseline in the worst case is not known. We start from the following observation. Suppose X ! Y where X, Y are observable variables and let L be a latent variable such that L ! X, L ! Y . Consider the post interventional graph D`[{X}] where we intervene on X. It is easy to see that, X and Y are dependent in the post interventional graph too because of the direct causal relationship. However, if X is not a parent of Y , then in the post interventional graph D`[{X}] even with or without the latent L between X and Y , X is independent of Y since X is intervened on. It is possible to recreate this condition between any target variable Y and any one of its direct parents X when many other observable variables are involved. Simply, we consider the post-interventional graph where we intervene on all observable variables but Y . In D`[V −{Y }], Y and X are dependent if and only if X ! Y is a directed edge in the observable graph D, because every variable except X becomes independent of all other variables in the post interventional graph. Therefore, one needs n interventions, each of size n−1 to find out the parent set of every node. We basically show in the next two sections that when the graph D has constant degree, it is enough to do O(log2(n)) interventions representing the first provably exponential improvement. 3 Learning Ancestral Relations In this section, we show that separating systems can be used to construct sequences of pairwise CI tests to discover the transitive closure of the observable causal graph, i.e., the graph that captures all ancestral relations. The following lemma relates post-interventional statistical dependencies with the ancestral relations in the graph with latents. Lemma 1. [Pairwise Conditional Independence Test] Consider a causal graph with latents D`. Consider an intervention on the set S ⇢V of observable variables. Then, under the post-interventional faithfulness assumption, for any pair Xi 2 S, Xj 2 V\S, (Xi 6?? Xj)D`[S] if and only if Xi is an ancestor of Xj in the post-interventional observable graph D[S]. Lemma 1 constitutes, for any ordered pair of variables (Xi, Xj) in the observable graph D, a test for whether Xi is an ancestor of Xj or not. Note that a single test is not sufficient to discover the ancestral relation between a pair (Xi, Xj), e.g., if Xi ! Xk ! Xj and Xi, Xk 2 S, Xj /2 S, the ancestral relation will not be discovered. This issue can be resolved by using a sequence of interventions guided by a separating system, and later finding the transitive closure of the learned graph. Separating systems were first defined by [17], and has been subsequently used in the context of experimental design [10]. A separating system on a ground set S is a collection of subsets of S, S = {S1, S2 . . .} such that for every pair (i, j), there is a set that contains only one, i.e., 9k such that i 2 Sk, j /2 Sk or j 2 Sk, i /2 Sk. We require a stronger notion which is captured by a strongly separating system. Definition 1. An (m, n) strongly separating system is a family of subsets {S1, S2 . . . Sm} of the ground set [n] such that for any two pairs of nodes i and j, there is a set S in the family such that i 2 S, j /2 S and also another set S0 such that i /2 S0, j 2 S0. Similar to separating systems, one can construct strongly separating systems using O(log(n)) subsets: Lemma 2. An (m, n) strong separating system exists on a ground set [n] where m 2dlog ne. We propose Algorithm 1 to discover the ancestral relations between the observable variables. It uses the subsets of a strongly separating system on the ground set of all observable variables as intervention sets, to assure that the ancestral relation between every ordered pair of observable variables is tested. The following theorem shows the number of experiments and the soundness of Algorithm 1. Theorem 1. Algorithm 1 requires only 2dlog ne interventions and conditional independence tests on samples obtained from each post-interventional distribution and outputs the transitive closure Dtc. 4 Learning the Observable Graph We introduce a deterministic and a randomized algorithm for learning the observable causal graph D from ancestral relations. D encodes every direct causal connection between the observable nodes. 4 Algorithm 1 LearnAncestralRelations- Given access to a conditional independence testing oracle (CI oracle), query access to samples from any post-interventional causal model derived out of M (with causal graph D`), outputs all ancestral relationships between observable variables, i.e., Dtc 1: function LEARNANCESTRALRELATIONS(M) 2: E = ;. 3: Consider a strongly sep. system of size 2 log n on the ground set V - {S1, S2..S2dlog ne}. 4: for i in [1 : 2dlog ne] do 5: Intervene on the set Si of nodes. 6: for X 2 Si, Y /2 Si, Y 2 V do 7: Use samples from MSi and use the CI-oracle to test the following. 8: if (X 6?? Y )D`[S] then 9: E E [ (X, Y ). 10: end if 11: end for 12: end for 13: return The transitive closure of the graph (V, E) 14: end function 4.1 A Deterministic Algorithm Based on Section 3, assume that we are given the transitive closure of the observable graph. We show in Lemma 3 that, when the intervention set contains all parents of Xi, the only variables dependent with Xi in the post-interventional observable graph are the parents of Xi in the observable graph. Lemma 3. For variable Xi, consider an intervention on S where Pai ⇢S. Then {Xj 2 S : (Xi 6?? Xj)D[S]} = Pai. Let the longest directed path of Dtc be r. Consider the partial order <Dtc implied by Dtc on the vertex set V. Define {Ti : i 2 [r + 1]} as the unique partitioning of vertices of Dtc where Ti <Dtc Tj, 8i < j and each node in Ti is a set of mutually incomparable elements. In other words, Ti are the set of nodes at layer i of the transitive closure graph Dtc. Define Ti = [i−1 k=1Tk. We have the following observation: Pai ⇢Ti. This paves the way for Algorithm 2 that leverages Lemma 3. Algorithm 2 LearnObservableGraph/Deterministic - Given the ancestral graph, access to a conditional independence testing oracle (CI oracle) and outputs the graph induced on observable nodes. 1: function LEARNOBSERVABLEGRAPH/DETERIMINISTIC(M) 2: E = ;. 3: for i in {r + 1, r, r −1, . . . , 2} do 4: Intervene on the set Ti of nodes. 5: Use samples from MTi and use the CI-oracle to test the following. 6: for X in Ti do 7: if (X 6?? Y )D`[Ti] then 8: E E [ (X, Y ). 9: end if 10: end for 11: end for 12: return Observable graph 13: end function The correctness of Algorithm 2 follows from Lemma 3, which is stated explicitly in the sequel. Theorem 2. Let r be the length of the longest directed path in the causal graph D`. Algorithm 2 requires only r interventions and conditional independence tests on samples obtained from each one of the post-interventional distributions and outputs the observable graph D. 4.2 A Randomized Algorithm We propose a randomized algorithm that repeatedly uses the ancestor graph learning algorithm from Section 3 to learn the observable graph 5. A key structure that we use is the transitive reduction: 5Note that this algorithm does not require learning the ancestral graph first. 5 V1 V2 V3 V4 (a) (b) Observable Graph D Post-interventional graph D[{V2}] After intervention on V2 V1 V2 V3 V4 Transitive reduction of D (c) V1 V2 V3 V4 Transitive reduction of D[{V2}] (d) V1 V2 V3 V4 Figure 1: Illustration of Lemma 5 - (a) An example of an observable graph D without latents (b): Transitive reduction of D. The highlighted red edge (V1, V3) has not been revealed under the operation of transitive reduction. c) Intervention on node V2 and its post interventional graph D[{V2}] d) Since all parents of V3 above V1 in the partial order have been intervened on, by Lemma 5, the edge (V1, V3) is revealed in the transitive reduction of D[{V2}]. Definition 2 (Transitive Reduction). Given a directed acyclic graph D = (V, E), let its transitive closure be Dtc. Then Tr(D) = (V, Er) is a directed acyclic graph with minimum number of edges such that its transitive closure is identical to Dtc. Lemma 4. [1] Tr(D) is known to be unique if D is acyclic. Further, the set of directed edges of Tr(D) is a subset of the directed edges of D, i.e., Er ⇢E. Computing Tr(D) from D takes the same time as transitive closure of a DAG D, which takes time poly(n). We note that Tr(D) = Tr(Dtc). Now, we provide an algorithm that outputs an observable graph based on samples from the post-interventional distribution after a sequence of interventions. Let us assume an ordering ⇡on the observable vertices V that satisfies the partial order relationships in the observable causal graph D. The key insight behind the algorithm is given by the following Lemma. Lemma 5. Consider an intervention on a set S ⇢V of nodes in the observable causal graph D. Consider the post-interventional observable causal graph D[S]. Suppose for a specific observable node Vi, Vi 2 Sc. Let Y be a direct parent of Vi in D such that all the direct parents of Vi above Y in the partial order6 ⇡(·) is in S, i.e., {X : ⇡(X) > ⇡(Y ), (X, V ) 2 D} ✓S. Then, Tr(D[S]) will contain the directed edge (Y, Vi) and it can be computed from Tr((D[S])tc) We illustrated Lemma 5 through an example in Figure 1. The red edge in Figure 1(a) is not revealed in the transitive reduction. The edge is revealed when computing the transitive reduction of the post-interventional graph D[{V2}]. This is possible because all parents of V3 above V1 in the partial order (in this case node V2) have been intervened on. Lemma 5 motivates Algorithm 3. The basic idea is to intervene in randomly, then compute the transitive closure of the post-interventional graph using the algorithm in the previous section, compute the transitive reduction, and then accumulate all the edges found in the transitive reduction at every stage. We will show in Theorem 3 that with high probability, the observable graph can be recovered. Theorem 3. Let dmax be greater than the maximum in-degree in the observable graph D. Algorithm 3 requires at most 8cdmax(log n)2 interventions and CI tests on samples obtained from post-interventional distributions, and outputs the observable graph with probability at least 1 − 1 nc−2 . Remark. The above algorithm takes as input a parameter dmax that needs to be estimated. One practical option is to gradually increase dmax and run Algorithm 3. 6The nodes above with respect to the partial order of a graph are those that are closer to the source nodes. 6 Algorithm 3 LearnObservable- Given access to a conditional independence testing oracle (CI oracle), a parameter dmax outputs induced subgraph between observable variables, i.e. D 1: function LEARNOBSERVABLE/RANDOMIZED(M, dmax) 2: E = ;. 3: for i in [1 : c ⇤4 ⇤dmax log n] do 4: S = ;. 5: for V 2 V do 6: S S [ V randomly with probability 1 −1/dmax. 7: end for 8: ˆDS = LearnAncestralRelations(M). Let ˆD = (V, ˆE). 9: Compute the transitive reduction of ˆD(Tr( ˆDS)) according to the algorithm in [1]. 10: Add the edges of the transitive reduction to the set E if not already there, i.e. E E [ ˆE. 11: end for 12: return The directed graph (V, E). 13: end function 5 Learning Latents from the Observable Graph The final stage of our framework is learning the existence and location of latent variables given the observable graph. We divide this problem into two steps – first, we devise an algorithm that can learn the latent variables between any two variables that are non-adjacent in the observable graph; later, we design an algorithm that learns the latent variables between every pair of adjacent variables. 5.1 Baseline Algorithm for Detecting Latents between Non-edges Consider two variables X and Y such that X L ! Y and where L is a latent variable. Clearly, to distinguish it from the case where X and Y are disconnected and have no latents, one needs check if X 6?? Y or not. This is a conditional independence test. For any non edge (X, Y ) in the observable graph D, when the observable graph D is known, to check for latents between them, when other variables and possible confounders are around, one has to simply intervene on the rest of the n −2 variables and do a independence test between X and Y in the post interventional graph. This requires a distinct intervention for every pair of variables. If the observable graph has maximum degree d = o(n), this requires ⇥(n2) interventions. We will reduce this to O(d2 log n) interventions which is an exponential improvement for constant degree graphs. 5.2 Latents between Non-adjacent Nodes We start by noting the following fact about causal systems with latent variables: Theorem 4. Consider two non-adjacent nodes Xi, Xj. Let S be the union of the parents of Xi, Xj, S = Pai [ Paj. Consider an intervention on S. Then we have (Xi 6?? Xj)MS if and only if there exists a latent variable Li,j such that Xj Li,j ! Xi. The statement holds under an intervention S such that Pai [ Paj ⇢S, Xi, Xj /2 S. The above theorem motivates the following approach: For a set of nodes which forms an independent set, an intervention on the union of parents of the nodes of the independent set allows us to learn the latents between any two nodes in the independent set. We leverage this observation using the following lemma on the number of such independent sets needed to cover all non-edges. Lemma 6. Consider a directed acyclic graph D = (V, E) with degree (out-degree+in-degree) d. Then there exists a randomized algorithm that returns a family of m = O(4e2(d + 1)2 log(n)) independent sets I = {I1, I2, . . . , Im} that cover all non-edges of D: 8i, j such that (Xi, Xj) /2 E and (Xj, Xi) /2 E, 9k 2 [m] such that Xi 2 Ik and Xj 2 Ik, with probability at least 1 − 1 n2 . Note that this is a randomized construction and we are not aware of any deterministic construction. Our deterministic causal learning algorithm requires oracle access to such a famiy of independent sets, whereas our randomized algorithm can directly use this randomized construction. Now, we use this observation to construct a procedure to identify latents between non-edges (see Algorithm 4). The following theorem about its performance follows from Lemma 6 and Theorem 4. 7 Algorithm 4 LearnLatentNonEdge- Given access to a CI oracle, observable graph D with max degree d (in-degree+out-degree), outputs all latents between non-edges 1: function LEARNLATENTNONEDGE(M, dmax) 2: L = ;. 3: Apply the randomized algorithm in Lemma 6 to find a family of independent sets I = {I1, I2, . . . , Im} that cover all non-edges in D such that m 4e2(d + 1)2 log(n). 4: for j 2 [1 : m] do 5: Intervene on the parent set of the nodes in Ij. 6: for every pair of nodes X, Y in Ij do 7: if (X 6?? Y )D`[Ij] then 8: L L [ {X, Y }. 9: end if 10: end for 11: end for 12: return The set of non-edges L. 13: end function G1: do(PaX) is needed G2: do(PaY) is needed T Z X Y U L Z X Y M L M Figure 2: Left: A graph where intervention on the parents of X is needed for do-see test to succeed. Right: A graph where intervention on the parents of Y is needed for do-see test to succeed. Theorem 5. Algorithm 4 outputs a list of non-edges L that have latent variables between them, given the observable graph D, with probability at least 1 − 1 n2 . The algorithm requires 4e2(d + 1)2 log(n) interventions where d is the max-degree (in-degree+out-degree) of the observable graph. 5.3 Latents between Adjacent Nodes We construct an algorithm that can learn latent variables between the variables adjacent in the observable graph. Note that the approach of CIT testing in the post-interventional graph is not helpful. Consider the variables X ! Y . To see the effect of the latent path, one needs to cut the direct edge from X to Y . This requires intervening on Y . However, such an intervention disconnects Y from its latent parent. Thus we resort to a different approach compared to the previous stages and exploit a different characterization of causal Bayesian networks called a ‘do-see’ test. A do-see test can be described as follows: Consider again a graph where X ! Y . If there are no latents, we have P(Y |X) = P(Y |do(X)). Assume that there is a latent variable Z which causes both X and Y , then excepting the pathological cases7, P(Y |X) 6= P(Y |do(X)). Figure 2 illustrates the challenges associated with a do-see test in bigger graphs with latents. Graphs G1 and G2 are examples where parents of both nodes involved in the test need to be included in the intervention set for the Do-see test to work. In G1, suppose we condition on X, as required by the ‘see’ test. This opens up a non-blocking path X −U −T −M −Y . Since X ! Y is not the only d-connecting path, it is not necessarily true that P(Y |X) = P(Y |do(X)). Now suppose we perform the do-see test under the intervention do(Z). Then the aforementioned path is closed since X is not a descendant of T in the post interventional graph. Hence we have P(Y |X, do(Z)) = P(Y |do(X, Z)). Similarly G2 shows that intervening on the parent set of Y is also necessary. We have the following theorem, which shows that we can perform the do-see test between X, Y under do(PaX, PaY ): 7These cases are fully identified in the full version [20]. 8 Theorem 6. [Interventional Do-see test] Consider a causal graph D on the set of observable variables V = {Vi}i2[n] and latent variables L = {Li}i2[m] with edge set E. If (Vi, Vj) 2 E, then Pr(Vj|Vi = vi, do(Pai = pai, Paj = paj)) = Pr(Vj|do(Vi = vi, Pai = pai, Paj = paj)), iff @k such that (Lk, Vi) 2 E and (Lk, Vj) 2 E, where Pai is the set of parents of Vi in V . Quantities on both sides are invariant irrespective of additional interventions elsewhere. Next we need a subgraph structure to perform multiple do-see tests at once in order to efficiently discover the latents between the adjacent nodes. Performing the test for every edge would take O(n) even in graphs with constant degree. We use strong edge coloring of sparse graphs. Definition 3. A strong edge coloring of an undirected graph with k colors is a map χ : E ! [k] such that every color class is an induced matching. Equivalently, it is an edge coloring such that any two nodes adjacent to distinct edges with the same color are non-adjacent. Graphs of maximum degree d can be strongly edge-colored with at most 2d2 colors. Lemma 7. [6] A graph of maximum degree d can be strongly edge-colored with at most 2d2 colors. A simple greedy algorithm that colors edges in sequence achieves this. Now observe that a color class of the edges forms an induced matching. We show that due to this, the ‘do’ part (RHS of Theorem 6) of all the do-see tests in a color class can be performed with a single intervention while the ‘see’ part (RHS of Theorem 6) can be again performed with another intervention. We argue that we need exactly two different interventions per color class. The following theorem uses this property to prove correctness of Algorithm 5. Algorithm 5 LearnLatentEdge- Observable graph D with max degree d (in-degree+out-degree), outputs all latents between edges 1: function LEARNLATENTEDGE(M, d) 2: L = ;. 3: Apply the greedy algorithm in Lemma 7 to color the edges of D with k 2d2 colors. 4: for j 2 [1 : k] do 5: Let Aj be the nodes involved with the edges that form color class j. Let Pj be the union of parents of all nodes in Aj except the nodes in Aj. 6: Let the set of tail nodes of all edges be Tj. 7: Following loop requires the intervention on the set Tj [ Pj, i.e. do({Tj, Pj}). 8: for Every directed edge (Vt, Vh) in color class j do 9: Calculate S(Vt, Vh) = P(Vh|do(Tj, Pj)) using post interventional samples. 10: end for 11: Following loop requires the intervention on the set Pj. 12: for Every directed edge (Vt, Vh) in color class j do 13: Calculate S0(Vt, Vh) = P(Vh|Vt, do(Pj)) using post interventional samples. 14: if S0(Vt, Vh) 6= S(Vt, Vh) then 15: L L [ (Vt, Vh) 16: end if 17: end for 18: end for 19: return The set of edges L that have latents between them. 20: end function Theorem 7. Algorithm 5 requires at most 4d2 interventions and outputs all latents between the edges in the observable graph. 6 Conclusions Learning cause-and-effect relations is one of the fundamental challenges in science. We studied the problem of learning causal models with latent variables using experimental data. Specifically, we introduced two efficient algorithms capable of learning direct causal relations (instead of ancestral relations) and finding the existence and location of potential latent variables. 9 References [1] Alfred V. Aho, Michael R Garey, and Jeffrey D. Ullman. The transitive reduction of a directed graph. SIAM Journal on Computing, 1(2):131–137, 1972. [2] Ayesha R. Ali, Thomas S. Richardson, Peter L. Spirtes, and Jiji Zhang. Towards characterizing markov equivalence classes for directed acyclic graphs with latent variables. In Proc. of the Uncertainty in Artificial Intelligence, 2005. [3] Noga Alon. Covering graphs by the minimum number of equivalence relations. Combinatorica, 6(3):201–206, 1986. [4] E. Bareinboim and J. Pearl. Causal inference by surrogate experiments: z-identifiability. In Nando de Freitas and Kevin Murphy, editors, Proceedings of the Twenty-Eighth Conference on Uncertainty in Artificial Intelligence, pages 113–120, Corvallis, OR, 2012. AUAI Press. [5] E. Bareinboim and J. Pearl. Causal inference and the data-fusion problem. Proceedings of the National Academy of Sciences, 113:7345–7352, 2016. [6] Julien Bensmail, Marthe Bonamy, and Hervé Hocquard. Strong edge coloring sparse graphs. Electronic Notes in Discrete Mathematics, 49:773–778, 2015. [7] Sofia Borboudakis, Giorgos andTriantafillou and Ioannis Tsamardinos. Tools and algorithms for causally interpreting directed edges in maximal ancestral graphs. In Sixth European Workshop on Probabilistic Graphical Models, 2012. [8] Tom Claassen and Tom Heskes. Causal discovery in multiple models from different experiments. In Advances in Neural Information Processing Systems, pages 415–423, 2010. [9] Frederick Eberhardt. Phd thesis. Causation and Intervention (Ph.D. Thesis), 2007. [10] Frederick Eberhardt and Richard Scheines. Interventions and causal inference. Philosophy of Science, 74(5):981–995, 2007. [11] Alain Hauser and Peter Bühlmann. Characterization and greedy learning of interventional markov equivalence classes of directed acyclic graphs. Journal of Machine Learning Research, 13(1):2409–2464, 2012. [12] Alain Hauser and Peter Bühlmann. Two optimal strategies for active learning of causal networks from interventional data. In Proceedings of Sixth European Workshop on Probabilistic Graphical Models, 2012. [13] Christina Heinze-Deml, Marloes H. Maathuis, and Nicolai Meinshausen. Causal structure learning. Annual Review of Statistics and Its Applications, 2017, To appear. [14] Patrik O Hoyer, Dominik Janzing, Joris Mooij, Jonas Peters, and Bernhard Schölkopf. Nonlinear causal discovery with additive noise models. In Proceedings of NIPS 2008, 2008. [15] Antti Hyttinen, Frederick Eberhardt, and Patrik Hoyer. Experiment selection for causal discovery. Journal of Machine Learning Research, 14:3041–3071, 2013. [16] Antti Hyttinen, Patrik O Hoyer, Frederick Eberhardt, and Matti Jarvisalo. Discovering cyclic causal models with latent variables: A general sat-based procedure. arXiv preprint arXiv:1309.6836, 2013. [17] Gyula Katona. On separating systems of a finite set. Journal of Combinatorial Theory, 1(2):174–194, 1966. [18] Murat Kocaoglu, Alexandros G. Dimakis, and Sriram Vishwanath. Cost-optimal learning of causal graphs. In ICML’17, 2017. [19] Murat Kocaoglu, Alexandros G. Dimakis, Sriram Vishwanath, and Babak Hassibi. Entropic causal inference. In AAAI’17, 2017. 10 [20] Murat Kocaoglu*, Karthikeyan Shanmugam*, and Elias Bareinboim. Experimental design for learning causal graphs with latent variables. Technical Report R-28, AI Lab, Purdue University, https://www.cs.purdue.edu/homes/eb/r28.pdf, 2017. [21] Po-Ling Loh and Peter Bühlmann. High-dimensional learning of linear causal networks via inverse covariance estimation. Journal of Machine Learning Research, 5:3065–3105, 2014. [22] Sara Magliacane, Tom Claassen, and Joris M Mooij. Joint causal inference on observational and experimental datasets. arXiv preprint arXiv:1611.10351, 2016. [23] Stijn Meganck, Sam Maes, Philippe Leray, and Bernard Manderick. Learning semi-markovian causal models using experiments. In Proceedings of The third European Workshop on Probabilistic Graphical Models , PGM 06, 2006. [24] Pekka Parviainen and Mikko Koivisto. Ancestor relations in the presence of unobserved variables. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2011. [25] J. Pearl, M. Glymour, and N.P. Jewell. Causal Inference in Statistics: A Primer. Wiley, 2016. [26] Judea Pearl. Causality: Models, Reasoning and Inference. Cambridge University Press, 2009. [27] Jonas Peters and Peter Bühlman. Identifiability of gaussian structural equation models with equal error variances. Biometrika, 101:219–228, 2014. [28] Jonas Peters, Peter Bühlmann, and Nicolai Meinshausen. Causal inference using invariant prediction: identification and confidence intervals. Statistical Methodology, Series B, 78:947 – 1012, 2016. [29] Bernhard Schölkopf, David W. Hogg, Dun Wang, Daniel Foreman-Mackey, Dominik Janzing, Carl-Johann Simon-Gabriel, and Jonas Peters. Removing systematic errors for exoplanet search via latent causes. In Proceedings of the 32 nd International Conference on Machine Learning, 2015. [30] Karthikeyan Shanmugam, Murat Kocaoglu, Alex Dimakis, and Sriram Vishwanath. Learning causal graphs with small interventions. In NIPS 2015, 2015. [31] S Shimizu, P. O Hoyer, A Hyvarinen, and A. J Kerminen. A linear non-gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7:2003––2030, 2006. [32] Ricardo Silva, Richard Scheines, Clark Glymour, and Peter Spirtes. Learning the structure of linear latent variable models. Journal of Machine Learning Research, 7:191–246, 2006. [33] Peter Spirtes, Clark Glymour, and Richard Scheines. Causation, Prediction, and Search. A Bradford Book, 2001. [34] Sofia Triantafillou and Ioannis Tsamardinos. Constraint-based causal discovery from multiple interventions over overlapping variable sets. Journal of Machine Learning Research, 16:2147– 2205, 2015. [35] Thomas Verma and Judea Pearl. An algorithm for deciding if a set of observed independencies has a causal explanation. In Proceedings of the Eighth international conference on uncertainty in artificial intelligence, 1992. [36] Jiji Zhang. Causal reasoning with ancestral graphs. J. Mach. Learn. Res., 9:1437–1474, June 2008. [37] Jiji Zhang. On the completeness of orientation rules for causal discovery in the presence of latent confounders and selection bias. Artificial Intelligence, 172(16):1873–1896, 2008. 11
2017
107
6,572
Lower bounds on the robustness to adversarial perturbations Jonathan Peck1,2, Joris Roels2,3, Bart Goossens3, and Yvan Saeys1,2 1Department of Applied Mathematics, Computer Science and Statistics, Ghent University, Ghent, 9000, Belgium 2Data Mining and Modeling for Biomedicine, VIB Inflammation Research Center, Ghent, 9052, Belgium 3Department of Telecommunications and Information Processing, Ghent University, Ghent, 9000, Belgium Abstract The input-output mappings learned by state-of-the-art neural networks are significantly discontinuous. It is possible to cause a neural network used for image recognition to misclassify its input by applying very specific, hardly perceptible perturbations to the input, called adversarial perturbations. Many hypotheses have been proposed to explain the existence of these peculiar samples as well as several methods to mitigate them, but a proven explanation remains elusive. In this work, we take steps towards a formal characterization of adversarial perturbations by deriving lower bounds on the magnitudes of perturbations necessary to change the classification of neural networks. The proposed bounds can be computed efficiently, requiring time at most linear in the number of parameters and hyperparameters of the model for any given sample. This makes them suitable for use in model selection, when one wishes to find out which of several proposed classifiers is most robust to adversarial perturbations. They may also be used as a basis for developing techniques to increase the robustness of classifiers, since they enjoy the theoretical guarantee that no adversarial perturbation could possibly be any smaller than the quantities provided by the bounds. We experimentally verify the bounds on the MNIST and CIFAR-10 data sets and find no violations. Additionally, the experimental results suggest that very small adversarial perturbations may occur with non-zero probability on natural samples. 1 Introduction Despite their big successes in various AI tasks, neural networks are basically black boxes: there is no clear fundamental explanation how they are able to outperform the more classical approaches. This has led to the identification of several unexpected and counter-intuitive properties of neural networks. In particular, Szegedy et al. [2014] discovered that the input-output mappings learned by state-of-theart neural networks are significantly discontinuous. It is possible to cause a neural network used for image recognition to misclassify its input by applying a very specific, hardly perceptible perturbation to the input. Szegedy et al. [2014] call these perturbations adversarial perturbations, and the inputs resulting from applying them to natural samples are called adversarial examples. In this paper, we hope to shed more light on the nature and cause of adversarial examples by deriving lower bounds on the magnitudes of perturbations necessary to change the classification of neural network classifiers. Such lower bounds are indispensable for developing rigorous methods that increase the robustness of classifiers without sacrificing accuracy. Since the bounds enjoy the theoretical guarantee that no adversarial perturbation could ever be any smaller, a method which increases these lower bounds potentially makes the classifier more robust. They may also aid model selection: if the bounds can be computed efficiently, then one can use them to compare different 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. models with respect to their robustness to adversarial perturbations and select the model that scores the highest in this regard without the need for extensive empirical tests. The rest of the paper is organized as follows. Section 2 discusses related work that has been done on the phenomenon of adversarial perturbations; Section 3 details the theoretical framework used to prove the lower bounds; Section 4 proves lower bounds on the robustness of different families of classifiers to adversarial perturbations; Section 5 empirically verifies that the bounds are not violated; Section 6 concludes the paper and provides avenues for future work. 2 Related work Since the puzzling discovery of adversarial perturbations, several hypotheses have been proposed to explain why they exist, as well as a number of methods to make classifiers more robust to them. 2.1 Hypotheses The leading hypothesis explaining the cause of adversarial perturbations is the linearity hypothesis by Goodfellow et al. [2015]. According this view, neural network classifiers tend to act very linearly on their input data despite the presence of non-linear transformations within their layers. Since the input data on which modern classifiers operate is often very high in dimensionality, such linear behavior can cause minute perturbations to the input to have a large impact on the output. In this vein, Lou et al. [2016] propose a variant of the linearity hypothesis which claims that neural network classifiers operate highly linearly on certain regions of their inputs, but non-linearly in other regions. Rozsa et al. [2016] conjecture that adversarial examples exist because of evolutionary stalling: during training, the gradients of samples that are classified correctly diminish, so the learning algorithm “stalls” and does not create significantly flat regions around the training samples. As such, most of the training samples will lie close to some decision boundary, and only a small perturbation is required to push them into a different class. 2.2 Proposed solutions Gu and Rigazio [2014] propose the Deep Contractive Network, which includes a smoothness penalty in the training procedure inspired by the Contractive Autoencoder. This penalty encourages the Jacobian of the network to have small components, thus making the network robust to small changes in the input. Based on their linearity hypothesis, Goodfellow et al. [2015] propose the fast gradient sign method for efficiently generating adversarial examples. They then use this method as a regularizer during training in an attempt to make networks more robust. Lou et al. [2016] use their “local linearity hypothesis” as the basis for training neural network classifiers using foveations, i.e. a transformation which selects certain regions from the input and discards all other information. Rozsa et al. [2016] introduce Batch-Adjusted Network Gradients (BANG) based on their idea of evolutionary stalling. BANG normalizes the gradients on a per-minibatch basis so that even correctly classified samples retain significant gradients and the learning algorithm does not stall. The solutions proposed above provide attractive intuitive explanations for the cause of adversarial examples, and empirical results seem to suggest that they are effective at eliminating them. However, none of the hypotheses on which these methods are based have been formally proven. Hence, even with the protections discussed above, it may still be possible to generate adversarial examples for classifiers using techniques which defy the proposed hypotheses. As such, there is a need to formally characterize the nature of adversarial examples. Fawzi et al. [2016] take a step in this direction by deriving precise bounds on the norms of adversarial perturbations of arbitrary classifiers in terms of the curvature of the decision boundary. Their analysis encourages to impose geometric constraints on this curvature in order to improve robustness. However, it is not obvious how such constraints relate to the parameters of the models and hence how one would best implement such constraints in practice. In this work, we derive lower bounds on the robustness of neural networks directly in terms of their model parameters. We consider only feedforward networks comprised of convolutional layers, pooling layers, fully-connected layers and softmax layers. 2 3 Theoretical framework The theoretical framework used in this paper draws heavily from Fawzi et al. [2016] and Papernot et al. [2016]. In the following, ∥·∥denotes the Euclidean norm and ∥·∥F denotes the Frobenius norm. We assume we want to train a classifier f : Rd →{1, . . . , C} to correctly assign one of C different classes to input vectors x from a d-dimensional Euclidean space. Let µ denote the probability measure on Rd and let f ⋆be an oracle that always returns the correct label for any input. The distribution µ is assumed to be of bounded support, i.e. Px∼µ(x ∈X) = 1 with X = {x ∈Rd | ∥x∥≤M} for some M > 0. Formally, adversarial perturbations are defined relative to a classifier f and an input x. A perturbation η is called an adversarial perturbation of x for f if f(x + η) ̸= f(x) while f ⋆(x + η) = f ⋆(x). An adversarial perturbation η is called minimal if no other adversarial perturbation ξ for x and f satisfies ∥ξ∥< ∥η∥. In this work, we will focus on minimal adversarial perturbations. The robustness of a classifier f is defined as the expected norm of the smallest perturbation necessary to change the classification of an arbitrary input x sampled from µ: ρadv(f) = Ex∼µ[∆adv(x; f)], where ∆adv(x; f) = min η∈Rd{∥η∥| f(x + η) ̸= f(x)}. A multi-index is a tuple of non-negative integers, generally denoted by Greek letters such as α and β. For a multi-index α = (α1, . . . , αm) and a function f we define |α| = α1 + · · · + αn, ∂αf = ∂|α|f ∂xα1 1 . . . ∂xαn n . The Jacobian matrix of a function f : Rn →Rm : x 7→[f1(x), . . . , fm(x)]T is defined as ∂ ∂xf =   ∂f1 ∂x1 . . . ∂f1 ∂xn ... ... ... ∂fm ∂x1 . . . ∂fm ∂xn  . 3.1 Families of classifiers The derivation of the lower bounds will be built up incrementally. We will start with the family of linear classifiers, which are among the simplest. Then, we extend the analysis to Multi-Layer Perceptrons, which are the oldest neural network architectures. Finally, we analyze Convolutional Neural Networks. In this section, we introduce each of these families of classifiers in turn. A linear classifier is a classifier f of the form f(x) = arg max i=1,...,Cwi · x + bi. The vectors wi are called weights and the scalars bi are called biases. A Multi-Layer Perceptron (MLP) is a classifier given by f(x) = arg max i=1,...,C softmax(hL(x))i, hL(x) = gL(VLhL−1(x) + bL), ... h1(x) = g1(V1x + b1). An MLP is nothing more than a series of linear transformations Vlhl−1(x) + bl followed by nonlinear activation functions gl (e.g. a ReLU [Glorot et al., 2011]). Here, softmax is the softmax function: softmax(y)i = exp(wi · y + bi) P j exp(wj · y + bj). 3 This function is a popular choice as the final layer for an MLP used for classification, but it is by no means the only possibility. Note that having a softmax as the final layer essentially turns the network into a linear classifier of the output of its penultimate layer, hL(x). A Convolutional Neural Network (CNN) is a neural network that uses at least one convolution operation. For an input tensor X ∈Rc×d×d and a kernel tensor W ∈Rk×c×q×q, the discrete convolution of X and W is given by (X ⋆W)ijk = c X n=1 q X m=1 q X l=1 wi,n,m,lxn,m+s(q−1),l+s(q−1). Here, s is the stride of the convolution. The output of such a layer is a 3D tensor of size k × t × t where t = d−q s + 1. After the convolution operation, usually a bias b ∈Rk is added to each of the feature maps. The different components (W ⋆X)i constitute the feature maps of this convolutional layer. In a slight abuse of notation, we will write W ⋆X + b to signify the tensor W ⋆X where each of the k feature maps has its respective bias added in: (W ⋆X + b)ijk = (W ⋆X)ijk + bi. CNNs also often employ pooling layers, which perform a sort of dimensionality reduction. If we write the output of a pooling layer as Z(X), then we have zijk(X) = p({xi,n+s(j−1),m+s(k−1) | 1 ≤n, m ≤q}). Here, p is the pooling operation, s is the stride and q is a parameter. The output tensor Z(X) has dimensions c × t × t. For ease of notation, we assume each pooling operation has an associated function I such that zijk(X) = p({xinm | (n, m) ∈I(j, k)}). In the literature, the set I(j, k) is referred to as the receptive field of the pooling layer. Each receptive field corresponds to some q × q region in the input X. Common pooling operations include taking the maximum of all inputs, averaging the inputs and taking an Lp norm of the inputs. 4 Lower bounds on classifier robustness Comparing the architectures of several practical CNNs such as LeNet [Lecun et al., 1998], AlexNet [Krizhevsky et al., 2012], VGGNet [Simonyan and Zisserman, 2015], GoogLeNet [Szegedy et al., 2015] and ResNet [He et al., 2016], it would seem the only useful approach is a “modular” one. If we succeed in lower-bounding the robustness of some layer given the robustness of the next layer, we can work our way backwards through the network, starting at the output layer and going backwards until we reach the input layer. That way, our approach can be applied to any feedforward neural network as long as the robustness bounds of the different layer types have been established. To be precise, if a given layer computes a function h of its input y and if the following layer has a robustness bound of κ in the sense that any adversarial perturbation to this layer has a Euclidean norm of at least κ, then we want to find a perturbation r such that ∥h(y + r)∥= ∥h(y)∥+ κ. This is clearly a necessary condition for any adversarial perturbation to the given layer. Hence, any adversarial perturbation q to this layer will satisfy ∥q∥≥∥r∥. Of course, the output layer of the network will require special treatment. For softmax output layers, κ is the norm of the smallest perturbation necessary to change the maximal component of the classification vector. The obvious downside of this idea is that we most likely introduce cumulative approximation errors which increase as the number of layers of the network increases. In turn, however, we get a flexible and efficient framework which can handle any feedforward architecture composed of known layer types. 4.1 Softmax output layers We now want to find the smallest perturbation r to the input x of a softmax layer such that f(x+r) ̸= f(x). It can be proven (Theorem A.3) that any such perturbation satisfies ∥r∥≥min c′̸=c |(wc′ −wc) · x + bc′ −bc| ∥wc′ −wc∥ , where f(x) = c. Moreover, there exist classifiers for which this bound is tight (Theorem A.4). 4 4.2 Fully-connected layers To analyze the robustness of fully-connected layers to adversarial perturbations, we assume the next layer has a robustness of κ (this will usually be the softmax output layer, however there exist CNNs which employ fully-connected layers in other locations than just at the end [Lin et al., 2014]). We then want to find a perturbation r such that ∥hL(x + r)∥= ∥hL(x)∥+ κ. We find Theorem 4.1. Let hL : Rd →Rn be twice differentiable with second-order derivatives bounded by M. Then for any x ∈Rd, ∥r∥≥ q ∥J(x)∥2 + 2M√nκ −∥J(x)∥ M√n , (1) where J(x) is the Jacobian matrix of hL at x. The proof can be found in Appendix A. In Theorem A.5 it is proved that the assumptions on hL are usually satisfied in practice. The proof of this theorem also yields an efficient algorithm for approximating M, a task which otherwise might involve a prohibitively expensive optimization problem. 4.3 Convolutional layers The next layer of the network is assumed to have a robustness bound of κ, in the sense that any adversarial perturbation Q to X must satisfy ∥Q∥F ≥κ. We can now attempt to bound the norm of a perturbation R to X such that ∥ReLU(W ⋆(X + R) + b)∥F = ∥ReLU(W ⋆X + b)∥F + κ. We find Theorem 4.2. Consider a convolutional layer with filter tensor W ∈Rk×c×q×q and stride s whose input consists of a 3D tensor X ∈Rc×d×d. Suppose the next layer has a robustness bound of κ, then any adversarial perturbation to the input of this layer must satisfy ∥R∥F ≥ κ ∥W∥F . (2) The proof of Theorem 4.2 can be found in Appendix A. 4.4 Pooling layers To facilitate the analysis of the pooling layers, we make the following assumption which is satisfied by the most common pooling operations (see Appendix B): Assumption 4.3. The pooling operation satisfies zijk(X + R) ≤zijk(X) + zijk(R). We have Theorem 4.4. Consider a pooling layer whose operation satisfies Assumption 4.3. Let the input be of size c × d × d and the receptive field of size q × q. Let the output be of size c × t × t. If the robustness bound of the next layer is κ, then the following bounds hold for any adversarial perturbation R: • MAX or average pooling: ∥R∥F ≥κ t . (3) • Lp pooling: ∥R∥F ≥ κ tq 2/p . (4) Proof can be found in Appendix A. 5 Figure 1: Illustration of LeNet architecture. Image taken from Lecun et al. [1998]. Table 1: Normalized summary of norms of adversarial perturbations found by FGS on MNIST and CIFAR-10 test sets Data set Mean Median Std Min Max MNIST 0.933448 0.884287 0.4655439 0.000023 3.306903 CIFAR-10 0.0218984 0.0091399 0.06103627 0.0000012 1.6975207 5 Experimental results We tested the theoretical bounds on the MNIST and CIFAR-10 test sets using the Caffe [Jia et al., 2014] implementation of LeNet [Lecun et al., 1998]. The MNIST data set [LeCun et al., 1998] consists of 70,000 28 × 28 images of handwritten digits; the CIFAR-10 data set [Krizhevsky and Hinton, 2009] consists of 60,000 32 × 32 RGB images of various natural scenes, each belonging to one of ten possible classes. The architecture of LeNet is depicted in Figure 1. The kernels of the two convolutional layers will be written as W1 and W2, respectively. The output sizes of the two pooling layers will be written as t1 and t2. The function computed by the first fully-connected layer will be denoted by h with Jacobian J. The last fully-connected layer has a weight matrix V and bias vector b. For an input sample x, the theoretical lower bound on the adversarial robustness of the network with respect to x is given by κ1, where κ6 = min c′̸=c |(vc′ −vc) · x + bc′ −bc| ∥vc′ −vc∥ , κ5 = q ∥J(x)∥2 + 2M √ 500κ6 −∥J(x)∥ M √ 500 , κ4 = κ5 t2 , κ3 = κ4 ∥W2∥F , κ2 = κ3 t1 , κ1 = κ2 ∥W1∥F . Because our method only computes norms and does not provide a way to generate actual adversarial perturbations, we used the fast gradient sign method (FGS) [Goodfellow et al., 2015] to adversarially perturb each sample in the test sets in order to assess the tightness of our theoretical bounds. FGS linearizes the cost function of the network to obtain an estimated perturbation η = εsign∇xL(x, θ). Here, ε > 0 is a parameter of the algorithm, L is the loss function and θ is the set of parameters of the network. The magnitudes of the perturbations found by FGS depend on the choice of ε, so we had to minimize this value in order to obtain the smallest perturbations the FGS method could supply. This was accomplished using a simple binary search for the smallest value of ε which still resulted in misclassification. As the MNIST and CIFAR-10 samples have pixel values within the range [0, 255], we upper-bounded ε by 100. No violations of the bounds were detected in our experiments. Figure 2 shows histograms of the norms of adversarial perturbations found by FGS and Table 1 summarizes their statistics. Histograms of the theoretical bounds of all samples in the test set are shown in Figure 3; their statistics are summarized in Table 2. Note that the statistics of Tables 1 and 2 have been normalized by dividing them by the dimensionality of their respective data sets (i.e. 28 × 28 for MNIST and 3 × 32 × 32 for CIFAR-10) to allow for a meaningful comparison between the two networks. Figure 4 provides histograms of the per-sample log-ratio between the norms of the adversarial perturbations and their corresponding theoretical lower bounds. 6 (a) MNIST (b) CIFAR-10 Figure 2: Histograms of norms of adversarial perturbations found by FGS on MNIST and CIFAR-10 test sets (a) MNIST (b) CIFAR-10 Figure 3: Histograms of theoretical bounds on MNIST and CIFAR-10 test sets Although the theoretical bounds on average deviate considerably from the perturbations found by FGS, one has to take into consideration that the theoretical bounds were constructed to provide a worst-case estimate for the norms of adversarial perturbations. These estimates may not hold for all (or even most) input samples. Furthermore, the smallest perturbations we were able to generate on the two data sets have norms that are much closer to the theoretical bound than their averages (0.0179 for MNIST and 0.0000012 for CIFAR-10). This indicates that the theoretical bound is not necessarily very loose, but rather that very small adversarial perturbations occur with non-zero probability on natural samples. Note also that the FGS method does not necessarily generate minimal perturbations even with the smallest choice of ε: the method depends on the linearity hypothesis and uses a first-order Taylor approximation of the loss function. Higher-order methods may find much smaller perturbations by exploiting non-linearities in the network, but these are generally much less efficient than FGS. There is a striking difference in magnitude between MNIST and CIFAR-10 of both the empirical and theoretical perturbations: the perturbations on MNIST are much larger than the ones found for Table 2: Normalized summary of theoretical bounds on MNIST and CIFAR-10 test sets Data set Mean Median Std Min Max MNIST 7.274e−8 6.547e−8 4.229566e−8 4.073e−10 2.932e−7 CIFAR-10 4.812e−13 4.445e−13 2.605381e−13 7.563e−15 2.098e−12 7 (a) MNIST (b) CIFAR-10 Figure 4: Histograms of the per-sample log-ratio between adversarial perturbation and lower bound for MNIST and CIFAR-10 test sets. A higher ratio indicates a bigger deviation of the theoretical bound from the empirical norm. CIFAR-10. This result can be explained by the linearity hypothesis of Goodfellow et al. [2015]. The input samples of CIFAR-10 are much larger in dimensionality than MNIST samples, so the linearity hypothesis correctly predicts that networks trained on CIFAR-10 are more susceptible to adversarial perturbations due to the highly linear behavior these classifiers are conjectured to exhibit. However, these differences may also be related to the fact that LeNet achieves much lower accuracy on the CIFAR-10 data set than it does on MNIST (over 99% on MNIST compared to about 60% on CIFAR-10). 6 Conclusion and future work Despite attracting a significant amount of research interest, a precise characterization of adversarial examples remains elusive. In this paper, we derived lower bounds on the norms of adversarial perturbations in terms of the model parameters of feedforward neural network classifiers consisting of convolutional layers, pooling layers, fully-connected layers and softmax layers. The bounds can be computed efficiently and thus may serve as an aid in model selection or the development of methods to increase the robustness of classifiers. They enable one to assess the robustness of a classifier without running extensive tests, so they can be used to compare different models and quickly select the one with highest robustness. Furthermore, the bounds enjoy a theoretical guarantee that no adversarial perturbation could ever be smaller, so methods which increase these bounds may make classifiers more robust. We tested the validity of our bounds on MNIST and CIFAR-10 and found no violations. Comparisons with adversarial perturbations generated using the fast gradient sign method suggest that these bounds can be close to the actual norms in the worst case. We have only derived lower bounds for feedforward networks consisting of fully-connected layers, convolutional layers and pooling layers. Extending this analysis to recurrent networks and other types of layers such as Batch Normalization [Ioffe and Szegedy, 2015] and Local Response Normalization [Krizhevsky et al., 2012] is an obvious avenue for future work. It would also be interesting to quantify just how tight the above bounds really are. In the absence of a precise characterization of adversarial examples, the only way to do this would be to generate adversarial perturbations using optimization techniques that make no assumptions on their underlying cause. Szegedy et al. [2014] use a box-constrained L-BFGS approach to generate adversarial examples without any assumptions, so using this method for comparison could provide a more accurate picture of how tight the theoretical bounds are. It is much less efficient than the FGS method, however. The analysis presented here is a “modular” one: we consider each layer in isolation, and derive bounds on their robustness in terms of the robustness of the next layer. However, it may also be insightful to study the relationship between the number of layers, the breadth of each layer and the robustness of the network. Providing estimates on the approximation errors incurred by this layer-wise approach could also be useful. 8 Finally, there is currently no known precise characterization of the trade-off between classifier robustness and accuracy. Intuitively, one might expect that as the robustness of the classifier increases, its accuracy will also increase up to a point since it is becoming more robust to adversarial perturbations. Once the robustness exceeds a certain threshold, however, we expect the accuracy to drop because the decision surfaces are becoming too flat and the classifier becomes too insensitive to changes. Having a precise characterization of this relationship between robustness and accuracy may aid methods designed to protect classifiers against adversarial examples while also maintaining state-of-the-art accuracy. References A. Fawzi, S.-M. Moosavi-Dezfooli, and P. Frossard. Robustness of classifiers: from adversarial to random noise. In Proceedings of Advances in Neural Information Processing Systems 29, pages 1632–1640. Curran Associates, Inc., 2016. X. Glorot, A. Bordes, and Y. Bengio. Deep sparse rectifier neural networks. In Proceedings of the Fourteenth International Conference on Artificial Intelligence and Statistics, volume 15 of Proceedings of Machine Learning Research, pages 315–323, Fort Lauderdale, FL, USA, 11–13 Apr 2011. PMLR. I. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In Proceedings of the Third International Conference on Learning Representations, volume 3 of Proceedings of the International Conference on Learning Representations, San Diego, CA, USA, 7–9 May 2015. ICLR. S. Gu and L. Rigazio. Towards deep neural network architectures robust to adversarial examples. NIPS Workshop on Deep Learning and Representation Learning, 2014. 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, Las Vegas, NV, USA, 26 Jun – 1 Jul 2016. CVPR. S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of the International Conference on Machine Learning, pages 448–456, Lille, 6–11 Jul 2015. JMLR. 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, pages 675–678. ACM, 2014. A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009. A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Proceedings of the 25th International Conference on Advances in Neural Information Processing Systems, volume 25 of Advances in Neural Information Processing Systems, pages 1097–1105, Lake Tahoe, USA, 3–8 Dec 2012. NIPS. Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, Nov 1998. Y. LeCun, C. Cortes, and C. J. Burges. The MNIST database of handwritten digits. http://yann. lecun.com/exdb/mnist/, 1998. Accessed 2017-04-17. M. Lin, Q. Chen, and S. Yan. Network in network. Proceedings of International Conference on Learning Representations, 2014. Y. Lou, X. Boix, G. Roig, T. Poggio, and Q. Zhao. Foveation-based mechanisms alleviate adversarial examples. arXiv preprint arXiv:1511.06292, 2016. N. Papernot, P. McDaniel, X. Wu, S. Jha, and A. Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pages 582–597, May 2016. 9 A. Rozsa, M. Gunther, and T. E. Boult. Towards robust deep neural networks with BANG. arXiv preprint arXiv:1612.00138, 2016. K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In Proceedings of the Third International Conference on Learning Representations, volume 3 of Proceedings of the International Conference on Learning Representations, San Diego, CA, USA, 7–9 May 2015. ICLR. C. Szegedy, W. Zaremba, and I. Sutskever. Intriguing properties of neural networks. In Proceedings of the Second International Conference on Learning Representations, volume 2 of Proceedings of the International Conference on Learning Representations, Banff, Canada, 14–16 Apr 2014. ICLR. C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Boston, MA, USA, 7-12 Jun 2015. CVPR. 10
2017
108
6,573
Reliable Decision Support using Counterfactual Models Peter Schulam Department of Computer Science Johns Hopkins University Baltimore, MD 21211 pschulam@cs.jhu.edu Suchi Saria Department of Computer Science Johns Hopkins University Baltimore, MD 21211 ssaria@cs.jhu.edu Abstract Decision-makers are faced with the challenge of estimating what is likely to happen when they take an action. For instance, if I choose not to treat this patient, are they likely to die? Practitioners commonly use supervised learning algorithms to fit predictive models that help decision-makers reason about likely future outcomes, but we show that this approach is unreliable, and sometimes even dangerous. The key issue is that supervised learning algorithms are highly sensitive to the policy used to choose actions in the training data, which causes the model to capture relationships that do not generalize. We propose using a different learning objective that predicts counterfactuals instead of predicting outcomes under an existing action policy as in supervised learning. To support decision-making in temporal settings, we introduce the Counterfactual Gaussian Process (CGP) to predict the counterfactual future progression of continuous-time trajectories under sequences of future actions. We demonstrate the benefits of the CGP on two important decision-support tasks: risk prediction and “what if?” reasoning for individualized treatment planning. 1 Introduction Decision-makers are faced with the challenge of estimating what is likely to happen when they take an action. One use of such an estimate is to evaluate risk; e.g. is this patient likely to die if I do not intervene? Another use is to perform “what if?” reasoning by comparing outcomes under alternative actions; e.g. would changing the color or text of an ad lead to more click-throughs? Practitioners commonly use supervised learning algorithms to help decision-makers answer such questions, but these decision-support tools are unreliable, and can even be dangerous. Consider, for instance, the finding discussed by Caruana et al. [2015] regarding risk of death among those who develop pneumonia. Their goal was to build a model that predicts risk of death for a hospitalized individual with pneumonia so that those at high-risk could be treated and those at low-risk could be safely sent home. Their model counterintuitively learned that asthmatics are less likely to die from pneumonia. They traced the result back to an existing policy that asthmatics with pneumonia should be directly admitted to the intensive care unit (ICU), therefore receiving more aggressive treatment. Had this model been deployed to assess risk, then asthmatics might have received less care, putting them at greater risk. Caruana et al. [2015] show how these counterintuitive relationships can be problematic and ought to be addressed by “repairing” the model. We note, however, that these issues stem from a deeper limitation: when training data is affected by actions, supervised learning algorithms capture relationships caused by action policies, and these relationships do not generalize when the policy changes. To build reliable models for decision support, we propose using learning objectives that predict counterfactuals, which are collections of random variables {Y [a] : a ∈C} used in the potential 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. ● ● ● ● ●●● ●●● 40 60 80 100 120 0 5 10 15 Years Since First Symptom PFVC ● ● ● ● ●●● ●●● 40 60 80 100 120 0 5 10 15 Years Since First Symptom PFVC E[Y [ ] | H] Lung Capacity ● ● ● ● ●●● ●●● 40 60 80 100 120 0 5 10 15 Years Since First Symptom PFVC History H Drug A Drug B E[Y [ ] | H] E[Y [ ] | H] (a) Years Since First Symptom (b) (c) E[Y [?] | H] E[Y [?] | H] E[Y [?] | H] Figure 1: Best viewed in color. An illustration of the counterfactual GP applied to health care. The red box in (a) shows previous lung capacity measurements (black dots) and treatments (the history). Panels (a)-(c) show the type of predictions we would like to make. We use Y [a] to represent the potential outcome under action a. outcomes framework [Neyman, 1923, 1990, Rubin, 1978]. Counterfactuals model the outcome Y after an action a is taken from a set of choices C. Counterfactual predictions are broadly applicable to a number of decision-support tasks. In medicine, for instance, when evaluating a patient’s risk of death Y to determine whether they should be treated aggressively, we want an estimate of how they will fare without treatment. This can be done by predicting the counterfactual Y [∅], where ∅stands for “do nothing”. In online marketing, to decide whether we should display ad a1 or a2, we may want an estimate of click-through Y under each, which amounts to predicting Y [a1] and Y [a2]. To support decision-making in temporal settings, we develop the Counterfactual Gaussian Process (CGP) to predict the counterfactual future progression of continuous-time trajectories under sequences of future actions. The CGP can be learned from and applied to time series data where actions are taken and outcomes are measured at irregular time points; a generalization of discrete time series. Figure 1 illustrates an application of the CGP. We show an individual with a lung disease, and would like to predict her future lung capacity (y-axis). Panel (a) shows the history in the red box, which includes previous lung capacity measurements (black dots) and previous treatments (green and blue bars). The blue counterfactual trajectory shows what might occur under no action, which can be used to evaluate this individual’s risk. In panel (b), we show the counterfactual trajectory under a single future green treatment. Panel (c) illustrates “what if?” reasoning by overlaying counterfactual trajectories under two different action sequences; in this case it seems that two future doses of the blue drug may lead to a better outcome than a single dose of green. Contributions. Our key methodological contribution is the Counterfactual Gaussian process (CGP), a model that predicts how a continuous-time trajectory will progress under sequences of actions. We derive an adjusted maximum likelihood objective that learns the CGP from observational traces; irregularly sampled sequences of actions and outcomes denoted using D = {{(yij, aij, tij)}ni j=1}m i=1, where yij ∈R ∪{∅}, aij ∈C ∪{∅}, and tij ∈[0, τ].1 Our objective accounts for and removes the effects of the policy used to choose actions in the observational traces. We derive the objective by jointly modeling observed actions and outcomes using a marked point process (MPP; see e.g., Daley and Vere-Jones 2007), and show how it correctly learns the CGP under a set of assumptions analagous to those required to learn counterfactual models in other settings. We demonstrate the CGP on two decision-support tasks. First, we show how the CGP can make reliable risk predictions that do not depend on the action policy in the training data. On the other hand, we show that predictions made by models trained using classical supervised learning objectives are sensitive to the policies. In our second experiment, we use data from a real intensive care unit (ICU) to learn the CGP, and qualitatively demonstrate how the CGP can be used to compare counterfactuals and answer “what if?” questions, which could offer medical decision-makers a powerful new tool for individualized treatment planning. 1.1 Related Work Decision support is a rich field; because our main methodological contribution is a counterfactual model for time series data, we limit the scope of our discussion of related work to this area. Causal inference. Counterfactual models stem from causal inference. In that literature, the difference between the counterfactual outcomes if an action had been taken and if it had not been taken 1yij and aij may be the null variable ∅to allow for the possibility that an action is taken but no outcome is observed and vice versa. [0, τ] denotes a fixed period of time over which the trajectories are observed. 2 is defined as the causal effect of the action (see e.g., Pearl 2009 or Morgan and Winship 2014). Potential outcomes are commonly used to formalize counterfactuals and obtain causal effect estimates [Neyman, 1923, 1990, Rubin, 1978]. Potential outcomes are often applied to cross-sectional data; see, for instance, the examples in Morgan and Winship 2014. Recent examples from the machine learning literature are Bottou et al. [2013] and Johansson et al. [2016]. Potential outcomes in discrete time. Potential outcomes have also been used to estimate the causal effect of a sequence of actions in discrete time on a final outcome (e.g. Robins 1986, Robins and Hernán 2009, Taubman et al. 2009). The key challenge in the sequential setting is to account for feedback between intermediate outcomes that determine future treatment. Conversely, Brodersen et al. [2015] estimate the effect that a single discrete intervention has on a discrete time series. Recent work on optimal dynamic treatment regimes uses the sequential potential outcomes framework proposed by Robins [1986] to learn lists of discrete-time treatment rules that optimize a scalar outcome. Algorithms for learning these rules often use action-value functions (Q-learning; e.g., Nahum-Shani et al. 2012). Alternatively, A-learning is a semiparametric approach that directly learns the relative difference in value between alternative actions [Murphy, 2003]. Potential outcomes in continuous time. Others have extended the potential outcomes framework in Robins [1986] to learn causal effects of actions taken in continuous-time on a single final outcome using observational data. Lok [2008] proposes an estimator based on structural nested models [Robins, 1992] that learns the instantaneous effect of administering a single type of treatment. Arjas and Parner [2004] develop an alternative framework for causal inference using Bayesian posterior predictive distributions to estimate the effects of actions in continuous time on a final outcome. Both Lok [2008] and Arjas and Parner [2004] use marked point processes to formalize assumptions that make it possible to learn causal effects from continuous-time observational data. We build on these ideas to learn causal effects of actions on continuous-time trajectories instead of a single outcome. There has also been recent work on building expressive models of treatment effects in continuous time. Xu et al. [2016] propose a Bayesian nonparametric approach to estimating individual-specific treatment effects of discrete but irregularly spaced actions, and Soleimani et al. [2017] model the effects of continuous-time, continuous-valued actions. Causal effects in continuous-time have also been studied using differential equations. Mooij et al. [2013] formalize an analog of Pearl’s “do” operation for deterministic ordinary differential equations. Sokol and Hansen [2014] make similar contributions for stochastic differential equations by studying limits of discrete-time non-parametric structural equation models [Pearl, 2009]. Cunningham et al. [2012] introduce the Causal Gaussian Process, but their use of the term “causal” is different from ours, and refers to a constraint that holds for sample paths of the GP. Reinforcement learning. Reinforcement learning (RL) algorithms learn from data where actions and observations are interleaved in discrete time (see e.g., Sutton and Barto 1998). In RL, however, the focus is on learning a policy (a map from states to actions) that optimizes the expected reward, rather than a model that predicts the effects of the agent’s actions on future observations. In model-based RL, a model of an action’s effect on the subsequent state is produced as a by-product either offline before optimizing the policy (e.g., Ng et al. 2006) or incrementally as the agent interacts with its environment. In most RL problems, however, learning algorithms rely on active experimentation to collect samples. This is not always possible; for example, in healthcare we cannot actively experiment on patients, and so we must rely on retrospective observational data. In RL, a related problem known as off-policy evaluation also uses retrospective observational data (see e.g., Dudík et al. 2011, Swaminathan and Joachims 2015, Jiang and Li 2016, P˘aduraru et al. 2012, Doroudi et al. 2017). The goal is to use state-action-reward sequences generated by an agent operating under an unknown policy to estimate the expected reward of a target policy. Off-policy algorithms typically use action-value function approximation, importance reweighting, or doubly robust combinations of the two to estimate the expected reward. 2 Counterfactual Models from Observational Traces Counterfactual GPs build on ideas from potential outcomes [Neyman, 1923, 1990, Rubin, 1978], Gaussian processes [Rasmussen and Williams, 2006], and marked point processes [Daley and VereJones, 2007]. In the interest of space, we review potential outcomes and marked point processes, but refer the reader to Rasmussen and Williams [2006] for background on GPs. Background: Potential Outcomes. To formalize counterfactuals, we adopt the potential outcomes framework [Neyman, 1923, 1990, Rubin, 1978], which uses a collection of random variables {Y [a] : 3 a ∈C} to model the outcome after each action a from a set of choices C. To make counterfactual predictions, we must learn the distribution P(Y [a] | X) for each action a ∈C given features X. If we can freely experiment by repeatedly taking actions and recording the effects, then it is straightforward to fit a predictive model. Conducting experiments, however, may not be possible. Alternatively, we can use observational data, where we have example actions A, outcomes Y , and features X, but do not know how actions were chosen. Note the difference between the action a and the random variable A that models the observed actions in our data; the notation Y [a] serves to distinguish between the observed distribution P(Y | A, X) and the target distribution P(Y [a] | X). In general, we can only use observational data to estimate P(Y | A, X). Under two assumptions, however, we can show that this conditional distribution is equivalent to the counterfactual model P(Y [a] | X). The first is known as the Consistency Assumption. Assumption 1 (Consistency). Let Y be the observed outcome, A ∈C be the observed action, and Y [a] be the potential outcome for action a ∈C, then: ( Y ≜Y [a] ) | A = a. Under consistency, we have that P(Y | A = a) = P(Y [a] | A = a). Now, the potential outcome Y [a] may depend on the action A, so in general P(Y [a] | A = a) ̸= P(Y [a]). The next assumption posits that the features X include all possible confounders [Morgan and Winship, 2014], which are sufficient to d-separate Y [a] and A. Assumption 2 (No Unmeasured Confounders (NUC)). Let Y be the observed outcome, A ∈C be the observed action, X be a vector containing all potential confounders, and Y [a] be the potential outcome under action a ∈C, then: ( Y [a] ⊥A ) | X. Under Assumptions 1 and 2, P(Y | A, X) = P(Y [a] | X). An extension of Assumption 2 introduced by Robins [1997] known as sequential NUC allows us to estimate the effect of a sequence of actions in discrete time on a single outcome. In continuous-time settings, where both the type and timing of actions may be statistically dependent on the potential outcomes, Assumption 2 (and sequential NUC) cannot be applied as-is. We will describe an alternative that serves a similar role for CGPs. Background: Marked Point Processes. Point processes are distributions over sequences of timestamps {Ti}N i=1, which we call points, and a marked point process (MPP) is a point process where each point is annotated with an additional random variable Xi, called its mark. For example, a point T might represent the arrival time of a customer, and X the amount that she spent at the store. We emphasize that both the annotated points (Ti, Xi) and the number of points N are random variables. A point process can be characterized as a counting process {Nt : t ≥0} that counts the number of points that occured up to and including time t: Nt = PN i=1 I(Ti≤t). By definition, this processes can only take integer values, and Nt ≥Ns if t ≥s. In addition, it is commonly assumed that N0 = 0 and that ∆Nt = limδ→0+ Nt −Nt−δ ∈{0, 1}. We can parameterize a point process using a probabilistic model of ∆Nt given the history of the process Ht−up to but not including time t (we use t−to denote the left limit of t). Using the Doob-Meyer decomposition [Daley and Vere-Jones, 2007], we can write ∆Nt = ∆Mt + ∆Λt, where Mt is a martingale, Λt is a cumulative intensity function, and P(∆Nt = 1 | Ht−) = E [∆Nt | Ht−] = E [∆Mt | Ht−] + ∆Λt(Ht−) = 0 + ∆Λt(Ht−), which shows that we can parameterize the point process using the conditional intensity function λ∗(t) dt ≜∆Λt(Ht−). The star superscript on the intensity function serves as a reminder that it depends on the history Ht−. For example, in non-homogeneous Poisson processes λ∗(t) is a function of time that does not depend on the history. On the other hand, a Hawkes process is an example of a point process where λ∗(t) does depend on the history [Hawkes, 1971]. MPPs are defined by an intensity that is a function of both the time t and the mark x: λ∗(t, x) = λ∗(t)p∗(x | t). We have written the joint intensity in a factored form, where λ∗(t) is the intensity of any point occuring (that is, the mark is unspecified), and p∗(x | t) is the pdf of the observed mark given the point’s time. For an MPP, the history Ht contains each prior point’s time and mark. 2.1 Counterfactual Gaussian Processes Let {Yt : t ∈[0, τ]} denote a continuous-time stochastic process, where Yt ∈R, and [0, τ] defines the interval over which the process is defined. We will assume that the process is observed at a discrete set of irregular and random times {(yj, tj)}n j=1. We use C to denote the set of possible action types, a ∈C to denote the elements of the set, and define an action to be a 2-tuple (a, t) specifying 4 an action type a ∈C and a time t ∈[0, τ] at which it is taken. To refer to multiple actions, we use a = [(a1, t1), . . . , (an, tn)]. Finally, we define the history Ht at a time t ∈[0, τ] to be a list of all previous observations of the process and all previous actions. Our goal is to model the counterfactual: P({Ys[a] : s > t} | Ht), where a = {(aj, tj) : tj > t}m j=1. (1) To learn the counterfactual model, we will use traces D ≜{hi = {(tij, yij, aij)}ni j=1}m i=1, where yij ∈R ∪{∅}, aij ∈C ∪{∅}, and tij ∈[0, τ]. Our approach is to model D using a marked point process (MPP), which we learn using the traces. Using Assumption 1 and two additional assumptions defined below, the estimated MPP recovers the counterfactual model in Equation 1. We define the MPP mark space as the Cartesian product of the outcome space R and the set of action types C. To allow either the outcome or the action (but not both) to be the null variable ∅, we introduce binary random variables zy ∈{0, 1} and za ∈{0, 1} to indicate when the outcome y and action a are not ∅. Formally, the mark space is X = (R ∪{∅}) × (C ∪{∅}) × {0, 1} × {0, 1}. We can then write the MPP intensity as λ∗(t, y, a, zy, za) = λ∗(t)p∗(zy, za | t) | {z } [A] Event model p∗(y | t, zy) | {z } [B] Outcome model (GP) p∗(a | y, t, za) | {z } [C] Action model , (2) where we have again used the ∗superscript as a reminder that the hazard function and densities above are implicitly conditioned on the history Ht−. The parameterization of the event and action models can be chosen to reflect domain knowledge about how the timing of events and choice of action depend on the history. The outcome model is parameterized using a GP (or any elaboration such as a hierarchical GP or mixture of GPs), and can be treated as a standard regression model that predicts how the future trajectory will progress given the previous actions and outcome observations. Learning. To learn the CGP, we maximize the likelihood of observational traces over a fixed interval [0, τ]. Let θ denote the model parameters, then the likelihood for a single trace is ℓ(θ) = n X j=1 log p∗ θ(yj | tj, zyj) + n X j=1 log λ∗ θ(tj)p∗ θ(aj, zyj, zaj | tj, yj) − Z τ 0 λ∗ θ(s) ds. (3) We assume that traces are independent, and so can learn from multiple traces by maximizing the sum of the individual-trace log likelihoods with respect to θ. We refer to Equation 3 as the adjusted maximum likelihood objective. We see that the first term fits the GP to the outcome data, and the second term acts as an adjustment to account for dependencies between future outcomes and the timing and types of actions that were observed in the training data. Connection to target counterfactual. By maximizing Equation 3, we obtain a statistical model of the observational traces D. In general, the statistical model may not recover the target counterfactual model (Equation 1). To connect the CGP to Equation 1, we describe two additional assumptions. The first assumption is an alternative to Assumption 2. Assumption 3 (Continuous-Time NUC). For all times t and all histories Ht−, the densities λ∗(t), p∗(zy, za | t), and p∗(a | y, t, za) do not depend on Ys[a] for all times s > t and all actions a. The key implication of this assumption is that the policy used to choose actions in the observational data did not depend on any unobserved information that is predictive of the future potential outcomes. Assumption 4 (Non-Informative Measurement Times). For all times t and any history Ht−, the following holds: p∗(y | t, zy = 1) dy = P(Yt ∈dy | Ht−). Under Assumptions 1, 3, and 4, we can show that Equation 1 is equivalent to the GP used to model p∗(y | t, zy = 1). In the interest of space, the argument for this equivalence is in Section A of the supplement. Note that these assumptions are not statistically testable (see e.g., Pearl 2009). 3 Experiments We demonstrate the CGP on two decision-support tasks. First, we show that the CGP can make reliable risk predictions that are insensitive to the action policy in the training data. Classical supervised learning algorithms, however, are dependent on the action policy and this can make them unreliable decision-support tools. Second, we show how the CGP can be used to compare counterfactuals and ask “what if?” questions for individualized treatment planning by learning the effects of dialysis on creatinine levels using real data from an intensive care unit (ICU). 5 Regime A Regime B Regime C Baseline GP CGP Baseline GP CGP Baseline GP CGP Risk Score ∆from A 0.000 0.000 0.083 0.001 0.162 0.128 Kendall’s τ from A 1.000 1.000 0.857 0.998 0.640 0.562 AUC 0.853 0.872 0.832 0.872 0.806 0.829 Table 1: Results measuring reliability for simulated data experiments. See Section 3.1 for details. 3.1 Reliable Risk Prediction with CGPs We first show how the CGP can be used for reliable risk prediction, where the objective is to predict the likelihood of an adverse event so that we can intervene to prevent it from happening. In this section, we use simulated data so that we can evaluate using the true risk on test data. For concreteness, we frame our experiment within a healthcare setting, but the ideas can be more broadly applied. Suppose that a clinician records a real-valued measurement over time that reflects an individual’s health, which we call a severity marker. We consider the individual to not be at risk if the severity marker is unlikely to fall below a particular threshold in the future without intervention. As discussed by Caruana et al. [2015], modeling this notion of risk can help doctors decide when an individual can safely be sent home without aggressive treatment. We simulate the value of a severity marker recorded over a period of 24 hours in the hospital; high values indicate that the patient is healthy. A natural approach to predicting risk at time t is to model the conditional distribution of the severity marker’s future trajectory given the history up until time t; i.e. P({Ys : s > t} | Ht). We use this as our baseline. As an alternative, we use the CGP to explicitly model the counterfactual “What if we do not treat this patient?”; i.e. P({Ys[∅] : s > t} | Ht). For all experiments, we consider a single decision time t = 12hrs. To quantify risk, we use the negative of each model’s predicted value at the end of 24 hours, normalized to lie in [0, 1]. Data. We simulate training and test data from three regimes. In regimes A and B, we simulate severity marker trajectories that are treated by policies πA and πB respectively, which are both unknown to the baseline model and CGP at train time. Both πA and πB are designed to satisfy Assumptions 1, 3, and 4. In regime C, we use a policy that does not satisfy these assumptions. This regime will demonstrate the importance of verifying whether the assumptions hold when applying the CGP. We train both the baseline model and CGP on data simulated from all three regimes. We test all models on a common set of trajectories treated up until t = 12hrs with policy πA and report how risk predictions vary as a function of action policy in the training data. Simulator. For each patient, we randomly sample outcome measurement times from a homogeneous Poisson process with with constant intensity λ over the 24 hour period. Given the measurement times, outcomes are sampled from a mixture of three GPs. The covariance function is shared between all classes, and is defined using a Matérn 3/2 kernel (variance 0.22, lengthscale 8.0) and independent Gaussian noise (scale 0.1) added to each observation. Each class has a distinct mean function parameterized using a 5-dimensional, order-3 B-spline. The first class has a declining mean trajectory, the second has a trajectory that declines then stabilizes, and the third has a stable trajectory.2 All classes are equally likely a priori. At each measurement time, the treatment policy π determines a probability p of treatment administration (we use only a single treatment type). The treatments increase the severity marker by a constant amount for 2 hours. If two or more actions occur within 2 hours of one another, the effects do not add up (i.e. it is as though only one treatment is active). Additional details about the simulator and policies can be found in the supplement. Model. For both the baseline GP and CGP, we use a mixture of three GPs (as was used to simulate the data). We assume that the mean function coefficients, the covariance parameters, and the treatment effect size are unknown and must be learned. We emphasize that both the baseline GP and CGP have identical forms, but are trained using different objectives; the baseline marginalizes over future actions, inducing a dependence on the treatment policy in the training data, while the CGP explicitly controls for them while learning. For both the baseline model and CGP, we analytically sum over the mixture component likelihoods to obtain a closed form expression for the likelihood, which we optimize using BFGS [Nocedal and Wright, 2006].3 Predictions for both models are made using the posterior predictive mean given data and interventions up until 12 hours. 2The exact B-spline coefficients can be found in the simulation code included in the supplement. 3Additional details can be found in the supplement. 6 Hours Since ICU Admission Creatinine Figure 2: Example factual (grey) and counterfactual (blue) predictions on real ICU data using the CGP. Results. We find that the baseline GP’s risk scores fluctuate across regimes A, B, and C. The CGP is stable across regimes A and B, but unstable in regime C, where our assumptions are violated. In Table 1, the first row shows the average difference in risk scores (which take values in [0, 1]) produced by the models trained in each regime and produced by the models trained in regime A. In row 1, column B we see that the baseline GP’s risk scores differ for the same person on average by around eight points (∆= 0.083). From the perspective of a decision-maker, this behavior could make the system appear less reliable. Intuitively, the risk for a given patient should not depend on the policy used to determine treatments in retrospective data. On the other hand, the CGP’s scores change very little when trained on different regimes (∆= 0.001), as long as Assumptions 1, 3, and 4 are satisfied. A cynical reader might ask: even if the risk scores are unstable, perhaps it has no consequences on the downstream decision-making task? In the second row of Table 1, we report Kendall’s τ computed between each regime and regime A using the risk scores to rank the patient’s in the test data according to severity (i.e. scores closer to 1 are more severe). In the third row, we report the AUC for both models trained in each regime on the common test set. We label a patient as “at risk” if the last marker value in the untreated trajectory is below zero, and “not at risk” otherwise. In row 2, column B we see that the CGP has a high rank correlation (τ = 0.998) between the two regimes where the policies satisfy our key assumptions. The baseline GP model trained on regime B, however, has a lower rank correlation of τ = 0.857 with the risk scores produced by the same model trained on regime A. Similarly, in row three, columns A and B, we see that the CGP’s AUC is unchanged (AUC = 0.872). The baseline GP, however, is unstable and creates a risk score with poorer discrimination in regime B (AUC = 0.832) than in regime A (AUC = 0.853). Although we illustrate stability of the CGP compared to the baseline GP using two regimes, this property is not specific to the particular choice of policies used in regimes A and B; the issue persists as we generate different training data by varying the distribution over the action choices. Finally, the results in column C highlight the importance of Assumptions 1, 3, and 4. The policy πC does not satisfy these assumptions, and we see that the risk scores for the CGP are different when fit in regime C than when fit in regime A (∆= 0.128). Similarly, in row 2 the CGP’s rank correlation degrades (τ = 0.562), and in row 3 the AUC decreases to 0.829. Note that the baseline GP continues to be unstable when fit in regime C. Conclusions. These results have important implications for the practice of building predictive models for decision support. Classical supervised learning algorithms can be unreliable due to an implicit dependence on the action policy in the training data, which is usually different from the assumed action policy at test time (e.g. what will happen if we do not treat?). Note that this issue is not resolved by training only on individuals who are not treated because selection bias creates a mismatch between our train and test distributions. From a broader perspective, supervised learning can be unreliable because it captures features of the training distribution that may change (e.g. relationships caused by the action policy). Although we have used a counterfactual model to account for and remove these unstable relationships, there may be other approaches that achieve the same effect (e.g., Dyagilev and Saria 2016). Recent related work by Gong et al. [2016] on covariate shift aims to learn only the components of the source distribution that will generalize to the target distribution. As predictive models are becoming more widely used in domains like healthcare where safety is critical (e.g. Li-wei et al. 2015, Schulam and Saria 2015, Alaa et al. 2016, Wiens et al. 2016, Cheng et al. 2017), the framework proposed here is increasingly pertinent. 3.2 “What if?” Reasoning for Individualized Treatment Planning To demonstrate how the CGP can be used for individualized treatment planning, we extract observational creatinine traces from the publicly available MIMIC-II database [Saeed et al., 2011]. 7 Creatinine is a compound produced as a by-product of the chemical reaction in the body that breaks down creatine to fuel muscles. Healthy kidneys normally filter creatinine out of the body, which can otherwise be toxic in large concentrations. During kidney failure, however, creatinine levels rise and the compound must be extracted using a medical procedure called dialysis. We extract patients in the database who tested positive for abnormal creatinine levels, which is a sign of kidney failure. We also extract the times at which three different types of dialysis were given to each individual: intermittent hemodialysis (IHD), continuous veno-venous hemofiltration (CVVH), and continuous veno-venous hemodialysis (CVVHD). The data set includes a total of 428 individuals, with an average of 34 (±12) creatinine observations each. We shuffle the data and use 300 traces for training, 50 for validation and model selection, and 78 for testing. Model. We parameterize the outcome model of the CGP using a mixture of GPs. We always condition on the initial creatinine measurement and model the deviation from that initial value. The mean for each class is zero (i.e. we assume there is no deviation from the initial value on average). We parameterize the covariance function using the sum of two non-stationary kernel functions. Let φ : t →[1, t, t2]⊤∈R3 denote the quadratic polynomial basis, then the first kernel is k1(t1, t2) = φ⊤(t1)Σφ(t2), where Σ ∈R3×3 is a positive-definite symmetric matrix parameterizing the kernel. The second kernel is the covariance function of the integrated Ornstein-Uhlenbeck (IOU) process (see e.g., Taylor et al. 1994), which is parameterized by two scalars α and ν and defined as kIOU(t1, t2) = ν2 2α3 2αmin(t1, t2) + e−αt1 + e−αt2 −1 −e−α|t1−t2| . The IOU covariance corresponds to the random trajectory of a particle whose velocity drifts according to an OU process. We assume that each creatinine measurement is observed with independent Gaussian noise with scale σ. Each class in the mixture has a unique set of covariance parameters. To model the treatment effects in the outcome model, we define a short-term function and longterm response function. If an action is taken at time t0, the outcome δ = t −t0 hours later will be additively affected by the response function g(δ; h1, a, b, h2, r) = gs(δ; h1, a, b) + gℓ(δ; h2, r), where h1, h2 ∈R and a, b, r ∈R+. The short-term and long-term response functions are defined as gs(δ; h1, a, b) = h1a a−b e−b·t −e−a·t , and gℓ(δ : h2, r) = h2 · (1.0 −e−r·t). The two response functions are included in the mean function of the GP, and each class in the mixture has a unique set of response function parameters. We assume that Assumptions 1, 3, and 4 hold, and that the event and action models have separate parameters, so can remain unspecified when estimating the outcome model. We fit the CGP outcome model using Equation 3, and select the number of classes in the mixture using fit on the validation data (we choose three components). Results. Figure 2 demonstrates how the CGP can be used to do “what if?” reasoning for treatment planning. Each panel in the figure shows data for an individual drawn from the test set. The green points show measurements on which we condition to obtain a posterior distribution over mixture class membership and the individual’s latent trajectory under each class. The red points are unobserved, future measurements. In grey, we show predictions under the factual sequence of actions extracted from the MIMIC-II database. Treatment times are shown using vertical bars marked with an “x” (color indicates which type of treatment was given). In blue, we show the CGP’s counterfactual predictions under an alternative sequence of actions. The posterior predictive trajectory is shown for the MAP mixture class (mean is shown by a solid grey/blue line, 95% credible intervals are shaded). We qualitatively discuss the CGP’s counterfactual predictions, but cannot quantitatively evaluate them without prospective experimental data from the ICU. We can, however, measure fit on the factual data and compare to baselines to evaluate our modeling decisions. Our CGP’s outcome model allows for heterogeneity in the covariance parameters and the response functions. We compare this choice to two alternatives. The first is a mixture of three GPs that does not model treatment effects. The second is a single GP that does model treatment effects. Over a 24-hour horizon, the CGP’s mean absolute error (MAE) is 0.39 (95% CI: 0.38-0.40),4, and for predictions between 24 and 48 hours in the future the MAE is 0.62 (95% CI: 0.60-0.64). The pairwise mean difference between the first baseline’s absolute errors and the CGP’s is 0.07 (0.06, 0.08) for 24 hours, and 0.09 (0.08, 0.10) for 24-48 hours. The mean difference between the second baseline’s absolute errors and the CGP’s is 0.04 (0.04, 0.05) for 24 hours and 0.03 (0.02, 0.04) for 24-48 hours. The improvements over the baselines suggest that modeling treatments and heterogeneity with a mixture of GPs for the outcome model are useful for this problem. 495% confidence intervals computed using the pivotal bootstrap are shown in parentheses 8 Figure 2 shows factual and counterfactual predictions made by the CGP. In the first (left-most) panel, the patient is factually administered IHD about once a day, and is responsive to the treatment (creatinine steadily improves). We query the CGP to estimate how the individual would have responded had the IHD treatment been stopped early. The model reasonably predicts that we would have seen no further improvement in creatinine. The second panel shows a similar case. In the third panel, an individual with erratic creatinine levels receives CVVHD for the last 100 hours and is responsive to the treatment. As before, the CGP counterfactually predicts that she would not have improved had CVVHD not been given. Interestingly, panel four shows the opposite situation: the individual did not receive treatment and did not improve for the last 100 hours, but the CGP counterfactually predicts an improvement in creatinine as in panel 3 under daily CVVHD. 4 Discussion Classical supervised learning algorithms can lead to unreliable and, in some cases, dangerous decisionsupport tools. As a safer alternative, this paper advocates for using potential outcomes [Neyman, 1923, 1990, Rubin, 1978] and counterfactual learning objectives (like the one in Equation 3). We introduced the Counterfactual Gaussian Process (CGP) as a decision-support tool for scenarios where outcomes are measured and actions are taken at irregular, discrete points in continuous-time. The CGP builds on previous ideas in continuous-time causal inference (e.g. Robins 1997, Arjas and Parner 2004, Lok 2008), but is unique in that it can predict the full counterfactual trajectory of a time-dependent outcome. We designed an adjusted maximum likelihood algorithm for learning the CGP from observational traces by modeling them using a marked point process (MPP), and described three structural assumptions that are sufficient to show that the algorithm correctly recovers the CGP. We empirically demonstrated the CGP on two decision-support tasks. First, we showed that the CGP can be used to make reliable risk predictions that are insensitive to the action policies used in the training data. This is critical because an action policy can cause a predictive model fit using classical supervised learning to capture relationships between the features and outcome (risk) that lead to poor downstream decisions and that are difficult to diagnose. In the second set of experiments, we showed how the CGP can be used to compare counterfactuals and answer “what if?” questions, which could offer decision-makers a powerful new tool for individualized treatment planning. We demonstrated this capability by learning the effects of dialysis on creatinine trajectories using real ICU data and predicting counterfactual progressions under alternative dialysis treatment plans. These results suggest a number of new questions and directions for future work. First, the validity of the CGP is conditioned upon a set of assumptions (this is true for all counterfactual models). In general, these assumptions are not testable. The reliability of approaches using counterfactual models therefore critically depends on the plausibility of those assumptions in light of domain knowledge. Formal procedures, such as sensitivity analyses (e.g., Robins et al. 2000, Scharfstein et al. 2014), that can identify when causal assumptions conflict with a data set will help to make these methods more easily applied in practice. In addition, there may be other sets of structural assumptions beyond those presented that allow us to learn counterfactual GPs from non-experimental data. For instance, the back door and front door criteria are two separate sets of structural assumptions discussed by Pearl [2009] in the context of estimating parameters of causal Bayesian networks from observational data. More broadly, this work has implications for recent pushes to introduce safety, accountability, and transparency into machine learning systems. We have shown that learning algorithms sensitive to certain factors in the training data (the action policy, in this case) can make a system less reliable. In this paper, we used the potential outcomes framework and counterfactuals to characterize and account for such factors, but there may be other ways to do this that depend on fewer or more realistic assumptions (e.g., Dyagilev and Saria 2016). Moreover, removing these nuisance factors is complementary to other system design goals such as interpretability (e.g., Ribeiro et al. 2016). Acknowledgements We thank the anonymous reviewers for their insightful feedback. This work was supported by generous funding from DARPA YFA #D17AP00014 and NSF SCH #1418590. PS was also supported by an NSF Graduate Research Fellowship. We thank Katie Henry and Andong Zhan for help with the ICU data set. We also thank Miguel Hernán for pointing us to earlier work by James Robins on treatment-confounder feedback. 9 References A.M. Alaa, J. Yoon, S. Hu, and M. van der Schaar. Personalized Risk Scoring for Critical Care Patients using Mixtures of Gaussian Process Experts. In ICML Workshop on Computational Frameworks for Personalization, 2016. E. Arjas and J. Parner. Causal reasoning from longitudinal data. Scandinavian Journal of Statistics, 31(2):171–187, 2004. L. Bottou, J. Peters, J.Q. Candela, D.X. Charles, M. Chickering, E. Portugaly, D. Ray, P.Y. Simard, and E. Snelson. Counterfactual reasoning and learning systems: the example of computational advertising. Journal of Machine Learning Research (JMLR), 14(1):3207–3260, 2013. K.H. Brodersen, F. Gallusser, J. Koehler, N. Remy, and S.L. Scott. Inferring causal impact using bayesian structural time-series models. The Annals of Applied Statistics, 9(1):247–274, 2015. R. Caruana, Y. Lou, J. Gehrke, P. Koch, M. Sturm, and N. Elhadad. Intelligible models for healthcare: Predicting pneumonia risk and hospital 30-day readmission. In International Conference on Knowledge Discovery and Data Mining (KDD), pages 1721–1730. ACM, 2015. L.F. Cheng, G. Darnell, C. Chivers, M.E. Draugelis, K. Li, and B.E. Engelhardt. Sparse multi-output Gaussian processes for medical time series prediction. arXiv preprint arXiv:1703.09112, 2017. J. Cunningham, Z. Ghahramani, and C.E. Rasmussen. Gaussian processes for time-marked timeseries data. In International Conference on Artificial Intelligence and Statistics (AISTATS), pages 255–263, 2012. D.J. Daley and D. Vere-Jones. An Introduction to the Theory of Point Processes. Springer Science & Business Media, 2007. S. Doroudi, P.S. Thomas, and E. Brunskill. Importance sampling for fair policy selection. In Uncertainty in Artificial Intelligence (UAI), 2017. M. Dudík, J. Langford, and L. Li. Doubly robust policy evaluation and learning. In International Conference on Machine Learning (ICML), 2011. K. Dyagilev and S. Saria. Learning (predictive) risk scores in the presence of censoring due to interventions. Machine Learning, 102(3):323–348, 2016. M. Gong, K. Zhang, T. Liu, D. Tao, C. Glymour, and B. Schölkopf. Domain adaptation with conditional transferable components. In International Conference on Machine Learning (ICML), 2016. A.G. Hawkes. Spectra of some self-exciting and mutually exciting point processes. Biometrika, pages 83–90, 1971. N. Jiang and L. Li. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning (ICML), pages 652–661, 2016. F.D. Johansson, U. Shalit, and D. Sontag. Learning representations for counterfactual inference. In International Conference on Machine Learning (ICML), 2016. H.L Li-wei, R.P. Adams, L. Mayaud, G.B. Moody, A. Malhotra, R.G. Mark, and S. Nemati. A physiological time series dynamics-based approach to patient monitoring and outcome prediction. IEEE Journal of Biomedical and Health Informatics, 19(3):1068–1076, 2015. J.J. Lok. Statistical modeling of causal effects in continuous time. The Annals of Statistics, pages 1464–1507, 2008. J.M. Mooij, D. Janzing, and B. Schölkopf. From ordinary differential equations to structural causal models: the deterministic case. 2013. S.L. Morgan and C. Winship. Counterfactuals and causal inference. Cambridge University Press, 2014. 10 S.A. Murphy. Optimal dynamic treatment regimes. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 65(2):331–355, 2003. I. Nahum-Shani, M. Qian, D. Almirall, W.E. Pelham, B. Gnagy, G.A. Fabiano, J.G. Waxmonsky, J. Yu, and S.A. Murphy. Q-learning: A data analysis method for constructing adaptive interventions. Psychological Methods, 17(4):478, 2012. J. Neyman. Sur les applications de la théorie des probabilités aux experiences agricoles: Essai des principes. Roczniki Nauk Rolniczych, 10:1–51, 1923. J. Neyman. On the application of probability theory to agricultural experiments. Statistical Science, 5(4):465–472, 1990. A.Y. Ng, A. Coates, M. Diel, V. Ganapathi, J. Schulte, B. Tse, E. Berger, and E. Liang. Autonomous inverted helicopter flight via reinforcement learning. In Experimental Robotics IX, pages 363–372. Springer, 2006. J. Nocedal and S.J. Wright. Numerical optimization 2nd, 2006. C. P˘aduraru, D. Precup, J. Pineau, and G. Com˘anici. An empirical analysis of off-policy learning in discrete mdps. In Workshop on Reinforcement Learning, page 89, 2012. J. Pearl. Causality: models, reasoning and inference. Cambridge University Press, 2009. C.E. Rasmussen and C.K.I. Williams. Gaussian processes for machine learning. the MIT Press, 2006. M.T. Ribeiro, S. Singh, and C. Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In International Conference on Knowledge Discovery and Data Mining (KDD), pages 1135–1144. ACM, 2016. J.M. Robins. A new approach to causal inference in mortality studies with a sustained exposure period—application to control of the healthy worker survivor effect. Mathematical Modelling, 7 (9-12):1393–1512, 1986. J.M. Robins. Estimation of the time-dependent accelerated failure time model in the presence of confounding factors. Biometrika, 79(2):321–334, 1992. J.M. Robins. Causal inference from complex longitudinal data. In Latent variable modeling and applications to causality, pages 69–117. Springer, 1997. J.M. Robins and M.A. Hernán. Estimation of the causal effects of time-varying exposures. Longitudinal data analysis, pages 553–599, 2009. J.M. Robins, A. Rotnitzky, and D.O. Scharfstein. Sensitivity analysis for selection bias and unmeasured confounding in missing data and causal inference models. In Statistical models in epidemiology, the environment, and clinical trials, pages 1–94. Springer, 2000. D.B. Rubin. Bayesian inference for causal effects: The role of randomization. The Annals of statistics, pages 34–58, 1978. M. Saeed, M. Villarroel, A.T. Reisner, G. Clifford, L.W. Lehman, G. Moody, T. Heldt, T.H. Kyaw, B. Moody, and R.G. Mark. Multiparameter intelligent monitoring in intensive care II (MIMIC-II): a public-access intensive care unit database. Critical Care Medicine, 39(5):952, 2011. D. Scharfstein, A. McDermott, W. Olson, and F. Wiegand. Global sensitivity analysis for repeated measures studies with informative dropout: A fully parametric approach. Statistics in Biopharmaceutical Research, 6(4):338–348, 2014. P. Schulam and S. Saria. A framework for individualizing predictions of disease trajectories by exploiting multi-resolution structure. In Advances in Neural Information Processing Systems (NIPS), pages 748–756, 2015. A. Sokol and N.R. Hansen. Causal interpretation of stochastic differential equations. Electronic Journal of Probability, 19(100):1–24, 2014. 11 H. Soleimani, A. Subbaswamy, and S. Saria. Treatment-response models for counterfactual reasoning with continuous-time, continuous-valued interventions. In Uncertainty in Artificial Intelligence (UAI), 2017. R.S. Sutton and A.G. Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998. A. Swaminathan and T. Joachims. Counterfactual risk minimization. In International Conference on Machine Learning (ICML), 2015. S.L. Taubman, J.M. Robins, M.A. Mittleman, and M.A. Hernán. Intervening on risk factors for coronary heart disease: an application of the parametric g-formula. International Journal of Epidemiology, 38(6):1599–1611, 2009. J. Taylor, W. Cumberland, and J. Sy. A stochastic model for analysis of longitudinal AIDS data. Journal of the American Statistical Association, 89(427):727–736, 1994. J. Wiens, J. Guttag, and E. Horvitz. Patient risk stratification with time-varying parameters: a multitask learning approach. Journal of Machine Learning Research (JMLR), 17(209):1–23, 2016. Y. Xu, Y. Xu, and S. Saria. A Bayesian nonparametric approach for estimating individualized treatment-response curves. In Machine Learning for Healthcare Conference (MLHC), pages 282–300, 2016. 12
2017
109
6,574
Saliency-based Sequential Image Attention with Multiset Prediction Sean Welleck New York University wellecks@nyu.edu Jialin Mao New York University jialin.mao@nyu.edu Kyunghyun Cho New York University kyunghyun.cho@nyu.edu Zheng Zhang New York University zz@nyu.edu Abstract Humans process visual scenes selectively and sequentially using attention. Central to models of human visual attention is the saliency map. We propose a hierarchical visual architecture that operates on a saliency map and uses a novel attention mechanism to sequentially focus on salient regions and take additional glimpses within those regions. The architecture is motivated by human visual attention, and is used for multi-label image classification on a novel multiset task, demonstrating that it achieves high precision and recall while localizing objects with its attention. Unlike conventional multi-label image classification models, the model supports multiset prediction due to a reinforcement-learning based training process that allows for arbitrary label permutation and multiple instances per label. 1 Introduction Humans can rapidly process complex scenes containing multiple objects despite having limited computational resources. The visual system uses various forms of attention to prioritize and selectively process subsets of the vast amount of visual input [6]. Computational models and various forms of psychophysical and neuro-biological evidence suggest that this process may be implemented using various "maps" that topographically encode the relevance of locations in the visual field [17, 39, 13]. Under these models, visual input is compiled into a saliency-map that encodes the conspicuity of locations based on bottom-up features, computed in a parallel, feed-forward process [20, 17]. Top-down, goal-specific relevance of locations is then incorporated to form a priority map, which is then used to select the next target of attention [39]. Thus processing a scene with multiple attentional shifts may be interpreted as a feed-forward process followed by sequential, recurrent stages [23]. Furthermore, the allocation of attention can be separated into covert attention, which is deployed to regions without eye movement and precedes eye movements, and overt attention associated with an eye movement [6]. Despite their evident importance to human visual attention, the notions of incorporating saliency to decide attentional targets, integrating covert and overt attention mechanisms, and using multiple, sequential shifts while processing a scene have not been fully addressed by modern deep learning architectures. Motivated by the model of Itti et al. [17], we propose a hierarchical visual architecture that operates on a saliency map computed by a feed-forward process, followed by a recurrent process that uses a combination of covert and overt attention mechanisms to sequentially focus on relevant regions and take additional glimpses within those regions. We propose a novel attention mechanism for implementing the covert attention. Here, the architecture is used for multi-label image classifica31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. tion. Unlike conventional multi-label image classification models, this model can perform multiset classification due to the proposed reinforcement-learning based training. 2 Related Work We first introduce relevant concepts from biological visual attention, then contextualize work in deep learning related to visual attention, saliency, and hierarchical reinforcement learning (RL). We observe that current deep learning models either exclusively focus on bottom-up, feed-forward attention or overt sequential attention, and that saliency has traditionally been studied separately from object recognition. 2.1 Biological Visual Attention Visual attention can be classified into covert and overt components. Covert attention precedes eye movements, and is intuitively used to monitor the environment and guide eye movements to salient regions [6, 21]. Two particular functions of covert attention motivate the Gaussian attention mechanism proposed below: noise exclusion, which modifies perceptual filters to enhance the signal portion of the stimulus and mitigate the noise; and distractor suppression, which refers to suppressing the representation strength outside an attention area [6]. Further inspiring the proposed attention mechanism is evidence from cueing [1], multiple object tracking [8], and fMRI [30] studies, which indicate that covert attention can be deployed to multiple, disjoint regions that vary in size and can be conceptually viewed as multiple "spotlights". Overt attention is associated with an eye movement, so that the attentional focus coincides with the fovea’s line of sight. The planning of eye movements is thought to be influenced by bottom-up (scene dependent) saliency as well as top-down (goal relevant) factors [21]. In particular, one major view is that two types of maps, the saliency map and the priority map, encode measures used to determine the target of attention [39]. Under this view, visual input is processed into a feature-agnostic saliency map that quantifies distinctiveness of a location relative to other locations in the scene based on bottom-up properties. The saliency map is then integrated to include top-down information, resulting in a priority map. The saliency map was initially proposed by Koch & Ullman [20], then implemented in a computational model by Itti [17]. In their model, saliency is determined by relative feature differences and compiled into a "master saliency map". Attentional selection then consists of directing a fixed-sized attentional region to the area of highest saliency, i.e. in a "winner-take-all" process. The attended location’s saliency is then suppressed, and the process repeats, so that multiple attentional shifts can occur following a single feed-forward computation. Subsequent research effort has been directed at finding neural correlates of the saliency map and priority map. Some proposed areas for salience computation include the superficial layers of the superior colliculus (sSC) and inferior sections of the pulvinar (PI), and for priority map computation include the frontal eye field (FEF) and deeper layers of the superior colliculus (dSC)[39]. Here, we need to only assume existence of the maps as conceptual mechanisms involved in influencing visual attention and refer the reader to [39] for a recent review. We explore two aspects of Itti’s model within the context of modern deep learning-based vision: the use of a bottom-up, featureless saliency map to guide attention, and the sequential shifting of attention to multiple regions. Furthermore, our model incorporates top-down signals with the bottom-up saliency map to create a priority map, and includes covert and overt attention mechanisms. 2.2 Visual Attention, Saliency, and Hierarchical RL in Deep Learning Visual attention is a major area of interest in deep learning; existing work can be separated into sequential attention and bottom-up feed-forward attention. Sequential attention models choose a series of attention regions. Larochelle & Hinton [24] used a RBM to classify images with a sequence of fovea-like glimpses, while the Recurrent Attention Model (RAM) of Mnih et al. [31] posed single-object image classification as a reinforcement learning problem, where a policy chooses the sequence of glimpses that maximizes classification accuracy. This "hard attention" mechanism developed in [31] has since been widely used [27, 44, 35, 2]. Notably, an extension to multiple 2 objects was made in the DRAM model [3], but DRAM is limited to datasets with a natural label ordering, such as SVHN [32]. Recently, Cheung et al. [9] developed a variable-sized glimpse inspired by biological vision, incorporating it into a simple RNN for single object recognition. Due to the fovea-like attention which shifts based on task-specific objectives, the above models can be seen as having overt, top-down attention mechanisms. An alternative approach is to alter the structure of a feed-forward network so that the convolutional activations are modified as the image moves through the network, i.e. in a bottom-up fashion. Spatial transformer networks [18] learn parameters of a transformation that can have the effect of stretching, rotating, and cropping activations between layers. Progressive Attention Networks [36] learn attention filters placed at each layer of a CNN to progressively focus on an arbitrary subset of the input, while Residual Attention Networks [41] learn feature-specific filters. Here, we consider an attentional stage that follows a feed-forward stage, i.e. a saliency map and image representation are produced in a feed-forward stage, then an attention mechanism determines which parts of the image representation are relevant using the saliency map. Saliency is typically studied in the context of saliency modeling, in which a model outputs a saliency map for an image that matches human fixation data, or salient object segmentation [25]. Separately, several works have considered extracting a saliency map for understanding classification network decisions [37, 47]. Zagoruyko et al. [46] formulate a loss function that causes a student network to have similar "saliency" to a teacher network. They model saliency as a reduction operation F : RC×H×W →RH×W applied to a volume of convolutional activations, which we adopt due to its simplicity. Here, we investigate using a saliency map for a downstream task. Recent work has begun to explore saliency maps as inputs for prominent object detection [38] and image captioning [11], pointing to further uses of saliency-based vision models. While we focus on using reinforcement learning for multiset classification with only class labels as annotation, RL has been applied to other computer vision tasks, including modeling eye movements based on annotated human scan paths [29], optimizing prediction performance subject to a computational budget [19], describing classification decisions with natural language [16], and object detection [28, 5, 4]. Finally, our architecture is inspired by works in hierarchical reinforcement learning. The model distinguishes between the upper level task of choosing an image region to focus on and the lower level task of classifying the object related to that region. The tasks are handled by separate networks that operate at different time-scales, with the upper level network specifying the task of the lower level network. This hierarchical modularity relates to the meta-controller / controller architecture of Kulkarni et al. [22] and feudal reinforcement learning [12, 40]. Here, we apply a hierarchical architecture to multi-label image classification, with the two levels linked by a differentiable operation. Figure 1: A high-level view of the model components. See Supplementary Materials section 3 for detailed views. 3 3 Architecture The architecture is a hierarchical recurrent neural network consisting of two main components: the meta-controller and controller. These components assume access to a saliency model, which produces a saliency map from an image, and an activation model, which produces an activation volume from an image. Figure 1 shows the high level components, and Supplementary Materials section 3 shows detailed views of the overall architecture and individual components. In short, given a saliency map the meta-controller places an attention mask on an object, then the controller takes subsequent glimpses and classifies that object. The saliency map is updated to account for the processed locations, and the process repeats. The meta-controller and controller operate at different time-scales; for each step of the meta-controller, the controller takes k + 1 steps. Notation Let I denote the space of images, I ∈RhI×wI and Y = 1, ..., nc denote the set of labels. Let S denote the space of saliency maps, S ∈RhS×wS, let V denote the space of activation volumes, V ∈RC×hV ×wV , let M denote the space of covert attention masks, M ∈RhM×wM , let P denote the space of priority maps, P ∈RhM×wM , and let A denote an action space. The activation model is a function fA : I →V mapping an input image to an activation volume. An example volume is the 512 × hV × wV activation tensor from the final conv layer of a ResNet. Meta-Controller The meta-controller is a function fMC : S →M mapping a saliency map to a covert attention mask. Here, fMC is a recurrent neural network defined as follows: xt = [St, ˆyt−1], et = Wencodext, ht = GRU(et, ht−1), Mt = attn(ht). xt is a concatenation of the flattened saliency map and one-hot encoding of the previous step’s class label prediction, and attn(·) is the novel spatial attention mechanism defined below. The mask is then transformed by the interface layer into a priority map that directs the controller’s glimpses towards a salient region, and used to produce an initial glimpse vector for the controller. Gaussian Attention Mechanism The spatial attention mechanism, inspired by covert visual attention, is a 2D discrete convolution of a mixture of Gaussians filter. Specifically, the attention mask M is a m × n matrix with Mij = φ(i, j), where φ(i, j) = K X k=1 α(k) exp  −β(k)  κ(k) 1 −i 2 +  κ(k) 2 −j 2 . K denotes the number of Gaussian components and α(k), β(k), κ(k) 1 , κ(k) 2 respectively denote the importance, width, and x, y center of component k. To implement the mechanism, the parameters (α, β, κ1, κ2) are output by a network layer as a 4K-dimensional vector (α, β, κ1, κ2), and the elements are transformed to their proper ranges: κ1 = σ(κ1)m, κ2 = σ(κ2)n, α = softmax(α), β = exp(β). Then M is formed by applying φ to the coordinates {(i, j) | 1 ≤i ≤m, 1 ≤j ≤n}. Note that these operations are differentiable, allowing the attention mechanism to be used as a module in a network trained with back-propagation. Graves [15] proposed a 1D version; here we use a 2D version for spatial attention. Interface The interface layer transforms the meta-controller’s output into a priority map and glimpse vector that are used as input to the controller (diagram in Supp. Materials 3.4). The priority map combines the top-down covert attention mask with the bottom-up saliency map: P = M ⊙S. Since P influences the region that is processed next, this can also be seen as a generalization of the "winner-take-all" step in the Itti model; here a learned function chooses a region of high saliency rather than greedily choosing the maximum location. To provide an initial glimpse vector ⃗g0 ∈RC for the controller, the mask is used to spatially weight the activation volume: ⃗g0 = PhV i=1 PwV j=1 Mi,jV·,i,j This is interpreted as the meta-controller taking an initial, possibly broad and variable-sized glimpse using covert attention. The weighting produced by the attention map retains the activations around the centers of attention, while down-weighting outlying areas, effectively suppressing activations from noise outside of the attentional area. Since 4 the activations are averaged into a single vector, there is a trade-off between attentional area and information retention. Controller The controller is a recurrent neural network fC : (P, g0) →A that runs for k + 1 steps and maps a priority map and initial glimpse vector from the interface layer to parameters of a distribution, and an action is sampled. The first k actions select spatial indices of the activation volume, and the final action chooses a class label, i.e. A1,...,k ≡{1, 2, ..., hV wV } and Ak+1 ≡Y. Specifically: xi = [Pt, ˆyt−1, ai−1, gi−1], ei = Wencodexi, hi = GRU(ei, hi−1), si = Wlocationhi 1 ≤i ≤k Wclasshi i = k + 1 , pi = softmax(si), ai ∼pi, where t indexes the meta-controller time-step and i indexes the controller time-step, and ai ∈A is an action sampled from the categorical distribution with parameter vector pi. The glimpse vectors gi, i ≤1 ≤k are formed by extracting the column from the activation volume V at location ai = (x, y)i. Intuitively, the controller uses overt attention to choose glimpse locations using the information conveyed in the priority map and initial glimpse, compiling the information in its hidden state to make a classification decision. Recall that both covert attention and priority maps are known to influence eye saccades [21]. See Supplementary Materials 3.5 for a diagram. Update Mechanism During a step t, the meta-controller takes saliency map St as input, focuses on a region of St using an attention mask Mt, then the controller takes glimpses at locations (x, y)1, (x, y)2, ..., (x, y)k. At step t + 1, the saliency map should reflect the fact that some regions have already been attended to in order to encourage attending to novel areas. While the metacontroller’s hidden state can in principle prevent it from repeatedly focusing on the same regions, we explicitly update the saliency map with a function update : S →S that suppresses the saliency of glimpsed locations and locations with nonzero attention mask values, thereby increasing the relative saliency of the remaining unattended regions: [St+1]ij = 0 if (i, j) ∈{(x, y)1, (x, y)2, ..., (x, y)k} max([St]ij −[Mt]ij, 0) otherwise This mechanism is motivated by the inhibition of return effect in the human visual system; after attention has been removed from a region, there is an increased response time to stimuli in the region, which may influence visual search and encourage attending to novel areas [13, 33]. Saliency Model The saliency model is a function fS : I →S mapping an input image to a saliency map. Here, we use a saliency model that computes a map by compressing an activation volume using a reduction operation F : RC×HV ×WV →RHV ×WV as in [46]. We choose F(V ) = PC c=1 |Vi|2, and use the output of the activation model as V . Furthermore, the activation model is fine-tuned on a single-object dataset containing classes found in the multi-object dataset, so that the saliency model has high activations around classes of interest. 4 Learning 4.1 Sequential Multiset Classification Multi-label classification tasks can be categorized based on whether the labels are lists, sets, or multisets. We claim that multiset classification most closely resembles a human’s free viewing of a scene; the exact labeling order of objects may vary by individual, and multiple instances of the same object may appear in a scene and receive individual labels. Specifically, let D = {(Xi, Yi)}n i=1 be a dataset of images Xi with labels Yi ⊆Y and consider the structure of Yi. In list-based classification, the labels Yi = [y1, ..., y|Yi|] have a consistent order, e.g. left to right. As a sequential prediction problem, there is exactly one true label for each prediction step, so a standard 5 cross-entropy loss can be used at each prediction step, as in [3]. When the labels Yi = {y1, ..., y|Yi|} are a set, one approach for sequential prediction is to impose an ordering O(Yi) →[yo1, ..., yo|Yi|] as a preprocessing step, transforming the set-based problem to a list-based problem. For instance, O(·) may order the labels based on prevalence in the training data as in [42]. Finally, multiset classification generalizes set-based classification to allow duplicate labels within an example, i.e. Yi = {ym1 1 , ...y m|Yi| |Yi| }, where mj denotes the multiplicity of label yj. Here, we propose a training process that allows duplicate labels and is permutation-invariant with respect to the labels, removing the need for a hand-engineered ordering and supporting all three types of classification. With a saliency-based model, permutation invariance for labels is especially crucial, since the most salient (and hence first classified) object may not correspond to the first label. 4.2 Training Our solution is to frame the problem in terms of maximizing a non-smooth reward function that encourages the desired classification and attention behavior, and use reinforcement learning to maximize the expected reward. Assuming access to a trained saliency model and activation model, the meta-controller and controller can be jointly trained end-to-end. Reward To support multiset classification, we propose a multiset-based reward for the controller’s classification action. Specifically, consider an image X with m labels Y = {y1, ..., ym}. At metacontroller step t, 1 ≤t ≤m, let Ai be a multiset of available labels, let fi(X) be the corresponding class scores output by the controller. Then define: Riclf = +1 if ˆyi ∈Ai −1 otherwise Ai+1 = Ai \ ˆyi if ˆyi ∈Ai Ai otherwise where ˆyi ∼softmax(fi(X)) and A1 ←Y. In short, a class label is sampled from the controller, and the controller receives a positive reward if and only if that label is in the multiset of available labels. If so, the label is removed from the available labels. Clearly, the reward for sampled labels ˆy1, ˆy2, .., ˆym equals the reward for σ(ˆy1), σ(ˆy2), .., σ(ˆym) for any permutation σ of the m elements. Note that list-based tasks can be supported by setting Ai ←yi. The controller’s location-choice actions simply receive a reward equal to the priority map value at the glimpse location, which encourages the controller to choose locations according to the priority map. That is, for locations (x, y)1, ..., (x, y)k sampled from the controller, define Riloc = P(x,y)i. Objective Let n = 1...N index the example, t = 1...M index the meta-controller step, and i = 0...K index the controller step. The goal is choosing θ to maximize the total expected reward: J(θ) = Ep(τ|fθ) hP n,t,i Rn,t,i i where the rewards Rn,t,i are defined as above, and the expectation is over the distribution of trajectories produced using a model f parameterized by θ. An unbiased gradient estimator for θ can be obtained using the REINFORCE [43] estimator within the stochastic computation graph framework of Schulman et al. [34] as follows. Viewed as a stochastic computation graph, an input saliency map Sn,t passes through a path of deterministic nodes, reaching the controller. Each of the controller’s k+1 steps produces a categorical parameter vector pn,t,i and a stochastic node is introduced by each sampling operation at,i ∼pn,t,i. Then form a surrogate loss function L(θ) = P t,i log pt,iRt,i with the stochastic computation graph. By Corollary 1 of [34], the gradient of L(θ) gives an unbiased gradient estimator of the objective, which can be approximated using Monte-Carlo sampling: ∂ ∂θJ(θ) = E  ∂ ∂θL(θ)  ≈ 1 B PB b=1 ∂ ∂θL(θ). As is standard in reinforcement learning, a state-value function V (st,i) is used as a baseline to reduce the variance of the REINFORCE estimator, thus L(θ) = P t,i log pt,i(V (st,i) − Rt,i). In our implementation, the controller outputs the state-value estimate, so that st,i is the controller’s hidden state. 5 Experiments We validate the classification performance, training process, and hierarchical attention with set-based and multiset-based classification experiments. To test the effectiveness of the permutation-invariant 6 Table 1: Metrics on the test set for MNIST Set and Multiset tasks, and SVHN Multiset. MNIST Set MNIST Multiset SVHN Multiset F1 0-1 F1 0-1 F1 0-1 HSAL-RL 0.990 0.960 0.978 0.935 0.973 0.947 Cross-Entropy 0.735 0.478 0.726 0.477 0.589 0.307 RL training, we compare against a baseline model that uses a cross-entropy loss on the probabilities pt,i and (randomly ordered) labels yi instead of the RL training, similar to training proposed in [42]. Datasets Two synthetic datasets, MNIST Set and MNIST Multiset, as well as the real-world SVHN dataset, are used. For MNIST Set and Multiset, each 100x100 image in the dataset has a variable number (1-4) of digits, of varying sizes (20-50px) and positions, along with cluttering objects that introduce noise. Each label in an image from MNIST Set is unique, while MNIST Multiset images may contain duplicate labels. Each dataset is split into 60,000 training examples and 10,000 testing examples, and metrics are reported for the testing set. SVHN Multiset consists of SVHN examples with label order randomized when a batch is sampled. This removes the natural left-to-right order of the SVHN labels, thus turning the classification into a multiset task. Evaluation Metrics To evaluate classification performance, macro-F1 and exact match (0-1) as defined in [26] are used. For evaluating the hierarchical attention mechanism we use visualization as well as a saliency metric for the controller’s glimpses, defined as attnsaliency = 1 k Pk i=1 Sti for a controller trajectory (x, y)1, ..., (x, y)k, ˆyt at meta-controller time step t, then averaged over all time steps and examples. A high score means that the controller tends to pick salient points as glimpse locations. Implementation Details The activation and saliency model is a ResNet-34 network pre-trained on ImageNet. For MNIST experiments, the ResNet is fine-tuned on a single object MNIST Set dataset, and for SVHN is fine-tuned by randomly selecting one of an image’s labels each time a batch is sampled. Images are resized to 224x224, and the final (4th) convolutional layer is used (V ∈R512×7×7). Since the label sets vary in size, the model is trained with an extra "stop" class, and during inference greedy argmax sampling is used until the "stop" class is predicted. See Supplementary Materials section 1 for further details. 5.1 Experimental Evaluation In this section we analyze the model’s classification performance, the contribution of the proposed RL training, and the behavior of the hierarchical attention mechanism. Classification Performance Table 1 shows the evaluation metrics on the set-based and multiset-based classification tasks for the proposed hierarchical saliency-based model with RL training ("HSAL-RL") and the cross-entropy baseline ("Cross-Entropy") introduced above. HSAL-RL performs well across all metrics; on both the set and multiset tasks the model achieves very high precision, recall, and macro-F1 scores, but as expected, the multiset task is more difficult. We conclude that the proposed model and training process is effective for these set and multiset image classification tasks. Contribution of RL training As seen in Table 1, performance is greatly reduced when the standard cross-entropy training is used, which is not invariant to the label ordering. This shows the importance of the RL training, which only assumes that predictions are some permutation of the labels. Controller Attention Based on attnsaliency, the controller learns to glimpse in salient regions more often as training progresses, starting at 58.7 and ending at 126.5 (see graph in Supplementary Materials Section 2). The baseline, which does not have the reward signal for its glimpses, fails to improve over training (remaining near 25), demonstrating the importance and effectiveness of the controller’s glimpse rewards. Hierarchical Attention Visualization Figure 2 visualizes the hierarchical attention mechanism on three example inference processes. See Supplementary Materials Section 4 for more examples, which we discuss here. In general, the upper level attention highlights a region encompassing a digit, and 7 Figure 2: The inference process showing the hierarchical attention on three different examples. Each column represents a single meta-controller step, two controller glimpses, and classification. the lower level glimpses near the digit before classifying. Notice the saliency map update over time, the priority map’s structure due to the Gaussian attention mechanism, and the variable-sized focus of the priority map followed by finer-grained glimpses. Note that the predicted labels need not be in the same order as the ground truth labels (e.g. "689"), and that the model can predict multiple instances of a label (e.g. "33", "449"), illustrating multiset prediction. In some cases, the upper level attention is sufficient to classify the object without the controller taking related glimpses, as in "373", where the glimpses are in a blank region for the 7. In "722", the covert attention is initially placed on both the 7 and the 2, then the controller focuses only on the 7; this can be interpreted as using the multiple spotlight capability of covert attention, then directing overt attention to a single target. 5.2 Limitations Saliency Map Input Since the saliency map is the only top-level input, the quality of the saliency model is a potential performance bottleneck. As Figure 4 shows, in general there is no guarantee that all objects of interest will have high saliency relative to the locations around them. However, the modular architecture allows for plugging in alternative, rigorously evaluated saliency models such as a state-of-the-art saliency model trained with human fixation data [10]. Activation Resolution Currently, the activation model returns the highest-level convolutional activations, which have a 7x7 spatial dimension for a 224x224 image. Consider the case shown in Figure 3. Even if the controller acted optimally, activations for multiple digits would be included in its glimpse vector due to the low resolution. This suggests activations with higher spatial resolution are needed, perhaps by incorporating dilated convolutions [45] or using lower-level activations at attended areas, motivated by covert attention’s known enhancement of spatial resolution [6, 7, 14]. 6 Conclusion We proposed a novel architecture, attention mechanism, and RL-based training process for sequential image attention, supporting multiset classification. The proposal is a first step towards incorporating notions of saliency, covert and overt attention, and sequential processing motivated by the biological visual attention literature into deep learning architectures for downstream vision tasks. 8 Figure 3: The location of highest saliency from a 7x7 saliency map (right) is projected onto the 224x224 image (left). Figure 4: The cat is a label in the ground truth set but does not have high salience relative to its surroundings. Acknowledgments This work was partly supported by the NYU Global Seed Funding <Model-Free Object Tracking with Recurrent Neural Networks>, STCSM 17JC1404100/1, and Huawei HIPP Open 2017. References [1] Edward Awh and Harold Pashler. Evidence for split attentional foci. 26:834–46, 05 2000. [2] Jimmy Ba, Roger Grosse, Ruslan Salakhutdinov, and Brendan Frey. Learning wake-sleep recurrent attention models. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pages 2593–2601, Cambridge, MA, USA, 2015. MIT Press. [3] Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. arXiv preprint arXiv:1412.7755, 2014. [4] Miriam Bellver, Xavier Giro i Nieto, Ferran Marques, and Jordi Torres. Hierarchical object detection with deep reinforcement learning. arXiv preprint arXiv:1611.03718, 2016. [5] Juan C. Caicedo and Svetlana Lazebnik. Active object localization with deep reinforcement learning. In Proceedings of the 2015 IEEE International Conference on Computer Vision (ICCV), ICCV ’15, pages 2488–2496, Washington, DC, USA, 2015. IEEE Computer Society. [6] Marisa Carrasco. Visual attention: The past 25 years. Vision Research, 51(13):1484 – 1525, 2011. Vision Research 50th Anniversary Issue: Part 2. [7] Marisa Carrasco, Patrick E Williams, and Yaffa Yeshurun. Covert attention increases spatial resolution with or without masks: Support for signal enhancement. Journal of Vision, 2:467–479, 2002. [8] Patrick Cavanagh and George A. Alvarez. Tracking multiple targets with multifocal attention. Trends in Cognitive Sciences, 9(7):349 – 354, 2005. [9] Brian Cheung, Eric Weiss, and Bruno Olshausen. Emergence of foveal image sampling from learning to attend in visual scenes. arXiv preprint arXiv:1611.09430, 2016. [10] Marcella Cornia, Lorenzo Baraldi, Giuseppe Serra, and Rita Cucchiara. Predicting human eye fixations via an lstm-based saliency attentive model. arXiv preprint arXiv:1611.09571, 2016. [11] Marcella Cornia, Lorenzo Baraldi, Giuseppe Serra, and Rita Cucchiara. Paying more attention to saliency: Image captioning with saliency and context attention. arXiv preprint arXiv:1706.08474, 2017. [12] Peter Dayan and Geoffrey E. Hinton. Feudal reinforcement learning. In Advances in Neural Information Processing Systems 5, [NIPS Conference], pages 271–278, San Francisco, CA, USA, 1993. Morgan Kaufmann Publishers Inc. [13] Jillian H. Fecteau and Douglas P. Munoz. Salience, relevance, and firing: a priority map for target selection. Trends in Cognitive Sciences, 10(8):382 – 390, 2006. [14] Jason Fischer and David Whitney. Attention narrows position tuning of population responses in v1. Current Biology, 19(16):1356 – 1361, 2009. 9 [15] Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013. [16] Lisa Anne Hendricks, Zeynep Akata, Marcus Rohrbach, Jeff Donahue, Bernt Schiele, and Trevor Darrell. Generating visual explanations. In European Conference on (ECCV), 2016. [17] L. Itti, C. Koch, and E. Niebur. A model of saliency-based visual attention for rapid scene analysis. IEEE Transactions on Pattern Analysis and Machine Intelligence, 20(11):1254–1259, 1998. [18] Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. arXiv preprint arXiv:1506.02025, 2015. [19] Sergey Karayev, Tobias Baumgartner, Mario Fritz, and Trevor Darrell. Timely object recognition. In F. Pereira, C. J. C. Burges, L. Bottou, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 25, pages 890–898. Curran Associates, Inc., 2012. [20] C Koch and S Ullman. Shifts in selective visual attention: towards the underlying neural circuitry. Human neurobiology, 4(4):219–27, 1985. [21] Eileen Kowler. Eye movements: The Past 25 Years. Vision Research, 51(13):1457–1483, 7 2011. [22] Tejas D Kulkarni, Karthik Narasimhan, Ardavan Saeedi, and Josh Tenenbaum. Hierarchical deep reinforcement learning: Integrating temporal abstraction and intrinsic motivation. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 3675–3683. Curran Associates, Inc., 2016. [23] Victor A.F. Lamme and Pieter R. Roelfsema. The distinct modes of vision offered by feedforward and recurrent processing. Trends in Neurosciences, 23(11):571 – 579, 2000. [24] Hugo Larochelle and Geoffrey E Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In J. D. Lafferty, C. K. I. Williams, J. Shawe-Taylor, R. S. Zemel, and A. Culotta, editors, Advances in Neural Information Processing Systems 23, pages 1243–1251. Curran Associates, Inc., 2010. [25] Y. Li, X. Hou, C. Koch, J. M. Rehg, and A. L. Yuille. The secrets of salient object segmentation. In 2014 IEEE Conference on Computer Vision and Pattern Recognition, pages 280–287, June 2014. [26] Yuncheng Li, Yale Song, and Jiebo Luo. Improving pairwise ranking for multi-label image classification. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [27] Xiao Liu, Jiang Wang, Shilei Wen, Errui Ding, and Yuanqing Lin. Localizing by describing: Attribute-guided attention localization for fine-grained recognition. arXiv preprint arXiv:1605.06217, 2016. [28] S. Mathe, A. Pirinen, and C. Sminchisescu. Reinforcement learning for visual object detection. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 2894– 2902, June 2016. [29] Stefan Mathe and Cristian Sminchisescu. Action from still image dataset and inverse optimal control to learn task specific visual scanpaths. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 26, pages 1923–1931. Curran Associates, Inc., 2013. [30] Stephanie A McMains and David C Somers. Multiple Spotlights of Attentional Selection in Human Visual Cortex. Neuron, 42(4):677–686, 2004. [31] Volodymyr Mnih, Nicolas Heess, Alex Graves, and koray kavukcuoglu. Recurrent models of visual attention. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems 27, pages 2204–2212. Curran Associates, Inc., 2014. 10 [32] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading Digits in Natural Images with Unsupervised Feature Learning. [33] Raymond M. Klein. Inhibition of return. Trends in cognitive sciences, 4(4):138–147, 4 2000. [34] John Schulman, Nicolas Heess, Theophane Weber, and Pieter Abbeel. Gradient estimation using stochastic computation graphs. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pages 3528–3536, Cambridge, MA, USA, 2015. MIT Press. [35] Stanislau Semeniuta and Erhardt Barth. Image classification with recurrent attention models. In 2016 IEEE Symposium Series on Computational Intelligence (SSCI), pages 1–7. IEEE, 12 2016. [36] Paul Hongsuck Seo, Zhe Lin, Scott Cohen, Xiaohui Shen, and Bohyung Han. Progressive attention networks for visual attribute prediction. arXiv preprint arXiv:1606.02393, 2016. [37] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. [38] Hamed R. Tavakoli and Jorma Laaksonen. Towards instance segmentation with object priority: Prominent object detection and recognition. arXiv preprint arXiv:1704.07402, 2017. [39] Richard Veale, Ziad M. Hafed, and Masatoshi Yoshida. How is visual salience computed in the brain? Insights from behaviour, neurobiology and modelling. Philosophical Transactions of the Royal Society of London B: Biological Sciences, 372(1714), 2017. [40] Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. arXiv preprint arXiv:1703.01161, 2017. [41] Fei Wang, Mengqing Jiang, Chen Qian, Shuo Yang, Cheng Li, Honggang Zhang, Xiaogang Wang, and Xiaoou Tang. Residual attention network for image classification. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017. [42] Jiang Wang, Yi Yang, Junhua Mao, Zhiheng Huang, Chang Huang, and Wei Xu. Cnn-rnn: A unified framework for multi-label image classification. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. [43] Ronald J Williams. Simple Statistical Gradient-Following Algorithms for Connectionist Reinforcement Learning. Machine Learning, 8:229–256, 1992. [44] Kelvin Xu, Jimmy Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. arXiv preprint arXiv:1502.03044, 2015. [45] Fisher Yu and Vladlen Koltun. Multi-scale context aggregation by dilated convolutions. arXiv preprint arXiv:1511.07122, 2015. [46] Sergey Zagoruyko and Nikos Komodakis. Paying more attention to attention: Improving the performance of convolutional neural networks via attention transfer. arXiv preprint arXiv:1612.03928, 2016. [47] Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. 11
2017
11
6,575
Group Additive Structure Identification for Kernel Nonparametric Regression Pan Chao Department of Statistics Purdue University West Lafayette, IN 47906 panchao25@gmail.com Michael Zhu Department of Statistics, Purdue University West Lafayette, IN 47906 Center for Statistical Science Department of Industrial Engineering Tsinghua University, Beijing, China yuzhu@purdue.edu Abstract The additive model is one of the most popularly used models for high dimensional nonparametric regression analysis. However, its main drawback is that it neglects possible interactions between predictor variables. In this paper, we reexamine the group additive model proposed in the literature, and rigorously define the intrinsic group additive structure for the relationship between the response variable Y and the predictor vector X, and further develop an effective structure-penalized kernel method for simultaneous identification of the intrinsic group additive structure and nonparametric function estimation. The method utilizes a novel complexity measure we derive for group additive structures. We show that the proposed method is consistent in identifying the intrinsic group additive structure. Simulation study and real data applications demonstrate the effectiveness of the proposed method as a general tool for high dimensional nonparametric regression. 1 Introduction Regression analysis is popularly used to study the relationship between a response variable Y and a vector of predictor variables X. Linear and logistic regression analysis are arguably two most popularly used regression tools in practice, and both postulate explicit parametric models on f(X) = E[Y |X] as a function of X. When no parametric models can be imposed, nonparametric regression analysis can instead be performed. On one hand, nonparametric regression analysis is flexible and not susceptible to model mis-specification, whereas on the other hand, it suffers from a number of well-known drawbacks especially in high dimensional settings. Firstly, the asymptotic error rate of nonparametric regression deteriorates quickly as the dimension of X increases. [16] shows that with some regularity conditions, the optimal asymptotic error rate for estimating a dtimes differentiable function is O n−d/(2d+p) , where p is the dimensionality of X. Secondly, the resulting fitted nonparametric function is often complicated and difficult to interpret. To overcome the drawbacks of high dimensional nonparametric regression, one popularly used approach is to impose the additive structure [5] on f(X), that is to assume that f(X) = f1(X1) + · · ·+fp(Xp) where f1, . . . , fp are p unspecified univariate functions. Thanks to the additive structure, the nonparametric estimation of f or equivalently the individual fi’s for 1 ≤i ≤p becomes efficient and does not suffer from the curse of dimensionality. Furthermore, the interpretability of the resulting model has also been much improved. The key drawback of the additive model is that it does not assume interactions between the predictor variables. To address this limitation, functional ANOVA models were proposed to accommodate higher order interactions, see [4] and [13]. For example, by neglecting interactions of 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. order higher than 2, the functional ANOVA model can be written as f(X) = Pp i=1 fi(Xi) + P 1≤i,j≤p fij(Xi, Xj), with some marginal constraints. Another higher order interaction model, f(X) = PD d=1 P 1≤i1,...,id≤p fj(Xi1, . . . , Xid), is proposed by [6]. This model considers all interactions of order up to D, which is estimated by Kernel Ridge Regression (KRR) [10] with the elementary symmetric polynomial (ESP) kernel. Both of the two models assume the existence of possible interactions between any two or more predictor variables. This can lead to a serious problem, that is, the number of nonparametric functions that need to be estimated quickly increases as the number of predictor variables increases. There exists another direction to generalize the additive model. When proposing the Optimal Kernel Group Transformation (OKGT) method for nonparametric regression, [11] considers the additive structure of predictor variables in groups instead of individual predictor variables. Let G := {uj}d j=1 be a index partition of the predictor variables, that is, uj ∩uk = ∅if j ̸= k and ∪d j=1uj = {1, . . . , p}. Let Xuj = {Xk; k ∈uj} for j = 1, . . . , d. Then {X1, . . . , Xd} = Xu1 ∪· · · ∪Xud. For any function f(X), if there exists an index partition G = {u1, . . . , ud} such that f(X) = fu1(Xu1) + . . . + fud(Xud), (1) where fu1(Xu1), . . . , fud(Xud) are d unspecified nonparametric functions, then it is said that f(X) admits the group additive structure G. We also refer to (1) as a group additive model for f(X). It is clear that the usual additive model is a special case with G = {(1), . . . , (p)}. Suppose Xj1 and Xj2 are two predictor variables. Intuitively, if Xj1 and Xj2 interact to each other, then they must appear in the same group in an reasonable group additive structure of f(X). On the other hand, if Xj1 and Xj2 belong to two different groups, then they do not interact with each other. Therefore, in terms of accommodating interactions, the group additive model can be considered lying in the middle between the original additive model and the functional ANOVA or higher order interaction models. When the group sizes are small, for example all are less than or equal to 3, the group additive model can maintain the estimation efficiency and interpretability of the original additive model while avoiding the problem of a high order model discussed earlier. However, in [11], there are two important issues not addressed. First, the group additive structure may not be unique, which will lead to the nonidentifiability problem for the group additive model. (See discussion in Section 2.1). Second, [11] has not proposed a systematic approach to identify the group additive structure. In this paper, we intend to resolve these two issues. To address the first issue, we rigorously define the intrinsic group additive structure for any square integrable function, which in some sense is the minimal group additive structure among all correct group additive structures. To address the second issue, we propose a general approach to simultaneously identifying the intrinsic group additive structure and estimating the nonparametric functions using kernel methods and Reproducing Kernel Hilbert Spaces (RKHSs). For a given group additive structure G = {u1, . . . , ud}, we first define the corresponding direct sum RKHS as HG = Hu1 ⊕· · · ⊕Hud where Hui is the usual RKHS for the variables in uj only for j = 1, . . . , d. Based on the results on the capacity measure of RKHSs in the literature, we derive a tractable capacity measure of the direct sum RKHS HG which is further used as the complexity measure of G. Then, the identification of the intrinsic group additive structure and the estimation of the nonparametric functions can be performed through the following minimization problem ˆf, ˆG = arg min f∈HG,G 1 n n X i=1 (yi −f(xi))2 + λ∥f∥2 HG + µC(G). We show that when the novel complexity measure of group additive structure C(G) is used, the minimizer ˆG is consistent for the intrinsic group additive structure. We further develop two algorithms, one uses exhaustive search and the other employs a stepwise approach, for identifying true additive group structures under the small p and large p scenarios. Extensive simulation study and real data applications show that our proposed method can successfully recover the true additive group structures in a variety of model settings. There exists a connection between our proposed group additive model and graphical models ([2], [7]). This is especially true when a sparse block structure is imposed [9]. However, a key difference exists. Let’s consider the following example. Y = sin(X1 + X2 2 + X3) + cos(X4 + X5 + X2 6) + ϵ. A graphical model typically considers the conditional dependence (CD) structure among all of the 2 variables including X1, . . . , X6 and Y , which is more complex than the group additive (GA) structure {(X1, X2, X3), (X4, X5, X6)}. The CD structure, once known, can be further examined to infer the GA structure. In this paper, we however proposed methods that directly target the GA structure instead of the more complex CD structure. The rest of the paper is organized as follows. In Section 2, we rigorously formulate the problem of Group Additive Structure Identification (GASI) for nonparametric regression and propose the structural penalty method to solve the problem. In Section 3, we prove the selection consistency for the method. We report the experimental results based on simulation studies and real data application in Section 4 and 5. Section 6 concludes this paper with discussion. 2 Method 2.1 Group Additive Structures In the Introduction, we discussed that the group additive structure for f(X) may not be unique. Here is an example. Consider the model Y = 2 + 3X1 + 1/(1 + X2 2 + X2 3) + arcsin ((X4 + X5)/2) + ϵ, where ϵ is the 0 mean error independent of X. According to our definition, this model admits the group additive structure G0 = {(1) , (2, 3) , (4, 5)}. Let G1 = {(1, 2, 3) , (4, 5)} and G2 = {(1, 4, 5) , (2, 3)}. The model can also be said to admit G1 and G2. However, there exists a major difference between G0, G1 and G2. While the groups in G0 cannot be further divided into subgroups, both G1 and G2 contain groups that can be further split. We define the following partial order between group structures to characterize the difference and their relationship. Definition 1. Let G and G′ be two group additive structures. If for every group u ∈G there is a group v ∈G′ such that u ⊆v, then G is called a sub group additive structure of G′. This relation is denoted as G ≤G′. Equivalently, G′ is a super group additive structure of G, denoted as G′ ≥G. In the previous example, G0 is a sub group additive structure of both G1 and G2. However, the order between G1 and G2 is not defined. Let X := [0, 1]p be the p-dimensional unit cube for all the predictor variables X with distribution PX. For a group of predictor variables u, we define the space of square integrable functions as L2 u(X) := {g ∈L2 PX(X) | g(X) = fu(Xu)}, that is L2 u contains the functions that only depend on the variables in group u. Then the group additive model f(X) = Pd j=1 fuj(Xuj) is a member of the direct sum function space defined as L2 G(X) := ⊕u∈GL2 u(X). Let |u| be the cardinality of the group u. If u is the only group in a group additive structure and |u| = p, then L2 u = L2 G and f is a fully non-parametric function. The following proposition shows that the order of two different group additive structures is preserved by their corresponding square integrable function spaces. Proposition 1. Let G1 and G2 be two group additive structures. If G1 ≤G2, then L2 G1 ⊆L2 G2. Furthermore, if X1, . . . , Xp are independent and G1 ̸= G2, then L2 G1 ⊂L2 G2. Definition 2. Let f(X) be an square integrable function. For a group additive structure G, if there is a function fG ∈L2 G such that fG = f, then G is called an amiable group additive structure for f. In the example discussed in the beginning of the subsection, G0, G1 and G2 are all amiable group structures. So amiable group structures may not be unique. Proposition 2. Suppose G is an amiable group additive structure for f. If there is a second group additive structure G′ such that G ≤G′, then G′ is also amiable for f. We denote the collection of all amiable group structures for f(X) as Ga, which is partially ordered and complete. Therefore, there exists a minimal group additive structure in Ga, which is the most concise group additive structure for the target function. We state this result as a theorem. Theorem 1. Let Ga be the set of amiable group additive structures for f. There is a unique minimal group additive structure G∗∈Ga such that G∗≤G for all G ∈Ga, where the order is given by Definition 1. G∗is called the intrinsic group additive structure for f. For statistical modeling, G∗achieves the greatest dimension reduction for the relationship between Y and X. It induces the smallest function space which includes the model. In general, the intrinsic group structure can help much mitigate the curse of dimensionality while improving both efficiency and interpretability of high dimensional nonparametric regression. 3 2.2 Kernel Method with Known Intrinsic Group Additive Structure Suppose the intrinsic group additive structure for f(X) = E[Y |X] is known to be G∗= {uj}d j=1, that is, f(X) = fu1(Xu1) + · · · + fud(Xud). Then, we will use the kernel method to estimate the functions fu1, fu2, . . ., fud. Let (Kuj, Huj) be the kernel and its corresponding RKHS for the j-th group uj. Then using kernel methods is to solve ˆfλ,G∗= arg min fG∗∈HG∗ ( 1 n n X i=1 (yi −fG∗(xi))2 + λ∥fG∗∥2 HG∗ ) , (2) where HG∗:= {f = Pd j=1 fuj | fuj ∈Huj}. The subscripts of ˆf are used to explicitly indicate its dependence on the group additive structure G∗and tuning parameter λ. In general, an RKHS is usually smaller than the L2 space defined on the same input domain. So, it is not always true that ˆfλ,G∗achieves f. However, one can choose to use universal kernels Kuj so that their corresponding RKHSs are dense in the L2 spaces (see [3], [15]). Using universal kernels allows ˆfλ,G∗to not only achieve unbiasedness but also recover the group additive structure of f(X). This is the fundamental reason for the consistency property of our proposed method to identify the intrinsic group additive structure. Two examples of universal kernel are Gaussian and Laplace. 2.3 Identification of Unknown Intrinsic Group Additive Structure 2.3.1 Penalization on Group Additive Structures The success of the kernel method hinges on knowing the intrinsic group additive structure G∗. In practice, however, G∗is seldom known, and it may be of primary interest to identify G∗while estimating a group additive model. Recall that in Subsection 2.1, we have shown that G∗exists and is unique. The other group additive structures belong to two categories, amiable and non-amiable. Let’s consider an arbitrary non-amiable group additive structure G ∈G \ Ga first. If G is used in the place of G∗in (2), the solution ˆfλ,G, as an estimator of f, will have a systematic bias because the L2 distance between any function fG ∈HG and the true function f will be bounded below. In other words, using a non-amiable structure will result in poor fitting of the model. Next we consider an arbitrary amiable group additive structure G ∈Ga to be used in (2). Recall that because G is amiable, we have fG∗= fG almost surely (in population) for the true function f(X). The bias of the resulting fitted function ˆfλ,G will vanish as the sample size increases. Although their asymptotic rates are in general different, under fixed sample size n, simply using goodness of fit will not be able to distinguish G from G∗. The key difference between G∗and G is their structural complexities, that is, G∗is the smallest among all amiable structures (i.e. G∗≤G, ∀G ∈Ga). Suppose a proper complexity measure of a group additive structure G can be defined (to be addressed in the next section) and is denoted as C(G). We can then incorporate C(G) into (2) as an additional penalty term and change the kernel method to the following structure-penalized kernel method. ˆfλ,µ, ˆG = arg min fG∈HG,G ( 1 n n X i=1 (yi −fG(xi))2 + λ∥fG∥2 HG + µC(G) ) . (3) It is clear that the only difference between (2) and (3) is the term µC(G). As discussed above, the intrinsic group additive structure G∗can achieve the goodness of fit represented by the first two terms in (3) and the penalty on the structural complexity represented by the last term. Therefore, by properly choosing the tuning parameters, we expect that ˆG is consistent in that the probability ˆG = G∗increases to one as n increases (see the Theory Section below). In the next section, we derive a tractable complexity measure for a group additive structure. 2.3.2 Complexity Measure of Group additive Structure It is tempting to propose an intuitive complexity measure for a group additive structure C(·) such that C(G1) ≤C(G2) whenever G1 ≤G2. The intuition however breaks down or at least becomes less clear when the order between G1 and G2 cannot be defined. From Proposition 1, it is known that when G1 < G2, we have L2 G1 ⊂L2 G2. It is not difficult to show that it is also true that when 4 G1 < G2, then HK,G1 ⊂HK,G2. This observation motivates us to define the structural complexity measure of G through the capacity measure of its corresponding RKHS HG. There exist a number of different capacity measures for RKHSs in the literature, including entropy [18], VC dimensions [17], Rademacher complexity [1], and covering numbers ([14], [18]). After investigating and comparing different measures, we use covering number to design a practically convenient complexity measure for group additive structures. It is known that an RKHS HK can be embedded in the continuous function space C(X) (see [12], [18]), with the inclusion mapping denoted as IK : HK →C(X). Let HK,r = {h : ∥h∥Hk ≤ r, and h ∈HK} be an r-ball in HK and I (HK,r) be the closure of I (HK,r) ⊆C(X). One way to measure the capacity of HK is through the covering number of I (HK,r) in C(X), denoted as N(ϵ, I (HK,r), d∞), which is the smallest cardinalty of a subset S of C(X) such that I (HK,r) ⊂ ∪s∈S{t ∈C(X) : d∞(t, s) ≤ϵ}. Here ϵ is any small positive value and d∞is the sup-norm. The exact formula for N(ϵ, I (HK,r), d∞) is in general not available. Under certain conditions, various upper bounds have been obtained in the literature. One such upper bound is presented below. When K is a convolution kernel, i.e. K(x, t) = k(x −t), and the Fourier transform of k decays exponentially, then it is given in [18] that ln N  ϵ, I(HK,r), d∞  ≤Ck,p  ln r ϵ p+1 , (4) where Ck,p is a constant depending on the kernel function k and input dimension p. In particular, when K is a Gaussian kernel, [18] has obtained more elaborate upper bounds. The upper bound in (4) depends on r and ϵ through ln(r/ϵ). When ϵ →0 with r being fixed (e,g. r = 1 when a unit ball is considered), (ln(r/ϵ))p+1 dominates the upper bound. According to [8], the growth rate of N (ϵ, IK) or its logarithm can be viewed as a capacity measure of RKHS. So we use (ln(r/ϵ))p+1 as the capacity measure, which can be reparameterized as αp+1 with α = ln(r/ϵ). Let C(Hk) denote the capacity measure of Hk, which is defined as C(Hk) = (ln(r/ϵ))p+1 = α(ϵ)p+1. We know ϵ is the radius of a covering ball, which is the unit of measurement we use to quantify the capacity. The capacity of two RKHSs with different input dimensions are easier to be differentiated when ϵ is small. This gives an interpretation of α. We have defined a capacity measure for a general RKHS. In Problem (3), the model space HG is a direct sum of a number of RKHSs. Let G = {u1, . . . , ud}; let HG, Hu1, . . . , Hud be the RKHSs corresponding to G, u1, . . . , ud, respectively; let IG, Iu1, . . . , Iud be the inclusion mappings of HG, Hu1, . . . , Hud into C(X). Then, we have the following proposition. Proposition 3. Let G be a group additive structure and HG be the induced direct sum RKHS defined in (3). Then, we have the following inequality relating the covering number of HG and the covering numbers of Huj ln N (ϵ, IG, d∞) ≤ d X j=1 ln N  ϵ |G|, Iuj, d∞  , (5) where |G| denotes the number of groups in G. By applying Proposition 3 and using the parameterized upper bound, we have ln N (ϵ, IG, d∞) = O P u∈G α(ϵ)|u|+1 . The rate can be used as the explicit expression of the complexity measure for group additive structures, that is C(G) = Pd j=1 α(ϵ)|uj|+1. Recall that there is another tuning parameter µ which controls the effect of the complexity of group structure on the penalized risk. By combining the common factor 1 in the exponent with µ, we could further simplify the penalty’s expression. Thus, we have the following explicit formulation for GASI ˆfλ,µ, ˆG = arg min fG∈HG,G    n X i=1 (yi −fG(xi))2 + λ∥fG∥2 HG + µ d X j=1 α|uj|   . (6) 5 2.4 Estimation We assume that the value of λ is given. In practice, λ can be tuned separately. If the values of µ and α are also given, Problem (6) can be solved by following a two-step procedure. First, when the group structure G is known, fu can be estimated by solving the following problem ˆRλ G = min fG∈HG ( 1 n n X i=1 (yi −fG(xi))2 + λ ∥fG∥2 HG ) . (7) Second, the optimal group structure is chosen to achieve both small fitting error and complexity, i.e. ˆG = arg min G∈G    ˆRλ G + µ d X j=1 α|uj|   . (8) The two-step procedure above is expected to identify the intrinsic group structure, that is, ˆG = G∗. Recall a group structure belongs to one of the three categories, intrinsic, amiable, or non-amiable structures. If G is non-amiable, then ˆRλ G is expected to be large, because G is a wrong structure which will result in a biased estimate. If G is amiable, though ˆRλ G is expected to be small, the complexity penalty of G is larger than that for G∗. As a consequence, only G∗can simultaneously achieve a small ˆRλ G∗and a relatively small complexity. Therefore, when the sample size is large enough, we expect ˆG = G∗with high probability. If the values of µ and α are not given, a separate validation set can be used to select tuning parameters. The two-step estimation is summarized in Algorithm 1. When a model contains a large number of predictor variables, such exhaustive search suffers high computational cost. In order to apply GASI on a large model, we propose a backward stepwise algorithm which is illustrated in Algorithm 2. Algorithm 1: Exhaustive Search w/ Validation 1: Split data into training (T ) and validation (V) sets. 2: for (µ, α) in grid do 3: for G ∈G do 4: ˆRG, ˆfG ←solve (7) using G; 5: Calculate the sum in (8), denoted by ˆRpen,µ,α G ; 6: end for 7: ˆGµ,α ←arg minG∈G ˆRpen,µ,α G ; 8: ˆyV ←ˆf b Gµ,α(xV); 9: e2 b Gµ,α ←∥yV −ˆyV∥2; 10: end for 11: µ∗, α∗←arg minµ,α e2 b Gµ,α; 12: G∗←ˆGµ∗,α∗; Algorithm 2: Basic Backward Stepwise 1: Start with the group structure {(1, . . . , p)}; 2: Solve (6) and obtain its minimum value ˆRpen G ; 3: for each predictor variable j do 4: G′ ←either split j as a new group or add to an existing group; 5: Solve (6) and obtain its minimum value ˆRpen G′; 6: if ˆRpen G′ < ˆRpen G then 7: Keep G′ as the new group structure; 8: end if 9: end for 10: return G′; 3 Theory In this section, we prove that the estimated group additive structure ˆG as a solution to (6) is consistent, that is the probability P( ˆG = G∗) goes to 1 as the sample size n goes to infinity. The proof and supporting lemmas are included in the supplementary material. Let R(fG) = E[(Y −f(X))2] denote the population risk of a function f ∈HG, and ˆR(f) = 1 n Pn i=1(yi −f(xi))2 be the empirical risk. First, we show that for any amiable structure G ∈Ga, its minimized empirical risk ˆR( ˆfG) converges in probability to the optimal population risk R(f ∗ G∗) achieved by the intrinsic group additive structure. Here ˆfG denotes the minimizer of Problem (7) with the given G, and f ∗ G∗denotes the minimizer of the population risk when the intrinsic group structure is used. The result is given below as Proposition 4. Proposition 4. Let G∗be the intrinsic group additive structure, G ∈Ga a given amiable group structure, and HG∗and HG the respective direct sum RKHSs. If ˆf λ G ∈HG is the optimal solution of 6 ID Model Intrinsic Group Structure M1 y = 2x1 + x2 2 + x3 3 + sin(πx4) + log(x5 + 5) + |x6| + ϵ {(1) , (2) , (3) , (4) , (5) , (6)} M2 y = 1 1+x2 1 + arcsin x2+x3 2  + arctan (x4 + x5 + x6)3 + ϵ {(1) , (2, 3) , (4, 5, 6)} M3 y = arcsin x1+x3 2  + 1 1+x2 2 + arctan (x4 + x5 + x6)3 + ϵ {(1, 3) , (2) , (4, 5, 6)} M4 y = x1 · x2 + sin((x3 + x4) · π) + log(x5 · x6 + 10) + ϵ {(1, 2) , (3, 4) , (5, 6)} M5 y = exp np x2 1 + x2 2 + x2 3 + x2 4 + x2 5 + x2 6 o + ϵ {(1, 2, 3, 4, 5, 6)} Table 1: Selected models for the simulation study using the exhaustive search method and the corresponding additive group structures. Problem (7), then for any ϵ > 0, we have P  | b R( ˆfG) −R(f ∗ G∗)| > ϵ  ≤12n · exp (X u∈G ln N  ϵ 12|G|, Hu, d∞  −ϵ2n 144 ) + 12n · exp (X u∈G ln N  ϵ 12|G|, Hu, d∞  −n  ϵ 24 −λn∥f ∗ G∗∥2 12 2) . (9) Note that λn in (9) must be chosen such that ϵ/24 −λn∥f ∗ G∗∥2/12 is positive. For a fixed p, the number of amiable group additive structures is finite. Using a Bonferroni type of technique, we can in fact obtain a uniform upper bound for all of the amiable group additive structures in Ga. Theorem 2. Let Ga be the set of all amiable group structures. For any ϵ > 0 and n > 2/ϵ2, we have P  sup G∈Ga| b Rg( ˆf λ G) −Rg(f ∗ G∗)| > ϵ  ≤12n|Ga| · " exp  max G∈Ga ln N  ϵ 12, HG, d∞  −ϵ2n 144  + exp ( max G∈Ga ln N  ϵ 12, HG, d∞  −n  ϵ 24 −λn∥f ∗ G∗∥2 12 2) # (10) Next we consider a non-amiable group additive structure G′ ∈G \ Ga. It turns out that ˆR( ˆfG) fails to converge to R(f ∗ G∗), and | ˆR( ˆfG) −R(f ∗ G∗)| converges to a positive constant. Furthermore, because the number of non-amiable group additive structures is finite, we can show that | ˆR( ˆfG) −R(f ∗ G∗)| is uniformly bounded below from zero with probability going to 1. We state the results below. Theorem 3. (i) For a non-amiable group structure G ∈G \ Ga, there exists a constant C > 0 such that | ˆRg( ˆf λ G) −Rg(f ∗ G∗)| converges to C in probability. (ii) There exits a constant ˜C such that P(| ˆRg( ˆf λ G) −Rg(f ∗ G∗)| > ˜C for all G ∈G \ Ga) goes to 1 as n goes to infinity. By combining Theorem 2 and Theorem 3, we can prove consistency for our GASI method. Theorem 4. Let λn ∗n →0. By choosing a proper tuning parameter µ > 0 for the structural penalty , the estimated group structure ˆG is consistent for the intrinsic group additive structure G∗, that is, P( ˆG = G∗) goes to one as the sample size n goes to infinity. 4 Simulation In this section, we evaluate the performance of GASI using synthetic data. Table 1 lists the five models we are using. Observations of X are simulated independently from N(0, 1) in M1, Unif(−1, 1) in M2 and M3, and Unif(0, 2) in M4 and M5. The noise ϵ is i.i.d. N(0, 0.012). The grid values of µ are equally spaced in [1e−10, 1/64] on a log-scale and each α is an integer in [1, 10]. We first show that GASI has the ability to identify the intrinsic group additive structure. The two-step procedure is carried out for each (µ, α) pair multiple times. If there are (µ, α) pairs for each model that the true group structure can be often identified, then GASI has the power to identify true group structures. We also apply Algorithm 1 which uses an additional validation set to select the parameters. We simulate 100 different samples for each model. The frequency of the true group structure being identified is calculated for each (µ, α). 7 Model Max freq. µ α Max freq. µ α Max freq. µ α M1 100 1.2500e-06 10 59 1.2500e-06 4 99 1.5625e-02 10 M2 97 1.2500e-06 8 89 1.2500e-06 7 70 1.3975e-04 9 M3 97 1.2500e-06 9 89 1.2500e-06 7 65 1.3975e-04 8 M4 100 1.2500e-06 7 99 1.2500e-06 4 1 1.3975e-04 8 M5 100 1.2500e-06 1 100 1.2500e-06 1 100 1.2500e-06 1 Table 2: Maximum frequencies that the intrinsic group additive structures are identified for the five models using exhaustive search algorithm without parameter tuning (left panel), with parameter tuning (middle panel) and stepwise algorithm (right panel). If different pairs share the same max frequency, a pair is randomly chosen. Figure 1: Estimated transformation functions for selected groups. Top-left: group (1, 6), top-right: group (3), bottom-left: group (5, 8), bottom-right: group (10, 12). In Table 2, we report the maximum frequency and the corresponding (µ, α) for each model. The complete results are included in the supplementary material. It can be seen from the left panel that the intrinsic group additive structures can be successfully identified. When the parameters are tuned, the middle panel shows that the performance of Model 1 deteriorated. This might be caused by the estimation method (KRR to solve Problem (7)) used in the algorithm. It could also be affected by λ. When the number of predictor variables increases, we use a backward stepwise algorithm. We apply Algorithm 2 on the same models. The results are reported in the right panel in Figure 2. The true group structures could be identified most of time for Model 1, 2, 3, 5. The result of Model 4 is not satisfying. Since stepwise algorithm is greedy, it is possible that the true group structures were never visited. Further research is needed to develop a better algorithms. 5 Real Data In this section, we report the results of applying GASI on the Boston Housing data (another real data application is reported in the supplementary material). The data includes 13 predictor variables used to predict the house median value. The sample size is 506. Our goal is to identify a probable group additive structure for the predictor variables. The backward algorithm is used and the tuning parameters µ and α are selected via 10-fold CV. The group structure that achieves the lowest average validation error is {(1, 6) , (2, 11) , (3) , (4, 9) , (5, 8) , (7, 13) , (10, 12)}, which is used for further investigation. Then the nonparametric functions for each group were estimated using the whole data set. Because each group contains no more than two variables, the estimated functions can be visualized. Figure 1 shows the selected results. It is interesting to see some patterns emerging in the plots. For example, the top-left plot shows the function of the average number of rooms per dwelling and per capita crime rate by town. We can see the house value increases with more rooms and decreases as the crime rate increases. However, when the crime rate is low, smaller sized houses (4 or 5 rooms) seem to be preferred. The top-right plot 8 shows that there is a changing point in terms of how house value is related to the size of non-retail business in the area. The value initially drops when the percentage of non-retail business is small, then increases at around 8%. The increase in the value might be due to the high demand of housing from the employees of those business. 6 Discussion We use group additive model for nonparametric regression and propose a RKHS complexity penalty based approach for identifying the intrinsic group additive structure. There are two main directions for future research. First, our penalty function is based on the covering number of RKHSs. It is of interest to know if there exists other more effective penalty functions. Second, it is of great interest to further improve the proposed method and apply it in general high dimensional nonparametric regression. 9 References [1] P. L. Bartlett and S. Mendelson. Rademacher and gaussian complexities: Risk bounds and structural results. The Journal of Machine Learning Research, 3:463–482, 2003. [2] C. M. Bishop. Pattern Recognition and Machine Learning (Information Science and Statistics). SpringerVerlag New York, Inc., Secaucus, NJ, USA, 2006. [3] C. Carmeli, E. De Vito, A. Toigo, and V. Umanitá. Vector valued reproducing kernel hilbert spaces and universality. Analysis and Applications, 8(01):19–61, 2010. [4] C. Gu. Smoothing spline ANOVA models, volume 297. Springer Science & Business Media, 2013. [5] T. Hastie and R. Tibshirani. Generalized additive models. Statistical science, pages 297–310, 1986. [6] K. Kandasamy and Y. Yu. Additive approximations in high dimensional nonparametric regression via the salsa. In Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, ICML’16, pages 69–78. JMLR.org, 2016. [7] D. Koller and N. Friedman. Probabilistic Graphical Models: Principles and Techniques - Adaptive Computation and Machine Learning. The MIT Press, 2009. [8] T. Kühn. Covering numbers of Gaussian reproducing kernel Hilbert spaces. Journal of Complexity, 27(5):489–499, 2011. [9] B. M. Marlin and K. P. Murphy. Sparse gaussian graphical models with unknown block structure. In Proceedings of the 26th Annual International Conference on Machine Learning, ICML ’09, pages 705–712, New York, NY, USA, 2009. ACM. [10] K. P. Murphy. Machine learning: a probabilistic perspective. MIT press, 2012. [11] C. Pan, Q. Huang, and M. Zhu. Optimal kernel group transformation for exploratory regression analysis and graphics. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 905–914. ACM, 2015. [12] T. Poggio and C. Shelton. On the mathematical foundations of learning. American Mathematical Society, 39(1):1–49, 2002. [13] J. O. Ramsay and B. W. Silverman. Applied functional data analysis: methods and case studies, volume 77. Citeseer, 2002. [14] A. J. Smola and B. Schölkopf. Learning with kernels. Citeseer, 1998. [15] I. Steinwart and A. Christmann. Support vector machines. Springer Science & Business Media, 2008. [16] C. J. Stone. Optimal global rates of convergence for nonparametric regression. The annals of statistics, pages 1040–1053, 1982. [17] V. Vapnik. The nature of statistical learning theory. Springer Science & Business Media, 2013. [18] D.-X. Zhou. The covering number in learning theory. Journal of Complexity, 18(3):739 – 767, 2002. 10
2017
110
6,576
A multi-agent reinforcement learning model of common-pool resource appropriation Julien Perolat⇤ DeepMind London, UK perolat@google.com Joel Z. Leibo⇤ DeepMind London, UK jzl@google.com Vinicius Zambaldi DeepMind London, UK vzambaldi@google.com Charles Beattie DeepMind London, UK cbeattie@google.com Karl Tuyls University of Liverpool Liverpool, UK karltuyls@google.com Thore Graepel DeepMind London, UK thore@google.com Abstract Humanity faces numerous problems of common-pool resource appropriation. This class of multi-agent social dilemma includes the problems of ensuring sustainable use of fresh water, common fisheries, grazing pastures, and irrigation systems. Abstract models of common-pool resource appropriation based on non-cooperative game theory predict that self-interested agents will generally fail to find socially positive equilibria—a phenomenon called the tragedy of the commons. However, in reality, human societies are sometimes able to discover and implement stable cooperative solutions. Decades of behavioral game theory research have sought to uncover aspects of human behavior that make this possible. Most of that work was based on laboratory experiments where participants only make a single choice: how much to appropriate. Recognizing the importance of spatial and temporal resource dynamics, a recent trend has been toward experiments in more complex real-time video game-like environments. However, standard methods of noncooperative game theory can no longer be used to generate predictions for this case. Here we show that deep reinforcement learning can be used instead. To that end, we study the emergent behavior of groups of independently learning agents in a partially observed Markov game modeling common-pool resource appropriation. Our experiments highlight the importance of trial-and-error learning in commonpool resource appropriation and shed light on the relationship between exclusion, sustainability, and inequality. 1 Introduction Natural resources like fisheries, groundwater basins, and grazing pastures, as well as technological resources like irrigation systems and access to geosynchronous orbit are all common-pool resources (CPRs). It is difficult or impossible for agents to exclude one another from accessing them. But whenever an agent obtains an individual benefit from such a resource, the remaining amount available for appropriation by others is ever-so-slightly diminished. These two seemingly-innocent properties of CPRs combine to yield numerous subtle problems of motivation in organizing collective action [12, 26, 27, 6]. The necessity of organizing groups of humans for effective CPR appropriation, combined with its notorious difficulty, has shaped human history. It remains equally critical today. ⇤indicates equal contribution 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Renewable natural resources† have a stock component and a flow component [10, 35, 7, 26]. Agents may choose to appropriate resources from the flow. However, the magnitude of the flow depends on the state of the stock‡. Over-appropriation negatively impacts the stock, and thus has a negative impact on future flow. Agents secure individual rewards when they appropriate resource units from a CPR. However, the cost of such appropriation, felt via its impact on the CPR stock, affects all agents in the community equally. Economic theory predicts that as long as each individual’s share of the marginal social cost is less than their marginal gain from appropriating an additional resource unit, agents will continue to appropriate from the CPR. If such over-appropriation continues unchecked for too long then the CPR stock may become depleted, thus cutting off future resource flows. Even if an especially clever agent were to realize the trap, they still could not unilaterally alter the outcome by restraining their own behavior. In other words, CPR appropriation problems have socially-deficient Nash equilibria. In fact, the choice to appropriate is typically dominant over the choice to show restraint (e.g. [32]). No matter what the state of the CPR stock, agents prefer to appropriate additional resources for themselves over the option of showing restraint, since in that case they receive no individual benefit but still endure the cost of CPR exploitation by others. (a) Open map (b) Small map with agent’s observation Figure 1: (a) The initial state of the Commons Game at the start of each episode on the large open map used in sections 3.2, 3.3, and 3.5. Apples are green, walls are grey, and players are red or blue. (b) The initial state of the small map used for the single-agent experiment (Section 3.1). The size of the window of pixels a player receives as an observation is also shown. Nevertheless, despite such pessimistic theoretical predictions, human communities frequently are able to self-organize to solve CPR appropriation problems [26, 28, 27, 6]. A major goal of laboratory-based behavioral work in this area is to determine what it is about human behavior that makes this possible. Being based on behavioral game theory [4], most experimental work on human CPR appropriation behavior features highly abstracted environments where the only decision to make is how much to appropriate (e.g. [29]). The advantage of such a setup is that the theoretical predictions of non-cooperative game theory are clear. However, this is achieved by sacrificing the opportunity to model spatial and temporal dynamics which are important in real-world CPRs [26]. This approach also downplays the role of trial-and-error learning. One recent line of behavioral research on CPR appropriation features significantly more complex environments than the abstract matrix games that came before [16, 18, 17, 14, 15]. In a typical experiment, a participant controls the movements of an on-screen avatar in a real-time video game-like environment that approximates a CPR with complex spatial and temporal dynamics. They are compensated proportionally to the amount of resources they collect. Interesting behavioral results have been obtained with this setup. For example, [18] found that participants often found cooperative solutions that relied on dividing the CPR into separate territories. However, due to the increased complexity of the environment model used in this new generation of experiments, the standard tools of noncooperative game theory can no longer be used to generate predictions. We propose a new model of common-pool resource appropriation in which learning takes the center stage. It consists of two components: (1) a spatially and temporally dynamic CPR environment, similar to [17], and (2) a multi-agent system consisting of N independent self-interested deep reinforcement learning agents. On the collective level, the idea is that self-organization to solve CPR appropriation problems works by smoothly adjusting over time the incentives felt by individual agents through a process akin to trial and error. This collective adjustment process is the aggregate result of all the many individual agents simultaneously learning how best to respond to their current situation. †Natural resources may or may not be renewable. However, this paper is only concerned with those that are. ‡CPR appropriation problems are concerned with the allocation of the flow. In contrast, CPR provision problems concern the supply of the stock. This paper only addresses the appropriation problem and we will say no more about CPR provision. See [7, 26] for more on the distinction between the two problems. 2 This model of CPR appropriation admits a diverse range of emergent social outcomes. Much of the present paper is devoted to developing methodology for analyzing such emergence. For instance, we show how behavior of groups may be characterized along four social outcome metrics called: efficiency, equality, sustainability, and peace. We also develop an N-player empirical game-theoretic analysis that allows one to connect our model back to standard non-cooperative game theory. It allows one to determine classical game-theoretic properties like Nash equilibria for strategic games that emerge from learning in our model. Our point is not to argue that we have a more realistic model than standard non-cooperative game theory. This is also a reductionist model. However, it emphasizes different aspects of real-world CPR problems. It makes different assumptions and thus may be expected to produce new insights for the general theory of CPR appropriation that were missed by the existing literature’s focus on standard game theory models. Our results are broadly compatible with previous theory while also raising a new possibility, that trial-and-error learning may be a powerful mechanism for promoting sustainable use of the commons. 2 Modeling and analysis methods 2.1 The commons game The goal of the Commons Game is to collect “apples” (resources). The catch is that the apple regrowth rate (i.e. CPR flow) depends on the spatial configuration of the uncollected apples (i.e the CPR stock): the more nearby apples, the higher the regrowth rate. If all apples in a local area are harvested then none ever grow back—until the end of the episode (1000 steps), at which point the game resets to an initial state. The dilemma is as follows. The interests of the individual lead toward harvesting as rapidly as possible. However, the interests of the group as a whole are advanced when individuals refrain from doing so, especially in situations where many agents simultaneously harvest in the same local region. Such situations are precarious because the more harvesting agents there are, the greater the chance of bringing the local stock down to zero, at which point it cannot recover. (a) Single agent return (b) Optimal path Figure 2: (a) Single-agent returns as a function of training steps. (b) The optimal resource appropriation policy for a single agent on this map. At convergence, the agent we study nearly learns this policy: https://youtu. be/NnghJgsMxAY. So far, the proposed Commons Game is quite similar to the dynamic game used in human behavioral experiments [16, 18, 17, 14, 15]. However, it departs in one notable way. In the behavioral work, especially [17], participants were given the option of paying a fee in order to fine another participant, reducing their score. In contrast, in our Commons Game, agents can tag one another with a “time-out beam”. Any agent caught in the path of the beam is removed from the game for 25 steps. Neither the tagging nor the tagged agent receive any direct reward or punishment from this. However, the tagged agent loses the chance to collect apples during its time-out period and the tagging agent loses a bit of time chasing and aiming, thus paying the opportunity cost of foregone apple consumption. We argue that such a mechanism is more realistic because it has an effect within the game itself, not just on the scores. The Commons Game is a partially-observable general-sum Markov Game [33, 22]. In each state of the game, agents take actions based on a partial observation of the state space and receive an individual reward. Agents must learn through experience an appropriate behavior policy while interacting with one another. In technical terms, we consider an N-player partially observable Markov game M defined on a finite set of states S. The observation function O : S ⇥{1, . . . , N} ! Rd specifies each player’s d-dimensional view on the state space. In any state, players are allowed to take actions from the set A1, . . . , AN (one for each player). As a result of their joint action a1, . . . , aN 2 A1, . . . , AN the state changes following the stochastic transition function T : S ⇥A1 ⇥· · · ⇥AN ! ∆(S) (where ∆(S) denotes the set of discrete probability distributions over S) and every player receives an individual reward defined as 3 ri : S ⇥A1 ⇥· · · ⇥AN ! R for player i. Finally, let us write Oi = {oi | s 2 S, oi = O(s, i)} be the observation space of player i. Each agent learns, independently through their own experience of the environment, a behavior policy ⇡i : Oi ! ∆(Ai) (written ⇡(ai|oi)) based on their own observation oi = O(s, i) and reward ri(s, a1, . . . , aN). For the sake of simplicity we will write ~a = (a1, . . . , aN), ~o = (o1, . . . , oN) and ~⇡(.|~o) = (⇡1(.|o1), . . . , ⇡N(.|oN)). Each agent’s goal is to maximize a long term γ-discounted payoff defined as follow: V i ~⇡(s0) = E " 1 X t=0 γtri(st,~at)|~at ⇠~⇡t, st+1 ⇠T (st,~at) # 2.2 Deep multi-agent reinforcement learning Multi-agent learning in Markov games is the subject of a large literature [3], mostly concerned with the aim of prescribing an optimal learning rule. To that end, many algorithms have been proposed over the past decade to provide guarantees of convergence in specific settings. Some of them address the zero-sum two-player case [22], or attempt to solve the general-sum case [13, 11]. Others study the emergence of cooperation in partially observable Markov decision processes [9, 37, 38] but rely on knowledge of the model which is unrealistic when studying independent interaction. Our goal, as opposed to the prescriptive agenda, is to describe the behaviour that emerges when agents learn in the presence of other learning agents. This agenda is called the descriptive agenda in the categorization of Shoham & al. [34]. To that end, we simulated N independent agents, each simultaneously learning via the deep reinforcement learning algorithm of Mnih et al. (2015) [24]. Reinforcement learning algorithms learn a policy through experience balancing exploration of the environment and exploitation. These algorithms were developed for the single agent case and are applied independently here [21, 3] even though this multi-agent context breaks the Markov assumption [20]. The algorithm we use is Q-learning with function approximation (i.e. DQN) [24]. In Q-learning, the policy of agent i is implicitly represented through a state-action value function Qi(O(s, i), a) (also written Qi(s, a) in the following). The policy of agent i is an ✏-greedy policy and is defined by ⇡i(a|O(s, i)) = (1 −✏)1a=arg max a Qi(s,a) + ✏ |Ai|. The parameter ✏controls the amount of exploration. The Q-function Qi is learned to minimize the bellman residual kQi(oi, ai) − ri −max b Qi(o0i, b)k on data collected through interaction with the environment (oi, ai, ri, o0i) in {(oi t, ai t, ri t, oi t+1)} (where oi t = O(st, i)). 2.3 Social outcome metrics Unlike in single-agent reinforcement learning where the value function is the canonical metric of agent performance, in multi-agent systems with mixed incentives like the Commons Game, there is no scalar metric that can adequately track the state of the system (see e.g. [5]). Thus we introduce four key social outcome metrics in order to summarize group behavior and facilitate its analysis. Consider N independent agents. Let {ri t | t = 1, . . . , T} be the sequence of rewards obtained by the i-th agent over an episode of duration T. Likewise, let {oi t | t = 1, . . . T} be the i-th agent’s observation sequence. Its return is given by Ri = PT t=1 ri t. The Utilitarian metric (U), also known as Efficiency, measures the sum total of all rewards obtained by all agents. It is defined as the average over players of sum of rewards Ri. The Equality metric (E) is defined using the Gini coefficient [8]. The Sustainability metric (S) is defined as the average time at which the rewards are collected. The Peace metric (P) is defined as the average number of untagged agent steps. U = E "PN i=1 Ri T # , E = 1 − PN i=1 PN j=1 |Ri −Rj| 2N PN i=1 Ri , S = E " 1 N N X i=1 ti # where ti = E[t | ri t > 0]. P = E h NT −PN i=1 PT t=1 I(oi t) i T where I(o) = ( 1 if o = time-out observation 0 otherwise. 4 3 Results 3.1 Sustainable appropriation in the single-agent case In principle, even a single agent, on its own, may learn a strategy that over-exploits and depletes its own private resources. However, in the single-agent case, such a strategy could always be improved by individually adopting a more sustainable strategy. We find that, in practice, agents are indeed able to learn an efficient and sustainable appropriation policy in the single-agent case (Fig. 2). 3.2 Emergent social outcomes Now we consider the multi-agent case. Unlike in the single agent case where learning steadily improved returns (Fig. 2-a), in the multi-agent case, learning does not necessarily increase returns. The returns of a single agent are also a poor indicator of the group’s behavior. Thus we monitor how the social outcome metrics that we defined in Section 2.3 evolve over the course of training (Fig. 3). Figure 3: Evolution of the different social outcome metrics (Sec.2.3) over the course of training on the open map (Fig.1a) using a time-out beam of length 10 and width 5. From top to bottom is displayed, the utility metric (U), the sustainability metric (S), the equality metric (E), and the peace metric (P). The system moves through 3 phases characterized by qualitatively different behaviors and social outcomes. Phase 1, which we may call naïvety, begins at the start of training and extends until ⇡900 episodes. It is characterized by healthy CPR stocks (high apple density). Agents begin training by acting randomly, diffusing through the space and collecting apples whenever they happen upon them. Apples density is high enough that the overall utilitarian efficiency (U) is quite high, and in fact is close to the max it will ever attain. As training progresses, agents learn to move toward regions of greater apple density in order to more efficiently harvest rewards. They detect no benefit from their tagging action and quickly learn not to use it. This can be seen as a steady increase in the peace metric (P) (Fig. 3). In a video§ of typical agent behavior in the naïvety phase, it can be seen that apples remain plentiful (the CPR stock remains healthy) throughout the entire episode. Phase 2, which we may call tragedy, begins where naïvety ends (⇡episode 900), it is characterized by rapid and catastrophic depletion of CPR stock in each episode. The sustainability metric (S), which had already been decreasing steadily with learning in the previous phase, now takes a sudden and drastic turn downward. It happens because agents have learned “too well” how to appropriate from the CPR. With each agent harvesting as quickly as they possibly can, no time is allowed for the CPR stock to recover. It quickly becomes depleted. As a result, utilitarian efficiency (U) declines precipitously. At the low point, agents are collecting less than half as many apples per episode as they did at the very start of training—when they were acting randomly (Fig. 3). In a video¶ of agent play at the height of the tragedy one can see that by ⇡500 steps into the (1100-step) episode, the stock has been completely depleted and no more apples can grow. Phase 3, which we may call maturity, begins when efficiency and sustainability turn the corner and start to recover again after their low point (⇡episode 1500) and continues indefinitely. Initially, conflict breaks out when agents discover that, in situations of great §learned policy after 100 episodes https://youtu.be/ranlu_9ooDw. ¶learned policy after 1100 episodes https://youtu.be/1xF1DoLxqyQ. 5 apple scarcity, it is possible to tag another agent to prevent them from taking apples that one could otherwise take for themselves. As learning continues, this conflict expands in scope. Agents learn to tag one another in situations of greater and greater abundance. The peace metric (P) steadily declines (Fig. 3). At the same time, efficiency (U) and sustainability (S) increase, eventually reaching and slightly surpassing their original level from before tragedy struck. How can efficiency and sustainability increase while peace declines? When an agent is tagged by another agent’s beam, it gets removed from the game for 25 steps. Conflict between agents in the Commons Game has the effect of lowering the effective population size and thus relieving pressure on the CPR stock. With less agents harvesting at any given time, the survivors are free to collect with greater impunity and less risk of resource depletion. This effect is evident in a videok of agent play during the maturity phase. Note that the CPR stock is maintained through the entire episode. By contrast, in an analogous experiment with the tagging action disabled, the learned policies were much less sustainable (Supp. Fig. 11). taggers non-taggers (a) Territorial effect (b) Histogram of the equality metric on the territory maps Figure 4: (a) Scatter plot of return by range size (variance of position) for individual agents in experiments with one tagging agent (red dots, one per random seed) and 11 non-tagging agents (blue dots, eleven per random seed). The tagging players collect more apples per episode than the others and remain in a smaller part of the map. This illustrates that the tagging players take over a territory and harvest sustainably within its boundary. (b) represents the distribution of the equality metric (E) for different runs on four different maps with natural regions from which it may be possible to exclude other. The first map is the standard map from which others will be derived (Fig. 6c). In the second apples are more concentrated on the top left corner and will respawn faster (Fig. 6d). the third is porous meaning it is harder for an agent to protect an area (Fig 6e). On the fourth map, the interiors walls are removed (Fig. 6f). Figure 4b shows inequality rises in maps where players can exclude one another from accessing the commons. 3.3 Sustainability and the emergence of exclusion Suppose, by building a fence around the resource or some other means, access to it can be made exclusive to just one agent. Then that agent is called the owner and the resource is called a private good [30]. The owner is incentivized to avoid over-appropriation so as to safeguard the value of future resource flows from which they and they alone will profit. In accord with this, we showed above (Fig. 2) that sustainability can indeed be achieved in the single agent case. Next, we wanted to see if such a strategy could emerge in the multi-agent case. The key requirement is for agents to somehow be able to exclude one another from accessing part of the CPR, i.e. a region of the map. To give an agent the chance to exclude others we had to provide it with an advantage. Thus we ran an experiment where only one out of the twelve agents could use the tagging action. In this experiment, the tagging agent learned a policy of controlling a specific territory by using its time-out beam to exclude other agents from accessing it. The tagging agents roam over a smaller part of the map than the non-tagging agents but achieve better returns (Fig. 4a). This is because the non-tagging agents generally failed to organize a sustainable appropriation pattern klearned policy after 3900 episodes https://youtu.be/XZXJYgPuzEI. 6 All players L: taggers R: non-taggers number of non-taggers (a) Early training (after 500 episodes) Schelling diagram for L = taggers and R = non-taggers All players L: taggers R: non-taggers number of non-taggers (b) Late training (after 3,000 episodes) Schelling diagram for L = taggers and R = non-taggers Figure 5: Schelling diagram from early (5a) and late (5b) in training for the experiment where L = taggers and R = non-taggers. and depleted the CPR stock in the area available to them (the majority of the map). The tagging agent, on the other hand, was generally able to maintain a healthy stock within its “privatized” territory⇤⇤. Interestingly, territorial solutions to CPR appropriation problems have emerged in real-world CPR problems, especially fisheries [23, 1, 36]. Territories have also emerged spontaneously in laboratory experiments with a spatially and temporally dynamic commons game similar to the one we study here [18]. 3.4 Emergence of inequality To further investigate the emergence of exclusion strategies using agents that all have the same abilities (all can tag), we created four new maps with natural regions enclosed by walls (see Supp. Fig. 6). The idea is that it is much easier to exclude others from accessing a territory that has only a single entrance than one with multiple entrances or one with no walls at all. This manipulation had a large effect on the equality of outcomes. Easier exclusion led to greater inequality (Fig. 4b). The lucky agent that was first to learn how to exclude others from “its territory” could then monopolize the lion’s share of the rewards for a long time (Supp. Figs. 7a and 7b). In one map with unequal apple density between the four regions, the other agents were never able to catch up and achieve returns comparable to the first-to-learn agent (Supp. Fig. 7b). On the other hand, on the maps where exclusion was more difficult, there was no such advantage to being the first to learn (Supp. Figs. 7c and 7d). 3.5 Empirical game-theoretic analysis of emergent strategic incentives We use empirical game theoretic analysis to characterize the strategic incentives facing agents at different points over the course of training. As in [21], we use simulation to estimate the payoffs of an abstracted game in which agents choose their entire policy as a single decision with two alternatives. However, the method of [21] cannot be applied directly to the case of N > 2 players that we study in this paper. Instead, we look at Schelling diagrams [32]. They provide an intuitive way to summarize the strategic structure of a symmetric N-player 2-action game where everyone’s payoffs depend only on the number of others choosing one way or the other. Following Schelling’s terminology, we refer to the two alternatives as L and R (left and right). We include in the appendix several examples of Schelling diagrams produced from experiments using different ways of assigning policies to L and R groups (Supp. Fig. 8). ⇤⇤A typical episode where the tagging agent has a policy of excluding others from a region in the lower left corner of the map: https://youtu.be/3iGnpijQ8RM. 7 In this section we restrict our attention to an experiment where L is the choice of adopting a policy that uses the tagging action and R the choice of a policy that does not tag. A Schelling diagram is interpreted as follows. The green curve is the average return obtained by a player choosing L (a tagger) as a function of the number of players choosing R (non-taggers). Likewise, the red curve is the average return obtained by a player choosing R as a function of the number of other players also choosing R. The average return of all players is shown in blue. At the leftmost point, |R| = 0 =) |L| = N, the blue curve must coincide with the green one. At the rightmost point, |R| = N =) |L| = 0, the blue curve coincides with the red curve. Properties of the strategic game can be read off from the Schelling diagram. For example, in Fig. 5b one can see that the choice of a tagging policy is dominant over the choice of a non-tagging policy since, for any |R|, the expected return of the L group is always greater than that of the R group. This implies that the Nash equilibrium is at |R| = 0 (all players tagging). The Schelling diagram also shows that the collective maximum (blue curve’s max) occurs when |R| = 7. So the Nash equilibrium is socially-deficient in this case. In addition to being able to describe the strategic game faced by agents at convergence, we can also investigate how the strategic incentives agents evolve over the course of learning. Fig. 5a shows that the strategic game after 500 training episodes is one with a uniform negative externality. That is, no matter whether one is a tagger or a non-tagger, the effect of switching one additional other agent from the tagging group to the non-tagging group is to decrease returns. After 3000 training episodes the strategic situation is different (Fig. 5b). Now, for |R| > 5, there is a contingent externality. Switching one additional agent from tagging to non-tagging has a positive effect on the remaining taggers and a negative effect on the non-taggers (green and red curves have differently signed slopes). 4 Discussion This paper describes how algorithms arising from reinforcement learning research may be applied to build new kinds of models for phenomena drawn from the social sciences. As such, this paper really has two audiences. For social scientists, the core conclusions are as follows. (1) Unlike most game theory-based approaches where modelers typically “hand engineer” specific strategies like tit-for-tat [2] or win-stay-lose-shift [25], here agents must learn how to implement their strategic decisions. This means that the resulting behaviors are emergent. For example, in this case the tragedy of the commons was “solved” by reducing the effective population size below the environment’s carrying capacity, but this outcome was not assumed. (2) This model endogenizes exclusion. That is, it allows agents to learn strategies wherein they exclude others from a portion of the CPR. Then, in accord with predictions from economics [26, 1, 18, 36], sustainable appropriation strategies emerge more readily in the “privatized” zones than they do elsewhere. (3) Inequality emerges when exclusion policies are easier to implement. In particular, natural boundaries in the environment make inequality more likely to arise. From the perspective of reinforcement learning research, the most interesting aspect of this model is that—despite the fact that all agents learn only toward their individual objectives—tracking individual rewards over the course of training is insufficient to characterize the state of the system. These results illustrate how multiple simultaneously learning agents may continually improve in “competence” without improving their expected discounted returns. Indeed, learning may even decrease returns in cases where too-competent agents end up depleting the commons. Without the social outcome metrics (efficiency, equality, sustainability, and peace) and other analyses employed here, such emergent events could not have been detected. This insight is widely applicable to other general-sum Markov games with mixed incentives (e.g. [19, 21]). This is a reductionist approach. Notice what is conspicuously absent from the model we have proposed. The process by which groups of humans self-organize to solve CPR problems is usually conceptualized as one of rational negotiation (e.g. [26]). People do things like bargain with one another, attempt to build consensus for collective decisions, think about each other’s thoughts, and make arbitration appeals to local officials. The agents in our model can’t do anything like that. Nevertheless, we still find it is sometimes possible for self-organization to resolve CPR appropriation problems. Moreover, examining the pattern of success and failure across variants of our model yields insights that appear readily applicable to understanding human CPR appropriation behavior. The question then is raised: how much of human cognitive sophistication is really needed to find adequate solutions to CPR appropriation problems? We note that nonhuman organisms also solve them [31]. This suggests that trial-and-error learning alone, without advanced cognitive capabilities, may sometimes be sufficient for effective CPR appropriation. 8 References [1] James M Acheson and Roy J Gardner. Spatial strategies and territoriality in the maine lobster industry. Rationality and society, 17(3):309–341, 2005. [2] Robert Axelrod. The Evolution of Cooperation. Basic Books, 1984. [3] Lucian Busoniu, Robert Babuska, and Bart De Schutter. A comprehensive survey of multiagent reinforcement learning. IEEE Transactions on Systems, Man, and Cybernetics, Part C (Applications and Reviews), 2(38):156–172, 2008. [4] Colin F Camerer. Progress in behavioral game theory. The Journal of Economic Perspectives, 11(4):167– 188, 1997. [5] Georgios Chalkiadakis and Craig Boutilier. Coordination in multiagent reinforcement learning: a bayesian approach. In The Second International Joint Conference on Autonomous Agents & Multiagent Systems, AAMAS 2003, July 14-18, 2003, Melbourne, Victoria, Australia, Proceedings, pages 709–716, 2003. [6] Thomas Dietz, Elinor Ostrom, and Paul C Stern. The struggle to govern the commons. science, 302(5652):1907–1912, 2003. [7] Roy Gardner, Elinor Ostrom, and James M Walker. The nature of common-pool resource problems. Rationality and Society, 2(3):335–358, 1990. [8] C. Gini. Variabilità e mutabilità: contributo allo studio delle distribuzioni e delle relazioni statistiche. [|.]. Number pt. 1 in Studi economico-giuridici pubblicati per cura della facoltà di Giurisprudenza della R. Università di Cagliari. Tipogr. di P. Cuppini, 1912. [9] Piotr J Gmytrasiewicz and Prashant Doshi. A framework for sequential planning in multi-agent settings. Journal of Artificial Intelligence Research, 24:49–79, 2005. [10] H Scott Gordon. The economic theory of a common-property resource: the fishery. Journal of political economy, 62(2):124–142, 1954. [11] A. Greenwald and K. Hall. Correlated-Q learning. In Proceedings of the 20th International Conference on Machine Learning (ICML), pages 242–249, 2003. [12] Garrett Hardin. The tragedy of the commons. Science, 162(3859):1243–1248, 1968. [13] J. Hu and M. P. Wellman. Multiagent reinforcement learning: Theoretical framework and an algorithm. In Proceedings of the 15th International Conference on Machine Learning (ICML), pages 242–250, 1998. [14] Marco Janssen. Introducing ecological dynamics into common-pool resource experiments. Ecology and Society, 15(2), 2010. [15] Marco Janssen. The role of information in governing the commons: experimental results. Ecology and Society, 18(4), 2013. [16] Marco Janssen, Robert Goldstone, Filippo Menczer, and Elinor Ostrom. Effect of rule choice in dynamic interactive spatial commons. International Journal of the Commons, 2(2), 2008. [17] Marco A Janssen, Robert Holahan, Allen Lee, and Elinor Ostrom. Lab experiments for the study of social-ecological systems. Science, 328(5978):613–617, 2010. [18] Marco A Janssen and Elinor Ostrom. Turfs in the lab: institutional innovation in real-time dynamic spatial commons. Rationality and Society, 20(4):371–397, 2008. [19] Max Kleiman-Weiner, M K Ho, J L Austerweil, Michael L Littman, and Josh 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. [20] Guillaume J. Laurent, Laëtitia Matignon, and N. Le Fort-Piat. The world of independent learners is not Markovian. Int. J. Know.-Based Intell. Eng. Syst., 15(1):55–64, 2011. [21] 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 International Conference on Autonomous Agents and Multiagent Systems (AA-MAS 2017), Sao Paulo, Brazil, 2017. [22] M. 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. 9 [23] Kent O Martin. Play by the rules or don’t play at all: Space division and resource allocation in a rural newfoundland fishing community. North Atlantic maritime cultures, pages 277–98, 1979. [24] 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. [25] Martin Nowak, Karl Sigmund, et al. A strategy of win-stay, lose-shift that outperforms tit-for-tat in the prisoner’s dilemma game. Nature, 364(6432):56–58, 1993. [26] Elinor Ostrom. Governing the Commons: The Evolution of Institutions for Collective Action. Cambridge University Press, 1990. [27] Elinor Ostrom, Joanna Burger, Christopher B Field, Richard B Norgaard, and David Policansky. Revisiting the commons: local lessons, global challenges. Science, 284(5412):278–282, 1999. [28] Elinor Ostrom and Roy Gardner. Coping with asymmetries in the commons: self-governing irrigation systems can work. The Journal of Economic Perspectives, 7(4):93–112, 1993. [29] Elinor Ostrom, Roy Gardner, and James Walker. Rules, games, and common-pool resources. University of Michigan Press, 1994. [30] Vincent Ostrom and Elinor Ostrom. Public goods and public choices. In Alternatives for Delivering Public Services: Toward Improved Performance, pages 7–49. Westview press, 1977. [31] Daniel J Rankin, Katja Bargum, and Hanna Kokko. The tragedy of the commons in evolutionary biology. Trends in ecology & evolution, 22(12):643–651, 2007. [32] Thomas C Schelling. Hockey helmets, concealed weapons, and daylight saving: A study of binary choices with externalities. Journal of Conflict resolution, 17(3):381–428, 1973. [33] L. S. Shapley. Stochastic Games. In Proc. of the National Academy of Sciences of the United States of America, 1953. [34] Y. Shoham, R. Powers, and T. Grenager. If multi-agent learning is the answer, what is the question? Artificial Intelligence, 171(7):365–377, 2007. [35] Vernon L Smith. Economics of production from natural resources. The American Economic Review, 58(3):409–431, 1968. [36] Rachel A Turner, Tim Gray, Nicholas VC Polunin, and Selina M Stead. Territoriality as a driver of fishers’ spatial behavior in the northumberland lobster fishery. Society & Natural Resources, 26(5):491–505, 2013. [37] Pradeep Varakantham, Jun-young Kwak, Matthew E Taylor, Janusz Marecki, Paul Scerri, and Milind Tambe. Exploiting coordination locales in distributed POMDPs via social model shaping. In Proceedings of the 19th International Conference on Automated Planning and Scheduling, ICAPS, 2009. [38] Chao Yu, Minjie Zhang, Fenghui Ren, and Guozhen Tan. Emotional multiagent reinforcement learning in spatial social dilemmas. IEEE Transactions on Neural Networks and Learning Systems, 26(12):3083–3096, 2015. 10
2017
111
6,577
Decoding with Value Networks for Neural Machine Translation Di He1 di_he@pku.edu.cn Hanqing Lu2 hanqinglu@cmu.edu Yingce Xia3 xiayingc@mail.ustc.edu.cn Tao Qin4 taoqin@microsoft.com Liwei Wang1,5 wanglw@cis.pku.edu.cn Tie-Yan Liu4 tie-yan.liu@microsoft.com 1Key Laboratory of Machine Perception, MOE, School of EECS, Peking University 2Carnegie Mellon University 3University of Science and Technology of China 4Microsoft Research 5Center for Data Science, Peking University, Beijing Institute of Big Data Research Abstract Neural Machine Translation (NMT) has become a popular technology in recent years, and beam search is its de facto decoding method due to the shrunk search space and reduced computational complexity. However, since it only searches for local optima at each time step through one-step forward looking, it usually cannot output the best target sentence. Inspired by the success and methodology of AlphaGo, in this paper we propose using a prediction network to improve beam search, which takes the source sentence x, the currently available decoding output y1, · · · , yt−1 and a candidate word w at step t as inputs and predicts the long-term value (e.g., BLEU score) of the partial target sentence if it is completed by the NMT model. Following the practice in reinforcement learning, we call this prediction network value network. Specifically, we propose a recurrent structure for the value network, and train its parameters from bilingual data. During the test time, when choosing a word w for decoding, we consider both its conditional probability given by the NMT model and its long-term value predicted by the value network. Experiments show that such an approach can significantly improve the translation accuracy on several translation tasks. 1 Introduction Neural Machine Translation (NMT), which is based on deep neural networks and provides an endto-end solution to machine translation, has attracted much attention from the research community [2, 6, 12, 20] and gradually been adopted by industry in past several years [18, 22]. NMT uses an RNN-based encoder-decoder framework to model the entire translation process. In training, it maximizes the likelihood of a target sentence given a source sentence. In testing, given a source sentence x, it tries to find a sentence y∗in the target language that maximizes the conditional probability P(y|x). Since the number of possible target sentences is exponentially large, finding the optimal y∗is NP-hard. Thus beam search is commonly employed to find a reasonably good y. Beam search is a heuristic search algorithm that maintains the top-scoring partial sequences expanded in a left-to-right fashion. In particular, it keeps a pool of candidates each of which is a partial sequence. At each time step, the algorithm expands each candidate by appending a new word, and then keeps 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the top-ranked new candidates scored by the NMT model. The algorithm terminates if it meets the maximum decoding depth or all sentences are completely generated, i.e., all sentences are ended with the end-of-sentence (EOS) symbol. While NMT with beam search has been proved to be successful, it has several obvious issues, including exposure bias [9], loss-evaluation mismatch [9] and label bias [16], which have been studied. However, we observe that there is still an important issue associated with beam search of NMT, the myopic bias, which unfortunately is largely ignored, to the best of our knowledge. Beam search tends to focus more on short-term reward. At iteration t, for a candidate y1, · · · , yt−1 (refers to y<t) and two words w and w′, we denote y<t + w if we append w to y<t. If P(y<t + w|x) > P(y<t + w′|x), new candidate y<t + w is more likely to be kept, even if w′ is the ground truth translation at step t or can offer a better score in future decodings. Such search errors coming from short sighted actions sometimes provide a bad translation even if the translation model is good. To address the myopic bias, for each word w and each candidate y<t, we propose to design a prediction model to estimate the long-term reward if we append w to y<t and follow the current NMT model until the decoding finishes. Then we can leverage the predicted score from this model during each decoding step to help find a better w that can contribute to the long-term translation performance. This prediction model, which predicts long-term reward we will receive in the future, is exactly the concept of value function in Reinforcement Learning (RL). In this work, we develop a neural network-based prediction model, which is called value network for NMT. The value network takes the source sentence and any partial target sequence as input, and outputs a predicted value to estimate the expected total reward (e.g. BLEU) generated from this partial sequence by the NMT model. In any decoding step, we select the best candidates not only based on the conditional probability of the partial sequence outputted by the NMT model, but also based on the estimated long-term reward outputted by the value network. The main contributions of this work are summarized as follows. First, we develop a decoding scheme that considers long-term reward while generating words one by one for machine translation, which is new in NMT literature. At each step, the new decoding scheme not only considers the probability of the word sequence conditioned on the source sentence, but also relies on the predicted future reward. We believe that considering the two aspects can lead to better final translation. Second, we design a novel structure for the value network. On the top of the encoder-decoder layer of NMT, we develop another two modules for the value network, a semantic matching module and a context-coverage module. The semantic matching module aims at estimating the similarity between the source and target sentences, which can contribute to the quality of the translation. It is often observed that the more context used in the attention mechanism, the better translation we will generate [14, 15]. Thus we build a context-coverage module to measure the coverage of context used in the encoder-decoder layer. With the outputs of the two modules, the value prediction is done via fully connected layers. We conduct a set of experiments on several translation tasks. All the results demonstrate the effectiveness and robustness of the new decoding mechanism compared to several baseline algorithms. The remaining parts of the paper are organized as follows. In Section 2, we briefly review the literature of neural machine translation. After that, we describe the myopic bias problem of NMT in Section 3 and introduce our method for value network learning in Section 4. Experimental results are provided and analyzed in Section 5. We discuss future directions in the last section. 2 Neural Machine Translation Neural machine translation systems are typically implemented with a Recurrent Neural Network (RNN)-based encoder-decoder framework. Such a framework directly models the probability P(y|x) of a target sentence y = {y1, y2, ..., yTy} conditioned on the source sentence x = {x1, x2, ..., xTx}, where Tx and Ty are the length of sentence x and y. The encoder of NMT reads the source sentence x word by word and generates a hidden representation for each word xi: hi = f(hi−1, xi), (1) 2 h1 h2 h3 htx c1 c2 c3 r3 r2 r1 … x1 x2 x3 xtx y1 y2 y3 … … SM Module CC Module Encoder Decoder Semantic Matching (SM) Module c1 c2 c3 r3 r2 r1 … … Attention Context-Coverage (CC) Module c1 c2 c3 htx h2 h1 … … Mean pooling Mean pooling 𝜇𝑆𝑀 Mean pooling Mean pooling 𝜇𝐶𝐶 Figure 1: Architecture of Value Network in which function f is the recurrent unit such as Long Short-Term Memory (LSTM) unit [12] or Gated Recurrent Unit (GRU) [4]. Afterwards, the decoder of NMT computes the conditional probability of each target word yt conditioned on its proceeding words y<t as well as the source sentence: P(yt|y<t, x) ∝exp(yt; rt, ct), (2) rt = g(rt−1, yt−1, ct), (3) ct = q(rt−1, h1, · · · , hTx), (4) where rt is the decoder RNN hidden representation at step t, similarly computed by an LSTM or GRU, and ct denotes the weighted contextual information summarizing the source sentence x using some attention mechanism [4]. Denote all the parameters to be learned in the encoder-decoder framework as Θ. For ease of reference, we also use πΘ to represent the translation model with parameter Θ. Denote D as the training dataset that contains source-target sentence pairs. The training process aims at seeking the optimal parameters Θ∗to correctly encode source sentence and decode it into the target sentence. While there are different objectives to achieve this [2, 10, 1, 5, 19, 17], maximum likelihood estimation is the most popular one [2]: Θ∗ = argmax Θ Y (x,y)∈D P(y|x; Θ) = argmax Θ Y (x,y)∈D Ty Y t=1 P(yt|y<t, x; Θ). (5) 3 The Myopic Bias Since during training, one aims to find the conditional probability P(y|x), ideally in testing, the translation of a source sentence x should be the target sentence y with the maximum conditional probability P(y|x). However, as there are exponentially many candidates in the target language, one cannot compute the probability for every candidate and find the maximum one. Thus, beam search is widely used to find a reasonable good target sentence [4, 14, 12]. Note that the training objective of NMT is usually defined on the full target sentence y instead of partial sentences. One issue with beam search is that a locally good word might not lead to a good complete sentence. From the example mentioned in the introduction, we can see that such search errors from short sighted actions can provide a bad translation even if we hold a perfect translation model. We call such errors the myopic bias. To reduce myopic bias, we hope to predict the long-term value of each action and use the value in decoding, which is the exact motivation of our work. There exist several works weakly related to this issue. [3] develops the scheduled sampling approach, which takes the generated outputs from the model as well as the golden truth sentence in training, to help the model learn from its own errors. Although it can (to some extent) handle the negative 3 impact of choosing an incorrect word at middle steps, it still follows beam search during testing, which cannot avoid the myopic bias. Another related work is [16]. It learns a predictor to predict the ranking score of a certain word at step t, and use this score to replace the conditional probability outputted by the NMT model for beam search during testing. Unfortunately, this work still looks only one step forward and cannot address the problem. 4 Value Network for NMT As discussed in the previous section, it is not reasonable to fully rely on the conditional probability in beam search. This motivates us to estimate the expected performance of any sequence during decoding, which is exactly the concept of value function in reinforcement learning. 4.1 Value Network Structure In conventional reinforcement learning, a value function describes how much cumulated reward could be collected from state s by following certain policy π. In machine translation, we can consider any input sentence x paired with partial output sentence y<t as the state, and consider the translation model πΘ as policy which can generate a word (action) given any state. Given policy πΘ, the value function characterizes what the expected translation performance (e.g. BLEU score) is if we use πΘ to translate x with the first t −1 words being y<t. Denote v(x, y<t) as the value function and y∗(x) as the ground truth translation, and then v(x, y<t) = P y′∈Y:y′ <t=y<t BLEU(y∗(x), y′)P(y′|x; Θ), where Y is the space of complete sentences. The first important problem is how to design the input and the parametric form of the value function. As the translation model is built up on an encoder-decoder framework, we also build up our value network on the top of this architecture. To fully exploit the information in the encoder-decoder framework, we develop a value network with two new modules, the semantic matching module and the context-coverage module. Semantic Matching (SM) Module: In the semantic matching module, at time step t, we use mean pooling over the decoder RNN hidden states ¯rt = 1 t Pt l=1 rl as a summarization of the partial target sentence, and use mean pooling over context states ¯ct = 1 t Pt l=1 cl as a summarization of the context in source language. We concatenate ¯rt and ¯ct, and use a feed-forward network µSM = fSM([¯rt, ¯ct]) to evaluate semantic information between the source sentence and the target sentence. Context-Coverage (CC) Module: It is often observed that the more context covered in the attention model, the better translation we will generate [14, 15]. Thus we build a context-coverage module to measure the coverage of information used in the encoder-decoder framework. We argue that using mean pooling over the context layer and the encoding states should give some effective knowledge. Similarly, denote ¯h = 1 Tx PTx l=1 hl, we use another feed-forward network µCC = fCC([¯ct, ¯h]) to process such information. In the end, we concatenate both µSM and µCC and then use another fully connected layer with sigmoid activation function to output a scalar as the value prediction. The whole architecture is shown in Figure 1. 4.2 Training Data Generation Based on the designed value network structure, we aim at finding a model that can correctly predict the performance after the decoding ends. Popular value function learning algorithms include Monte-Carlo methods and Temple-Difference methods, and both of them have been adopted in many challenging tasks [13, 7, 11]. In this paper, we adopt the Monte-Carlo method to learn the value function. Given a well-learnt NMT model πΘ, the training of the value network for πΘ is shown in Algorithm 1. For randomly picked source sentence x in the training corpus, we generate a partial target sentence yp using πΘ with random early stop, i.e., we randomly terminate the decoding process before its end. Then for the pair (x, yp), we use πΘ to finish the translation starting from yp and obtain a set S(yp) of K complete target sentences, e.g., using beam search. In the end, we compute the BLEU score of 4 each complete target sentence and calculate the averaged BLEU score of (x, yp): avg_bleu(x, yp) = 1 K X y∈S(yp) BLEU(y∗(x), y). (6) avg_bleu(x, yp) can be considered as an estimation of the long-term reward of state (x, yp) used in value network training. 4.3 Learning Algorithm 1 Value network training 1: Input: Bilingual corpus, a trained neural machine translation model πΘ, hyperparameter K. 2: repeat 3: t = t + 1. 4: Randomly pick a source sentence x from the training dataset. 5: Generate two partial translations yp,1, yp,2 for x using πΘ with random early stop. 6: Generate K complete translations for each partial translation using πΘ and beam search. Denote this set of complete target sentences as S(yp,1) and S(yp,2). 7: Compute the BLEU score for each sentence in S(yp,1) and S(yp,2). 8: Calculate the average BLEU score for each partial translation according to Eqn.(6) 9: Gradient Decent on stochastic loss defined in Eqn.(7). 10: until converge 11: Output: Value network with parameter ω In conventional Monte-Carlo method for value function estimation, people usually use a regression model to approximate the value function, i.e., learn a mapping from (x, yp) →avg_bleu(x, yp) by minimizing the mean square error (MSE). In this paper, we take an alternative objective function which is shown to be more effective in experiments. We hope the value network we learn is accurate and useful in differentiating good and bad examples. Thus we use pairwise ranking loss instead of MSE loss. To be concrete, we sample two partial sentences yp,1 and yp,2 for each x. We hope the predicted score of (x, yp,1) can be larger than that of (x, yp,2) by certain margin if avg_bleu(x, yp,1) > avg_bleu(x, yp,2). Denote ω as the parameter of the value function described in Section 4.1. We design the loss function as follows: L(ω) = X (x,yp,1,yp,2) evω(x,yp,2)−vω(x,yp,1), (7) where avg_bleu(x, yp,1) > avg_bleu(x, yp,2). Algorithm 2 Beam search with value network in NMT 1: Input: Testing example x, neural machine translation model P(y|x) with target vocabulary V , value network model v(x, y), beam search size K, maximum search depth L, weight α. 2: Set S = ∅, U = ∅as candidate sets. 3: repeat 4: t = t + 1. 5: Uexpand ←{yi + {w}|yi ∈U, w ∈V }. 6: U ←{top (K −|S|) candidates that maximize α × 1 t log P(y|x) + (1 −α) × log v(x, y)|y ∈Uexpand} 7: Ucomplete ←{y|y ∈U, yt = EOS} 8: U ←U \ Ucomplete 9: S ←S ∪Ucomplete 10: until |S| = K or t = L 11: Output: y = argmaxy∈S∪U α × 1 |y| log P(y|x) + (1 −α) × log v(x, y) 5 4.4 Inference Since the value network estimates the long-term reward of a state, it will be helpful to enhance the decoding process of NMT. For example, in a certain decoding step, the NMT model prefers word w1 over w2 according to the conditional probability, but it does not know that picking w2 will be a better choice for future decoding. As the value network provides sufficient information on the future reward, if the value network outputs show that picking w2 is better than picking w1, we can take both NMT probability and future reward into consideration to choose a better action. In this paper, we simply linearly combine the outputs of the NMT model and the value network, which is motivated by the success of AlphaGo [11]. We first compute the normalized log probability of each candidate, and then linearly combine it with the logarithmic value of the reward. In detail, given a translation model P(y|x), a value network v(x, y) and a hyperparameter α ∈(0, 1), the score of partial sequence y for x is computed by α × 1 |y| log P(y|x) + (1 −α) × log v(x, y), (8) where |y| is the length of y. The details of the decoding process are presented in Algorithm 2, and we call our neural network-based decoding algorithm NMT-VNN for short. 5 Experiments 5.1 Settings We compare our proposed NMT-VNN with two baselines. The first one is classic NMT with beam search [2] (NMT-BS). The second one [16] trains a predictor that can evaluate the quality of any partial sequence, e.g., partial BLEU score 1, and then it uses the predictor to select words instead of the probability. The main difference between [16] and ours is that they predict the local improvement of BLEU for any single word, while ours aims at predicting the final BLEU score and use the predicted score to select words. We refer their work as beam search optimization (we call it NMT-BSO). For NMT-BS, we directly used the open source code [2]. NMT-BSO was implemented by ourselves based on the open source code [2]. We tested our proposed algorithms and the baselines on three pairs of languages: English→French (En→Fr), English→German (En→De), and Chinese→English (Zh→En). In detail, we used the same bilingual corpora from WMT’ 14 as used in [2] , which contains 12M, 4.5M and 10M training data for each task. Following common practices, for En→Fr and En→De, we concatenated newstest2012 and newstest2013 as the validation set, and used newstest2014 as the testing set. For Zh→En, we used NIST 2006 and NIST 2008 datasets for testing, and use NIST 2004 dataset for validation. For all datasets in Chinese, we used a public tool for word segmentation. In all experiments, validation sets were only used for early-stopping and hyperparameter tuning. For NMT-VNN and NMT-BS, we need to train an NMT model first. We followed [2] to set experimental parameters to train the NMT model. For each language, we constructed the vocabulary with the most common 30K words in the parallel corpora, and out-of-vocabulary words were replaced with a special token “UNK". Each word was embedded into a vector space of 620 dimensions, and the dimension of the recurrent unit was 1000. We removed sentences with more than 50 words from the training set. Batch size was set as 80 with 20 batches pre-fetched and sorted by sentence lengths. The NMT model was trained with asynchronized SGD on four K40m GPUs for about seven days. For NMT-BSO, we implemented the algorithm and the model was trained in the same environment. For the value network used in NMT-VNN, we set the same parameters for the encoder-decoder layers as the NMT model. Additionally, in the SM module and CC module, we set function µSM and µCC as single-layer feed forward networks with 1000 output nodes. In Algorithm 1, we set the hyperparameter K = 20 to estimate the value of any partial sequence. We adapted mini-batch training with batch size to be 80, and the value network model was trained with AdaDelta [21] on one K40m GPU for about three days. 1If the ground truth is y∗, the partial bleu on the partial sequence y<t at step t is defined as the BLEU score on y<t and y∗ <t. 6 During testing, the hyperparameter α for NMT-VNN was set by cross validation. For En→Fr, En→De and Zh→En tasks, we found setting α to be 0.85, 0.9 and 0.8 respectively are the best choices. We used the BLEU score [8] as the evaluation metric, which is computed by the multi-bleu.perl script2. We set the beam search size to be 12 for all the algorithms following the common practice [12]. (a) En→Fr (b) En→De (c) Zh→En NIST 2006 (d) Zh→En NIST 2008 Figure 2: Translation results on the test sets of three tasks 5.2 Overall Results We report the experimental results in this subsection. From Table 1 we can see that our NMT-VNN algorithm outperforms the baseline algorithms on all tasks. For English→French task and English→German task, NMT-VNN outperforms the baseline NMT-BS by about 1.03/1.3 points. As the only difference between the two algorithms is that our NMT-VNN additionally uses the outputs of value network to enhance decoding, we can conclude that such additional knowledge provides useful information to help the NMT model. Our method outperforms NMT-BSO by about 0.31/0.33 points. Since NMT-BSO only uses a local BLEU predictor to estimate the partial BLEU score while ours predicts the future performance, our proposed value network which considers long-term benefit is more powerful. The performance of our NMT-VNN is much better than NMT-BS and NMT-BSO for Chinese→English tasks. NMT-VNN outperforms the baseline NMT-BS by about 1.4/1.82 points on NIST 2006 and NIST 2008, and outperforms NMT-BSO by about 1.01/0.72 points. We plot BLEU scores with respect to the length of source sentences in Figure 2 for all the tasks. From the figures, we can see that our NMT-VNN algorithm outperforms the baseline algorithms in almost all the ranges of length. Furthermore, we also test our value network on a deep NMT model in which the encoder and decoder are both stacked 4-layer LSTMs. The result also shows that we can get 0.33 points improvement on English→French task. These results demonstrate the effectiveness and robustness of our NMT-VNN algorithm. 2https://github.com/moses-smt/mosesdecoder/blob/master/scripts/generic/multi-bleu.perl. For final evaluation we use corpus-level BLEU, while for the value network training we use sentence-level BLEU as in [1]. 7 Table 1: Overall Performance En→Fr En→De Zh→En NIST06 Zh→En NIST08 En→Fr Deep NMT-BS 30.51 15.67 36.2 29.4 37.86 NMT-BSO 31.23 16.64 36.59 30.5 – NMT-VNN 31.54 16.97 37.6 31.22 38.19 5.3 Analysis on Value Network We further look into the learnt value network and conduct some analysis to better understand it. First, as we use an additional component during decoding, it will affect the efficiency of the translation process. As the designed value network architecture is similar to the basic NMT model, the computational complexity is similar to the NMT model and the two processes can be run in parallel. Second, it has been observed that the accuracy of NMT is sometimes very sensitive to the size of beam search on certain tasks. As the beam size grows, the accuracy will drop drastically. [14] argues this is because the training of NMT favors short but inadequate translation candidates. We also observe this phenomenon on English→German translation. However, we show that by using value network, such shortage can be largely avoided. We tested the accuracy of our algorithm with different beam sizes, as shown in Figure 3.(a). It can be seen that NMT-VNN is much more stable than the original NMT without value network: its accuracy only differs a little for different beam sizes while NMT-BS drops more than 0.5 point when the beam size is large. (a) (b) Figure 3: (a). BLEU scores of En→De task w.r.t different beam size. (b). BLEU scores of En→De task w.r.t different hyperparameter α. Third, we tested the performances of NMT-VNN using different hyperparameter α during decoding for English→German task. As can be seen from the figure, the performance is stable for the α ranging from 0.7 to 0.95, and slightly drops for a smaller α. This shows that our proposed algorithm is robust to the hyperparameter. 6 Conclusions and Future Work In this work we developed a new decoding scheme that incorporates value networks for neural machine translation. By introducing the value network, the new decoding scheme considers not only the local conditional probability of a candidate word, but also its long-term reward for future decoding. Experiments on three translation tasks verify the effectiveness of the new scheme. We plan to explore the following directions in the future. First, it is interesting to investigate how to design better structures for the value network. Second, the idea of using value networks is quite general, and we will extend it to other sequence-to-sequence learning tasks, such as image captioning and dialog systems. 8 Acknowledgments This work was partially supported by National Basic Research Program of China (973 Program) (grant no. 2015CB352502), NSFC (61573026). We would like to thank the anonymous reviewers for their valuable comments on our paper. References [1] D. Bahdanau, P. Brakel, K. Xu, A. Goyal, R. Lowe, J. Pineau, A. Courville, and Y. Bengio. An actor-critic algorithm for sequence prediction. ICLR, 2017. [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. ICLR, 2015. [3] S. Bengio, O. Vinyals, N. Jaitly, and N. Shazeer. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems, pages 1171–1179, 2015. [4] K. Cho, B. van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. 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, Doha, Qatar, October 2014. Association for Computational Linguistics. [5] D. He, Y. Xia, T. Qin, L. Wang, N. Yu, T. Liu, and W.-Y. Ma. Dual learning for machine translation. In Advances in Neural Information Processing Systems, pages 820–828, 2016. [6] S. Jean, K. Cho, R. Memisevic, and Y. Bengio. On using very large target vocabulary for neural machine translation. In 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 1–10, Beijing, China, July 2015. Association for Computational Linguistics. [7] 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. [8] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pages 311–318. Association for Computational Linguistics, 2002. [9] M. Ranzato, S. Chopra, M. Auli, and W. Zaremba. Sequence level training with recurrent neural networks. ICLR, 2016. [10] S. Shen, Y. Cheng, Z. He, W. He, H. Wu, M. Sun, and Y. Liu. Minimum risk training for neural machine translation. In ACL, 2016. [11] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016. [12] 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. [13] G. Tesauro. Td-gammon, a self-teaching backgammon program, achieves master-level play. Neural computation, 6(2):215–219, 1994. [14] Z. Tu, Y. Liu, L. Shang, X. Liu, and H. Li. Neural machine translation with reconstruction. In AAAI, pages 3097–3103, 2017. [15] Z. Tu, Z. Lu, Y. Liu, X. Liu, and H. Li. Coverage-based neural machine translation. CoRR, abs/1601.04811, 2016. 9 [16] S. Wiseman and A. M. Rush. Sequence-to-sequence learning as beam-search optimization. In EMNLP, 2016. [17] L. Wu, Y. Xia, L. Zhao, F. Tian, T. Qin, J. Lai, and T.-Y. Liu. Adversarial neural machine translation. arXiv preprint arXiv:1704.06933, 2017. [18] 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. [19] Y. Xia, T. Qin, W. Chen, J. Bian, N. Yu, and T.-Y. Liu. Dual supervised learning. In ICML, 2017. [20] Y. Xia, F. Tian, L. Wu, J. Lin, T. Qin, N. Yu, and T. Liu. Deliberation networks: Sequence generation beyond one-pass decoding. In 31st Annual Conference on Neural Information Processing Systems (NIPS), 2017. [21] M. D. Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012. [22] J. Zhou, Y. Cao, X. Wang, P. Li, and W. Xu. Deep recurrent models with fast-forward connections for neural machine translation. arXiv preprint arXiv:1606.04199, 2016. 10
2017
112
6,578
Population Matching Discrepancy and Applications in Deep Learning Jianfei Chen, Chongxuan Li, Yizhong Ru, Jun Zhu∗ Dept. of Comp. Sci. & Tech., TNList Lab, State Key Lab for Intell. Tech. & Sys. Tsinghua University, Beijing, 100084, China {chenjian14,licx14,ruyz13}@mails.tsinghua.edu.cn, dcszj@tsinghua.edu.cn Abstract A differentiable estimation of the distance between two distributions based on samples is important for many deep learning tasks. One such estimation is maximum mean discrepancy (MMD). However, MMD suffers from its sensitive kernel bandwidth hyper-parameter, weak gradients, and large mini-batch size when used as a training objective. In this paper, we propose population matching discrepancy (PMD) for estimating the distribution distance based on samples, as well as an algorithm to learn the parameters of the distributions using PMD as an objective. PMD is defined as the minimum weight matching of sample populations from each distribution, and we prove that PMD is a strongly consistent estimator of the first Wasserstein metric. We apply PMD to two deep learning tasks, domain adaptation and generative modeling. Empirical results demonstrate that PMD overcomes the aforementioned drawbacks of MMD, and outperforms MMD on both tasks in terms of the performance as well as the convergence speed. 1 Introduction Recent advances on image classification [26], speech recognition [19] and machine translation [9] suggest that properly building large models with a deep hierarchy can be effective to solve realistic learning problems. Many deep learning tasks, such as generative modeling [16, 3], domain adaptation [5, 47], model criticism [32] and metric learning [14], require estimating the statistical divergence of two probability distributions. A challenge is that in many tasks, only the samples instead of the closed-form distributions are available. Such distributions include implicit probability distributions and intractable marginal distributions. Without making explicit assumption on the parametric form, these distributions are richer and hence can lead to better estimates [35]. In these cases, the estimation of the statistical divergence based on samples is important. Furthermore, as the distance can be used as a training objective, it need to be differentiable with respect to the parameters of the distributions to enable efficient gradient-based training. One popular sample-based statistical divergence is the maximum mean discrepancy (MMD) [17], which compares the kernel mean embedding of two distributions in RKHS. MMD has a closed-form estimate of the statistical distance in quadratic time, and there are theoretical results on bounding the approximation error. Due to its simplicity and theoretical guarantees, MMD have been widely adopted in many tasks such as belief propagation [44], domain adaptation [47] and generative modeling [31]. However, MMD has several drawbacks. For instance, it has a kernel bandwidth parameter that needs tuning [18], and the kernel can saturate so that the gradient vanishes [3] in a deep generative model. Furthermore, in order to have a reliable estimate of the distance, the mini-batch size must be large, e.g., 1000, which slows down the training by stochastic gradient descent [31]. ∗Corresponding author. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 2 1 0 1 2 3 Require: Noise distributions qX, qY and transformations T X θX, T Y θY . Population size N, mini-batch size |B|. for each iteration do Draw ǫ ∼qX(·), ξ ∼qY (·) Compute xi;θX = T X θX(ǫi) and yj;θY = T Y θY (ξj) M ←MinimumWeightMatching(XθX, YθY ) Align the matched pairs y1;θY , . . . , yN;θY ← yM1;θY , . . . , yMN;θY for each mini batch s ∈[0, |B|, 2|B|, . . . , N] do θ = SGD(θ, 1 |B| Ps+|B|−1 i=s d(xi;θX, yi;θY )) end for end for Figure 1: Pseudocode of PMD for parameter learning with graphical illustration of an iteration. Top: draw the populations and compute the matching; bottom: update the distribution parameters. In this paper, we consider a sample-based estimation of the Wasserstein metric [49], which we refer to as population matching discrepancy (PMD). PMD is the cost of the minimum weight matching of the two sample populations from the distributions, and we show that it is a strongly consistent estimator of the first Wasserstein metric. We propose an algorithm to use PMD as a training objective to learn the parameters of the distribution, and reveal that PMD has some advantages over MMD: PMD has no bandwidth hyper-parameter, has stronger gradient, and can use normal mini-batch size, such as 100, during the learning. We compare PMD with MMD on two deep learning tasks, domain adaptation and generative modeling. PMD outperforms MMD in terms of both the performance and the speed of convergence. 2 Population Matching Discrepancy In this section, we give the definition of the population matching discrepancy (PMD) and propose an algorithm to learn with PMD. 2.1 Population Matching Discrepancy Consider the general case where we have two distributions pX(x) and pY (y), whose PDFs are unknown, but we are allowed to draw samples from them. Let X = {xi}N i=1 and Y = {yj}N j=1 denote the N i.i.d. samples from each distribution respectively. We define the N-PMD of the two distributions as DN(X, Y) = min M 1 N N X i=1 d(xi, yMi), (1) where d(·, ·) is any distance in the sample space (e.g., Euclidean distance) and M is a permutation to derive a matching between the two sets of samples. The optimal M corresponds to the bipartite minimum weight matching [27], where each element of the cost matrix is dij = d(xi, yj) with i, j ∈[N], where [N] = {1, · · · , N}. Intuitively, PMD is the average distance of the matched pairs of samples, therefore it is non-negative and symmetric. Furthermore, as we shall see in Sec. 3.1, PMD is a strongly consistent estimator of the first Wasserstein metric [49] between pX and pY , which is a valid statistical distance, i.e., D∞(X, Y) = 0 iff the two distributions pX and pY are identical. 2.2 Parameter Learning While the N-PMD in Eq. (1) itself can serve as a measure of the closeness of two distributions, we are more interested in learning the parameter of the distributions using PMD as an objective. For instance, in generative modeling [31], we have a parameterized generator distribution pX(x; θX) and a data distribution pY (y), and we wish to minimize the distance of these two distributions. We 2 assume the samples are obtained by applying some parameterized transformations to a known and fixed noise distribution, i.e., ǫi ∼qX(ǫ), xi;θX = T X θX(ǫi); and ξj ∼qY (ξ), yj;θY = T Y θY (ξj). For flexibility, the transformations can be implemented by deep neural networks. Without loss of generality, we assume both pX and pY are parameterized distributions by θX and θY , respectively. If pX is a fixed distribution, we can take qX = pX and T X θX to be a fixed identity mapping. Our goal for parameter learning is to minimize the expected N-PMD over different populations min θX,θY Eǫ,ξDN(XθX, YθY ), (2) where ǫ = {ǫi}N i=1, ξ = {ξj}N j=1, XθX = {xi;θX}N i=1 and YθY = {yj;θY }N j=1, and the expectation is for preventing over-fitting the parameter with respect to particular populations. The parameters can be optimized by stochastic gradient descent (SGD) [7]. At each iteration, we draw ǫ and ξ, and compute an unbiased stochastic gradient ∇θDN(XθX, YθY ) = ∇θ min M 1 N N X i=1 d(xi;θX, yMi;θY ) = ∇θ 1 N N X i=1 d(xi;θX, yM ∗ i ;θY ), (3) where M∗= argminM PN i=1 d(xi;θX, yMi;θY ) is the minimum weight matching for XθX and YθY . The second equality in Eq. (3) holds because the discrete matching M∗should not change for infinitesimal change of θ, as long as the transformations T X, T Y , and the distance d(·, ·) are continuous. In other words, the gradient does not propagate through the matching. Furthermore, assuming that the matching M∗does not change much within a small number of gradient updates, we can have an even cheaper stochastic gradient by subsampling the populations ∇θDN(XθX, YθY ) ≈∇θ 1 |B| |B| X i=1 d(xBi;θX, yM ∗ Bi;θY ), (4) where a mini-batch of |B|, e.g., 100, samples is used to approximate the whole N-sample population. To clarify, our population size N is known as the mini-batch size in some maximum mean discrepancy (MMD) literature [31], and is around 1000. Fig. 1 is the pseudocode of parameter learning for PMD along with a graphical illustration. In the outer loop, we generate populations and compute the matching; and in the inner loop, we perform several SGD updates of the parameter θ, assuming the matching M does not change much. In the graphical illustration, the distribution pY is fixed, and we want to optimize the parameters of pX to minimize their PMD. 2.3 Solving the Matching Problem The minimum weight matching can be solved exactly in O(N 3) by the Hungarian algorithm [27]. When the problem is simple enough, so that small N, e.g., hundreds, is sufficient for reliable distance estimation, O(N 3) time complexity is acceptable comparing with the O(N × BackProp) time complexity of computing the gradient with respect to the transformations T X θX and T Y θY . When N is larger, e.g., a few thousands, the Hungarian algorithm takes seconds to run. We resort to Drake and Hougardy’s approximated matching algorithm [11] in O(N 2) time. The running time and model quality of PMD using both matching algorithms are reported in Sec. 5.3. In practice, we find PMD with both the exact and approximate matching algorithms works well. This is not surprising because training each sample towards its approximate matching sample is still reasonable. Finally, while we only implement the serial CPU version of the matching algorithms, both algorithm can be parallelized on GPU to further improve the running speed [10, 34]. 3 Theoretical Analysis and Connections to Other Discrepancies In this section, we establish the connection between PMD with the Wasserstein metric and the maximum mean discrepancy (MMD). We show that PMD is a strongly consistent estimator of the Wasserstein metric, and compare its advantages and disadvantages with MMD. 3 3.1 Relationship with the Wasserstein Metric The Wasserstein metric [49] was initially studied in the optimal transport theory, and has been adopted in computer vision [40], information retrival [50] and differential privacy [30]. The first Wasserstein metric of two distributions pX(x) and pY (y) is defined as inf γ(x,y) Z d(x, y)γ(x, y)dxdy s.t. Z γ(x, y)dx = pY (y), ∀y; Z γ(x, y)dy = pX(x), ∀x; γ(x, y) ≥0, ∀x, y. (5) Intuitively, the Wasserstein metric is the optimal cost to move some mass distributed as pX to pY , where the transference plan γ(x, y) is the amount of mass to move from x to y. Problem (5) is not tractable because the PDFs of pX and pY are unknown. We approximate them with empirical distributions ˆpX(x) = 1 N PN i=1 δxi(x) and ˆpY (y) = 1 N PN j=1 δyj(y), where δx(·) is the Dirac delta function at x. To satisfy the constraints, γ should have the form γ(x, y) = PN i=1 PN j=1 γijδxi,yj(x, y), where γij ≥0. Letting pX = ˆpX and pY = ˆpY , we can simplify problem (5) as follows min γ N X i=1 N X j=1 d(xi, yj)γij s.t. N X j=1 γij = 1 N , i ∈[N]; N X i=1 γij = 1 N , j ∈[N]; γij ≥0. (6) The linear program (6) is equivalent to the minimum weight matching problem [27], i.e., there exists a permutation M1, . . . , MN, such that γ(xi, yMi) = 1 N is an optimal solution (see Proposition 5.4 in [6]). Plugging such γ back to problem (6), we obtain Eq. (1), the original definition of PMD. Furthermore, we can show that the solution of problem (6), i.e., the N-PMD, is a strongly consistent estimator of the first Wasserstein metric in problem (5). Definition 1 (Weak Convergence of Measure [48]). A sequence of probability distributions pN, N = 1, 2, ... converges weakly to the probability distribution p, denoted as pn ⇒p, if limN→∞EpN [f] = Ep[f] for all bounded continuous functions f. Proposition 3.1 (Varadarajan Theorem [48]). Let x1, ..., xN, ... be independent, identically distributed real random variables with the density function p(x), let pN(x) = 1 N PN i=1 δxN (x) where δxN (·) is the Dirac delta function. Then pN ⇒p almost surely. Proposition 3.2 (Stability of Optimal Transport [49]). Let X and Y be Polish spaces and let d : X × Y →R be a continuous function s.t. inf d > −∞. Let {pX N}N∈N and {pY N}N∈N be sequences of probability distributions on X and Y respectively. Assume that pX N ⇒pX (resp. pY N ⇒pY ). For each N, let γN be an optimal transference plan between pX N and pY N. If lim infN∈N R d(x, y)γN(x, y)dxdy < +∞, then γN ⇒γ, where γ is an optimal transference plan between pX and pY . Proposition 3.2 is a special case of Theorem 5.20 in [49] with fixed function d. The following theorem is the main result of this section. Theorem 3.3 (Strong Consistency of PMD). Let x1, ..., xN, ... and y1, ..., yN, ... be independent, identically distributed real random variables from pX and pY , respectively. We construct a sequence of PMD problems (6) between pX N(x) = 1 N PN i=1 δxN (x) and pY N(y) = 1 N PN i=1 δyN (y). Let γN be the optimal transference plan of the N-th PMD problem. Then the sequence γN ⇒ γ almost surely, where γ is the optimal transference plan between pX and pY . Moreover, limN→∞ R d(x, y)γN(x, y)dxdy = R d(x, y)γ(x, y)dxdy almost surely. The proof is straightforward by applying Proposition 3.1 and 3.2. We also perform an empirical study of the approximation error with respect to the population size in Fig. 2(a). While the Wasserstein metric has been widely adopted in various machine learning and data mining tasks [40, 50, 30], it is usually used to measure the similarity between two discrete distributions, e.g., histograms. In contrast, PMD is a stochastic approximation of the Wasserstein metric between two continuous distributions. There is also work on estimating the Wasserstein metric of continuous distributions based on samples [45]. Unlike PMD, which is approximating the primal problem, they approximate the dual. Their approximation is not differentiable with respect to the distribution 4 1 2 4 8 16 32 64 128 256 Population size N 10 1 100 Relative approximation error (a) Relative approximation error w.r.t the population size 0 1 2 3 4 5 Normalized magnitude of gradient 0 50 100 150 200 250 300 Frequency PMD MMD (b) Distribution of normalized gradients Figure 2: Some empirical analysis results. The detailed experiment setting is described in Sec. 5.4. parameters because the parameters appear in the constraint instead of the objective. Recently, Wasserstein GAN (WGAN) [3] proposes approximating the dual Wasserstein metric by using a neural network “critic” in place of a 1-Lipschitz function. While WGAN has shown excellent performance on generative modeling, it can only compute a relative value of the Wasserstein metric upon to an unknown scale factor depending on the Lipschitz constant of the critic neural network. PMD also differs from WGAN by not requiring a separate critic network with additional parameters. Instead, PMD is parameter free and can be computed in polynomial time. 3.2 Relationship with MMD Maximum mean discrepancy (MMD) [17] is a popular method for estimating the distance between two distributions by samples, defined as follows DMMD(X, Y) = 1 N 2 N X i=1 N X j=1 k(xi, xj) − 2 NM N X i=1 M X j=1 k(xi, yj) + 1 M 2 M X i=1 M X j=1 k(yi, yj), where k(·, ·) is a kernel, e.g., k(x, y) = exp(−∥x −y∥2 /2σ2) is the RBF kernel with bandwidth σ. Both MMD and the Wasserstein metric are integral probability metrics [17], with different function classes. MMD has a closed-form objective, and can be evaluated in O(NMD) if x and y are Ddimensional vectors. In contrast, PMD needs to solve a matching problem, and the time complexity is O(N 2D) for computing the distance matrix, O(N 3) for exact Hungarian matching, and O(N 2) for approximated matching. However, as we argued in Sec. 2.3, the time complexity for computing matching is still acceptable comparing with the cost of training neural networks. Comparing with MMD, PMD has a number of advantages: Fewer hyper-parameter PMD do not have the kernel bandwidth σ, which needs tuning. Stronger gradient Using the RBF kernel, the gradient of MMD w.r.t a particular sample xi is ∇xiDMMD(X, Y) = 1 N 2 P j k(xi, xj) xj−xi σ2 − 2 NM P j k(xi, yj) yj−xi σ2 . When minimizing MMD, the first term is a repulsive term between the samples from pX, and the second term is an attractive term between the samples from pX and pY . The L2 norm of the term between two samples x and y is k(x, y) ∥x−y∥2 σ2 , which is small if ∥x −y∥2 is either too small or too large. As a result, if a sample xi is an outlier, i.e., it is not close to any samples from pY , all the k(xi, yj) terms are small and xi will not receive strong gradients. On the other hand, if all the samples xi, i ∈[N] are close to each other, xj −xi is small, so that repulsive term of the gradient is weak. Both cases slow down the training. In contrast, if d(x, y) = |x −y| is the L1 distance, the gradient of PMD ∇xiDN(X, Y) = 1 N sgn(xi −yMi), where sgn(·) is the sign function, is always strong regardless of the closeness between xi and yMi. We compare the distribution of the relative magnitude of the gradient of the parameters contributed by each sample in Fig. 2(b). The PMD gradients have similar magnitude for each sample, while there are many samples have small gradients for MMD. Smaller mini-batch size As we see in Sec 2.2, the SGD mini-batch size for PMD can be smaller than the population size; while the mini-batch size for MMD must be equal with the population size. This is because PMD only considers the distance between a sample and its matched sample, while 5 MMD considers the distance between all pairs of samples. As the result of smaller mini-batch size, PMD can converge faster than MMD when used as a training objective. 4 Applications 4.1 Domain Adaptation Now we consider a scenario where the labeled data is scarce in some domain of interest (target domain) but that is abundant in some related domain (source domain). Assuming that the data distribution pS(X, y) for the source domain and that of the target domain, i.e. pT (X, y) are similar but not the same, unsupervised domain adaptation aims to train a model for the target domain, given some labeled data {(XS i , yS i )}NS i=1 from the source domain and some unlabeled data {XT j }NT j=1 from the target domain. According to the domain adaptation theory [5], the generalization error on the target domain depends on the generalization error on the source domain as well as the difference between the two domains. Therefore, one possible solution for domain adaptation is to learn a feature extractor φ(X) shared by both domains, which defines feature distributions pφ S and pφ T for both domains, and minimize some distance between the feature distributions [47] as a regularization. Since the data distribution is inaccessible, we replace all distributions with their empirical distributions ˆpS, ˆpT , ˆpφ S and ˆpφ T , and the training objective is EX,y∼ˆpSL(y, h(φ(X))) + λD(ˆpφ S, ˆpφ T ), where L(·, ·) is a loss function, h(·) is a classifier, λ is a hyper-parameter, and D(ˆpφ S, ˆpφ T ) is the domain adaptation regularization. While the Wasserstein metric itself of two empirical distribution is tractable, it can be too expensive to compute due to the large size of the dataset. Therefore, we still approximate the distance with (expected) PMD, i.e., D(ˆpφ S, ˆpφ T ) ≈EXS∼ˆpS,XT ∼ˆpT DP MD(φ(XS), φ(XT )). 4.2 Deep Generative Modeling Deep generative models (DGMs) aim at capturing the complex structures of the data by combining hierarchical architectures and probabilistic modelling. They have been proven effective on image generation [38] and semi-supervised learning [23] recently. There are many different DGMs, including tractable auto-regressive models [37], latent variable models [24, 39], and implicit probabilistic models [16, 31]. We focus on learning implicit probabilistic models, which define probability distributions on sample space flexibly without a closed-form. However, as described in Sec. 2.2, we can draw samples X = T X θX(ǫ) efficiently from the models by transforming a random noise ǫ ∼q(ǫ), where q is a simple distribution (e.g. uniform), to X through a parameterized model (e.g. neural network). The parameters in the models are trained to minimize some distance between the model distribution pX(X) and the empirical data distribution ˆpY (Y ). The distance can be defined based on an parameterized adversary, i.e., another neural network [16, 3], or directly with the samples [31]. We choose the distance to be the first Wasserstein metric, and employ its finite-sample estimator (i.e., the N-PMD defined in Eq. (2)) as training objective directly. Training this model with MMD is known as generative moment matching networks [31, 12]. 5 Experiments We now study the empirical performance of PMD and compare it with MMD. In the experiments, PMD always use the L1 distance, and MMD always use the RBF kernel. Our experiment is conducted on a machine with Nvidia Titan X (Pascal) GPU and Intel E5-2683v3 CPU. We implement the models in TensorFlow [1]. The matching algorithms are implemented in C++ with a single thread, and we write a CUDA kernel for computing the all-pair L1 distance within a population. The CUDA program is compiled with nvcc 8.0 and the C++ program is compiled with g++ 4.8.4, while -O3 flag is used for both programs. We use the approximate matching for the generative modeling experiment and exact Hungarian matching for all the other experiments. 5.1 Domain Adaptation We compare the performance of PMD and MMD on the standard Office [41] object recognition benchmark for domain adaptation. The dataset contains three domains: amazon, dslr and webcam, and 6 Table 1: All the 6 unsupervised domain adaptation accuracy on the Office dataset between the amazon (a), dslr (d) and webcam (w) domains, in percentage. SVM and NN are trained only on the source domain, where NN uses the same architecture of PMD and MMD, but set λ = 0. Method a →w d →w w →d a →d d →a w →a avg. DDC [47] 59.4±.8 92.5±.3 91.7±.8 DANN [13] 73.0 96.4 99.2 CMD [52] 77.0±.6 96.3±.4 99.2±.2 79.6 ± .6 63.8±.7 63.3±.6 79.9 JAN-xy [33] 78.1±.4 96.4 ± .2 99.3±.1 77.5 ± .2 68.4 ± .2 65.0±.4 80.8 SVM 65.0 96.1 99.4 70.7 56.4 55.1 73.8 NN 67.8±.5 96.3±.2 99.5±.2 73.9 ± .6 58.5±.3 58.1±.3 75.7 MMD 76.9±.8 96.2±.2 99.6 ± .2 78.4±1.0 64.9±.5 68.1 ± .6 80.7 PMD 86.2 ± .7 96.2±.3 99.5±.2 82.7 ± .8 64.3±.4 66.8±.4 82.6 0 500 1000 1500 2000 2500 3000 3500 4000 number of iterations 0.54 0.56 0.58 0.60 0.62 0.64 0.66 test accuracy PMD MMD (a) Convergence speed 0.25 1 4 9 16 25 36 49 64 81 100 bandwidth 0.03 0.1 0.3 1 3 10 30 100 300 1000 3000 regularization 0.58 0.55 0.56 0.59 0.64 0.6 0.59 0.6 0.56 0.57 0.58 0.57 0.56 0.54 0.58 0.65 0.64 0.62 0.62 0.61 0.6 0.61 0.58 0.57 0.55 0.54 0.65 0.65 0.64 0.64 0.61 0.61 0.6 0.58 0.56 0.56 0.53 0.61 0.68 0.66 0.64 0.62 0.62 0.61 0.59 0.57 0.57 0.55 0.59 0.66 0.62 0.65 0.63 0.62 0.63 0.58 0.6 0.58 0.55 0.57 0.64 0.65 0.65 0.64 0.62 0.62 0.59 0.58 0.58 0.56 0.56 0.62 0.65 0.65 0.64 0.63 0.62 0.57 0.56 0.57 0.57 0.56 0.59 0.6 0.6 0.62 0.63 0.62 0.59 0.59 0.58 0.58 0.57 0.59 0.58 0.6 0.6 0.6 0.6 0.57 0.57 0.57 0.56 0.58 0.57 0.59 0.58 0.59 0.6 0.6 0.58 0.58 0.56 0.58 0.57 0.56 0.58 0.58 0.59 0.58 0.57 0.550 0.575 0.600 0.625 0.650 0.675 (b) MMD parameter sensitivity 10 4 10 3 10 2 10 1 1 101 102 regularization 0.475 0.500 0.525 0.550 0.575 0.600 0.625 0.650 test accuracy (c) PMD parameter sensitivity Figure 3: Convergence speed and parameter sensitivity on the Office d →a task. there are 31 classes. Following [52], we use the 4096-dimensional VGG-16 [43] feature pretrained on ImageNet as the input. The classifier is a fully-connected neural network with a single hidden layer of 256 ReLU [15] units, trained with AdaDelta [51]. The domain regularization term is put on the hidden layer. We apply batch normalization [21] on the hidden layer, and the activations from the source and the target domain are normalized separately. Following [8], we validate the domain regularization strength λ and the MMD kernel bandwidth σ on a random 100-sample labeled dataset on the target domain, but the model is trained without any labeled data from the target domain. The experiment is then repeated for 10 times on the hyper-parameters with the best validation error. Since we perform such validation for both PMD and MMD, the comparison between them is fair. The result is reported in Table 1, and PMD outperforms MMD on the a →w and a →d tasks by a large margin, and is comparable with MMD on the other 4 tasks. Then, we compare the convergence speed of PMD and MMD on the d →a task. We choose this task because PMD and MMD have similar performance on it. The result is shown in Fig. 3(a), where PMD converges faster than MMD. We also show the parameter sensitivity of MMD and PMD as Fig. 3(b) and Fig. 3(c), respectively. The performance of MMD is sensitive to both the regularization parameter λ and the kernel bandwidth σ, so we need to tune both parameters. In contrast, PMD only has one parameter to tune. 5.2 Generative Modeling We compare PMD with MMD for image generation on the MNIST [28], SVHN [36] and LFW [20] dataset. For SVHN, we train the models on the 73257-image training set. The LFW dataset is converted to 32 × 32 gray-scale images [2], and there are 13233 images for training. The noise ǫ follows a uniform distribution [−1, 1]40. We implemented three architectures, including a fullyconnected (fc) network as the transformation T X θX, a deconvolutional (conv) network, and a fullyconnected network for generating the auto-encoder codes (ae) [31], where the auto-encoder is a convolutional one pre-trained on the dataset. For MMD, we use a mixture of kernels of different bandwidths for the fc and conv architecture, and the bandwidth is fixed at 1 for the ae architecture, following the settings in the generative moment matching networks (GMMN) paper. We set the population size N = 2000 for both PMD and MMD, and the mini-batch size |B| = 100 for PMD. We use the AdaM optimizer [22] with batch normalization [21], and train the model for 100 epoches for PMD, and 500 epoches for MMD. The generated images on the SVHN and LFW dataset are 7 fc conv ae MMD PMD MMD PMD Figure 4: Image generation results on SVHN (top two rows) and LFW (bottom two rows). 4000 2000 1000 500 250 100 Mini-batch size |B| 52 54 56 58 60 Final PMD N=500 N=1000 N=2000 N=4000 Exact N=500 (a) PMD sensitivity w.r.t. N and |B| 8000 6000 4000 2000 1000 500 250 100 Population size N 0.0120 0.0121 0.0122 0.0123 0.0124 0.0125 0.0126 Final MMD (b) sensitivity of MMD w.r.t. N 500 1000 2000 4000 Population size N 100 101 102 Time (seconds) Exact Randomized SGD (c) split of the time per epoch Figure 5: Convergence and timing results. The “Exact N = 500” curve in (a) uses the Hungarian algorithm, and the rest uses the approximated matching algorithm. presented in Fig. 4, and the images on the MNIST dataset can be found in the supplementary material. We observe that the images generated by PMD are less noisy than that generated by MMD. While MMD only performs well on the autoencoder code space (ae), PMD generates acceptable images on pixel space. We also noticed the generated images of PMD on the SVHN and LFW datasets are blurry. One reason for this is the pixel-level L1 distance is not good for natural images. Therefore, learning the generative model on the code space helps. To verify that PMD does not trivially reproduce the training dataset, we perform a circular interpolation in the representation space q(ǫ) between 5 random points, the result is available in the supplementary material. 5.3 Convergence Speed and Time Consumption We study the impact of the population size N, the mini-batch size |B| and the choice of matching algorithm to PMD. Fig. 5(a) shows the final PMD evaluated on N = 2000 samples on the MNIST dataset, using the fc architecture, after 100 epoches. The results show that the solution is insensitive to neither the population size N nor the choice of the matching algorithm, which implies that we can use the cheap approximated matching and relatively small population size for speed. On the other hand, decreasing the mini-batch size |B| improves the final PMD significantly, supporting our claim in Sec. 3.2 that the ability of using small |B| is indeed an advantage for PMD. Unlike PMD, there is a trade-off for selecting the population size N for MMD, as shown in Fig. 5(b). If N is too large, the SGD optimization converges slowly; if N is too small, the MMD estimation is unreliable. Fig. 5(c) shows the total time spent on exact matching, approximated matching and SGD respectively for each epoch. The cost of approximated matching is comparable with the cost of SGD. Again, we emphasize while we only have single thread implementations for the matching algorithms, both the exact [10] and approximated matching [34] can be significantly accelerated with GPU. 5.4 Empirical Studies We examine the approximation error of PMD on a toy dataset. We compute the distances between two 5-dimensional standard isotropic Gaussian distributions. One distribution is centered at the origin and the other is at (10, 0, 0, 0, 0). The first Wasserstein metric between these two distributions is 10. We vary the population size N and compute the relative approximation error = |DN(X, Y) −10|/10 for 100 different populations (X, Y) for each N. The result is shown in Fig. 2(a). We perform a 8 linear regression between log N and the logarithm of expected approximation error, and find that the error is roughly proportional to N −0.23. We also validate the claim in Sec. 3.2 on the stronger gradients of PMD than that of MMD. We calculate the magnitude (in L2 norm) of the gradient of the parameters contributed by each sample. The gradients are computed on the converged model, and the model is the same as Sec. 5.3. Because the scale of the gradients depend on the scale of the loss function, we normalize the magnitudes by dividing them with the average magnitude of the gradients. We then show the distribution of normalized magnitudes of gradients in Fig. 2(b). The PMD gradients contributed by each sample are close with each other, while there are many samples contributing small gradients for MMD, which may slow down the fitting of these samples. 6 Conclusions We present population matching discrepancy (PMD) for estimating the distance between two probability distributions by samples. PMD is the minimum weight matching between two random populations from the distributions, and we show that PMD is a strongly consistent estimator of the first Wasserstein metric. We also propose a stochastic gradient descent algorithm to learn parameters of the distributions using PMD. Comparing with the popular maximum mean discrepancy (MMD), PMD has no kernel bandwidth hyper-parameter, stronger gradient and smaller mini-batch size for gradient-based optimization. We apply PMD to domain adaptation and generative modeling tasks. Empirical results show that PMD outperforms MMD in terms of performance and convergence speed in both tasks. In the future, we plan to derive finite-sample error bounds for PMD, study its testing power, and accelerate the computation of minimum weight matching with GPU. Acknowledgments This work is supported by the National NSF of China (Nos. 61620106010, 61621136008, 61332007), the MIIT Grant of Int. Man. Comp. Stan (No. 2016ZXFB00001), the Youth Top-notch Talent Support Program, Tsinghua Tiangong Institute for Intelligent Computing and the NVIDIA NVAIL Program. 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] Siddharth Agrawal. Generative Moment Matching Networks. https://github.com/ siddharth-agrawal/Generative-Moment-Matching-Networks. [3] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017. [4] Marc G Bellemare, Ivo Danihelka, Will Dabney, Shakir Mohamed, Balaji Lakshminarayanan, Stephan Hoyer, and Rémi Munos. The cramer distance as a solution to biased wasserstein gradients. arXiv preprint arXiv:1705.10743, 2017. [5] 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. [6] Dimitri P Bertsekas. Network optimization: continuous and discrete models. Citeseer, 1998. [7] Léon Bottou. Large-scale machine learning with stochastic gradient descent. In Proceedings of COMPSTAT’2010, pages 177–186. Springer, 2010. [8] Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks. In Advances in Neural Information Processing Systems, pages 343–351, 2016. [9] Kyunghyun Cho, Bart Van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. In EMNLP, 2014. 9 [10] Ketan Date and Rakesh Nagi. Gpu-accelerated hungarian algorithms for the linear assignment problem. Parallel Computing, 57:52–72, 2016. [11] Doratha Drake and Stefan Hougardy. Improved linear time approximation algorithms for weighted matchings. Approximation, Randomization, and Combinatorial Optimization.. Algorithms and Techniques, pages 21–46, 2003. [12] Gintare Karolina Dziugaite, Daniel M Roy, and Zoubin Ghahramani. Training generative neural networks via maximum mean discrepancy optimization. In UAI, 2015. [13] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(59):1–35, 2016. [14] Bo Geng, Dacheng Tao, and Chao Xu. Daml: Domain adaptation metric learning. IEEE Transactions on Image Processing, 20(10):2980–2989, 2011. [15] Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In AISTATS, volume 15, page 275, 2011. [16] 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. [17] Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Schölkopf, and Alexander Smola. A kernel two-sample test. Journal of Machine Learning Research, 13(Mar):723–773, 2012. [18] Arthur Gretton, Dino Sejdinovic, Heiko Strathmann, Sivaraman Balakrishnan, Massimiliano Pontil, Kenji Fukumizu, and Bharath K Sriperumbudur. Optimal kernel choice for large-scale two-sample tests. In Advances in neural information processing systems, pages 1205–1213, 2012. [19] 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. [20] 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 07-49, University of Massachusetts, Amherst, October 2007. [21] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015. [22] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. 2014. [23] 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. [24] Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. [25] Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009. [26] 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. [27] Harold W Kuhn. The hungarian method for the assignment problem. Naval research logistics quarterly, 2(1-2):83–97, 1955. [28] 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. [29] Chun-Liang Li, Wei-Cheng Chang, Yu Cheng, Yiming Yang, and Barnabás Póczos. Mmd gan: Towards deeper understanding of moment matching network. arXiv preprint arXiv:1705.08584, 2017. [30] Ninghui Li, Tiancheng Li, and Suresh Venkatasubramanian. t-closeness: Privacy beyond k-anonymity and l-diversity. In Data Engineering, 2007. ICDE 2007. IEEE 23rd International Conference on, pages 106–115. IEEE, 2007. 10 [31] Yujia Li, Kevin Swersky, and Richard S Zemel. Generative moment matching networks. In ICML, pages 1718–1727, 2015. [32] James R Lloyd and Zoubin Ghahramani. Statistical model criticism using kernel two sample tests. In Advances in Neural Information Processing Systems, pages 829–837, 2015. [33] Mingsheng Long, Jianmin Wang, and Michael I Jordan. Deep transfer learning with joint adaptation networks. In ICML, 2017. [34] Fredrik Manne and Rob Bisseling. A parallel approximation algorithm for the weighted maximum matching problem. Parallel Processing and Applied Mathematics, pages 708–717, 2008. [35] Shakir Mohamed and Balaji Lakshminarayanan. Learning in implicit generative models. arXiv preprint arXiv:1610.03483, 2016. [36] 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. [37] Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. In ICML, 2016. [38] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015. [39] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In ICML, 2014. [40] Yossi Rubner, Carlo Tomasi, and Leonidas J Guibas. The earth mover’s distance as a metric for image retrieval. International journal of computer vision, 40(2):99–121, 2000. [41] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. Computer Vision–ECCV 2010, pages 213–226, 2010. [42] Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems, pages 2234–2242, 2016. [43] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015. [44] Le Song, Arthur Gretton, Danny Bickson, Yucheng Low, and Carlos Guestrin. Kernel belief propagation. In International Conference on Artificial Intelligence and Statistics, pages 707–715, 2011. [45] Bharath K Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Schölkopf, and Gert RG Lanckriet. Non-parametric estimation of integral probability metrics. In Information Theory Proceedings (ISIT), 2010 IEEE International Symposium on, pages 1428–1432. IEEE, 2010. [46] Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26–31, 2012. [47] Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014. [48] VS Varadarajan. Weak convergence of measures on separable metric spaces. Sankhy¯a: The Indian Journal of Statistics (1933-1960), 19(1/2):15–22, 1958. [49] Cédric Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008. [50] Xiaojun Wan. A novel document similarity measure based on earth mover’s distance. Information Sciences, 177(18):3718–3730, 2007. [51] Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012. [52] Werner Zellinger, Thomas Grubinger, Edwin Lughofer, Thomas Natschläger, and Susanne Saminger-Platz. Central moment discrepancy (cmd) for domain-invariant representation learning. In ICLR, 2017. 11
2017
113
6,579
Predictive State Recurrent Neural Networks Carlton Downey Carnegie Mellon University Pittsburgh, PA 15213 cmdowney@cs.cmu.edu Ahmed Hefny Carnegie Mellon University Pittsburgh, PA, 15213 ahefny@cs.cmu.edu Boyue Li Carnegie Mellon University Pittsburgh, PA, 15213 boyue@cs.cmu.edu Byron Boots Georgia Tech Atlanta, GA, 30332 bboots@cc.gatech.edu Geoff Gordon Carnegie Mellon University Pittsburgh, PA, 15213 ggordon@cs.cmu.edu Abstract We present a new model, Predictive State Recurrent Neural Networks (PSRNNs), for filtering and prediction in dynamical systems. PSRNNs draw on insights from both Recurrent Neural Networks (RNNs) and Predictive State Representations (PSRs), and inherit advantages from both types of models. Like many successful RNN architectures, PSRNNs use (potentially deeply composed) bilinear transfer functions to combine information from multiple sources. We show that such bilinear functions arise naturally from state updates in Bayes filters like PSRs, in which observations can be viewed as gating belief states. We also show that PSRNNs can be learned effectively by combining Backpropogation Through Time (BPTT) with an initialization derived from a statistically consistent learning algorithm for PSRs called two-stage regression (2SR). Finally, we show that PSRNNs can be factorized using tensor decomposition, reducing model size and suggesting interesting connections to existing multiplicative architectures such as LSTMs and GRUs. We apply PSRNNs to 4 datasets, and show that we outperform several popular alternative approaches to modeling dynamical systems in all cases. 1 Introduction Learning to predict temporal sequences of observations is a fundamental challenge in a range of disciplines including machine learning, robotics, and natural language processing. While there are a wide variety of different approaches to modelling time series data, many of these approaches can be categorized as either recursive Bayes Filtering or Recurrent Neural Networks. Bayes Filters (BFs) [1] focus on modeling and maintaining a belief state: a set of statistics, which, if known at time t, are sufficient to predict all future observations as accurately as if we know the full history. The belief state is generally interpreted as the statistics of a distribution over the latent state of a data generating process, conditioned on history. BFs recursively update the belief state by conditioning on new observations using Bayes rule. Examples of common BFs include sequential filtering in Hidden Markov Models (HMMs) [2] and Kalman Filters (KFs) [3]. Predictive State Representations [4] (PSRs) are a variation on Bayes filters that do not define system state explicitly, but proceed directly to a representation of state as the statistics of a distribution of features of future observations, conditioned on history. By defining the belief state in terms of observables rather than latent states, PSRs can be easier to learn than other filtering methods [5–7]. PSRs also support rich functional forms through kernel mean map embeddings [8], and a natural interpretation of model update behavior as a gating mechanism. This last property is not unique to 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. PSRs, as it is also possible to interpret the model updates of other BFs such as HMMs in terms of gating. Due to their probabilistic grounding, BFs and PSRs possess a strong statistical theory leading to efficient learning algorithms. In particular, method-of-moments algorithms provide consistent parameter estimates for a range of BFs including PSRs [5, 7, 9–11]. Unfortunately, current versions of method of moments initialization restrict BFs to relatively simple functional forms such as linearGaussian (KFs) or linear-multinomial (HMMs). Recurrent Neural Networks (RNNs) are an alternative to BFs that model sequential data via a parameterized internal state and update function. In contrast to BFs, RNNs are directly trained to minimize output prediction error, without adhering to any axiomatic probabilistic interpretation. Examples of popular RNN models include Long-Short Term Memory networks [12] (LSTMs), Gated Recurrent Units [13] (GRUs), and simple recurrent networks such as Elman networks [14]. RNNs have several advantages over BFs. Their flexible functional form supports large, rich models. And, RNNs can be paired with simple gradient-based training procedures that achieve state-of-the-art performance on many tasks [15]. RNNs also have drawbacks however: unlike BFs, RNNs lack an axiomatic probabilistic interpretation, and are therefore difficult to analyze. Furthermore, despite strong performance in some domains, RNNs are notoriously difficult to train; in particular it is difficult to find good initializations. In summary, RNNs and BFs offer complementary advantages and disadvantages: RNNs offer rich functional forms at the cost of statistical insight, while BFs possess a sophisticated statistical theory but are restricted to simpler functional forms in order to maintain tractable training and inference. By drawing insights from both Bayes Filters and RNNs we develop a novel hybrid model, Predictive State Recurrent Neural Networks (PSRNNs). Like many successful RNN architectures, PSRNNs use (potentially deeply composed) bilinear transfer functions to combine information from multiple sources. We show that such bilinear functions arise naturally from state updates in Bayes filters like PSRs, in which observations can be viewed as gating belief states. We show that PSRNNs directly generalize discrete PSRs, and can be learned effectively by combining Backpropogation Through Time (BPTT) with an approximately consistent method-of-moments initialization based on two-stage regression. We also show that PSRNNs can be factorized using tensor decomposition, reducing model size and suggesting interesting connections to existing multiplicative architectures such as LSTMs. 2 Related Work It is well known that a principled initialization can greatly increase the effectiveness of local search heuristics. For example, Boots [16] and Zhang et al. [17] use subspace ID to initialize EM for linear dyanmical systems, and Ko and Fox [18] use N4SID [19] to initialize GP-Bayes filters. Pasa et al. [20] propose an HMM-based pre-training algorithm for RNNs by first training an HMM, then using this HMM to generate a new, simplified dataset, and, finally, initializing the RNN weights by training the RNN on this dataset. Belanger and Kakade [21] propose a two-stage algorithm for learning a KF on text data. Their approach consists of a spectral initialization, followed by fine tuning via EM using the ASOS method of Martens [22]. They show that this approach has clear advantages over either spectral learning or BPTT in isolation. Despite these advantages, KFs make restrictive linear-Gaussian assumptions that preclude their use on many interesting problems. Downey et al. [23] propose a two-stage algorithm for learning discrete PSRs, consisting of a spectral initialization followed by BPTT. While that work is similar in spirit to the current paper, it is still an attempt to optimize a BF using BPTT rather than an attempt to construct a true hybrid model. This results in several key differences: they focus on the discrete setting, and they optimize only a subset of the model parameters. Haarnoja et al. [24] also recognize the complementary advantages of Bayes Filters and RNNs, and propose a new network architecture attempting to combine some of the advantages of both. Their approach differs substantially from ours as they propose a network consisting of a Bayes Filter concatenated with an RNN, which is then trained end-to-end via backprop. In contrast our entire network architecture has a dual interpretation as both a Bayes filter and a RNN. Because of this, 2 our entire network can be initialized via an approximately consistent method of moments algorithm, something not possible in [24]. Finally, Kossaifiet al. [25] also apply tensor decomposition in the neural network setting. They propose a novel neural network layer, based on low rank tensor factorization, which can directly process tensor input. This is in contrast to a standard approach where the data is flattened to a vector. While they also recognize the strength of the multilinear structure implied by tensor weights, both their setting and their approach differ from ours: they focus on factorizing tensor input data, while we focus on factorizing parameter tensors which arise naturally from a kernelized interpretation of Bayes rule. 3 Background 3.1 Predictive State Representations Predictive state representations (PSRs) [4] are a class of models for filtering, prediction, and simulation of discrete time dynamical systems. PSRs provide a compact representation of a dynamical system by representing state as a set of predictions of features of future observations. Let ft = f(ot:t+k−1) be a vector of features of future observations and let ht = h(o1:t−1) be a vector of features of historical observations. Then the predictive state is qt = qt|t−1 = E[ft | o1:t−1]. The features are selected such that qt determines the distribution of future observations P(ot:t+k−1 | o1:t−1).1 Filtering is the process of mapping a predictive state qt to qt+1 conditioned on ot, while prediction maps a predictive state qt = qt|t−1 to qt+j|t−1 = E[ft+j | o1:t−1] without intervening observations. PSRs were originally developed for discrete data as a generalization of existing Bayes Filters such as HMMs [4]. However, by leveraging the recent concept of Hilbert Space embeddings of distributions [26], we can embed a PSR in a Hilbert Space, and thereby handle continuous observations [8]. Hilbert Space Embeddings of PSRs (HSE-PSRs) [8] represent the state as one or more nonparametric conditional embedding operators in a Reproducing Kernel Hilbert Space (RKHS) [27] and use Kernel Bayes Rule (KBR) [26] to estimate, predict, and update the state. For a full treatment of HSE-PSRs see [8]. Let kf, kh, ko be translation invariant kernels [28] defined on ft, ht, and ot respectively. We use Random Fourier Features [28] (RFF) to define projections φt = RFF(ft), ηt = RFF(ht), and ωt = RFF(ot) such that kf(fi, fj) ≈φT i φj, kh(hi, hj) ≈ ηT i ηj, ko(oi, oj) ≈ωT i ωj. Using this notation, the HSE-PSR predictive state is qt = E[φt | ot:t−1]. Formally an HSE-PSR (hereafter simply referred to as a PSR) consists of an initial state b1, a 3-mode update tensor W, and a 3-mode normalization tensor Z. The PSR update equation is qt+1 = (W ×3 qt) (Z ×3 qt)−1 ×2 ot. (1) where ×i is tensor multiplication along the ith mode of the preceding tensor. In some settings (such as with discrete data) it is possible to read off the observation probability directly from W ×3 qt; however, in order to generalize to continuous observations with RFF features we include Z as a separate parameter. 3.2 Two-stage Regression Hefny et al. [7] show that PSRs can be learned by solving a sequence of regression problems. This approach, referred to as Two-Stage Regression or 2SR, is fast, statistically consistent, and reduces to simple linear algebra operations. In 2SR the PSR model parameters q1, W, and Z are learned using 1For convenience we assume that the system is k-observable: that is, the distribution of all future observations is determined by the distribution of the next k observations. (Note: not by the next k observations themselves.) At the cost of additional notation, this restriction could easily be lifted. 3 the history features ηt defined earlier via the following set of equations: q1 = 1 T T X t=1 φt (2) W = T X t=1 φt+1 ⊗ωt ⊗ηt ! ×3 T X t=1 ηt ⊗φt !+ (3) Z = T X t=1 ωt ⊗ωt ⊗ηt ! ×3 T X t=1 ηt ⊗φt !+ . (4) Where + is the Moore-Penrose pseudo-inverse. It’s possible to view (2–4) as first estimating predictive states by regression from history (stage 1) and then estimating parameters W and Z by regression among predictive states (stage 2), hence the name Two-Stage Regression; for details see [7]. Finally in practice we use ridge regression in order to improve model stability, and minimize the destabilizing effect of rare events while preserving consistency. We could instead use nonlinear predictors in stage 1, but with RFF features, linear regression has been sufficient for our purposes.2 Once we learn model parameters, we can apply the filtering equation (1) to obtain predictive states q1:T . 3.3 Tensor Decomposition The tensor Canonical Polyadic decomposition (CP decomposition) [29] can be viewed as a generalization of the Singular Value Decomposition (SVD) to tensors. If T ∈R(d1×...×dk) is a tensor, then a CP decomposition of T is: T = m X i=1 a1 i ⊗a2 i ⊗... ⊗ak i where aj i ∈Rdj and ⊗is the Kronecker product. The rank of T is the minimum m such that the above equality holds. In other words, the CP decomposition represents T as a sum of rank-1 tensors. 4 Predictive State Recurrent Neural Networks In this section we introduce Predictive State Recurrent Neural Networks (PSRNNs), a new RNN architecture inspired by PSRs. PSRNNs allow for a principled initialization and refinement via BPTT. The key contributions which led to the development of PSRNNs are: 1) a new normalization scheme for PSRs which allows for effective refinement via BPTT; 2) the extention of the 2SR algorithm to a multilayered architecture; and 3) the optional use of a tensor decomposition to obtain a more scalable model. 4.1 Architecture The basic building block of a PSRNN is a 3-mode tensor, which can be used to compute a bilinear combination of two input vectors. We note that, while bilinear operators are not a new development (e.g., they have been widely used in a variety of systems engineering and control applications for many years [30]), the current paper shows how to chain these bilinear components together into a powerful new predictive model. Let qt and ot be the state and observation at time t. Let W be a 3-mode tensor, and let q be a vector. The 1-layer state update for a PSRNN is defined as: qt+1 = W ×2 ot ×3 qt + b ∥W ×2 ot ×3 qt + b∥2 (5) Here the 3-mode tensor of weights W and the bias vector b are the model parameters. This architecture is illustrated in Figure 1a. It is similar, but not identical, to the PSR update (Eq. 1); sec 3.1 gives 2Note that we can train a regression model to predict any quantity from the state. This is useful for general sequence-to-sequence mapping models. However, in this work we focus on predicting future observations. 4 more detail on the relationship. This model may appear simple, but crucially the tensor contraction W ×2 ot ×3 qt integrates information from bt and ot multiplicatively, and acts as a gating mechanism, as discussed in more detail in section 5. The typical approach used to increase modeling capability for BFs (including PSRs) is to use an initial fixed nonlinearity to map inputs up into a higher-dimensional space [31, 30]. PSRNNs incorporate such a step, via RFFs. However, a multilayered architecture typically offers higher representation power for a given number of parameters [32]. To obtain a multilayer PSRNN, we stack the 1-layer blocks of Eq. (5) by providing the output of one layer as the observation for the next layer. (The state input for each layer remains the same.) In this way we can obtain arbitrarily deep RNNs. This architecture is displayed in Figure 1b. We choose to chain on the observation (as opposed to on the state) as this architecture leads to a natural extension of 2SR to multilayered models (see Sec. 4.2). In addition, this architecture is consistent with the typical approach for constructing multilayered LSTMs/GRUs [12]. Finally, this architecture is suggested by the full normalized form of an HSE PSR, where the observation is passed through two layers. (a) Single Layer PSRNN (b) Multilayer PSRNN Figure 1: PSRNN architecture: See equation 5 for details. We omit bias terms to avoid clutter. 4.2 Learning PSRNNs There are two components to learning PSRNNs: an initialization procedure followed by gradientbased refinement. We first show how a statistically consistent 2SR algorithm derived for PSRs can be used to initialize the PSRNN model; this model can then be refined via BPTT. We omit the BPTT equations as they are similar to existing literature, and can be easily obtained via automatic differentiation in a neural network library such as PyTorch or TensorFlow. The Kernel Bayes Rule portion of the PSR update (equation 1) can be separated into two terms: (W ×3 qt) and (Z ×3 qt)−1. The first term corresponds to calculating the joint distribution, while the second term corresponds to normalizing the joint to obtain the conditional distribution. In the discrete case, this is equivalent to dividing the joint distribution of ft+1 and ot by the marginal of ot; see [33] for details. If we remove the normalization term, and replace it with two-norm normalization, the PSR update becomes qt+1 = W ×3qt×2ot ∥W ×3qt×2ot∥, which corresponds to calculating the joint distribution (up to a scale factor), and has the same functional form as our single-layer PSRNN update equation (up to bias). It is not immediately clear that this modification is reasonable. We show in appendix B that our algorithm is consistent in the discrete (realizable) setting; however, to our current knowledge we lose the consistency guarantees of the 2SR algorithm in the full continuous setting. Despite this we determined experimentally that replacing full normalization with two-norm normalization appears to have a minimal effect on model performance prior to refinement, and results in improved performance after refinement. Finally, we note that working with the (normalized) joint distribution in place of the conditional distribution is a commonly made simplification in the systems literature, and has been shown to work well in practice [34]. The adaptation of the two-stage regression algorithm of Hefny et al. [7] described above allows us to initialize 1-layer PSRNNs; we now extend this approach to multilayered PSRNNs. Suppose we have learned a 1-layer PSRNN P using two-stage regression. We can use P to perform filtering on a dataset to generate a sequence of estimated states ˆq1, ..., ˆqn. According to the architecture described in Figure 1b, these states are treated as observations in the second layer. Therefore we can initialize the second layer by an additional iteration of two-stage regression using our estimated 5 states ˆq1, ..., ˆqn in place of observations. This process can be repeated as many times as desired to initialize an arbitrarily deep PSRNN. If the first layer were learned perfectly, the second layer would be superfluous; however, in practice, we observe that the second layer is able to learn to improve on the first layer’s performance. Once we have obtained a PSRNN using the 2SR approach described above, we can use BPTT to refine the PSRNN. We note that we choose to use 2-norm divisive normalization because it is not practical to perform BPTT through the matrix inverse required in PSRs: the inverse operation is ill-conditioned in the neighborhood of any singular matrix. We observe that 2SR provides us with an initialization which converges to a good local optimum. 4.3 Factorized PSRNNs In this section we show how the PSRNN model can be factorized to reduce the number of parameters prior to applying BPTT. Let (W, b0) be a PSRNN block. Suppose we decompose W using CP decomposition to obtain W = n X i=1 ai ⊗bi ⊗ci Let A (similarly B, C) be the matrix whose ith row is ai (respectively bi, ci). Then the PSRNN state update (equation (5)) becomes (up to normalization): qt+1 = W ×2 ot ×3 qt + b (6) = (A ⊗B ⊗C) ×2 ot ×3 qt + b (7) = AT (Bot ⊙Cqt) + b (8) where ⊙is the Hadamard product. We call a PSRNN of this form a factorized PSRNN. This model architecture is illustrated in Figure 2. Using a factorized PSRNN provides us with complete control over the size of our model via the rank of the factorization. Importantly, it decouples the number of model parameters from the number of states, allowing us to set these two hyperparameters independently. Figure 2: Factorized PSRNN Architecture We determined experimentally that factorized PSRNNs are poorly conditioned when compared with PSRNNs, due to very large and very small numbers often occurring in the CP decomposition. To alleviate this issue, we need to initialize the bias b in a factorized PSRNN to be a small multiple of the mean state. This acts to stabilize the model, regularizing gradients and preventing us from moving away from the good local optimum provided by 2SR. We note that a similar stabilization happens automatically in randomly initialized RNNs: after the first few iterations the gradient updates cause the biases to become non-zero, stabilizing the model and resulting in subsequent gradient descent updates being reasonable. Initialization of the biases is only a concern for us because we do not want the original model to move away from our carefully prepared initialization due to extreme gradients during the first few steps of gradient descent. In summary, we can learn factorized PSRNNs by first using 2SR to initialize a PSRNN, then using CP decomposition to factorize the tensor model parameters to obtain a factorized PSRNN, then applying BPTT to the refine the factorized PSRNN. 6 5 Discussion The value of bilinear units in RNNs was the focus of recent work by Wu et al [35]. They introduced the concept of Multiplicative Integration (MI) units — components of the form Ax ⊙By — and showed that replacing additive units by multiplicative ones in a range of architectures leads to significantly improved performance. As Eq. (8) shows, factorizing W leads precisely to an architecture with MI units. Modern RNN architectures such as LSTMs and GRUs are known to outperform traditional RNN architectures on many problems [12]. While the success of these methods is not fully understood, much of it is attributed to the fact that these architectures possess a gating mechanism which allows them both to remember information for a long time, and also to forget it quickly. Crucially, we note that PSRNNs also allow for a gating mechanism. To see this consider a single entry in the factorized PSRNN update (omitting normalization). [qt+1]i = X j Aji X k Bjk[ot]k ⊙ X l Cjl[qt]l ! + b (9) The current state qt will only contribute to the new state if the function P k Bjk[ot]k of ot is non-zero. Otherwise ot will cause the model to forget this information: the bilinear component of the PSRNN architecture naturally achieves gating. We note that similar bilinear forms occur as components of many successful models. For example, consider the (one layer) GRU update equation: zt = σ(Wzot + Uzqt + cz) rt = σ(Wrot + Urqt + cr) qt+1 = zt ⊙qt + (1 −zt) ⊙σ(Whot + Uh(rt ⊙qt) + ch) The GRU update is a convex combination of the existing state qt and and update term Whot+Uh(rt⊙ qt) + ch. We see that the core part of this update term Uh(rt ⊙qt) + ch bears a striking similarity to our factorized PSRNN update. The PSRNN update is simpler, though, since it omits the nonlinearity σ(·), and hence is able to combine pairs of linear updates inside and outside σ(·) into a single matrix. Finally, we would like to highlight the fact that, as discussed in section 5, the bilinear form shared in some form by these models (including PSRNNs) resembles the first component of the Kernel Bayes Rule update function. This observation suggests that bilinear components are a natural structure to use when constructing RNNs, and may help explain the success of the above methods over alternative approaches. This hypothesis is supported by the fact that there are no activation functions (other than divisive normalization) present in our PSRNN architecture, yet it still manages to achieve strong performance. 6 Experimental Setup In this section we describe the datasets, models, model initializations, model hyperparameters, and evaluation metrics used in our experiments. We use the following datasets in our experiments: • Penn Tree Bank (PTB) This is a standard benchmark in the NLP community [36]. Due to hardware limitations we use a train/test split of 120780/124774 characters. • Swimmer We consider the 3-link simulated swimmer robot from the open-source package OpenAI gym.3 The observation model returns the angular position of the nose as well as the angles of the two joints. We collect 25 trajectories from a robot that is trained to swim forward (via the cross entropy with a linear policy), with a train/test split of 20/5. • Mocap This is a Human Motion Capture dataset consisting of 48 skeletal tracks from three human subjects collected while they were walking. The tracks have 300 timesteps each, and are from a Vicon motion capture system. We use a train/test split of 40/8. Features consist of the 3D positions of the skeletal parts (e.g., upper back, thorax, clavicle). 3https://gym.openai.com/ 7 • Handwriting This is a digit database available on the UCI repository [37, 38] created using a pressure sensitive tablet and a cordless stylus. Features are x and y tablet coordinates and pressure levels of the pen at a sampling rate of 100 milliseconds. We use 25 trajectories with a train/test split of 20/5. Models compared are LSTMs [30], GRUs [13], basic RNNs [14], KFs [3], PSRNNs, and factorized PSRNNs. All models except KFs consist of a linear encoder, a recurrent module, and a linear decoder. The encoder maps observations to a compressed representation; in the context of text data it can be viewed as a word embedding. The recurrent module maps a state and an observation to a new state and an output. The decoder maps an output to a predicted observation.4 We initialize the LSTMs and RNNs with random weights and zero biases according to the Xavier initialization scheme [39]. We initialize the the KF using the 2SR algorithm described in [7]. We initialize PSRNNs and factorized PSRNNs as described in section 3.1. In two-stage regression we use a ridge parameter of 10(−2)n where n is the number of training examples (this is consistent with the values suggested in [8]). (Experiments show that our approach works well for a wide variety of hyperparameter values.) We use a horizon of 1 in the PTB experiments, and a horizon of 10 in all continuous experiments. We use 2000 RFFs from a Gaussian kernel, selected according to the method of [28], and with the kernel width selected as the median pairwise distance. We use 20 hidden states, and a fixed learning rate of 1 in all experiments. We use a BPTT horizon of 35 in the PTB experiments, and an infinite BPTT horizon in all other experiments. All models are single layer unless stated otherwise. We optimize models on the PTB using Bits Per Character (BPC) and evaluate them using both BPC and one-step prediction accuracy (OSPA). We optimize and evaluate all continuous experiments using the Mean Squared Error (MSE). 7 Results In Figure 3a we compare performance of LSTMs, GRUs, and Factorized PSRNNs on PTB, where all models have the same number of states and approximately the same number of parameters. To achieve this we use a factorized PSRNN of rank 60. We see that the factorized PSRNN significantly outperforms LSTMs and GRUs on both metrics. In Figure 3b we compare the performance of 1- and 2-layer PSRNNs on PTB. We see that adding an additional layer significantly improves performance. 4This is a standard RNN architecture; e.g., a PyTorch implementation of this architecture for text prediction can be found at https://github.com/pytorch/examples/tree/master/word_language_model. (a) BPC and OSPA on PTB. All models have the same number of states and approximately the same number of parameters. (b) Comparison between 1- and 2layer PSRNNs on PTB. (c) Cross-entropy and prediction accuracy on Penn Tree Bank for PSRNNs and factorized PSRNNs of various rank. Figure 3: PTB Experiments 8 In Figure 3c we compare PSRNNs with factorized PSRNNs on the PTB. We see that PSRNNs outperform factorized PSRNNs regardless of rank, even when the factorized PSRNN has significantly more model parameters. (In this experiment, factorized PSRNNs of rank 7 or greater have more model parameters than a plain PSRNN.) This observation makes sense, as the PSRNN provides a simpler optimization surface: the tensor multiplication in each layer of a PSRNN is linear with respect to the model parameters, while the tensor multiplication in each layer of a Factorized PSRNN is bilinear. In addition, we see that higher-rank factorized models outperform lower-rank ones. However, it is worth noting that even models with low rank still perform well, as demonstrated by our rank 40 model still outperforming GRUs and LSTMs, despite having fewer parameters. (a) MSE vs Epoch on the Swimmer, Mocap, and Handwriting datasets (b) Test Data vs Model Prediction on a single feature of Swimmer. The first row shows initial performance. The second row shows performance after training. In order the columns show KF, RNN, GRU, LSTM, and PSRNN. Figure 4: Swimmer, Mocap, and Handwriting Experiments In Figure 4a we compare model performance on the Swimmer, Mocap, and Handwriting datasets. We see that PSRNNs significantly outperform alternative approaches on all datasets. In Figure 4b we attempt to gain insight into why using 2SR to initialize our models is so beneficial. We visualize the the one step model predictions before and after BPTT. We see that the behavior of the initialization has a large impact on the behavior of the refined model. For example the initial (incorrect) oscillatory behavior of the RNN in the second column is preserved even after gradient descent. 8 Conclusions We present PSRNNs: a new approach for modelling time-series data that hybridizes Bayes filters with RNNs. PSRNNs have both a principled initialization procedure and a rich functional form. The basic PSRNN block consists of a 3-mode tensor, corresponding to bilinear combination of the state and observation, followed by divisive normalization. These blocks can be arranged in layers to increase the expressive power of the model. We showed that tensor CP decomposition can be used to obtain factorized PSRNNs, which allow flexibly selecting the number of states and model parameters. We showed how factorized PSRNNs can be viewed as both an instance of Kernel Bayes Rule and a gated architecture, and discussed links to existing multiplicative architectures such as LSTMs. We applied PSRNNs to 4 datasets and showed that we outperform alternative approaches in all cases. Acknowledgements The authors gratefully acknowledge support from ONR (grant number N000141512365) and DARPA (grant number FA87501720152). 9 References [1] Sam Roweis and Zoubin Ghahramani. A unifying review of linear gaussian models. Neural Comput., 11(2):305–345, February 1999. ISSN 0899-7667. doi: 10.1162/089976699300016674. URL http://dx.doi.org/10.1162/089976699300016674. [2] Leonard E. Baum and Ted Petrie. Statistical inference for probabilistic functions of finite state markov chains. The Annals of Mathematical Statistics, 37:1554–1563, 1966. [3] R. E. Kalman. A new approach to linear filtering and prediction problems. ASME Journal of Basic Engineering, 1960. [4] Michael L. Littman, Richard S. Sutton, and Satinder Singh. Predictive representations of state. In In Advances In Neural Information Processing Systems 14, pages 1555–1561. MIT Press, 2001. [5] Byron Boots, Sajid Siddiqi, and Geoffrey Gordon. Closing the learning planning loop with predictive state representations. International Journal of Robotics Research (IJRR), 30:954–956, 2011. [6] Byron Boots and Geoffrey Gordon. An online spectral learning algorithm for partially observable nonlinear dynamical systems. In Proceedings of the 25th National Conference on Artificial Intelligence (AAAI), 2011. [7] Ahmed Hefny, Carlton Downey, and Geoffrey J. Gordon. Supervised learning for dynamical system learning. In Advances in Neural Information Processing Systems, pages 1963–1971, 2015. [8] Byron Boots, Geoffrey J. Gordon, and Arthur Gretton. Hilbert space embeddings of predictive state representations. CoRR, abs/1309.6819, 2013. URL http://arxiv.org/abs/1309. 6819. [9] Daniel J. Hsu, Sham M. Kakade, and Tong Zhang. A spectral algorithm for learning hidden markov models. CoRR, abs/0811.4413, 2008. [10] Amirreza Shaban, Mehrdad Farajtabar, Bo Xie, Le Song, and Byron Boots. Learning latent variable models by improving spectral solutions with exterior point methods. In Proceedings of The International Conference on Uncertainty in Artificial Intelligence (UAI), 2015. [11] Peter Van Overschee and Bart De Moor. N4sid: numerical algorithms for state space subspace system identification. In Proc. of the World Congress of the International Federation of Automatic Control, IFAC, volume 7, pages 361–364, 1993. [12] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8): 1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. [13] KyungHyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder-decoder approaches. CoRR, abs/1409.1259, 2014. [14] Jeffrey L. Elman. Finding structure in time. COGNITIVE SCIENCE, 14(2):179–211, 1990. [15] Ilya Sutskever, Oriol Vinyals, and Quoc V. Le. Sequence to sequence learning with neural networks. CoRR, abs/1409.3215, 2014. URL http://arxiv.org/abs/1409.3215. [16] Byron Boots. Learning stable linear dynamical systems. Online]. Avail.: https://www. ml. cmu. edu/research/dap-papers/dap_boots. pdf, 2009. [17] Yuchen Zhang, Xi Chen, Denny Zhou, and Michael I Jordan. Spectral methods meet em: A provably optimal algorithm for crowdsourcing. In Advances in neural information processing systems, pages 1260–1268, 2014. [18] Jonathan Ko and Dieter Fox. Learning gp-bayesfilters via gaussian process latent variable models. Autonomous Robots, 30(1):3–23, 2011. 10 [19] Peter Van Overschee and Bart De Moor. N4sid: Subspace algorithms for the identification of combined deterministic-stochastic systems. Automatica, 30(1):75–93, January 1994. ISSN 0005-1098. doi: 10.1016/0005-1098(94)90230-5. URL http://dx.doi.org/10.1016/ 0005-1098(94)90230-5. [20] Luca Pasa, Alberto Testolin, and Alessandro Sperduti. A hmm-based pre-training approach for sequential data. In 22th European Symposium on Artificial Neural Networks, ESANN 2014, Bruges, Belgium, April 23-25, 2014, 2014. URL http://www.elen.ucl.ac.be/ Proceedings/esann/esannpdf/es2014-166.pdf. [21] David Belanger and Sham Kakade. A linear dynamical system model for text. In Francis Bach and David Blei, editors, Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pages 833–842, Lille, France, 07–09 Jul 2015. PMLR. [22] James Martens. Learning the linear dynamical system with asos. In Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 743–750, 2010. [23] Carlton Downey, Ahmed Hefny, and Geoffrey Gordon. Practical learning of predictive state representations. Technical report, Carnegie Mellon University, 2017. [24] Tuomas Haarnoja, Anurag Ajay, Sergey Levine, and Pieter Abbeel. Backprop kf: Learning discriminative deterministic state estimators. In Advances in Neural Information Processing Systems, pages 4376–4384, 2016. [25] Jean Kossaifi, Zachary C Lipton, Aran Khanna, Tommaso Furlanello, and Anima Anandkumar. Tensor regression networks. arXiv preprint arXiv:1707.08308, 2017. [26] Alex Smola, Arthur Gretton, Le Song, and Bernhard Schölkopf. A hilbert space embedding for distributions. In International Conference on Algorithmic Learning Theory, pages 13–31. Springer, 2007. [27] Nachman Aronszajn. Theory of reproducing kernels. Transactions of the American mathematical society, 68(3):337–404, 1950. [28] Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pages 1177–1184, 2008. [29] Frank L Hitchcock. The expression of a tensor or a polyadic as a sum of products. Studies in Applied Mathematics, 6(1-4):164–189, 1927. [30] Lennart Ljung. System identification. Wiley Online Library, 1999. [31] Le Song, Byron Boots, Sajid M. Siddiqi, Geoffrey J. Gordon, and Alex J. Smola. Hilbert space embeddings of hidden markov models. In Johannes Fürnkranz and Thorsten Joachims, editors, Proceedings of the 27th International Conference on Machine Learning (ICML-10), pages 991–998. Omnipress, 2010. URL http://www.icml2010.org/papers/495.pdf. [32] Yoshua Bengio et al. Learning deep architectures for ai. Foundations and trends R⃝in Machine Learning, 2(1):1–127, 2009. [33] Le Song, Jonathan Huang, Alex Smola, and Kenji Fukumizu. Hilbert space embeddings of conditional distributions with applications to dynamical systems. In Proceedings of the 26th Annual International Conference on Machine Learning, pages 961–968. ACM, 2009. [34] Sebastian Thrun, Wolfram Burgard, and Dieter Fox. Probabilistic robotics. MIT press, 2005. [35] Yuhuai Wu, Saizheng Zhang, Ying Zhang, Yoshua Bengio, and Ruslan Salakhutdinov. On multiplicative integration with recurrent neural networks. CoRR, abs/1606.06630, 2016. URL http://arxiv.org/abs/1606.06630. [36] Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993. 11 [37] Fevzi. Alimoglu E. Alpaydin. Pen-Based Recognition of Handwritten Digits Data Set. https://archive.ics.uci.edu/ml/datasets/Pen-Based+Recognition+of+Handwritten+Digits. [38] E Alpaydin and Fevzi Alimoglu. Pen-based recognition of handwritten digits data set. University of California, Irvine, Machine Learning Repository. Irvine: University of California, 1998. [39] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS’10). Society for Artificial Intelligence and Statistics, 2010. 12
2017
114
6,580
Robust Hypothesis Test for Nonlinear Effect with Gaussian Processes Jeremiah Zhe Liu, Brent Coull Department of Biostatistics Harvard University Cambridge, MA 02138 {zhl112@mail, bcoull@hsph}.harvard.edu Abstract This work constructs a hypothesis test for detecting whether an data-generating function h : Rp →R belongs to a specific reproducing kernel Hilbert space H0, where the structure of H0 is only partially known. Utilizing the theory of reproducing kernels, we reduce this hypothesis to a simple one-sided score test for a scalar parameter, develop a testing procedure that is robust against the misspecification of kernel functions, and also propose an ensemble-based estimator for the null model to guarantee test performance in small samples. To demonstrate the utility of the proposed method, we apply our test to the problem of detecting nonlinear interaction between groups of continuous features. We evaluate the finite-sample performance of our test under different data-generating functions and estimation strategies for the null model. Our results reveal interesting connections between notions in machine learning (model underfit/overfit) and those in statistical inference (i.e. Type I error/power of hypothesis test), and also highlight unexpected consequences of common model estimating strategies (e.g. estimating kernel hyperparameters using maximum likelihood estimation) on model inference. 1 Introduction We study the problem of constructing a hypothesis test for an unknown data-generating function h : Rp →R, when h is estimated with a black-box algorithm (specifically, Gaussian Process regression) from n observations {yi, xi}n i=1. Specifically, we are interested in testing for the hypothesis: H0 : h ∈H0 v.s. Ha : h ∈Ha where H0, Ha are the function spaces for h under the null and the alternative hypothesis. We assume only partial knowledge about H0. For example, we may assume H0 = {h|h(xi) = h(xi,1)} is the space of functions depend only on x1, while claiming no knowledge about other properties (linearity, smoothness, etc) about h. We pay special attention to the setting where the sample size n is small. This type of tests carries concrete significance in scientific studies. In areas such as genetics, drug trials and environmental health, a hypothesis test for feature effect plays a critical role in answering scientific questions of interest. For example, assuming for simplicity x2×1 = [x1, x2]T , an investigator might inquire the effect of drug dosage x1 on patient’s biometric measurement y (corresponds to the null hypothesis H0 = {h(x) = h(x2)}), or whether the adverse health effect of air pollutants x1 is modified by patients’ nutrient intake x2 (corresponds to the null hypothesis H0 = {h(x) = h1(x1) + h2(x2)}). In these studies, h usually represents some complex, nonlinear biological process whose exact mathematical properties are not known. Sample size in these studies are often small (n ≈100 −200), due to the high monetary and time cost in subject recruitment and the lab analysis of biological samples. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. There exist two challenges in designing such a test. The first challenge arises from the low interpretability of the blackbox model. It is difficult to formulate a hypothesis about feature effect in these models, since the blackbox models represents ˆh implicitly using a collection of basis functions constructed from the entire feature vector x, rather than a set of model parameters that can be interpreted in the context of some effect of interest. For example, consider testing for the interaction effect between x1 and x2. With linear model h(xi) = xi1β1 + xi2β2 + xi1xi2β3, we can simply represent the interaction effect using a single parameter β3, and test for H0 : β3 = 0. On the other hand, Gaussian process (GP) [16] models h(xi) = Pn j=1 k(xi, xj)αj using basis functions defined by the kernel function k. Since k is an implicit function that takes the entire feature vector as input, it is not clear how to represent the interaction effect in GP models. We address this challenge assuming h belongs to a reproducing kernel Hilbert space (RKHS) governed by the kernel function kδ, such that H = H0 when δ = 0, and H = Ha otherwise. In this way, δ encode exactly the feature effect of interest, and the null hypothesis h ∈H0 can be equivalently stated as H0 : δ = 0. To test for the hypothesis, we re-formulate the GP estimates as the variance components of a linear mixed model (LMM) [13], and derive a variance component score test which requires only model estimates under the null hypothesis. Clearly, performance of the hypothesis test depends on the quality of the model estimate under the null hypothesis, which give rise to the second challenge: estimating the null model when only having partial knowledge about H0. In the case of Gaussian process, this translates to only having partial knowledge about the kernel function k0. The performance of Gaussian process is sensitive to the choices of the kernel function k(z, z′). In principle, the RKHS H generated by a proper kernel function k(z, z′) should be rich enough so it contains the data-generating function h, yet restrictive enough such that ˆh does not overfit in small samples. Choosing a kernel function that is too restrictive or too flexible will lead to either model underfit or overfit, rendering the subsequent hypothesis tests not valid. We address this challenge by proposing an ensemble-based estimator for h we term Cross-validated Kernel Ensemble (CVEK). Using a library of base kernels, CVEK learns a proper H from data by directly minimizing the ensemble model’s cross-validation error, therefore guaranteeing robust test performance for a wide range of data-generating functions. The rest of the paper is structured as follows. After a brief review of Gaussian process and its connection with linear mixed model in Section 2, we introduce the test procedure for general hypothesis h ∈H0 in Section 3, and its companion estimation procedure CVEK in Section 4. To demonstrate the utility of the proposed test, in section 5, we adapt our test to the problem of detecting nonlinear interaction between groups of continuous features, and in section 6 we conduct simulation studies to evaluate the finite-sample performance of the interaction test, under different kernel estimation strategies, and under a range of data-generating functions with different mathematical properties. Our simulation study reveals interesting connection between notions in machine learning and those in statistical inference, by elucidating the consequence of model estimation (underfit / overfit) on the Type I error and power of the subsequent hypothesis test. It also cautions against the use of some common estimation strategies (most notably, selecting kernel hyperparameters using maximum likelihood estimation) when conducting hypothesis test in small samples, by highlighting inflated Type I errors from hypothesis tests based on the resulting estimates. We note that the methods and conclusions from this work is extendable beyond the Gaussian Process models, due to GP’s connection to other blackbox models such as random forest [5] and deep neural network [19]. 2 Background on Gaussian Process Assume we observe data from n independent subjects. For the ith subject, let yi be a continuous response, xi be the set of p continuous features that has nonlinear effect on yi. We assume that the outcome yi depends on features xi through below data-generating model: yi|h = µ + h(xi) + ϵi where ϵi iid ∼N(0, λ) (1) and h : Rp →R follows the Gaussian process prior GP(0, k) governed by the positive definite kernel function k, such that the function evaluated at the observed record follows the multivariate normal (MVN) distribution: h = [h(x1), . . . , h(xn)] ∼MV N(0, K) 2 with covariance matrix Ki,j = k(xi, xj). Under above construction, the predictive distribution of h evaluated at the samples is also multivariate normal: h|{yi, xi}n i=1 ∼MV N(h∗, K∗) h∗= K(K + λI)−1(y −u) K∗= K −K(K + λI)−1K To understand the impact of λ and k on h∗, recall that Gaussian process can be understood as the Bayesian version of the kernel machine regression, where h∗equivalently arise from the below optimization problem: h∗= argmin h∈Hk ||y −µ −h(x)||2 + λ||h||2 H where Hk is the RKHS generated by kernel function k. From this perspective, h∗is the element in a spherical ball in Hk that best approximates the observed data y. The norm of h∗, ||h||2 H, is constrained by the tuning parameter λ, and the mathematical properties (e.g. smoothness, spectral density, etc) of h∗are governed by the kernel function k. It should be noticed that although h∗may arise from Hk, the probability of the Gaussian Process h ∈Hk is 0 [14]. Gaussian Process as Linear Mixed Model [13] argued that if define τ = σ2 λ , h∗can arise exactly from a linear mixed model (LMM): y = µ + h + ϵ where h ∼N(0, τK) ϵ ∼N(0, σ2I) (2) Therefore λ can be treated as part of the LMM’s variance components parameters. If K is correctly specified, then the variance components parameters (τ, σ2) can be estimated unbiasedly by maximizing the Restricted Maximum Likelihood (REML)[12]: LREML(µ, τ, σ2|K) = −log|V| −log|1T V−11| −(y −µ)T V−1(y −µ) (3) where V = τK + σ2I, and 1 a n × 1 vector whose all elements are 1. However, it is worth noting that REML is a model-based procedure. Therefore improper estimates for λ = σ2 τ may arise when the family of kernel functions are mis-specified. 3 A recipe for general hypothesis h ∈H0 The GP-LMM connection introduced in Section 2 opens up the arsenal of statistical tools from Linear Mixed Model for inference tasks in Gaussian Process. Here, we use the classical variance component test [12] to construct a testing procedure for the hypothesis about Gaussian process function: H0 : h ∈H0. (4) We first translate above hypothesis into a hypothesis in terms of model parameters. The key of our approach is to assume that h lies in a RKHS generated by a garrote kernel function kδ(z, z′) [15], which is constructed by including an extra garrote parameter δ to a given kernel function. When δ = 0, the garrote kernel function k0(x, x′) = kδ(x, x′) δ=0 generates exactly H0, the space of functions under the null hypothesis. In order to adapt this general hypothesisio to their hypothesis of interest, practitioners need only to specify the form of the garrote kernel so that H0 corresponds to the null hypothesis. For example, If kδ(x) = k(δ ∗x1, x2, . . . , xp), δ = 0 corresponds to the null hypothesis H0 : h(x) = h(x2, . . . , xp), i.e. the function h(x) does not depend on x1. (As we’ll see in section 5, identifying such k0 is not always straightforward). As a result, the general hypothesis (4) is equivalent to H0 : δ = 0. (5) We now construct a test statistic ˆT0 for (5) by noticing that the garrote parameter δ can be treated as a variance component parameter in the linear mixed model. This is because the Gaussian process under garrote kernel can be formulated into below LMM: y = µ + h + ϵ where h ∼N(0, τKδ) ϵ ∼N(0, σ2I) 3 where Kδ is the kernel matrix generated by kδ(z, z′). Consequently, we can derive a variance component test for H0 by calculating the square derivative of LREML with respect δ under H0 [12]: ˆT0 = ˆτ ∗(y −ˆµ)T V−1 0 h ∂K0 i V−1 0 (y −ˆµ) (6) where V0 = ˆσ2I + ˆτK0. In this expression, K0 = Kδ δ=0, and ∂K0 is the null derivative kernel matrix whose (i, j)th entry is ∂ ∂δkδ(x, x′) δ=0. As discussed previously, misspecifying the null kernel function k0 negatively impacts the performance of the resulting hypothesis test. To better understand the mechanism at play, we express the test statistic ˆT0 from (6) in terms of the model residual ˆϵ = y −ˆµ −ˆh: ˆT0 =  ˆτ ˆσ4  ∗ˆϵT h ∂K0 i ˆϵ, (7) where we have used the fact V−1 0 (y −ˆµ) = (ˆσ2)−1(ˆϵ) [10]. As shown, the test statistic ˆT0 is a scaled quadratic-form statistic that is a function of the model residual. If k0 is too restrictive, model estimates will underfit the data even under the null hypothesis, introducing extraneous correlation among the ˆϵi’s, therefore leading to overestimated ˆT0 and eventually underestimated p-value under the null. In this case, the test procedure will frequently reject the null hypothesis (i.e. suggest the existence of nonlinear interaction) even when there is in fact no interaction, yielding an invalid test due to inflated Type I error. On the other hand, if k0 is too flexible, model estimates will likely overfit the data in small samples, producing underestimated residuals, an underestimated test statistic, and overestimated p-values. In this case, the test procedure will too frequently fail to reject the null hypothesis (i.e. suggesting there is no interaction) when there is in fact interaction, yielding an insensitive test with diminished power. The null distribution of ˆT can be approximated using a scaled chi-square distribution κχ2 ν using Satterthwaite method [20] by matching the first two moments of T: κ ∗ν = E(T), 2 ∗κ2 ∗ν = V ar(T) with solution (see Appendix for derivation): ˆκ = ˆIδδ/ h ˆτ ∗tr  V−1 0 ∂K0 i ˆν = h ˆτ ∗tr  V−1 0 ∂K0 i2 /(2 ∗ˆIδδ) where ˆIδθ and ˆIδθ are the submatrices of the REML information matrix. Numerically more accurate, but computationally less efficient approximation methods are also available [2]. Finally, the p-value of this test is calculated by examining the tail probability of ˆκχ2 ˆν: p = P(ˆκχ2 ˆν > ˆT) = P(χ2 ˆν > ˆT/ˆκ) A complete summary of the proposed testing procedure is available in Algorithm 1. Algorithm 1 Variance Component Test for h ∈H0 1: procedure VCT FOR INTERACTION Input: Null Kernel Matrix K0, Derivative Kernel Matrix ∂K0, Data (y, X) Output: Hypothesis Test p-value p # Step 1: Estimate Null Model using REML 2: (ˆµ, ˆτ, ˆσ2) = argmin LREML(µ, τ, σ2|K0) as in (3) # Step 2: Compute Test Statistic and Null Distribution Parameters 3: ˆT0 = ˆτ ∗(y −Xˆβ)T V−1 0 ∂K0 V−1 0 (y −Xˆβ) 4: ˆκ = ˆIδθ/ h ˆτ ∗tr  V−1 0 ∂K0 i , ˆν = h ˆτ ∗tr  V−1 0 ∂K0 i2 /(2 ∗ˆIδθ) # Step 3: Compute p-value and reach conclusion 5: p = P(ˆκχ2 ˆν > ˆT) = P(χ2 ˆν > ˆT/ˆκ) 6: end procedure 4 In light of the discussion about model misspecification in Introduction section, we highlight the fact that our proposed test (6) is robust against model misspecification under the alternative [12], since the calculation of test statistics do not require detailed parametric assumption about kδ. However, the test is NOT robust against model misspecification under the null, since the expression of both test statistic ˆT0 and the null distribution parameters (ˆκ, ˆν) still involve the kernel matrices generated by k0 (see Algorithm 1). In the next section, we address this problem by proposing a robust estimation procedure for the kernel matrices under the null. 4 Estimating Null Kernel Matrix using Cross-validated Kernel Ensemble Observation in (7) motivates the need for a kernel estimation strategy that is flexible so that it does not underfit under the null, yet stable so that it does not overfit under the alternative. To this end, we propose estimating h using the ensemble of a library of fixed base kernels {kd}D d=1: ˆh(x) = D X d=1 udˆhd(x) u ∈∆= {u|u ≥0, ||u||2 2 = 1}, (8) where ˆhd is the kernel predictor generated by dth base kernel kd. In order to maximize model stability, the ensemble weights u are estimated to minimize the overall cross-validation error of ˆh. We term this method the Cross-Validated Kernel Ensemble (CVEK). Our proposed method belongs to the well-studied family of algorithms known as ensembles of kernel predictors (EKP) [7, 8, 3, 4], but with specialized focus in maximizing the algorithm’s cross-validation stability. Furthermore, in addition to producing ensemble estimates ˆh, CVEK will also produce the ensemble estimate of the kernel matrix ˆK0 that is required by Algorithm 1. The exact algorithm proceeds in three stages as follows: Stage 1: For each basis kernel in the library {kd}D d=1, we first estimate ˆhd = Kd(Kd + ˆλdI)−1y, the prediction based on dth kernel, where the tunning parameter ˆλd is selected by minimizing the leave-one-out cross validation (LOOCV) error [6]: LOOCV(λ|kd) = (I −diag(Ad,λ))−1(y −ˆhd,λ) where Ad,λ = Kd(Kd + λI)−1. (9) We denote estimate the final LOOCV error for dth kernel ˆϵd = LOOCV  ˆλd|kd  . Stage 2: Using the estimated LOOCV errors {ˆϵd}D d=1, estimate the ensemble weights u = {ud}D d=1 such that it minimizes the overall LOOCV error: ˆu = argmin u∈∆ || D X d=1 udˆϵd||2 where ∆= {u|u ≥0, ||u||2 2 = 1}, and produce the final ensemble prediction: ˆh = D X d=1 ˆudhd = D X d=1 ˆudAd,ˆλdy = ˆAy, where ˆA = PD d=1 ˆudAd,ˆλd is the ensemble hat matrix. Stage 3: Using the ensemble hat matrix ˆA, estimate the ensemble kernel matrix ˆK by solving: ˆK( ˆK + λI)−1 = ˆA. Specifically, if we denote UA and {δA,k}n k=1 the eigenvector and eigenvalues of ˆA, then ˆK adopts the form (see Appendix for derivation): ˆK = UAdiag  δA,k 1 −δA,k  UT A 5 Application: Testing for Nonlinear Interaction Recall in Section 3, we assume that we are given a kδ that generates exactly H0. However, depending on the exact hypothesis of interest, identifying such k0 is not always straightforward. In this section, 5 we revisit the example about interaction testing discussed in challenge 1 at the Introduction section, and consider how to build a k0 for below hypothesis of interest H0 : h(x) = h1(x1) + h2(x2) Ha : h(x) = h1(x1) + h2(x2) + h12(x1, x2) where h12 is the "pure interaction" function that is orthogonal to main effect functions h1 and h2. Recall as discussed previously, this hypothesis is difficult to formulate with Gaussian process models, since the kernel functions k(x, x′) in general do not explicitly separate the main and the interaction effect. Therefore rather than directly define k0, we need to first construct H0 and Ha that corresponds to the null and alternative hypothesis, and then identify the garrote kernel function kδ such it generates exactly H0 when δ = 0 and Ha when δ > 0. We build H0 using the tensor-product construction of RKHS on the product domain (x1,i, x2,i) ∈ Rp1 × Rp2 [9], due to this approach’s unique ability in explicitly characterizing the space of "pure interaction" functions. Let 1 = {f|f ∝1} be the RKHS of constant functions, and H1, H2 be the RKHS of centered functions for x1x2, respectively. We can then define the full space as H = ⊗2 m=1(1 ⊕Hm). H describes the space of functions that depends jointly on {x1, x2}, and adopts below orthogonal decomposition: H = (1 ⊕H1) ⊗(1 ⊕H2) = 1 ⊕ n H1 ⊕H2 o ⊕ n H1 ⊗H2 o = 1 ⊕H⊥ 12 ⊕H12 where we have denoted H⊥ 12 = H1 ⊕H2 and H12 = H1 ⊗H2, respectively. We see that H12 is indeed the space of“pure interaction" functions , since H12 contains functions on the product domain Rp1 × Rp2, but is orthogonal to the space of additive main effect functions H⊥ 12. To summarize, we have identified two function spaces H0 and Ha that has the desired interpretation: H0 = H⊥ 12 Ha = H⊥ 12 ⊕H12 We are now ready to identify the garrote kernel kδ(x, x′). To this end, we notice that both H0 and H12 are composite spaces built from basis RKHSs using direct sum and tensor product. If denote km(xm, x′ m) the reproducing kernel associated with Hm, we can construct kernel functions for composite spaces H0 and H12 as [1]: k0(x, x′) = k1(x1, x′ 1) + k2(x2, x′ 2) k12(x, x′) = k1(x1, x′ 1) k2(x2, x′ 2) and consequently, the garrote kernel function for Ha: kδ(x, x′) = k0(x, x′) + δ ∗k12(x, x′). (10) Finally, using the chosen form of the garrote kernel function, the (i, j)th element of the null derivative kernel matrix K0 is ∂ ∂δkδ(x, x′) = k12(x, x′), i.e. the null derivative kernel matrix ∂K0 is simply the kernel matrix K12 that corresponds to the interaction space. Therefore the score test statistic ˆT0 in (6) simplifies to: ˆT0 = ˆτ ∗(y −Xˆβ)T V−1 0 K12 V−1 0 (y −Xˆβ) (11) where V0 = ˆσ2I + ˆτK0. 6 Simulation Experiment We evaluated the finite-sample performance of the proposed interaction test in a simulation study that is analogous to a real nutrition-environment interaction study. We generate two groups of input features (xi,1, xi,2) ∈Rp1 × Rp2 independently from standard Gaussian distribution, representing normalized data representing subject’s level of exposure to p1 environmental pollutants and the levels of a subject’s intake of p2 nutrients during the study. Throughout the simulation scenarios, we keep n = 100, and p1 = p2 = 5. We generate the outcome yi as: yi = h1(xi,1) + h2(xi,2) + δ ∗h12(xi,1, xi,2) + ϵi (12) 6 where h1, h2, h12 are sampled from RKHSs H1, H2 and H1 ⊗H2, generated using a ground-truth kernel ktrue. We standardize all sampled functions to have unit norm, so that δ represents the strength of interaction relative to the main effect. For each simulation scenario, we first generated data using δ and ktrue as above, then selected a kmodel to estimate the null model and obtain p-value using Algorithm 1. We repeated each scenario 1000 times, and evaluate the test performance using the empirical probability ˆP(p ≤0.05). Under null hypothesis H0 : δ = 0, ˆP(p ≤0.05) estimates the test’s Type I error, and should be smaller or equal to the significance level 0.05. Under alternative hypothesis Ha : δ > 0, ˆP(p ≤0.05) estimates the test’s power, and should ideally approach 1 quickly as the strength of interaction δ increases. In this study, we varied ktrue to produce data-generating functions hδ(xi,1, xi,2) with different smoothness and complexity properties, and varied kmodel to reflect different common modeling strategies for the null model in addition to using CVEK. We then evaluated how these two aspects impact the hypothesis test’s Type I error and power. Data-generating Functions We sampled the data-generate function by using ktrue from Matérn kernel family [16]: k(r|ν, σ) = 21−ν Γ(ν) √ 2νσ||r|| ν Kν √ 2νσ||r||  , where r = x −x′, with two non-negative hyperparameters (ν, σ). For a function h sampled using Matérn kernel, ν determines the function’s smoothness, since h is k-times mean square differentiable if and only if ν > k. In the case of ν →∞, Matérn kernel reduces to the Gaussian RBF kernel which is infinitely differentiable. σ determines the function’s complexity, this is because in Bochner’s spectral decomposition[16] k(r|ν, σ) = Z e2πisT rdS(s|ν, σ), (13) σ determines how much weight the spectral density S(s) puts on the slow-varying, low-frequency basis functions. In this work, we vary ν ∈{ 3 2, 5 2, ∞} to generate once-, twice, and infinitelydifferentiable functions, and vary σ ∈{0.5, 1, 1.5} to generate functions with varying degree of complexity. Modeling Strategies Polynomial Kernels is a family of simple parametric kernels that is equivalent to the polynomial ridge regression model favored by statisticians due to its model interpretability. In this work, we use the linear kernel klinear(x, x′|p) = xT x′ and quadratic kernel kquad(x, x′|p) = (1 + xT x′)2 which are common choices from this family. Gaussian RBF Kernels kRBF(x, x′|σ) = exp(−σ||x −x′||2) is a general-purpose kernel family that generates nonlinear, but infinitely differentiable (therefore very smooth) functions. Under this kernel, we consider two hyperparameter selection strategies common in machine learning applications: RBFMedian where we set σ to the sample median of {||xi −xj||}i̸=j, and RBF-MLE who estimates σ by maximizing the model likelihood. Matérn and Neural Network Kernels are two flexible kernels favored by machine learning practitioners for their expressiveness. Matérn kernels generates functions that are more flexible compared to that of Gaussian RBF due to the relaxed smoothness constraint [17]. In order to investigate the consequences of added flexibility relative to the true model, we use Matern 1/2, Matern 3/2 and Matern 5/2, corresponding to Matérn kernels with ν = 1/2, 3/2, and 5/2. Neural network kernels [16] knn(x, x′|σ) = 2 π ∗sin−1 2σ˜xT ˜x′ √ (1+2σ˜xT ˜x)(1+2σ˜x′T ˜x′)  , on the other hand, represent a 1-layer Bayesian neural network with infinite hidden unit and probit link function, with σ being the prior variance on hidden weights. Therefore knn is flexible in the sense that it is an universal approximator for arbitrary continuous functions on the compact domain [11]. In this work, we denote NN 0.1, NN 1 and NN 10 to represent Bayesian networks with different prior constraints σ ∈{0.1, 1, 10}. Result The simulation results are presented graphically in Figure 1 and documented in detail in the Appendix. We first observe that for reasonably specified kmodel, the proposed hypothesis test always has the 7 0.0 0.2 0.4 0.6 0.8 1.0 (a) ktrue = Matérn 3/2, σ = 0.5 (b) ktrue = Matérn 3/2, σ = 1 Linear Quadratic RBF_MLE RBF_Median Matern 1/2 Matern 3/2 Matern 5/2 (c) ktrue = Matérn 3/2, σ = 1.5 0.0 0.2 0.4 0.6 0.8 1.0 (d) ktrue = Matérn 5/2, σ = 0.5 (e) ktrue = Matérn 5/2, σ = 1 NN 0.1 NN 1 NN 10 CVKE_RBF CVKE_NN (f) ktrue = Matérn 5/2, σ = 1.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 (g) ktrue = Gaussian RBF, σ = 0.5 0.0 0.2 0.4 0.6 0.8 1.0 (h) ktrue = Gaussian RBF, σ = 1 0.0 0.2 0.4 0.6 0.8 1.0 (i) ktrue = Gaussian RBF, σ = 1.5 Figure 1: Estimated ˆP(p < 0.05) (y-axis) as a function of Interaction Strength δ ∈[0, 1] (x-axis). Skype Blue: Linear (Solid) and Quadratic (Dashed) Kernels, Black: RBF-Median (Solid) and RBFMLE (Dashed), Dark Blue: Matérn Kernels with ν = 1 2, 3 2, 5 2, Purple: Neural Network Kernels with σ = 0.1, 1, 10, Red: CVEK based on RBF (Solid) and Neural Networks (Dashed). Horizontal line marks the test’s significance level (0.05). When δ = 0, ˆP should be below this line. correct Type I error and reasonable power. We also observe that the complexity of the data-generating function hδ (12) plays a role in test performance, in the sense that the power of the hypothesis tests increases as the Matérn ktrue’s complexity parameter σ becomes larger, which corresponds to functions that put more weight on the complex, fast-varying eigenfunctions in (13). We observed clear differences in test performance from different estimation strategies. In general, polynomial models (linear and quadratic) are too restrictive and appear to underfit the data under both the null and the alternative, producing inflated Type I error and diminished power. On the other hand, lower-order Matérn kernels (Matérn 1/2 and Matérn 3/2, dark blue lines) appear to be too flexible. Whenever data are generated from smoother ktrue, Matérn 1/2 and 3/2 overfit the data and produce deflated Type I error and severely diminished power, even if the hyperparameter σ are fixed at true value. Therefore unless there’s strong evidence that h exhibits behavior consistent with that described by these kernels, we recommend avoid the use of either polynomial or lower-order Matérn kernels for hypothesis testing. Comparatively, Gaussian RBF works well for a wider range of ktrue’s, but only if the hyperparameter σ is selected carefully. Specifically, RBF-Median (black dashed line) works generally well, despite being slightly conservative (i.e. lower power) when the data-generation function is smooth and of low complexity. RBF-MLE (black solid line), on the other hand, tends to underfit the data under the null and exhibits inflated Type I error, possibly because of the fact that σ is not strongly identified when the sample size is too small [18]. The situation becomes more severe as hδ becomes rougher and more complex, in the moderately extreme case of non-differentiable h with σ = 1.5, the Type I error is inflated to as high as 0.238. Neural Network kernels also perform well for a wide range of ktrue, and its Type I error is more robust to the specification of hyperparameters. Finally, the two ensemble estimators CVEK-RBF (based on kRBF’s with log(σ) ∈{−2, −1, 0, 1, 2}) and CVEK-NN (based on kNN’s with σ ∈{0.1, 1, 10, 50}) perform as well or better than the nonensemble approaches for all ktrue’s, despite being slightly conservative under the null. As compared to CVEK-NN, CVEK-RBF appears to be slightly more powerful. 8 References [1] N. Aronszajn. Theory of reproducing kernels. Transactions of the American Mathematical Society, 68(3):337–404, 1950. [2] D. A. Bodenham and N. M. Adams. A comparison of efficient approximations for a weighted sum of chi-squared random variables. Statistics and Computing, 26(4):917–928, July 2016. [3] C. Cortes, M. Mohri, and A. Rostamizadeh. Two-Stage Learning Kernel Algorithms. 2010. [4] C. Cortes, M. Mohri, and A. Rostamizadeh. Ensembles of Kernel Predictors. arXiv:1202.3712 [cs, stat], Feb. 2012. arXiv: 1202.3712. [5] A. Davies and Z. Ghahramani. The Random Forest Kernel and other kernels for big data from random partitions. arXiv:1402.4293 [cs, stat], Feb. 2014. arXiv: 1402.4293. [6] A. Elisseeff and M. Pontil. Leave-one-out Error and Stability of Learning Algorithms with Applications. In J. Suykens, G. Horvath, S. Basu, C. Micchelli, and J. Vandewalle, editors, Learning Theory and Practice. IOS Press, 2002. [7] T. Evgeniou, L. Perez-Breva, M. Pontil, and T. Poggio. Bounds on the Generalization Performance of Kernel Machine Ensembles. In Proceedings of the Seventeenth International Conference on Machine Learning, ICML ’00, pages 271–278, San Francisco, CA, USA, 2000. Morgan Kaufmann Publishers Inc. [8] T. Evgeniou, M. Pontil, and A. Elisseeff. Leave One Out Error, Stability, and Generalization of Voting Combinations of Classifiers. Machine Learning, 55(1):71–97, Apr. 2004. [9] C. Gu. Smoothing Spline ANOVA Models. Springer Science & Business Media, Jan. 2013. Google-Books-ID: 5VxGAAAAQBAJ. [10] D. A. Harville. Maximum Likelihood Approaches to Variance Component Estimation and to Related Problems. Journal of the American Statistical Association, 72(358):320–338, 1977. [11] K. Hornik. Approximation capabilities of multilayer feedforward networks. Neural Networks, 4(2):251–257, 1991. [12] X. Lin. Variance component testing in generalised linear models with random effects. Biometrika, 84(2):309–326, June 1997. [13] D. Liu, X. Lin, and D. Ghosh. Semiparametric Regression of Multidimensional Genetic Pathway Data: Least-Squares Kernel Machines and Linear Mixed Models. Biometrics, 63(4):1079–1088, Dec. 2007. [14] M. N. Luki´c and J. H. Beder. Stochastic Processes with Sample Paths in Reproducing Kernel Hilbert Spaces. Transactions of the American Mathematical Society, 353(10):3945–3969, 2001. [15] A. Maity and X. Lin. Powerful tests for detecting a gene effect in the presence of possible gene-gene interactions using garrote kernel machines. Biometrics, 67(4):1271–1284, Dec. 2011. [16] C. E. Rasmussen and C. K. I. Williams. Gaussian Processes for Machine Learning. University Press Group Limited, Jan. 2006. Google-Books-ID: vWtwQgAACAAJ. [17] J. Snoek, H. Larochelle, and R. P. Adams. Practical Bayesian Optimization of Machine Learning Algorithms. arXiv:1206.2944 [cs, stat], June 2012. arXiv: 1206.2944. [18] G. Wahba. Spline Models for Observational Data. SIAM, Sept. 1990. Google-Books-ID: ScRQJEETs0EC. [19] A. G. Wilson, Z. Hu, R. Salakhutdinov, and E. P. Xing. Deep Kernel Learning. arXiv:1511.02222 [cs, stat], Nov. 2015. arXiv: 1511.02222. [20] D. Zhang and X. Lin. Hypothesis testing in semiparametric additive mixed models. Biostatistics (Oxford, England), 4(1):57–74, Jan. 2003. 9
2017
115
6,581
Sharpness, Restart and Acceleration Vincent Roulet INRIA, ENS Paris France vincent.roulet@inria.fr Alexandre d’Aspremont CNRS, ENS Paris France aspremon@ens.fr Abstract The Łojasiewicz inequality shows that sharpness bounds on the minimum of convex optimization problems hold almost generically. Sharpness directly controls the performance of restart schemes, as observed by Nemirovskii and Nesterov [1985]. The constants quantifying error bounds are of course unobservable, but we show that optimal restart strategies are robust, and searching for the best scheme only increases the complexity by a logarithmic factor compared to the optimal bound. Overall then, restart schemes generically accelerate accelerated methods. Introduction We study convex optimization problems of the form minimize f(x) (P) where f is a convex function defined on Rn. The complexity of these problems using first order methods is generically controlled by smoothness assumptions on f such as Lipschitz continuity of its gradient. Additional assumptions such as strong convexity or uniform convexity provide respectively linear [Nesterov, 2013b] and faster polynomial [Juditski and Nesterov, 2014] rates of convergence. However, these assumptions are often too restrictive to be applied. Here, we make a much weaker and generic assumption that describes the sharpness of the function around its minimizers by constants µ ≥0 and r ≥1 such that µ r d(x, X∗)r ≤f(x) −f ∗, for every x ∈K, (Sharp) where f ∗is the minimum of f, K ⊂Rn is a compact set, d(x, X∗) = miny∈X∗∥x −y∥is the distance from x to the set X∗⊂K of minimizers of f 1 for the Euclidean norm ∥· ∥. This defines a lower bound on the function around its minimizers: for r = 1, f shows a kink around its minimizers and the larger is r the flatter is the function around its minimizers. We tackle this property by restart schemes of classical convex optimization algorithms. Sharpness assumption (Sharp) is better known as a Hölderian error bound on the distance to the set of minimizers. Hoffman [Hoffman, 1952] first introduced error bounds to study system of linear inequalities. Natural extensions were then developed for convex optimization [Robinson, 1975; Mangasarian, 1985; Auslender and Crouzeix, 1988], notably through the concept of sharp minima [Polyak, 1979; Burke and Ferris, 1993; Burke and Deng, 2002]. But the most striking discovery was made by Łojasiewicz [Łojasiewicz, 1963, 1993] who proved inequality (Sharp) for real analytic and subanalytic functions. It has then been extended to non-smooth subanalytic convex functions by Bolte et al. [2007]. Overall, since (Sharp) essentially measures the sharpness of minimizers, it holds somewhat generically. On the other hand, this inequality is purely descriptive as we have no hope of ever observing either r or µ, and deriving adaptive schemes is crucial to ensure practical relevance. 1We assume the problem feasible, i.e. X∗̸= ∅. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Łojasiewicz inequalities either in the form of (Sharp) or as gradient dominated properties [Polyak, 1979] led to new simple convergence results [Karimi et al., 2016], in particular for alternating and splitting methods [Attouch et al., 2010; Frankel et al., 2015], even in the non-convex case [Bolte et al., 2014]. Here we focus on Hölderian error bounds as they offer simple explanation of accelerated rates of restart schemes. Restart schemes were already studied for strongly or uniformly convex functions [Nemirovskii and Nesterov, 1985; Nesterov, 2013a; Juditski and Nesterov, 2014; Lin and Xiao, 2014]. In particular, Nemirovskii and Nesterov [1985] link a “strict minimum” condition akin to (Sharp) with faster convergence rates using restart schemes which form the basis of our results, but do not study the cost of adaptation and do not tackle the non-smooth case. In a similar spirit, weaker versions of this strict minimum condition were used more recently to study the performance of restart schemes in [Renegar, 2014; Freund and Lu, 2015; Roulet et al., 2015]. The fundamental question of a restart scheme is naturally to know when must an algorithm be stopped and relaunched. Several heuristics [O’Donoghue and Candes, 2015; Su et al., 2014; Giselsson and Boyd, 2014] studied adaptive restart schemes to speed up convergence of optimal methods. The robustness of restart schemes was then theoretically studied by Fercoq and Qu [2016] for quadratic error bounds, i.e. (Sharp) with r = 2, that LASSO problem satisfies for example. Fercoq and Qu [2017] extended recently their work to produce adaptive restarts with theoretical guarantees of optimal performance, still for quadratic error bounds. Previous references focus on smooth problems, but error bounds appear also for non-smooth ones, Gilpin et al. [2012] prove for example linear converge of restart schemes in bilinear matrix games where the minimum is sharp, i.e. (Sharp) with r = 1. Our contribution here is to derive optimal scheduled restart schemes for general convex optimization problems for smooth, non-smooth or Hölder smooth functions satisfying the sharpness assumption. We then show that for smooth functions these schemes can be made adaptive with nearly optimal complexity (up to a squared log term) for a wide array of sharpness assumptions. We also analyze restart criterion based on a sufficient decrease of the gap to the minimum value of the problem, when this latter is known in advance. In that case, restart schemes are shown ot be optimal without requiring any additional information on the function. 1 Problem assumptions 1.1 Smoothness Convex optimization problems (P) are generally divided in two classes: smooth problems, for which f has Lipschitz continuous gradients, and non-smooth problems for which f is not differentiable. Nesterov [2015] proposed to unify point of views by assuming generally that there exist constants 1 ≤s ≤2 and L > 0 such that ∥∇f(x) −∇f(y)∥≤L∥x −y∥s−1, for all x, y ∈Rn (Smooth) where ∇f(x) is any sub-gradient of f at x if s = 1 (otherwise this implies differentiability of f). For s = 2, we retrieve the classical definition of smoothness [Nesterov, 2013b]. For s = 1 we get a classical assumption made in non-smooth convex optimization, i.e., that sub-gradients of the function are bounded. For 1 < s < 2, this assumes gradient of f to be Hölder Lipschitz continuous. In a first step, we will analyze restart schemes for smooth convex optimization problems, then generalize to general smoothness assumption (Smooth) using appropriate accelerated algorithms developed by Nesterov [2015]. 1.2 Error bounds In general, an error bound is an inequality of the form d(x, X∗) ≤ω(f(x) −f ∗), where ω is an increasing function at 0, called the residual function, and x may evolve either in the whole space or in a bounded set, see Bolte et al. [2015] for more details. We focus on Hölderian Error Bounds (Sharp) as they are the most common in practice. They are notably satisfied by a analytic and subanalytic functions but the proof (see e.g. Bierstone and Milman [1988, Theorem 6.4]) is shown using topological arguments that are far from constructive. Hence, outside of some 2 particular cases (e.g. strong convexity), we cannot assume that the constants in (Sharp) are known, even approximately. Error bounds can generically be linked to Łojasiewicz inequality that upper bounds magnitude of the gradient by values of the function [Bolte et al., 2015]. Such property paved the way to many recent results in optimization [Attouch et al., 2010; Frankel et al., 2015; Bolte et al., 2014]. Here we will see that (Sharp) is sufficient to acceleration of convex optimization algorithms by their restart. Note finally that in most cases, error bounds are local properties hence the convergence results that follow will generally be local. 1.3 Sharpness and smoothness Let f be a convex function on Rn satisfying (Smooth) with parameters (s, L). This property ensures that, f(x) ≤f ∗+ L s ∥x −y∥s, for given x ∈Rn and y ∈X∗. Setting y to be the projection of x onto X∗, this yields the following upper bound on suboptimality f(x) −f ∗≤L s d(x, X∗)s. (1) Now, assume that f satisfies the error bound (Sharp) on a set K with parameters (r, µ). Combining (1) and (Sharp) this leads for every x ∈K, sµ rL ≤d(x, X∗)s−r. This means that necessarily s ≤r by taking x →X∗. Moreover if s < r, this last inequality can only be valid on a bounded set, i.e. either smoothness or error bound or both are valid only on a bounded set. In the following, we write κ ≜L 2 s /µ 2 r and τ ≜1 −s r (2) respectively a generalized condition number for the function f and a condition number based on the ratio of powers in inequalities (Smooth) and (Sharp). If r = s = 2, κ matches the classical condition number of the function. 2 Scheduled restarts for smooth convex problems In this section, we seek to solve (P) assuming that the function f is smooth, i.e. satisfies (Smooth) with s = 2 and L > 0. Without further assumptions on f, an optimal algorithm to solve the smooth convex optimization problem (P) is Nesterov’s accelerated gradient method [Nesterov, 1983]. Given an initial point x0, this algorithm outputs, after t iterations, a point x = A(x0, t) such that f(x) −f ∗≤cL t2 d(x0, X∗)2, (3) where c > 0 denotes a universal constant (whose value will be allowed to vary in what follows, with c = 4 here). We assume without loss of generality that f(x) ≤f(x0). More details about Nesterov’s algorithm are given in Supplementary Material. In what follows, we will also assume that f satisfies (Sharp) with parameters (r, µ) on a set K ⊇X∗, which means µ r d(x, X∗)r ≤f(x) −f ∗, for every x ∈K. (Sharp) As mentioned before if r > s = 2, this property is necessarily local, i.e. K is bounded. We assume then that given a starting point x0 ∈Rn, sharpness is satisfied on the sublevel set {x| f(x) ≤f(x0)}. Remark that if this property is valid on an open set K ⊃X∗, it will also be valid on any compact set K′ ⊃K with the same exponent r but a potentially lower constant µ. The scheduled restart schemes we present here rely on a global sharpness hypothesis on the sublevel set defined by the initial point and are not adaptive to constant µ on smaller sublevel sets. On the other hand, restarts on criterion that we present in Section 4, assuming that f ∗is known, adapt to the value of µ. We now describe a restart scheme exploiting this extra regularity assumption to improve the computational complexity of solving problem (P) using accelerated methods. 3 2.1 Scheduled restarts Here, we schedule the number of iterations tk made by Nesterov’s algorithm between restarts, with tk the number of (inner) iterations at the kth algorithm run (outer iteration). Our scheme is described in Algorithm 1 below. Algorithm 1 Scheduled restarts for smooth convex minimization Inputs : x0 ∈Rn and a sequence tk for k = 1, . . . , R. for k = 1, . . . , R do xk := A(xk−1, tk) end for Output : ˆx := xR The analysis of this scheme and the following ones relies on two steps. We first choose schedules that ensure linear convergence in the iterates xk at a given rate. We then adjust this linear rate to minimize the complexity in terms of the total number of iterations. We begin with a technical lemma which assumes linear convergence holds, and connects the growth of tk, the precision reached and the total number of inner iterations N. Lemma 2.1. Let xk be a sequence whose kth iterate is generated from the previous one by an algorithm that runs tk iterations and write N = PR k=1 tk the total number of iterations to output a point xR. Suppose setting tk = Ceαk, k = 1, . . . , R for some C > 0 and α ≥0 ensures that outer iterations satisfy f(xk) −f ∗≤νe−γk, (4) for all k ≥0 with ν ≥0 and γ ≥0. Then precision at the output is given by, f(xR) −f ∗≤ν exp(−γN/C), when α = 0, and f(xR) −f ∗≤ ν (αe−αC−1N + 1) γ α , when α > 0. Proof. When α = 0, N = RC, and inserting this in (4) at the last point xR yields the desired result. On the other hand, when α > 0, we have N = PR k=1 tk = Ceα eαR−1 eα−1 , which gives R = log eα−1 eαC N + 1  /α. Inserting this in (4) at the last point, we get f(xR) −f ∗≤ν exp −γ α log eα−1 eαC N + 1  ≤ ν (αe−αC−1N+1) γ α , where we used ex −1 ≥x. This yields the second part of the result. The last approximation in the case α > 0 simplifies the analysis that follows without significantly affecting the bounds. We also show in Supplementary Material that using ˜tk = ⌈tk⌉does not significantly affect the bounds above. Remark that convergence bounds are generally linear or polynomial such that we can extract a subsequence that converges linearly. Therefore our approach does not restrict the analysis of our scheme. It simplifies it and can be used for other algorithms like the gradient descent as detailed in Supplementary Material. We now analyze restart schedules tk that ensure linear convergence. Our choice of tk will heavily depend on the ratio between r and s (with s = 2 for smooth functions here), incorporated in the parameter τ = 1 −s/r defined in (2). Below, we show that if τ = 0, a constant schedule is sufficient to ensure linear convergence. When τ > 0, we need a geometrically increasing number of iterations for each cycle. Proposition 2.2. Let f be a smooth convex function satisfying (Smooth) with parameters (2, L) and (Sharp) with parameters (r, µ) on a set K. Assume that we are given x0 ∈Rn such that {x| f(x) ≤f(x0)} ⊂K. Run Algorithm 1 from x0 with iteration schedule tk = C∗ κ,τeτk, for k = 1, . . . , R, where C∗ κ,τ ≜e1−τ(cκ) 1 2 (f(x0) −f ∗)−τ 2 , (5) 4 with κ and τ defined in (2) and c = 4e2/e here. The precision reached at the last point ˆx is given by, f(ˆx) −f ∗≤exp  −2e−1(cκ)−1 2 N  (f(x0) −f ∗) = O  exp(−κ−1 2 N)  , when τ = 0, (6) while, f(ˆx) −f ∗≤ f(x0) −f ∗  τe−1(f(x0) −f ∗) τ 2 (cκ)−1 2 N + 1  2 τ = O  N −2 τ  , when τ > 0, (7) where N = PR k=1 tk is the total number of iterations. Proof. Our strategy is to choose tk such that the objective is linearly decreasing, i.e. f (xk) −f ∗≤e−γk(f(x0) −f ∗), (8) for some γ ≥0 depending on the choice of tk. This directly holds for k = 0 and any γ ≥0. Combining (Sharp) with the complexity bound in (3), we get f (xk) −f ∗≤cκ t2 k (f (xk−1) −f ∗) 2 r , where c = 4e2/e using that r2/r ≤e2/e. Assuming recursively that (8) is satisfied at iteration k −1 for a given γ, we have f (xk) −f ∗≤cκe−γ 2 r (k−1) t2 k (f(x0) −f ∗) 2 r , and to ensure (8) at iteration k, we impose cκe−γ 2 r (k−1) t2 k (f(x0) −f ∗) 2 r ≤e−γk(f(x0) −f ∗). Rearranging terms in this last inequality, using τ defined in (2), we get tk ≥e γ(1−τ) 2 (cκ) 1 2 (f(x0) −f ∗)−τ 2 e τγ 2 k. (9) For a given γ ≥0, we can set tk = Ceαk where C = e γ(1−τ) 2 (cκ) 1 2 (f(x0) −f ∗)−τ 2 and α = τγ/2, (10) and Lemma 2.1 then yields, f(ˆx) −f ∗≤exp  −γe−γ 2 (cκ)−1 2 N  (f(x0) −f ∗), when τ = 0, while f(ˆx) −f ∗≤ (f(x0)−f ∗)  τ 2 γe−γ 2 (cκ)−1 2 (f(x0)−f ∗) τ 2 N+1  2 τ , when τ > 0. These bounds are minimal for γ = 2, which yields the desired result. When τ = 0, bound (6) matches the classical complexity bound for smooth strongly convex functions [Nesterov, 2013b]. When τ > 0 on the other hand, bound (7) highlights a much faster convergence rate than accelerated gradient methods. The sharper the function (i.e. the smaller r), the faster the convergence. This matches the lower bounds for optimizing smooth and sharp functions functions [Arjevani and Shamir, 2016; Nemirovskii and Nesterov, 1985, Page 6] up to constant factors. Also, setting tk = C∗ κ,τeτk yields continuous bounds on precision, i.e. when τ →0, bound (7) converges to bound (6), which also shows that for τ near zero, constant restart schemes are almost optimal. 5 2.2 Adaptive scheduled restart The previous restart schedules depend on the sharpness parameters (r, µ) in (Sharp). In general of course, these values are neither observed nor known a priori. Making our restart scheme adaptive is thus crucial to its practical performance. Fortunately, we show below that a simple logarithmic grid search strategy on these parameters is enough to guarantee nearly optimal performance. We run several schemes with a fixed number of inner iterations N to perform a log-scale grid search on τ and κ. We define these schemes as follows.  Si,0 : Algorithm 1 with tk = Ci, Si,j : Algorithm 1 with tk = Cieτjk, (11) where Ci = 2i and τj = 2−j. We stop these schemes when the total number of inner algorithm iterations has exceed N, i.e. at the smallest R such that PR k=1 tk ≥N. The size of the grid search in Ci is naturally bounded as we cannot restart the algorithm after more than N total inner iterations, so i ∈[1, . . . , ⌊log2 N⌋]. We will also show that when τ is smaller than 1/N, a constant schedule performs as well as the optimal geometrically increasing schedule, which crucially means we can also choose j ∈[1, . . . , ⌈log2 N⌉] and limits the cost of grid search. The following result details the convergence of this method, its notations are the same as in Proposition 2.2 and its technical proof can be found in Supplementary Material. Proposition 2.3. Let f be a smooth convex function satisfying (Smooth) with parameters (2, L) and (Sharp) with parameters (r, µ) on a set K. Assume that we are given x0 ∈Rn such that {x| f(x) ≤f(x0)} ⊂K and denote N a given number of iterations. Run schemes Si,j defined in (11) to solve (P) for i ∈[1, . . . , ⌊log2 N⌋] and j ∈[0, . . . , ⌈log2 N⌉], stopping each time after N total inner algorithm iterations i.e. for R such that PR k=1 tk ≥N. Assume N is large enough, so N ≥2C∗ κ,τ, and if 1 N > τ > 0, C∗ κ,τ > 1. If τ = 0, there exists i ∈[1, . . . , ⌊log2 N⌋] such that scheme Si,0 achieves a precision given by f(ˆx) −f ∗≤exp  −e−1(cκ)−1 2 N  (f(x0) −f ∗). If τ > 0, there exist i ∈[1, . . . , ⌊log2 N⌋] and j ∈[1, . . . , ⌈log2 N⌉] such that scheme Si,j achieves a precision given by f(ˆx) −f ∗≤ f(x0)−f ∗  τe−1(cκ)−1 2 (f(x0)−f ∗) τ 2 (N−1)/4+1  2 τ . Overall, running the logarithmic grid search has a complexity (log2 N)2 times higher than running N iterations using the optimal (oracle) scheme. As showed in Supplementary Material, scheduled restart schemes are theoretically efficient only if the algorithm itself makes a sufficient number of iterations to decrease the objective value. Therefore we need N large enough to ensure the efficiency of the adaptive method. If τ = 0, we naturally have C∗ κ,0 ≥1, therefore if 1 N > τ > 0 and N is large, assuming C∗ κ,τ ≈C∗ κ,0, we get C∗ κ,τ ≥1. This adaptive bound is similar to the one of Nesterov [2013b] to optimize smooth strongly convex functions in the sense that we lose approximately a log factor of the condition number of the function. However our assumptions are weaker and we are able to tackle all regimes of the sharpness property, i.e. any exponent r ∈[2, +∞], not just the strongly convex case. In the supplementary material we also analyze the simple gradient descent method under the sharpness (Sharp) assumption. It shows that simple gradient descent achieves a O(ϵ−τ) complexity for a given accuracy ϵ. Therefore restarting accelerated gradient methods reduces complexity to O(ϵ−τ/2) compared to simple gradient descent. This result is similar to the acceleration of gradient descent. We extend now this restart scheme to solve non-smooth or Hölder smooth convex optimization problem under the sharpness assumption. 3 Universal scheduled restarts for convex problems In this section, we use the framework introduced by Nesterov [2015] to describe smoothness of a convex function f, namely, we assume that there exist s ∈[1, 2] and L > 0 on a set J ⊂Rn, i.e. ∥∇f(x) −∇f(y)∥≤L∥x −y∥s−1, for every x, y ∈J. 6 Without further assumptions on f, the optimal rate of convergence for this class of functions is bounded as O(1/N ρ), where N is the total number of iterations and ρ = 3s/2 −1, (12) which gives ρ = 2 for smooth functions and ρ = 1/2 for non-smooth functions. The universal fast gradient method [Nesterov, 2015] achieves this rate by requiring only a target accuracy ϵ and a starting point x0. It outputs after t iterations a point x ≜U(x0, ϵ, t), such that f(x) −f ∗≤ϵ 2 + cL 2 s d(x0, X∗)2 ϵ 2 s t 2ρ s ϵ 2, (13) where c is a constant (c = 2 4s−2 s ). More details about the universal fast gradient method are given in Supplementary Material. We will again assume that f is sharp with parameters (r, µ) on a set K ⊇X∗, i.e. µ r d(x, X∗)r ≤f(x) −f ∗, for every x ∈K. (Sharp) As mentioned in Section 1.2, if r > s, smoothness or sharpness are local properties, i.e. either J or K or both are bounded, our analysis is therefore local. In the following we assume for simplicity, given an initial point x0, that smoothness and sharpness are satisfied simultaneously on the sublevel set {x| f(x) ≤f(x0)}. The key difference with the smooth case described in the previous section is that here we schedule both the target accuracy ϵk used by the algorithm and the number of iterations tk made at the kth run of the algorithm. Our scheme is described in Algorithm 2. Algorithm 2 Universal scheduled restarts for convex minimization Inputs : x0 ∈Rn, ϵ0 ≥f(x0) −f ∗, γ ≥0 and a sequence tk for k = 1, . . . , R. for k = 1, . . . , R do ϵk := e−γϵk−1, xk := U(xk−1, ϵk, tk) end for Output : ˆx := xR Our strategy is to choose a sequence tk that ensures f(xk) −f ∗≤ϵk, for the geometrically decreasing sequence ϵk. The overall complexity of our method will then depend on the growth of tk as described in Lemma 2.1. The proof is similar to the smooth case and can be found in Supplementary Material. Proposition 3.1. Let f be a convex function satisfying (Smooth) with parameters (s, L) on a set J and (Sharp) with parameters (r, µ) on a set K. Given x0 ∈Rn assume that {x|f(x) ≤f(x0)} ⊂J ∩K. Run Algorithm 2 from x0 for a given ϵ0 ≥f(x0) −f ∗with γ = ρ, tk = C∗ κ,τ,ρeτk, where C∗ κ,τ,ρ ≜e1−τ(cκ) s 2ρ ϵ −τ ρ 0 where ρ is defined in (12), κ and τ are defined in (2) and c = 8e2/e here. The precision reached at the last point ˆx is given by, f(ˆx) −f ∗≤exp  −ρe−1(cκ)−s 2ρ N  ϵ0 = O  exp(−κ−s 2ρ N)  , when τ = 0, while, f(ˆx) −f ∗≤ ϵ0  τe−1(cκ)−s 2ρ ϵ τ ρ 0 N + 1 −ρ τ = O  κ s 2τ N −ρ τ  , when τ > 0, where N = PR k=1 tk is total number of iterations. This bound matches the lower bounds for optimizing smooth and sharp functions [Nemirovskii and Nesterov, 1985, Page 6] up to constant factors. Notice that, compared to Nemirovskii and Nesterov [1985], we can tackle non-smooth convex optimization by using the universal fast gradient algorithm of Nesterov [2015]. The rate of convergence in Proposition 3.1 is controlled by the ratio between τ and ρ. If these are unknown, a log-scale grid search won’t be able to reach the optimal rate, even if ρ is known since we will miss the optimal rate by a constant factor. If both are known, in the case of non-smooth strongly convex functions for example, a grid-search on C recovers nearly the optimal bound. Now we will see that if f ∗is known, restart produces adaptive optimal rates. 7 4 Restart with termination criterion Here, we assume that we know the optimum f ∗of (P), or have an exact termination criterion. This is the case for example in zero-sum matrix games problems or non-degenerate least-squares without regularization. We assume again that f satisfies (Smooth) with parameters (s, L) on a set J and (Sharp) with parameters (r, µ) on a set K. Given an initial point x0 we assume that smoothness and sharpness are satisfied simultaneously on the sublevel set {x| f(x) ≤f(x0)}. We use again the universal gradient method U. Here however, we can stop the algorithm when it reaches the target accuracy as we know the optimum f ∗, i.e. we stop after tϵ inner iterations such that x = U(x0, ϵ, tϵ) satisfies f(x) −f ∗≤ϵ, and write x ≜C(x0, ϵ) the output of this method. Here we simply restart this method and decrease the target accuracy by a constant factor after each restart. Our scheme is described in Algorithm 3. Algorithm 3 Restart on criterion Inputs : x0 ∈Rn, f ∗, γ ≥0, ϵ0 = f(x0) −f ∗ for k = 1, . . . , R do ϵk := e−γϵk−1, xk := C(xk−1, ϵk) end for Output : ˆx := xR The following result describes the convergence of this method. It relies on the idea that it cannot do more iterations than the best scheduled restart to achieve the target accuracy at each iteration. Its proof can be found in Supplementary Material. Proposition 4.1. Let f be a convex function satisfying (Smooth) with parameters (s, L) on a set J and (Sharp) with parameters (r, µ) on a set K. Given x0 ∈Rn assume that {x, f(x) ≤f(x0)} ⊂ J ∩K. Run Algorithm 3 from x0 with parameter γ = ρ. The precision reached at the last point ˆx is given by, f(ˆx) −f ∗≤exp  −ρe−1(cκ)−s 2ρ N  (f(x0) −f ∗) = O  exp(−κ−s 2ρ N)  , when τ = 0, while, f(ˆx) −f ∗≤ f(x0) −f ∗  τe−1(cκ)−s 2ρ (f(x0) −f ∗) τ ρ N + 1  ρ τ = O κ s 2τ N −ρ τ  , when τ > 0, where N is the total number of iterations, ρ is defined in (12), κ and τ are defined in (2) and c = 8e2/e here. Therefore if f ∗is known, this method is adaptive, contrary to the general case in Proposition 3.1. It can even adapt to the local values of L or µ as we use a criterion instead of a preset schedule. Here, stopping using f(xk) −f ∗implicitly yields optimal choices of C and τ. A closer look at the proof shows that the dependency in γ of this restart scheme is a factor h(γ) = γe−γ/ρ of the number of iterations. Taking γ = 1, leads then to a suboptimal constant factor of at most h(ρ)/h(1) ≤e/2 ≈1.3 for ρ ∈[1/2, 2], so running this scheme with γ = 1 makes it parameter-free while getting nearly optimal bounds. 5 Numerical Results We illustrate our results by testing our adaptive restart methods, denoted Adap and Crit, introduced respectively in Sections 2.2 and 4 on several problems and compare them against simple gradient descent (Grad), accelerated gradient methods (Acc), and the restart heuristic enforcing monotonicity (Mono in [O’Donoghue and Candes, 2015]). For Adap we plot the convergence of the best method found by grid search to compare with the restart heuristic. This implicitly assumes that the grid search is run in parallel with enough servers. For Crit we use the optimal f ∗found by another solver. This gives an overview of its performance in order to potentially approximate it along the iterations 8 in a future work as done with Polyak steps [Polyak, 1987]. All restart schemes were done using the accelerated gradient with backtracking line search detailed in the Supplementary Material, with large dots representing restart iterations. The results focused on unconstrained problems but our approach can directly be extended to composite problems by using the proximal variant of the gradient, accelerated gradient and universal fast gradient methods [Nesterov, 2015] as detailed in the Supplementary Material. This includes constrained optimization as a particular case by adding the indicator function of the constraint set to the objective (as in the SVM example below). In Figure 1, we solve classification problems with various losses on the UCI Sonar data set [Asuncion and Newman, 2007]. For least square loss on sonar data set, we observe much faster convergence of the restart schemes compared to the accelerated method. These results were already observed by O’Donoghue and Candes [2015]. For logistic loss, we observe that restart does not provide much improvement. The backtracking line search on the Lipschitz constant may be sufficient to capture the geometry of the problem. For hinge loss, we regularized by a squared norm and optimize the dual, which means solving a quadratic problem with box constraints. We observe here that the scheduled restart scheme convergences much faster, while restart heuristics may be activated too late. We observe similar results for the LASSO problem. In general Crit ensures the theoretical accelerated rate but Adap exhibits more consistent behavior. This highlights the benefits of a sharpness assumption for these last two problems. Precisely quantifying sharpness from data/problem structure is a key open problem. 0 200 400 600 800 Iterations 10 -10 10 -5 10 0 f(x)-f * Grad Acc Mono Adap Crit 0 500 1000 Iterations 10 -2 10 -1 10 0 f(x)-f * Grad Acc Mono Adap Crit 0 500 1000 Iterations 10 -10 10 -5 10 0 f(x)-f * Grad Acc Mono Adap Crit 0 500 1000 Iterations 10 -10 10 -5 10 0 f(x)-f * Grad Acc Mono Adap Crit Figure 1: From left to right: least square loss, logistic loss, dual SVM problem and LASSO. We use adaptive restarts (Adap), gradient descent (Grad), accelerated gradient (Acc) and restart heuristic enforcing monotonicity (Mono). Large dots represent the restart iterations. Regularization parameters for dual SVM and LASSO were set to one. Acknowledgments The authors would like to acknowledge support from the chaire Économie des nouvelles données with the data science joint research initiative with the fonds AXA pour la recherche, a gift from Société Générale Cross Asset Quantitative Research and an AMX fellowship. The authors are affiliated to PSL Research University, Paris, France. 9 References Arjevani, Y. and Shamir, O. [2016], On the iteration complexity of oblivious first-order optimization algorithms, in ‘International Conference on Machine Learning’, pp. 908–916. Asuncion, A. and Newman, D. [2007], ‘Uci machine learning repository’. Attouch, H., Bolte, J., Redont, P. and Soubeyran, A. [2010], ‘Proximal alternating minimization and projection methods for nonconvex problems: An approach based on the kurdyka-łojasiewicz inequality’, Mathematics of Operations Research 35(2), 438–457. Auslender, A. and Crouzeix, J.-P. [1988], ‘Global regularity theorems’, Mathematics of Operations Research 13(2), 243–253. Bierstone, E. and Milman, P. D. [1988], ‘Semianalytic and subanalytic sets’, Publications Mathématiques de l’IHÉS 67, 5–42. Bolte, J., Daniilidis, A. and Lewis, A. [2007], ‘The łojasiewicz inequality for nonsmooth subanalytic functions with applications to subgradient dynamical systems’, SIAM Journal on Optimization 17(4), 1205–1223. Bolte, J., Nguyen, T. P., Peypouquet, J. and Suter, B. W. [2015], ‘From error bounds to the complexity of first-order descent methods for convex functions’, Mathematical Programming pp. 1–37. Bolte, J., Sabach, S. and Teboulle, M. [2014], ‘Proximal alternating linearized minimization for nonconvex and nonsmooth problems’, Mathematical Programming 146(1-2), 459–494. Burke, J. and Deng, S. [2002], ‘Weak sharp minima revisited part i: basic theory’, Control and Cybernetics 31, 439–469. Burke, J. and Ferris, M. C. [1993], ‘Weak sharp minima in mathematical programming’, SIAM Journal on Control and Optimization 31(5), 1340–1359. Fercoq, O. and Qu, Z. [2016], ‘Restarting accelerated gradient methods with a rough strong convexity estimate’, arXiv preprint arXiv:1609.07358 . Fercoq, O. and Qu, Z. [2017], ‘Adaptive restart of accelerated gradient methods under local quadratic growth condition’, arXiv preprint arXiv:1709.02300 . Frankel, P., Garrigos, G. and Peypouquet, J. [2015], ‘Splitting methods with variable metric for kurdyka–łojasiewicz functions and general convergence rates’, Journal of Optimization Theory and Applications 165(3), 874–900. Freund, R. M. and Lu, H. [2015], ‘New computational guarantees for solving convex optimization problems with first order methods, via a function growth condition measure’, arXiv preprint arXiv:1511.02974 . Gilpin, A., Pena, J. and Sandholm, T. [2012], ‘First-order algorithm with O(log 1/ϵ) convergence for ϵ-equilibrium in two-person zero-sum games’, Mathematical programming 133(1-2), 279–298. Giselsson, P. and Boyd, S. [2014], Monotonicity and restart in fast gradient methods, in ‘53rd IEEE Conference on Decision and Control’, IEEE, pp. 5058–5063. Hoffman, A. J. [1952], ‘On approximate solutions of systems of linear inequalities’, Journal of Research of the National Bureau of Standards 49(4). Juditski, A. and Nesterov, Y. [2014], ‘Primal-dual subgradient methods for minimizing uniformly convex functions’, arXiv preprint arXiv:1401.1792 . Karimi, H., Nutini, J. and Schmidt, M. [2016], Linear convergence of gradient and proximal-gradient methods under the polyak-łojasiewicz condition, in ‘Joint European Conference on Machine Learning and Knowledge Discovery in Databases’, Springer, pp. 795–811. Lin, Q. and Xiao, L. [2014], An adaptive accelerated proximal gradient method and its homotopy continuation for sparse optimization., in ‘ICML’, pp. 73–81. 10 Łojasiewicz, S. [1963], ‘Une propriété topologique des sous-ensembles analytiques réels’, Les équations aux dérivées partielles pp. 87–89. Łojasiewicz, S. [1993], ‘Sur la géométrie semi-et sous-analytique’, Annales de l’institut Fourier 43(5), 1575–1595. Mangasarian, O. L. [1985], ‘A condition number for differentiable convex inequalities’, Mathematics of Operations Research 10(2), 175–179. Nemirovskii, A. and Nesterov, Y. [1985], ‘Optimal methods of smooth convex minimization’, USSR Computational Mathematics and Mathematical Physics 25(2), 21–30. Nesterov, Y. [1983], ‘A method of solving a convex programming problem with convergence rate O(1/k2)’, Soviet Mathematics Doklady 27(2), 372–376. Nesterov, Y. [2013a], ‘Gradient methods for minimizing composite functions’, Mathematical Programming 140(1), 125–161. Nesterov, Y. [2013b], Introductory lectures on convex optimization: A basic course, Vol. 87, Springer Science & Business Media. Nesterov, Y. [2015], ‘Universal gradient methods for convex optimization problems’, Mathematical Programming 152(1-2), 381–404. O’Donoghue, B. and Candes, E. [2015], ‘Adaptive restart for accelerated gradient schemes’, Foundations of computational mathematics 15(3), 715–732. Polyak, B. [1979], Sharp minima institute of control sciences lecture notes, moscow, ussr, 1979, in ‘IIASA workshop on generalized Lagrangians and their applications, IIASA, Laxenburg, Austria’. Polyak, B. [1987], Introduction to optimization, Optimization Software. Renegar, J. [2014], ‘Efficient first-order methods for linear programming and semidefinite programming’, arXiv preprint arXiv:1409.5832 . Robinson, S. M. [1975], ‘An application of error bounds for convex programming in a linear space’, SIAM Journal on Control 13(2), 271–273. Roulet, V., Boumal, N. and d’Aspremont, A. [2015], ‘Renegar’s condition number, shaprness and compressed sensing performance’, arXiv preprint arXiv:1506.03295 . Su, W., Boyd, S. and Candes, E. [2014], A differential equation for modeling nesterov’s accelerated gradient method: Theory and insights, in ‘Advances in Neural Information Processing Systems’, pp. 2510–2518. 11
2017
116
6,582
Dynamic Routing Between Capsules Sara Sabour Nicholas Frosst Geoffrey E. Hinton Google Brain Toronto {sasabour, frosst, geoffhinton}@google.com Abstract A capsule is a group of neurons whose activity vector represents the instantiation parameters of a specific type of entity such as an object or an object part. We use the length of the activity vector to represent the probability that the entity exists and its orientation to represent the instantiation parameters. Active capsules at one level make predictions, via transformation matrices, for the instantiation parameters of higher-level capsules. When multiple predictions agree, a higher level capsule becomes active. We show that a discrimininatively trained, multi-layer capsule system achieves state-of-the-art performance on MNIST and is considerably better than a convolutional net at recognizing highly overlapping digits. To achieve these results we use an iterative routing-by-agreement mechanism: A lower-level capsule prefers to send its output to higher level capsules whose activity vectors have a big scalar product with the prediction coming from the lower-level capsule. 1 Introduction Human vision ignores irrelevant details by using a carefully determined sequence of fixation points to ensure that only a tiny fraction of the optic array is ever processed at the highest resolution. Introspection is a poor guide to understanding how much of our knowledge of a scene comes from the sequence of fixations and how much we glean from a single fixation, but in this paper we will assume that a single fixation gives us much more than just a single identified object and its properties. We assume that our multi-layer visual system creates a parse tree-like structure on each fixation, and we ignore the issue of how these single-fixation parse trees are coordinated over multiple fixations. Parse trees are generally constructed on the fly by dynamically allocating memory. Following Hinton et al. [2000], however, we shall assume that, for a single fixation, a parse tree is carved out of a fixed multilayer neural network like a sculpture is carved from a rock. Each layer will be divided into many small groups of neurons called “capsules” (Hinton et al. [2011]) and each node in the parse tree will correspond to an active capsule. Using an iterative routing process, each active capsule will choose a capsule in the layer above to be its parent in the tree. For the higher levels of a visual system, this iterative process will be solving the problem of assigning parts to wholes. The activities of the neurons within an active capsule represent the various properties of a particular entity that is present in the image. These properties can include many different types of instantiation parameter such as pose (position, size, orientation), deformation, velocity, albedo, hue, texture, etc. One very special property is the existence of the instantiated entity in the image. An obvious way to represent existence is by using a separate logistic unit whose output is the probability that the entity exists. In this paper we explore an interesting alternative which is to use the overall length of the vector of instantiation parameters to represent the existence of the entity and to force the orientation 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. of the vector to represent the properties of the entity1. We ensure that the length of the vector output of a capsule cannot exceed 1 by applying a non-linearity that leaves the orientation of the vector unchanged but scales down its magnitude. The fact that the output of a capsule is a vector makes it possible to use a powerful dynamic routing mechanism to ensure that the output of the capsule gets sent to an appropriate parent in the layer above. Initially, the output is routed to all possible parents but is scaled down by coupling coefficients that sum to 1. For each possible parent, the capsule computes a “prediction vector” by multiplying its own output by a weight matrix. If this prediction vector has a large scalar product with the output of a possible parent, there is top-down feedback which increases the coupling coefficient for that parent and decreasing it for other parents. This increases the contribution that the capsule makes to that parent thus further increasing the scalar product of the capsule’s prediction with the parent’s output. This type of “routing-by-agreement” should be far more effective than the very primitive form of routing implemented by max-pooling, which allows neurons in one layer to ignore all but the most active feature detector in a local pool in the layer below. We demonstrate that our dynamic routing mechanism is an effective way to implement the “explaining away” that is needed for segmenting highly overlapping objects. Convolutional neural networks (CNNs) use translated replicas of learned feature detectors. This allows them to translate knowledge about good weight values acquired at one position in an image to other positions. This has proven extremely helpful in image interpretation. Even though we are replacing the scalar-output feature detectors of CNNs with vector-output capsules and max-pooling with routing-by-agreement, we would still like to replicate learned knowledge across space. To achieve this, we make all but the last layer of capsules be convolutional. As with CNNs, we make higher-level capsules cover larger regions of the image. Unlike max-pooling however, we do not throw away information about the precise position of the entity within the region. For low level capsules, location information is “place-coded” by which capsule is active. As we ascend the hierarchy, more and more of the positional information is “rate-coded” in the real-valued components of the output vector of a capsule. This shift from place-coding to rate-coding combined with the fact that higher-level capsules represent more complex entities with more degrees of freedom suggests that the dimensionality of capsules should increase as we ascend the hierarchy. 2 How the vector inputs and outputs of a capsule are computed There are many possible ways to implement the general idea of capsules. The aim of this paper is not to explore this whole space but simply to show that one fairly straightforward implementation works well and that dynamic routing helps. We want the length of the output vector of a capsule to represent the probability that the entity represented by the capsule is present in the current input. We therefore use a non-linear "squashing" function to ensure that short vectors get shrunk to almost zero length and long vectors get shrunk to a length slightly below 1. We leave it to discriminative learning to make good use of this non-linearity. vj = ||sj||2 1 + ||sj||2 sj ||sj|| (1) where vj is the vector output of capsule j and sj is its total input. For all but the first layer of capsules, the total input to a capsule sj is a weighted sum over all “prediction vectors” ˆuj|i from the capsules in the layer below and is produced by multiplying the output ui of a capsule in the layer below by a weight matrix Wij sj = X i cijˆuj|i , ˆuj|i = Wijui (2) where the cij are coupling coefficients that are determined by the iterative dynamic routing process. The coupling coefficients between capsule i and all the capsules in the layer above sum to 1 and are determined by a “routing softmax” whose initial logits bij are the log prior probabilities that capsule i 1This makes biological sense as it does not use large activities to get accurate representations of things that probably don’t exist. 2 should be coupled to capsule j. cij = exp(bij) P k exp(bik) (3) The log priors can be learned discriminatively at the same time as all the other weights. They depend on the location and type of the two capsules but not on the current input image2. The initial coupling coefficients are then iteratively refined by measuring the agreement between the current output vj of each capsule, j, in the layer above and the prediction ˆuj|i made by capsule i. The agreement is simply the scalar product aij = vj.ˆuj|i. This agreement is treated as if it was a log likelihood and is added to the initial logit, bij before computing the new values for all the coupling coefficients linking capsule i to higher level capsules. In convolutional capsule layers, each capsule outputs a local grid of vectors to each type of capsule in the layer above using different transformation matrices for each member of the grid as well as for each type of capsule. Procedure 1 Routing algorithm. 1: procedure ROUTING(ˆuj|i, r, l) 2: for all capsule i in layer l and capsule j in layer (l + 1): bij ←0. 3: for r iterations do 4: for all capsule i in layer l: ci ←softmax(bi) ▷softmax computes Eq. 3 5: for all capsule j in layer (l + 1): sj ←P i cijˆuj|i 6: for all capsule j in layer (l + 1): vj ←squash(sj) ▷squash computes Eq. 1 7: for all capsule i in layer l and capsule j in layer (l + 1): bij ←bij + ˆuj|i.vj return vj 3 Margin loss for digit existence We are using the length of the instantiation vector to represent the probability that a capsule’s entity exists. We would like the top-level capsule for digit class k to have a long instantiation vector if and only if that digit is present in the image. To allow for multiple digits, we use a separate margin loss, Lk for each digit capsule, k: Lk = Tk max(0, m+ −||vk||)2 + λ (1 −Tk) max(0, ||vk|| −m−)2 (4) where Tk = 1 iff a digit of class k is present3 and m+ = 0.9 and m−= 0.1. The λ down-weighting of the loss for absent digit classes stops the initial learning from shrinking the lengths of the activity vectors of all the digit capsules. We use λ = 0.5. The total loss is simply the sum of the losses of all digit capsules. 4 CapsNet architecture A simple CapsNet architecture is shown in Fig. 1. The architecture is shallow with only two convolutional layers and one fully connected layer. Conv1 has 256, 9 × 9 convolution kernels with a stride of 1 and ReLU activation. This layer converts pixel intensities to the activities of local feature detectors that are then used as inputs to the primary capsules. The primary capsules are the lowest level of multi-dimensional entities and, from an inverse graphics perspective, activating the primary capsules corresponds to inverting the rendering process. This is a very different type of computation than piecing instantiated parts together to make familiar wholes, which is what capsules are designed to be good at. The second layer (PrimaryCapsules) is a convolutional capsule layer with 32 channels of convolutional 8D capsules (i.e. each primary capsule contains 8 convolutional units with a 9 × 9 kernel and a stride of 2). Each primary capsule output sees the outputs of all 256 × 81 Conv1 units whose receptive 2For MNIST we found that it was sufficient to set all of these priors to be equal. 3We do not allow an image to contain two instances of the same digit class. We address this weakness of capsules in the discussion section. 3 Figure 1: A simple CapsNet with 3 layers. This model gives comparable results to deep convolutional networks (such as Chang and Chen [2015]). The length of the activity vector of each capsule in DigitCaps layer indicates presence of an instance of each class and is used to calculate the classification loss. Wij is a weight matrix between each ui, i ∈(1, 32 × 6 × 6) in PrimaryCapsules and vj, j ∈(1, 10). Figure 2: Decoder structure to reconstruct a digit from the DigitCaps layer representation. The euclidean distance between the image and the output of the Sigmoid layer is minimized during training. We use the true label as reconstruction target during training. fields overlap with the location of the center of the capsule. In total PrimaryCapsules has [32 × 6 × 6] capsule outputs (each output is an 8D vector) and each capsule in the [6 × 6] grid is sharing their weights with each other. One can see PrimaryCapsules as a Convolution layer with Eq. 1 as its block non-linearity. The final Layer (DigitCaps) has one 16D capsule per digit class and each of these capsules receives input from all the capsules in the layer below. We have routing only between two consecutive capsule layers (e.g. PrimaryCapsules and DigitCaps). Since Conv1 output is 1D, there is no orientation in its space to agree on. Therefore, no routing is used between Conv1 and PrimaryCapsules. All the routing logits (bij) are initialized to zero. Therefore, initially a capsule output (ui) is sent to all parent capsules (v0...v9) with equal probability (cij). Our implementation is in TensorFlow (Abadi et al. [2016]) and we use the Adam optimizer (Kingma and Ba [2014]) with its TensorFlow default parameters, including the exponentially decaying learning rate, to minimize the sum of the margin losses in Eq. 4. 4.1 Reconstruction as a regularization method We use an additional reconstruction loss to encourage the digit capsules to encode the instantiation parameters of the input digit. During training, we mask out all but the activity vector of the correct digit capsule. Then we use this activity vector to reconstruct the input image. The output of the digit capsule is fed into a decoder consisting of 3 fully connected layers that model the pixel intensities as described in Fig. 2. We minimize the sum of squared differences between the outputs of the logistic units and the pixel intensities. We scale down this reconstruction loss by 0.0005 so that it does not dominate the margin loss during training. As illustrated in Fig. 3 the reconstructions from the 16D output of the CapsNet are robust while keeping only important details. 4 Figure 3: Sample MNIST test reconstructions of a CapsNet with 3 routing iterations. (l, p, r) represents the label, the prediction and the reconstruction target respectively. The two rightmost columns show two reconstructions of a failure example and it explains how the model confuses a 5 and a 3 in this image. The other columns are from correct classifications and shows that model preserves many of the details while smoothing the noise. (l, p, r) (2, 2, 2) (5, 5, 5) (8, 8, 8) (9, 9, 9) (5, 3, 5) (5, 3, 3) Input Output Table 1: CapsNet classification test accuracy. The MNIST average and standard deviation results are reported from 3 trials. Method Routing Reconstruction MNIST (%) MultiMNIST (%) Baseline 0.39 8.1 CapsNet 1 no 0.34±0.032 CapsNet 1 yes 0.29±0.011 7.5 CapsNet 3 no 0.35±0.036 CapsNet 3 yes 0.25±0.005 5.2 5 Capsules on MNIST Training is performed on 28 × 28 MNIST (LeCun et al. [1998]) images that have been shifted by up to 2 pixels in each direction with zero padding. No other data augmentation/deformation is used. The dataset has 60K and 10K images for training and testing respectively. We test using a single model without any model averaging. Wan et al. [2013] achieves 0.21% test error with ensembling and augmenting the data with rotation and scaling. They achieve 0.39% without them. We get a low test error (0.25%) on a 3 layer network previously only achieved by deeper networks. Tab. 1 reports the test error rate on MNIST for different CapsNet setups and shows the importance of routing and reconstruction regularizer. Adding the reconstruction regularizer boosts the routing performance by enforcing the pose encoding in the capsule vector. The baseline is a standard CNN with three convolutional layers of 256, 256, 128 channels. Each has 5x5 kernels and stride of 1. The last convolutional layers are followed by two fully connected layers of size 328, 192. The last fully connected layer is connected with dropout to a 10 class softmax layer with cross entropy loss. The baseline is also trained on 2-pixel shifted MNIST with Adam optimizer. The baseline is designed to achieve the best performance on MNIST while keeping the computation cost as close as to CapsNet. In terms of number of parameters the baseline has 35.4M while CapsNet has 8.2M parameters and 6.8M parameters without the reconstruction subnetwork. 5.1 What the individual dimensions of a capsule represent Since we are passing the encoding of only one digit and zeroing out other digits, the dimensions of a digit capsule should learn to span the space of variations in the way digits of that class are instantiated. These variations include stroke thickness, skew and width. They also include digit-specific variations such as the length of the tail of a 2. We can see what the individual dimensions represent by making use of the decoder network. After computing the activity vector for the correct digit capsule, we can feed a perturbed version of this activity vector to the decoder network and see how the perturbation affects the reconstruction. Examples of these perturbations are shown in Fig. 4. We found that one dimension (out of 16) of the capsule almost always represents the width of the digit. While some dimensions represent combinations of global variations, there are other dimensions that represent 5 Figure 4: Dimension perturbations. Each row shows the reconstruction when one of the 16 dimensions in the DigitCaps representation is tweaked by intervals of 0.05 in the range [−0.25, 0.25]. Scale and thickness Localized part Stroke thickness Localized skew Width and translation Localized part variation in a localized part of the digit. For example, different dimensions are used for the length of the ascender of a 6 and the size of the loop. 5.2 Robustness to Affine Transformations Experiments show that each DigitCaps capsule learns a more robust representation for each class than a traditional convolutional network. Because there is natural variance in skew, rotation, style, etc in hand written digits, the trained CapsNet is moderately robust to small affine transformations of the training data. To test the robustness of CapsNet to affine transformations, we trained a CapsNet and a traditional convolutional network (with MaxPooling and DropOut) on a padded and translated MNIST training set, in which each example is an MNIST digit placed randomly on a black background of 40 × 40 pixels. We then tested this network on the affNIST4 data set, in which each example is an MNIST digit with a random small affine transformation. Our models were never trained with affine transformations other than translation and any natural transformation seen in the standard MNIST. An under-trained CapsNet with early stopping which achieved 99.23% accuracy on the expanded MNIST test set achieved 79% accuracy on the affnist test set. A traditional convolutional model with a similar number of parameters which achieved similar accuracy (99.22%) on the expanded mnist test set only achieved 66% on the affnist test set. 6 Segmenting highly overlapping digits Dynamic routing can be viewed as a parallel attention mechanism that allows each capsule at one level to attend to some active capsules at the level below and to ignore others. This should allow the model to recognize multiple objects in the image even if objects overlap. Hinton et al. propose the task of segmenting and recognizing highly overlapping digits (Hinton et al. [2000] and others have tested their networks in a similar domain (Goodfellow et al. [2013], Ba et al. [2014], Greff et al. [2016]). The routing-by-agreement should make it possible to use a prior about the shape of objects to help segmentation and it should obviate the need to make higher-level segmentation decisions in the domain of pixels. 6.1 MultiMNIST dataset We generate the MultiMNIST training and test dataset by overlaying a digit on top of another digit from the same set (training or test) but different class. Each digit is shifted up to 4 pixels in each direction resulting in a 36×36 image. Considering a digit in a 28×28 image is bounded in a 20×20 box, two digits bounding boxes on average have 80% overlap. For each digit in the MNIST dataset we generate 1K MultiMNIST examples. So the training set size is 60M and the test set size is 10M. 4Available at http://www.cs.toronto.edu/~tijmen/affNIST/. 6 Figure 5: Sample reconstructions of a CapsNet with 3 routing iterations on MultiMNIST test dataset. The two reconstructed digits are overlayed in green and red as the lower image. The upper image shows the input image. L:(l1, l2) represents the label for the two digits in the image and R:(r1, r2) represents the two digits used for reconstruction. The two right most columns show two examples with wrong classification reconstructed from the label and from the prediction (P). In the (2, 8) example the model confuses 8 with a 7 and in (4, 9) it confuses 9 with 0. The other columns have correct classifications and show that the model accounts for all the pixels while being able to assign one pixel to two digits in extremely difficult scenarios (column 1 −4). Note that in dataset generation the pixel values are clipped at 1. The two columns with the (*) mark show reconstructions from a digit that is neither the label nor the prediction. These columns suggests that the model is not just finding the best fit for all the digits in the image including the ones that do not exist. Therefore in case of (5, 0) it cannot reconstruct a 7 because it knows that there is a 5 and 0 that fit best and account for all the pixels. Also, in case of (8, 1) the loop of 8 has not triggered 0 because it is already accounted for by 8. Therefore it will not assign one pixel to two digits if one of them does not have any other support. R:(2, 7) R:(6, 0) R:(6, 8) R:(7, 1) *R:(5, 7) *R:(2, 3) R:(2, 8) R:P:(2, 7) L:(2, 7) L:(6, 0) L:(6, 8) L:(7, 1) L:(5, 0) L:(4, 3) L:(2, 8) L:(2, 8) R:(8, 7) R:(9, 4) R:(9, 5) R:(8, 4) *R:(0, 8) *R:(1, 6) R:(4, 9) R:P:(4, 0) L:(8, 7) L:(9, 4) L:(9, 5) L:(8, 4) L:(1, 8) L:(7, 6) L:(4, 9) L:(4, 9) 6.2 MultiMNIST results Our 3 layer CapsNet model trained from scratch on MultiMNIST training data achieves higher test classification accuracy than our baseline convolutional model. We are achieving the same classification error rate of 5.0% on highly overlapping digit pairs as the sequential attention model of Ba et al. [2014] achieves on a much easier task that has far less overlap (80% overlap of the boxes around the two digits in our case vs < 4% for Ba et al. [2014]). On test images, which are composed of pairs of images from the test set, we treat the two most active digit capsules as the classification produced by the capsules network. During reconstruction we pick one digit at a time and use the activity vector of the chosen digit capsule to reconstruct the image of the chosen digit (we know this image because we used it to generate the composite image). The only difference with our MNIST model is that we increased the period of the decay step for the learning rate to be 10× larger because the training dataset is larger. The reconstructions illustrated in Fig. 5 show that CapsNet is able to segment the image into the two original digits. Since this segmentation is not at pixel level we observe that the model is able to deal correctly with the overlaps (a pixel is on in both digits) while accounting for all the pixels. The position and the style of each digit is encoded in DigitCaps. The decoder has learned to reconstruct a digit given the encoding. The fact that it is able to reconstruct digits regardless of the overlap shows that each digit capsule can pick up the style and position from the votes it is receiving from PrimaryCapsules layer. 7 Tab. 1 emphasizes the importance of capsules with routing on this task. As a baseline for the classification of CapsNet accuracy we trained a convolution network with two convolution layers and two fully connected layers on top of them. The first layer has 512 convolution kernels of size 9 × 9 and stride 1. The second layer has 256 kernels of size 5 × 5 and stride 1. After each convolution layer the model has a pooling layer of size 2 × 2 and stride 2. The third layer is a 1024D fully connected layer. All three layers have ReLU non-linearities. The final layer of 10 units is fully connected. We use the TensorFlow default Adam optimizer (Kingma and Ba [2014]) to train a sigmoid cross entropy loss on the output of final layer. This model has 24.56M parameters which is 2 times more parameters than CapsNet with 11.36M parameters. We started with a smaller CNN (32 and 64 convolutional kernels of 5 × 5 and stride of 1 and a 512D fully connected layer) and incrementally increased the width of the network until we reached the best test accuracy on a 10K subset of the MultiMNIST data. We also searched for the right decay step on the 10K validation set. We decode the two most active DigitCaps capsules one at a time and get two images. Then by assigning any pixel with non-zero intensity to each digit we get the segmentation results for each digit. 7 Other datasets We tested our capsule model on CIFAR10 and achieved 10.6% error with an ensemble of 7 models each of which is trained with 3 routing iterations on 24 × 24 patches of the image. Each model has the same architecture as the simple model we used for MNIST except that there are three color channels and we used 64 different types of primary capsule. We also found that it helped to introduce a "none-of-the-above" category for the routing softmaxes, since we do not expect the final layer of ten capsules to explain everything in the image. 10.6% test error is about what standard convolutional nets achieved when they were first applied to CIFAR10 (Zeiler and Fergus [2013]). One drawback of Capsules which it shares with generative models is that it likes to account for everything in the image so it does better when it can model the clutter than when it just uses an additional “orphan” category in the dynamic routing. In CIFAR-10, the backgrounds are much too varied to model in a reasonable sized net which helps to account for the poorer performance. We also tested the exact same architecture as we used for MNIST on smallNORB (LeCun et al. [2004]) and achieved 2.7% test error rate, which is on-par with the state-of-the-art (Cire¸san et al. [2011]). The smallNORB dataset consists of 96x96 stereo grey-scale images. We resized the images to 48x48 and during training processed random 32x32 crops of them. We passed the central 32x32 patch during test. We also trained a smaller network on the small training set of SVHN (Netzer et al. [2011]) with only 73257 images. We reduced the number of first convolutional layer channels to 64, the primary capsule layer to 16 6D-capsules with 8D final capsule layer at the end and achieved 4.3% on the test set. 8 Discussion and previous work For thirty years, the state-of-the-art in speech recognition used hidden Markov models with Gaussian mixtures as output distributions. These models were easy to learn on small computers, but they had a representational limitation that was ultimately fatal: The one-of-n representations they use are exponentially inefficient compared with, say, a recurrent neural network that uses distributed representations. To double the amount of information that an HMM can remember about the string it has generated so far, we need to square the number of hidden nodes. For a recurrent net we only need to double the number of hidden neurons. Now that convolutional neural networks have become the dominant approach to object recognition, it makes sense to ask whether there are any exponential inefficiencies that may lead to their demise. A good candidate is the difficulty that convolutional nets have in generalizing to novel viewpoints. The ability to deal with translation is built in, but for the other dimensions of an affine transformation we have to chose between replicating feature detectors on a grid that grows exponentially with the number of dimensions, or increasing the size of the labelled training set in a similarly exponential way. Capsules (Hinton et al. [2011]) avoid these exponential inefficiencies by converting pixel intensities 8 into vectors of instantiation parameters of recognized fragments and then applying transformation matrices to the fragments to predict the instantiation parameters of larger fragments. Transformation matrices that learn to encode the intrinsic spatial relationship between a part and a whole constitute viewpoint invariant knowledge that automatically generalizes to novel viewpoints. Hinton et al. [2011] proposed transforming autoencoders to generate the instantiation parameters of the PrimaryCapsule layer and their system required transformation matrices to be supplied externally. We propose a complete system that also answers "how larger and more complex visual entities can be recognized by using agreements of the poses predicted by active, lower-level capsules". Capsules make a very strong representational assumption: At each location in the image, there is at most one instance of the type of entity that a capsule represents. This assumption, which was motivated by the perceptual phenomenon called "crowding" (Pelli et al. [2004]), eliminates the binding problem (Hinton [1981a]) and allows a capsule to use a distributed representation (its activity vector) to encode the instantiation parameters of the entity of that type at a given location. This distributed representation is exponentially more efficient than encoding the instantiation parameters by activating a point on a high-dimensional grid and with the right distributed representation, capsules can then take full advantage of the fact that spatial relationships can be modelled by matrix multiplies. Capsules use neural activities that vary as viewpoint varies rather than trying to eliminate viewpoint variation from the activities. This gives them an advantage over "normalization" methods like spatial transformer networks (Jaderberg et al. [2015]): They can deal with multiple different affine transformations of different objects or object parts at the same time. Capsules are also very good for dealing with segmentation, which is another of the toughest problems in vision, because the vector of instantiation parameters allows them to use routing-by-agreement, as we have demonstrated in this paper. The importance of dynamic routing procedure is also backed by biologically plausible models of invarient pattern recognition in the visual cortex. Hinton [1981b] proposes dynamic connections and canonical object based frames of reference to generate shape descriptions that can be used for object recognition. Olshausen et al. [1993] improves upon Hinton [1981b] dynamic connections and presents a biologically plausible, position and scale invariant model of object representations. Research on capsules is now at a similar stage to research on recurrent neural networks for speech recognition at the beginning of this century. There are fundamental representational reasons for believing that it is a better approach but it probably requires a lot more small insights before it can out-perform a highly developed technology. The fact that a simple capsules system already gives unparalleled performance at segmenting overlapping digits is an early indication that capsules are a direction worth exploring. Acknowledgement. Of the many who provided us with constructive comments, we are specially grateful to Robert Gens, Eric Langlois, Vincent Vanhoucke, Chris Williams, and the reviewers for their fruitful comments and corrections. 9 References 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. Jimmy Ba, Volodymyr Mnih, and Koray Kavukcuoglu. Multiple object recognition with visual attention. arXiv preprint arXiv:1412.7755, 2014. Jia-Ren Chang and Yong-Sheng Chen. Batch-normalized maxout network in network. arXiv preprint arXiv:1511.02583, 2015. Dan C Cire¸san, Ueli Meier, Jonathan Masci, Luca M Gambardella, and Jürgen Schmidhuber. Highperformance neural networks for visual object classification. arXiv preprint arXiv:1102.0183, 2011. Ian J Goodfellow, Yaroslav Bulatov, Julian Ibarz, Sacha Arnoud, and Vinay Shet. Multi-digit number recognition from street view imagery using deep convolutional neural networks. arXiv preprint arXiv:1312.6082, 2013. Klaus Greff, Antti Rasmus, Mathias Berglund, Tele Hao, Harri Valpola, and Jürgen Schmidhuber. Tagger: Deep unsupervised perceptual grouping. In Advances in Neural Information Processing Systems, pages 4484–4492, 2016. Geoffrey E Hinton. Shape representation in parallel systems. In International Joint Conference on Artificial Intelligence Vol 2, 1981a. Geoffrey E Hinton. A parallel computation that assigns canonical object-based frames of reference. In Proceedings of the 7th international joint conference on Artificial intelligence-Volume 2, pages 683–685. Morgan Kaufmann Publishers Inc., 1981b. Geoffrey E Hinton, Zoubin Ghahramani, and Yee Whye Teh. Learning to parse images. In Advances in neural information processing systems, pages 463–469, 2000. Geoffrey E Hinton, Alex Krizhevsky, and Sida D Wang. Transforming auto-encoders. In International Conference on Artificial Neural Networks, pages 44–51. Springer, 2011. Max Jaderberg, Karen Simonyan, Andrew Zisserman, and Koray Kavukcuoglu. Spatial transformer networks. In Advances in Neural Information Processing Systems, pages 2017–2025, 2015. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. Yann LeCun, Corinna Cortes, and Christopher JC Burges. The mnist database of handwritten digits, 1998. Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In Computer Vision and Pattern Recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE Computer Society Conference on, volume 2, pages II–104. IEEE, 2004. 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. Bruno A Olshausen, Charles H Anderson, and David C Van Essen. A neurobiological model of visual attention and invariant pattern recognition based on dynamic routing of information. Journal of Neuroscience, 13(11):4700–4719, 1993. Denis G Pelli, Melanie Palomares, and Najib J Majaj. Crowding is unlike ordinary masking: Distinguishing feature integration from detection. Journal of vision, 4(12):12–12, 2004. Li Wan, Matthew D Zeiler, Sixin Zhang, Yann LeCun, and Rob Fergus. Regularization of neural networks using dropconnect. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pages 1058–1066, 2013. 10 Matthew D Zeiler and Rob Fergus. Stochastic pooling for regularization of deep convolutional neural networks. arXiv preprint arXiv:1301.3557, 2013. A How many routing iterations to use? In order to experimentally verify the convergence of the routing algorithm we plot the average change in the routing logits at each routing iteration. Fig. A.1 shows the average bij change after each routing iteration. Experimentally we observe that there is negligible change in the routing by 5 iteration from the start of training. Average change in the 2nd pass of the routing settles down after 500 epochs of training to 0.007 while at routing iteration 5 the logits only change by 1e −5 on average. Figure A.1: Average change of each routing logit (bij) by each routing iteration. After 500 epochs of training on MNIST the average change is stabilized and as it shown in right figure it decreases almost linearly in log scale with more routing iterations. (a) During training. (b) Log scale of final differences. We observed that in general more routing iterations increases the network capacity and tends to overfit to the training dataset. Fig. A.2 shows a comparison of Capsule training loss on Cifar10 when trained with 1 iteration of routing vs 3 iteration of routing. Motivated by Fig. A.2 and Fig. A.1 we suggest 3 iteration of routing for all experiments. Figure A.2: Traning loss of CapsuleNet on cifar10 dataset. The batch size at each training step is 128. The CapsuleNet with 3 iteration of routing optimizes the loss faster and converges to a lower loss at the end. 11
2017
117
6,583
InfoGAIL: Interpretable Imitation Learning from Visual Demonstrations Yunzhu Li MIT liyunzhu@mit.edu Jiaming Song Stanford University tsong@cs.stanford.edu Stefano Ermon Stanford University ermon@cs.stanford.edu Abstract The goal of imitation learning is to mimic expert behavior without access to an explicit reward signal. Expert demonstrations provided by humans, however, often show significant variability due to latent factors that are typically not explicitly modeled. In this paper, we propose a new algorithm that can infer the latent structure of expert demonstrations in an unsupervised way. Our method, built on top of Generative Adversarial Imitation Learning, can not only imitate complex behaviors, but also learn interpretable and meaningful representations of complex behavioral data, including visual demonstrations. In the driving domain, we show that a model learned from human demonstrations is able to both accurately reproduce a variety of behaviors and accurately anticipate human actions using raw visual inputs. Compared with various baselines, our method can better capture the latent structure underlying expert demonstrations, often recovering semantically meaningful factors of variation in the data. 1 Introduction A key limitation of reinforcement learning (RL) is that it involves the optimization of a predefined reward function or reinforcement signal [1–6]. Explicitly defining a reward function is straightforward in some cases, e.g., in games such as Go or chess. However, designing an appropriate reward function can be difficult in more complex and less well-specified environments, e.g., for autonomous driving where there is a need to balance safety, comfort, and efficiency. Imitation learning methods have the potential to close this gap by learning how to perform tasks directly from expert demonstrations, and has succeeded in a wide range of problems [7–11]. Among them, Generative Adversarial Imitation Learning (GAIL, [12]) is a model-free imitation learning method that is highly effective and scales to relatively high dimensional environments. The training process of GAIL can be thought of as building a generative model, which is a stochastic policy that when coupled with a fixed simulation environment, produces similar behaviors to the expert demonstrations. Similarity is achieved by jointly training a discriminator to distinguish expert trajectories from ones produced by the learned policy, as in GANs [13]. In imitation learning, example demonstrations are typically provided by human experts. These demonstrations can show significant variability. For example, they might be collected from multiple experts, each employing a different policy. External latent factors of variation that are not explicitly captured by the simulation environment can also significantly affect the observed behavior. For example, expert demonstrations might be collected from users with different skills and habits. The goal of this paper is to develop an imitation learning framework that is able to automatically discover and disentangle the latent factors of variation underlying expert demonstrations. Analogous to the goal of uncovering style, shape, and color in generative modeling of images [14], we aim to automatically learn similar interpretable concepts from human demonstrations through an unsupervised manner. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. We propose a new method for learning a latent variable generative model that can produce trajectories in a dynamic environment, i.e., sequences of state-actions pairs in a Markov Decision Process. Not only can the model accurately reproduce expert behavior, but also empirically learns a latent space of the observations that is semantically meaningful. Our approach is an extension of GAIL, where the objective is augmented with a mutual information term between the latent variables and the observed state-action pairs. We first illustrate the core concepts in a synthetic 2D example and then demonstrate an application in autonomous driving, where we learn to imitate complex driving behaviors while recovering semantically meaningful structure, without any supervision beyond the expert trajectories. 1 Remarkably, our method performs directly on raw visual inputs, using raw pixels as the only source of perceptual information. The code for reproducing the experiments are available at https://github.com/ermongroup/InfoGAIL. In particular, the contributions of this paper are threefold: 1. We extend GAIL with a component which approximately maximizes the mutual information between latent space and trajectories, similar to InfoGAN [14], resulting in a policy where low-level actions can be controlled through more abstract, high-level latent variables. 2. We extend GAIL to use raw pixels as input and produce human-like behaviors in complex high-dimensional dynamic environments. 3. We demonstrate an application to autonomous highway driving using the TORCS driving simulator [15]. We first demonstrate that the learned policy is able to correctly navigate the track without collisions. Then, we show that our model learns to reproduce different kinds of human-like driving behaviors by exploring the latent variable space. 2 Background 2.1 Preliminaries We use the tuple (S, A, P, r, ⇢0, γ) to define an infinite-horizon, discounted Markov decision process (MDP), where S represents the state space, A represents the action space, P : S⇥A⇥S ! R denotes the transition probability distribution, r : S ! R denotes the reward function, ⇢0 : S ! R is the distribution of the initial state s0, and γ 2 (0, 1) is the discount factor. Let ⇡denote a stochastic policy ⇡: S ⇥A ! [0, 1], and ⇡E denote the expert policy to which we only have access to demonstrations. The expert demonstrations ⌧E are a set of trajectories generated using policy ⇡E, each of which consists of a sequence of state-action pairs. We use an expectation with respect to a policy ⇡to denote an expectation with respect to the trajectories it generates: E⇡[f(s, a)] , E[P1 t=0 γtf(st, at)], where s0 ⇠⇢0, at ⇠⇡(at|st), st+1 ⇠P(st+1|at, st). 2.2 Imitation learning The goal of imitation learning is to learn how to perform a task directly from expert demonstrations, without any access to the reinforcement signal r. Typically, there are two approaches to imitation learning: 1) behavior cloning (BC), which learns a policy through supervised learning over the stateaction pairs from the expert trajectories [16]; and 2) apprenticeship learning (AL), which assumes the expert policy is optimal under some unknown reward and learns a policy by recovering the reward and solving the corresponding planning problem. BC tends to have poor generalization properties due to compounding errors and covariate shift [17, 18]. AL, on the other hand, has the advantage of learning a reward function that can be used to score trajectories [19–21], but is typically expensive to run because it requires solving a reinforcement learning (RL) problem inside a learning loop. 2.3 Generative Adversarial Imitation Learning Recent work on AL has adopted a different approach by learning a policy without directly estimating the corresponding reward function. In particular, Generative Adversarial Imitation Learning (GAIL, [12]) is a recent AL method inspired by Generative Adversarial Networks (GAN, [13]). In the GAIL framework, the agent imitates the behavior of an expert policy ⇡E by matching the generated state-action distribution with the expert’s distribution, where the optimum is achieved when the 1A video showing the experimental results is available at https://youtu.be/YtNPBAW6h5k. 2 distance between these two distributions is minimized as measured by Jensen-Shannon divergence. The formal GAIL objective is denoted as min ⇡ max D2(0,1)S⇥A E⇡[log D(s, a)] + E⇡E[log(1 −D(s, a))] −λH(⇡) (1) where ⇡is the policy that we wish to imitate ⇡E with, D is a discriminative classifier which tries to distinguish state-action pairs from the trajectories generated by ⇡and ⇡E, and H(⇡) , E⇡[−log ⇡(a|s)] is the γ-discounted causal entropy of the policy ⇡✓[22]. Instead of directly learning a reward function, GAIL relies on the discriminator to guide ⇡into imitating the expert policy. GAIL is model-free: it requires interaction with the environment to generate rollouts, but it does not need to construct a model for the environment. Unlike GANs, GAIL considers the environment/simulator as a black box, and thus the objective is not differentiable end-to-end. Hence, optimization of GAIL objective requires RL techniques based on Monte-Carlo estimation of policy gradients. Optimization over the GAIL objective is performed by alternating between a gradient step to increase (1) with respect to the discriminator parameters, and a Trust Region Policy Optimization (TRPO, [2]) step to decrease (1) with respect to ⇡. 3 Interpretable Imitation Learning through Visual Inputs Demonstrations are typically collected from human experts. The resulting trajectories can show significant variability among different individuals due to internal latent factors of variation, such as levels of expertise and preferences for different strategies. Even the same individual might make different decisions while encountering the same situation, potentially resulting in demonstrations generated from multiple near-optimal but distinct policies. In this section, we propose an approach that can 1) discover and disentangle salient latent factors of variation underlying expert demonstrations without supervision, 2) learn policies that produce trajectories which correspond to these latent factors, and 3) use visual inputs as the only external perceptual information. Formally, we assume that the expert policy is a mixture of experts ⇡E = {⇡0 E, ⇡1 E, . . . }, and we define the generative process of the expert trajectory ⌧E as: s0 ⇠⇢0, c ⇠p(c), ⇡⇠p(⇡|c), at ⇠⇡(at|st), st+1 ⇠P(st+1|at, st), where c is a discrete latent variable that selects a specific policy ⇡from the mixture of expert policies through p(⇡|c) (which is unknown and needs to be learned), and p(c) is the prior distribution of c (which is assumed to be known before training). Similar to the GAIL setting, we consider the apprenticeship learning problem as the dual of an occupancy measure matching problem, and treat the trajectory ⌧E as a set of state-action pairs. Instead of learning a policy solely based on the current state, we extend it to include an explicit dependence on the latent variable c. The objective is to recover a policy ⇡(a|s, c) as an approximation of ⇡E; when c is samples from the prior p(c), the trajectories ⌧generated by the conditional policy ⇡(a|s, c) should be similar to the expert trajectories ⌧E, as measured by a discriminative classifier. 3.1 Interpretable Imitation Learning Learning from demonstrations generated by a mixture of experts is challenging as we have no access to the policies employed by the individual experts. We have to proceed in an unsupervised way, similar to clustering. The original Generative Adversarial Imitation Learning method would fail as it assumes all the demonstrations come from a single expert, and there is no incentive in separating and disentangling variations observed in the data. A method that can automatically disentangle the demonstrations in a meaningful way is thus needed. The way we address this problem is to introduce a latent variable c into our policy function, ⇡(a|s, c). Without further constraints over c, applying GAIL directly to this ⇡(a|s, c) could simply ignore c and fail to separate different types of behaviors present in the expert trajectories 2. To incentivize the model to use c as much as possible, we utilize an information-theoretic regularization enforcing that there should be high mutual information between c and the state-action pairs in the generated trajectory. This concept was introduced by InfoGAN [14], where latent codes are utilized to discover the salient semantic features of the data distribution and guide the generating process. In particular, the regularization seeks to maximize the mutual information between latent codes and trajectories, 2For a fair comparison, we consider this form as our GAIL baseline in the experiments below. 3 denoted as I(c; ⌧),which is hard to maximize directly as it requires access to the posterior P(c|⌧). Hence we introduce a variational lower bound, LI(⇡, Q), of the mutual information I(c; ⌧)3: LI(⇡, Q) = Ec⇠p(c),a⇠⇡(·|s,c)[log Q(c|⌧)] + H(c) I(c; ⌧) (2) where Q(c|⌧) is an approximation of the true posterior P(c|⌧). The objective under this regularization, which we call Information Maximizing Generative Adversarial Imitation Learning (InfoGAIL), then becomes: min ⇡,Q max D E⇡[log D(s, a)] + E⇡E[log(1 −D(s, a))] −λ1LI(⇡, Q) −λ2H(⇡) (3) where λ1 > 0 is the hyperparameter for information maximization regularization term, and λ2 > 0 is the hyperparameter for the casual entropy term. By introducing the latent code, InfoGAIL is able to identify the salient factors in the expert trajectories through mutual information maximization, and imitate the corresponding expert policy through generative adversarial training. This allows us to disentangle trajectories that may arise from a mixture of experts, such as different individuals performing the same task. To optimize the objective, we use a simplified posterior approximation Q(c|s, a), since directly working with entire trajectories ⌧would be too expensive, especially when the dimension of the observations is very high (such as images). We then parameterize policy ⇡, discriminator D and posterior approximation Q with weights ✓, ! and respectively. We optimize LI(⇡✓, Q ) with stochastic gradient methods, ⇡✓using TRPO [2], and Q is updated using the Adam optimizer [23]. An outline for the optimization procedure is shown in Algorithm 1. Algorithm 1 InfoGAIL Input: Initial parameters of policy, discriminator and posterior approximation ✓0, !0, 0; expert trajectories ⌧E ⇠⇡E containing state-action pairs. Output: Learned policy ⇡✓ for i = 0, 1, 2, ... do Sample a batch of latent codes: ci ⇠p(c) Sample trajectories: ⌧i ⇠⇡✓i(ci), with the latent code fixed during each rollout. Sample state-action pairs χi ⇠⌧i and χE ⇠⌧E with same batch size. Update !i to !i+1 by ascending with gradients ∆!i = ˆEχi[r!i log D!i(s, a)] + ˆEχE[r!i log(1 −D!i(s, a))] Update i to i+1 by descending with gradients ∆ i = −λ1ˆEχi[r i log Q i(c|s, a)] Take a policy step from ✓i to ✓i+1, using the TRPO update rule with the following objective: ˆEχi[log D!i+1(s, a)] −λ1LI(⇡✓i, Q i+1) −λ2H(⇡✓i) end for 3.2 Reward Augmentation In complex and less well-specified environments, imitation learning methods have the potential to perform better than reinforcement learning methods as they do not require manual specification of an appropriate reward function. However, if the expert is performing sub-optimally, then any policy trained under the recovered rewards will be also suboptimal; in other words, the imitation learning agent’s potential is bounded by the capabilities of the expert that produced the training data. In many cases, while it is very difficult to fully specify a suitable reward function for a given task, it is relatively straightforward to come up with constraints that we would like to enforce over the policy. This motivates the introduction of reward augmentation [8], a general framework to incorporate prior knowledge in imitation learning by providing additional incentives to the agent without interfering 3[14] presents a proof for the lower bound. 4 with the imitation learning process. We achieve this by specifying a surrogate state-based reward ⌘(⇡✓) = Es⇠⇡✓[r(s)] that reflects our bias over the desired agent’s behavior: min ✓, max ! E⇡✓[log D!(s, a)]+E⇡E[log(1−D!(s, a))]−λ0⌘(⇡✓)−λ1LI(⇡✓, Q )−λ2H(⇡✓) (4) where λ0 > 0 is a hyperparameter. This approach can be seen as a hybrid between imitation and reinforcement learning, where part of the reinforcement signal for the policy optimization is coming from the surrogate reward and part from the discriminator, i.e., from mimicking the expert. For example, in our autonomous driving experiment below we show that by providing the agent with a penalty if it collides with other cars or drives off the road, we are able to significantly improve the average rollout distance of the learned policy. 3.3 Improved Optimization While GAIL is successful in tasks with low-dimensional inputs (in [12], the largest observation has 376 continuous variables), few have explored tasks where the input dimension is very high (such as images - 110 ⇥200 ⇥3 pixels as in our driving experiments). In order to effectively learn a policy that relies solely on high-dimensional input, we make the following improvements over the original GAIL framework. It is well known that the traditional GAN objective suffers from vanishing gradient and mode collapse problems [24, 25]. We propose to use the Wasserstein GAN (WGAN [26]) technique to alleviate these problems and augment our objective function as follows: min ✓, max ! E⇡✓[D!(s, a)] −E⇡E[D!(s, a)] −λ0⌘(⇡✓) −λ1LI(⇡✓, Q ) −λ2H(⇡✓) (5) We note that this modification is especially important in our setting, where we want to model complex distributions over trajectories that can potentially have a large number of modes. We also use several variance reduction techniques, including baselines [27] and replay buffers [28]. Besides the baseline, we have three models to update in the InfoGAIL framework, which are represented as neural networks: the discriminator network D!(s, a), the policy network ⇡✓(a|s, c), and the posterior estimation network Q (c|s, a). We update D! using RMSprop (as suggested in the original WGAN paper), and update Q and ⇡✓using Adam and TRPO respectively. We include the detailed training procedure in Appendix C. To speed up training, we initialize our policy from behavior cloning, as in [12]. Note that the discriminator network D! and the posterior approximation network Q are treated as distinct networks, as opposed to the InfoGAN approach where they share the same network parameters until the final output layer. This is because the current WGAN training framework requires weight clipping and momentum-free optimization methods when training D!. These changes would interfere with the training of an expressive Q if D! and Q share the same network parameters. 4 Experiments We demonstrate the performance of our method by applying it first to a synthetic 2D example and then in a challenging driving domain where the agent is imitating driving behaviors from visual inputs. By conducting experiments on these two environments, we show that our learned policy ⇡✓ can 1) imitate expert behaviors using high-dimensional inputs with only a small number of expert demonstrations, 2) cluster expert behaviors into different and semantically meaningful categories, and 3) reproduce different categories of behaviors by setting the high-level latent variables appropriately. The driving experiments are conducted in the TORCS (The Open Source Racing Car Simulator, [15]) environment. The demonstrations are collected by manually driving along the race track, and show typical behaviors like staying within lanes, avoiding collisions and surpassing other cars. The policy accepts raw visual inputs as the only external inputs for the state, and produces a three-dimensional continuous action that consists of steering, acceleration, and braking. We assume that our policies are Gaussian distributions with fixed standard deviations, thus H(⇡) is constant. 5 (a) Expert (b) Behavior cloning (c) GAIL (d) Ours Figure 1: Learned trajectories in the synthetic 2D plane environment. Each color denotes one specific latent code. Behavior cloning deviates from the expert demonstrations due to compounding errors. GAIL does produce circular trajectories but fails to capture the latent structure for it assumes that the demonstrations are generated from a single expert, and tries to learn an average policy. Our method (InfoGAIL) successfully distinguishes expert behaviors and imitates each mode accordingly (colors are ordered in accordance to the expert for visualization purposes, but are not identifiable). 4.1 Learning to Distinguish Trajectories We demonstrate the effectiveness of InfoGAIL on a synthetic example. The environment is a 2D plane where the agent can move around freely at a constant velocity by selecting its direction pt at (discrete) time t. For the agent, the observations at time t are positions from t−4 to t. The (unlabeled) expert demonstrations contain three distinct modes, each generated with a stochastic expert policy that produces a circle-like trajectory (see Figure 1, panel a). The objective is to distinguish these three distinct modes and imitate the corresponding expert behavior. We consider three methods: behavior cloning, GAIL and InfoGAIL (details included in Appendix A). In particular, for all the experiments we assume the same architecture and that the latent code is a one-hot encoded vector with 3 dimensions and a uniform prior; only InfoGAIL regularizes the latent code. Figure 1 shows that the introduction of latent variables allows InfoGAIL to distinguish the three types of behavior and imitate each behavior successfully; the other two methods, however, fail to distinguish distinct modes. BC suffers from the compounding error problem and the learned policy tends to deviate from the expert trajectories; GAIL does learn to generate circular trajectories but it fails to separate different modes due to the lack of a mechanism that can explicitly account for the underlying structure. In the rest of Section 4, we show how InfoGAIL can infer the latent structure of human decisionmaking in a driving domain. In particular, our agent only relies on visual inputs to sense the environment. 4.2 Utilizing Raw Visual Inputs via Transfer Learning The high dimensional nature of visual inputs poses a significant challenges to learning a policy. Intuitively, the policy will have to simultaneously learn how to identify meaningful visual features, and how to leverage them to achieve the desired behavior using only a small number of expert demonstrations. Therefore, methods to mitigate the high sample complexity of the problem are crucial to success in this domain. In this paper, we take a transfer learning approach. Features extracted using a CNN pre-trained on ImageNet contain high-level information about the input images, which can be adapted to new vision tasks via transfer learning [29]. However, it is not yet clear whether these relatively high-level features can be directly applied to tasks where perception and action are tightly interconnected; we demonstrate that this is possible through our experiments. We perform transfer learning by exploiting features from a pre-trained neural network that effectively convert raw images into relatively highlevel information [30]. In particular, we use a Deep Residual Network [31] pre-trained on the ImageNet classification task [32] to obtain the visual features used as inputs for the policy network. 4.3 Network Structure Our policy accepts certain auxiliary information as internal input to serve as a short-term memory. This auxiliary information can be accessed along with the raw visual inputs. In our experiments, the auxiliary information for the policy at time t consists of the following: 1) velocity at time t, which is a three dimensional vector; 2) actions at time t −1 and t −2, which are both three dimensional vectors; 3) damage of the car, which is a real value. The auxiliary input has 10 dimensions in total. 6 Figure 2: Visualizing the training process of turn. Here we show the trajectories of InfoGAIL at different stages of training. Blue and red indicate policies under different latent codes, which correspond to “turning from inner lane” and “turning from outer lane” respectively. The rightmost figure shows the trajectories under latent codes [1, 0] (red), [0, 1] (blue), and [0.5, 0.5] (purple), which suggests that, to some extent, our method is able to generalize to cases previously unseen in the training data. For the policy network, input visual features are passed through two convolutional layers, and then combined with the auxiliary information vector and (in the case of InfoGAIL) the latent code c. We parameterize the baseline as a network with the same architecture except for the final layer, which is just a scalar output that indicates the expected accumulated future rewards. The discriminator D! accepts three elements as input: the input image, the auxiliary information, and the current action. The output is a score for the WGAN training objective, which is supposed to be lower for expert state-action pairs, and higher for generated ones. The posterior approximation network Q adopts the same architecture as the discriminator, except that the output is a softmax over the discrete latent variables or a factored Gaussian over continuous latent variables. We include details of our architecture in Appendix B. 4.4 Interpretable Imitation Learning from Visual Demonstrations In this experiment, we consider two subsets of human driving behaviors: turn, where the expert takes a turn using either the inside lane or the outside lane; and pass, where the expert passes another vehicle from either the left or the right. In both cases, the expert policy has two significant modes. Our goal is to have InfoGAIL capture these two separate modes from expert demonstrations in an unsupervised way. We use a discrete latent code, which is a one-hot encoded vector with two possible states. For both settings, there are 80 expert trajectories in total, with 100 frames in each trajectory; our prior for the latent code is a uniform discrete distribution over the two states. The performance of a learned policy is quantified with two metrics: the average distance is determined by the distance traveled by the agent before a collision (and is bounded by the length of the simulation horizon), and accuracy is defined as the classification accuracy of the expert state-action pairs according to the latent code inferred with Q . We add constant reward at every time step as reward augmentation, which is used to encourage the car to "stay alive" as long as possible and can be regarded as another way of reducing collision and off-lane driving (as these will lead to the termination of that episode). The average distance and sampled trajectories at different stages of training are shown in Figures 2 and 3 for turn and pass respectively. During the initial stages of training, the model does not distinguish the two modes and has a high chance of colliding and driving off-lane, due to the limitations of behavior cloning (which we used to initialize the policy). As training progresses, trajectories provided by the learned policy begin to diverge. Towards the end of training, the two types of trajectories are clearly distinguishable, with only a few exceptions. In turn, [0, 1] corresponds to using the inside lane, while [1, 0] corresponds to the outside lane. In pass, the two kinds of latent codes correspond to passing from right and left respectively. Meanwhile, the average distance of the rollouts steadily increases with more training. Learning the two modes separately requires accurate inference of the latent code. To examine the accuracy of posterior inference, we select state-action pairs from the expert trajectories (where the state is represented as a concatenation of raw image and auxiliary variables) and obtain the corresponding latent code through Q (c|s, a); see Table 1. Although we did not explicitly provide any label, our model is able to correctly distinguish over 81% of the state-action pairs in pass (and almost all the pairs in turn, confirming the clear separation between generated trajectories with different latent codes in Figure 2). 7 Figure 3: Experimental results for pass. Left: Trajectories of InfoGAIL at different stages of training (epoch 1 to 37). Blue and red indicate policies using different latent code values, which correspond to passing from right or left. Middle: Traveled distance denotes the absolute distance from the start position, averaged over 60 rollouts of the InfoGAIL policy trained at different epochs. Right: Trajectories of pass produced by an agent trained on the original GAIL objective. Compared to InfoGAIL, GAIL fails to distinguish between different modes. Table 1: Classification accuracies for pass. Method Accuracy Chance 50% K-means 55.4% PCA 61.7% InfoGAIL (Ours) 81.9% SVM 85.8% CNN 90.8% Table 2: Average rollout distances. Method Avg. rollout distance Behavior Cloning 701.83 GAIL 914.45 InfoGAIL \ RB 1031.13 InfoGAIL \ RA 1123.89 InfoGAIL \ WGAN 1177.72 InfoGAIL (Ours) 1226.68 Human 1203.51 For comparison, we also visualize the trajectories of pass for the original GAIL objective in Figure 3, where there is no mutual information regularization. GAIL learns the expert trajectories as a whole, and cannot distinguish the two modes in the expert policy. Interestingly, instead of learning two separate trajectories, GAIL tries to fit the left trajectory by swinging the car suddenly to the left after it has surpassed the other car from the right. We believe this reflects a limitation in the discriminators. Since D!(s, a) only requires state-action pairs as input, the policy is only required to match most of the state-action pairs; matching each rollout in a whole with expert trajectories is not necessary. InfoGAIL with discrete latent codes can alleviate this problem by forcing the model to learn separate trajectories. 4.5 Ablation Experiments We conduct a series of ablation experiments to demonstrate that our proposed improved optimization techniques in Section 3.2 and 3.3 are indeed crucial for learning an effective policy. Our policy drives a car on the race track along with other cars, whereas the human expert provides 20 trajectories with 500 frames each by trying to drive as fast as possible without collision. Reward augmentation is performed by adding a reward that encourages the car to drive faster. The performance of the policy is determined by the average distance. Here a longer average rollout distance indicates a better policy. In our ablation experiments, we selectively remove some of the improved optimization methods from Section 3.2 and 3.3 (we do not use any latent code in these experiments). InfoGAIL(Ours) includes all the optimization techniques; GAIL excludes all the techniques; InfoGAIL\WGAN switches the WGAN objective with the GAN objective; InfoGAIL\RA removes reward augmentation; InfoGAIL\RB removes the replay buffer and only samples from the most recent rollouts; Behavior Cloning is the behavior cloning method and Human is the expert policy. Table 2 shows the average rollout distances of different policies. Our method is able to outperform the expert with the help of reward augmentation; policies without reward augmentation or WGANs perform slightly worse than the expert; removing the replay buffer causes the performance to deteriorate significantly due to increased variance in gradient estimation. 8 5 Related work There are two major paradigms for vision-based driving systems [33]. Mediated perception is a two-step approach that first obtains scene information and then makes a driving decision [34–36]; behavior reflex, on the other hand, adopts a direct approach by mapping visual inputs to driving actions [37, 16]. Many of the current autonomous driving methods rely on the two-step approach, which requires hand-crafting features such as the detection of lane markings and cars [38, 33]. Our approach, on the other hand, attempts to learn these features directly from vision to actions. While mediated perception approaches are currently more prevalent, we believe that end-to-end learning methods are more scalable and may lead to better performance in the long run. [39] introduce an end-to-end imitation learning framework that learns to drive entirely from visual information, and test their approach on real-world scenarios. However, their method uses behavior cloning by performing supervised learning over the state-action pairs, which is well-known to generalize poorly to more sophisticated tasks, such as changing lanes or passing vehicles. With the use of GAIL, our method can learn to perform these sophisticated operations easily. [40] performs end-to-end visual imitation learning in TORCS through DAgger [18], querying the reference policies during training, which in many cases is difficult. Most imitation learning methods for end-to-end driving rely heavily on LIDAR-like inputs to obtain precise distance measurements [21, 41]. These inputs are not usually available to humans during driving. In particular, [41] applies GAIL to the task of modeling human driving behavior on highways. In contrast, our policy requires only raw visual information as external input, which in practice is all the information humans need in order to drive. [42] and [9] have also introduced a pre-trained deep neural network to achieve better performance in imitation learning with relatively few demonstrations. Specifically, they introduce a pre-trained model to learn dense, incremental reward functions that are suitable for performing downstream reinforcement learning tasks, such as real-world robotic experiments. This is different from our approach, in that transfer learning is performed over the critic instead of the policy. It would be interesting to combine that reward with our approach through reward augmentation. 6 Conclusion In this paper, we present a method to imitate complex behaviors while identifying salient latent factors of variation in the demonstrations. Discovering these latent factors does not require direct supervision beyond expert demonstrations, and the whole process can be trained directly with standard policy optimization algorithms. We also introduce several techniques to successfully perform imitation learning using visual inputs, including transfer learning and reward augmentation. Our experimental results in the TORCS simulator show that our methods can automatically distinguish certain behaviors in human driving, while learning a policy that can imitate and even outperform the human experts using visual information as the sole external input. We hope that our work can further inspire end-to-end learning approaches to autonomous driving under more realistic scenarios. Acknowledgements We thank Shengjia Zhao and Neal Jean for their assistance and advice. Toyota Research Institute (TRI) 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. This research was also supported by Intel Corporation, FLI and NSF grants 1651565, 1522054, 1733686. References [1] S. Levine and V. Koltun, “Guided policy search.,” in ICML (3), pp. 1–9, 2013. [2] J. Schulman, S. Levine, P. Abbeel, M. I. Jordan, and P. Moritz, “Trust region policy optimization.,” in ICML, pp. 1889–1897, 2015. [3] T. P. Lillicrap, J. J. Hunt, A. Pritzel, N. Heess, T. Erez, Y. Tassa, D. Silver, and D. Wierstra, “Continuous control with deep reinforcement learning,” arXiv preprint arXiv:1509.02971, 2015. 9 [4] J. Schulman, P. Moritz, S. Levine, M. Jordan, and P. Abbeel, “High-dimensional continuous control using generalized advantage estimation,” arXiv preprint arXiv:1506.02438, 2015. [5] D. Silver, A. Huang, C. J. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, et al., “Mastering the game of go with deep neural networks and tree search,” Nature, vol. 529, no. 7587, pp. 484–489, 2016. [6] A. Tamar, S. Levine, P. Abbeel, Y. WU, and G. Thomas, “Value iteration networks,” in Advances in Neural Information Processing Systems, pp. 2146–2154, 2016. [7] B. D. Ziebart, A. L. Maas, J. A. Bagnell, and A. K. Dey, “Maximum entropy inverse reinforcement learning.,” in AAAI, vol. 8, pp. 1433–1438, Chicago, IL, USA, 2008. [8] P. Englert and M. Toussaint, “Inverse kkt–learning cost functions of manipulation tasks from demonstrations,” in Proceedings of the International Symposium of Robotics Research, 2015. [9] C. Finn, S. Levine, and P. Abbeel, “Guided cost learning: Deep inverse optimal control via policy optimization,” in Proceedings of the 33rd International Conference on Machine Learning, vol. 48, 2016. [10] B. Stadie, P. Abbeel, and I. Sutskever, “Third person imitation learning,” in ICLR, 2017. [11] S. Ermon, Y. Xue, R. Toth, B. N. Dilkina, R. Bernstein, T. Damoulas, P. Clark, S. DeGloria, A. Mude, C. Barrett, et al., “Learning large-scale dynamic discrete choice models of spatiotemporal preferences with application to migratory pastoralism in east africa.,” in AAAI, pp. 644– 650, 2015. [12] J. Ho and S. Ermon, “Generative adversarial imitation learning,” in Advances in Neural Information Processing Systems, pp. 4565–4573, 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 Advances in neural information processing systems, pp. 2672–2680, 2014. [14] X. Chen, Y. Duan, R. Houthooft, J. Schulman, I. Sutskever, and P. Abbeel, “Infogan: Interpretable representation learning by information maximizing generative adversarial nets,” in Advances in Neural Information Processing Systems, pp. 2172–2180, 2016. [15] B. Wymann, E. Espié, C. Guionneau, C. Dimitrakakis, R. Coulom, and A. Sumner, “Torcs, the open racing car simulator,” Software available at http://torcs. sourceforge. net, 2000. [16] D. A. Pomerleau, “Efficient training of artificial neural networks for autonomous navigation,” Neural Computation, vol. 3, no. 1, pp. 88–97, 1991. [17] S. Ross and D. Bagnell, “Efficient reductions for imitation learning.,” in AISTATS, pp. 3–5, 2010. [18] S. Ross, G. J. Gordon, and D. Bagnell, “A reduction of imitation learning and structured prediction to no-regret online learning.,” in AISTATS, p. 6, 2011. [19] P. Abbeel and A. Y. Ng, “Apprenticeship learning via inverse reinforcement learning,” in Proceedings of the twenty-first international conference on Machine learning, p. 1, ACM, 2004. [20] U. Syed, M. Bowling, and R. E. Schapire, “Apprenticeship learning using linear programming,” in Proceedings of the 25th international conference on Machine learning, pp. 1032–1039, ACM, 2008. [21] J. Ho, J. K. Gupta, and S. Ermon, “Model-free imitation learning with policy optimization,” in Proceedings of the 33rd International Conference on Machine Learning, 2016. [22] M. Bloem and N. Bambos, “Infinite time horizon maximum causal entropy inverse reinforcement learning,” in Decision and Control (CDC), 2014 IEEE 53rd Annual Conference on, pp. 4911– 4916, IEEE, 2014. 10 [23] D. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. [24] 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. 2234– 2242, 2016. [25] S. Arora, R. Ge, Y. Liang, T. Ma, and Y. Zhang, “Generalization and equilibrium in generative adversarial nets (gans),” arXiv preprint arXiv:1703.00573, 2017. [26] M. Arjovsky, S. Chintala, and L. Bottou, “Wasserstein gan,” arXiv preprint arXiv:1701.07875, 2017. [27] R. J. Williams, “Simple statistical gradient-following algorithms for connectionist reinforcement learning,” Machine learning, vol. 8, no. 3-4, pp. 229–256, 1992. [28] 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, vol. 518, no. 7540, pp. 529–533, 2015. [29] J. Yosinski, J. Clune, Y. Bengio, and H. Lipson, “How transferable are features in deep neural networks?,” in Advances in neural information processing systems, pp. 3320–3328, 2014. [30] A. Sharif Razavian, H. Azizpour, J. Sullivan, and S. Carlsson, “Cnn features off-the-shelf: an astounding baseline for recognition,” in Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 806–813, 2014. [31] 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. [32] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al., “Imagenet large scale visual recognition challenge,” International Journal of Computer Vision, vol. 115, no. 3, pp. 211–252, 2015. [33] C. Chen, A. Seff, A. Kornhauser, and J. Xiao, “Deepdriving: Learning affordance for direct perception in autonomous driving,” in Proceedings of the IEEE International Conference on Computer Vision, pp. 2722–2730, 2015. [34] M. Aly, “Real time detection of lane markers in urban streets,” in Intelligent Vehicles Symposium, 2008 IEEE, pp. 7–12, IEEE, 2008. [35] P. Lenz, J. Ziegler, A. Geiger, and M. Roser, “Sparse scene flow segmentation for moving object detection in urban environments,” in Intelligent Vehicles Symposium (IV), 2011 IEEE, pp. 926–932, IEEE, 2011. [36] K. Kitani, B. Ziebart, J. Bagnell, and M. Hebert, “Activity forecasting,” Computer Vision–ECCV 2012, pp. 201–214, 2012. [37] D. A. Pomerleau, “Alvinn, an autonomous land vehicle in a neural network,” tech. rep., Carnegie Mellon University, Computer Science Department, 1989. [38] A. Geiger, P. Lenz, C. Stiller, and R. Urtasun, “Vision meets robotics: The kitti dataset,” The International Journal of Robotics Research, vol. 32, no. 11, pp. 1231–1237, 2013. [39] M. Bojarski, D. Del Testa, D. Dworakowski, B. Firner, B. Flepp, P. Goyal, L. D. Jackel, M. Monfort, U. Muller, J. Zhang, et al., “End to end learning for self-driving cars,” arXiv preprint arXiv:1604.07316, 2016. [40] J. Zhang and K. Cho, “Query-efficient imitation learning for end-to-end autonomous driving,” arXiv preprint arXiv:1605.06450, 2016. [41] A. Kuefler, J. Morton, T. Wheeler, and M. Kochenderfer, “Imitating driver behavior with generative adversarial networks,” arXiv preprint arXiv:1701.06699, 2017. [42] P. Sermanet, K. Xu, and S. Levine, “Unsupervised perceptual rewards for imitation learning,” arXiv preprint arXiv:1612.06699, 2016. 11
2017
118
6,584
A Regularized Framework for Sparse and Structured Neural Attention Vlad Niculae∗ Cornell University Ithaca, NY vlad@cs.cornell.edu Mathieu Blondel NTT Communication Science Laboratories Kyoto, Japan mathieu@mblondel.org Abstract Modern neural networks are often augmented with an attention mechanism, which tells the network where to focus within the input. We propose in this paper a new framework for sparse and structured attention, building upon a smoothed max operator. We show that the gradient of this operator defines a mapping from real values to probabilities, suitable as an attention mechanism. Our framework includes softmax and a slight generalization of the recently-proposed sparsemax as special cases. However, we also show how our framework can incorporate modern structured penalties, resulting in more interpretable attention mechanisms, that focus on entire segments or groups of an input. We derive efficient algorithms to compute the forward and backward passes of our attention mechanisms, enabling their use in a neural network trained with backpropagation. To showcase their potential as a drop-in replacement for existing ones, we evaluate our attention mechanisms on three large-scale tasks: textual entailment, machine translation, and sentence summarization. Our attention mechanisms improve interpretability without sacrificing performance; notably, on textual entailment and summarization, we outperform the standard attention mechanisms based on softmax and sparsemax. 1 Introduction Modern neural network architectures are commonly augmented with an attention mechanism, which tells the network where to look within the input in order to make the next prediction. Attentionaugmented architectures have been successfully applied to machine translation [2, 29], speech recognition [10], image caption generation [44], textual entailment [38, 31], and sentence summarization [39], to name but a few examples. At the heart of attention mechanisms is a mapping function that converts real values to probabilities, encoding the relative importance of elements in the input. For the case of sequence-to-sequence prediction, at each time step of generating the output sequence, attention probabilities are produced, conditioned on the current state of a decoder network. They are then used to aggregate an input representation (a variable-length list of vectors) into a single vector, which is relevant for the current time step. That vector is finally fed into the decoder network to produce the next element in the output sequence. This process is repeated until the end-of-sequence symbol is generated. Importantly, such architectures can be trained end-to-end using backpropagation. Alongside empirical successes, neural attention—while not necessarily correlated with human attention—is increasingly crucial in bringing more interpretability to neural networks by helping explain how individual input elements contribute to the model’s decisions. However, the most commonly used attention mechanism, softmax, yields dense attention weights: all elements in the input always make at least a small contribution to the decision. To overcome this limitation, sparsemax was recently proposed [31], using the Euclidean projection onto the simplex as a sparse alternative to ∗Work performed during an internship at NTT Commmunication Science Laboratories, Kyoto, Japan. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. russian defense minister ivanov called sundayfor the creationof a joint frontfor combating global terrorism . russian defense minister calls for joint front against terrorism <EOS> fusedmax russian defense minister ivanov called sundayfor the creationof a joint frontfor combating global terrorism . softmax russian defense minister ivanov called sundayfor the creationof a joint frontfor combating global terrorism . sparsemax Figure 1: Attention weights produced by the proposed fusedmax, compared to softmax and sparsemax, on sentence summarization. The input sentence to be summarized (taken from [39]) is along the x-axis. From top to bottom, each row shows where the attention is distributed when producing each word in the summary. All rows sum to 1, the grey background corresponds to exactly 0 (never achieved by softmax), and adjacent positions with exactly equal weight are not separated by borders. Fusedmax pays attention to contiguous segments of text with equal weight; such segments never occur with softmax and sparsemax. In addition to enhancing interpretability, we show in §4.3 that fusedmax outperforms both softmax and sparsemax on this task in terms of ROUGE scores. softmax. Compared to softmax, sparsemax outputs more interpretable attention weights, as illustrated in [31] on the task of textual entailment. The principle of parsimony, which states that simple explanations should be preferred over complex ones, is not, however, limited to sparsity: it remains open whether new attention mechanisms can be designed to benefit from more structural prior knowledge. Our contributions. The success of sparsemax motivates us to explore new attention mechanisms that can both output sparse weights and take advantage of structural properties of the input through the use of modern sparsity-inducing penalties. To do so, we make the following contributions: 1) We propose a new general framework that builds upon a max operator, regularized with a strongly convex function. We show that this operator is differentiable, and that its gradient defines a mapping from real values to probabilities, suitable as an attention mechanism. Our framework includes as special cases both softmax and a slight generalization of sparsemax. (§2) 2) We show how to incorporate the fused lasso [42] in this framework, to derive a new attention mechanism, named fusedmax, which encourages the network to pay attention to contiguous segments of text when making a decision. This idea is illustrated in Figure 1 on sentence summarization. For cases when the contiguity assumption is too strict, we show how to incorporate an OSCAR penalty [7] to derive a new attention mechanism, named oscarmax, that encourages the network to pay equal attention to possibly non-contiguous groups of words. (§3) 3) In order to use attention mechanisms defined under our framework in an autodiff toolkit, two problems must be addressed: evaluating the attention itself and computing its Jacobian. However, our attention mechanisms require solving a convex optimization problem and do not generally enjoy a simple analytical expression, unlike softmax. Computing the Jacobian of the solution of an optimization problem is called argmin/argmax differentiation and is currently an area of active research (cf. [1] and references therein). One of our key algorithmic contributions is to show how to compute this Jacobian under our general framework, as well as for fused lasso and OSCAR. (§3) 4) To showcase the potential of our new attention mechanisms as a drop-in replacement for existing ones, we show empirically that our new attention mechanisms enhance interpretability while achieving comparable or better accuracy on three diverse and challenging tasks: textual entailment, machine translation, and sentence summarization. (§4) Notation. We denote the set {1, . . . , d} by [d]. We denote the (d −1)-dimensional probability simplex by ∆d := {x ∈Rd : ∥x∥1 = 1, x ≥0} and the Euclidean projection onto it by P∆d(x) := arg miny∈∆d ∥y −x∥2. Given a function f : Rd →R ∪{∞}, its convex conjugate is defined by f ∗(x) := supy∈dom f yTx−f(y). Given a norm ∥·∥, its dual is defined by ∥x∥∗:= sup∥y∥≤1 yTx. We denote the subdifferential of a function f at y by ∂f(y). Elements of the subdifferential are called subgradients and when f is differentiable, ∂f(y) contains a single element, the gradient of f at y, denoted by ∇f(y). We denote the Jacobian of a function g: Rd →Rd at y by Jg(y) ∈Rd×d and the Hessian of a function f : Rd →R at y by Hf(y) ∈Rd×d. 2 4 2 0 2 4 t 0 1 2 3 4 max ([t,0])+ const max softmax sparsemax sq-pnorm-max fusedmax 4 2 0 2 4 t 0.00 0.25 0.50 0.75 1.00 ([t,0])1 = max ([t,0])1 Figure 2: The proposed maxΩ(x) operator up to a constant (left) and the proposed ΠΩ(x) mapping (right), illustrated with x = [t, 0] and γ = 1. In this case, maxΩ(x) is a ReLu-like function and ΠΩ(x) is a sigmoid-like function. Our framework recovers softmax (negative entropy) and sparsemax (squared 2-norm) as special cases. We also introduce three new attention mechanisms: sq-pnorm-max (squared p-norm, here illustrated with p = 1.5), fusedmax (squared 2-norm + fused lasso), and oscarmax (squared 2-norm + OSCAR; not pictured since it is equivalent to fusedmax in 2-d). Except for softmax, which never exactly reaches 0, all mappings shown on the right encourage sparse outputs. 2 Proposed regularized attention framework 2.1 The max operator and its subgradient mapping To motivate our proposal, we first show in this section that the subgradients of the maximum operator define a mapping from Rd to ∆d, but that this mapping is highly unsuitable as an attention mechanism. The maximum operator is a function from Rd to R and can be defined by max(x) := max i∈[d] xi = sup y∈∆d yTx. The equality on the r.h.s comes from the fact that the supremum of a linear form over the simplex is always achieved at one of the vertices, i.e., one of the standard basis vectors {ei}d i=1. Moreover, it is not hard to check that any solution y⋆of that supremum is precisely a subgradient of max(x): ∂max(x) = {ei⋆: i⋆∈arg maxi∈[d] xi}. We can see these subgradients as a mapping Π: Rd → ∆d that puts all the probability mass onto a single element: Π(x) = ei for any ei ∈∂max(x). However, this behavior is undesirable, as the resulting mapping is a discontinuous function (a Heaviside step function when x = [t, 0]), which is not amenable to optimization by gradient descent. 2.2 A regularized max operator and its gradient mapping These shortcomings encourage us to consider a regularization of the maximum operator. Inspired by the seminal work of Nesterov [35], we apply a smoothing technique. The conjugate of max(x) is max∗(y) = 0, if y ∈∆d ∞, o.w. . For a proof, see for instance [33, Appendix B]. We now add regularization to the conjugate max∗ Ω(y) := γΩ(y), if y ∈∆d ∞, o.w. , where we assume that Ω: Rd →R is β-strongly convex w.r.t. some norm ∥· ∥and γ > 0 controls the regularization strength. To define a smoothed max operator, we take the conjugate once again maxΩ(x) = max∗∗ Ω(x) = sup y∈Rd yTx −max∗ Ω(y) = sup y∈∆d yTx −γΩ(y). (1) Our main proposal is a mapping ΠΩ: Rd →∆d, defined as the argument that achieves this supremum. ΠΩ(x) := arg max y∈∆d yTx −γΩ(y) = ∇maxΩ(x) The r.h.s. holds by combining that i) maxΩ(x) = (y⋆)Tx −max∗ Ω(y⋆) ⇔y⋆∈∂maxΩ(x) and ii) ∂maxΩ(x) = {∇maxΩ(x)}, since (1) has a unique solution. Therefore, ΠΩis a gradient mapping. We illustrate maxΩand ΠΩfor various choices of Ωin Figure 2 (2-d) and in Appendix C.1 (3-d). 3 Importance of strong convexity. Our β-strong convexity assumption on Ωplays a crucial role and should not be underestimated. Recall that a function f : Rd →R is β-strongly convex w.r.t. a norm ∥· ∥if and only if its conjugate f ∗is 1 β -smooth w.r.t. the dual norm ∥· ∥∗[46, Corollary 3.5.11] [22, Theorem 3]. This is sufficient to ensure that maxΩis 1 γβ -smooth, or, in other words, that it is differentiable everywhere and its gradient, ΠΩ, is 1 γβ -Lipschitz continuous w.r.t. ∥· ∥∗. Training by backpropagation. In order to use ΠΩin a neural network trained by backpropagation, two problems must be addressed for any regularizer Ω. The first is the forward computation: how to evaluate ΠΩ(x), i.e., how to solve the optimization problem in (1). The second is the backward computation: how to evaluate the Jacobian of ΠΩ(x), or, equivalently, the Hessian of maxΩ(x). One of our key contributions, presented in §3, is to show how to solve these two problems for general differentiable Ω, as well as for two structured regularizers: fused lasso and OSCAR. 2.3 Recovering softmax and sparsemax as special cases Before deriving new attention mechanisms using our framework, we now show how we can recover softmax and sparsemax, using a specific regularizer Ω. Softmax. We choose Ω(y) = Pd i=1 yi log yi, the negative entropy. The conjugate of the negative entropy restricted to the simplex is the log sum exp [9, Example 3.25]. Moreover, if f(x) = γg(x) for γ > 0, then f ∗(y) = γg∗(y/γ). We therefore get a closed-form expression: maxΩ(x) = γ log sum exp(x/γ) := γ log Pd i=1 exi/γ. Since the negative entropy is 1-strongly convex w.r.t. ∥· ∥1 over ∆d, we get that maxΩis 1 γ -smooth w.r.t. ∥· ∥∞. We obtain the classical softmax, with temperature parameter γ, by taking the gradient of maxΩ(x), ΠΩ(x) = ex/γ Pd i=1 exi/γ , (softmax) where ex/γ is evaluated element-wise. Note that some authors also call maxΩa “soft max.” Although ΠΩis really a soft arg max, we opt to follow the more popular terminology. When x = [t, 0], it can be checked that maxΩ(x) reduces to the softplus [16] and ΠΩ(x)1 to a sigmoid. Sparsemax. We choose Ω(y) = 1 2∥y∥2 2, also known as Moreau-Yosida regularization in proximal operator theory [35, 36]. Since 1 2∥y∥2 2 is 1-strongly convex w.r.t. ∥·∥2, we get that maxΩis 1 γ -smooth w.r.t. ∥· ∥2. In addition, it is easy to verify that ΠΩ(x) = P∆d(x/γ) = arg min y∈∆d ∥y −x/γ∥2. (sparsemax) This mapping was introduced as is in [31] with γ = 1 and was named sparsemax, due to the fact that it is a sparse alternative to softmax. Our derivation thus gives us a slight generalization, where γ controls the sparsity (the smaller, the sparser) and could be tuned; in our experiments, however, we follow the literature and set γ = 1. The Euclidean projection onto the simplex, P∆d, can be computed exactly [34, 15] (we discuss the complexity in Appendix B). Following [31], the Jacobian of ΠΩis JΠΩ(x) = 1 γ JP∆d (x/γ) = 1 γ diag(s) −ssT/∥s∥1  , where s ∈{0, 1}d indicates the nonzero elements of ΠΩ(x). Since ΠΩis Lipschitz continuous, Rademacher’s theorem implies that ΠΩis differentiable almost everywhere. For points where ΠΩis not differentiable (where maxΩis not twice differentiable), we can take an arbitrary matrix in the set of Clarke’s generalized Jacobians [11], the convex hull of Jacobians of the form lim xt→x JΠΩ(xt) [31]. 3 Deriving new sparse and structured attention mechanisms 3.1 Differentiable regularizer Ω Before tackling more structured regularizers, we address in this section the case of general differentiable regularizer Ω. Because ΠΩ(x) involves maximizing (1), a concave function over the simplex, it can be computed globally using any off-the-shelf projected gradient solver. Therefore, the main challenge is how to compute the Jacobian of ΠΩ. This is what we address in the next proposition. 4 Proposition 1 Jacobian of ΠΩfor any differentiable Ω(backward computation) Assume that Ωis differentiable over ∆d and that ΠΩ(x) = arg maxy∈∆d yTx −γΩ(y) = y⋆has been computed. Then the Jacobian of ΠΩat x, denoted JΠΩ, can be obtained by solving the system (I + A(B −I)) JΠΩ= A, where we defined the shorthands A := JP∆d (y⋆−γ∇Ω(y⋆) + x) and B := γHΩ(y⋆). The proof is given in Appendix A.1. Unlike recent work tackling argmin differentiation through matrix differential calculus on the Karush–Kuhn–Tucker (KKT) conditions [1], our proof technique relies on differentiating the fixed point iteration y∗= P∆d(y⋆−∇f(y⋆)). To compute JΠΩv for an arbitrary v ∈Rd, as required by backpropagation, we may directly solve (I + A(B −I)) (JΠΩv) = Av. We show in Appendix B how this system can be solved efficiently thanks to the structure of A. Squared p-norms. As a useful example of a differentiable function over the simplex, we consider squared p-norms: Ω(y) = 1 2∥y∥2 p = Pd i=1 yp i 2/p , where y ∈∆d and p ∈(1, 2]. For this choice of p, it is known that the squared p-norm is strongly convex w.r.t. ∥· ∥p [3]. This implies that maxΩis 1 γ(p−1) smooth w.r.t. ∥.∥q, where 1 p + 1 q = 1. We call the induced mapping function sq-pnorm-max: ΠΩ(x) = arg min y∈∆d γ 2 ∥y∥2 p −yTx. (sq-pnorm-max) The gradient and Hessian needed for Proposition 1 can be computed by ∇Ω(y) = yp−1 ∥y∥p−2 p and HΩ(y) = diag(d) + uuT, where d = (p −1) ∥y∥p−2 p yp−2 and u = s (2 −p) ∥y∥2p−2 p yp−1, with the exponentiation performed element-wise. sq-pnorm-max recovers sparsemax with p = 2 and, like sparsemax, encourages sparse outputs. However, as can be seen in the zoomed box in Figure 2 (right), the transition between y⋆= [0, 1] and y⋆= [1, 0] can be smoother when 1 < p < 2. Throughout our experiments, we use p = 1.5. 3.2 Structured regularizers: fused lasso and OSCAR Fusedmax. For cases when the input is sequential and the order is meaningful, as is the case for many natural languages, we propose fusedmax, an attention mechanism based on fused lasso [42], also known as 1-d total variation (TV). Fusedmax encourages paying attention to contiguous segments, with equal weights within each one. It is expressed under our framework by choosing Ω(y) = 1 2∥y∥2 2 +λ Pd−1 i=1 |yi+1 −yi|, i.e., the sum of a strongly convex term and of a 1-d TV penalty. It is easy to verify that this choice yields the mapping ΠΩ(x) = arg min y∈∆d 1 2∥y −x/γ∥2 + λ d−1 X i=1 |yi+1 −yi|. (fusedmax) Oscarmax. For situations where the contiguity assumption may be too strict, we propose oscarmax, based on the OSCAR penalty [7], to encourage attention weights to merge into clusters with the same value, regardless of position in the sequence. This is accomplished by replacing the 1-d TV penalty in fusedmax with an ∞-norm penalty on each pair of attention weights, i.e., Ω(y) = 1 2∥y∥2 2 + λ P i<j max(|yi|, |yj|). This results in the mapping ΠΩ(x) = arg min y∈∆d 1 2∥y −x/γ∥2 + λ X i<j max(|yi|, |yj|). (oscarmax) Forward computation. Due to the y ∈∆d constraint, computing fusedmax/oscarmax does not seem trivial on first sight. The next proposition shows how to do so, without any iterative method. Proposition 2 Computing fusedmax and oscarmax (forward computation) fusedmax: ΠΩ(x) = P∆d (PTV (x/γ)) , PTV(x) := arg min y∈Rd 1 2∥y −x∥2 + λ d−1 X i=1 |yi+1 −yi|. oscarmax: ΠΩ(x) = P∆d (POSC (x/γ)) , POSC(x) := arg min y∈Rd 1 2∥y −x∥2 + λ X i<j max(|yi|, |yj|). 5 Here, PTV and POSC indicate the proximal operators of 1-d TV and OSCAR, and can be computed exactly by [13] and [47], respectively. To remind the reader, P∆d denotes the Euclidean projection onto the simplex and can be computed exactly using [34, 15]. Proposition 2 shows that we can compute fusedmax and oscarmax using the composition of two functions, for which exact noniterative algorithms exist. This is a surprising result, since the proximal operator of the sum of two functions is not, in general, the composition of the proximal operators of each function. The proof follows by showing that the indicator function of ∆d satisfies the conditions of [45, Corollaries 4,5]. Groups induced by PTV and POSC. Let z⋆be the optimal solution of PTV(x) or POSC(x). For PTV, we denote the group of adjacent elements with the same value as z⋆ i by G⋆ i , ∀i ∈[d]. Formally, G⋆ i = [a, b] ∩N with a ≤i ≤b where a and b are the minimal and maximal indices such that z⋆ i = z⋆ j for all j ∈G⋆ i . For POSC, we define G⋆ i as the indices of elements with the same absolute value as z⋆ i , more formally G⋆ i = {j ∈[d]: |z⋆ i | = |z⋆ j |}. Because P∆d(z⋆) = max(z⋆−θ, 0) for some θ ∈R, fusedmax/oscarmax either shift a group’s common value or set all its elements to zero. λ controls the trade-off between no fusion (sparsemax) and all elements fused into a single trivial group. While tuning λ may improve performance, we observe that λ = 0.1 (fusedmax) and λ = 0.01 (oscarmax) are sensible defaults that work well across all tasks and report all our results using them. Backward computation. We already know that the Jacobian of P∆d is the same as that of sparsemax with γ = 1. Then, by Proposition 2, if we know how to compute the Jacobians of PTV and POSC, we can obtain the Jacobians of fusedmax and oscarmax by straightforward application of the chain rule. However, although PTV and POSC can be computed exactly, they lack analytical expressions. We next show that we can nonetheless compute their Jacobians efficiently, without needing to solve a system. Proposition 3 Jacobians of PTV and POSC (backward computation) Assume z⋆= PTV(x) or POSC(x) has been computed. Define the groups derived from z⋆as above. Then, [JPTV(x)]i,j = ( 1 |G⋆ i | if j ∈G⋆ i , 0 o.w. and [JPOSC(x)]i,j = ( sign(z⋆ i z⋆ j ) |G⋆ i | if j ∈G⋆ i and z⋆ i ̸= 0, 0 o.w. . The proof is given in Appendix A.2. Clearly, the structure of these Jacobians permits efficient Jacobian-vector products; we discuss the computational complexity and implementation details in Appendix B. Note that PTV and POSC are differentiable everywhere except at points where groups change. For these points, the same remark as for sparsemax applies, and we can use Clarke’s Jacobian. 4 Experimental results We showcase the performance of our attention mechanisms on three challenging natural language tasks: textual entailment, machine translation, and sentence summarization. We rely on available, well-established neural architectures, so as to demonstrate simple drop-in replacement of softmax with structured sparse attention; quite likely, newer task-specific models could lead to further improvement. 4.1 Textual entailment (a.k.a. natural language inference) experiments Textual entailment is the task of deciding, given a text T and an hypothesis H, whether a human reading T is likely to infer that H is true [14]. We use the Stanford Natural Language Inference (SNLI) dataset [8], a collection of 570,000 English sentence pairs. Each pair consists of a sentence and an hypothesis, manually labeled with one of the labels ENTAILMENT, CONTRADICTION, or NEUTRAL. Table 1: Textual entailment test accuracy on SNLI [8]. attention accuracy softmax 81.66 sparsemax 82.39 fusedmax 82.41 oscarmax 81.76 We use a variant of the neural attention–based classifier proposed for this dataset by [38] and follow the same methodology as [31] in terms of implementation, hyperparameters, and grid search. We employ the CPU implementation provided in [31] and simply replace sparsemax with fusedmax/oscarmax; we observe that training time per epoch is essentially the same for each of the four attention mechanisms (timings and more experimental details in Appendix C.2). Table 1 shows that, for this task, fusedmax reaches the highest accuracy, and oscarmax slightly outperforms softmax. Furthermore, 6 A band is playing on stage ata concert and the attendants are dancing to the music. 0.0 0.1 0.2 softmax A band is playing on stage ata concert and the attendants are dancing to the music. 0.0 0.1 0.2 sparsemax A band is playing on stage ata concert and the attendants are dancing to the music. 0.0 0.1 0.2 0.3 fusedmax A band is playing on stage ata concert and the attendants are dancing to the music. 0.0 0.1 0.2 oscarmax Figure 3: Attention weights when considering the contradicted hypothesis “No one is dancing.” fusedmax results in the most interpretable feature groupings: Figure 3 shows the weights of the neural network’s attention to the text, when considering the hypothesis “No one is dancing.” In this case, all four models correctly predicted that the text “A band is playing on stage at a concert and the attendants are dancing to the music,” denoted along the x-axis, contradicts the hypothesis, although the attention weights differ. Notably, fusedmax identifies the meaningful segment “band is playing”. 4.2 Machine translation experiments Sequence-to-sequence neural machine translation (NMT) has recently become a strong contender in machine translation [2, 29]. In NMT, attention weights can be seen as an alignment between source and translated words. To demonstrate the potential of our new attention mechanisms for NMT, we ran experiments on 10 language pairs. We build on OpenNMT-py [24], based on PyTorch [37], with all default hyperparameters (detailed in Appendix C.3), simply replacing softmax with the proposed ΠΩ. OpenNMT-py with softmax attention is optimized for the GPU. Since sparsemax, fusedmax, and oscarmax rely on sorting operations, we implement their computations on the CPU for simplicity, keeping the rest of the pipeline on the GPU. However, we observe that, even with this context switching, the number of tokens processed per second was within 3/4 of the softmax pipeline. For sq-pnorm-max, we observe that the projected gradient solver used in the forward pass, unlike the linear system solver used in the backward pass, could become a computational bottleneck. To mitigate this effect, we set the tolerance of the solver’s stopping criterion to 10−2. Quantitatively, we find that all compared attention mechanisms are always within 1 BLEU score point of the best mechanism (for detailed results, cf. Appendix C.3). This suggests that structured sparsity does not restrict accuracy. However, as illustrated in Figure 4, fusedmax and oscarmax often lead to more interpretable attention alignments, as well as to qualitatively different translations. La coalition pour l' aide internationale devraitle lire avec attention . the coalition for international aid should read it carefully . <EOS> fusedmax La coalition pour l' aide internationale devrait le lire avec attention . the international aid coalition should read it carefully . <EOS> oscarmax La coalition pour l' aide internationale devraitle lire avec attention . the coalition for international aid should read it carefully . <EOS> softmax Figure 4: Attention weights for French to English translation, using the conventions of Figure 1. Within a row, weights grouped by oscarmax under the same cluster are denoted by “•”. Here, oscarmax finds a slightly more natural English translation. More visulizations are given in Appendix C.3. 4.3 Sentence summarization experiments Attention mechanisms were recently explored for sentence summarization in [39]. To generate sentence-summary pairs at low cost, the authors proposed to use the title of a news article as a noisy summary of the article’s leading sentence. They collected 4 million such pairs from the Gigaword dataset and showed that this seemingly simplistic approach leads to models that generalize 7 Table 2: Sentence summarization results, following the same experimental setting as in [39]. DUC 2004 Gigaword attention ROUGE-1 ROUGE-2 ROUGE-L ROUGE-1 ROUGE-2 ROUGE-L softmax 27.16 9.48 24.47 35.13 17.15 32.92 sparsemax 27.69 9.55 24.96 36.04 17.78 33.64 fusedmax 28.42 9.96 25.55 36.09 17.62 33.69 oscarmax 27.84 9.46 25.14 35.36 17.23 33.03 sq-pnorm-max 27.94 9.28 25.08 35.94 17.75 33.66 surprisingly well. We follow their experimental setup and are able to reproduce comparable results to theirs with OpenNMT when using softmax attention. The models we use are the same as in §4.2. Our evaluation follows [39]: we use the standard DUC 2004 dataset (500 news articles each paired with 4 different human-generated summaries) and a randomly held-out subset of Gigaword, released by [39]. We report results on ROUGE-1, ROUGE-2, and ROUGE-L. Our results, in Table 2, indicate that fusedmax is the best under nearly all metrics, always outperforming softmax. In addition to Figure 1, we exemplify our enhanced interpretability and provide more detailed results in Appendix C.4. 5 Related work Smoothed max operators. Replacing the max operator by a differentiable approximation based on the log sum exp has been exploited in numerous works. Regularizing the max operator with a squared 2-norm is less frequent, but has been used to obtain a smoothed multiclass hinge loss [41] or smoothed linear programming relaxations for maximum a-posteriori inference [33]. Our work differs from these in mainly two aspects. First, we are less interested in the max operator itself than in its gradient, which we use as a mapping from Rd to ∆d. Second, since we use this mapping in neural networks trained with backpropagation, we study and compute the mapping’s Jacobian (the Hessian of a regularized max operator), in contrast with previous works. Interpretability, structure and sparsity in neural networks. Providing interpretations alongside predictions is important for accountability, error analysis and exploratory analysis, among other reasons. Toward this goal, several recent works have been relying on visualizing hidden layer activations [20, 27] and the potential for interpretability provided by attention mechanisms has been noted in multiple works [2, 38, 39]. Our work aims to fulfill this potential by providing a unified framework upon which new interpretable attention mechanisms can be designed, using well-studied tools from the field of structured sparse regularization. Selecting contiguous text segments for model interpretations is explored in [26], where an explanation generator network is proposed for justifying predictions using a fused lasso penalty. However, this network is not an attention mechanism and has its own parameters to be learned. Furthemore, [26] sidesteps the need to backpropagate through the fused lasso, unlike our work, by using a stochastic training approach. In constrast, our attention mechanisms are deterministic and drop-in replacements for existing ones. As a consequence, our mechanisms can be coupled with recent research that builds on top of softmax attention, for example in order to incorporate soft prior knowledge about NMT alignment into attention through penalties on the attention weights [12]. A different approach to incorporating structure into attention uses the posterior marginal probabilities from a conditional random field as attention weights [23]. While this approach takes into account structural correlations, the marginal probabilities are generally dense and different from each other. Our proposed mechanisms produce sparse and clustered attention weights, a visible benefit in interpretability. The idea of deriving constrained alternatives to softmax has been independently explored for differentiable easy-first decoding [32]. Finally, sparsity-inducing penalties have been used to obtain convex relaxations of neural networks [5] or to compress models [28, 43, 40]. These works differ from ours, in that sparsity is enforced on the network parameters, while our approach can produce sparse and structured outputs from neural attention layers. 8 6 Conclusion and future directions We proposed in this paper a unified regularized framework upon which new attention mechanisms can be designed. To enable such mechanisms to be used in a neural network trained by backpropagation, we demonstrated how to carry out forward and backward computations for general differentiable regularizers. We further developed two new structured attention mechanisms, fusedmax and oscarmax, and demonstrated that they enhance interpretability while achieving comparable or better accuracy on three diverse and challenging tasks: textual entailment, machine translation, and summarization. The usefulness of a differentiable mapping from real values to the simplex or to [0, 1] with sparse or structured outputs goes beyond attention mechanisms. We expect that our framework will be useful to sample from categorical distributions using the Gumbel trick [21, 30], as well as for conditional computation [6] or differentiable neural computers [18, 19]. We plan to explore these in future work. Acknowledgements We are grateful to André Martins, Takuma Otsuka, Fabian Pedregosa, Antoine Rolet, Jun Suzuki, and Justine Zhang for helpful discussions. We thank the anonymous reviewers for the valuable feedback. References [1] B. Amos and J. Z. Kolter. OptNet: Differentiable optimization as a layer in neural networks. In Proc. of ICML, 2017. [2] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR, 2015. [3] K. Ball, E. A. Carlen, and E. H. Lieb. Sharp uniform convexity and smoothness inequalities for trace norms. Inventiones Mathematicae, 115(1):463–482, 1994. [4] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183–202, 2009. [5] Y. Bengio, N. Le Roux, P. Vincent, O. Delalleau, and P. Marcotte. Convex neural networks. In Proc. of NIPS, 2005. [6] Y. Bengio, N. Léonard, and A. Courville. Estimating or propagating gradients through stochastic neurons for conditional computation. In Proc. of NIPS, 2013. [7] H. D. Bondell and B. J. Reich. Simultaneous regression shrinkage, variable selection, and supervised clustering of predictors with OSCAR. Biometrics, 64(1):115–123, 2008. [8] S. R. Bowman, G. Angeli, C. Potts, and C. D. Manning. A large annotated corpus for learning natural language inference. In Proc. of EMNLP, 2015. [9] S. Boyd and L. Vandenberghe. Convex optimization. Cambridge University Press, 2004. [10] J. K. Chorowski, D. Bahdanau, D. Serdyuk, K. Cho, and Y. Bengio. Attention-based models for speech recognition. In Proc. of NIPS, 2015. [11] F. H. Clarke. Optimization and nonsmooth analysis. SIAM, 1990. [12] T. Cohn, C. D. V. Hoang, E. Vymolova, K. Yao, C. Dyer, and G. Haffari. Incorporating structural alignment biases into an attentional neural translation model. In Proc. of NAACL-HLT, 2016. [13] L. Condat. A direct algorithm for 1-d total variation denoising. IEEE Signal Processing Letters, 20(11):1054–1057, 2013. [14] I. Dagan, B. Dolan, B. Magnini, and D. Roth. Recognizing textual entailment: Rational, evaluation and approaches. Natural Language Engineering, 15(4):i–xvii, 2009. [15] J. Duchi, S. Shalev-Shwartz, Y. Singer, and T. Chandra. Efficient projections onto the ℓ1-ball for learning in high dimensions. In Proc. of ICML, 2008. 9 [16] C. Dugas, Y. Bengio, F. Bélisle, C. Nadeau, and R. Garcia. Incorporating second-order functional knowledge for better option pricing. Proc. of NIPS, 2001. [17] J. Friedman, T. Hastie, H. Höfling, and R. Tibshirani. Pathwise coordinate optimization. The Annals of Applied Statistics, 1(2):302–332, 2007. [18] A. Graves, G. Wayne, and I. Danihelka. Neural Turing Machines. In Proc. of NIPS, 2014. [19] A. Graves, G. Wayne, M. Reynolds, T. Harley, I. Danihelka, A. Grabska-Barwi´nska, S. G. Colmenarejo, E. Grefenstette, T. Ramalho, J. Agapiou, et al. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, 2016. [20] O. Irsoy. Deep sequential and structural neural models of compositionality. PhD thesis, Cornell University, 2017. [21] E. Jang, S. Gu, and B. Poole. Categorical reparameterization with Gumbel-Softmax. In Proc. of ICLR, 2017. [22] S. M. Kakade, S. Shalev-Shwartz, and A. Tewari. Regularization techniques for learning with matrices. Journal of Machine Learning Research, 13:1865–1890, 2012. [23] Y. Kim, C. Denton, L. Hoang, and A. M. Rush. Structured attention networks. In Proc. of ICLR, 2017. [24] G. Klein, Y. Kim, Y. Deng, J. Senellart, and A. M. Rush. OpenNMT: Open-source toolkit for neural machine translation. arXiv e-prints, 2017. [25] 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 Proc. of ACL, 2007. [26] T. Lei, R. Barzilay, and T. Jaakkola. Rationalizing neural predictions. In Proc. of EMNLP, 2016. [27] J. Li, X. Chen, E. Hovy, and D. Jurafsky. Visualizing and understanding neural models in NLP. In Proc. of NAACL-HLT, 2016. [28] B. Liu, M. Wang, H. Foroosh, M. Tappen, and M. Pensky. Sparse convolutional neural networks. In Proc. of ICCVPR, 2015. [29] M.-T. Luong, H. Pham, and C. D. Manning. Effective approaches to attention-based neural machine translation. In Proc. of EMNLP, 2015. [30] C. J. Maddison, A. Mnih, and Y. W. Teh. The concrete distribution: A continuous relaxation of discrete random variables. In Proc. of ICLR, 2017. [31] A. F. Martins and R. F. Astudillo. From softmax to sparsemax: A sparse model of attention and multi-label classification. In Proc. of ICML, 2016. [32] A. F. Martins and J. Kreutzer. Learning what’s easy: Fully differentiable neural easy-first taggers. In Proc. of EMNLP, 2017. [33] O. Meshi, M. Mahdavi, and A. G. Schwing. Smooth and strong: MAP inference with linear convergence. In Proc. of NIPS, 2015. [34] C. Michelot. A finite algorithm for finding the projection of a point onto the canonical simplex of Rn. Journal of Optimization Theory and Applications, 50(1):195–200, 1986. [35] Y. Nesterov. Smooth minimization of non-smooth functions. Mathematical Programming, 103(1):127–152, 2005. [36] N. Parikh and S. Boyd. Proximal algorithms. Foundations and Trends R⃝in Optimization, 1(3):127–239, 2014. [37] PyTorch. http://pytorch.org, 2017. 10 [38] T. Rocktäschel, E. Grefenstette, K. M. Hermann, T. Kocisky, and P. Blunsom. Reasoning about entailment with neural attention. In Proc. of ICLR, 2016. [39] A. M. Rush, S. Chopra, and J. Weston. A neural attention model for abstractive sentence summarization. In Proc. of EMNLP, 2015. [40] S. Scardapane, D. Comminiello, A. Hussain, and A. Uncini. Group sparse regularization for deep neural networks. Neurocomputing, 241:81–89, 2017. [41] S. Shalev-Shwartz and T. Zhang. Accelerated proximal stochastic dual coordinate ascent for regularized loss minimization. Mathematical Programming, 155(1):105–145, 2016. [42] R. Tibshirani, M. Saunders, S. Rosset, J. Zhu, and K. Knight. Sparsity and smoothness via the fused lasso. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 67(1):91–108, 2005. [43] W. Wen, C. Wu, Y. Wang, Y. Chen, and H. Li. Learning structured sparsity in deep neural networks. In Proc. of NIPS, 2016. [44] K. Xu, J. Ba, R. Kiros, K. Cho, A. Courville, R. Salakhudinov, R. Zemel, and Y. Bengio. Show, attend and tell: Neural image caption generation with visual attention. In Proc. of ICML, 2015. [45] Y. Yu. On decomposing the proximal map. In Proc. of NIPS, 2013. [46] C. Zalinescu. Convex analysis in general vector spaces. World Scientific, 2002. [47] X. Zeng and M. A. Figueiredo. Solving OSCAR regularization problems by fast approximate proximal splitting algorithms. Digital Signal Processing, 31:124–135, 2014. [48] X. Zeng and F. A. Mario. The ordered weighted ℓ1 norm: Atomic formulation, dual norm, and projections. arXiv e-prints, 2014. [49] L. W. Zhong and J. T. Kwok. Efficient sparse modeling with automatic feature grouping. IEEE transactions on neural networks and learning systems, 23(9):1436–1447, 2012. 11
2017
119
6,585
Adaptive Bayesian Sampling with Monte Carlo EM Anirban Roychowdhury, Srinivasan Parthasarathy Department of Computer Science and Engineering The Ohio State University roychowdhury.7@osu.edu, srini@cse.ohio-state.edu Abstract We present a novel technique for learning the mass matrices in samplers obtained from discretized dynamics that preserve some energy function. Existing adaptive samplers use Riemannian preconditioning techniques, where the mass matrices are functions of the parameters being sampled. This leads to significant complexities in the energy reformulations and resultant dynamics, often leading to implicit systems of equations and requiring inversion of high-dimensional matrices in the leapfrog steps. Our approach provides a simpler alternative, by using existing dynamics in the sampling step of a Monte Carlo EM framework, and learning the mass matrices in the M step with a novel online technique. We also propose a way to adaptively set the number of samples gathered in the E step, using sampling error estimates from the leapfrog dynamics. Along with a novel stochastic sampler based on Nosé-Poincaré dynamics, we use this framework with standard Hamiltonian Monte Carlo (HMC) as well as newer stochastic algorithms such as SGHMC and SGNHT, and show strong performance on synthetic and real high-dimensional sampling scenarios; we achieve sampling accuracies comparable to Riemannian samplers while being significantly faster. 1 Introduction Markov Chain Monte Carlo sampling is a well-known set of techniques for learning complex Bayesian probabilistic models that arise in machine learning. Typically used in cases where computing the posterior distributions of parameters in closed form is not feasible, MCMC techniques that converge reliably to the target distributions offer a provably correct way (in an asymptotic sense) to draw samples of target parameters from arbitrarily complex probability distributions. A recently proposed method in this domain is Hamiltonian Monte Carlo (HMC) [1, 2], that formulates the target density as an “energy function” augmented with auxiliary “momentum” parameters, and uses discretized Hamiltonian dynamics to sample the parameters while preserving the energy function. The resulting samplers perform noticeably better than random walk-based methods in terms of sampling efficiency and accuracy [1, 3]. For use in stochastic settings, where one uses random minibatches of the data to calculate the gradients of likelihoods for better scalability, researchers have used Fokker-Planck correction steps to preserve the energy in the face of stochastic noise [4], as well as used auxiliary “thermostat” variables to control the effect of this noise on the momentum terms [5, 6]. As with the batch setting, these methods have exploited energy-preserving dynamics to sample more efficiently than random walk-based stochastic samplers [4, 7, 8]. A primary (hyper-)parameter of interest in these augmented energy function-based samplers in the “mass” matrix of the kinetic energy term; as noted by various researchers [1, 3, 6, 8, 9], this matrix plays an important role in the trajectories taken by the samplers in the parameter space of interest, thereby affecting the overall efficiency. While prior efforts have set this to the identity matrix or some other pre-calculated value [4, 5, 7], recent work has shown that there are significant gains to be had in efficiency as well as convergent accuracy by reformulating the mass in terms of the target parameters to be sampled [3, 6, 8], thereby making the sampler sensitive to the underlying geometry. This is done by imposing a positive definite constraint on the adaptive mass, and using it as the metric of 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. the Riemannian manifold of probability distributions parametrized by the target parameters. This constraint also satisfies the condition that the momenta be sampled from a Gaussian with the mass as the covariance. Often called Riemannian preconditioning, this idea has been applied in both batch [3] as well as stochastic settings [6, 8] to derive HMC-based samplers that adaptively learn the critically important mass matrix from the data. Although robust, these reformulations often lead to significant complexities in the resultant dynamics; one can end up solving an implicit system of equations in each half-step of the leapfrog dynamics [3, 6], along with inverting large O(D2)  matrices. This is sometimes sidestepped by performing fixed point updates at the cost of additional error, or restricting oneself to simpler formulations that honor the symmetric positive definite constraint, such as a diagonal matrix [8]. While this latter choice ameliorates a lot of the added complexity, it is clearly suboptimal in the context of adapting to the underlying geometry of the parameter space. Thus we would ideally need a mechanism to robustly learn this critical mass hyperparameter from the data without significantly adding to the computational burden. We address this issue in this work with the Monte Carlo EM (MCEM) [10, 11, 12, 13] framework. An alternative to the venerable EM technique, MCEM is used to locally optimize maximum likelihood problems where the posterior probabilities required in the E step of EM cannot be computed in closed form. In this work, we perform existing dynamics derived from energy functions in the Monte Carlo E step while holding the mass fixed, and use the stored samples of the momentum term to learn the mass in the M step. We address the important issue of selecting appropriate E-step sampling iterations, using error estimates to gradually increase the sample sizes as the Markov chain progresses towards convergence. Combined with an online method to update the mass using sample covariance estimates in the M step, this gives a clean and scalable adaptive sampling algorithm that performs favorably compared to the Riemannian samplers. In both our synthetic experiments and a high dimensional topic modeling problem with a complex Bayesian nonparametric construction [14], our samplers match or beat the Riemannian variants in sampling efficiency and accuracy, while being close to an order of magnitude faster. 2 Preliminaries 2.1 MCMC with Energy-Preserving Dynamics In Hamiltonian Monte Carlo, the energy function is written as H(θ, p) = −L(θ) + 1 2pT M −1p. (1) Here X is the observed data, and θ denotes the model parameters. L(θ) = log p(X|θ) + log p(θ) denotes the log likelihood of the data given the parameters along with the Bayesian prior, and p denotes the auxiliary “momentum” mentioned above. Note that the second term in the energy function, the kinetic energy, is simply the kernel of a Gaussian with the mass matrix M acting as covariance. Hamilton’s equations of motions are then applied to this energy function to derive the following differential equations, with the dot accent denoting a time derivative: ˙θ = M −1p, ˙p = ∇L(θ). These are discretized using the generalized leapfrog algorithm [1, 15] to create a sampler that is both symplectic and time-reversible, upto a discretization error that is quadratic in the stepsize. Machine learning applications typically see the use of very large datasets for which computing the gradients of the likelihoods in every leapfrog step followed by a Metropolis-Hastings correction ratio is prohibitively expensive. To address this, one uses random “minibatches” of the dataset in each iteration [16], allowing some stochastic noise for improved scalability, and removes the Metropolis-Hastings (M-H) correction steps [4, 7]. To preserve the system energy in this context one has to additionally apply Fokker-Planck corrections to the dynamics [17]. The stochastic sampler in [4] uses these techniques to preserve the canonical Gibbs energy above (1). Researchers have also used the notion of “thermostats” from the molecular dynamics literature [9, 18, 19, 20] to further control the behavior of the momentum terms in the face of stochastic noise; the resulting algorithm [5] preserves an energy of its own [21] as well. 2.2 Adaptive MCMC using Riemannian Manifolds As mentioned above, learning the mass matrices in these MCMC systems is an important challenge. Researchers have traditionally used Riemannian manifold refomulations to address this, and integrate 2 the updating of the mass into the sampling steps. In [3] the authors use this approach to derive adaptive variants of first-order Langevin dynamics as well as HMC. For the latter the reformulated energy function can be written as: Hgc(θ, p) = −L(θ) + 1 2pT G(θ)−1p + 1 2 log  (2π)D|G(θ)| , (2) where D is the dimensionality of the parameter space. Note that the momentum variable p can be integrated out to recover the desired marginal density of θ, in spite of the covariance being a function of θ. In the machine learning literature, the authors of [8] used a diagonal G(θ) to produce an adaptive variant of the algorithm in [7], whereas the authors in [6] derived deterministic and stochastic algorithms from a Riemannian variant of the Nosé-Poincaré energy [9], with the resulting adaptive samplers preserving symplecticness as well as canonical system temperature. 2.3 Monte Carlo EM The EM algorithm [22] is widely used to learn maximum likelihood parameter estimates for complex probabilistic models. In cases where the expectations of the likelihoods required in the E step are not tractable, one can use Monte Carlo simulations of the posterior instead. The resulting Monte Carlo EM (MCEM) framework [10] has been widely studied in the statistics literature, with various techniques developed to efficiently draw samples and estimate Monte Carlo errors in the E step [11, 12, 13]. For instance, the expected log-likelihood is usually replaced with the following Monte Carlo approximation: Q(θ|θt) = 1 m m P l=1 log p(X, ut l|θ), where u represents the latent augmentation variables used in EM, and m is the number of samples taken in the E step. While applying this framework, one typically has to carefully tune the number of samples gathered in the E step, since the potential distance from the stationary distribution in the early phases would necessitate drawing relatively fewer samples, and progressively more as the sampler nears convergence. In this work we leverage this MCEM framework to learn M in (1) and similar energies using samples of p; the discretized dynamics constitute the E step of the MCEM framework, with suitable updates to M performed in the corresponding M step. We also use a novel mechanism to dynamically adjust the sample count by using sampling errors estimated from the gathered samples, as described next. 3 Mass-Adaptive Sampling with Monte Carlo EM 3.1 The Basic Framework Riemannian samplers start off by reformulating the energy function, making the mass a function of θ and adding suitable terms to ensure constancy of the marginal distributions. Our approach is fundamentally different: we cast the task of learning the mass as a maximum likelihood problem over the space of symmetric positive definite matrices. For instance, we can construct the following problem for standard HMC: max M≻0 L(θ) −1 2pT M −1p −1 2 log |M|. (3) Recall that the joint likelihood is p(θ, p) ∝exp(−H(θ, p)), H(·, ·) being the energy from (1). Then, we use correct samplers that preserve the desired densities in the E step of a Monte Carlo EM (MCEM) framework, and use the obtained samples of p in the corresponding M step to perform suitable updates for the mass M. Specifically, to wrap the standard HMC sampler in our framework, we perform the generalized leapfrog steps [1, 15] to obtain proposal updates for θ, p followed by Metropolis-Hastings corrections in the E step, and use the obtained p values in the M step. The resultant adaptive sampling method is shown in Alg. 1. Note that this framework can also be applied to stochastic samplers that preserve the energy, upto standard discretization errors. We can wrap the SGHMC sampler [4] in our framework as well, since it uses Fokker-Planck corrections to approximately preserve the energy (1) in the presence of stochastic noise. We call the resulting method SGHMC-EM, and specify it in Alg. 3 in the supplementary. As another example, the SGNHT sampler [5] is known to preserve a modified Gibbs energy [21]; therefore we can propose the following max-likelihood problem for learning the mass: max M≻0 L(θ) −1 2pT M −1p −1 2 log |M| + µ(ξ −¯ξ)2/2, (4) 3 where ξ is the thermostat variable, and µ, ¯ξ are constants chosen to preserve correct marginals. The SGNHT dynamics can used in the E step to maintain the above energy, and we can use the collected p samples in the M step as before. We call the resultant method SGNHT-EM, as shown in Alg. 2. Note that, unlike standard HMC above, we do not perform Metropolis-Hastings corrections steps on the gathered samples for these cases. As shown in the algorithms, we collect one set of momenta samples per epoch, after the leapfrog iterations. We use S_count to denote the number of such samples collected before running an M-step update. The advantage of this MCEM approach over the parameter-dependent Riemannian variants is twofold: 1. The existing Riemannian adaptive algorithms in the literature [3, 6, 8] all start by modifying the energy function, whereas our framework does not have any such requirement. As long as one uses a sampling mechanism that preserves some energy with correct marginals for θ, in a stochastic sense or otherwise, it can be used in the E step of our framework. 2. The primary disadvantage of the Riemannian algorithms is the added complexity in the dynamics derived from the modified energy functions. One typically ends up using generalized leapfrog dynamics [3, 6], which can lead to implicit systems of equations; to solve these one either has to use standard solvers that have complexity at least cubic in the dimensionality [23, 24], with scalability issues in high dimensional datasets, or use fixed point updates with worsened error guarantees. An alternative approach is to use diagonal covariance matrices, as mentioned earlier, which ignores the coordinate correlations. Our MCEM approach sidesteps all these issues by keeping the existing dynamics of the desired E step sampler unchanged. As shown in the experiments, we can match or beat the Riemannian samplers in accuracy and efficiency by using suitable sample sizes and M step updates, with significantly improved sampling complexities and runtimes. 3.2 Dynamic Updates for the E-step Sample Size Algorithm 1 HMC-EM Input: θ(0), ϵ, LP_S, S_count · Initialize M; repeat · Sample p(t) ∼N(0, M); for i = 1 to LP_S do · p(i) ←p(i+ϵ−1), θ(i) ←θ(i+ϵ−1); · p(i+ϵ/2) ←p(i) −ϵ 2∇θH(θ(i), p(i)); · θ(i+ϵ) ←θ(i) + ϵ 2∇pH(θ(i), p(i+ϵ/2)); · p(i+ϵ) ←p(i+ϵ/2) −ϵ 2∇θH(θ(i+ϵ), p(i+ϵ/2)); end for · Set θ(t+1), p(t+1) from θLP _S+ϵ, pLP _S+ϵ using Metropolis-Hastings · Store MC-EM sample p(t+1); if (t + 1) mod S_count = 0 then · Update M using MC-EM samples; end if · Update S_count as described in the text; until forever We now turn our attention to the task of learning the sample size in the E step from the data. The nontriviality of this issue is due to the following reasons: first, we cannot let the sampling dynamics run to convergence in each E step without making the whole process prohibitively slow; second, we have to account for the correlation among successive samples, especially early on in the process when the Markov chain is far from convergence, possibly with “thinning” techniques; and third, we may want to increase the sample count as the chain matures and gets closer to the stationary distribution, and use relatively fewer samples early on. To this end, we leverage techniques derived from the MCEM literature in statistics [11, 13, 25] to first evaluate a suitable “test” function of the target parameters at certain subsampled steps, using the gathered samples and current M step estimates. We then use confidence intervals created around these evaluations to gauge the relative effect of successive MCEM estimates over the Monte Carlo error. If the updated values of these functions using newer M-step estimates lie in these intervals, we increase the number of samples collected in the next MCEM loop. Specifically, similar to [13], we start off with the following test function for HMC-EM (Alg. 1): q(·) =  M −1p, ∇L(θ)  . We then subsample some timesteps as mentioned below, evaluate q at those steps, and create confidence intervals using sample means and variances: mS = 1 S S X s=1 qs, vS = 1 S S X s=1 q2 s −m2 S, CS := mS ± z1−α/2vS, 4 where S denotes the subsample count, z1−α/2 is the (1 −α) critical value of a standard Gaussian, and CS the confidence interval mentioned earlier. For SGNHT-EM (Alg. 2), we use the following test function: q(·) =  M −1p, ∇L(θ) + ξM −1p, pT M −1p  , derived from the SGNHT dynamics. Algorithm 2 SGNHT-EM Input: θ(0), ϵ, A, LP_S, S_count · Initialize ξ(0), p(0) and M; repeat for i = 1 to LP_S do · p(i+1) ←p(i) −ϵξ(i)M −1p(i) −ϵ ˜∇L(θ(i))+ √ 2AN(0, ϵ); · θ(i+1) ←θ(i) + ϵM −1p(i+1); · ξ(i+1) ←ξ(i)+ϵ  1 Dp(i+1)T M −1p(i+1) −1  ; end for · Set θ(t+1), p(t+1), ξ(t+1) = θ(LP _S+1), p(LP _S+1), ξ(LP _S+1) ; · Store MC-EM sample p(t+1); if (t + 1) mod S_count = 0 then · Update M using MC-EM samples; end if · Update S_count as described in the text; until forever One can adopt the following method described in [25]: choose the subsampling offsets {t1 . . . tS} as ts = Ps i=1 xi, where xi −1 ∼Poisson(νid), with suitably chosen ν ≥1 and d > 0. We found both this and a fixed set of S offsets to work well in our experiments. With the subsamples collected using this mechanism, we calculate the confidence intervals as described earlier. The assumption is that this interval provides an estimate of the spread of q due to the Monte Carlo error. We then perform the M-step, and evaluate q using the updated M-step estimates. If this value lies in the previously calculated confidence bound, we increase S as S = S + S/SI in the following iteration to overcome the Monte Carlo noise. See [11, 13] for details on these procedures. Values for the constants ν, α, d, SI, as well as initial estimates for S are given in the supplementary. Running values for S are denoted S_count hereafter. 3.3 An Online Update for the M-Step Next we turn our attention to the task of updating the mass matrices using the collected momenta samples. As shown in the energy functions above, the momenta are sampled from zero-mean normal distributions, enabling us to use standard covariance estimation techniques from the literature. However, since we are using discretized MCMC to obtain these samples, we have to address the variance arising from the Monte Carlo error, especially during the burn-in phase. To that end, we found a running average of the updates to work well in our experiments; in particular, we updated the inverse mass matrix, denoted as MI, at the kth M-step as: M (k) I = (1 −κ(k))M (k−1) I + κ(k)M (k,est) I , (5) where M (k,est) I is a suitable estimate computed from the gathered samples in the kth M-step, and  κ(k) is a step sequence satisfying some standard assumptions, as described below. Note that the MIs correspond to the precision matrix of the Gaussian distribution of the momenta; updating this during the M-step also removes the need to invert the mass matrices during the leapfrog iterations. Curiously, we found the inverse of the empirical covariance matrix to work quite well as M (k,est) I in our experiments. These updates also induce a fresh perspective on the convergence of the overall MCEM procedure. Existing convergence analyses in the statistics literature fall into three broad categories: a) the almost sure convergence presented in [26] as t →∞with increasing sample sizes, b) the asymptotic angle presented in [27], where the sequence of MCEM updates are analyzed as an approximation to the standard EM sequence as the sample size, referred to as S_count above, tends to infinity, and c) the asymptotic consistency results obtained from multiple Gibbs chains in [28], by letting the chain counts and iterations tend to ∞. Our analysis differs from all of these, by focusing on the maximum likelihood situations noted above as convex optimization problems, and using SGD convergence techniques [29] for the sequence of iterates M (k) I . Proposition 1. Assume the M (k,est) I ’s provide an unbiased estimate of ∇J, and have bounded eigenvalues. Let inf∥MI−M ∗ I ∥2>ϵ ∇J(MI) > 0 ∀ϵ > 0. Further, let the sequence  κ(k) satisfy P k κ(k) = ∞, P k κ(k)2 < ∞. Then the sequence n M (k) I o converges to the MLE of the precision almost surely. 5 Recall that the (negative) precision is a natural parameter of the normal distribution written in exponential family notation, and that the log-likelihood is a concave function of the natural parameters for this family; this makes max-likelihood a convex optimization problem over the precision, even in the presence of linear constraints [30, 31]. Therefore, this implies that the problems (3), (4) have a unique maximum, denoted by M ∗ I above. Also note that the update (5) corresponds to a first order update on the iterates with an L2-regularized objective, with unit regularization parameter; this is denoted by J(MI) in the proposition. That is, J is the energy preserved by our sampler(s), as a function of the mass (precision), augmented with an L2 regularization term. The resultant strongly convex optimization problem can be analyzed using SGD techniques under the assumptions noted above; we provide a proof in the supplementary for completeness. We should note here that the “stochasticity” in the proof does not refer to the stochastic gradients of L(θ) used in the leapfrog dynamics of Algorithms 2 through 5; instead we think of the collected momenta samples as a stochastic minibatch used to compute the gradient of the regularized energy, as a function of the covariance (mass), allowing us to deal with the Monte Carlo error indirectly. Also note that our assumption on the unbiasedness of the M (k,est) I estimates is similar to [26], and distinct from assuming that the MCEM samples of θ are unbiased; indeed, it would be difficult to make this latter claim, since stochastic samplers in general are known to have a convergent bias. 3.4 Nosé-Poincaré Variants We next develop a stochastic version of the dynamics derived from the Nosé-Poincaré Hamiltonian, followed by an MCEM variant. This allows for a direct comparison of the Riemann manifold formulation and our MCEM framework for learning the kinetic masses, in a stochastic setting with thermostat controls on the momentum terms and desired properties like reversibility and symplecticness provided by generalized leapfrog discretizations. The Nosé-Poincaré energy function can be written as [6, 9]: HNP = s  −L(θ) + 1 2 p s  M −1 p s  + q2 2Q + gkT log s −H0  , (6) where L(θ) is the joint log-likelihood, s is the thermostat control, p and q the momentum terms corresponding to θ and s respectively, and M and Q the respective mass terms. See [6, 9] for descriptions of the other constants. Our goal is to learn both M and Q using the MCEM framework, as opposed to [6], where both were formulated in terms of θ. To that end, we propose the following system of equations for the stochastic scenario: pt+ϵ/2 = p + ϵ 2  s ˜∇L(θ) −B(θ) √s M −1pt+ϵ/2  , ϵ 4Q(qt+ϵ/2)2 +  1 + A(θ)sϵ 2Q  qt+ϵ/2 −  q + ϵ 2  −gkT(1 + log s) + 1 2 pt+ϵ/2 s  M −1 pt+ϵ/2 s  + ˜L(θ) + H0  = 0, st+ϵ = s + ϵ qt+ϵ/2 Q  s + st+ϵ/2 , θt+ϵ = θ + ϵM −1p 1 s + 1 st+ϵ  , pt+ϵ = pt+ϵ/2 + ϵ 2  st+ϵ ˜∇L(θt+ϵ) −B(θt+ϵ) √ st+ϵ M −1pt+ϵ/2  , qt+ϵ = qt+ϵ/2 + ϵ 2  H0 + ˜L(θt+ϵ) −gkT(1 + log st+ϵ) + 1 2 pt+ϵ/2 st+ϵ  M −1 pt+ϵ/2 st+ϵ  −A(θ)st+ϵ 2Q qt+ϵ/2 − qt+ϵ/22 2Q  , (7) where t + ϵ/2 denotes the half-step dynamics, ˜ signifies noisy stochastic estimates, and A(θ) and B(θ) denote the stochastic noise terms, necessary for the Fokker-Planck corrections [6]. Note that we only have to solve a quadratic equation for qt+ϵ/2 with the other updates also being closed-form, as opposed to the implicit system of equations in [6]. Proposition 2. The dynamics (7) preserve the Nosé-Poincaré energy (6). The proof is a straightforward application of the Fokker-Planck corrections for stochastic noise to the Hamiltonian dynamics derived from (6), and is provided in the supplementary. With these dynamics, we first develop the SG-NPHMC algorithm (Alg. 4 in the supplementary) as a counterpart to SGHMC and SGNHT, and wrap it in our MCEM framework to create SG-NPHMC-EM (Alg. 5 in the supplementary). As we shall demonstrate shortly, this EM variant performs comparably to SGR-NPHMC from [6], while being significantly faster. 6 4 Experiments In this section we compare the performance of the MCEM-augmented variants of HMC, SGHMC as well as SGNHT with their standard counterparts, where the mass matrices are set to the identity matrix. We call these augmented versions HMC-EM, SGHMC-EM, and SGNHT-EM respectively. As baselines for the synthetic experiments, in addition to the standard samplers mentioned above, we also evaluate RHMC [3] and SGR-NPHMC [6], two recent algorithms based on dynamic Riemann manifold formulations for learning the mass matrices. In the topic modeling experiment, for scalability reasons we evaluate only the stochastic algorithms, including the recently proposed SGR-NPHMC, and omit HMC, HMC-EM and RHMC. Since we restrict the discussions in this paper to samplers with second-order dynamics, we do not compare our methods with SGLD [7] or SGRLD [8]. 4.1 Parameter Estimation of a 1D Standard Normal Distribution In this experiment we aim to learn the parameters of a unidimensional standard normal distribution in both batch and stochastic settings, using 5, 000 data points generated from N(0, 1), analyzing the impact of our MC-EM framework on the way. We compare all the algorithms mentioned so far: HMC, HMC-EM, SGHMC, SGHMC-EM, SGNHT, SGNHT-EM, SG-NPHMC, SG-NPHMC-EM along with RHMC and SGR-NPHMC. The generative model consists of normal-Wishart priors on the mean µ and precision τ, with posterior distribution p(µ, τ|X) ∝N(X|µ, τ)W(τ|1, 1), where W denotes the Wishart distribution. We run all the algorithms for the same number of iterations, discarding the first 5, 000 as “burn-in”. Batch sizes were fixed to 100 for all the stochastic algorithms, along with 10 leapfrog iterations across the board. For SGR-NPHMC and RHMC, we used the observed Fisher information plus the negative Hessian of the prior as the tensor, with one fixed point iteration on the implicit system of equations arising from the dynamics of both. For HMC we used a fairly high learning rate of 1e −2. For SGHMC and SGNHT we used A = 10 and A = 1 respectively. For SGR-NPHMC we used A, B = 0.01. METHOD RMSE (µ) RMSE (τ) TIME HMC 0.0196 0.0197 0.417MS HMC-EM 0.0115 0.0104 0.423MS RHMC 0.0111 0.0089 5.748MS SGHMC 0.1590 0.1646 0.133MS SGHMC-EM 0.0713 0.2243 0.132MS SG-NPHMC 0.0326 0.0433 0.514MS SG-NPHMC-EM 0.0274 0.0354 0.498MS SGR-NPHMC 0.0240 0.0308 3.145MS SGNHT 0.0344 0.0335 0.148MS SGNHT-EM 0.0317 0.0289 0.148MS Table 1: RMSE of the sampled means, precisions and periteration runtimes (in milliseconds) from runs on synthetic Gaussian data. We show the RMSE numbers collected from post-burn-in samples as well as per-iteration runtimes in Table 1. An “iteration” here refers to a complete E step, with the full quota of leapfrog jumps. The improvements afforded by our MCEM framework are immediately noticeable; HMCEM matches the errors obtained from RHMC, in effect matching the sample distribution, while being much faster (an order of magnitude) per iteration. The stochastic MCEM algorithms show markedly better performance as well; SGNHT-EM in particular beats SGR-NPHMC in RMSE-τ while being significantly faster due to simpler updates for the mass matrices. Accuracy improvements are particularly noticeable for the high learning rate regimes for HMC, SGHMC and SG-NPHMC. 4.2 Parameter Estimation in 2D Bayesian Logistic Regression Next we present some results obtained from a Bayesian logistic regression experiment, using both synthetic and real datasets. For the synthetic case, we used the same methodology as [6]; we generated 2, 000 observations from a mixture of two normal distributions with means at [1, −1] and [−1, 1], with mixing weights set to (0.5, 0.5) and the covariance set to I. We then classify these points using a linear classifier with weights {W0, W1} = [1, −1], and attempt to learn these weights using our samplers. We put N(0, 10I) priors on the weights, and used the metric tensor described in §7 of [3] for the Riemannian samplers. In the (generalized) leapfrog steps of the Riemannian samplers, we opted to use 2 or 3 fixed point iterations to approximate the solutions to the implicit equations. Along with this synthetic setup, we also fit a Bayesian LR model to the Australian Credit and Heart regression datasets from the UCI database, for additional runtime comparisons. The Australian credit dataset contains 690 datapoints of dimensionality 14, and the Heart dataset has 270 13-dimensional datapoints. 7 METHOD RMSE (W0) RMSE (W1) HMC 0.0456 0.1290 HMC-EM 0.0145 0.0851 RHMC 0.0091 0.0574 SGHMC 0.2812 0.2717 SGHMC-EM 0.2804 0.2583 SG-NPHMC 0.4945 0.4263 SG-NPHMC-EM 0.0990 0.4229 SGR-NPHMC 0.1901 0.1925 SGNHT 0.2035 0.1921 SGNHT-EM 0.1983 0.1729 Table 2: RMSE of the two regression parameters, for the synthetic Bayesian logistic regression experiment. See text for details. For the synthetic case, we discard the first 10, 000 samples as burn-in, and calculate RMSE values from the remaining samples. Learning rates were chosen from {1e−2, 1e−4, 1e−6}, and values of the stochastic noise terms were selected from {0.001, 0.01, 0.1, 1, 10}. Leapfrog steps were chosen from {10, 20, 30}. For the stochastic algorithms we used a batchsize of 100. The RMSE numbers for the synthetic dataset are shown in Table 2, and the per-iteration runtimes for all the datasets are shown in Table 3. We used initialized S_count to 300 for HMCEM, SGHMC-EM, and SGNHT-EM, and 200 for SG-NPHMC-EM. The MCEM framework noticeably improves the accuracy in almost all cases, with no computational overhead. Note the improvement for SG-NPHMC in terms of RMSE for W0. For the runtime calculations, we set all samplers to 10 leapfrog steps, and fixed S_count to the values mentioned above. METHOD TIME (SYNTH) TIME (AUS) TIME (HEART) HMC 1.435MS 0.987MS 0.791MS HMC-EM 1.428MS 0.970MS 0.799MS RHMC 1550MS 367MS 209MS SGHMC 0.200MS 0.136MS 0.112MS SGHMC-EM 0.203MS 0.141MS 0.131MS SG-NPHMC 0.731MS 0.512MS 0.403MS SG-NPHMC-EM 0.803MS 0.525MS 0.426MS SGR-NPHMC 6.720MS 4.568MS 3.676MS SGNHT 0.302MS 0.270MS 0.166MS SGNHT-EM 0.306MS 0.251MS 0.175MS Table 3: Per-iteration runtimes (in milliseconds) for Bayesian logistic regression experiments, on both synthetic and real datasets. The comparisons with the Riemannian algorithms tell a clear story: though we do get somewhat better accuracy with these samplers, they are orders of magnitude slower. In our synthetic case, for instance, each iteration of RHMC (consisting of all the leapfrog steps and the M-H ratio calculation) takes more than a second, using 10 leapfrog steps and 2 fixed point iterations for the implicit leapfrog equations, whereas both HMC and HMC-EM are simpler and much faster. Also note that the M-step calculations for our MCEM framework involve a single-step closed form update for the precision matrix, using the collected samples of p once every S_count sampling steps; thus we can amortize the cost of the M-step over the previous S_count iterations, leading to negligible changes to the per-sample runtimes. 4.3 Topic Modeling using a Nonparametric Gamma Process Construction Next we turn our attention to a high-dimensional topic modeling experiment using a nonparametric Gamma process construction. We elect to follow the experimental setup described in [6]. Specifically, we use the Poisson factor analysis framework of [32]. Denoting the vocabulary as V , and the documents in the corpus as D, we model the observed counts of the vocabulary terms as DV ×N = Poi(ΦΘ), where ΘK×N models the counts of K latent topics in the documents, and ΦV ×K denotes the factor load matrix, that encodes the relative importance of the vocabulary terms in the latent topics. Following standard Bayesian convention, we put model the columns of Φ as φ·,k ∼Dirichlet(α), using normalized Gamma variables: φv,k = γv P v γv , with γv ∼Γ(α, 1). Then we have θn,k ∼ Γ(rk, pj 1−pj ); we put β(a0, b0) priors on the document-specific mixing probabilities pj. We then set the rks to the atom weights generated by the constructive Gamma process definition of [14]; we refer the reader to that paper for the details of the formulation. It leads to a rich nonparametric construction of this Poisson factor analysis model for which closed-form Gibbs updates are infeasible, thereby providing a testing application area for the stochastic MCMC algorithms. We omit the Metropolis Hastings correction-based HMC and RHMC samplers in this evaluation due to poor scalability. 8 (a) (b) Figure 1: Test perplexities plotted against (a) post-burnin iterations and (b) wall-clock time for the 20-Newsgroups dataset. See text for experimental details. We use count matrices from the 20-Newsgroups and Reuters Corpus Volume 1 corpora [33]. The former has 2, 000 words and 18, 845 documents, while the second has a vocabulary of size 10, 000 over 804, 414 documents. We used a chronological 60−40 train-test split for both datasets. Following standard convention for stochastic algorithms, following each minibatch we learn document-specific parameters from 80% of the test set, and calculate test perplexities on the remaining 20%. Test perplexity, a commonly used measure for such evaluations, is detailed in the supplementary. As noted in [14], the atom weights have three sets of components: the Eks, Tks and the hyperparameters α, γ and c. As in [6], we ran three parallel chains for these parameters, collecting samples of the momenta from the Tk and hyperparameter chains for the MCEM mass updates. We kept the mass of the Ek chain fixed to IK, and chose K = 100 as number of latent topics. We initialized S_count, the E-step sample size in our algorithms, to 50 for NPHMC-EM and 100 for the rest. Increasing S_count over time yielded fairly minor improvements, hence we kept it fixed to the values above for simplicity. Additional details on batch sizes, learning rates, stochastic noise estimates, leapfrog iterations etc are provided in the supplementary. For the 20-Newsgroups dataset we ran all algorithms for 1, 500 burn-in iterations, and collected samples for the next 1, 500 steps thereafter, with a stride of 100, for perplexity calculations. For the Reuters dataset we used 2, 500 burn-in iterations. Note that for all these algorithms, an “iteration” corresponds to a full E-step with a stochastic minibatch. METHOD 20-NEWS REUTERS TIME(20-NEWS) SGHMC 759 996 0.047S SGHMC-EM 738 972 0.047S SGNHT 757 979 0.045S SGNHT-EM 719 968 0.045S SGR-NPHMC 723 952 0.410S SG-NPHMC 714 958 0.049S SG-NPHMC-EM 712 947 0.049S Table 4: Test perplexities and per-iteration runtimes on 20Newsgroups and Reuters datasets. The numbers obtained at the end of the runs are shown in Table 2, along with per-iteration runtimes. The post-burnin perplexity-vsiteration plots from the 20Newsgroups dataset are shown in Figure 1. We can see significant improvements from the MCEM framework for all samplers, with that of SGNHT being highly pronounced (719 vs 757); indeed, the SG-NPHMC samplers have lower perplexities (712) than those obtained by SGR-NPHMC (723), while being close to an order of magnitude faster per iteration for 20-Newsgroups even when the latter used diagonalized metric tensors, ostensibly by avoiding implicit systems of equations in the leapfrog steps to learn the kinetic masses. The framework yields nontrivial improvements for the Reuters dataset as well. 5 Conclusion We propose a new theoretically grounded approach to learning the mass matrices in Hamiltonianbased samplers, including both standard HMC and stochastic variants, using a Monte Carlo EM framework. In addition to a newly proposed stochastic sampler, we augment certain existing samplers with this technique to devise a set of new algorithms that learn the kinetic masses dynamically from the data in a flexible and scalable fashion. Experiments conducted on synthetic and real datasets demonstrate the efficacy and efficiency of our framework, when compared to existing Riemannian manifold-based samplers. 9 Acknowledgments We thank the anonymous reviewers for their insightful comments and suggestions. This material is based upon work supported by the National Science Foundation under Grant No. DMS-1418265. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. References [1] R. M. Neal. MCMC using Hamiltonian dynamics. In S. Brooks, A. Gelman, G. L. Jones, and X.-L. Meng, editors, Handbook of Markov Chain Monte Carlo, pages 113–162. Chapman & Hall / CRC Press, 2011. [2] S. Duane, A. D. Kennedy, B. J. Pendleton, and D. Roweth. Hybrid Monte Carlo. Physics Letters B, 195(2):216–222, 1987. [3] 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. [4] T. Chen, E. Fox, and C. Guestrin. Stochastic Gradient Hamiltonian Monte Carlo. In Proceedings of The 31st International Conference on Machine Learning (ICML), pages 1683–1691, 2014. [5] N. Ding, Y. Fang, R. Babbush, C. Chen, R. D. Skeel, and H. Neven. Bayesian Sampling using Stochastic Gradient Thermostats. In Advances in Neural Information Processing Systems (NIPS) 27, pages 3203–3211, 2014. [6] A. Roychowdhury, B. Kulis, and S. Parthasarathy. Robust Monte Carlo Sampling using Riemannian Nosé-Poincaré Hamiltonian Dynamics. In Proceedings of The 33rd International Conference on Machine Learning (ICML), pages 2673–2681, 2016. [7] M. Welling and Y. W. Teh. Bayesian Learning via Stochastic Gradient Langevin Dynamics. In Proceedings of The 28th International Conference on Machine Learning (ICML), pages 681–688, 2011. [8] S. Patterson and Y. W. Teh. Stochastic Gradient Riemannian Langevin Dynamics on the Probability Simplex. In Advances in Neural Information Processing Systems (NIPS) 26, pages 3102–3110, 2013. [9] S. D. Bond, B. J. Leimkuhler, and B. B. Laird. The Nosé-Poincaré Method for Constant Temperature Molecular Dynamics. J. Comput. Phys, 151:114–134, 1999. [10] G. C. G. Wei and M. A. Tanner. A Monte Carlo Implementation of the EM Algorithm and the Poor Man’s Data Augmentation Algorithms. Journal of the American Statistical Association, 85:699–704, 1990. [11] J. G. Booth and J. P. Hobert. Maximizing Generalized Linear Mixed Model Likelihoods with an Automated Monte Carlo EM Algorithm. Journal of the Royal Statistical Society Series B, 61(1):265–285, 1999. [12] C. E. McCulloch. Maximum Likelihood Algorithms for Generalized Linear Mixed Models. Journal of the American Statistical Association, 92(437):162–170, 1997. [13] R. A. Levine and G. Casella. Implementations of the Monte Carlo EM Algorithm. Journal Computational and Graphical Statistics, 10(3):422–439, 2001. [14] A. Roychowdhury and B. Kulis. Gamma Processes, Stick-Breaking, and Variational Inference. In Proceedings of the 18th International Conference on Artificial Intelligence and Statistics (AISTATS), pages 800–808, 2015. [15] B. Leimkuhler and S. Reich. Simulating Hamiltonian Dynamics. Cambridge University Press, 2004. 10 [16] H. Robbins and S. Monro. A Stochastic Approximation Method. The Annals of Mathematical Statistics, 22(3):400–407, 1951. [17] L. Yin and P. Ao. Existence and Construction of Dynamical Potential in Nonequilibrium Processes without Detailed Balance. Journal of Physics A: Mathematical and General, 39(27):8593, 2006. [18] D. Frenkel and B. Smit. Understanding Molecular Simulations: From Algorithms to Applications, 2nd Edition. Academic Press, 2001. [19] B. Leimkuhler and C. Matthews. Molecular Dynamics: With Deterministic and Stochastic Numerical Methods. Springer, 2015. [20] W. G. Hoover. Canonical dynamics: Equilibrium phase-space distributions. Physical Review A (General Physics), 31(3):1695–1697, 1985. [21] A. Jones and B. Leimkuhler. Adaptive stochastic methods for sampling driven molecular systems. Journal of Chemical Physics, 135(8):084125, 2011. [22] A. P. Dempster, N. M. Laird, and D. B. Rubin. Maximum Likelihood from Incomplete Data via the EM Algorithm. Journal of the Royal Statistical Society Series B, 39(1):1–38, 1977. [23] J. D. Dixon. Exact solution of linear equations using P-adic expansions. Numerische Mathematik, 40(1):137–141, 1982. [24] W. Eberly, M. Giesbrecht, P. Giorgi, A. Storjohann, and G. Villard. Solving sparse rational linear systems. In Proceedings of the 2006 international symposium on Symbolic and algebraic computation (ISSAC), pages 63–70, 2006. [25] C. P. Robert, T. Rydén, and D. M. Titterington. Convergence Controls for MCMC Algorithms, With Applications to Hidden Markov Chains. Journal of Statistical Computation and Simulation, 64:327–355, 1999. [26] G. Fort and E. Moulines. Convergence of the Monte Carlo Expectation Maximization for Curved Exponential Families. The Annals of Statistics, 31(4):1220–1259, 2003. [27] K. S. Chan and J. Ledolter. Monte Carlo EM Estimation for Time Series Models Involving Counts. Journal of the American Statistical Association, 90(429):242–252, 1995. [28] R. P. Sherman, Y.-Y. K. Ho, and S. R. Dalal. Conditions for convergence of Monte Carlo EM sequences with an application to product diffusion modeling . The Econometrics Journal, 2(2):248–267, 1999. [29] L. Bottou. On-line Learning and Stochastic Approximations. In On-line Learning in Neural Networks, pages 9–42. Cambridge University Press, 1998. [30] C. Uhler. Geometry of maximum likelihood estimation in Gaussian graphical models. Annals of Statistics, 40:238–261, 2012. [31] A. P. Dempster. Covariance selection. Biometrics, 28:157–175, 1972. [32] M. Zhou and L. Carin. Negative Binomial Process Count and Mixture Modeling. IEEE Trans. Pattern Anal. Mach. Intell., 37(2):307–320, 2015. [33] N. Srivastava, R. Salakhutdinov, and G. E. Hinton. Modeling documents with deep Boltzmann machines. In Proceedings of the 29th Conference on Uncertainty in Artificial Intelligence (UAI), pages 616–624, 2013. 11
2017
12
6,586
Style Transfer from Non-Parallel Text by Cross-Alignment Tianxiao Shen1 Tao Lei2 Regina Barzilay1 Tommi Jaakkola1 1MIT CSAIL 2ASAPP Inc. 1{tianxiao, regina, tommi}@csail.mit.edu 2tao@asapp.com Abstract This paper focuses on style transfer on the basis of non-parallel text. This is an instance of a broad family of problems including machine translation, decipherment, and sentiment modification. The key challenge is to separate the content from other aspects such as style. We assume a shared latent content distribution across different text corpora, and propose a method that leverages refined alignment of latent representations to perform style transfer. The transferred sentences from one style should match example sentences from the other style as a population. We demonstrate the effectiveness of this cross-alignment method on three tasks: sentiment modification, decipherment of word substitution ciphers, and recovery of word order.1 1 Introduction Using massive amounts of parallel data has been essential for recent advances in text generation tasks, such as machine translation and summarization. However, in many text generation problems, we can only assume access to non-parallel or mono-lingual data. Problems such as decipherment or style transfer are all instances of this family of tasks. In all of these problems, we must preserve the content of the source sentence but render the sentence consistent with desired presentation constraints (e.g., style, plaintext/ciphertext). The goal of controlling one aspect of a sentence such as style independently of its content requires that we can disentangle the two. However, these aspects interact in subtle ways in natural language sentences, and we can succeed in this task only approximately even in the case of parallel data. Our task is more challenging here. We merely assume access to two corpora of sentences with the same distribution of content albeit rendered in different styles. Our goal is to demonstrate that this distributional equivalence of content, if exploited carefully, suffices for us to learn to map a sentence in one style to a style-independent content vector and then decode it to a sentence with the same content but a different style. In this paper, we introduce a refined alignment of sentence representations across text corpora. We learn an encoder that takes a sentence and its original style indicator as input, and maps it to a style-independent content representation. This is then passed to a style-dependent decoder for rendering. We do not use typical VAEs for this mapping since it is imperative to keep the latent content representation rich and unperturbed. Indeed, richer latent content representations are much harder to align across the corpora and therefore they offer more informative content constraints. Moreover, we reap additional information from cross-generated (style-transferred) sentences, thereby getting two distributional alignment constraints. For example, positive sentences that are style-transferred into negative sentences should match, as a population, the given set of negative sentences. We illustrate this cross-alignment in Figure 1. 1Our code and data are available at https://github.com/shentianxiao/language-style-transfer. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Figure 1: An overview of the proposed cross-alignment method. X1 and X2 are two sentence domains with different styles y1 and y2, and Z is the shared latent content space. Encoder E maps a sentence to its content representation, and generator G generates the sentence back when combining with the original style. When combining with a different style, transferred ˜ X1 is aligned with X2 and ˜ X2 is aligned with X1 at the distributional level. To demonstrate the flexibility of the proposed model, we evaluate it on three tasks: sentiment modification, decipherment of word substitution ciphers, and recovery of word order. In all of these applications, the model is trained on non-parallel data. On the sentiment modification task, the model successfully transfers the sentiment while keeps the content for 41.5% of review sentences according to human evaluation, compared to 41.0% achieved by the control-gen model of Hu et al. (2017). It achieves strong performance on the decipherment and word order recovery tasks, reaching Bleu score of 57.4 and 26.1 respectively, obtaining 50.2 and 20.9 gap than a comparable method without cross-alignment. 2 Related work Style transfer in vision Non-parallel style transfer has been extensively studied in computer vision (Gatys et al., 2016; Zhu et al., 2017; Liu and Tuzel, 2016; Liu et al., 2017; Taigman et al., 2016; Kim et al., 2017; Yi et al., 2017). Gatys et al. (2016) explicitly extract content and style features, and then synthesize a new image by combining “content” features of one image with “style” features from another. More recent approaches learn generative networks directly via generative adversarial training (Goodfellow et al., 2014) from two given data domains X1 and X2. The key computational challenge in this non-parallel setting is aligning the two domains. For example, CoupledGANs (Liu and Tuzel, 2016) employ weight-sharing between networks to learn cross-domain representation, whereas CycleGAN (Zhu et al., 2017) introduces cycle consistency which relies on transitivity to regularize the transfer functions. While our approach has a similar high-level architecture, the discreteness of natural language does not allow us to reuse these models and necessitates the development of new methods. Non-parallel transfer in natural language In natural language processing, most tasks that involve generation (e.g., translation and summarization) are trained using parallel sentences. Our work most closely relates to approaches that do not utilize parallel data, but instead guide sentence generation from an indirect training signal (Mueller et al., 2017; Hu et al., 2017). For instance, Mueller et al. (2017) manipulate the hidden representation to generate sentences that satisfy a desired property (e.g., sentiment) as measured by a corresponding classifier. However, their model does not necessarily enforce content preservation. More similar to our work, Hu et al. (2017) aims at generating sentences with controllable attributes by learning disentangled latent representations (Chen et al., 2016). Their model builds on variational auto-encoders (VAEs) and uses independency constraints to enforce that attributes can be reliably inferred back from generated sentences. While our model builds on distributional cross-alignment for the purpose of style transfer and content preservation, these constraints can be added in the same way. Adversarial training over discrete samples Recently, a wide range of techniques addresses challenges associated with adversarial training over discrete samples generated by recurrent networks (Yu et al., 2016; Lamb et al., 2016; Hjelm et al., 2017; Che et al., 2017). In our work, we employ the Professor-Forcing algorithm (Lamb et al., 2016) which was originally proposed to close the gap between teacher-forcing during training and self-feeding during testing for recurrent networks. This design fits well with our scenario of style transfer that calls for cross-alignment. By using 2 continuous relaxation to approximate the discrete sampling process (Jang et al., 2016; Maddison et al., 2016), the training procedure can be effectively optimized through back-propagation (Kusner and Hernández-Lobato, 2016; Goyal et al., 2017). 3 Formulation In this section, we formalize the task of non-parallel style transfer and discuss the feasibility of the learning problem. We assume the data are generated by the following process: 1. a latent style variable y is generated from some distribution p(y); 2. a latent content variable z is generated from some distribution p(z); 3. a datapoint x is generated from conditional distribution p(x|y, z). We observe two datasets with the same content distribution but different styles y1 and y2, where y1 and y2 are unknown. Specifically, the two observed datasets X1 = {x(1) 1 , · · · , x(n) 1 } and X2 = {x(1) 2 , · · · , x(m) 2 } consist of samples drawn from p(x1|y1) and p(x2|y2) respectively. We want to estimate the style transfer functions between them, namely p(x1|x2; y1, y2) and p(x2|x1; y1, y2). A question we must address is when this estimation problem is feasible. Essentially, we only observe the marginal distributions of x1 and x2, yet we are going to recover their joint distribution: p(x1, x2|y1, y2) = Z z p(z)p(x1|y1, z)p(x2|y2, z)dz (1) As we only observe p(x1|y1) and p(x2|y2), y1 and y2 are unknown to us. If two different y and y′ lead to the same distribution p(x|y) = p(x|y′), then given a dataset X sampled from it, its underlying style can be either y or y′. Consider the following two cases: (1) both datasets X1 and X2 are sampled from the same style y; (2) X1 and X2 are sampled from style y and y′ respectively. These two scenarios have different joint distributions, but the observed marginal distributions are the same. To prevent such confusion, we constrain the underlying distributions as stated in the following proposition: Proposition 1. In the generative framework above, x1 and x2’s joint distribution can be recovered from their marginals only if for any different y, y′ ∈Y, distributions p(x|y) and p(x|y′) are different. This proposition basically says that X generated from different styles should be “distinct” enough, otherwise the transfer task between styles is not well defined. While this seems trivial, it may not hold even for simplified data distributions. The following examples illustrate how the transfer (and recovery) becomes feasible or infeasible under different model assumptions. As we shall see, for a certain family of styles Y, the more complex distribution for z, the more probable it is to recover the transfer function and the easier it is to search for the transfer. 3.1 Example 1: Gaussian Consider the common choice that z ∼N(0, I) has a centered isotropic Gaussian distribution. Suppose a style y = (A, b) is an affine transformation, i.e. x = Az + b + ϵ, where ϵ is a noise variable. For b = 0 and any orthogonal matrix A, Az + b ∼N(0, I) and hence x has the same distribution for any such styles y = (A, 0). In this case, the effect of rotation cannot be recovered. Interestingly, if z has a more complex distribution, such as a Gaussian mixture, then affine transformations can be uniquely determined. Lemma 1. Let z be a mixture of Gaussians p(z) = PK k=1 πkN(z; µk, Σk). Assume K ≥2, and there are two different Σi ̸= Σj. Let Y = {(A, b)||A| ̸= 0} be all invertible affine transformations, and p(x|y, z) = N(x; Az + b, ϵ2I), in which ϵ is a noise. Then for all y ̸= y′ ∈Y, p(x|y) and p(x|y′) are different distributions. Theorem 1. If the distribution of z is a mixture of Gaussians which has more than two different components, and x1, x2 are two affine transformations of z, then the transfer between them can be recovered given their respective marginals. 3 3.2 Example 2: Word substitution Consider here another example when z is a bi-gram language model and a style y is a vocabulary in use that maps each “content word” onto its surface form (lexical form). If we observe two realizations x1 and x2 of the same language z, the transfer and recovery problem becomes inferring a word alignment between x1 and x2. Note that this is a simplified version of language decipherment or translation. Nevertheless, the recovery problem is still sufficiently hard. To see this, let M1, M2 ∈Rn×n be the estimated bi-gram probability matrix of data X1 and X2 respectively. Seeking the word alignment is equivalent to finding a permutation matrix P such that P ⊤M1P ≈M2, which can be expressed as an optimization problem, min P ∥P ⊤M1P −M2∥2 The same formulation applies to graph isomorphism (GI) problems given M1 and M2 as the adjacency matrices of two graphs, suggesting that determining the existence and uniqueness of P is at least GI hard. Fortunately, if M as a graph is complex enough, the search problem could be more tractable. For instance, if each vertex’s weights of incident edges as a set is unique, then finding the isomorphism can be done by simply matching the sets of edges. This assumption largely applies to our scenario where z is a complex language model. We empirically demonstrate this in the results section. The above examples suggest that z as the latent content variable should carry most complexity of data x, while y as the latent style variable should have relatively simple effects. We construct the model accordingly in the next section. 4 Method Learning the style transfer function under our generative assumption is essentially learning the conditional distribution p(x1|x2; y1, y2) and p(x2|x1; y1, y2). Unlike in vision where images are continuous and hence the transfer functions can be learned and optimized directly, the discreteness of language requires us to operate through the latent space. Since x1 and x2 are conditionally independent given the latent content variable z, p(x1|x2; y1, y2) = Z z p(x1, z|x2; y1, y2)dz = Z z p(z|x2, y2) · p(x1|y1, z)dz = Ez∼p(z|x2,y2)[p(x1|y1, z)] (2) This suggests us learning an auto-encoder model. Specifically, a style transfer from x2 to x1 involves two steps—an encoding step that infers x2’s content z ∼p(z|x2, y2), and a decoding step which generates the transferred counterpart from p(x1|y1, z). In this work, we approximate and train p(z|x, y) and p(x|y, z) using neural networks (where y ∈{y1, y2}). Let E : X × Y →Z be an encoder that infers the content z for a given sentence x and a style y, and G : Y × Z →X be a generator that generates a sentence x from a given style y and content z. E and G form an auto-encoder when applying to the same style, and thus we have reconstruction loss, Lrec(θE, θG) = Ex1∼X1[−log pG(x1|y1, E(x1, y1))] + Ex2∼X2[−log pG(x2|y2, E(x2, y2))] (3) where θ are the parameters to estimate. In order to make a meaningful transfer by flipping the style, X1 and X2’s content space must coincide, as our generative framework presumed. To constrain that x1 and x2 are generated from the same latent content distribution p(z), one option is to apply a variational auto-encoder (Kingma and Welling, 2013). A VAE imposes a prior density p(z), such as z ∼N(0, I), and uses a KL-divergence regularizer to align both posteriors pE(z|x1, y1) and pE(z|x2, y2) to it, LKL(θE) = Ex1∼X1[DKL(pE(z|x1, y1)∥p(z))] + Ex2∼X2[DKL(pE(z|x2, y2)∥p(z))] (4) 4 The overall objective is to minimize Lrec + LKL, whose opposite is the variational lower bound of data likelihood. However, as we have argued in the previous section, restricting z to a simple and even distribution and pushing most complexity to the decoder may not be a good strategy for non-parallel style transfer. In contrast, a standard auto-encoder simply minimizes the reconstruction error, encouraging z to carry as much information about x as possible. On the other hand, it lowers the entropy in p(x|y, z), which helps to produce meaningful style transfer in practice as we flip between y1 and y2. Without explicitly modeling p(z), it is still possible to force distributional alignment of p(z|y1) and p(z|y2). To this end, we introduce two constrained variants of auto-encoder. 4.1 Aligned auto-encoder Dispense with VAEs that make an explicit assumption about p(z) and align both posteriors to it, we align pE(z|y1) and pE(z|y2) with each other, which leads to the following constrained optimization problem: θ∗= arg min θ Lrec(θE, θG) s.t. E(x1, y1) d= E(x2, y2) x1 ∼X1, x2 ∼X2 (5) In practice, a Lagrangian relaxation of the primal problem is instead optimized. We introduce an adversarial discriminator D to align the aggregated posterior distribution of z from different styles (Makhzani et al., 2015). D aims to distinguish between these two distributions: Ladv(θE, θD) = Ex1∼X1[−log D(E(x1, y1))] + Ex2∼X2[−log(1 −D(E(x2, y2)))] (6) The overall training objective is a min-max game played among the encoder E, generator G and discriminator D. They constitute an aligned auto-encoder: min E,G max D Lrec −λLadv (7) We implement the encoder E and generator G using single-layer RNNs with GRU cell. E takes an input sentence x with initial hidden state y, and outputs the last hidden state z as its content representation. G generates a sentence x conditioned on latent state (y, z). To align the distributions of z1 = E(x1, y1) and z2 = E(x2, y2), the discriminator D is a feed-forward network with a single hidden layer and a sigmoid output layer. 4.2 Cross-aligned auto-encoder The second variant, cross-aligned auto-encoder, directly aligns the transfered samples from one style with the true samples from the other. Under the generative assumption, p(x2|y2) = R x1 p(x2|x1; y1, y2)p(x1|y1)dx1, thus x2 (sampled from the left-hand side) should exhibit the same distribution as transferred x1 (sampled from the right-hand side), and vice versa. Similar to our first model, the second model uses two discriminators D1 and D2 to align the populations. D1’s job is to distinguish between real x1 and transferred x2, and D2’s job is to distinguish between real x2 and transferred x1. Adversarial training over the discrete samples generated by G hinders gradients propagation. Although sampling-based gradient estimator such as REINFORCE (Williams, 1992) can by adopted, training with these methods can be unstable due to the high variance of the sampled gradient. Instead, we employ two recent techniques to approximate the discrete training (Hu et al., 2017; Lamb et al., 2016). First, instead of feeding a single sampled word as the input to the generator RNN, we use the softmax distribution over words instead. Specifically, during the generating process of transferred x2 from G(y1, z2), suppose at time step t the output logit vector is vt. We feed its peaked distribution softmax(vt/γ) as the next input, where γ ∈(0, 1) is a temperature parameter. Secondly, we use Professor-Forcing (Lamb et al., 2016) to match the sequence of hidden states instead of the output words, which contains the information about outputs and is smoothly distributed. That is, the input to the discriminator D1 is the sequence of hidden states of either (1) G(y1, z1) teacher-forced by a real example x1, or (2) G(y1, z2) self-fed by previous soft distributions. 5 Figure 2: Cross-aligning between x1 and transferred x2. For x1, G is teacher-forced by its words w1w2 · · · wt. For transfered x2, G is self-fed by previous output logits. The sequence of hidden states h0, · · · , ht and ˜h0, · · · , ˜ht are passed to discriminator D1 to be aligned. Note that our first variant aligned auto-encoder is a special case of this, where only h0 and ˜h0, i.e. z1 and z2, are aligned. Algorithm 1 Cross-aligned auto-encoder training. The hyper-parameters are set as λ = 1, γ = 0.001 and learning rate is 0.0001 for all experiments in this paper. Input: Two corpora of different styles X1, X2. Lagrange multiplier λ, temperature γ. Initialize θE, θG, θD1, θD2 repeat for p = 1, 2; q = 2, 1 do Sample a mini-batch of k examples {x(i) p }k i=1 from Xp Get the latent content representations z(i) p = E(x(i) p , yp) Unroll G from initial state (yp, z(i) p ) by feeding x(i) p , and get the hidden states sequence h(i) p Unroll G from initial state (yq, z(i) p ) by feeding previous soft output distribution with temperature γ, and get the transferred hidden states sequence ˜h(i) p end for Compute the reconstruction Lrec by Eq. (3) Compute D1’s (and symmetrically D2’s) loss: Ladv1 = −1 k k X i=1 log D1(h(i) 1 ) −1 k k X i=1 log(1 −D1(˜h(i) 2 )) (8) Update {θE, θG} by gradient descent on loss Lrec −λ(Ladv1 + Ladv2) (9) Update θD1 and θD2 by gradient descent on loss Ladv1 and Ladv2 respectively until convergence Output: Style transfer functions G(y2, E(·, y1)) : X1 →X2 and G(y1, E(·, y2)) : X2 →X1 The running procedure of our cross-aligned auto-encoder is illustrated in Figure 2. Note that crossaligning strengthens the alignment of latent variable z over the recurrent network of generator G. By aligning the whole sequence of hidden states, it prevents z1 and z2’s initial misalignment from propagating through the recurrent generating process, as a result of which the transferred sentence may end up somewhere far from the target domain. We implement both D1 and D2 using convolutional neural networks for sequence classification (Kim, 2014). The training algorithm is presented in Algorithm 1. 6 5 Experimental setup Sentiment modification Our first experiment focuses on text rewriting with the goal of changing the underlying sentiment, which can be regarded as “style transfer” between negative and positive sentences. We run experiments on Yelp restaurant reviews, utilizing readily available user ratings associated with each review. Following standard practice, reviews with rating above three are considered positive, and those below three are considered negative. While our model operates at the sentence level, the sentiment annotations in our dataset are provided at the document level. We assume that all the sentences in a document have the same sentiment. This is clearly an oversimplification, since some sentences (e.g., background) are sentiment neutral. Given that such sentences are more common in long reviews, we filter out reviews that exceed 10 sentences. We further filter the remaining sentences by eliminating those that exceed 15 words. The resulting dataset has 250K negative sentences, and 350K positive ones. The vocabulary size is 10K after replacing words occurring less than 5 times with the “<unk>” token. As a baseline model, we compare against the control-gen model of Hu et al. (2017). To quantitatively evaluate the transfered sentences, we adopt a model-based evaluation metric similar to the one used for image transfer (Isola et al., 2016). Specifically, we measure how often a transferred sentence has the correct sentiment according to a pre-trained sentiment classifier. For this purpose, we use the TextCNN model as described in Kim (2014). On our simplified dataset for style transfer, it achieves nearly perfect accuracy of 97.4%. While the quantitative evaluation provides some indication of transfer quality, it does not capture all the aspects of this generation task. Therefore, we also perform two human evaluations on 500 sentences randomly selected from the test set2. In the first evaluation, the judges were asked to rank generated sentences in terms of their fluency and sentiment. Fluency was rated from 1 (unreadable) to 4 (perfect), while sentiment categories were “positive”, “negative”, or “neither” (which could be contradictory, neutral or nonsensical). In the second evaluation, we evaluate the transfer process comparatively. The annotator was shown a source sentence and the corresponding outputs of the systems in a random order, and was asked “Which transferred sentence is semantically equivalent to the source sentence with an opposite sentiment?”. They can be both satisfactory, A/B is better, or both unsatisfactory. We collect two labels for each question. The label agreement and conflict resolution strategy can be found in the supplementary material. Note that the two evaluations are not redundant. For instance, a system that always generates the same grammatically correct sentence with the right sentiment independently of the source sentence will score high in the first evaluation setup, but low in the second one. Word substitution decipherment Our second set of experiments involves decipherment of word substitution ciphers, which has been previously explored in NLP literature (Dou and Knight, 2012; Nuhn and Ney, 2013). These ciphers replace every word in plaintext (natural language) with a cipher token according to a 1-to-1 substitution key. The decipherment task is to recover the plaintext from ciphertext. It is trivial if we have access to parallel data. However we are interested to consider a non-parallel decipherment scenario. For training, we select 200K sentences as X1, and apply a substitution cipher f on a different set of 200K sentences to get X2. While these sentences are nonparallel, they are drawn from the same distribution from the review dataset. The development and test sets have 100K parallel sentences D1 = {x(1), · · · , x(n)} and D2 = {f(x(1)), · · · , f(x(n))}. We can quantitatively compare between D1 and transferred (deciphered) D2 using Bleu score (Papineni et al., 2002). Clearly, the difficulty of this decipherment task depends on the number of substituted words. Therefore, we report model performance with respect to the percentage of the substituted vocabulary. Note that the transfer models do not know that f is a word substitution function. They learn it entirely from the data distribution. In addition to having different transfer models, we introduce a simple decipherment baseline based on word frequency. Specifically, we assume that words shared between X1 and X2 do not require translation. The rest of the words are mapped based on their frequency, and ties are broken arbitrarily. Finally, to assess the difficulty of the task, we report the accuracy of a machine translation system trained on a parallel corpus (Klein et al., 2017). 2we eliminated 37 sentences from them that were judged as neutral by human judges. 7 Method accuracy Hu et al. (2017) 83.5 Variational auto-encoder 23.2 Aligned auto-encoder 48.3 Cross-aligned auto-encoder 78.4 Table 1: Sentiment accuracy of transferred sentences, as measured by a pretrained classifier. Method sentiment fluency overall transfer Hu et al. (2017) 70.8 3.2 41.0 Cross-align 62.6 2.8 41.5 Table 2: Human evaluations on sentiment, fluency and overall transfer quality. Fluency rating is from 1 (unreadable) to 4 (perfect). Overall transfer quality is evaluated in a comparative manner, where the judge is shown a source sentence and two transferred sentences, and decides whether they are both good, both bad, or one is better. Word order recovery Our final experiments focus on the word ordering task, also known as bag translation (Brown et al., 1990; Schmaltz et al., 2016). By learning the style transfer functions between original English sentences X1 and shuffled English sentences X2, the model can be used to recover the original word order of a shuffled sentence (or conversely to randomly permute a sentence). The process to construct non-parallel training data and parallel testing data is the same as in the word substitution decipherment experiment. Again the transfer models do not know that f is a shuffle function and learn it completely from data. 6 Results Sentiment modification Table 1 and Table 2 show the performance of various models for both human and automatic evaluation. The control-gen model of Hu et al. (2017) performs better in terms of sentiment accuracy in both evaluations. This is not surprising because their generation is directly guided by a sentiment classifier. Their system also achieves higher fluency score. However, these gains do not translate into improvements in terms of the overall transfer, where our model faired better. As can be seen from the examples listed in Table 3, our model is more consistent with the grammatical structure and semantic meaning of the source sentence. In contrast, their model achieves sentiment change by generating an entirely new sentence which has little overlap with the original. The discrepancy between the two experiments demonstrate the crucial importance of developing appropriate evaluation measures for comparing methods for style transfer. Word substitution decipherment Table 4 summarizes the performance of our model and the baselines on the decipherment task, at various levels of word substitution. Consistent with our intuition, the last row in this table shows that the task is trivial when the parallel data is provided. In non-parallel case, the difficulty of the task is driven by the substitution rate. Across all the testing conditions, our cross-aligned model consistently outperforms its counterparts. The difference becomes more pronounced as the task becomes harder. When the substitution rate is 20%, all methods do a reasonably good job in recovering substitutions. However, when 100% of the words are substituted (as expected in real language decipherment), the poor performance of variational autoencoder and aligned auto-encoder rules out their application for this task. Word order recovery The last column in Table 4 demonstrates the performance on the word order recovery task. Order recovery is much harder—even when trained with parallel data, the machine translation model achieves only 64.6 Bleu score. Note that some generated orderings may be completely valid (e.g., reordering conjunctions), but the models will be penalized for producing them. In this task, only the cross-aligned auto-encoder achieves grammatical reorder to a certain extent, demonstrated by its Bleu score 26.1. Other models fail this task, doing no better than no transfer. 8 From negative to positive consistently slow . consistently good . consistently fast . my goodness it was so gross . my husband ’s steak was phenomenal . my goodness was so awesome . it was super dry and had a weird taste to the entire slice . it was a great meal and the tacos were very kind of good . it was super flavorful and had a nice texture of the whole side . From positive to negative i love the ladies here ! i avoid all the time ! i hate the doctor here ! my appetizer was also very good and unique . my bf was n’t too pleased with the beans . my appetizer was also very cold and not fresh whatsoever . came here with my wife and her grandmother ! came here with my wife and hated her ! came here with my wife and her son . Table 3: Sentiment transfer samples. The first line is an input sentence, the second and third lines are the generated sentences after sentiment transfer by Hu et al. (2017) and our cross-aligned auto-encoder, respectively. Method Substitution decipher Order recover 20% 40% 60% 80% 100% No transfer (copy) 56.4 21.4 6.3 4.5 0 5.1 Unigram matching 74.3 48.1 17.8 10.7 1.2 Variational auto-encoder 79.8 59.6 44.6 34.4 0.9 5.3 Aligned auto-encoder 81.0 68.9 50.7 45.6 7.2 5.2 Cross-aligned auto-encoder 83.8 79.1 74.7 66.1 57.4 26.1 Parallel translation 99.0 98.9 98.2 98.5 97.2 64.6 Table 4: Bleu scores of word substitution decipherment and word order recovery. 7 Conclusion Transferring languages from one style to another has been previously trained using parallel data. In this work, we formulate the task as a decipherment problem with access only to non-parallel data. The two data collections are assumed to be generated by a latent variable generative model. Through this view, our method optimizes neural networks by forcing distributional alignment (invariance) over the latent space or sentence populations. We demonstrate the effectiveness of our method on tasks that permit quantitative evaluation, such as sentiment transfer, word substitution decipherment and word ordering. The decipherment view also provides an interesting open question—when can the joint distribution p(x1, x2) be recovered given only marginal distributions? We believe addressing this general question would promote the style transfer research in both vision and NLP. 9 Acknowledgments We thank Nicholas Matthews for helping to facilitate human evaluations, and Zhiting Hu for sharing his code. We also thank Jonas Mueller, Arjun Majumdar, Olga Simek, Danelle Shah, MIT NLP group and the reviewers for their helpful comments. This work was supported by MIT Lincoln Laboratory. References Peter F Brown, John Cocke, Stephen A Della Pietra, Vincent J Della Pietra, Fredrick Jelinek, John D Lafferty, Robert L Mercer, and Paul S Roossin. A statistical approach to machine translation. Computational linguistics, 16(2):79–85, 1990. Tong Che, Yanran Li, Ruixiang Zhang, R Devon Hjelm, Wenjie Li, Yangqiu Song, and Yoshua Bengio. Maximum-likelihood augmented discrete generative adversarial networks. arXiv preprint arXiv:1702.07983, 2017. 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, 2016. Qing Dou and Kevin Knight. Large scale decipherment for out-of-domain machine translation. In Proceedings of the 2012 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, pages 266–275. Association for Computational Linguistics, 2012. Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2414–2423, 2016. 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. Kartik Goyal, Chris Dyer, and Taylor Berg-Kirkpatrick. Differentiable scheduled sampling for credit assignment. arXiv preprint arXiv:1704.06970, 2017. R Devon Hjelm, Athul Paul Jacob, Tong Che, Kyunghyun Cho, and Yoshua Bengio. Boundaryseeking generative adversarial networks. arXiv preprint arXiv:1702.08431, 2017. Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Controllable text generation. arXiv preprint arXiv:1703.00955, 2017. Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint arXiv:1611.07004, 2016. Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016. 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. Yoon Kim. Convolutional neural networks for sentence classification. arXiv preprint arXiv:1408.5882, 2014. Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M Rush. Opennmt: Open-source toolkit for neural machine translation. arXiv preprint arXiv:1701.02810, 2017. Matt J Kusner and José Miguel Hernández-Lobato. Gans for sequences of discrete elements with the gumbel-softmax distribution. arXiv preprint arXiv:1611.04051, 2016. 10 Alex M Lamb, Anirudh Goyal ALIAS PARTH GOYAL, Ying Zhang, Saizheng Zhang, Aaron C Courville, and Yoshua Bengio. Professor forcing: A new algorithm for training recurrent networks. In Advances In Neural Information Processing Systems, pages 4601–4609, 2016. Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Advances in Neural Information Processing Systems, pages 469–477, 2016. Ming-Yu Liu, Thomas Breuel, and Jan Kautz. Unsupervised image-to-image translation networks. arXiv preprint arXiv:1703.00848, 2017. Chris J Maddison, Andriy Mnih, and Yee Whye Teh. The concrete distribution: A continuous relaxation of discrete random variables. arXiv preprint arXiv:1611.00712, 2016. Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, Ian Goodfellow, and Brendan Frey. Adversarial autoencoders. arXiv preprint arXiv:1511.05644, 2015. Jonas Mueller, Tommi Jaakkola, and David Gifford. Sequence to better sequence: continuous revision of combinatorial structures. International Conference on Machine Learning (ICML), 2017. Malte Nuhn and Hermann Ney. Decipherment complexity in 1: 1 substitution ciphers. In ACL (1), pages 615–621, 2013. Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting on association for computational linguistics, pages 311–318. Association for Computational Linguistics, 2002. Allen Schmaltz, Alexander M. Rush, and Stuart Shieber. Word ordering without syntax. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pages 2319–2324. Association for Computational Linguistics, 2016. Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. arXiv preprint arXiv:1611.02200, 2016. Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992. Zili Yi, Hao Zhang, Ping Tan Gong, et al. Dualgan: Unsupervised dual learning for image-to-image translation. arXiv preprint arXiv:1704.02510, 2017. Lantao Yu, Weinan Zhang, Jun Wang, and Yong Yu. Seqgan: sequence generative adversarial nets with policy gradient. arXiv preprint arXiv:1609.05473, 2016. Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. arXiv preprint arXiv:1703.10593, 2017. 11 A Proof of Lemma 1 Lemma 1. Let z be a mixture of Gaussians p(z) = PK k=1 πkN(z; µk, Σk). Assume K ≥2, and there are two different Σi ̸= Σj. Let Y = {(A, b)||A| ̸= 0} be all invertible affine transformations, and p(x|y, z) = N(x; Az + b, ϵ2I), in which ϵ is a noise. Then for all y ̸= y′ ∈Y, p(x|y) and p(x|y′) are different distributions. Proof. p(x|y = (A, b)) = K X k=1 πkN(x; Aµk + b, AΣkA⊤+ ϵ2I) For different y = (A, b) and y′ = (A′, b′), p(x|y) = p(x|y′) entails that for k = 1, · · · , K, Aµk + b = A′µk + b′ AΣkA⊤= A′ΣkA′⊤ Since all Y are invertible, (A−1A′)Σk(A−1A′)⊤= Σk Suppose Σk = QkDkQ⊤ k is Σk’s orthogonal diagonalization. If k = 1, all solutions for A−1A′ have the form: n QD1/2UD−1/2Q⊤ U is orthogonal o However, when K ≥2 and there are two different Σi ̸= Σj, the only solution is A−1A′ = I, i.e. A = A′, and thus b = b′. Therefore, for all y ̸= y′, p(x|y) ̸= p(x|y′). 12
2017
120
6,587
Unsupervised Learning of Disentangled Representations from Video Emily Denton Department of Computer Science New York University denton@cs.nyu.edu Vighnesh Birodkar Department of Computer Science New York University vighneshbirodkar@nyu.edu Abstract We present a new model DRNET that learns disentangled image representations from video. Our approach leverages the temporal coherence of video and a novel adversarial loss to learn a representation that factorizes each frame into a stationary part and a temporally varying component. The disentangled representation can be used for a range of tasks. For example, applying a standard LSTM to the time-vary components enables prediction of future frames. We evaluate our approach on a range of synthetic and real videos, demonstrating the ability to coherently generate hundreds of steps into the future. 1 Introduction Unsupervised learning from video is a long-standing problem in computer vision and machine learning. The goal is to learn, without explicit labels, a representation that generalizes effectively to a previously unseen range of tasks, such as semantic classification of the objects present, predicting future frames of the video or classifying the dynamic activity taking place. There are several prevailing paradigms: the first, known as self-supervision, uses domain knowledge to implicitly provide labels (e.g. predicting the relative position of patches on an object [4] or using feature tracks [36]). This allows the problem to be posed as a classification task with self-generated labels. The second general approach relies on auxiliary action labels, available in real or simulated robotic environments. These can either be used to train action-conditional predictive models of future frames [2, 20] or inversekinematics models [1] which attempt to predict actions from current and future frame pairs. The third and most general approaches are predictive auto-encoders (e.g.[11, 12, 18, 31]) which attempt to predict future frames from current ones. To learn effective representations, some kind of constraint on the latent representation is required. In this paper, we introduce a form of predictive auto-encoder which uses a novel adversarial loss to factor the latent representation for each video frame into two components, one that is roughly time-independent (i.e. approximately constant throughout the clip) and another that captures the dynamic aspects of the sequence, thus varying over time. We refer to these as content and pose components, respectively. The adversarial loss relies on the intuition that while the content features should be distinctive of a given clip, individual pose features should not. Thus the loss encourages pose features to carry no information about clip identity. Empirically, we find that training with this loss to be crucial to inducing the desired factorization. We explore the disentangled representation produced by our model, which we call DisentangledRepresentation Net (DRNET ), on a variety of tasks. The first of these is predicting future video frames, something that is straightforward to do using our representation. We apply a standard LSTM model to the pose features, conditioning on the content features from the last observed frame. Despite the simplicity of our model relative to other video generation techniques, we are able to generate convincing long-range frame predictions, out to hundreds of time steps in some instances. This is significantly further than existing approaches that use real video data. We also show that DRNET can 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. be used for classification. The content features capture the semantic content of the video thus can be used to predict object identity. Alternately, the pose features can be used for action prediction. 2 Related work On account of its natural invariances, image data naturally lends itself to an explicit “what” and “where” representation. The capsule model of Hinton et al. [10] performed this separation via an explicit auto-encoder structure. Zhao et al. [40] proposed a multi-layered version, which has similarities to ladder networks [23]. Several weakly supervised approaches have been proposed to factor images into style and content (e.g. [19, 24]). These methods all operate on static images, whereas our approach uses temporal structure to separate the components. Factoring video into time-varying and time-independent components has been explored in many settings. Classic structure-from-motion methods use an explicit affine projection model to extract a 3D point cloud and camera homography matrices [8]. In contrast, Slow Feature Analysis [38] has no model, instead simply penalizing the rate of change in time-independent components and encouraging their decorrelation. Most closely related to ours is Villegas et al. [33] which uses an unsupervised approach to factoring video into content and motion. Their architecture is also broadly similar to ours, but the loss functions differ in important ways. They rely on pixel/gradient space ℓp-norm reconstructions, plus a GAN term [6] that encourages the generated frames to be sharp. We also use an ℓ2 pixel-space reconstruction. However, this pixel-space loss is only applied, in combination with a novel adversarial term applied to the pose features, to learn the disentangled representation. In contrast to [33], our forward model acts on latent pose vectors rather than predicting pixels directly. Other approaches explore general methods for learning disentangled representations from video. Kulkarni et al. [14] show how explicit graphics code can be learned from datasets with systematic dimensions of variation. Whitney et al. [37] use a gating principle to encourage each dimension of the latent representation to capture a distinct mode of variation. Grathwohl et al. [7] propose a deep variational model to disentangle space and time in video sequences. A range of generative video models, based on deep nets, have recently been proposed. Ranzato et al. [22] adopt a discrete vector quantization approach inspired by text models. Srivastava et al. [31] use LSTMs to generate entire frames. Video Pixel Networks [12] use these models is a conditional manner, generating one pixel at a time in raster-scan order (similar image models include [27, 32]). Finn et al. [5] use an LSTM framework to model motion via transformations of groups of pixels. Cricri et al. [3] use a ladder of stacked-autoencoders. Other works predict optical flows fields that can be used to extrapolate motion beyond the current frame, e.g. [17, 39, 35]. In contrast, a single pose vector is predicted in our model, rather than a spatial field. Chiappa et al. [2] and Oh et al. [20] focus on prediction in video game environments, where known actions at each frame can be permit action-conditional generative models that can give accurate long-range predictions. In contrast to the above works, whose latent representations combine both content and motion, our approach relies on a factorization of the two, with a predictive model only being applied to the latter. Furthermore, we do not attempt to predict pixels directly, instead applying the forward model in the latent space. Chiappa et al. [2], like our approach, produces convincing long-range generations. However, the video game environment is somewhat more constrained than the real-world video we consider since actions are provided during generation. Several video prediction approaches have been proposed that focus on handling the inherent uncertainty in predicting the future. Mathieu et al. [18] demonstrate that a loss based on GANs can produce sharper generations than traditional ℓ2-based losses. [34] train a series of models, which aim to span possible outcomes and select the most likely one at any given instant. While we considered GANbased losses, the more constrained nature of our model, and the fact that our forward model does not directly generate in pixel-space, meant that standard deterministic losses worked satisfactorily. 3 Approach In our model, two separate encoders produce distinct feature representations of content and pose for each frame. They are trained by requiring that the content representation of frame xt and the pose representation of future frame xt+k can be combined (via concatenation) and decoded to predict the pixels of future frame xt+k. However, this reconstruction constraint alone is insufficient to induce 2 the desired factorization between the two encoders. We thus introduce a novel adversarial loss on the pose features that prevents them from being discriminable from one video to another, thus ensuring that they cannot contain content information. A further constraint, motivated by the notion that content information should vary slowly over time, encourages temporally close content vectors to be similar to one another. More formally, let xi = (x1 i , ..., xT i ) denote a sequence of T images from video i. We subsequently drop index i for brevity. Let Ec denote a neural network that maps an image xt to the content representation ht c which captures structure shared across time. Let Ep denote a neural network that maps an image xt to the pose representation ht p capturing content that varies over time. Let D denote a decoder network that maps a content representation from a frame, ht c, and a pose representation ht+k p from future time step t + k to a prediction of the future frame ˜xt+k. Finally, C is the scene discriminator network that takes pairs of pose vectors (h1, h2) and outputs a scalar probability that they came from the same video or not. The loss function used during training has several terms: Reconstruction loss: We use a standard per-pixel ℓ2 loss between the predicted future frame ˜xt+k and the actual future frame xt+k for some random frame offset k ∈[0, K]: Lreconstruction(D) = ||D(ht c, ht+k p ) −xt+k||2 2 (1) Note that many recent works on video prediction that rely on more complex losses that can capture uncertainty, such as GANs [19, 6]. Similarity loss: To ensure the content encoder extracts mostly time-invariant representations, we penalize the squared error between the content features ht c, ht+k c of neighboring frames k ∈[0, K]: Lsimilarity(Ec) = ||Ec(xt) −Ec(xt+k)||2 2 (2) Adversarial loss: We now introduce a novel adversarial loss that exploits the fact that the objects present do not typically change within a video, but they do between different videos. Our desired disenanglement would thus have the content features be (roughly) constant within a clip, but distinct between them. This implies that the pose features should not carry any information about the identity of objects within a clip. We impose this via an adversarial framework between the scene discriminator network C and pose encoder Ep, shown in Fig. 1. The latter provides pairs of pose vectors, either computed from the same video (ht p,i, ht+k p,i ) or from different ones (ht p,i, ht+k p,j ), for some other video j. The discriminator then attempts to classify the pair as being from the same/different video using a cross-entropy loss: −Ladversarial(C) = log(C(Ep(xt i), Ep(xt+k i ))) + log(1 −C(Ep(xt i), Ep(xt+k j ))) (3) The other half of the adversarial framework imposes a loss function on the pose encoder Ep that tries to maximize the uncertainty (entropy) of the discriminator output on pairs of frames from the same clip: −Ladversarial(Ep) = 1 2 log(C(Ep(xt i), Ep(xt+k i ))) + 1 2 log(1 −C(Ep(xt i), Ep(xt+k i ))) (4) Thus the pose encoder is encouraged to produce features that the discriminator is unable to classify if they come from the same clip or not. In so doing, the pose features cannot carry information about object content, yielding the desired factorization. Note that this does assume that the object’s pose is not distinctive to a particular clip. While adversarial training is also used by GANs, our setup purely considers classification; there is no generator network, for example. Overall training objective: During training we minimize the sum of the above losses, with respect to Ec, Ep, D and C: L = Lreconstruction(Ec, Ep, D)+αLsimilarity(Ec)+β(Ladversarial(Ep)+Ladversarial(C)) (5) where α and β are hyper-parameters. The first three terms can be jointly optimized, but the discriminator C is updated while the other parts of the model (Ec, Ep, D) are held constant. The overall model is shown in Fig. 1. Details of the training procedure and model architectures for Ec, Ep, D and C are given in Section 4.1. 3 Target 1 (same scene) Target 0 (different scenes) Pose encoder: Ep(x) Scene discriminator: C(Ep(x), Ep(x’)) Target 1 (same scene) Target 0 (different scenes) Scene discriminator: D(Ep(x), Ep(x’)) LBCE LBCE xi t xi t+k xi t xj t+k Pose encoder: Ep(x) Lsimilarity Lreconstruction Content encoder: Ec(x) Frame decoder: D( Ec(xt), Ep(xt+k) ) xt+k xt+k’ xt xt+k x t+k ~ Target=0.5 (maximal uncertainty) Ladversarial Figure 1: Left: The discriminator C is trained with binary cross entropy (BCE) loss to predict if a pair of pose vectors comes from the same (top portion) or different (lower portion) scenes. xi and xj denote frames from different sequences i and j. The frame offset k is sampled uniformly in the range [0, K]. Note that when C is trained, the pose encoder Ep is fixed. Right: The overall model, showing all terms in the loss function. Note that when the pose encoder Ep is updated, the scene discriminator is held fixed. Frame decoder: D( Ec(xt), Ep(xt+k) ) xt xt+k x t+k ~ Target 1/2 (maximal uncertainty) Ladversary Scene discriminator not updated, only used for pose encoder loss Ec xt LSTM hc t hc t Ep xt-1 hp t-1 D hp t ~ LSTM hc t Ep hp t hp t+1 ~ LSTM hc t hp t+1 ~ hc t D LSTM hc t hp t+2 ~ hc t hp t+3 ~ ~ hp t+2 D hc t xt x t+3 ~ x t+2 ~ x t+1 ~ Figure 2: Generating future frames by recurrently predicting hp, the latent pose vector. 3.1 Forward Prediction After training, the pose and content encoders Ep and Ec provide a representation which enables video prediction in a straightforward manner. Given a frame xt, the encoders produce ht p and ht c respectively. To generate the next frame, we use these as input to an LSTM model to predict the next pose features ht+1 p . These are then passed (along with the content features) to the decoder, which generates a pixel-space prediction ˜xt+1: ˜ht+1 p = LSTM(Ep(xt), ht c) ˜xt+1 = D(˜ht+1 p , ht c) (6) ˜ht+2 p = LSTM(˜ht+1 p , ht c) ˜xt+2 = D(˜ht+2 p , ht c) (7) Note that while pose estimates are generated in a recurrent fashion, the content features ht c remain fixed from the last observed real frame. This relies on the nature of Lreconstruction which ensured that content features can be combined with future pose vectors to give valid reconstructions. The LSTM is trained separately from the main model using a standard ℓ2 loss between ˜ht+1 p and ht+1 p . Note that this generative model is far simpler than many other recent approaches, e.g. [12]. This largely due to the forward model being applied within our disentangled representation, rather than directly on raw pixels. 3.2 Classification Another application of our disentangled representation is to use it for classification tasks. Content features, which are trained to be invariant to local temporal changes, can be used to classify the semantic content of an image. Conversely, a sequence of pose features can be used to classify actions in a video sequence. In either case, we train a two layer classifier network S on top of either hc or hp, with its output predicting the class label y. 4 4 Experiments We evaluate our model on both synthetic (MNIST, NORB, SUNCG) and real (KTH Actions) video datasets. We explore several tasks with our model: (i) the ability to cleanly factorize into content and pose components; (ii) forward prediction of video frames using the approach from Section 3.1; (iii) using the pose/content features for classification tasks. 4.1 Model details We explored a variety of convolutional architectures for the content encoder Ec, pose encoder Ep and decoder D. For MNIST, Ec, Ep and D all use a DCGAN architecture [21] with |hp| = 5 and |hc| = 128. The encoders consist of 5 convolutional layers with subsampling. Batch normalization and Leaky ReLU’s follow each convolutional layer except the final layer which normalizes the pose/content vectors to have unit norm. The decoder is a mirrored version of the encoder with 5 deconvolutional layers and a sigmoid output layer. For both NORB and SUNCG, D is a DCGAN architecture while Ec and Ep use a ResNet-18 architecture [9] up until the final pooling layer with |hp| = 10 and |hc| = 128. For KTH, Ep uses a ResNet-18 architecture with |hp| = 24. Ec uses the same architecture as VGG16 [29] up until the final pooling layer with |hc| = 128. The decoder is a mirrored version of the content encoder with pooling layers replaced with spatial up-sampling. In the style of U-Net [25], we add skip connections from the content encoder to the decoder, enabling the model to easily generate static background features. In all experiments the scene discriminator C is a fully connected neural network with 2 hidden layers of 100 units. We trained all our models with the ADAM optimizer [13] and learning rate η = 0.002. We used β = 0.1 for MNIST, NORB and SUNCG and β = 0.0001 for KTH experiments. We used α = 1 for all datasets. For future prediction experiments we train a two layer LSTM with 256 cells using the ADAM optimizer. On MNIST, we train the model by observing 5 frames and predicting 10 frames. On KTH, we train the model by observing 10 frames and predicting 10 frames. 4.2 Synthetic datasets MNIST: We start with a toy dataset consisting of two MNIST digits bouncing around a 64x64 image. Each video sequence consists of a different pair of digits with independent trajectories. Fig. 3(left) shows how the content vector from one frame and the pose vector from another generate new examples that transfer the content and pose from the original frames. This demonstrates the clean disentanglement produced by our model. Interestingly, for this data we found it to be necessary to use a different color for the two digits. Our adversarial term is so aggressive that it prevents the actionDim=5-latentDi m=128-maxStep=8-a dvWeight=0-normaliz e=true-ngf=64-ndf=64 -model=basic-output= sigmoid-linWeight=0 3 5 1 9 12 6 18 21 15 50 100 24 200 500 ... ... ... ... ... ... Input frames Generated frames ... Figure 3: Left: Demonstration of content/pose factorization on held out MNIST examples. Each image in the grid is generated using the pose and content vectors hp and hc taken from the corresponding images in the top row and first column respectively. The model has clearly learned to disentangle content and pose. Right: Each row shows forward modeling up to 500 time steps into the future, given 5 initial frames. For each generation, note that only the pose part of the representation is being predicted from the previous time step (using an LSTM), with the content vector being fixed from the 5th frame. The generations remain crisp despite the long-range nature of the predictions. 5 Pose Content Content Pose Pose Pose Pose Content Figure 4: Left: Factorization examples using our DRNET model on held out NORB images. Each image in the grid is generated using the pose and content vectors hp and hc taken from the corresponding images in the top row and first column respectively. Center: Examples where DRNET was trained without the adversarial loss term. Note how content and pose are no longer factorized cleanly: the pose vector now contains content information which ends up dominating the generation. Right: factorization examples from Mathieu et al. [19]. x1 x2 Interpolations Pose Content Figure 5: Left: Examples of linear interpolation in pose space between the examples x1 and x2. Right: Factorization examples on held out images from the SUNCG dataset. Each image in the grid is generated using the pose and content vectors hp and hc taken from the corresponding images in the top row and first column respectively. Note how, even for complex objects, the model is able to rotate them accurately. pose vector from capturing any content information, thus without a color cue the model is unable to determine which pose information to associate with which digit. In Fig. 3(right) we perform forward modeling using our representation, demonstrating the ability to generate crisp digits 500 time steps into the future. NORB: We apply our model to the NORB dataset [16], converted into videos by taking sequences of different azimuths, while holding object identity, lighting and elevation constant. Fig. 4.2(left) shows that our model is able to factor content and pose cleanly on held out data. In Fig. 4.2(center) we train a version of our model without the adversarial loss term, which results in a significant degradation in the model and the pose vectors are no longer isolated from content. For comparison, we also show the factorizations produced by Mathieu et al. [19], which are less clean, both in terms of disentanglement and generation quality than our approach. Table 1 shows classification results on NORB, following the training of a classifier on pose features and also content features. When the adversarial term is used (β = 0.1) the content features perform well. Without the term, content features become less effective for classification. SUNCG: We use the rendering engine from the SUNCG dataset [30] to generate sequences where the camera rotates around a range of 3D chair models. The dataset consists of 324 different chair models of varying size, shape and color. DRNET learns a clean factorization of content and pose and is able to generate high quality examples of this dataset, as shown in Fig. 4.2(right). 6 4.3 KTH Action Dataset Finally, we apply DRNET to the KTH dataset [28]. This is a simple dataset of real-world videos of people performing one of six actions (walking, jogging, running, boxing, handwaving, hand-clapping) against fairly uniform backgrounds. In Fig. 4.3 we show forward generations of different held out examples, comparing against two baselines: (i) the MCNet of Villegas et al. [33]which, to the best of our knowledge, produces the current best quality generations of on real-world video and (ii) a baseline auto-encoder LSTM model (AE-LSTM). This is essentially the same as ours, but with a single encoder whose features thus combine content and pose (as opposed to factoring them in DRNET ). It is also similar to [31]. Fig. 7 shows more examples, with generations out to 100 time steps. For most actions this is sufficient time for the person to have left the frame, thus further generations would be of a fixed background. In Fig. 9 we attempt to quantify the fidelity of the generations by comparing our approach to MCNet [33] using a metric derived from the Inception score [26]. The Inception score is used for assessing generations from GANs and is more appropriate for our scenario that traditional metrics such as PSNR or SSIM (see appendix B for further discussion). The curves show the mean scores of our generations decaying more gracefully than MCNet [33]. Further examples and generated movies may be viewed in appendix A and also at https://sites.google.com/view/drnet-paper//. A natural concern with high capacity models is that they might be memorizing the training examples. We probe this in Fig. 4.3, where we show the nearest neighbors to our generated frames from the training set. Fig. 8 uses the pose representation produced by DRNET to train an action classifier from very few examples. We extract pose vectors from video sequences of length 24 and train a fully connected classifier on these vectors to predict the action class. We compare against an autoencoder baseline, which is the same as ours but with a single encoder whose features thus combine content and pose. We find the factorization significantly boosts performance. t = 21 Ground truth future MCNet AE-LSTM DrNet (ours) Walking t = 25 t = 15 t = 17 t = 27 t = 30 t = 12 t = 5 t = 10 t = 1 t = 21 Ground truth future MCNet AE-LSTM DrNet (ours) Running t = 25 t = 15 t = 17 t = 27 t = 30 t = 12 t = 5 t = 10 t = 1 Figure 6: Qualitative comparison between our DRNET model, MCNet [33] and the AE-LSTM baseline. All models are conditioned on the first 10 video frames and generate 20 frames. We display predictions of every 3rd frame. Video sequences are taken from held out examples of the KTH dataset for the classes of walking (top) and running (bottom). 7 t=11 t=100 t=90 t=80 t=70 t=60 t=50 t=47 t=44 t=41 t=38 t=35 t=32 t=29 t=26 t=23 t=20 t=17 t=14 DrNet MCNet Figure 7: Four additional examples of generations on held out examples of the KTH dataset, rolled out to 100 timesteps. Model Accuracy (%) DRNET β=0.1 hc 93.3 hp 60.9 DRNET β=0 hc 72.6 hp 80.8 Mathieu et al. [19] 86.5 Table 1: Classification results on NORB dataset, with/without adversarial loss (β = 0.1/0) using content or pose representations (hc, hp respectively). The adversarial term is crucial for forcing semantic information into the content vectors – without it performance drops significantly. Figure 8: Classification of KTH actions from pose vectors with few labeled examples, with autoencoder baseline. N.B. SOA (fully supervised) is 93.9% [15]. 0 20 40 60 80 100 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 1.7 1.75 Future time step Inception Score DrNet MCNet Figure 9: Comparison of KTH video generation quality using Inception score. X-axis indicated how far from conditioned input the start of the generated sequence is. t = 12 t = 15 t = 17 t = 21 t = 25 t = 27 t = 30 DrNet generations Nearest neighbour in pose space t = 12 t = 15 t = 17 t = 21 t = 25 t = 27 t = 30 Nearest neighbour in pose+content space DrNet generations Nearest neighbour in pose space Nearest neighbour in pose+content space Figure 10: For each frame generated by DRNET (top row in each set), we show nearest-neighbor images from the training set, based on pose vectors (middle row) and both content and pose vectors (bottom row). It is evident that our model is not simply copying examples from the training data. Furthermore, the middle row shows that the pose vector generalizes well, and is independent of background and clothing. 8 5 Discussion In this paper we introduced a model based on a pair of encoders that factor video into content and pose. This seperation is achieved during training through novel adversarial loss term. The resulting representation is versatile, in particular allowing for stable and coherent long-range prediction through nothing more than a standard LSTM. Our generations compare favorably with leading approaches, despite being a simple model, e.g. lacking the GAN losses or probabilistic formulations of other video generation approaches. Source code is available at https://github.com/edenton/drnet. Acknowledgments We thank Rob Fergus, Will Whitney and Jordan Ash for helpful comments and advice. Emily Denton is grateful for the support of a Google Fellowship References [1] P. Agrawal, A. Nair, P. Abbeel, J. Malik, and S. Levine. Learning to poke by poking: Experiential learning of intuitive physics. arXiv preprint arXiv:1606.07419, 2016. [2] S. Chiappa, S. Racaniere, D. Wierstra, and S. Mohamed. Recurrent environment simulators. In ICLR, 2017. [3] F. Cricri, M. Honkala, X. Ni, E. Aksu, and M. Gabbouj. Video ladder networks. arXiv preprint arXiv:1612.01756, 2016. [4] C. Doersch, A. Gupta, and A. A. Efros. Unsupervised visual representation learning by context prediction. In CVPR, pages 1422–1430, 2015. [5] C. Finn, I. Goodfellow, and S. Levine. Unsupervised learning for physical interaction through video prediction. In arXiv 1605.07157, 2016. [6] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS, 2014. [7] W. Grathwohl and A. Wilson. Disentangling space and time in video with hierarchical variational auto-encoders. arXiv preprint arXiv:1612.04440, 2016. [8] R. Hartley and A. Zisserman. Multiple view geometry in computer vision, 2000. [9] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2016. [10] G. E. Hinton, A. Krizhevsky, and S. Wang. Transforming auto-encoders. In ICANN, 2011. [11] G. E. Hinton and R. R. Salakhutdinov. Reducing the dimensionality of data with neural networks. Science, 313(5786):504–507, 2006. [12] N. Kalchbrenner, A. van den Oord, K. Simonyan, I. Danihelka, O. Vinyals, A. Graves, and K. Kavukcuoglu. Video pixel networks. In arXiv:1610.00527, 2016. [13] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. [14] 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. [15] Q. V. Le, W. Y. Zou, S. Y. Yeung, and A. Y. Ng. Learning hierarchical invariant spatio-temporal features for action recognition with independent subspace analysis. In Proceedings of the 2011 IEEE Conference on Computer Vision and Pattern Recognition, 2011. [16] Y. LeCun, F. Huang, and L. Bottou. Learning methods for generic object recognition with invariance to pose and lighting. In CVPR, 2004. [17] C. Liu. Beyond pixels: exploring new representations and applications for motion analysis. PhD thesis, Massachusetts Institute of Technology, 2009. [18] M. Mathieu, C. Couprie, and Y. LeCun. Deep multi-scale video prediction beyond mean square error. arXiv 1511.05440, 2015. [19] M. Mathieu, P. S. Junbo Zhao, A. Ramesh, and Y. LeCun. Disentangling factors of variation in deep representations using adversarial training. In Advances in Neural Information Processing Systems 29, 2016. [20] J. Oh, X. Guo, H. Lee, R. Lewis, and S. Singh. Action-conditional video prediction using deep networks in Atari games. In NIPS, 2015. [21] A. Radford, L. Metz, and S. Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In The International Conference on Learning Representations, 2016. 9 [22] M. Ranzato, A. Szlam, J. Bruna, M. Mathieu, R. Collobert, and S. Chopra. Video (language) modeling: a baseline for generative models of natural videos. arXiv 1412.6604, 2014. [23] A. Rasmus, M. Berglund, M. Honkala, H. Valpola, and T. Raiko. Semi-supervised learning with ladder network. In Advances in Neural Information Processing Systems 28, 2015. [24] S. Reed, Z. Zhang, Y. Zhang, and H. Lee. Deep visual analogy-making. In NIPS, 2015. [25] O. Ronneberger, P. Fischer, and T. Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical Image Computing and Computer-Assisted Intervention, pages 234–241. Springer International Publishing, 2015. [26] T. Salimans, I. J. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. arXiv 1606.03498, 2016. [27] T. Salimans, A. Karpathy, X. Chen, and D. P. Kingma. Pixelcnn++: Improving the pixelcnn with discretized logistic mixture likelihood and other modifications. arXiv preprint arXiv:1701.05517, 2017. [28] C. Schuldt, I. Laptev, and B. Caputo. Recognizing human actions: A local svm approach. In Pattern Recognition, 2004. ICPR 2004. Proceedings of the 17th International Conference on, volume 3, pages 32–36. IEEE, 2004. [29] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. In The International Conference on Learning Representations, 2015. [30] S. Song, F. Yu, A. Zeng, A. X. Chang, M. Savva, and T. Funkhouser. Semantic scene completion from a single depth image. IEEE Conference on Computer Vision and Pattern Recognition, 2017. [31] N. Srivastava, E. Mansimov, and R. Salakhutdinov. Unsupervised learning of video representations using LSTMs. In ICML, 2015. [32] A. van den Oord, N. Kalchbrenner, and K. Kavukcuoglu. Pixel recurrent neural networks. In ICML, 2016. [33] R. Villegas, J. Yang, S. Hong, X. Lin, and H. Lee. Decomposing motion and content for natural video sequence prediction. In ICLR, 2017. [34] C. Vondrick, H. Pirsiavash, and A. Torralba. Generating videos with scene dynamics. In arXiv 1609.02612, 2016. [35] J. Walker, A. Gupta, and M. Hebert. Dense optical flow prediction from a static image. In ICCV, 2015. [36] X. Wang and A. Gupta. Unsupervised learning of visual representations using videos. In CVPR, pages 2794–2802, 2015. [37] W. F. Whitney, M. Chang, T. Kulkarni, and J. B. Tenenbaum. Understanding visual concepts with continuation learning. arXiv preprint arXiv:1502.04623, 2016. [38] L. Wiskott and T. Sejnowski. Slow feature analysis: Unsupervised learning of invariance. Neural Computation, 14(4):715–770, 2002. [39] T. Xue, J. Wu, K. L. Bouman, and W. T. Freeman. Visual dynamics: Probabilistic future frame synthesis via cross convolutional networks. In NIPS, 2016. [40] J. Zhao, M. Mathieu, R. Goroshin, and Y. LeCun. Stacked what-where auto-encoders. In International Conference on Learning Representations, 2016. 10
2017
121
6,588
Countering Feedback Delays in Multi-Agent Learning Zhengyuan Zhou Stanford University zyzhou@stanford.edu Panayotis Mertikopoulos Univ. Grenoble Alpes, CNRS, Inria, LIG panayotis.mertikopoulos@imag.fr Nicholas Bambos Stanford University bambos@stanford.edu Peter Glynn Stanford University glynn@stanford.edu Claire Tomlin UC Berkeley tomlin@eecs.berkeley.edu Abstract We consider a model of game-theoretic learning based on online mirror descent (OMD) with asynchronous and delayed feedback information. Instead of focusing on specific games, we consider a broad class of continuous games defined by the general equilibrium stability notion, which we call λ-variational stability. Our first contribution is that, in this class of games, the actual sequence of play induced by OMD-based learning converges to Nash equilibria provided that the feedback delays faced by the players are synchronous and bounded. Subsequently, to tackle fully decentralized, asynchronous environments with (possibly) unbounded delays between actions and feedback, we propose a variant of OMD which we call delayed mirror descent (DMD), and which relies on the repeated leveraging of past information. With this modification, the algorithm converges to Nash equilibria with no feedback synchronicity assumptions and even when the delays grow superlinearly relative to the horizon of play. 1 Introduction Online learning is a broad and powerful theoretical framework enjoying widespread applications and great success in machine learning, data science, operations research, and many other fields [3, 7, 22]. The prototypical online learning problem may be described as follows: At each round t = 0, 1, . . . , a player selects an action xt from some convex, compact set, and obtains a reward ut(xt) based on some a priori unknown payoff function ut. Subsequently, the player receives some feedback (e.g. the past history of the reward functions) and selects a new action xt+1 with the goal of maximizing the obtained reward. Aggregating over the rounds of the process, this is usually quantified by asking that the player’s (external) regret Reg(T) ≡maxx∈X PT t=1 [ut(x) −ut(xt)] grow sublinearly with the horizon of play T, a property known as “no regret”. One of the most widely used algorithmic schemes for learning in this context is the online mirror descent (OMD) class of algorithms [23]. Tracing its origins to [17] for offline optimization problems, OMD proceeds by taking a gradient step in the dual (gradient) space and projecting it back to the primal (decision) space via a mirror map generated by a strongly convex regularizer function (with different regularizers giving rise to different algorithms). In particular, OMD includes as special cases several seminal learning algorithms, such as Zinkevich’s online gradient descent (OGD) scheme [29], and the multiplicative/exponential weights (EW) algorithm [1, 13]. Several variants of this class also exist and, perhaps unsurprisingly, they occur with a variety of different names – such as “Follow-the-Regularized-Leader" [9], dual averaging [18, 25], and so on. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. When ut is concave, OMD enjoys a sublinear O( √ T) regret bound which is known to be universally tight.1 A common instantiation of this is found in repeated multi-player games, where each player’s payoff function is determined by the actions of all other players via a fixed mechanism – the stage game. Even though this mechanism may be unknown to the players, the universality of the OMD regret bounds raises high expectations in terms of performance guarantees, so it is natural to assume that players adopt some variant thereof when faced with such online decision processes. This leads to the following central question: if all players of a repeated game employ an OMD updating rule, do their actions converge to a Nash equilibrium of the underlying one-shot game? Related Work. Given the prominence of Nash equilibrium as a solution concept in game theory (compared to coarser notions such as correlated equilibria or the Hannan set), this problem lies at the heart of multi-agent learning [4]. However, convergence to a Nash equilibrium is, in the words of [4], “considerably more difficult” than attaining a no-regret state for all players (which leads to weaker notion of coarse correlated equilibrium in finite games). To study this question, a growing body of literature has focused on special classes of games (e.g. zero-sum games, routing games) and established the convergence of the so-called “ergodic average” T −1 PT t=1 xt of OMD [2, 10, 12]. In general, the actual sequence of play may fail to converge altogether, even in simple, finite games [16, 24]. On the other hand, there is a number of recent works establishing the convergence of play in potential games with finite action sets under different assumptions for the number of players involved (continuous or finite) and the quality of the available feedback (perfect, semi-bandit/imperfect, or bandit/payoff-based) [5, 11, 14, 19]. However, these works focus on games with finite action sets and feedback is assumed to be instantly available to the players (i.e. with no delays or asynchronicities), two crucial assumptions that we do not make in this paper. A further major challenge arises in decentralized environments (such as transportation networks), where a considerable delay often occurs between a player’s action and the corresponding received feedback. To study learning in such settings, [20] recently introduced an elegant and flexible delay framework where the gradient at round t is only available at round t + dt −1, with dt being the delay associated with the player’s action at round t.2 [20] then considered a very natural extension of OMD under delays: updating the set of gradients as they are received (see Algorithm 1 for details). If the total delay after time T is D(T) = PT t=1 dt, [20] showed that OMD enjoys an O(D(T)1/2) regret bound. This natural extension has several strengths: first, no assumption is made on how the gradients are received (the delayed gradients can be received out-of-order); further, as pointed out in [6, 8], a gradient “does not need to be timestamped by the round s from which it originates,” as required for example by the pooling strategies of [6, 8]. Our Contributions. Our investigations here differ from existing work in the following aspects: First, we consider learning in games with asynchronous and delayed feedback by extending the general single-agent feedback delay framework introduced in [20]. Previous work on the topic has focused on the regret analysis of single-agent learning with delays, but the convergence properties of such processes in continuous games are completely unknown. Second, we focus throughout on the convergence of the actual sequence of play generated by OMD (its “last iterate” in the parlance of optimization), as opposed to the algorithm’s ergodic average 1 T PT t=1 xt. This last point is worth emphasizing for several reasons: a) this mode of convergence is stronger and theoretically more appealing because it implies ergodic convergence; b) in a game-theoretic setting, payoffs are determined by the actual sequence of play, so ergodic convergence diminishes in value if it is not accompanied by similar conclusions for the players’ realized actions; and c) because there is no inherent averaging, the techniques used to prove convergence of xt provide a much finer understanding of the evolution of OMD. The starting point of our paper is the introduction of an equilibrium stability notion which we call λ-variational stability, a notion that is motivated by the concept of evolutionary stability in population games and builds on the characterization of stable Nash equilibria as solutions to a Mintytype variational inequality [15]. This stability notion is intimately related to monotone operators in variational analysis [21] and can be seen as a strict generalization of operator monotonicity in the 1In many formulations, a cost function (as opposed to a reward function) is used, in which case such cost functions need to be convex. 2Of course, taking dt = 1 yields the classical no-delay setting. 2 current game-theoretic context.3 By means of this notion, we are able to treat convergence questions in general games with continuous action spaces, without having to focus on a specific class of games – such as concave potential or strictly monotone games (though our analysis also covers such games). Our first result is that, assuming variational stability, the sequence of play induced by OMD converges to the game’s set of Nash equilibria, provided that the delays of all players are synchronous and bounded (see Theorems 4.3 and 4.4). As an inherited benefit, players adopting this learning algorithm can receive gradients out-of-order and do not need to keep track of the timestamps from which the gradients originate. In fact, even in the special case of learning without delays, we are not aware of a similar convergence result for the actual sequence of play. An important limitation of this result is that delays are assumed synchronous and bounded, an assumption which might not hold in large, decentralized environments. To lift this barrier, we introduce a modification of vanilla OMD which we call delayed mirror descent (DMD), and which leverages past information repeatedly, even in rounds where players receive no feedback. Thanks to this modification, play under DMD converges to variationally stable sets of Nash equilibria (Theorem 5.2), even if the players experience asynchronous and unbounded delays: in particular, delays could grow superlinearly in the game’s horizon, and DMD would still converge. We mention that the convergence proofs for both OMD and DMD rely on designing a particular Lyapunov function, the so-called λ-Fenchel coupling which serves as a “primal-dual divergence” measure between actions and gradient variables. Thanks to its Lyapunov properties, the λ-Fenchel coupling provides a potent tool for proving convergence and we exploit it throughout. Further, we present a unified theoretical framework that puts the analysis of both algorithms under different delay assumptions on the same footing. 2 Problem Setup 2.1 Games with Continuous Action Sets We start with the definition of a game with continuous action sets, which serves as a stage game and provides a reward function for each player in an online learning process. Definition 2.1. A continuous game G is a tuple G = (N, X = QN i=1 Xi, {ui}N i=1), where N is the set of N players {1, 2, . . . , N}, Xi is a compact convex subset of some finite-dimensional vector space Rdi representing the action space of player i, and ui : X →R is the i-th player’s payoff function. Regarding the players’ payoff functions, we make the following assumptions throughout: 1. For each i ∈N, ui(x) is continuous in x. 2. For each i ∈N, ui is continuously differentiable in xi and the partial gradient ∇xi ui(x) is Lipschitz continuous in x. Throughout the paper, x−i denotes the joint action of all players but player i. Consequently, the joint action4 x will frequently be written as (xi, x−i). Two important quantities in the current context are: Definition 2.2. We let v(x) be the profile of the players’ individual payoff gradients,5 i.e. v(x) = (v1(x), . . . , vN(x)), where vi(x) ≜∇xi ui(x). Definition 2.3. Given a continuous game G, x∗∈X is called a (pure-strategy) Nash equilibrium if for each i ∈N, ui(x∗ i , x∗ −i) ≥ui(xi, x∗ −i), ∀xi ∈Xi. 2.2 Online Mirror Descent in Games under Delays In what follows, we consider a general multi-agent delay model extending the single-agent delay model of [20] to the multi-agent learning case. At a high level, for each agent there can be an arbitrary 3In the supplement, we give two well-known classes of games that satisfy this equilibrium notion. 4Note that boldfaced letters are only used to denote joint actions. In particular, xi is a vector even though it is not boldfaced. 5Note that per the last assumption in the definition of a concave game (Definition 2.1), the gradient v(x) always exists and is a continuous function on the joint action space X. 3 delay between the stage at which an action is played and the stage at which feedback is received about said action (typically in the form of gradient information). There is no extra assumption imposed on the feedback delays – in particular, feedback can arrive out-of-order and in a completely asynchronous manner across agents. Further, the received feedback is not time-stamped – so the player might not know to which iteration a specific piece of feedback corresponds. When OMD is applied in this setting, we obtain the following scheme: Algorithm 1 Online Mirror Descent on Games under Delays 1: Each player i chooses an initial y0 i . 2: for t = 0, 1, 2, . . . do 3: for i = 1, . . . , N do 4: xt i = arg maxxi∈Xi{⟨yt i, xi⟩−hi(xi)} 5: yt+1 i = yt i + αt P s∈Gt i vi(xs) 6: end for 7: end for Three comments are in order here. First, each hi is a regularizer on Xi, as defined below: Definition 2.4. Let D be a compact and convex subset of Rm. We say that g: D →R is a regularizer if g is continuous and strongly convex on D, i.e. there exists some K > 0 such that g(td + (1 −t)d′) ≤tg(d) + (1 −t)g(d′) −1 2Kt(1 −t)∥d′ −d∥2 (2.1) for all t ∈[0, 1], bd, bd′ ∈D. Second, the gradient step size αt in Algorithm 1 can be any positive and non-increasing sequence that satisfies the standard summability assumption: P∞ t=0 αt = ∞, P∞ t=0(αt)2 < ∞. Third, regarding the delay model: in Algorithm 1, Gt i denotes the set of rounds whose gradients become available for player i at the current round t. Denote player i’s delay of the gradient at round s to be ds i (a positive integer), then this gradient vi(xs) will be available at round s + ds i −1, i.e. s ∈Gs+ds i −1 i . In particular, if ds i = 1 for all s, player i doesn’t experience any feedback delays. Note here again that each player can receive feedback out of order: this can happen if the gradient at an earlier round has a much larger delay than that of the gradient at a later round. 3 λ-Variational Stability: A Key Criterion In this section, we define a key stability notion, called λ-variational stability. This notion allows us to obtain strong convergence results for the induced sequence of play, as opposed to results that only hold in specific classes of games. The supplement provides two detailed special classes of games (convex potential games and asymmetric Cournot oligopolies) that admit variationally stable equilibria. Other examples include monotone games (discussed later in this section), pseudo-monotone games [28], non-atomic routing games [26, 27], symmetric influence network games [11] and many others. 3.1 λ-Variational Stability Definition 3.1. Given a game with continuous actions (N, X = QN i=1 Xi, {ui}N i=1), a set C ⊂X is called λ-variationally stable for some λ ∈RN ++ if N X i=1 λi⟨vi(x), xi −x∗ i ⟩≤0, for all x ∈X, x∗∈C. (3.1) with equality if and only if x ∈C. Remark 3.1. If C is λ-stable with λi = 1 for all i, it is called simply stable [15]. We emphasize that in a game setting, λ-variational stability is more general than an important concept called operator monotonicity in variational analysis. Specifically, v(·) is called a monotone 4 operator [21] if the following holds (with equality if and only if x = ˜x): ⟨v(x) −v(˜x), x −˜x⟩≜ N X i=1 ⟨vi(x) −vi(˜x), xi −˜xi⟩≤0, ∀x, ˜x ∈X. (3.2) If v(·) is monotone, the game admits a unique Nash equilibrium x∗which (per the property of a Nash equilibrium) satisfies ⟨v(x∗), x −x∗⟩≤0. Consequently, if v(·) is a monotone operator, it follows that ⟨v(x), x −x∗⟩≤⟨v(x∗), x −x∗⟩≤0, where equality is achieved if and only if x = x∗. This implies that when v(x) is a monotone operator, the singleton set of the unique Nash equilibrium is 1-variationally stable, where 1 is the all-ones vector. The converse is not true: when v(x) is not a monotone operator, we can still have a unique Nash equilibrium that is λ-variationally stable, or more generally, have a λ-variationally stable set C. 3.2 Properties of λ-Variational Stability Lemma 3.2. If C is nonempty and λ-stable, then it is closed, convex and contains all Nash equilibria of the game. The following lemma gives us a convenient sufficient condition ensuring that a singleton λvariationally stable set {x∗} exists; in this case, we simply say that x∗is λ-variationally stable. Lemma 3.3. Given a game with continuous actions (N, X = QN i=1 Xi, {ui}N i=1), where each ui is twice continuously differentiable. For each x ∈X, define the λ-weighted Hessian matrix Hλ(x) as follows: Hλ ij(x) = 1 2λi ∇xj vi(x) + 1 2λj(∇xi vj(x))T . (3.3) If Hλ(x) is negative-definite for every x ∈X, then the game admits a unique Nash equilibrium x∗ that is λ-globally variational stable. Remark 3.2. It is important to note that the Hessian matrix so defined is a block matrix: each Hλ ij(x) is a di×dj matrix. Writing it in terms of the utility function, we have Hλ ij(x) = 1 2λi ∇xj ∇xi ui(x)+ 1 2λj(∇xi ∇xj uj(x))T . 4 Convergence under Synchronous and Bounded Delays In this section, we tackle the convergence of the last iterate of OMD under delays. We start by defining an important divergence measure, λ-Fenchel coupling, that generalizes Bregman divergence. We then establish its useful properties that play an indispensable role in both this and next sections. 4.1 λ-Fenchel Coupling Definition 4.1. Fix a game with continuous action spaces (N, X = QN i=1 Xi, {ui}N i=1) and for each player i, let hi : Xi →R be a regularizer with respect to the norm ∥· ∥i that is Ki-strongly convex. 1. The convex conjugate function h∗ i : Rdi →R of hi is defined as: h∗ i (yi) = max xi∈Xi{⟨xi, yi⟩−hi(xi)}. 2. The choice function Ci : Rdi →Xi associated with regularizer hi for player i is defined as: Ci(yi) = arg max xi∈Xi{⟨xi, yi⟩−hi(xi)}. 3. For a λ ∈RN ++, the λ-Fenchel coupling F λ : X × R PN i=1 di →R is defined as: F λ(x, y) = N X i=1 λi(hi(xi) −⟨xi, yi⟩+ h∗ i (yi)). 5 Note that although the domain of hi is Xi ⊂Rdi, the domain of its conjugate (gradient space) h∗ i is Rdi. The two key properties of λ-Fenchel coupling that will be important in establishing the convergence of OMD are given next. Lemma 4.2. For each i ∈{1, . . . , N}, let hi : Xi →R be a regularizer with respect to the norm ∥· ∥i that is Ki-strongly convex and let λ ∈RN ++. Then ∀x ∈X, ∀˜y, y ∈R PN i=1 di: 1. F λ(x, y) ≥1 2 PN i=1 Kiλi∥Ci(yi) −xi∥2 i ≥1 2(mini Kiλi) PN i=1 ∥Ci(yi) −xi∥2 i . 2. F λ(x, ˜y) ≤F λ(x, y)+PN i=1 λi⟨˜yi −yi, Ci(yi)−xi⟩+ 1 2(maxi λi Ki ) PN i=1(∥˜yi −yi∥∗ i )2, where ∥· ∥∗ i is the dual norm of ∥· ∥i (i.e. ∥yi∥∗ i = max∥xi∥i≤1⟨xi, yi⟩. Remark 4.1. Collecting each individual choice map into a vector, we obtain the aggregate choice map C : R PN i=1 di →X, with C(y) = (C1(y1), . . . , CN(yN)). Since each space Xi is endowed with norm ∥· ∥i, we can define the induced aggregate norm ∥· ∥on the joint space X as follows: ∥x∥= PN i=1 ∥xi∥i. We can also similarly define the aggregate dual norm: ∥y∥∗= PN i=1 ∥yi∥∗ i . Henceforth, it shall be clear that the convergence in the joint space (e.g. C(yt) →x, yt →y) will be defined under the respective aggregate norm. Finally, we assume throughout the paper that the choice maps are regular in the following (very weak) sense: a choice map C(·) is said to be λ-Fenchel coupling conforming if C(yt) →x implies F λ(x, yt) →0 as t →∞. (4.1) Unless one aims for relatively pathological cases, choice maps induced by typical regularizers are always λ-Fenchel coupling conforming: examples include the Euclidean and entropic regularizers. 4.2 Convergence of OMD to Nash Equilibrium We start by characterizing the assumption on the delay model: Assumption 1. The delays are assumed to be: 1. Synchronous: Gt i = Gt j, ∀i, j, ∀t. 2. Bounded: dt i ≤D, ∀i, ∀t (for some positive integer D). Theorem 4.3. Fix a game with continuous action spaces (N, X = QN i=1 Xi, {ui}N i=1) that admits x∗as the unique Nash equilibrium that is λ-variationally stable. Under Assumption 1, the OMD iterate xt given in Algorithm 1 converges to x∗, irrespective of the initial point x0. Remark 4.2. The proof is rather long and involved. To aid the understanding and enhance the intuition, we break it down into four main steps, each of which will be proved in the appendix in detail. 1. Since the delays are synchronous, we denote by Gt the common set and dt the common delay at round t. The gradient update in OMD under delays can then be written as: yt+1 i = yt i + αt X s∈Gt vi(xs) = yt i + αt ( |Gt|vi(xt) + X s∈Gt {vi(xs) −vi(xt)} ) . (4.2) Define bt i = P s∈Gt{vi(xs) −vi(xt)}. We show limt→∞∥bt i∥∗ i = 0 for each player i. 2. Define bt = (bt 1, . . . , bt N) and we have limt→∞bt = 0 per Claim 1. Since each player’s gradient update can be written as yt+1 i = yt i + αt(|Gt|vi(xt) + bt i) per Claim 1, we can then write the joint OMD update (of all players) as: xt = C(yt), (4.3) yt+1 = yt + αt {|Gt|v(xt) + bt} . (4.4) Let B(x∗, ϵ) ≜{x ∈X | ∥x −x∗∥< ϵ} be the open ball centered around x∗with radius ϵ. Then, using λ-Fenchel coupling as a “energy" function and leveraging the handle on bt given by Claim 1, we can establish that, for any ϵ > 0 the iterate xt will eventually enter B(x∗, ϵ) and visit B(x∗, ϵ) infinitely often, no matter what the initial point x0 is. Mathematically, the claim is that ∀ϵ > 0, ∀x0, |{t | xt ∈B(x∗, ϵ)}| = ∞. 6 3. Fix any δ > 0 and consider the set ˜B(x∗, δ) ≜{C(y) | F λ(x∗, y) < δ}. In other words, ˜B(x∗, δ) is some “neighborhood" of x∗, which contains every x that is an image of some y (under the choice map C(·)) that is within δ distance of x∗under the λ-Fenchel coupling “metric". Although F λ(x∗, y) is not a metric, ˜B(x∗, δ) contains an open ball within it. Mathematically, the claim is that for any δ > 0, ∃ϵ(δ) > 0 such that: B(x∗, ϵ) ⊂˜B(x∗, δ). 4. For any “neighborhood" ˜B(x∗, δ), after long enough rounds, if xt ever enters ˜B(x∗, δ), it will be trapped inside ˜B(x∗, δ) thereafter. Mathematically, the claim is that for any δ > 0, ∃T(δ), such that for any t ≥T(δ), if xt ∈˜B(x∗, δ), then x˜t ∈˜B(x∗, δ), ∀˜t ≥t. Putting all four elements above together, we note that the significance of Claim 3 is that, since the iterate xt will enter B(x∗, ϵ) infinitely often (per Claim 2), xt must enter ˜B(x∗, δ) infinitely often. It therefore follows that, per Claim 4, starting from iteration t, xt will remain in ˜B(x∗, δ). Since this is true for any δ > 0, we have F λ(x∗, yt) →0 as t →∞. Per Statement 1 in Lemma 4.2, this leads to that ∥C(yt) −x∗∥→0 as t →∞, thereby establishing that xt = C(yt) →x∗as t →0. In fact, the result generalizes straightforwardly to multiple Nash equilibria. The proof of the convergence to the set case is line-by-line identical, provided we redefine, in a standard way, every quantity that measures the distance between two points to the corresponding quantity that measures the distance between a point and a set (by taking the infimum over the distances between the point and a point in that set). We directly state the result below. Theorem 4.4. Fix a game with continuous action spaces (N, X = QN i=1 Xi, {ui}N i=1) that admits X ∗as a λ-variationally stable set (of necessarily all Nash equilibria), for some λ ∈RN ++. Under Assumption 1, the OMD iterate xt given in Algorithm 1 satisfies limt→∞dist(xt, X ∗) = 0, irrespective of x0, where dist(·, ·) is the standard point-to-set distance function induced by the norm ∥· ∥. 5 Delayed Mirror Descent: Asynchronous and Unbounded Delays The synchronous and bounded delay assumption in Assumption 1 is fairly strong. In this section, by a simple modification of OMD, we propose a new learning algorithm called Delayed Mirror Descent (DMD), that allows the last-iterate convergence-to-Nash result to be generalized to cases with arbitrary asynchronous delays among players as well as unbounded delay growth. 5.1 Delayed Mirror Descent in Games The main idea for the modification is that when player i doesn’t receive any gradient on round t, instead of not doing any gradient updates as in OMD, he uses the most recent set of gradients to perform updates. More formally, define the most recent information set6 as: ˜Gt i = Gt i, if Gt i ̸= ∅ ˜Gt−1 i , if Gt i = ∅. Under this definition, Delayed Mirror Descent is (note that ˜Gt i is always non-empty here): We only make the following assumption on the delays: Assumption 2. For each player i, limt→∞ Pt s=min ˜Gt i αs = 0. This assumption essentially requires that no player’s delays grow too fast. Note that in particular, players delays can be arbitrarily asynchronous. To make this assumption more concrete, we next give two more explicit delay conditions that satisfy the main delay assumption. As made formal by the following lemma, if the delays are bounded (but not necessarily synchronous), then Assumption 2 is satisfied. Furthermore, by appropriately choosing the sequence αt, Assumption 2 can accommodate delays that are unbounded and grow super-linearly. 6There may not be any gradient information in the first few rounds due to delays. Without loss of generality, we can always start at the first round when there is non-empty gradient information, or equivalently, assume that some gradient is available at t = 0. 7 Algorithm 2 Delayed Mirror Descent on Games 1: Each player i chooses an initial y0 i . 2: for t = 0, 1, 2, . . . do 3: for i = 1, . . . , N do 4: xt i = arg maxxi∈Xi{⟨yt i, xi⟩−hi(xi)} 5: yt+1 i = yt i + αt | ˜Gt i| P s∈˜Gt i vi(xs) 6: end for 7: end for Lemma 5.1. Let {ds i}∞ s=1 be the delay sequences for player i. 1. If each player i’s delay is bounded (i.e. ∃d ∈Z, ds i ≤d, ∀s), then Assumption 2 is satisfied for any positive, non-increasing, not-summable-but-square-summable sequence {αt}. 2. There exists a positive, non-increasing, not-summable-but-square-summable sequence (e.g. αt = 1 t log t log log t) such that if ds i = O(s log s), ∀i, then Assumption 2 is satisfied. Proof: We will only prove Statement 2, the more interesting case. Take αt = 1 t log t log log t, which is obviously positive, non-increasing and square-summable. Since R t s=4 1 s log s log log sds = log log log t →∞as t →∞, αt is not summable. Next, let ˜Gt i be given and let ˜t be the most recent round (up to and including t) such that G˜t i is not empty. This means: ˜Gt i = G˜t i, Gk i = ∅, ∀k ∈(˜t, t]. (5.1) Note that since the gradient at time ˜t will be available at time ˜t + d˜t i −1, it follows that t −˜t ≤d˜t i. (5.2) Note that this implies ˜t →∞as t →∞, because otherwise, ˜t is bounded, leading to the right-side d˜t i being bounded, which contradicts to the left-side diverging to infinity. Since ds i = O(s log s), it follows that ds i ≤Ks log s for some K > 0. Consequently, Equation 5.2 implies: t ≤˜t + K˜t log ˜t. Denote st min = min ˜Gt i, Equation 5.1 implies that st min = min G˜t i, thereby yielding st min + dst min i −1 = ˜t. Therefore: dst min i = ˜t −st min + 1. (5.3) Equation (5.3) implies that st min →∞as t →∞, because otherwise, the left-hand side of Equation (5.3) is bounded while the right-hand side goes to infinity (since ˜t →∞as t →∞as established earlier). With the above notation, it follows that: lim t→∞ t X s=min ˜Gt i αs ≤lim t→∞ t X s=st min αs = lim t→∞    ˜t X s=st min αs + t X s=˜t+1 αs    (5.4) ≤lim t→∞ n dst min i αst min + (˜t log ˜t)α˜to (5.5) = lim t→∞ ( dst min i (st min) log(st min) log log(st min) + K˜t log ˜t (˜t + 1) log(˜t + 1) log log(˜t + 1) ) (5.6) ≤lim t→∞  K(st min) log(st min) (st min) log(st min) log log(st min) + K˜t log ˜t (˜t + 1) log(˜t + 1) log log(˜t + 1)  (5.7) ≤lim t→∞  K log log(st min) + K log log(˜t + 1)  = 0. (5.8) ■ 8 Remark 5.1. The proof to the second claim of Lemma 5.1 indicates that one can also easily obtain slightly larger delay growth rates: O(t log t log log t), O(t log t log log t log log log t) and so on, by choosing the corresponding step size sequences. Further, it is conceivable that one can identify meaningfully larger delay growth rates that still satisfy Assumption 2, particularly under more restrictions on the degree of delay asynchrony among the players. We leave that for future work. 5.2 Convergence of DMD to Nash Equilibrium Theorem 5.2. Fix a game with continuous action spaces (N, X = QN i=1 Xi, {ui}N i=1) that admits x∗as the unique Nash equilibrium that is λ-variationally stable. Under Assumption 2, the DMD iterate xt given in Algorithm 2 converges to x∗, irrespective of the initial point x0. The proof here uses a similar framework as the one in Remark 4.2, although the details are somewhat different. Building on the notation and arguments given in Remark 4.2, we again outline three main ingredients that together establish the result. Detailed proofs are omitted due to space limitation. 1. The gradient update in DMD can be rewritten as: yt+1 i = yt i + αt | ˜Gt i| X s∈˜Gt i vi(xs) = yt i + αtvi(xt) + αt X s∈˜Gt i vi(xs) −vi(xt) | ˜Gt i| . By defining: bt i = P s∈˜Gt i vi(xs)−vi(xt) | ˜Gt i| , we can write player i’s gradient update as: yt+1 i = yt i + αt(vi(xt) + bt i). By bounding bt i’s magnitude using the delay sequence, Assumption 2 allows us to establish that bt i has negligible impact over time. Mathematically, the claim is that limt→∞∥bt i∥∗ i = 0. 2. The joint DMD update can be written as: xt = C(yt), (5.9) yt+1 = yt + αt(v(xt) + bt). (5.10) Here again using λ-Fenchel coupling as a “energy" function and leveraging the handle on bt given by Claim 1, we show that for any ϵ > 0 the iterate xt will eventually enter B(x∗, ϵ) and visit B(x∗, ϵ) infinitely often, no matter what the initial point x0 is. Furthermore, per Claim 3 in Remark 4.2, B(x∗, ϵ) ⊂˜B(x∗, δ). This implies that xt must enter ˜B(x∗, δ) infinitely often. 3. Again using λ-Fenchel coupling, we show that under DMD, for any “neighborhood" ˜B(x∗, δ), after long enough iterations, if xt ever enters ˜B(x∗, δ), it will be trapped inside ˜B(x∗, δ) thereafter. Combining the above three elements, it follows that under DMD, starting from iteration t, xt will remain in ˜B(x∗, δ). Since this is true for any δ > 0, we have F λ(x∗, yt) →0 as t →∞, thereby establishing that xt = C(yt) →x∗as t →0. Here again, the result generalizes straightforwardly to the multiple Nash equilibria case (with identical proofs modulo using point-to-set distance metric). We omit the statement. 6 Conclusion We examined a model of game-theoretic learning based on OMD with asynchronous and delayed information. By focusing on games with λ- stable equilibria, we showed that the sequence of play induced by OMD converges whenever the feedback delays faced by the players are synchronous and bounded. Subsequently, to tackle fully decentralized, asynchronous environments with unbounded feedback delays (possibly growing sublinearly in the game’s horizon), we showed that our convergence result still holds under delayed mirror descent, a variant of vanilla OMD that leverages past information even in rounds where no feedback is received. To further enhance the distributed aspect of the algorithm, in future work we intend to focus on the case where the players’ gradient input is not only delayed, but also subject to stochastic imperfections – or, taking this to its logical extreme, when players only have observations of their in-game payoffs, and have no gradient information. 9 7 Acknowledgments Zhengyuan Zhou is supported by Stanford Graduate Fellowship and he would like to thank Walid Krichene and Alex Bayen for stimulating discussions (and their charismatic research style) that have firmly planted the initial seeds for this work. Panayotis Mertikopoulos gratefully acknowledges financial support from the Huawei Innovation Research Program ULTRON and the ANR JCJC project ORACLESS (grant no. ANR–16–CE33–0004–01). Claire Tomlin is supported in part by the NSF CPS:FORCES grant (CNS-1239166). References [1] S. ARORA, E. HAZAN, AND S. KALE, The multiplicative weights update method: A meta-algorithm and applications, Theory of Computing, 8 (2012), pp. 121–164. [2] M. BALANDAT, W. KRICHENE, C. TOMLIN, AND A. BAYEN, Minimizing regret on reflexive Banach spaces and Nash equilibria in continuous zero-sum games, in NIPS ’16: Proceedings of the 30th International Conference on Neural Information Processing Systems, 2016. [3] A. BLUM, On-line algorithms in machine learning, in Online algorithms, Springer, 1998, pp. 306–325. [4] N. CESA-BIANCHI AND G. LUGOSI, Prediction, learning, and games, Cambridge university press, 2006. [5] J. COHEN, A. HÉLIOU, AND P. MERTIKOPOULOS, Learning with bandit feedback in potential games, in NIPS ’17: Proceedings of the 31st International Conference on Neural Information Processing Systems, 2017. [6] T. DESAUTELS, A. KRAUSE, AND J. W. BURDICK, Parallelizing exploration-exploitation tradeoffs in gaussian process bandit optimization., Journal of Machine Learning Research, 15 (2014), pp. 3873–3923. [7] E. HAZAN, Introduction to Online Convex Optimization, Foundations and Trends(r) in Optimization Series, Now Publishers, 2016. [8] P. JOULANI, A. GYORGY, AND C. SZEPESVÁRI, Online learning under delayed feedback, in Proceedings of the 30th International Conference on Machine Learning (ICML-13), 2013, pp. 1453–1461. [9] A. KALAI AND S. VEMPALA, Efficient algorithms for online decision problems, Journal of Computer and System Sciences, 71 (2005), pp. 291–307. [10] S. KRICHENE, W. KRICHENE, R. DONG, AND A. BAYEN, Convergence of heterogeneous distributed learning in stochastic routing games, in Communication, Control, and Computing (Allerton), 2015 53rd Annual Allerton Conference on, IEEE, 2015, pp. 480–487. [11] W. KRICHENE, B. DRIGHÈS, AND A. M. BAYEN, Online learning of nash equilibria in congestion games, SIAM Journal on Control and Optimization, 53 (2015), pp. 1056–1081. [12] K. LAM, W. KRICHENE, AND A. BAYEN, On learning how players learn: estimation of learning dynamics in the routing game, in Cyber-Physical Systems (ICCPS), 2016 ACM/IEEE 7th International Conference on, IEEE, 2016, pp. 1–10. [13] N. LITTLESTONE AND M. K. WARMUTH, The weighted majority algorithm, INFORMATION AND COMPUTATION, 108 (1994), pp. 212–261. [14] R. MEHTA, I. PANAGEAS, AND G. PILIOURAS, Natural selection as an inhibitor of genetic diversity: Multiplicative weights updates algorithm and a conjecture of haploid genetics, in ITCS ’15: Proceedings of the 6th Conference on Innovations in Theoretical Computer Science, 2015. [15] P. MERTIKOPOULOS, Learning in games with continuous action sets and unknown payoff functions. https://arxiv.org/abs/1608.07310, 2016. [16] P. MERTIKOPOULOS, C. H. PAPADIMITRIOU, AND G. PILIOURAS, Cycles in adversarial regularized learning, in SODA ’18: Proceedings of the 29th annual ACM-SIAM symposium on discrete algorithms, to appear. [17] A. S. NEMIROVSKI AND D. B. YUDIN, Problem Complexity and Method Efficiency in Optimization, Wiley, New York, NY, 1983. [18] Y. NESTEROV, Primal-dual subgradient methods for convex problems, Mathematical Programming, 120 (2009), pp. 221–259. [19] G. PALAIOPANOS, I. PANAGEAS, AND G. PILIOURAS, Multiplicative weights update with constant step-size in congestion games: Convergence, limit cycles and chaos, in NIPS ’17: Proceedings of the 31st International Conference on Neural Information Processing Systems, 2017. [20] K. QUANRUD AND D. KHASHABI, Online learning with adversarial delays, in Advances in Neural Information Processing Systems, 2015, pp. 1270–1278. [21] R. T. ROCKAFELLAR AND R. J.-B. WETS, Variational analysis, vol. 317, Springer Science & Business Media, 2009. 10 [22] S. SHALEV-SHWARTZ ET AL., Online learning and online convex optimization, Foundations and Trends R⃝ in Machine Learning, 4 (2012), pp. 107–194. [23] S. SHALEV-SHWARTZ AND Y. SINGER, Convex repeated games and Fenchel duality, in Advances in Neural Information Processing Systems 19, MIT Press, 2007, pp. 1265–1272. [24] Y. VIOSSAT AND A. ZAPECHELNYUK, No-regret dynamics and fictitious play, Journal of Economic Theory, 148 (2013), pp. 825–842. [25] L. XIAO, Dual averaging methods for regularized stochastic learning and online optimization, Journal of Machine Learning Research, 11 (2010), pp. 2543–2596. [26] Z. ZHOU, N. BAMBOS, AND P. GLYNN, Dynamics on linear influence network games under stochastic environments, in International Conference on Decision and Game Theory for Security, Springer, 2016, pp. 114–126. [27] Z. ZHOU, B. YOLKEN, R. A. MIURA-KO, AND N. BAMBOS, A game-theoretical formulation of influence networks, in American Control Conference (ACC), 2016, IEEE, 2016, pp. 3802–3807. [28] M. ZHU AND E. FRAZZOLI, Distributed robust adaptive equilibrium computation for generalized convex games, Automatica, 63 (2016), pp. 82–91. [29] M. ZINKEVICH, Online convex programming and generalized infinitesimal gradient ascent, in ICML ’03: Proceedings of the 20th International Conference on Machine Learning, 2003, pp. 928–936. 11
2017
122
6,589
Affinity Clustering: Hierarchical Clustering at Scale MohammadHossein Bateni Google Research bateni@google.com Soheil Behnezhad∗ University of Maryland soheil@cs.umd.edu Mahsa Derakhshan∗ University of Maryland mahsaa@cs.umd.edu MohammadTaghi Hajiaghayi∗ University of Maryland hajiagha@cs.umd.edu Raimondas Kiveris Google Research rkiveris@google.com Silvio Lattanzi Google Research silviol@google.com Vahab Mirrokni Google Research mirrokni@google.com Abstract Graph clustering is a fundamental task in many data-mining and machine-learning pipelines. In particular, identifying a good hierarchical structure is at the same time a fundamental and challenging problem for several applications. The amount of data to analyze is increasing at an astonishing rate each day. Hence there is a need for new solutions to efficiently compute effective hierarchical clusterings on such huge data. The main focus of this paper is on minimum spanning tree (MST) based clusterings. In particular, we propose affinity, a novel hierarchical clustering based on Bor˚uvka’s MST algorithm. We prove certain theoretical guarantees for affinity (as well as some other classic algorithms) and show that in practice it is superior to several other state-of-the-art clustering algorithms. Furthermore, we present two MapReduce implementations for affinity. The first one works for the case where the input graph is dense and takes constant rounds. It is based on a Massively Parallel MST algorithm for dense graphs that improves upon the state-of-the-art algorithm of Lattanzi et al. [34]. Our second algorithm has no assumption on the density of the input graph and finds the affinity clustering in O(log n) rounds using Distributed Hash Tables (DHTs). We show experimentally that our algorithms are scalable for huge data sets, e.g., for graphs with trillions of edges. 1 Introduction Clustering is a classic unsupervised learning problem with many applications in information retrieval, data mining, and machine learning. In hierarchical clustering the goal is to detect a nested hierarchy of clusters that unveils the full clustering structure of the input data set. In this work we study the hierarchical clustering problem on real-world graphs. This problem has received a lot of attention in recent years [13, 16, 41] and new elegant formulations and algorithms have been introduced. Nevertheless many of the newly proposed techniques are sequential, hence difficult to apply on large data sets. ∗Supported in part by NSF CAREER award CCF-1053605, NSF BIGDATA grant IIS-1546108, NSF AF:Medium grant CCF-1161365, DARPA GRAPHS/AFOSR grant FA9550-12-1-0423, and another DARPA SIMPLEX grant. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. With the constant increase in the size of data sets to analyze, it is crucial to design efficient large-scale solutions that can be easily implemented in distributed computing platforms (such as Spark [45] and Hadoop [43] as well as MapReduce and its extension Flume [17]), and cloud services (such as Amazon Cloud or Google Cloud). For this reason in the past decade several papers proposed new distributed algorithms for classic computer science and machine learning problems [3, 4, 7, 14, 15, 19]. Despite these efforts not much is known about distributed algorithms for hierarchical clustering. There are only two works analyzing these problems [27, 28], and neither gives any theoretical guarantees on the quality of their algorithms or on the round complexity of their solutions. In this work we propose new parallel algorithms in the MapReduce model to compute hierarchical clustering and we analyze them from both theoretical and experimental perspectives. The main idea behind our algorithms is to adapt clustering techniques based on classic minimum spanning tree algorithms such as Bor˚uvka’s algorithm [11] and Kruskal’s algorithm [33] to run efficiently in parallel. Furthermore we also provide a new theoretical framework to compare different clustering algorithms based on the concept of a “certificate” and show new interesting properties of our algorithms. We can summarize our contribution in four main points. First, we focus on the distributed implementations of two important clustering techniques based on classic minimum spanning tree algorithms. In particular we consider linkage-based clusterings inspired by Kruskal’s algorithm and a novel clustering called affinity clustering based on Bor˚uvka’s algorithm. We provide new theoretical frameworks to compare different clustering algorithms based on the concept of a “certificate” as a proof of having a good clustering and show new interesting properties of both affinity and single-linkage clustering algorithms. Then, using a connection between linkage-based clustering, affinity clustering and the minimum spanning tree problem, we present new efficient distributed algorithms for the hierarchical clustering problem in a MapReduce model. In our analysis we consider the most restrictive model for distributed computing, called Massively Parallel Communication, among previously studied MapReduce-like models [10, 23, 30]. Along the way, we obtain a constant round MapReduce algorithm for minimum spanning tree (MST) of dense graphs (in Section 5). Our algorithm for graphs with Θ(n1+c) edges and for any given ϵ with 0 < ϵ < c < 1, finds the MST in ⌈log(c/ϵ)⌉+1 rounds using ˜O(n1+ϵ) space per machine and O(nc−ϵ) machines (i.e., optimal total space). This improves the round complexity of the state-of-the-art MST algorithm of Lattanzi et al. [34] for dense graphs which requires up to ⌈c/ϵ⌉ rounds using the same number of machines and space. Prior to our work, no hierarchical clustering algorithm was known in this model. Then we turn our attention to real world applications and we introduce efficient implementations of affinity clustering as well as classic single-linkage clustering that leverage Distributed Hash Tables (DHTs) [12, 31] to speed up computation for huge data sets. Last but not least, we present an experimental study where we analyze the scalability and effectiveness of our newly introduced algorithms and we observe that, in most cases, affinity clustering outperforms all state-of-the-art algorithms from both quality and scalability standpoints.2 2 Related Work Clustering and, in particular, hierarchical clustering techniques have been studied by hundreds of researchers [16, 20, 22, 32]. In social networks, detecting the hierarchical clustering structure is a basic primitive for studying the interaction between nodes [36, 39]. Other relevant applications of hierarchical clustering can be found in bioinformatics, image analysis and text classification. Our paper is closely related to two main lines of research. The first one focuses on studying theoretical properties of clustering approaches based on minimum spanning trees (MSTs). Linkagebased clusterings (often based on Kruskal’s algorithm) have been extensively studied as basic techniques for clustering datasets. The most common linkage-based clustering algorithms are singlelinkage, average-linkage and complete-linkage algorithms. In [44], Zadeh and Ben-David gave a characterization of the single-linkage algorithm. Their result has been then generalized to linkagebased algorithms in [1]. Furthermore single-linkage algorithms are known to provably recover a ground truth clustering if the similarity function has some stability properties [6]. In this paper we 2Implementations are available at https://github.com/MahsaDerakhshan/AffinityClustering. 2 introduce a new technique to compare clustering algorithms based on “certificates.” Furthermore we introduce and analyze a new algorithm—affinity—based on Bor˚uvka’s well-known algorithm. We show that affinity is not only scalable for huge data sets but also its performance is superior to several state-of-the-art clustering algorithms. To the best of our knowledge though Bor˚uvka’s algorithm is a well-known and classic algorithm, not many clustering algorithms have been considered based on Bor˚uvka’s. The second line of work is closely related to distributed algorithms for clustering problems. Several models of MapReduce computation have been introduced in the past few years [10, 23, 30]. The first paper that studied clustering problems in these models is by Ene et al. [18], where the authors prove that any α approximation algorithm for the k-center or k-median problems can produce 4α + 2 and 10α+3 approximation factors, respectively, for the k-center or k-median problems in the MapReduce model. Subsequently several papers [5, 7, 8] studied similar problems in the MapReduce model. A lot of efforts also went into studying efficient algorithms on graphs [3, 4, 7, 15, 14, 19]. However the problem of hierarchical clustering did not receive a lot of attention. To the best of our knowledge there are only two papers [27, 28] on this topic, and neither analyzes the problem formally or proves any guarantee in any MapReduce model. 3 Minimum Spanning Tree-Based Clusterings We begin by going over two famous algorithms for minimum spanning tree and define the corresponding algorithms for clustering. Bor˚uvka’s algorithm and affinity clustering: Bor˚uvka’s algorithm [11], first published in 1926, is an algorithm for finding a minimum spanning tree (MST)3. The algorithm was rediscovered a few times, in particular by Sollin [42] in 1965 in the parallel computing literature. Initially each vertex forms a group (cluster) by itself. The algorithm begins by picking the cheapest edge going out of each cluster, in each round (in parallel) joins these clusters to form larger clusters and continues joining in a similar manner until a tree spanning all vertices is formed. Since the size of the smallest cluster at least doubles each time, the number of rounds is at most O(log n). In affinity clustering, we stop Bor˚uvka’s algorithm after r > 0 rounds when for the first time we have at most k clusters for a desired number k > 0. In case the number of clusters is strictly less than k, we delete the edges that we added in the last round in a non-increasing order (i.e., we delete the edge with the highest weight first) to obtain exactly k clusters. To the best of our knowledge, although Bor˚uvka’s algorithm is a well-known and classic algorithm, clustering algorithms based on it have not been considered much. A natural hierarchy of nodes can be obtained by continuing Bor˚uvka’s algorithm: each cluster here will be a subset of future clusters. We call this hierarchical affinity clustering. We present distributed implementations of Bor˚uvka/affinity in Section 5 and show its scalability even for huge graphs. We also show affinity clustering, in most cases, works much better than several well-known clustering algorithms in Section 6. Kruskal’s algorithm and single-linkage clustering: Kruskal’s algorithm [33] first introduced in 1956 is another famous algorithm for finding MST. The algorithm is highly sequential and iteratively picks an edge of the least possible weight that connects any two trees (clusters) in the forest.4 Though the number of iterations in Kruskal’s algorithm is n −1 (the number of edges of any tree on n nodes), the algorithm can be implemented in O(m log n) time with simple data structures (m is the number of edges) and in O(ma(n)) time using a more sophisticated disjoint-set data structure, where a(.) is the extremely slowly growing inverse of the single-valued Ackermann function. In single-linkage clustering, we stop Kruskal’s algorithm when we have at least k clusters (trees) for a desired number k > 0. Again if we desire to obtain a corresponding hierarchical single-linkage clustering, by adding further edges which will be added in Kruskal’s algorithm later, we can obtain a natural hierarchical clustering (each cluster here will be a subset of future clusters). As mentioned above, Kruskal’s Algorithm and single-linkage clustering are highly sequential, however as we show in Section 5 thinking backward once we have an efficient implementation of Bor˚uvka’s 3More precisely the algorithm works when there is a unique MST, in particular, when all edge weights are distinct; however this can be easily achieved by either perturbing the edge weights by an ϵ > 0 amount or have a tie-breaking ordering for edges with the same weights 4Unlike Bor˚uvka’s method, this greedy algorithm has no limitations on the distinctness of edge weights. 3 (or any MST algorithm) in Map-Reduce and using Distributed Hash Tables (DHTs), we can achieve an efficient parallel implementation of single-linkage clustering as well. We show scalability of this implementation even for huge graphs in Section 5 and its performance in experiments in Section 6. 4 Guaranteed Properties of Clustering Algorithms An important property of affinity clustering is that it produces clusters that are roughly of the same size. This is intuitively correct since at each round of the algorithm, each cluster is merged to at least one other cluster and as a result, the size of even the smallest cluster is at least doubled. In fact linkage based algorithms (and specially single linkage) are often criticized for producing uneven clusters; therefore it is tempting to give a theoretical guarantee for the size ratio of the clusters that affinity produces. Unfortunately, as it is illustrated in Figure 1, we cannot give any worst case bounds since even in one round we may end up having a cluster of size Ω(n) and another cluster of size O(1). As the first property, we show that at least in the first round, this does not happen when the observations are randomly distributed. Our empirical results on real world data sets in Section 6.1, further confirm this property for all rounds, and on real data sets. Figure 1: An example of how affinity may produce a large component in one round. We start by defining the nearest neighbor graph. Definition 1 (Nearest Neighbor Graph). Let S be a set of points in a metric space. The nearest neighbor graph of S, denoted by GS, has |S| vertices, each corresponding to an element in S and if a ∈S is the nearest element to b ∈S in S, graph GS contains an edge between the corresponding vertices of a and b. At each round of affinity clustering, all the vertices that are in the same connected component of the nearest neighbor graph will be merged together5. Thus, it suffices to bound the connected components’ size. For a random model of points, consider a Poisson point process X in Rd (d ≥1) with density 1. It has two main properties. First, the number of points in any finite region of volume V is Poisson distributed with mean V . Second, the number of points in any two disjoint regions are independent of each other. Theorem 1 (Häggström et al. [38]). For any d ≥2, consider the (Euclidean distance) nearest neighbor graph G of a realization of a Poisson point process in Rd with density 1. All connected components of G are finite almost surely. Theorem 1 implies that the size of the maximum connected component of the points within any finite region in Rd is bounded by almost a constant number. This is a very surprising result compared to the worst case scenario of having a connected component that contains all the points. Note that although the aforementioned bound holds for the first round of affinity, after the connected components are contracted, we cannot necessarily assume that the new points are Poisson distributed and the same argument cannot be used for the rest of the rounds. Next we present further properties of affinity clustering. Let us begin by introducing the concept of “cost” for a clustering solution to be able to compare clustering algorithms. Definition 2. The cost of a cluster is the sum of edge lengths (weights) of a minimum Steiner tree connecting all vertices inside the cluster. The cost of a clustering is the sum of the costs of its clusters. Finally a non-singleton clustering of a graph is a partition of its vertices into clusters of size at least two. Even one round of affinity clustering often produces good solutions for several applications. Now we are ready to present the following extra property of the result of the first round of affinity clustering. 5Depending on the variant of affinity that we use, the distance function will be updated. 4 Theorem 2. The cost of any non-singleton clustering is at least half of that of the clustering obtained after the first round of affinity clustering. Before presenting the proof of Theorem 2, we need to demonstrate the concept of disc painting introduced previously in [29, 2, 21, 9, 25]. In this setting, we consider a topological structure of a graph metric in which each edge is a curve connecting its endpoints whose length is equal to its weight. We assume each vertex has its own color. A disc painting is simply a set of disjoint disks centered at terminals (with the same colors of the center vertices). A disk of radius r centered at vertex v paints all edges (or portions) of them which are at distance r from vertex v with the color of v. Thus we paint (portions of) edges by different disks each corresponding to a vertex and each edge can be painted by at most two disks. With this definition of disk painting, we now demonstrate the proof of Theorem 2. Next we turn our focus to obtain structural properties for single-linkage clustering. We denote by Fk the set of edges added after k iterations of Kruskal, i.e., when we have n−k clusters in single-linkage clustering. Note that Fk is a forest, i.e., a set of edges with no cycle. First we start with an important observation whose proof comes directly from the description of the single-linkage algorithm. Proposition 3. Suppose we run single-linkage clustering until we have n −k clusters. Let doutside be the minimum distance between any two clusters and dinside be the maximum distance of any edge added to forest Fk. Then doutside ≥dinside. We note that Proposition 3 demonstrates the following important property of single-linkage clustering: Each vertex of a cluster at any time has a neighbor inside to which is closer than any other vertex outside of its clusters. Next we define another criterion for desirability of a clustering algorithm. This generalizes Proposition 3. Definition 3. An α-certificate for a clustering algorithm, where α ≥1, is an assignment of shares to each vertex of the graph with the following two properties: (1) The cost of each cluster is at most α times the sum of shares of vertices inside the cluster; (2) For any set S of vertices containing at most one from each cluster in our solution, the imaginary cluster S costs at least the sum of shares of vertices in S. Note that intuitively the first property guarantees that vertices inside each cluster can pay the cost of their corresponding cluster and that there is no free-rider. The second property intuitively implies we cannot find any better clustering by combining vertices from different clusters in our solution. Next we show that there always exists a 2-certificate for single-linkage clustering guaranteeing its worst-case performance. Theorem 4. Single-linkage always produces a clustering solution that has a 2-certificate. 5 Distributed Algorithms 5.1 Constant Round Algorithm For Dense Graphs Unsurprisingly, finding the affinity clustering of a given graph G is closely related to the problem of finding its Minimum Spanning Tree (MST). In fact, we show the data that is encoded in the MST of G is sufficient for finding its affinity clustering (Theorem 9). This property is also known to be true for single linkage [24]. For MapReduce algorithms this is particularly useful because the MST requires a substantially smaller space than the original graph and can be stored in one machine. Therefore, once we have the MST, we can obtain affinity or single linkage in one round. The main contribution of this section is an algorithm for finding the MST (and therefore the affinity clustering) of dense graphs in constant rounds of MapReduce which improves upon prior known dense graph MST algorithms of Karloff et al. [30] and Lattanzi et al. [34]. Theoretical Model. Let N denote the input size. There are a total number of M machines and each of them has a space of size S. Both S and M must be substantially sublinear in N. In each round, the machines can run an arbitrary polynomial time algorithm on their local data. No communication is allowed during the rounds but any two machines can communicate with each other between the rounds as long as the total communication size of each machine does not exceed its memory size. 5 Algorithm 1 MST of Dense Graphs Input: A weighted graph G Output: The minimum spanning tree of G 1: function MST(G = (V, E), ϵ) 2: c ←logn (m/n) ▷Since G is assumed to be dense we know c > 0. 3: while |E| > O(n1+ϵ) do 4: REDUCEEDGES(G, c) 5: c ←(c −ϵ)/2 6: Move all the edges to one machine and find MST of G in there. 7: function REDUCEEDGES(G = (V, E), c) 8: k ←n(c−ϵ)/2 9: Independently and u.a.r. partition V into k subsets {V1, . . . , Vk}. 10: Independently and u.a.r. partition V into k subsets {U1, . . . , Uk}. 11: Let Gi,j be a subgraph of G with vertex set Vi ∪Uj containing any edge (v, u) ∈E(G) where v ∈Vi and u ∈Uj. 12: for any i, j ∈{1, . . . , k} do 13: Send all the edges of Gi,j to the same machine and find its MST in there. 14: Remove an edge e from E(G) , if e ∈Gi,j and it is not in MST of Gi,j. This model is called Massively Parallel Communication (MPC) in the literature and is “arguably the most popular one” [26] among MapReduce like models. Theorem 5. Let G = (V, E) be a graph with n vertices and n1+c edges for any constant c > 0 and let w : E 7→R+ be its edge weights. For any given ϵ such that 0 < ϵ < c, there exists a randomized algorithm for finding the MST of G that runs in at most ⌈log (c/ϵ)⌉+ 1 rounds of MPC where every machine uses a space of size ˜O(n1+ϵ) with high probability and the total number of required machines is O(nc−ϵ). Our algorithm, therefore, uses only enough total space (˜O(n1+c)) on all machines to store the input. The following observation is mainly used by Algorithm 1 to iteratively remove the edges that are not part of the final MST. Lemma 6. Let G′ = (V ′, E′) be a (not necessarily connected) subgraph of the input graph G. If an edge e ∈E′ is not in the MST of G′, then it is not in the MST of G either. To be more specific, we iteratively divide G into its subgraphs, such that each edge of G is at least in one subgraph. Then, we handle each subgraph in one machine and throw away the edges that are not in their MST. We repeat this until there are only O(n1+ϵ) edges left in G. Then we can handle all these edges in one machine and find the MST of G. Algorithm 1 formalizes this process. Lemma 7. Algorithm 1 correctly finds the MST of the input graph in ⌈log (c/ϵ)⌉+ 1 rounds. By Lemma 6 we know any edge that is removed from is not part of the MST therefore it suffices to prove the while loop in Algorithm 1 takes ⌈log (c/ϵ)⌉+ 1 iterations. Lemma 8. In Algorithm 1, every machine uses a space of size ˜O(n1+ϵ) with high probability. The combination of Lemma 7 and Lemma 8 implies that Algorithm 1 is indeed in MPC and Theorem 5 holds. See supplementary material for omitted proofs. The next step is to prove all the information that is required for affinity clustering is indeed contained in the MST. Theorem 9. Let G = (V, E) denote an arbitrary graph, and let G′ = (V, E′) denote the minimum spanning tree of G. Running affinity clustering algorithm on G gives the same clustering of V as running this algorithm on G′. By combining the MST algorithm given for Theorem 5 and the sufficiency of MST for computing affinity clustering (Theorem 9) and single linkage ([24]) we get the following corollary. Corollary 10. Let G = (V, E) be a graph with n vertices and n1+c edges for any constant c > 0 and let w : E 7→R+ be its edge weights. For any given ϵ such that 0 < ϵ < c, there exists a 6 randomized algorithm for affinity clustering and single linkage that runs in ⌈log (c/ϵ)⌉+ 1 rounds of MPC where every machine uses a space of size ˜O(n1+ϵ) with high probability and the total number of required machines is O(nc−ϵ). 5.2 Logarithmic Round Algorithm For Sparse Graphs Consider a graph G(V, E) on n = |V | vertices, with edge weights w : E 7→R. We assume that the edge weights denote distances. (The discussion applies mutatis mutandis to the case where edge weights signify similarity.) The algorithm works for a fixed number of synchronous rounds, or until no further progress is made, say, by reaching a single cluster of all vertices. Each round consists of two steps: First, every vertex picks its best edge (i.e., that of the minimum weight) at each round; and then the graph is contracted along the selected edges. (See Algorithm 2 in the appendix.) For a connected graph, the algorithm continues until a single cluster of all vertices is obtained. The supernodes at different rounds can be thought of as a hierarchical clustering of the vertices. While the first step of each round has a trivial implementation in MapReduce, the latter might take Ω(log n) MapReduce rounds to implement, as it is an instance of the connected components problem. Using a DHT was shown to significantly improve the running time here, by implementing the operation in one round of MapReduce [31]. Basically we have a read-only random-access table mapping each vertex to its best neighbor. Repeated lookups in the table allows each vertex to follow the chain of best neighbors until a loop (of length two) is encountered. This assigns a unique name for each connected component; then all the vertices in the same component are reduced into a supernode. Theorem 11. The affinity clustering algorithm runs in O(log n) rounds of MapReduce when we have access to a distributed hash table (DHT). Without the DHT, the algorithm takes O(log2 n) rounds. 6 Experiments 6.1 Quality Analysis In this section, we compare well known hierarchical and flat clustering algorithms, such as k-means, single linkage, complete linkage and average linkage with different variants of affinity clustering, such as single affinity, complete affinity and average affinity. We run our experiments on several data sets from the UCI database [37] and use Euclidean distance6. To evaluate the outputs of these algorithms we use Rand index which is defined as follows. Definition 4 (Rand index [40]). Given a set V = {v1, . . . , vn} of n points and two clusterings X = {X1, . . . , Xr} and Y = {Y1, . . . , Ys} of V . Define the following. • a: the number of pairs in V that are in the same cluster in X and in the same cluster in Y . • b: the number of pairs in V that are in different clusters in X and in different clusters in Y . the Rand index r(X, Y ) is defined to be (a + b)/ n 2  . By having the ground truth clustering T of a data set, we define the Rand index score of a clustering X, to be r(X, T). The Rand index based scores are in range [0, 1] and a higher number implies a better clustering. For a hierarchical clustering, the level of its corresponding tree with the highest score is used for evaluations. Figure 2 (a) compares the Rand index score of different clustering algorithms for different data sets. We observe that single affinity generally performs really well and is among the top two algorithms for most of the datasets (all except Glass). Average affinity also seems to perform well and in some cases (e.g., for Soybean data set) it produces a very high quality clustering compared to others. To summarize, linkage based algorithms do not seem to be as good as affinity based algorithms but in some cases k-means could be close. 6We consider Iris, Wine, Soybean, Digits and Glass data sets. 7 Datasets Rand Index Score Algorithm Single Affinity Average Affinity Complete Affinity Complete Linkage Average Linkage Single Linkage k-Means 0.4 0.6 0.8 1.0 Iris Soybean Wine Glass Digits (a) 0.0 0.2 0.4 0.6 0.8 Iris Soybean Wine Glass Digits Datasets Clusters' Size Ratio Algorithm Single Affinity Average Affinity Complete Affinity Complete Linkage Average Linkage Single Linkage k-Means (b) Figure 2: Comparison of clustering algorithms based on their Rand index score (a) and clusters size ratio (b). Table 1: Statistics about datasets used. (Numbers for ImageGraph are approximate.) The fifth column shows the relative running time of affinity clustering, and the last column is the speedup obtained by a ten-fold increase in parallelism. Dataset # nodes # edges max degree running time speedup LiveJournal 4,846,609 7,861,383,690 444,522 1.0 4.3 Orkut 3,072,441 42,687,055,644 893,056 2.4 9.2 Friendster 65,608,366 1,092,793,541,014 2,151,462 54 5.9 ImageGraph 2 × 1010 1012 14000 142 4.1 Another property of the algorithms that we measure is the clusters’ size ratio. Let X = {X1, . . . , Xr} be a clustering. We define the size ratio of X to be mini,j∈[r] |Xi|/|Xj|. As it is visualized in Figure 2 (b), affinity based algorithms have a much higher size ratio (i.e., the clusters are more balanced) compared to linkage based algorithms. This confirms the property that we proved for Poisson distributions in Section 4 for real world data sets. Hence we believe affinity clustering is superior to (or at least as good as) the other methods when the dataset under consideration is not extremely unbalanced. 6.2 Scalability Here we demonstrate the scalability of our implementation of affinity clustering. A collection of public and private graphs of varying sizes are studied. These graphs have between 4 million and 20 billion vertices and from 4 billion to one trillion edges. The first three graphs in Table 1 are based on public graphs [35]. As most public graphs are unweighted, we use the number of common neighbors between a pair of nodes as the weight of the edge between them. (This is computed for all pairs, whether they form a pair in the original graph or not, and then new edges of weight zero are removed.) The last graph is based on (a subset of) an internal corpus of public images found on the web and their similarities. We note that we use the “maximum” spanning tree variant of affinity clustering; here edge weights denote similarity rather than distance. While we cannot reveal the exact running times and number of machines used in the experiments, we report these quantities in “normalized form.” We only run one round of affinity clustering (consisting of a “Find Best Neighbors” and a “Contract Graph” step). Two settings are used in the experiments. We once use W MapReduce workers and D machines for the DHT, and compare this to the case with 10W MapReduce workers and D machines for the DHT. This ten-fold increase in the number of MapReduce workers leads to four- to ten-fold decrease in the total running time for different datasets. Each running time is itself the average over three runs to reduce the effect of external network events. Table 1 also shows how the running time changes with the size of the graph. With a modest number of MapReduce workers, affinity clustering runs in less than an hour for all the graphs. 8 References [1] Margareta Ackerman, Shai Ben-David, and David Loker. Characterization of linkage-based clustering. In COLT 2010 - The 23rd Conference on Learning Theory, Haifa, Israel, June 27-29, 2010, pages 270–281, 2010. [2] Ajit Agrawal, Philip N. Klein, and R. Ravi. When trees collide: An approximation algorithm for the generalized steiner problem on networks. SIAM J. Comput., 24(3):440–456, 1995. [3] Kook Jin Ahn, Sudipto Guha, and Andrew McGregor. Analyzing graph structure via linear measurements. In Proceedings of the Twenty-Third Annual ACM-SIAM Symposium on Discrete Algorithms, pages 459–467, 2012. [4] Alexandr Andoni, Aleksandar Nikolov, Krzysztof Onak, and Grigory Yaroslavtsev. Parallel algorithms for geometric graph problems. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing, pages 574–583. ACM, 2014. [5] Bahman Bahmani, Benjamin Moseley, Andrea Vattani, Ravi Kumar, and Sergei Vassilvitskii. Scalable k-means++. PVLDB, 5(7):622–633, 2012. [6] Maria-Florina Balcan, Avrim Blum, and Santosh Vempala. A discriminative framework for clustering via similarity functions. In Proceedings of the 40th Annual ACM Symposium on Theory of Computing, Victoria, British Columbia, Canada, May 17-20, 2008, pages 671–680, 2008. [7] Maria-Florina Balcan, Steven Ehrlich, and Yingyu Liang. Distributed k-means and k-median clustering on general communication topologies. In Advances in Neural Information Processing Systems 26: 27th Annual Conference on Neural Information Processing Systems 2013. Proceedings of a meeting held December 5-8, 2013, Lake Tahoe, Nevada, United States., pages 1995–2003, 2013. [8] MohammadHossein Bateni, Aditya Bhaskara, Silvio Lattanzi, and Vahab S. Mirrokni. Distributed balanced clustering via mapping coresets. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 2591–2599, 2014. [9] MohammadHossein Bateni, Mohammad Taghi Hajiaghayi, and Dániel Marx. Approximation schemes for steiner forest on planar graphs and graphs of bounded treewidth. J. ACM, 58(5):21:1–21:37, 2011. [10] Paul Beame, Paraschos Koutris, and Dan Suciu. Communication steps for parallel query processing. In Proceedings of the 32nd ACM SIGMOD-SIGACT-SIGAI symposium on Principles of database systems, pages 273–284. ACM, 2013. [11] Oktar Boruvka. O jistém problému minimálním. Práce Moravské pˇrírodovˇedecké spoleˇcnosti. Mor. pˇrírodovˇedecká spoleˇcnost, 1926. [12] Fay Chang, Jeffrey Dean, Sanjay Ghemawat, Wilson C. Hsieh, Deborah A. Wallach, Michael Burrows, Tushar Chandra, Andrew Fikes, and Robert E. Gruber. Bigtable: A distributed storage system for structured data. ACM Trans. Comput. Syst., 26(2):4:1–4:26, 2008. [13] Moses Charikar and Vaggos Chatziafratis. Approximate hierarchical clustering via sparsest cut and spreading metrics. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19, pages 841–854, 2017. [14] Rajesh Chitnis, Graham Cormode, Hossein Esfandiari, MohammadTaghi Hajiaghayi, Andrew McGregor, Morteza Monemizadeh, and Sofya Vorotnikova. Kernelization via sampling with applications to finding matchings and related problems in dynamic graph streams. In Proceedings of the Twenty-Seventh Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1326–1344, 2016. [15] Rajesh Hemant Chitnis, Graham Cormode, Mohammad Taghi Hajiaghayi, and Morteza Monemizadeh. Parameterized streaming: Maximal matching and vertex cover. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1234–1251, 2015. [16] Sanjoy Dasgupta. A cost function for similarity-based hierarchical clustering. In Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016, pages 118–127, 2016. [17] Jeffrey Dean and Sanjay Ghemawat. MapReduce: Simplified data processing on large clusters. Communications of the ACM, 51(1):107–113, 2008. 9 [18] Alina Ene, Sungjin Im, and Benjamin Moseley. Fast clustering using mapreduce. In Proceedings of the 17th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Diego, CA, USA, August 21-24, 2011, pages 681–689, 2011. [19] Hossein Esfandiari, Mohammad Taghi Hajiaghayi, Vahid Liaghat, Morteza Monemizadeh, and Krzysztof Onak. Streaming algorithms for estimating the matching size in planar graphs and beyond. In Proceedings of the Twenty-Sixth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 1217–1233, 2015. [20] Assaf Glazer, Omer Weissbrod, Michael Lindenbaum, and Shaul Markovitch. Approximating hierarchical mv-sets for hierarchical clustering. In Advances in Neural Information Processing Systems 27: Annual Conference on Neural Information Processing Systems 2014, December 8-13 2014, Montreal, Quebec, Canada, pages 999–1007, 2014. [21] Michel X. Goemans and David P. Williamson. A general approximation technique for constrained forest problems. SIAM J. Comput., 24(2):296–317, 1995. [22] Jacob Goldberger and Sam T. Roweis. Hierarchical clustering of a mixture model. In Advances in Neural Information Processing Systems 17 [Neural Information Processing Systems, NIPS 2004, December 13-18, 2004, Vancouver, British Columbia, Canada], pages 505–512, 2004. [23] Michael T Goodrich, Nodari Sitchinava, and Qin Zhang. Sorting, searching, and simulation in the mapreduce framework. In International Symposium on Algorithms and Computation, pages 374–383. Springer, 2011. [24] John C Gower and GJS Ross. Minimum spanning trees and single linkage cluster analysis. Applied statistics, pages 54–64, 1969. [25] Mohammad Taghi Hajiaghayi, Vahid Liaghat, and Debmalya Panigrahi. Online node-weighted steiner forest and extensions via disk paintings. In 54th Annual IEEE Symposium on Foundations of Computer Science, FOCS 2013, 26-29 October, 2013, Berkeley, CA, USA, pages 558–567, 2013. [26] Sungjin Im, Benjamin Moseley, and Xiaorui Sun. Efficient massively parallel methods for dynamic programming. In Proceedings of the 46th Annual ACM Symposium on Theory of Computing. ACM, 2017. [27] Chen Jin, Ruoqian Liu, Zhengzhang Chen, William Hendrix, Ankit Agrawal, and Alok N. Choudhary. A scalable hierarchical clustering algorithm using spark. In First IEEE International Conference on Big Data Computing Service and Applications, BigDataService 2015, Redwood City, CA, USA, March 30 - April 2, 2015, pages 418–426, 2015. [28] Chen Jin, Md Mostofa Ali Patwary, Ankit Agrawal, William Hendrix, Wei-keng Liao, and Alok Choudhary. Disc: A distributed single-linkage hierarchical clustering algorithm using mapreduce. In Proceedings of the 4th International SC Workshop on Data Intensive Computing in the Clouds, 2013. [29] Michael Jünger and William R. Pulleyblank. New primal and dual matching heuristics. Algorithmica, 13(4):357–386, 1995. [30] Howard Karloff, Siddharth Suri, and Sergei Vassilvitskii. A model of computation for mapreduce. In Proceedings of the twenty-first annual ACM-SIAM symposium on Discrete Algorithms, pages 938–948. Society for Industrial and Applied Mathematics, 2010. [31] Raimondas Kiveris, Silvio Lattanzi, Vahab S. Mirrokni, Vibhor Rastogi, and Sergei Vassilvitskii. Connected components in MapReduce and beyond. In Proceedings of the ACM Symposium on Cloud Computing, Seattle, WA, USA, November 03 - 05, 2014, pages 18:1–18:13, 2014. [32] Akshay Krishnamurthy, Sivaraman Balakrishnan, Min Xu, and Aarti Singh. Efficient active algorithms for hierarchical clustering. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, June 26 - July 1, 2012, 2012. [33] Joseph B. Kruskal. On the shortest spanning subtree of a graph and the traveling salesman problem. In Proceedings of the American Mathematical Society, volume 7, pages 48–50, 1956. [34] Silvio Lattanzi, Benjamin Moseley, Siddharth Suri, and Sergei Vassilvitskii. Filtering: a method for solving graph problems in mapreduce. In Proceedings of the twenty-third annual ACM symposium on Parallelism in algorithms and architectures, pages 85–94. ACM, 2011. [35] Jure Leskovec and Andrej Krevl. SNAP Datasets: Stanford large network dataset collection. http: //snap.stanford.edu/data, June 2014. 10 [36] Jure Leskovec, Anand Rajaraman, and Jeffrey D. Ullman. Mining of Massive Datasets, 2nd Ed. Cambridge University Press, 2014. [37] Moshe Lichman. UCI machine learning repository, 2013. [38] Ronald Meester et al. Nearest neighbor and hard sphere models in continuum percolation. Random structures and algorithms, 9(3):295–315, 1996. [39] Mark Newman. Networks: An Introduction. Oxford University Press, Inc., New York, NY, USA, 2010. [40] William M Rand. Objective criteria for the evaluation of clustering methods. Journal of the American Statistical association, 66(336):846–850, 1971. [41] Aurko Roy and Sebastian Pokutta. Hierarchical clustering via spreading metrics. In Advances in Neural Information Processing Systems 29: Annual Conference on Neural Information Processing Systems 2016, December 5-10, 2016, Barcelona, Spain, pages 2316–2324, 2016. [42] M. Sollin. Le tracé de canalisation. Programming, Games, and Transportation Networks (in French), 1965. [43] Tom White. Hadoop: The Definitive Guide. O’Reilly Media, Inc., 2012. [44] Reza Zadeh and Shai Ben-David. A uniqueness theorem for clustering. In UAI 2009, Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, Montreal, QC, Canada, June 18-21, 2009, pages 639–646, 2009. [45] Matei Zaharia, Mosharaf Chowdhury, Michael J. Franklin, Scott Shenker, and Ion Stoica. Spark: Cluster computing with working sets. In Proceedings of the 2Nd USENIX Conference on Hot Topics in Cloud Computing, pages 10–10, 2010. 11
2017
123
6,590
Geometric Matrix Completion with Recurrent Multi-Graph Neural Networks Federico Monti Università della Svizzera italiana Lugano, Switzerland federico.monti@usi.ch Michael M. Bronstein Università della Svizzera italiana Lugano, Switzerland michael.bronstein@usi.ch Xavier Bresson School of Computer Science and Engineering NTU, Singapore xbresson@ntu.edu.sg Abstract Matrix completion models are among the most common formulations of recommender systems. Recent works have showed a boost of performance of these techniques when introducing the pairwise relationships between users/items in the form of graphs, and imposing smoothness priors on these graphs. However, such techniques do not fully exploit the local stationary structures on user/item graphs, and the number of parameters to learn is linear w.r.t. the number of users and items. We propose a novel approach to overcome these limitations by using geometric deep learning on graphs. Our matrix completion architecture combines a novel multi-graph convolutional neural network that can learn meaningful statistical graph-structured patterns from users and items, and a recurrent neural network that applies a learnable diffusion on the score matrix. Our neural network system is computationally attractive as it requires a constant number of parameters independent of the matrix size. We apply our method on several standard datasets, showing that it outperforms state-of-the-art matrix completion techniques. 1 Introduction Recommender systems have become a central part of modern intelligent systems. Recommending movies on Netflix, friends on Facebook, furniture on Amazon, and jobs on LinkedIn are a few examples of the main purpose of these systems. Two major approaches to recommender systems are collaborative [5] and content [32] filtering techniques. Systems based on collaborative filtering use collected ratings of items by users and offer new recommendations by finding similar rating patterns. Systems based on content filtering make use of similarities between items and users to recommend new items. Hybrid systems combine collaborative and content techniques. Matrix completion. Mathematically, a recommendation method can be posed as a matrix completion problem [9], where columns and rows represent users and items, respectively, and matrix values represent scores determining whether a user would like an item or not. Given a small subset of known elements of the matrix, the goal is to fill in the rest. A famous example is the Netflix challenge [22] offered in 2009 and carrying a 1M$ prize for the algorithm that can best predict user ratings for movies based on previous user ratings. The size of the Netflix matrix is 480k movies × 18k users (8.5B entries), with only 0.011% known entries. Recently, there have been several attempts to incorporate geometric structure into matrix completion problems [27, 19, 33, 24], e.g. in the form of column and row graphs representing similarity of users 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. and items, respectively. Such additional information defines e.g. the notion of smoothness of the matrix and was shown beneficial for the performance of recommender systems. These approaches can be generally related to the field of signal processing on graphs [37], extending classical harmonic analysis methods to non-Euclidean domains (graphs). Geometric deep learning. Of key interest to the design of recommender systems are deep learning approaches. In the recent years, deep neural networks and, in particular, convolutional neural networks (CNNs) [25] have been applied with great success to numerous applications. However, classical CNN models cannot be directly applied to the recommendation problem to extract meaningful patterns in users, items and ratings because these data are not Euclidean structured, i.e. they do not lie on regular lattices like images but rather irregular domains like graphs. Recent works applying deep learning to recommender systems used networks with fully connected or auto-encoder architectures [44, 35, 14]. Such methods are unable to extract the important local stationary patterns from the data, which is one of the key properties of CNN architectures. New neural networks are necessary and this has motivated the recent development of geometric deep learning techniques that can mathematically deal with graph-structured data, which arises in numerous applications, ranging from computer graphics and vision [28, 2, 4, 3, 30] to chemistry [12]. We recommend the review paper [6] to the reader not familiar with this line of works. The earliest attempts to apply neural networks to graphs are due to Scarselli et al. [13, 34] (see more recent formulation [26, 40]). Bruna et al. [7, 15] formulated CNN-like deep neural architectures on graphs in the spectral domain, employing the analogy between the classical Fourier transforms and projections onto the eigenbasis of the graph Laplacian operator [37]. Defferrard et al. [10] proposed an efficient filtering scheme using recurrent Chebyshev polynomials, which reduces the complexity of CNNs on graphs to the same complexity of classical (Euclidean) CNNs. This model was later extended to deal with dynamic data [36]. Kipf and Welling [21] proposed a simplification of Chebychev networks using simple filters operating on 1-hop neighborhoods of the graph. Monti et al. [30] introduced a spatial-domain generalization of CNNs to graphs local patch operators represented as Gaussian mixture models, showing significantly better generalization across different graphs. Contributions. We present two main contributions. First, we introduce a new multi-graph CNN architecture that generalizes [10] to multiple graphs. This new architecture is able to extract local stationary patterns from signals defined on multiple graphs simultaneously. While in this work we apply multi-graph CNNs in the context of recommender systems to the graphs of users and items, however, our architecture is generic and can be used in other applications, such as neuroscience (autism detection with network of people and brain connectivity [31, 23]), computer graphics (shape correspondence on product manifold [41]), or social network analysis (abnormal spending behavior detection with graphs of customers and stores [39]). Second, we approach the matrix completion problem as learning on user and item graphs using the new deep multi-graph CNN framework. Our architecture is based on a cascade of multi-graph CNN followed by Long Short-Term Memory (LSTM) recurrent neural network [16] that together can be regarded as a learnable diffusion process that reconstructs the score matrix. 2 Background 2.1 Matrix Completion Matrix completion problem. Recovering the missing values of a matrix given a small fraction of its entries is an ill-posed problem without additional mathematical constraints on the space of solutions. It is common to assume that the variables lie in a smaller subspace, i.e., the matrix is of low rank, min X rank(X) s.t. xij = yij, ∀ij ∈Ω, (1) where X denotes the matrix to recover, Ωis the set of the known entries and yij are their values. Unfortunately, rank minimization turns out to be an NP-hard combinatorial problem that is computationally intractable in practical cases. The tightest possible convex relaxation of problem (1) is to replace the rank with the nuclear norm ∥· ∥⋆equal to the sum of its singular values [8], min X ∥X∥⋆+ µ 2 ∥Ω◦(X −Y)∥2 F; (2) the equality constraint is also replaced with a penalty to make the problem more robust to noise (here Ωis the indicator matrix of the known entries Ωand ◦denotes the Hadamard pointwise product). 2 Candès and Recht [8] proved that under some technical conditions the solutions of problems (2) and (1) coincide. Geometric matrix completion An alternative relaxation of the rank operator in (1) can be achieved constraining the space of solutions to be smooth w.r.t. some geometric structure on the rows and columns of the matrix [27, 19, 33, 1]. The simplest model is proximity structure represented as an undirected weighted column graph Gc = ({1, . . . , n}, Ec, Wc) with adjacency matrix Wc = (wc ij), where wc ij = wc ji, wc ij = 0 if (i, j) /∈Ec and wc ij > 0 if (i, j) ∈Ec. In our setting, the column graph could be thought of as a social network capturing relations between users and the similarity of their tastes. The row graph Gr = ({1, . . . , m}, Er, Wr) representing the items similarities is defined similarly. On each of these graphs one can construct the (normalized) graph Laplacian, an n × n symmetric positive-semidefinite matrix ∆= I −D−1/2WD−1/2, where D = diag(P j̸=i wij) is the degree matrix. We denote the Laplacian associated with row and column graphs by ∆r and ∆c, respectively. Considering the columns (respectively, rows) of matrix X as vector-valued functions on the column graph Gc (respectively, row graph Gr), their smoothness can be expressed as the Dirichlet norm ∥X∥2 Gr = trace(X⊤∆rX) (respecitvely, ∥X∥2 Gc = trace(X∆cX⊤)). The geometric matrix completion problem [19] thus boils down to minimizing min X ∥X∥2 Gr + ∥X∥2 Gc + µ 2 ∥Ω◦(X −Y)∥2 F. (3) Factorized models. Matrix completion algorithms introduced in the previous section are well-posed as convex optimization problems, guaranteeing existence, uniqueness and robustness of solutions. Besides, fast algorithms have been developed for the minimization of the non-differentiable nuclear norm. However, the variables in this formulation are the full m × n matrix X, making it hard to scale up to large matrices such as the Netflix challenge. A solution is to use a factorized representation [38, 22, 27, 43, 33, 1] X = WH⊤, where W, H are m × r and n × r matrices, respectively, with r ≪min(m, n). The use of factors W, H reduces the number of degrees of freedom from O(mn) to O(m + n); this representation is also attractive as people often assumes the original matrix to be low-rank for solving the matrix completion problem, and rank(WH⊤) ≤r by construction. The nuclear norm minimization problem (2) can be rewritten in a factorized form as [38]: min W,H 1 2∥W∥2 F + 1 2∥H∥2 F + µ 2 ∥Ω◦(WH⊤−Y)∥2 F. (4) and the factorized formulation of the graph-based minimization problem (3) as min W,H 1 2∥W∥2 Gr + 1 2∥H∥2 Gc + µ 2 ∥Ω◦(WH⊤−Y)∥2 F. (5) The limitation of model (5) is that it decouples the regularization previously applied simultaneously on the rows and columns of X in (3), but the advantage is linear instead of quadratic complexity. 2.2 Deep learning on graphs The key concept underlying our work is geometric deep learning, an extension of CNNs to graphs. In particular, we focus here on graph CNNs formulated in the spectral domain. A graph Laplacian admits a spectral eigendecomposition of the form ∆= ΦΛΦ⊤, where Φ = (φ1, . . . φn) denotes the matrix of orthonormal eigenvectors and Λ = diag(λ1, . . . , λn) is the diagonal matrix of the corresponding eigenvalues. The eigenvectors play the role of Fourier atoms in classical harmonic analysis and the eigenvalues can be interpreted as frequencies. Given a function x = (x1, . . . , xn)⊤on the vertices of the graph, its graph Fourier transform is given by ˆx = Φ⊤x. The spectral convolution of two functions x, y can be defined as the element-wise product of the respective Fourier transforms, x ⋆y = Φ(Φ⊤y) ◦(Φ⊤x) = Φ diag(ˆy1, . . . , ˆyn) ˆx, (6) by analogy to the Convolution Theorem in the Euclidean case. Bruna et al. [7] used the spectral definition of convolution (6) to generalize CNNs on graphs. A spectral convolutional layer in this formulation has the form ˜xl = ξ   q′ X l′=1 Φ ˆYll′Φ⊤xl′  , l = 1, . . . , q, (7) 3 where q′, q denote the number of input and output channels, respectively, ˆYll′ = diag(ˆyll′,1, . . . , ˆyll′,n) is a diagonal matrix of spectral multipliers representing a learnable filter in the spectral domain, and ξ is a nonlinearity (e.g. ReLU) applied on the vertex-wise function values. Unlike classical convolutions carried out efficiently in the spectral domain using FFT, the computations of the forward and inverse graph Fourier transform incur expensive O(n2) multiplication by the matrices Φ, Φ⊤, as there are no FFT-like algorithms on general graphs. Second, the number of parameters representing the filters of each layer of a spectral CNN is O(n), as opposed to O(1) in classical CNNs. Third, there is no guarantee that the filters represented in the spectral domain are localized in the spatial domain, which is another important property of classical CNNs. Henaff et al. [15] argued that spatial localization can be achieved by forcing the spectral multipliers to be smooth. The filter coefficients are represented as ˆyk = τ(λk), where τ(λ) is a smooth transfer function of frequency λ; its application to a signal x is expressed as τ(∆)x = Φ diag(τ(λ1), . . . , τ(λn))Φ⊤x, where applying a function to a matrix is understood in the operator sense and boils down to applying the function to the matrix eigenvalues. In particular, the authors used parametric filters of the form τθ(λ) = p X j=1 θjβj(λ), (8) where β1(λ), . . . , βr(λ) are some fixed interpolation kernels, and θ = (θ1, . . . , θp) are p = O(1) interpolation coefficients acting as parameters of the spectral convolutional layer. Defferrard et al. [10] used polynomial filters of order p represented in the Chebyshev basis, τθ(˜λ) = p X j=0 θjTj(˜λ), (9) where ˜λ is frequency rescaled in [−1, 1], θ is the (p+1)-dimensional vector of polynomial coefficients parametrizing the filter, and Tj(λ) = 2λTj−1(λ) −Tj−2(λ) denotes the Chebyshev polynomial of degree j defined in a recursive manner with T1(λ) = λ and T0(λ) = 1. Here, ˜∆= 2λ−1 n ∆−I is the rescaled Laplacian with eigenvalues ˜Λ = 2λ−1 n Λ −I in the interval [−1, 1]. This approach benefits from several advantages. First, it does not require an explicit computation of the Laplacian eigenvectors, as applying a Chebyshev filter to x amounts to τθ( ˜∆)x = Pp j=0 θjTj( ˜∆)x; due to the recursive definition of the Chebyshev polynomials, this incurs applying the Laplacian p times. Multiplication by Laplacian has the cost of O(|E|), and assuming the graph has |E| = O(n) edges (which is the case for k-nearest neighbors graphs and most real-world networks), the overall complexity is O(n) rather than O(n2) operations, similarly to classical CNNs. Moreover, since the Laplacian is a local operator affecting only 1-hop neighbors of a vertex and accordingly its pth power affects the p-hop neighborhood, the resulting filters are spatially localized. 3 Our approach In this paper, we propose formulating matrix completion as a problem of deep learning on user and item graphs. We consider two architectures summarized in Figures 1 and 2. The first architecture works on the full matrix model producing better accuracy but requiring higher complexity. The second architecture used factorized matrix model, offering better scalability at the expense of slight reduction of accuracy. For both architectures, we consider a combination of multi-graph CNN and RNN, which will be described in detail in the following sections. Multi-graph CNNs are used to extract local stationary features from the score matrix using row and column similarities encoded by user and item graphs. Then, these spatial features are fed into a RNN that diffuses the score values progressively, reconstructing the matrix. 3.1 Multi-Graph CNNs Multi-graph convolution. Our first goal is to extend the notion of the aforementioned graph Fourier transform to matrices whose rows and columns are defined on row- and column-graphs. We recall that the classical two-dimensional Fourier transform of an image (matrix) can be thought of as applying a one-dimensional Fourier transform to its rows and columns. In our setting, the analogy of the two-dimensional Fourier transform has the form ˆX = Φ⊤ r XΦc (10) 4 where Φc, Φr and Λc = diag(λc,1, . . . , λc,n) and Λr = diag(λr,1, . . . , λr,m) denote the n × n and m × m eigenvector- and eigenvalue matrices of the column- and row-graph Laplacians ∆c, ∆r, respectively. The multi-graph version of the spectral convolution (6) is given by X ⋆Y = Φr( ˆX ◦ˆY)Φ⊤ c , (11) and in the classical setting can be thought as the analogy of filtering a 2D image in the spectral domain (column and row graph eigenvalues λc and λr generalize the x- and y-frequencies of an image). As in [7], representing multi-graph filters as their spectral multipliers ˆY would yield O(mn) parameters, prohibitive in any practical application. To overcome this limitation, we follow [15], assuming that the multi-graph filters are expressed in the spectral domain as a smooth function of both frequencies (eigenvalues λc, λr of the row- and column graph Laplacians) of the form ˆYk,k′ = τ(λc,k, λr,k′). In particular, using Chebychev polynomial filters of degree p,1 τΘ(˜λc, ˜λr) = p X j,j′=0 θjj′Tj(˜λc)Tj′(˜λr), (12) where ˜λc, ˜λr are the frequencies rescaled [−1, 1] (see Figure 4 for examples). Such filters are parametrized by a (p + 1) × (p + 1) matrix of coefficients Θ = (θjj′), which is O(1) in the input size as in classical CNNs on images. The application of a multi-graph filter to the matrix X ˜X = p X j,j′=0 θjj′Tj( ˜∆r)XTj′( ˜∆c) (13) incurs an O(mn) computational complexity (here, as previously, ˜∆c = 2λ−1 c,n∆c −I and ˜∆r = 2λ−1 r,m∆r −I denote the scaled Laplacians). Similarly to (7), a multi-graph convolutional layer using the parametrization of filters according to (13) is applied to q′ input channels (m × n matrices X1, . . . , Xq′ or a tensor of size m × n × q′), ˜Xl = ξ   q′ X l′=1 Xl′ ⋆Yll′  = ξ   q′ X l′=1 p X j,j′=0 θjj′,ll′Tj( ˜∆r)Xl′Tj′( ˜∆c)  , l = 1, . . . , q, (14) producing q outputs (tensor of size m × n × q). Several layers can be stacked together. We call such an architecture a Multi-Graph CNN (MGCNN). Separable convolution. A simplification of the multi-graph convolution is obtained considering the factorized form of the matrix X = WH⊤and applying one-dimensional convolutions to the respective graph to each factor. Similarly to the previous case, we can express the filters resorting to Chebyshev polynomials, ˜wl = p X j=0 θr jTj( ˜∆r)wl, ˜hl = p X j′=0 θc j′Tj′( ˜∆c)hl, l = 1, . . . , r (15) where wl, hl denote the lth columns of factors W, H and θr = (θr 0, . . . , θr p) and θc = (θc 0, . . . , θc p) are the parameters of the row- and column- filters, respectively (a total of 2(p + 1) = O(1)). Application of such filters to W and H incurs O(m + n) complexity. Convolutional layers (14) thus take the form ˜wl = ξ   q′ X l′=1 p X j=0 θr j,ll′Tj( ˜∆r)wl′  , ˜hl = ξ   q′ X l′=1 p X j′=0 θc j′,ll′Tj′( ˜∆c)hl′  . (16) We call such an architecture a separable MGCNN or sMGCNN. 3.2 Matrix diffusion with RNNs The next step of our approach is to feed the spatial features extracted from the matrix by the MGCNN or sMGCNN to a recurrent neural network (RNN) implementing a diffusion process that progressively reconstructs the score matrix (see Figure 3). Modelling matrix completion as a diffusion process 1For simplicity, we use the same degree p for row- and column frequencies. 5 X X(t) ˜X(t) MGCNN RNN dX(t) X(t+1) = X(t) + dX(t) row+column filtering Figure 1: Recurrent MGCNN (RMGCNN) architecture using the full matrix completion model and operating simultaneously on the rows and columns of the matrix X. Learning complexity is O(mn). W H⊤ H(t) ˜H(t) W(t) ˜ W(t) GCNN RNN GCNN RNN dH(t) dW(t) W(t+1) = W(t) + dW(t) H(t+1) = H(t) + dH(t) row filtering column filtering Figure 2: Separable Recurrent MGCNN (sRMGCNN) architecture using the factorized matrix completion model and operating separately on the rows and columns of the factors W, H⊤. Learning complexity is O(m + n). t = 0 1 2 3 4 5 6 7 8 9 10 2.26 1.89 1.60 1.78 1.31 0.52 0.48 0.63 0.38 0.07 0.01 1.15 1.04 0.94 0.89 0.84 0.76 0.69 0.49 0.27 0.11 0.01 Figure 3: Evolution of matrix X(t) with our architecture using full matrix completion model RMGCNN (top) and factorized matrix completion model sRMGCNN (bottom). Numbers indicate the RMS error. appears particularly suitable for realizing an architecture which is independent of the sparsity of the available information. In order to combine the few scores available in a sparse input matrix, a multilayer CNN would require very large filters or many layers to diffuse the score information across matrix domains. On the contrary, our diffusion-based approach allows to reconstruct the missing information just by imposing the proper amount of diffusion iterations. This gives the possibility to deal with extremely sparse data, without requiring at the same time excessive amounts of model parameters. See Table 3 for an experimental evaluation on this aspect. We use the classical LSTM architecture [16], which has demonstrated to be highly efficient to learn complex non-linear diffusion processes due to its ability to keep long-term internal states (in particular, limiting the vanishing gradient issue). The input of the LSTM gate is given by the static features extracted from the MGCNN, which can be seen as a projection or dimensionality reduction of the original matrix in the space of the most meaningful and representative information (the disentanglement effect). This representation coupled with LSTM appears particularly well-suited to keep a long term internal state, which allows to predict accurate small changes dX of the matrix X (or dW, dH of the factors W, H) that can propagate through the full temporal steps. 6 Figures 1 and 2 and Algorithms 1 and 2 summarize the proposed matrix completion architectures. We refer to the whole architecture combining the MGCNN and RNN in the full matrix completion setting as recurrent multi-graph CNN (RMGCNN). The factorized version with separable MGCNN and RNN is referred to as separable RMGCNN (sRMGCNN). The complexity of Algorithm 1 scales quadratically as O(mn) due to the use of MGCNN. For large matrices, Algorithm 2 that processes the rows and columns separately with standard GCNNs and scales linearly as O(m + n) is preferable. We will demonstrate in Section 4 that the proposed RMGCNN and sRMGCNN architectures show themselves very well on different settings of matrix completion problems. However, we should note that this is just one possible configuration, which we by no means claim to be optimal. For example, in all our experiments we used only one convolutional layer; it is likely that better yet performance could be achieved with more layers. Algorithm 1 (RMGCNN) input m × n matrix X(0) containing initial values 1: for t = 0 : T do 2: Apply the Multi-Graph CNN (13) on X(t) producing an m × n × q output ˜X(t). 3: for all elements (i, j) do 4: Apply RNN to q-dim ˜x(t) ij = (˜x(t) ij1, . . . , ˜x(t) ijq) producing incremental update dx(t) ij 5: end for 6: Update X(t+1) = X(t) + dX(t) 7: end for Algorithm 2 (sRMGCNN) input m × r factor H(0) and n × r factor W(0) representing the matrix X(0) 1: for t = 0 : T do 2: Apply the Graph CNN on H(t) producing an n × q output ˜H(t). 3: for j = 1 : n do 4: Apply RNN to q-dim ˜h(t) j = (˜h(t) j1 , . . . , ˜h(t) jq ) producing incremental update dh(t) j 5: end for 6: Update H(t+1) = H(t) + dH(t) 7: Repeat steps 2-6 for W(t+1) 8: end for 3.3 Training Training of the networks is performed by minimizing the loss ℓ(Θ, σ) = ∥X(T ) Θ,σ∥2 Gr + ∥X(T ) Θ,σ∥2 Gc + µ 2 ∥Ω◦(X(T ) Θ,σ −Y)∥2 F. (17) Here, T denotes the number of diffusion iterations (applications of the RNN), and we use the notation X(T ) Θ,σ to emphasize that the matrix depends on the parameters of the MGCNN (Chebyshev polynomial coefficients Θ) and those of the LSTM (denoted by σ). In the factorized setting, we use the loss ℓ(θr, θc, σ) = ∥W(T ) θr,σ∥2 Gr + ∥H(T ) θc,σ∥2 Gc + µ 2 ∥Ω◦(W(T ) θr,σ(H(T ) θc,σ)⊤−Y)∥2 F (18) where θc, θr are the parameters of the two GCNNs. 4 Results2 Experimental settings. We closely followed the experimental setup of [33], using five standard datasets: Synthetic dataset from [19], MovieLens [29], Flixster [18], Douban [27], and YahooMusic [11]. We used disjoint training and test sets and the presented results are reported on test sets in all our experiments. As in [33], we evaluated MovieLens using only the first of the 5 provided data splits. For Flixster, Douban and YahooMusic, we evaluated on a reduced matrix of 3000 users and items, considering 90% of the given scores as training set and the remaining as test set. Classical Matrix Completion (MC) [9], Inductive Matrix Completion (IMC) [17, 42], Geometric Matrix Completion (GMC) [19], and Graph Regularized Alternating Least Squares (GRALS) [33] were used as baseline methods. In all the experiments, we used the following settings for our RMGCNNs: Chebyshev polynomials of order p = 4, outputting k = 32-dimensional features, LSTM cells with 32 features and T = 10 diffusion steps (for both training and test). The number of diffusion steps T has been estimated on the Movielens validation set and used in all our experiments. A better estimate of T can be done by cross-validation, and thus can potentially only improve the final results. All the 2Code: https://github.com/fmonti/mgcnn 7 models were implemented in Google TensorFlow and trained using the Adam stochastic optimization algorithm [20] with learning rate 10−3. In factorized models, ranks r = 15 and 10 was used for the synthetic and real datasets, respectively. For all methods, hyperparameters were chosen by cross-validation. Figure 4: Absolute value |τ(˜λc, ˜λr)| of the first ten spectral filters learnt by our MGCNN model. In each matrix, rows and columns represent frequencies ˜λr and ˜λc of the row and column graphs, respectively. 0 0.5 1 1.5 2 0 0.2 0.4 0.6 0.8 λr, λc Filter Response Figure 5: Absolute values |τ(˜λc)| and |τ(˜λr)| of the first four column (solid) and row (dashed) spectral filters learned by our sMGCNN model. 4.1 Synthetic data We start the experimental evaluation showing the performance of our approach on a small synthetic dataset, in which the user and item graphs have strong communities structure. Though rather simple, such a dataset allows to study the behavior of different algorithms in controlled settings. The performance of different matrix completion methods is reported in Table 1, along with their theoretical complexity. Our RMGCNN and sRMGCNN models achieve better accuracy than other methods with lower complexity. Different diffusion time steps of these two models are visualized in Figure 3. Figures 4 and 5 depict the spectral filters learnt by MGCNN and row- and column-GCNNs. We repeated the same experiment assuming only the column (users) graph to be given. In this setting, RMGCNN cannot be applied, while sRMGCNN has only one GCNN applied on the factor H (the other factor W is free). Table 2 summarizes the results of this experiment, again, showing that our approach performs the best. Table 3 compares our RMGCNN with more classical multilayer MGCNNs. Our recurrent solutions outperforms deeper and more complex architectures, requiring at the same time a lower amount of parameters. Table 1: Comparison of different matrix completion methods using users+items graphs in terms of number of parameters (optimization variables) and computational complexity order (operations per iteration). Big-O notation is avoided for clarity reasons. Rightmost column shows the RMS error on Synthetic dataset. METHOD PARAMS NO. OP. RMSE GMC mn mn 0.3693 GRALS m + n m + n 0.0114 sRMGCNN 1 m + n 0.0106 RMGCNN 1 mn 0.0053 Table 2: Comparison of different matrix completion methods using users graph only in terms of number of parameters (optimization variables) and computational complexity order (operations per iteration). Big-O notation is avoided for clarity reasons. Rightmost column shows the RMS error on Synthetic dataset. METHOD PARAMS NO. OP. RMSE GRALS m + n m + n 0.0452 sRMGCNN m m + n 0.0362 Table 3: Reconstruction errors for the synthetic dataset between multiple convolutional layers architectures and the proposed architecture. Chebyshev polynomials of order 4 have been used for both users and movies graphs (q′MGCq denotes a multi-graph convolutional layer with q′ input features and q output features). Method Params Architecture RMSE MGCNN3layers 9K 1MGC32, 32MGC10, 10MGC1 0.0116 MGCNN4layers 53K 1MGC32, 32MGC32 × 2, 32MGC1 0.0073 MGCNN5layers 78K 1MGC32, 32MGC32 × 3, 32MGC1 0.0074 MGCNN6layers 104K 1MGC32, 32MGC32 × 4, 32MGC1 0.0064 RMGCNN 9K 1MGC32 + LSTM 0.0053 8 4.2 Real data Following [33], we evaluated the proposed approach on the MovieLens, Flixster, Douban and YahooMusic datasets. For the MovieLens dataset we constructed the user and item (movie) graphs as unweighted 10-nearest neighbor graphs in the space of user and movie features, respectively. For Flixster, the user and item graphs were constructed from the scores of the original matrix. On this dataset, we also performed an experiment using only the users graph. For the Douban dataset, we used only the user graph (provided in the form of a social network). For the YahooMusic dataset, we used only the item graph, constructed with unweighted 10-nearest neighbors in the space of item features (artists, albums, and genres). For the latter three datasets, we used a sub-matrix of 3000 × 3000 entries for evaluating the performance. Tables 4 and 5 summarize the performance of different methods. sRMGCNN outperforms the competitors in all the experiments. Table 4: Performance (RMS error) of different matrix completion methods on the MovieLens dataset. METHOD RMSE GLOBAL MEAN 1.154 USER MEAN 1.063 MOVIE MEAN 1.033 MC [9] 0.973 IMC [17, 42] 1.653 GMC [19] 0.996 GRALS [33] 0.945 sRMGCNN 0.929 Table 5: Performance (RMS error) on several datasets. For Douban and YahooMusic, a single graph (of users and items respectively) was used. For Flixster, two settings are shown: users+items graphs / only users graph. METHOD FLIXSTER DOUBAN YAHOOMUSIC GRALS 1.3126 / 1.2447 0.8326 38.0423 sRMGCNN 1.1788 / 0.9258 0.8012 22.4149 5 Conclusions In this paper, we presented a new deep learning approach for matrix completion based on multi-graph convolutional neural network architecture. Among the key advantages of our approach compared to traditional methods is its low computational complexity and constant number of degrees of freedom independent of the matrix size. We showed that the use of deep learning for matrix completion allows to beat related state-of-the-art recommender system methods. To our knowledge, our work is the first application of deep learning on graphs to this class of problems. We believe that it shows the potential of the nascent field of geometric deep learning on non-Euclidean domains, and will encourage future works in this direction. Acknowledgments FM and MB are supported in part by ERC Starting Grant No. 307047 (COMET), ERC Consolidator Grant No. 724228 (LEMAN), Google Faculty Research Award, Nvidia equipment grant, Radcliffe fellowship from Harvard Institute for Advanced Study, and TU Munich Institute for Advanced Study, funded by the German Excellence Initiative and the European Union Seventh Framework Programme under grant agreement No. 291763. XB is supported in part by NRF Fellowship NRFF2017-10. References [1] K. Benzi, V. Kalofolias, X. Bresson, and P. Vandergheynst. Song recommendation with nonnegative matrix factorization and graph total variation. In Proc. ICASSP, 2016. [2] D. Boscaini, J. Masci, S. Melzi, M. M. Bronstein, U. Castellani, and P. Vandergheynst. Learning class-specific descriptors for deformable shapes using localized spectral convolutional networks. Computer Graphics Forum, 34(5):13–23, 2015. [3] D. Boscaini, J. Masci, E. Rodolà, and M. M. Bronstein. Learning shape correspondence with anisotropic convolutional neural networks. In Proc. NIPS, 2016. [4] D. Boscaini, J. Masci, E. Rodolà, M. M. Bronstein, and D. Cremers. Anisotropic diffusion descriptors. Computer Graphics Forum, 35(2):431–441, 2016. [5] J. Breese, D. Heckerman, and C. Kadie. Empirical Analysis of Predictive Algorithms for Collaborative Filtering. In Proc. Uncertainty in Artificial Intelligence, 1998. 9 [6] 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. [7] J. Bruna, W. Zaremba, A. Szlam, and Y. LeCun. Spectral networks and locally connected networks on graphs. 2013. [8] E. Candès and B. Recht. Exact Matrix Completion via Convex Optimization. Foundations of Computational Mathematics, 9(6):717–772, 2009. [9] E. Candes and B. Recht. Exact matrix completion via convex optimization. Comm. ACM, 55(6):111–119, 2012. [10] M. Defferrard, X. Bresson, and P. Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Proc. NIPS, 2016. [11] G. Dror, N. Koenigstein, Y. Koren, and M. Weimer. The Yahoo! music dataset and KDD-Cup’11. In KDD Cup, 2012. [12] D. K. Duvenaud et al. Convolutional networks on graphs for learning molecular fingerprints. In Proc. NIPS, 2015. [13] M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In Proc. IJCNN, 2005. [14] X. He, L. Liao, H. Zhang, L. Nie, X. Hu, and T. Chua. Neural collaborative filtering. In Proc. WWW, 2017. [15] M. Henaff, J. Bruna, and Y. LeCun. Deep convolutional networks on graph-structured data. arXiv:1506.05163, 2015. [16] S. Hochreiter and J. Schmidhuber. Long short-term memory. Neural Computation, 9(8):1735– 1780, 1997. [17] P. Jain and I. S. Dhillon. Provable inductive matrix completion. arXiv:1306.0626, 2013. [18] M. Jamali and M. Ester. A matrix factorization technique with trust propagation for recommendation in social networks. In Proc. Recommender Systems, 2010. [19] V. Kalofolias, X. Bresson, M. M. Bronstein, and P. Vandergheynst. Matrix completion on graphs. 2014. [20] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. 2015. [21] T. N. Kipf and M. Welling. Semi-supervised classification with graph convolutional networks. 2017. [22] Y. Koren, R. Bell, and C. Volinsky. Matrix factorization techniques for recommender systems. Computer, 42(8):30–37, 2009. [23] S. I. Ktena, S. Parisot, E. Ferrante, M. Rajchl, M. Lee, B. Glocker, and D. Rueckert. Distance metric learning using graph convolutional networks: Application to functional brain networks. In Proc. MICCAI, 2017. [24] D. Kuang, Z. Shi, S. Osher, and A. L. Bertozzi. A harmonic extension approach for collaborative ranking. CoRR, abs/1602.05127, 2016. [25] Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proc. IEEE, 86(11):2278–2324, 1998. [26] Y. Li, D. Tarlow, M. Brockschmidt, and R. Zemel. Gated graph sequence neural networks. 2016. [27] H. Ma, D. Zhou, C. Liu, M. Lyu, and I. King. Recommender systems with social regularization. In Proc. Web Search and Data Mining, 2011. 10 [28] J. Masci, D. Boscaini, M. M. Bronstein, and P. Vandergheynst. Geodesic convolutional neural networks on Riemannian manifolds. In Proc. 3DRR, 2015. [29] B. N. Miller et al. MovieLens unplugged: experiences with an occasionally connected recommender system. In Proc. Intelligent User Interfaces, 2003. [30] F. Monti, D. Boscaini, J. Masci, E. Rodolà, J. Svoboda, and M. M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model CNNs. In Proc. CVPR, 2017. [31] S. Parisot, S. I. Ktena, E. Ferrante, M. Lee, R. Guerrerro Moreno, B. Glocker, and D. Rueckert. Spectral graph convolutions for population-based disease prediction. In Proc. MICCAI, 2017. [32] M. Pazzani and D. Billsus. Content-based Recommendation Systems. The Adaptive Web, pages 325–341, 2007. [33] N. Rao, H.-F. Yu, P. K. Ravikumar, and I. S. Dhillon. Collaborative filtering with graph information: Consistency and scalable methods. In Proc. NIPS, 2015. [34] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini. The graph neural network model. IEEE Trans. Neural Networks, 20(1):61–80, 2009. [35] S. Sedhain, A. Menon, S. Sanner, and L. Xie. Autorec: Autoencoders meet collaborative filtering. In Proc. WWW, 2015. [36] Y. Seo, M. Defferrard, P. Vandergheynst, and X. Bresson. Structured sequence modeling with graph convolutional recurrent networks. arXiv:1612.07659, 2016. [37] D. I. Shuman, S. K. Narang, P. Frossard, A. Ortega, and P. Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE Sig. Proc. Magazine, 30(3):83–98, 2013. [38] N. Srebro, J. Rennie, and T. Jaakkola. Maximum-Margin Matrix Factorization. In Proc. NIPS, 2004. [39] Y. Suhara, X. Dong, and A. S. Pentland. Deepshop: Understanding purchase patterns via deep learning. In Proc. International Conference on Computational Social Science, 2016. [40] S. Sukhbaatar, A. Szlam, and R. Fergus. Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems, pages 2244–2252, 2016. [41] M. Vestner, R. Litman, E. Rodolà, A. Bronstein, and D. Cremers. Product manifold filter: Non-rigid shape correspondence via kernel density estimation in the product space. In Proc. CVPR, 2017. [42] M. Xu, R. Jin, and Z.-H. Zhou. Speedup matrix completion with side information: Application to multi-label learning. In Proc. NIPS, 2013. [43] F. Yanez and F. Bach. Primal-dual algorithms for non-negative matrix factorization with the kullback-leibler divergence. In Acoustics, Speech and Signal Processing (ICASSP), 2017 IEEE International Conference on, pages 2257–2261. IEEE, 2017. [44] Y. Zheng, B. Tang, W. Ding, and H. Zhou. A neural autoregressive approach to collaborative filtering. In Proc. ICML, 2016. 11
2017
124
6,591
Maximizing Subset Accuracy with Recurrent Neural Networks in Multi-label Classification Jinseok Nam1, Eneldo Loza Mencía1, Hyunwoo J. Kim2, and Johannes Fürnkranz1 1Knowledge Engineering Group, TU Darmstadt 2Department of Computer Sciences, University of Wisconsin-Madison Abstract Multi-label classification is the task of predicting a set of labels for a given input instance. Classifier chains are a state-of-the-art method for tackling such problems, which essentially converts this problem into a sequential prediction problem, where the labels are first ordered in an arbitrary fashion, and the task is to predict a sequence of binary values for these labels. In this paper, we replace classifier chains with recurrent neural networks, a sequence-to-sequence prediction algorithm which has recently been successfully applied to sequential prediction tasks in many domains. The key advantage of this approach is that it allows to focus on the prediction of the positive labels only, a much smaller set than the full set of possible labels. Moreover, parameter sharing across all classifiers allows to better exploit information of previous decisions. As both, classifier chains and recurrent neural networks depend on a fixed ordering of the labels, which is typically not part of a multi-label problem specification, we also compare different ways of ordering the label set, and give some recommendations on suitable ordering strategies. 1 Introduction There is a growing need for developing scalable multi-label classification (MLC) systems, which, e.g., allow to assign multiple topic terms to a document or to identify objects in an image. While the simple binary relevance (BR) method approaches this problem by treating multiple targets independently, current research in MLC has focused on designing algorithms that exploit the underlying label structures. More formally, MLC is the task of learning a function f that maps inputs to subsets of a label set L = {1, 2, · · · , L}. Consider a set of N samples D = {(xn, yn)}N n=1, each of which consists of an input x ∈X and its target y ∈Y, and the (xn, yn) are assumed to be i.i.d following an unknown distribution P(X, Y ) over a sample space X × Y. We let Tn = |yn| denote the size of the label set associated to xn and C = 1 N PN n=1 Tn the cardinality of D, which is usually much smaller than L. Often, it is convenient to view y not as a subset of L but as a binary vector of size L, i.e., y ∈{0, 1}L. Given a function f parameterized by θ that returns predicted outputs ˆy of inputs x, i.e., ˆy ←f(x; θ), and a loss function ℓ: (y, ˆy) →R which measures the discrepancy between y and ˆy, the goal is to find an optimal parametrization f ∗that minimizes the expected loss on an unknown sample drawn from P(X, Y ) such that f ∗= arg minf EX  EY |X [ℓ(Y , f(X; θ))]  . While the expected risk minimization over P(X, Y ) is intractable, for a given observation x it can be simplified to f ∗(x) = arg minf EY |X [ℓ(Y , f(x; θ))] . A natural choice for the loss function is subset 0/1 loss defined as ℓ0/1(y, f (x; θ)) = I [y ̸= ˆy] which is a generalization of the 0/1 loss in binary classification to multi-label problems. It can be interpreted as an objective to find the mode of the joint probability of label sets y given instances x: EY |X  ℓ0/1 (Y , ˆy)  = 1 −P(Y = y|X = x). Conversely, 1 −ℓ0/1(y, f (x; θ)) is often referred to as subset accuracy in the literature. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. 2 Subset Accuracy Maximization in Multi-label Classification For maximizing subset accuracy, there are two principled ways for reducing a MLC problem to multiple subproblems. The simplest method, label powerset (LP), defines a set of all possible label combinations SL = {{1}, {2}, · · · , {1, 2, · · · , L}}, from which a new class label is assigned to each label subset consisting of positive labels in D. LP, then, addresses MLC as a multi-class classification problem with min(N, 2L) possible labels such that P(y1, y2, · · · , yL|x) LP −−→P(yLP = k|x) (1) where k ∈{1, 2, · · · , min(N, 2L)}. While LP is appealing because most methods well studied in multi-class classification can be used, training LP models becomes intractable for large-scale problems with an increasing number of labels in SL. Even if the number of labels L is small enough, the problem is still prone to suffer from data scarcity because each label subset in LP will in general only have a few training instances. An effective solution to these problems is to build an ensemble of LP models learning from randomly constructed small label subset spaces [29]. An alternative approach is to learn the joint probability of labels, which is prohibitively expensive due to 2L label configurations. To address such a problem, Dembczy´nski et al. [3] have proposed probabilistic classifier chain (PCC) which decomposes the joint probability into L conditional probabilities: P(y1, y2, · · · , yL|x) = L Y i=1 P(yi|y<i, x) (2) where y<i = {y1, · · · , yi−1} denotes a set of labels that precede a label yi in computing conditional probabilities, and y<i = ∅if i = 1. For training PCCs, L functions need to be learned independently to construct a probability tree with 2L leaf nodes. In other words, PCCs construct a perfect binary tree of height L in which every node except the root node corresponds to a binary classifier. Therefore, obtaining the exact solution of such a probabilistic tree requires to find an optimal path from the root to a leaf node. A naïve approach for doing so requires 2L path evaluations in the inference step, and is therefore also intractable. However, several approaches have been proposed to reduce the computational complexity [4, 13, 24, 19]. Apart from the computational issue, PCC has also a few fundamental problems. One of them is a cascadation of errors as the length of a chain gets longer [25]. During training, the classifiers fi in the chain are trained to reduce the errors E(yi, ˆyi) by enriching the input vectors x with the corresponding previous true targets y<i as additional features. In contrast, at test time, fi generates samples ˆyi or estimates P(ˆyi|x, ˆy<i) where ˆy<i are obtained from the preceding classifiers f1, · · · , fi−1. Another key limitation of PCCs is that the classifiers fi are trained independently according to a fixed label order, so that each classifier is only able to make predictions with respect to a single label in a chain of labels. Regardless of the order of labels, the product of conditional probabilities in Eq. (2) represents the joint probability of labels by the chain rule, but in practice the label order in a chain has an impact on estimating the conditional probabilities. This issue was addressed in the past by ensemble averaging [23, 3], ensemble pruning [17] or by a previous analysis of the label dependencies, e.g., by Bayes nets [27], and selecting the ordering accordingly. Similar methods learning a global order over the labels have been proposed by [13], who use kernel target alignment to order the chain according to the difficulty of the single-label problems, and by [18], who formulate the problem of finding the globally optimal label order as a dynamic programming problem. Aside from PCC, there has been another family of probabilistic approaches to maximizing subset accuracy [9, 16]. 3 Learning to Predict Subsets as Sequence Prediction In the previous section, we have discussed LP and PCC as a means of subset accuracy maximization. Note that yLP in Eq. (1) denotes a set of positive labels. Instead of solving Eq. (1) using a multi-class classifier, one can consider predicting all labels individually in yLP, and interpret this approach as a way of maximizing the joint probability of a label subset given the number of labels T in the subset. Similar to PCC, the joint probability can be computed as product of conditional probabilities, but unlike PCC, only T ≪L terms are needed. Therefore, maximizing the joint probability of positive labels can be viewed as subset accuracy maximization such as LP in a sequential manner as the 2 way PCC works. To be more precise, y can be represented as a set of 1-of-L vectors such that y = {ypi}T i=1 and ypi ∈RL where T is the number of positive labels associated with an instance x. The joint probability of positive labels can be written as P(yp1, yp2, · · · , ypT |x) = T Y i=1 P(ypi|y<pi, x). (3) Note that Eq. (3) has the same form with Eq. (2) except for the number of output variables. While Eq. (2) is meant to maximize the joint probability over the entire 2L configurations, Eq. (3) represents the probability of sets of positive labels and ignores negative labels. The subscript p is omitted unless it is needed for clarity. A key advantage of Eq. (3) over the traditional multi-label formulation is that the number of conditional probabilities to be estimated is dramatically reduced from L to T, improving scalability. Also note that each estimate itself again depends on the previous estimates. Reducing the length of the chain might be helpful in reducing the cascading errors, which is particularly relevant for labels at the end of the chain. Having said that, computations over the LT search space of Eq. (3) remain infeasible even though our search space is much smaller than the search space of PCC in Eq. (2), 2L, since the label cardinality C is usually very small, i.e., C ≪L. As each instance has a different value for T, we need MLC methods capable of dealing with a different number of output targets across instances. In fact, the idea of predicting positive labels only has been explored for MLC. Recurrent neural networks (RNNs) have been successful in solving complex output space problems. In particular, Wang et al. [31] have demonstrated that RNNs provide a competitive solution on MLC image datasets. Doppa et al. [6] propose multi-label search where a heuristic function and cost function are learned to iteratively search for elements to be chosen as positive labels on a binary vector of size L. In this work, we make use of RNNs to compute QT i=1 P(ypi|y<pi, x) for which the order of labels in a label subset yp1, yp2, · · · , ypT need to be determined a priori, as in PCC. In the following, we explain possible ways of choosing label permutations, and then present three RNN architectures for MLC. 3.1 Determining Label Permutations We hypothesize that some label permutations make it easier to estimate Eqs. (2) and (3) than others. However, as no ground truth such as relevance scores of each positive label to a training instance is given, we need to make the way to prepare fixed label permutations during training. The most straightforward approach is to order positive labels by frequency simply either in a descending (from frequent to rare labels) or an ascending (from rare to frequent ones) order. Although this type of label permutation may break down label correlations in a chain, Wang et al. [31] have shown that the descending label ordering allows to achieve a decent performance on multi-label image datasets. As an alternative, if additional information such as label hierarchies is available about the labels, we can also take advantage of such information to determine label permutations. For example, assuming that labels are organized in a directed acyclic graph (DAG) where labels are partially ordered, we can obtain a total order of labels by topological sorting with depth-first search (DFS), and given that order, target labels in the training set can be sorted in a way that labels that have same ancestors in the graph are placed next to each other. In fact, this approach also preserves partial label orders in terms of the co-occurrence frequency of a child and its parent label in the graph. 3.2 Label Sequence Prediction from Given Label Permutations A recurrent neural network (RNN) is a neural network (NN) that is able to capture temporal information. RNNs have shown their superior performance on a wide range of applications where target outputs form a sequence. In our context, we can expect that MLC will also benefit from the reformulation of PCCs because the estimation of the joint probability of only positive labels as in Eq. (3) significantly reduces the length of the chains, thereby reducing the effect of error propagation. A RNN architecture that learns a sequence of L binary targets can be seen as a NN counterpart of PCC because its objective is to maximize Eq. (2), just like in PCC. We will refer to this architecture as RNNb (Fig. 1b). One can also come up with a RNN architecture maximizing Eq. (3) to take advantage of the smaller label subset size T than L, which shall be referred to as RNNm (Fig. 1c). For learning RNNs, we use gated recurrent units (GRUs) which allow to effectively avoid the vanishing gradient problem [2]. Let ¯x be the fixed input representation computed from an instance x. We shall 3 y1 y2 y3 m1 m2 m3 ¯x ¯x ¯x y<1 y<2 y<3 · · · mL ¯x y<L yL (a) PCC y1 y2 y3 h1 h2 h3 ¯x ¯x ¯x y0 y1 y2 · · · hL ¯x yL-1 yL (b) RNNb y1 y2 y3 h1 h2 h3 ¯x ¯x ¯x y0 y1 y2 (c) RNNm x1 x2 x3 x4 u1 u2 u3 u4 h1 h2 h3 y1 y2 y3 y0 y1 y2 (d) EncDec Figure 1: Illustration of PCC and RNN architectures for MLC. For the purpose of illustration, we assume T = 3 and x consists of 4 elements. explain how to determine ¯x in Sec. 4.2. Given an initial state h0 = finit (¯x), at each step i, both RNNb and RNNm compute a hidden state hi by taking ¯x and a target (or predicted) label from the previous step as inputs: hi = GRU hi−1, Vyi−1, ¯x  for RNNb and hi = GRU hi−1, Vypi−1, ¯x  for RNNm where V is the matrix of d-dimensional label embeddings. In turn, RNNb computes the conditional probabilities Pθ (yi|y<i, x) in Eq. (2) by f hi, Vyi−1, ¯x  consisting of linear projection, followed by the softmax function. Likewise, we consider f (hi, Vyi−1, ¯x) for RNNm. Note that the key difference between RNNb and RNNm is whether target labels are binary targets yi or 1-of-L targets yi. Under the assumption that the hidden states hi preserve the information on all previous labels y<i, learning RNNb and RNNm can be interpreted as learning classifiers in a chain. Whereas in PCCs an independent classifier is responsible for predicting each label, both proposed types of RNNs maintain a single set of parameters to predict all labels. The input representations ¯x to both RNNb and RNNm are kept fixed after the preprocessing of inputs x is completed. Recently, an encoder-decoder (EncDec) framework, also known as sequenceto-sequence (Seq2Seq) learning [2, 28], has drawn attention to modeling both input and output sequences, and has been applied successfully to various applications in natural language processing and computer vision [5, 14]. EncDec is composed of two RNNs: an encoder network captures the information in the entire input sequence, which is then passed to a decoder network which decodes this information into a sequence of labels (Fig. 1d). In contrast to RNNb and RNNm, which only use fixed input representations ¯x, EncDec makes use of context-sensitive input vectors from x. We describe how EncDec computes Eq. (3) in the following. Encoder. An encoder takes x and produces a sequence of D-dimensional vectors x = {x1, x2, · · · , xE} where E is the number of encoded vectors for a single instance. In this work, we consider documents as input data. For encoding documents, we use words as atomic units. Consider a document as a sequence of E words such that x = {w1, w2, · · · , wE} and a vocabulary of V words. Each word wj ∈V has its own K-dimensional vector representation uj. The set of these vectors constitutes a matrix of word embeddings defined as U ∈RK×|V|. Given this word embedding matrix U, words in a document are converted to a sequence of K-dimensional vectors u = {u1, u2, · · · , uE}, which is then fed into the RNN to learn the sequential structures in a document xj = GRU(xj−1, uj) (4) where x0 is the zero vector. Decoder. After the encoder computes xi for all elements in x, we set the initial hidden state of the decoder h0 = finit(xE), and then compute hidden states hi = GRU (hi−1, Vyi−1, ci) where ci = P j αijxj is the context vector which is the sum of the encoded input vectors weighted by attention scores αij = fatt (hi−1, xj) , αij ∈R. Then, as shown in [1], the conditional probability Pθ(yi|y<i, x) for predicting a label yi can be estimated by a function of the hidden state hi, the previous label yi−1 and the context vector ci: Pθ(yi|y<i, x) = f(hi, Vyi−1, ci). (5) Indeed, EncDec is potentially more powerful than RNNb and RNNm because each prediction is determined based on the dynamic context of the input x unlike the fixed input representation ¯x used 4 Table 1: Comparison of the three RNN architectures for MLC. RNNb RNNm EncDec hidden states GRU hi−1, Vyi−1, ¯x  GRU (hi−1, Vyi−1, ¯x) GRU (hi−1, Vyi−1, ci) prob. of output labels f hi, Vyi−1, ¯x  f (hi, Vyi−1, ¯x) f (hi, Vyi−1, ci) in PCC, RNNb and RNNm (cf. Figs. 1a to 1d). The differences in computing hidden states and conditional probabilities among the three RNNs are summarized in Table 1. Unlike in the training phase, where we know the size of positive label set T, this information is not available during prediction. Whereas this is typically solved using a meta learner that predicts a threshold in the ranking of labels, EncDec follows a similar approach as [7] and directly predicts a virtual label that indicates the end of the sequence. 4 Experimental Setup In order to see whether solving MLC problems using RNNs can be a good alternative to classifier chain (CC)-based approaches, we will compare traditional multi-label learning algorithms such as BR and PCCs with the RNN architectures (Fig. 1) on multi-label text classification datasets. For a fair comparison, we will use the same fixed label permutation strategies in all compared approaches if necessary. As it has already been demonstrated in the literature that label permutations may affect the performance of classifier chain approaches [23, 13], we will evaluate a few different strategies. 4.1 Baselines and Training Details We use feed-forward NNs as a base learner of BR, LP and PCC. For PCC, beam search with beam size of 5 is used at inference time [13]. As another NN baseline, we also consider a feed-forward NN with binary cross entropy per label [21]. We compare RNNs to FastXML [22], one of state-of-the-arts in extreme MLC.1 All NN based approaches are trained by using Adam [12] and dropout [26]. The dimensionality of hidden states of all the NN baselines as well as the RNNs is set to 1024. The size of label embedding vectors is set to 256. We used the NVIDIA Titan X to train NN models including RNNs and base learners. For FastXML, a machine with 64 cores and 1024GB memory was used. 4.2 Datasets and Preprocessing We use three multi-label text classification datasets for which we had access to the full text as it is required for our approach EncDec, namely Reuters-21578,2 RCV1-v2 [15] and BioASQ,3 each of which has different properties. Summary statistics of the datasets are given in Table 2. For preparing the train and the test set of Reuters-21578 and RCV1-v2, we follow [21]. We split instances in BioASQ by year 2014, so that all documents published in 2014 and 2015 belong to the test set. For tuning hyperparameters, we set aside 10% of the training instances as the validation set for both Reuters-21578 and RCV1-v2, but chose randomly 50 000 documents for BioASQ. The RCV1-v2 and BioASQ datasets provide label relationships as a graph. Specifically, labels in RCV1-v2 are structured in a tree. The label structure in BioASQ is a directed graph and contains cycles. We removed all edges pointing to nodes which have been already visited while traversing the graph using DFS, which results in a DAG of labels. Document Representations. For all datasets, we replaced numbers with a special token and then build a word vocabulary for each data set. The sizes of the vocabularies for Reuters-21578, RCV1-v2 and BioASQ are 22 747, 50 000 and 30 000, respectively. Out-of-vocabulary (OOV) words were also replaced with a special token and we truncated the documents after 300 words.4 1Note that as FastXML optimizes top-k ranking of labels unlike our approaches and assigns a confidence score for each label. We set a threshold of 0.5 to convert rankings of labels into bipartition predictions. 2http://www.daviddlewis.com/resources/testcollections/reuters21578/ 3http://bioasq.org 4By the truncation, one may worry about the possibility of missing information related to some specific labels. As the average length of documents in the datasets is below 300, the effect would be negligible. 5 Table 2: Summary of datasets. # training documents (Ntr), # test documents (Nts), # labels (L), label cardinality (C), # label combinations (LC), type of label structure (HS). DATASET Ntr Nts L C LC HS Reuters-21578 7770 3019 90 1.24 468 RCV1-v2 781 261 23 149 103 3.21 14 921 Tree BioASQ 11 431 049 274 675 26 970 12.60 11 673 800 DAG We trained word2vec [20] on an English Wikipedia dump to get 512-dimensional word embeddings u. Given the word embeddings, we created the fixed input representations ¯x to be used for all of the baselines in the following way: Each word in the document except for numbers and OOV words is converted into its corresponding embedding vector, and these word vectors are then averaged, resulting in a document vector ¯x. For EncDec, which learns hidden states of word sequences using an encoder RNN, all words are converted to vectors using the pre-trained word embeddings and we feed these vectors as inputs to the encoder. In this case, unlike during the preparation of ¯x, we do not ignore OOV words and numbers. Instead, we initialize the vectors for those tokens randomly. For a fair comparison, we do not update word embeddings of the encoder in EncDec. 4.3 Evaluation Measures MLC algorithms can be evaluated with multiple measures which capture different aspects of the problem. We evaluate all methods in terms of both example-based and label-based measures. Example-based measures are defined by comparing the target vector y = {y1, y2, · · · , yL} to the prediction vector ˆy = {ˆy1, ˆy2, · · · , ˆyL}. Subset accuracy (ACC) is very strict regarding incorrect predictions in that it does not allow any deviation in the predicted label sets: ACC (y, ˆy) = I [y = ˆy] . Hamming accuracy (HA) computes how many labels are correctly predicted in ˆy: HA (y, ˆy) = 1 L PL j=1 I [yj = ˆyj] . ACC and HA are used for datasets with moderate L. If C as well as L is higher, entirely correct predictions become increasingly unlikely, and therefore ACC often approaches 0. In this case, the example-based F1-measure (ebF1) defined by Eq. (6) can be considered as a good compromise. Label-based measures are based on treating each label yj as a separate two-class prediction problem, and computing the number of true positives (tpj), false positives (fpj) and false negatives (fnj) for this label. We consider two label-based measures, namely micro-averaged F1-measure (miF1) and macro-averaged F1-measure (maF1) which are defined by Eq. (7) and Eq. (8), respectively. ebF1 (y, ˆy) = 2 PL j=1 yj ˆyj PL j=1 yj + PL j=1 ˆyj (6) miF1 = PL j=1 2tpj PL j=1 2tpj + fpj + fnj (7) maF1 = 1 L L X j=1 2tpj 2tpj + fpj + fnj (8) miF1 favors a system yielding good predictions on frequent labels, whereas higher maF1 scores are usually attributed to superior performance on rare labels. 5 Experimental Results In the following, we show results of various versions of RNNs for MLC on three text datasets which span a wide variety of input and label set sizes. We also evaluate different label orderings, such as frequent-to-rare (f2r), and rare-to-frequent (r2f), as well as a topological sorting (when applicable). 5.1 Experiments on Reuters-21578 Figure 2 shows the negative log-likelihood (NLL) of Eq. (3) on the validation set during the course of training. Note that as RNNb attempts to predict binary targets, but RNNm and EncDec make predictions on multinomial targets, the results of RNNb are plotted separately, with a different scale of the y-axis (top half of the graph). Compared to RNNm and EncDec, RNNb converges very slowly. This can be attributed to the length of the label chain and sparse targets in the chain since RNNb is trained to make correct predictions over all 90 labels, most of them being zero. In other words, the length of target sequences of RNNb is 90 and fixed regardless of the content of training documents. 6 2 4 6 0 5 10 15 20 25 30 35 40 45 Epoch 1 2 Negative log-likelihood RNN b f2r RNN b r2f RNN m f2r RNN m r2f EncDec f2r EncDec r2f Figure 2: Negative log-likelihood of RNNs on the validation set of Reuters-21578. Table 3: Performance comparison on Reuters-21578. ACC HA ebF1 miF1 maF1 No label permutations BR(NN) 0.7685 0.9957 0.8515 0.8348 0.4022 LP(NN) 0.7837 0.9941 0.8206 0.7730 0.3505 NN 0.7502 0.9952 0.8396 0.8183 0.3083 Frequent labels first (f2r) PCC(NN) 0.7844 0.9955 0.8585 0.8305 0.3989 RNNb 0.6757 0.9931 0.7180 0.7144 0.0897 RNNm 0.7744 0.9942 0.8396 0.7884 0.2722 EncDec 0.8281 0.9961 0.8917 0.8545 0.4567 Rare labels first (r2f) PCC(NN) 0.7864 0.9956 0.8598 0.8338 0.3937 RNNb 0.0931 0.9835 0.1083 0.1389 0.0102 RNNm 0.7744 0.9943 0.8409 0.7864 0.2699 EncDec 0.8261 0.9962 0.8944 0.8575 0.4365 0 10 20 30 40 0.0 0.2 0.4 0.6 0.8 1.0 Subset accuracy 0 10 20 30 40 0.975 0.980 0.985 0.990 0.995 1.000 Hamming accuracy 0 10 20 30 40 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 Example-based F1 0 10 20 30 40 0.4 0.5 0.6 0.7 0.8 0.9 Micro-averaged F1 0 10 20 30 40 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Macro-averaged F1 RNN b f2r RNN b r2f RNN m f2r RNN m r2f EncDec f2r EncDec r2f Figure 3: Performance of RNN models on the validation set of Reuters-21578 during training. Note that the x-axis denotes # epochs and we use different scales on the y-axis for each measure. In particular, RNNb has trouble with the r2f label ordering, where training is unstable. The reason is presumably that the predictions for later labels depend on sequences that are mostly zero when rare labels occur at the beginning. Hence, the model sees only few examples of non-zero targets in a single epoch. On the other hand, both RNNm and EncDec converge relatively faster than RNNb and do obviously not suffer from the r2f ordering. Moreover, there is not much difference between both strategies since the length of the sequences is often 1 for Reuters-21578 and hence often the same. Figure 3 shows the performance of RNNs in terms of all evaluation measures on the validation set. EncDec performs best for all the measures, followed by RNNm. There is no clear difference between the same type of models trained on different label permutations, except for RNNb in terms of NLL (cf. Fig. 2). Note that although it takes more time to update the parameters of EncDec than those of RNNm, EncDec ends up with better results. RNNb performs poorly especially in terms of maF1 regardless of the label permutations, suggesting that RNNb would need more parameter updates for predicting rare labels. Notably, the advantage of EncDec is most pronounced for this specific task. Detailed results of all methods on the test set are shown in Table 3. Clearly, EncDec perform best across all measures. LP works better than BR and NN in terms of ACC as intended, but performs behind them in terms of other measures. The reason is that LP, by construction, is able to more accurately hit the exact label set, but, on the other hand, produces more false positives and false negatives in our experiments in comparison to BR and NN when missing the correct label combination. As shown in the table, RNNm performs better than its counterpart, i.e., RNNb, in terms of ACC, but has clear weaknesses in predicting rare labels (cf. especially maF1). For PCC, our two permutations of the labels do not affect much ACC due to the low label cardinality. 5.2 Experiments on RCV1-v2 In comparison to Reuters-21578, RCV1-v2 consists of a considerably larger number of documents. Though the the number of unique labels (L) is similar (103 vs. 90) in both datasets, RCV1-v2 has a higher C and LC is greatly increased from 468 to 14 921. Moreover, this dataset has the interesting property that all labels from the root to a relevant leaf label in the label tree are also associated to the document. In this case, we can also test a topological ordering of labels, as described in Section 3.1. 7 Table 4: Performance comparison on RCV1-v2. ACC HA ebF1 miF1 maF1 No label permutations BR(NN) 0.5554 0.9904 0.8376 0.8349 0.6376 LP(NN) 0.5149 0.9767 0.6696 0.6162 0.4154 NN 0.5837 0.9907 0.8441 0.8402 0.6573 FastXML 0.5953 0.9910 0.8409 0.8470 0.5918 Frequent labels first (f2r) PCC(NN) 0.6211 0.9904 0.8461 0.8324 0.6404 RNNm 0.6218 0.9903 0.8578 0.8487 0.6798 EncDec 0.6798 0.9925 0.8895 0.8838 0.7381 Rare labels first (r2f) PCC(NN) 0.6300 0.9906 0.8493 0.8395 0.6376 RNNm 0.6216 0.9903 0.8556 0.8525 0.6583 EncDec 0.6767 0.9925 0.8884 0.8817 0.7413 topological sorting PCC(NN) 0.6257 0.9904 0.8463 0.8364 0.6486 RNNm 0.6072 0.9898 0.8525 0.8437 0.6578 EncDec 0.6761 0.9924 0.8888 0.8808 0.7220 reverse topological sorting PCC(NN) 0.6267 0.9902 0.8444 0.8346 0.6497 RNNm 0.6232 0.9904 0.8561 0.8496 0.6535 EncDec 0.6781 0.9925 0.8899 0.8797 0.7258 Table 5: Performance comparison on BioASQ. ACC HA ebF1 miF1 maF1 No label permutations FastXML 0.0001 0.9996 0.3585 0.3890 0.0570 Frequent label first (f2r) RNNm 0.0001 0.9993 0.3917 0.4088 0.1435 EncDec 0.0004 0.9995 0.5294 0.5634 0.3211 Rare labels first (r2f) RNNm 0.0001 0.9995 0.4188 0.4534 0.1801 EncDec 0.0006 0.9996 0.5531 0.5943 0.3363 topological sorting RNNm 0.0001 0.9994 0.4087 0.4402 0.1555 EncDec 0.0006 0.9953 0.5311 0.5919 0.3459 reverse topological sorting RNNm 0.0001 0.9994 0.4210 0.4508 0.1646 EncDec 0.0007 0.9996 0.5585 0.5961 0.3427 As RNNb takes long to train and did not show good results on the small dataset, we have no longer considered it in these experiments. We instead include FastXML as a baseline. Table 4 shows the performance of the methods with different label permutations. These results demonstrate again the superiority of PCC and RNNm as well as EncDec against BR and NN in maximizing ACC. Another interesting observation is that LP performs much worse than other methods even in terms of ACC due to the data scarcity problem caused by higher LC. RNNm and EncDec, which also predict label subsets but in a sequential manner, do not suffer from the larger number of distinct label combinations. Similar to the previous experiment, we found no meaningful differences between the RNNm and EncDec models trained on different label permutations on RCV1v2. FastXML also performs well except for maF1 which tells us that it focuses more on frequent labels than rare labels. As noted, this is because FastXML is designed to maximize top-k ranking measures such as prec@k for which the performance on frequent labels is important. 5.3 Experiments on BioASQ Compared to Reuters-21578 and RCV1-v2, BioASQ has an extremely large number of instances and labels, where LC is almost close to Ntr + Nts. In other words, nearly all distinct label combinations appear only once in the dataset and some label subsets can only be found in the test set. Table 5 shows the performance of FastXML, RNNm and EncDec on the test set of BioASQ. EncDec clearly outperforms RNNm by a large margin. Making predictions over several thousand labels is a particularly difficult task because MLC methods not only learn label dependencies, but also understand the context information in documents allowing us to find word-label dependencies and to improve the generalization performance. We can observe a consistent benefit from using the reverse label ordering on both approaches. Note that EncDec does show reliable performance on two relatively small benchmarks regardless of the choice of the label permutations. Also, EncDec with reverse topological sorting of labels achieves the best performance, except for maF1. Note that we observed similar effects with RNNm in our preliminary experiments on RCV1-v2, but the impact of label permutations disappeared once we tuned RNNm with dropout. This indicates that label ordering does not affect much the final performance of models if they are trained well enough with proper regularization techniques. To understand the effectiveness of each model with respect to the size of the positive label set, we split the test set into five almost equally-sized partitions based on the number of target labels in the documents and evaluated the models separately for each of the partition, as shown in Fig. 4. The first partition (P1) contains test documents associated with 1 to 9 labels. Similarly, other partitions, P2, P3, P4 and P5, have documents with cardinalities of 10 ∼12, 13 ∼15, 16 ∼18 and more than 19, respectively. As expected, the performance of all models in terms of ACC and HA decreases as the 8 Figure 4: Comparison of RNNm and EncDec wrt. the number of positive labels T of test documents. The test set is divided into 5 partitions according to T. The x-axis denotes partition indices. tps and tps_rev stand for the label permutation ordered by topological sorting and its reverse. number of positive labels increases. The other measures increase since the classifiers have potentially more possibilities to match positive labels. We can further confirm the observations from Table 5 w.r.t. to different labelset sizes. The margin of FastXML to RNNm and EncDec is further increased. Moreover, its poor performance on rare labels confirms again the focus of FastXML on frequent labels. Regarding computational complexity, we could observe an opposed relation between the used resources: whereas we ran EncDec on a single GPU with 12G of memory for 5 days, FastXML only took 4 hours to complete (on 64 CPU cores), but, on the other hand, required a machine with 1024G of memory. 6 Conclusion We have presented an alternative formulation of learning the joint probability of labels given an instance, which exploits the generally low label cardinality in multi-label classification problems. Instead of having to iterate over each of the labels as in the traditional classifier chains approach, the new formulation allows us to directly focus only on the positive labels. We provided an extension of the formal framework of probabilistic classifier chains, contributing to the understanding of the theoretical background of multi-label classification. Our approach based on recurrent neural networks, especially encoder-decoders, proved to be effective, highly scalable, and robust towards different label orderings on both small and large scale multi-label text classification benchmarks. However, some aspects of the presented work deserve further consideration. When considering MLC problems with extremely large numbers of labels, a problem often referred to as extreme MLC (XMLC), F1-measure maximization is often preferred to subset accuracy maximization because it is less susceptible to the very large number of label combinations and imbalanced label distributions. One can exploit General F-Measure Maximizer (GFM) [30] to maximize the example-based F1-measure by drawing samples from P (y|x) at inference time. Although it is easy to draw samples from P (y|x) approximated by RNNs, and the calculation of the necessary quantities for GFM is straightforward, the use of GFM would be limited to MLC problems with a moderate number of labels because of its quadratic computational complexity O(L2). We used a fixed threshold 0.5 for all labels when making predictions by BR, NN and FastXML. In fact, such a fixed thresholding technique performs poorly on large label spaces. Jasinska et al. [10] exhibit an efficient macro-averaged F1-measure (maF1) maximization approach by tuning the threshold for each label relying on the sparseness of y. We believe that FastXML can be further improved by the maF1 maximization approach on BioASQ. However, we would like to remark that the RNNs, especially EncDec, perform well without any F1-measure maximization at inference time. Nevertheless, maF1 maximization for RNNs might be interesting for future work. In light of the experimental results in Table 5, learning from raw inputs instead of using fixed input representations plays a crucial role for achieving good performance in our XMLC experiments. As the training costs of the encoder-decoder architecture used in this work depend heavily on the input sequence lengths and the number of unique labels, it is inevitable to consider more efficient neural architectures [8, 11], which we also plan to do in future work. 9 Acknowledgments The authors would like to thank anonymous reviewers for their thorough feedback. Computations for this research were conducted on the Lichtenberg high performance computer of the Technische Universität Darmstadt. The Titan X used for this research was donated by the NVIDIA Corporation. This work has been supported by the German Institute for Educational Research (DIPF) under the Knowledge Discovery in Scientific Literature (KDSL) program, and the German Research Foundation as part of the Research Training Group Adaptive Preparation of Information from Heterogeneous Sources (AIPHES) under grant No. GRK 1994/1. References [1] D. Bahdanau, K. Cho, and Y. Bengio. Neural machine translation by jointly learning to align and translate. In Proceedings of the International Conference on Learning Representations, 2015. [2] K. Cho, B. van Merrienboer, C. Gulcehre, D. Bahdanau, F. Bougares, H. Schwenk, and Y. 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, pages 1724–1734, 2014. [3] K. Dembczy´nski, W. Cheng, and E. Hüllermeier. Bayes optimal multilabel classification via probabilistic classifier chains. In Proceedings of the 27th International Conference on Machine Learning, pages 279–286, 2010. [4] K. Dembczy´nski, W. Waegeman, and E. Hüllermeier. An analysis of chaining in multi-label classification. In Frontiers in Artificial Intelligence and Applications, volume 242, pages 294–299. IOS Press, 2012. [5] J. Donahue, L. Anne Hendricks, S. Guadarrama, M. Rohrbach, S. Venugopalan, K. Saenko, and T. Darrell. Long-term recurrent convolutional networks for visual recognition and description. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2625–2634, 2015. [6] J. R. Doppa, J. Yu, C. Ma, A. Fern, and P. Tadepalli. HC-Search for multi-label prediction: An empirical study. In Proceedings of the AAAI Conference on Artificial Intelligence, 2014. [7] J. Fürnkranz, E. Hüllermeier, E. Loza Mencía, and K. Brinker. Multilabel classification via calibrated label ranking. Machine Learning, 73(2):133–153, 2008. [8] J. Gehring, M. Auli, D. Grangier, D. Yarats, and Y. N. Dauphin. Convolutional sequence to sequence learning. In Proceedings of the International Conference on Machine Learning, pages 1243–1252, 2017. [9] N. Ghamrawi and A. McCallum. Collective multi-label classification. In Proceedings of the 14th ACM International Conference on Information and Knowledge Management, pages 195–200, 2005. [10] K. Jasinska, K. Dembczynski, R. Busa-Fekete, K. Pfannschmidt, T. Klerx, and E. Hullermeier. Extreme F-measure maximization using sparse probability estimates. In Proceedings of the International Conference on Machine Learning, pages 1435–1444, 2016. [11] A. Joulin, M. Cissé, D. Grangier, H. Jégou, et al. Efficient softmax approximation for GPUs. In Proceedings of the International Conference on Machine Learning, pages 1302–1310, 2017. [12] D. Kingma and J. Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations, 2015. [13] A. Kumar, S. Vembu, A. K. Menon, and C. Elkan. Beam search algorithms for multilabel learning. Machine Learning, 92(1):65–89, 2013. [14] 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 Proceedings of The 33rd International Conference on Machine Learning, pages 1378–1387, 2016. [15] D. D. Lewis, Y. Yang, T. G. Rose, and F. Li. RCV1: A new benchmark collection for text categorization research. Journal of Machine Learning Research, 5(Apr):361–397, 2004. [16] C. Li, B. Wang, V. Pavlu, and J. Aslam. Conditional Bernoulli mixtures for multi-label classification. In Proceedings of the 33rd International Conference on International Conference on Machine Learning, pages 2482–2491, 2016. [17] N. Li and Z.-H. Zhou. Selective ensemble of classifier chains. In Z.-H. Zhou, F. Roli, and J. Kittler, editors, Multiple Classifier Systems, volume 7872, pages 146–156. Springer Berlin Heidelberg, 2013. 10 [18] W. Liu and I. Tsang. On the optimality of classifier chain for multi-label classification. In Advances in Neural Information Processing Systems 28, pages 712–720. 2015. [19] D. Mena, E. Montañés, J. R. Quevedo, and J. J. Del Coz. Using A* for inference in probabilistic classifier chains. In Proceedings of the 24th International Joint Conference on Artificial Intelligence, pages 3707–3713, 2015. [20] T. Mikolov, I. Sutskever, K. Chen, G. S. Corrado, and J. Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems 26, pages 3111–3119. 2013. [21] J. Nam, J. Kim, E. Loza Mencía, I. Gurevych, and J. Fürnkranz. Large-scale multi-label text classification– revisiting neural networks. In Proceedings of the European Conference on Machine Learning and Principles and Practice of Knowledge Discovery in Databases, pages 437–452, 2014. [22] Y. Prabhu and M. Varma. FastXML: A fast, accurate and stable tree-classifier for extreme multi-label learning. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 263–272, 2014. [23] J. Read, B. Pfahringer, G. Holmes, and E. Frank. Classifier chains for multi-label classification. Machine Learning, 85(3):333–359, 2011. [24] J. Read, L. Martino, and D. Luengo. Efficient monte carlo methods for multi-dimensional learning with classifier chains. Pattern Recognition, 47(3):1535 – 1546, 2014. [25] R. Senge, J. J. Del Coz, and E. Hüllermeier. On the problem of error propagation in classifier chains for multi-label classification. In M. Spiliopoulou, L. Schmidt-Thieme, and R. Janning, editors, Data Analysis, Machine Learning and Knowledge Discovery, pages 163–170. Springer International Publishing, 2014. [26] N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014. [27] L. E. Sucar, C. Bielza, E. F. Morales, P. Hernandez-Leal, J. H. Zaragoza, and P. Larrañaga. Multi-label classification with Bayesian network-based chain classifiers. Pattern Recognition Letters, 41:14 – 22, 2014. ISSN 0167-8655. [28] I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In Advances in Neural Information Processing Systems 27, pages 3104–3112. 2014. [29] G. Tsoumakas, I. Katakis, and I. Vlahavas. Random k-labelsets for multilabel classification. IEEE Transactions on Knowledge and Data Engineering, 23(7):1079–1089, July 2011. [30] W. Waegeman, K. Dembczy´nki, A. Jachnik, W. Cheng, and E. Hüllermeier. On the Bayes-optimality of F-measure maximizers. Journal of Machine Learning Research, 15(1):3333–3388, 2014. [31] J. Wang, Y. Yang, J. Mao, Z. Huang, C. Huang, and W. Xu. CNN-RNN: A unified framework for multilabel image classification. In Proceedings of the 2016 IEEE Conference on Computer Vision and Pattern Recognition, pages 2285–2294, 2016. 11
2017
125
6,592
f-GANs in an Information Geometric Nutshell Richard Nock†,‡,§ Zac Cranko‡,† Aditya Krishna Menon†,‡ Lizhen Qu†,‡ Robert C. Williamson‡,† †Data61, ‡the Australian National University and §the University of Sydney {firstname.lastname, aditya.menon, bob.williamson}@data61.csiro.au Abstract Nowozin et al showed last year how to extend the GAN principle to all fdivergences. The approach is elegant but falls short of a full description of the supervised game, and says little about the key player, the generator: for example, what does the generator actually converge to if solving the GAN game means convergence in some space of parameters? How does that provide hints on the generator’s design and compare to the flourishing but almost exclusively experimental literature on the subject? In this paper, we unveil a broad class of distributions for which such convergence happens — namely, deformed exponential families, a wide superset of exponential families —. We show that current deep architectures are able to factorize a very large number of such densities using an especially compact design, hence displaying the power of deep architectures and their concinnity in the f-GAN game. This result holds given a sufficient condition on activation functions — which turns out to be satisfied by popular choices. The key to our results is a variational generalization of an old theorem that relates the KL divergence between regular exponential families and divergences between their natural parameters. We complete this picture with additional results and experimental insights on how these results may be used to ground further improvements of GAN architectures, via (i) a principled design of the activation functions in the generator and (ii) an explicit integration of proper composite losses’ link function in the discriminator. 1 Introduction In a recent paper, Nowozin et al. [30] showed that the GAN principle [15] can be extended to the variational formulation of all f-divergences. In the GAN game, there is an unknown distribution P which we want to approximate using a parameterised distribution Q. Q is learned by a generator by finding a saddle point of a function which we summarize for now as f-GAN(P, Q), where f is a convex function (see eq. (7) below for its formal expression). A part of the generator’s training involves as a subroutine a supervised adversary — hence, the saddle point formulation – called discriminator, which tries to guess whether randomly generated observations come from P or Q. Ideally, at the end of this supervised game, we want Q to be close to P, and a good measure of this is the f-divergence If(P∥Q), also known as Ali-Silvey distance [1, 12]. Initially, one choice of f was considered [15]. Nowozin et al. significantly grounded the game and expanded its scope by showing that for any f convex and suitably defined, then [30, Eq. 4]: f-GAN(P, Q) ≤If(P∥Q) . (1) The inequality is an equality if the discriminator is powerful enough. So, solving the f-GAN game can give guarantees on how P and Q are distant to each other in terms of f-divergence. This elegant characterization of the supervised game unfortunately falls short of justifying or elucidating all parameters of the supervised game [30, Section 2.4], and the paper is also silent regarding a key part of the game: the link between distributions in the variational formulation and the generator, the 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. main player which learns a parametric model of a density. In doing so, the f-GAN approach and its members remain within an information theoretic framework that relies on divergences between distributions only [30]. In the GAN world at large, this position contrasts with other prominent approaches that explicitly optimize geometric distortions between the parameters or support of distributions [6, 14, 16, 21, 22], and raises the problem of connecting the f-GAN approach to any sort of information geometric optimization. One such information-theoretic/information-geometric identity is well known: The Kullback-Leibler (KL) divergence between two distributions of the same (regular) exponential family equals a Bregman divergence D between their natural parameters [2, 4, 7, 9, 35], which we can summarize as: IfKL(P∥Q) = D(θ∥ϑ) . (2) Here, θ and ϑ are respectively the natural parameters of P and Q. Hence, distributions are points on a manifold on the right-hand side, a powerful geometric statement [4]; however, being restricted to KL divergence or "just" exponential families, it certainly falls short of the power to explain the GAN game. To our knowledge, the only generalizations known fall short of the f-divergence formulation and are not amenable to the variational GAN formulation [5, Theorem 9], [13, Theorem 3]. Our first contribution is such an identity that connects the general If-divergence formulation in eq. (1) to the general D (Bregman) divergence formulation in eq. (2). We now briefly state it, postponing the details to Section 3: f-GAN(P, escort(Q)) = D(θ∥ϑ) + Penalty(Q) , (3) for P and Q (with respective parameters θ and ϑ) which happen to lie in a superset of exponential families called deformed exponential families, that have received extensive treatment in statistical physics and differential information geometry over the last decade [3, 25]. The right-hand side of eq. (3) is the information geometric part [4], in which D is a Bregman divergence. Therefore, the f-GAN problem can be equivalent to a geometric optimization problem [4], like for the Wasserstein GAN and its variants [6]. Notice also that Q appears in the game in the form of an escort [5]. The difference vanish only for exponential families (escort(Q) = Q, Penalty(Q) = 0 and f = KL). Our second contribution drills down into the information-theoretic and information-geometric parts of (3). In particular, from the former standpoint, we completely specify the parameters of the supervised game, unveiling a key parameter left arbitrary in [30] (explicitly incorporating the link function of proper composite losses [32]). From the latter standpoint, we show that the standard deep generator architecture is powerful at modelling complex escorts of any deformed exponential family, factorising a number of escorts in order of the total inner layers’ dimensions, and this factorization happens for an especially compact design. This hints on a simple sufficient condition on the activation function to guarantee the escort modelling, and it turns out that this condition is satisfied, exactly or in a limit sense, by most popular activation functions (ELU, ReLU, Softplus, ...). We also provide experiments1 that display the uplift that can be obtained through a principled design of the activation function (generator), or tuning of the link function (discriminator). Due to the lack of space, a supplement (SM) provides the proof of the results in the main file and additional experiments. A longer version with a more exhaustive treatment of related results is available [27]. The rest of this paper is as follows. Section § 2 presents definition, § 3 formally presents eq. (3), § 4 derives consequences for deep learning, § 5 completes the supervised game picture of [30], Section § 6 presents experiments and a last Section concludes. 2 Definitions Throughout this paper, the domain X of observations is a measurable set. We begin with two important classes of distortion measures, f-divergences and Bregman divergences. Definition 1 For any two distributions P and Q having respective densities P and Q absolutely continuous with respect to a base measure µ, the f-divergence between P and Q, where f : R+ →R is convex with f(1) = 0, is If(P∥Q) .= EX∼Q  f P(X) Q(X)  = Z X Q(x) · f P(x) Q(x)  dµ(x) . (4) 1The code used for our experiments is available through https://github.com/qulizhen/fgan_info_geometric 2 For any convex differentiable ϕ : Rd →R, the (ϕ-)Bregman divergence between θ and ϱ is: Dϕ(θ∥ϱ) .= ϕ(θ) −ϕ(ϱ) −(θ −ϱ)⊤∇ϕ(ϱ) , (5) where ϕ is called the generator of the Bregman divergence. f-divergences are the key distortion measure of information theory, while Bregman divergences are the key distortion measure of information geometry. A distribution P from a (regular) exponential family with cumulant C : Θ →R and sufficient statistics φ : X →Rd has density PC(x|θ, φ) .= exp(φ(x)⊤θ −C(θ)), where Θ is a convex open set, C is convex and ensures normalization on the simplex (we leave implicit the associated dominating measure [3]). A fundamental Theorem ties Bregman divergences and f-divergences: when P and Q belong to the same exponential family, and denoting their respective densities PC(x|θ, φ) and QC(x|ϑ, φ), it holds that IKL(P∥Q) = DC(ϑ∥θ). Here, IKL is Kullback-Leibler (KL) f-divergence (f .= x 7→x log x). Remark that the arguments in the Bregman divergence are permuted with respect to those in eq. (2) in the introduction. This also holds if we consider fKL in eq. (2) to be the Csiszár dual of f [8], namely fKL : x 7→−log x, since in this case IfKL(P∥Q) = IKL(Q∥P) = DC(θ∥ϑ). We made this choice in the introduction for the sake of readability in presenting eqs. (1 — 3). We now define generalizations of exponential families, following [5, 13]. Let χ : R+ →R+ be non-decreasing [25, Chapter 10]. We define the χ-logarithm, logχ, as logχ(z) .= R z 1 1 χ(t)dt. The χ-exponential is expχ(z) .= 1 + R z 0 λ(t)dt, where λ is defined by λ(logχ(z)) .= χ(z). In the case where the integrals are improper, we consider the corresponding limit in the argument / integrand. Definition 2 [5] A distribution P from a χ-exponential family (or deformed exponential family, χ being implicit) with convex cumulant C : Θ →R and sufficient statistics φ : X →Rd has density given by Pχ,C(x|θ, φ) .= expχ(φ(x)⊤θ −C(θ)), with respect to a dominating measure µ. Here, Θ is a convex open set and θ is called the coordinate of P. The escort density (or χ-escort) of Pχ,C is ˜Pχ,C .= 1 Z · χ(Pχ,C) , Z .= Z X χ(Pχ,C(x|θ, φ))dµ(x) . (6) Z is the escort’s normalization constant. We leaving implicit the dominating measure and denote ˜P the escort distribution of P whose density is given by eq. (6). We shall name χ the signature of the deformed (or χ-)exponential family, and sometimes drop indexes to save readability without ambiguity, noting e.g. ˜P for ˜Pχ,C. Notice that normalization in the escort is ensured by a simple integration [5, Eq. 7]. For the escort to exist, we require that Z < ∞and therefore χ(P) is finite almost everywhere. Such a requirement would be satisfied in the GAN game. There is another generalization of regular exponential families, known as generalized exponential families [13, 27]. The starting point of our result is the following Theorem, in which the information-theoretic part is not amenable to the variational GAN formulation. Theorem 3 [5][36] for any two χ-exponential distributions P and Q with respective densities Pχ,C, Qχ,C and coordinates θ, ϑ, DC(θ∥ϑ) = EX∼˜Q[logχ(Qχ,C(X)) −logχ(Pχ,C(X))]. We now briefly frame the now popular (f-)GAN adversarial learning [15, 30]. We have a true unknown distribution P over a set of objects, e.g. 3D pictures, which we want to learn. In the GAN setting, this is the objective of a generator, who learns a distribution Qθ parameterized by vector θ. Qθ works by passing (the support of) a simple, uninformed distribution, e.g. standard Gaussian, through a possibly complex function, e.g. a deep net whose parameters are θ and maps to the support of the objects of interest. Fitting Q. involves an adversary (the discriminator) as subroutine, which fits classifiers, e.g. deep nets, parameterized by ω. The generator’s objective is to come up with arg minθ Lf(θ) with Lf(θ) the discriminator’s objective: Lf(θ) .= sup ω {EX∼P[Tω(X)] −EX∼Qθ[f ⋆(Tω(X))]} , (7) where ⋆is Legendre conjugate [10] and Tω : X →R integrates the classifier of the discriminator and is therefore parameterized by ω. Lf is a variational approximation to a f-divergence [30]; the discriminator’s objective is to segregate true (P) from fake (Q.) data. The original GAN choice, [15] fGAN(z) .= z log z −(z + 1) log(z + 1) + 2 log 2 (8) (the constant ensures f(1) = 0) can be replaced by any convex f meeting mild assumptions. 3 3 A variational information geometric identity for the f-GAN game We deliver a series of results that will bring us to formalize eq. (3). First, we define a new set of distortion measures, that we call KLχ divergences. Definition 4 For any χ-logarithm and distributions P, Q having respective densities P and Q absolutely continuous with respect to base measure µ, the KLχ divergence between P and Q is defined as KLχ(P∥Q) .= EX∼P  −logχ (Q(X)/P(X))  . Since χ is non-decreasing, −logχ is convex and so any KLχ divergence is an f-divergence. When χ(z) .= z, KLχ is the KL divergence. In what follows, base measure µ and absolute continuity are implicit, as well as that P (resp. Q) is the density of P (resp. Q). We now relate KLχ divergences vs f-divergences. Let ∂f be the subdifferential of convex f and IP,Q .= [infx P(x)/Q(x), supx P(x)/Q(x)) ⊆R+ denote the range of density ratios of P over Q. Our first result states that if there is a selection of the subdifferential which is upperbounded on IP,Q, the f-divergence If(P∥Q) is equal to a KLχ divergence. Theorem 5 Suppose that P, Q are such that there exists a selection ξ ∈∂f with sup ξ(IP,Q) < ∞. Then ∃χ : R+ →R+ non decreasing such that If(P∥Q) = KLχ(Q∥P). Theorem 5 essentially covers most if not all relevant GAN cases, as the assumption has to be satisfied in the GAN game for its solution not to be vacuous up to a large extent (eq. (7)). We provide a more complete treatment in the extended version [27]. The proof of Theorem 5 (in SM, Section I) is constructive: it shows how to pick χ which satisfies all requirements. It brings the following interesting corollary: under mild assumptions on f, there exists a χ that fits for all densities P and Q. A prominent example of f that fits is the original GAN choice for which we can pick χGAN(z) .= 1 log 1 + 1 z  . (9) We now define a slight generalization of KLχ-divergences and allow for χ to depend on the choice of the expectation’s X, granted that for any of these choices, it will meet the constraints to be R+ →R+ and also increasing, and therefore define a valid signature. For any f : X →R+, we denote KLχf (P∥Q) .= EX∼P h −logχf(X) (Q(X)/P(X)) i , where for any p ∈R+, χp(t) .= 1 p · χ(tp). Whenever f = 1, we just write KLχ as we already did in Definition 4. We note that for any x ∈X, χf(x) is increasing and non negative because of the properties of χ and f, so χf(x)(t) defines a χ-logarithm. We are ready to state a Theorem that connects KLχ-divergences and Theorem 3. Theorem 6 Letting P .= Pχ,C and Q .= Qχ,C for short in Theorem 3, we have EX∼˜Q[logχ(Q(X))− logχ(P(X))] = KLχ ˜ Q(˜Q∥P) −J(Q), with J(Q) .= KLχ ˜ Q(˜Q∥Q). (Proof in SM, Section II) To summarize, we know that under mild assumptions relatively to the GAN game, f-divergences coincide with KLχ divergences (Theorems 5). We also know from Theorem 6 that KLχ. divergences quantify the geometric proximity between the coordinates of generalized exponential families (Theorem 3). Hence, finding a geometric (parameter-based) interpretation of the variational f-GAN game as described in eq. (7) can be done via a variational formulation of the KLχ divergences appearing in Theorem 6. Since penalty J(Q) does not belong to the GAN game (it does not depend on P), it reduces our focus on KLχ ˜ Q(˜Q∥P). Theorem 7 KLχ ˜ Q(˜Q∥P) admits the variational formulation KLχ ˜ Q(˜Q∥P) = sup T ∈R++ X n EX∼P[T(X)] −EX∼˜Q[(−logχ ˜ Q)⋆(T(X))] o , (10) with R++ .= R\R++. Furthermore, letting Z denoting the normalization constant of the χ-escort of Q, the optimum T ∗: X →R++ to eq. (10) is T ∗(x) = −(1/Z) · (χ(Q(x))/χ(P(x))). 4 (Proof in SM, Section III) Hence, the variational f-GAN formulation can be captured in an information-geometric framework by the following identity using Theorems 3, 5, 7. Corollary 8 (the variational information-geometric f-GAN identity) Using notations from Theorems 6, 7 and letting θ (resp. ϑ) denote the coordinate of P (resp. Q), we have: sup T ∈R++ X n EX∼P[T(X)] −EX∼˜Q[(−logχ ˜ Q)⋆(T(X))] o = DC(θ∥ϑ) + J(Q) . (11) We shall also name for short vig-f-GAN the identity in eq. (11). We note that we can drill down further the identity, expressing in particular the Legendre conjugate (−logχ ˜ Q)⋆with an equivalent "dual" (negative) χ-logarithm in the variational problem [27]. The left hand-side of Eq. (11) has the exact same overall shape as the variational objective of [30, Eqs 2, 6]. However, it tells the formal story of GANs in significantly greater details, in particular for what concerns the generator. For example, eq. (11) yields a new characterization of the generators’ convergence: because DC is a Bregman divergence, it satisfies the identity of the indiscernibles. So, solving the f-GAN game [30] can guarantees convergence in the parameter space (ϑ vs θ). In the realm of GAN applications, it makes sense to consider that P (the true distribution) can be extremely complex. Therefore, even when deformed exponential families are significantly more expressive than regular exponential families [25], extra care should be put before arguing that complex applications comply with such a geometric convergence in the parameter space. One way to circumvent this problem is to build distributions in Q that factorize many deformed exponential families. This is one strong point of deep architectures that we shall prove next. 4 Deep architectures in the vig-f-GAN game In the GAN game, distribution Q in eq. (11) is built by the generator (call it Qg), by passing the support of a simple distribution (e.g. uniform, standard Gaussian), Qin, through a series of non-linear transformations. Letting Qin denote the corresponding density, we now compute Qg. Our generator g : X →Rd consists of two parts: a deep part and a last layer. The deep part is, given some L ∈N, the computation of a non-linear transformation φL : X →RdL as Rdl ∋φl(x) .= v(Wlφl−1(x) + bl) , ∀l ∈{1, 2, ..., L} , (12) φ0(x) .= x ∈X . (13) v is a function computed coordinate-wise, such as (leaky) ReLUs, ELUs [11, 17, 23, 24], Wl ∈ Rdl×dl−1, bl ∈Rdl. The last layer computes the generator’s output from φL: g(x) .= vOUT(ΓφL(x)+ β), with Γ ∈Rd×dL, β ∈Rd; in general, vOUT ̸= v and vOUT fits the output to the domain at hand, ranging from linear [6, 20] to non-linear functions like tanh [30]. Our generator captures the high-level features of some state of the art generative approaches [31, 37]. To carry our analysis, we make the assumption that the network is reversible, which is going to reguire that vOUT, Γ, Wl (l ∈{1, 2, ..., L}) are invertible. We note that popular examples can be invertible (e.g. DCGAN, if we use µ-ReLU, dimensions match and fractional-strided convolutions are invertible). At this reasonable price, we get in closed form the generator’s density and it shows the following: for any continuous signature χnet, there exists an activation function v such that the deep part in the network factors as escorts for the χnet-exponential family. Let 1i denote the ith canonical basis vector. Theorem 9 ∀vOUT, Γ, Wl invertible (l ∈{1, 2, ..., L}), for any continuous signature χnet, there exists activation v and bl ∈Rd (∀l ∈{1, 2, ..., L}) such that for any output z, letting x .= g−1(z), Qg(z) factorizes as Qg(z) = (Qin(x)/ ˜Qdeep(x)) · 1/(Hout(x) · Znet), with Znet > 0 a constant, Hout(x) .= Qd i=1 |v′ OUT(γ⊤ i φL(x) + βi)|, γi .= Γ⊤1i, and (letting wl,i .= W⊤ l 1i): ˜Qdeep(x) .= L Y l=1 d Y i=1 ˜Pχnet,bl,i(x|wl,i, φl−1) . (14) 5 Name v(z) χ(z) ReLU(§) max{0, z} 1z>0 Leaky-ReLU(†)  z if z > 0 ϵz if z ≤0  1 if z > −δ 1 ϵ if z ≤−δ (α, β)-ELU(♥)  βz if z > 0 α(exp(z) −1) if z ≤0  β if z > α z if z ≤α prop-τ (♣) k + τ⋆(z) τ⋆(0) τ′−1◦(τ⋆)−1(τ⋆(0)z) τ⋆(0) Softplus(♦) k + log2(1 + exp(z)) 1 log 2 · 1 −2−z µ-ReLU(♠) k + z+√ (1−µ)2+z2 2 4z2 (1−µ)2+4z2 LSU k +    0 if z < −1 (1 + z)2 if z ∈[−1, 1] 4z if z > 1  2√z if z < 4 4 if z > 4 Table 1: Some strongly/weakly admissible couples (v, χ). (§) : 1. is the indicator function; (†) : δ ≤0, 0 < ϵ ≤1 and dom(v) = [δ/ϵ, +∞). (♥) : β ≥α > 0; (♣) : ⋆is Legendre conjugate; (♠) : µ ∈[0, 1). Shaded: prop-τ activations; k is a constant (e.g. such that v(0) = 0) (see text). (Proof in SM, Section IV) The relationship between the inner layers of a deep net and deformed exponential families (Definition 2) follows from the theorem: rows in Wls define coordinates, φl define "deep" sufficient statistics, bl are cumulants and the crucial part, the χ-family, is given by the activation function v. Notice also that the bls are learned, and so the deformed exponential families’ normalization is in fact learned and not specified. We see that ˜Qdeep factors escorts, and in number. What is notable is the compactness achieved by the deep representation: the total dimension of all deep sufficient statistics in ˜Qdeep (eq. (14)) is L · d. To handle this, a shallow net with a single inner layer would require a matrix W of space Ω(L2 · d2). The deep net g requires only O(L · d2) space to store all Wls. The proof of Theorem 9 is constructive: it builds v as a function of χ. In fact, the proof also shows how to build χ from the activation function v in such a way that ˜Qdeep factors χ-escorts. The following Lemma essentially says that this is possible for all strongly admissible activations v. Definition 10 Activation function v is strongly admissible iff dom(v) ∩R+ ̸= ∅and v is C1, lowerbounded, strictly increasing and convex. v is weakly admissible iff for any ϵ > 0, there exists vϵ strongly admissible such that ||v −vϵ||L1 < ϵ, where ||f||L1 .= R |f(t)|dt. Lemma 11 The following holds: (i) for any strongly admissible v, there exists signature χ such that Theorem 9 holds; (ii) (γ,γ)-ELU (for any γ > 0), Softplus are strongly admissible. ReLU is weakly admissible. (proof in SM, Section V) The proof uses a trick for ReLU which can easily be repeated for (α, β)ELU, and for leaky-ReLU, with the constraint that the domain has to be lowerbounded. Table 1 provides some examples of strongly / weakly admissible activations. It includes a wide class of so-called "prop-τ activations", where τ is negative a concave entropy, defined on [0, 1] and symmetric around 1/2 [29]. This concludes our treatment of the information geometric part of the vig-f-GAN identity. We now complete it with a treatment of its information-theoretic part. 5 A complete proper loss picture of the supervised GAN game In their generalization of the GAN objective, Nowozin et al. [30] leave untold a key part of the supervised game: they split in eq. (7) the discriminator’s contribution in two, Tω = gf ◦Vω, where Vω : X →R is the actual discriminator, and gf is essentially a technical constraint to ensure that Vω(.) is in the domain of f ⋆. They leave the choice of gf "somewhat arbitrary" [30, Section 2.4]. We now show that if one wants the supervised loss to have the desirable property to be proper composite [32]2, then gf is not arbitrary. We proceed in three steps, first unveiling a broad class of proper f-GANs that deal with this property. The initial motivation of eq. (7) was that the inner maximisation may be seen as the f-divergence between P and Qθ [26], Lf(θ) = If(P∥Qθ). In fact, this variational 2informally, Bayes rule realizes the optimum and the loss accommodates for any real valued predictor. 6 representation of an f-divergence holds more generally: by [33, Theorem 9], we know that for any convex f, and invertible link function Ψ: (0, 1) →R, we have: inf T : X→R E (X,Y)∼D [ℓΨ(Y, T(X))] = −1 2 · If(P ∥Q) (15) where D is the distribution over (observations × {fake, real}) and the loss function ℓΨ is defined by: ℓΨ(+1, z) .= −f ′  Ψ−1(z) 1 −Ψ−1(z)  ; ℓΨ(−1, z) .= f ⋆  f ′  Ψ−1(z) 1 −Ψ−1(z)  , (16) assuming f differentiable. Note now that picking Ψ(z) = f ′(z/(1 −z)) with z .= T(x) and simplifying eq. (15) with P[Y = fake] = P[Y = real] = 1/2 in the GAN game yields eq. (7). For other link functions, however, we get an equally valid class of losses whose optimisation will yield a meaningful estimate of the f-divergence. The losses of eq. (16) belong to the class of proper composite losses with link function Ψ [32]. Thus (omitting parameters θ, ω), we rephrase eq. (7) and refer to the proper f-GAN formulation as infQ LΨ(Q) with (ℓis as per eq. (16)): LΨ(Q) .= sup T : X→R  E X∼P [−ℓΨ(+1, T(X))] + E X∼Q [−ℓΨ(−1, T(X))]  . (17) Note also that it is trivial to start from a suitable proper composite loss, and derive the corresponding generator f for the f-divergence as per eq. (15). Finally, our proper composite loss view of the f-GAN game allows us to elicitate gf in [30]: it is the composition of f ′ and Ψ in eq. (16). The use of proper composite losses as part of the supervised GAN formulation sheds further light on another aspect the game: the connection between the value of the optimal discriminator, and the density ratio between the generator and discriminator distributions. Instead of the optimal T ∗(x) = f ′(P(x)/Q(x)) for eq. (7) [30, Eq. 5], we now have with the more general eq. (17) the result T ∗(x) = Ψ((1 + Q(x)/P(x))−1). We now show that proper f-GANs can easily be adapted to eq. (11). We let χ•(t) .= 1/χ−1(1/t). Theorem 12 For any χ, define ℓx(−1, z) .= −log(χ•) 1 ˜ Q(x) (−z), and let ℓ(+1, z) .= −z. Then LΨ(Q) in eq. (17) equals eq. (11). Its link in eq. (17) is Ψx(z) = −1/χ ˜ Q(x) (z/(1 −z)). (Proof in SM, Section VI) Hence, in the proper composite view of the vig-f-GAN identity, the generator rules over the supervised game: it tempers with both the link function and the loss — but only for fake examples. Notice also that when z = −1, the fake examples loss satisfies ℓx(−1, −1) = 0 regardless of x by definition of the χ-logarithm. 6 Experiments Two of our theoretical contributions are (A) the fact that on the generator’s side, there exists numerous activation functions v that comply with the design of its density as factoring escorts (Lemma 11), and (B) the fact that on the discriminator’s side, the so-called output activation function gf of [30] aggregates in fact two components of proper composite losses, one of which, the link function Ψ, should be a fine knob to operate (Theorem 12). We have tested these two possibilities with the idea that an experimental validation should provide substantial ground to be competitive with mainstream approaches, leaving space for a finer tuning in specific applications. Also, in order not to mix their effects, we have treated (A) and (B) separately. Architectures and datasets — We provide in SM (Section VI) the detail of all experiments. To summarize, we consider two architectures in our experiments: DCGAN [31] and the multilayer feedforward network (MLP) used in [30]. Our datasets are MNIST [19] and LSUN tower category [38]. Comparison of varying activations in the generator (A) — We have compared µ-ReLUs with varying µ in [0, 0.1, ..., 1] (hence, we include ReLU as a baseline for µ = 1), the Softplus and the Least Square Unit (LSU, Table 1) activation (Figure 1). For each choice of the activation function, all inner layers of the generator use the same activation function. We evaluate the activation functions by using both DCGAN and the MLP used in [30] as the architectures. As training divergence, we adopt both GAN [15] and Wasserstein GAN (WGAN, [6]). Results are shown in Figure 1 (left). 7 µ Softplus LSU ReLU µ-ReLU Softplus / LS / ReLU Discriminator: varying link Figure 1: Summary of our results on MNIST, on experiment A (left+center) and B (right). Left: comparison of different values of µ for the µ-ReLU activation in the generator (ReLU = 1-ReLU, see text). Thicker horizontal dashed lines present the ReLU average baseline: for each color, points above the baselines represent values of µ for which ReLU is beaten on average. Center: comparison of different activations in the generator, for the same architectures as in the left plot. Right: comparison of different link function in the discriminator (see text, best viewed in color). Three behaviours emerge when varying µ: either it is globally equivalent to ReLU (GAN DCGAN) but with local variations that can be better (µ = 0.7) or worse (µ = 0), or it is almost consistently better than ReLU (WGAN MLP) or worse (GAN MLP). The best results were obtained for GAN DCGAN, and we note that the ReLU baseline was essentially beaten for values of µ yielding smaller variance, and hence yielding smaller uncertainty in the results. The comparison between different activation functions (Figure 1, center) reveals that (µ-)ReLU performs overall the best, yet with some variations among architectures. We note in particular that, in the same way as for the comparisons intra µ-ReLU (Figure 1, left), ReLU performs relatively worse than the other criteria for WGAN MLP, indicating that there may be different best fit activations for different architectures, which is good news. Visual results on LSUN (SM, Table A5) also display the quality of results when changing the µ-ReLU activation. Comparison of varying link functions in the discriminator (B) — We have compared the replacement of the sigmoid function by a link which corresponds to the entropy which is theoretically optimal in boosting algorithms, Matsushita entropy [18, 28], for which ΨMAT(z) .= (1/2) · (1 + z/ √ 1 + z2). Figure 1 (right) displays the comparison Matsushita vs "standard" (more specifically, we use sigmoid in the case of GAN [30], and none in the case of WGAN to follow current implementations [6]). We evaluate with both DCGAN and MLP on MNIST (same hyperparameters as for generators, ReLU activation for all hidden layer activation of generators). Experiments tend to display that tuning the link may indeed bring additional uplift: for GANs, Matsushita is indeed better than the sigmoid link for both DCGAN and MLP, while it remains very competitive with the no-link (or equivalently an identity link) of WGAN, at least for DCGAN. 7 Conclusion It is hard to exaggerate the success of GAN approaches in modelling complex domains, and with their success comes an increasing need for a rigorous theoretical understanding [34]. In this paper, we complete the supervised understanding of the generalization of GANs introduced in [30], and provide a theoretical background to understand its unsupervised part, showing in particular how deep architectures can be powerful at tackling the generative part of the game. Experiments display that the tools we develop may help to improve further the state of the art. 8 Acknowledgments The authors thank the reviewers, Shun-ichi Amari, Giorgio Patrini and Frank Nielsen for numerous comments. References [1] S.-M. Ali and S.-D.-S. Silvey. A general class of coefficients of divergence of one distribution from another. Journal of the Royal Statistical Society B, 28:131–142, 1966. 8 [2] S.-I. Amari. Differential-Geometrical Methods in Statistics. Springer-Verlag, Berlin, 1985. [3] S.-I. Amari. Information Geometry and Its Applications. Springer-Verlag, Berlin, 2016. [4] S.-I. Amari and H. Nagaoka. Methods of Information Geometry. Oxford University Press, 2000. [5] S.-I. Amari, A. Ohara, and H. Matsuzoe. Geometry of deformed exponential families: Invariant, dually-flat and conformal geometries. Physica A: Statistical Mechanics and its Applications, 391:4308–4319, 2012. [6] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein GAN. CoRR, abs/1701.07875, 2017. [7] K. S. Azoury and M. K. Warmuth. Relative loss bounds for on-line density estimation with the exponential family of distributions. MLJ, 43(3):211–246, 2001. [8] A. Ben-Tal, A. Ben-Israel, and M. Teboulle. Certainty equivalents and information measures: Duality and extremal principles. J. of Math. Anal. Appl., pages 211–236, 1991. [9] J.-D. Boissonnat, F. Nielsen, and R. Nock. Bregman voronoi diagrams. DCG, 44(2):281–307, 2010. [10] S. Boyd and L. Vandenberghe. Convex optimization. Cambridge University Press, 2004. [11] D.-A. Clevert, T. Unterthiner, and S. Hochreiter. Fast and accurate deep network learning by exponential linear units (ELUs). In 4th ICLR, 2016. [12] I. Csiszár. Information-type measures of difference of probability distributions and indirect observation. Studia Scientiarum Mathematicarum Hungarica, 2:299–318, 1967. [13] R.-M. Frongillo and M.-D. Reid. Convex foundations for generalized maxent models. In 33rd MaxEnt, pages 11–16, 2014. [14] A. Genevay, G. Peyré, and M. Cuturi. Sinkhorn-autodiff: Tractable Wasserstein learning of generative models. CoRR, abs/1706.00292, 2017. [15] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS*27, pages 2672–2680, 2014. [16] I. Gulrajani, F. Ahmed, M. Arjovsky, V. Dumoulin, and A.-C. Courville. Improved training of wasserstein GANs. CoRR, abs/1704.00028, 2017. [17] R.-H.-R. Hahnloser, R. Sarpeshkar, M.-A. Mahowald, R.-J. Douglas, and H.-S. Seung. Digital selection and analogue amplification coexist in a cortex-inspired silicon circuit. Nature, 405:947–951, 2000. [18] M.J. Kearns and Y. Mansour. On the boosting ability of top-down decision tree learning algorithms. J. Comp. Syst. Sc., 58:109–128, 1999. [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] H. Lee, R. Ge, T. Ma, A. Risteski, and S. Arora. On the ability of neural nets to express distributions. CoRR, abs/1702.07028, 2017. [21] Y. Li, K. Swersky, and R.-S. Zemel. Generative moment matching networks. In 32nd ICML, pages 1718–1727, 2015. [22] S. Liu, O. Bousquet, and K. Chaudhuri. Approximation and convergence properties of generative adversarial learning. CoRR, abs/1705.08991, 2017. [23] A.-L. Maas, A.-Y. Hannun, and A.-Y. Ng. Rectifier nonlinearities improve neural network acoustic models. In 30th ICML, 2013. [24] V. Nair and G. Hinton. Rectified linear units improve restricted Boltzmann machines. In 27th ICML, pages 807–814, 2010. [25] J. Naudts. Generalized thermostatistics. Springer, 2011. [26] 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. [27] R. Nock, Z. Cranko, A.-K. Menon, L. Qu, and R.-C. Williamson. f-GANs in an information geometric nutshell. CoRR, abs/1707.04385, 2017. [28] R. Nock and F. Nielsen. On the efficient minimization of classification-calibrated surrogates. In NIPS*21, pages 1201–1208, 2008. [29] R. Nock and F. Nielsen. Bregman divergences and surrogates for learning. IEEE Trans.PAMI, 31:2048– 2059, 2009. [30] S. Nowozin, B. Cseke, and R. Tomioka. f-GAN: training generative neural samplers using variational divergence minimization. In NIPS*29, pages 271–279, 2016. [31] A. Radford, L. Metz, and S. Chintala. unsupervised representation learning with deep convolutional generative adversarial networks. In 4th ICLR, 2016. [32] M.-D. Reid and R.-C. Williamson. Composite binary losses. JMLR, 11, 2010. [33] M.-D. Reid and R.-C. Williamson. Information, divergence and risk for binary experiments. JMLR, 12:731–817, 2011. [34] T. Salimans, I.-J. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved techniques for training gans. In NIPS*29, pages 2226–2234, 2016. [35] M. Telgarsky and S. Dasgupta. Agglomerative Bregman clustering. In 29 th ICML, 2012. [36] R.-F. Vigelis and C.-C. Cavalcante. On ϕ-families of probability distributions. J. Theor. Probab., 21:1–15, 2011. [37] L. Wolf, Y. Taigman, and A. Polyak. Unsupervised creation of parameterized avatars. CoRR, abs/1704.05693, 2017. [38] F. Yu, Y. Zhang, S. Song, A. Seff, and J. Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. 9
2017
126
6,593
Active Bias: Training More Accurate Neural Networks by Emphasizing High Variance Samples Haw-Shiuan Chang, Erik Learned-Miller, Andrew McCallum University of Massachusetts, Amherst 140 Governors Dr., Amherst, MA 01003 {hschang,elm,mccallum}@cs.umass.edu Abstract Self-paced learning and hard example mining re-weight training instances to improve learning accuracy. This paper presents two improved alternatives based on lightweight estimates of sample uncertainty in stochastic gradient descent (SGD): the variance in predicted probability of the correct class across iterations of minibatch SGD, and the proximity of the correct class probability to the decision threshold. Extensive experimental results on six datasets show that our methods reliably improve accuracy in various network architectures, including additional gains on top of other popular training techniques, such as residual learning, momentum, ADAM, batch normalization, dropout, and distillation. 1 Introduction Learning easier material before harder material is often beneficial to human learning. Inspired by this observation, curriculum learning [5] has shown that learning from easier instances first can also improve neural network training. When it is not known a priori which samples are easy, examples with lower loss on the current model can be inferred to be easier and can be used in early training. This strategy has been referred to as self-paced learning [25]. By decreasing the weight of difficult examples in the loss function, the model may become more robust to outliers [33], and this method has proven useful in several applications, especially with noisy labels [36]. Nevertheless, selecting easier examples for training often slows down the training process because easier samples usually contribute smaller gradients, and the current model has already learned how to make correct predictions on these samples. On the other hand, and somewhat ironically, the opposite strategy (i.e., sampling harder instances more often) has been shown to accelerate (mini-batch) stochastic gradient descent (SGD) in some cases, where the difficulty of an example can be defined by its loss [18, 29, 44] or be proportional to the magnitude of its gradient [51, 1, 12, 13]. This strategy is sometimes referred to as hard example mining [44]. In the literature, we can see that these two opposing strategies work well in different situations. Preferring easier examples may be effective when either machines or humans try to solve a challenging task containing more label noise or outliers. On the other hand, focusing on harder samples may accelerate and stabilize SGD in cleaner data by minimizing the variance of gradients [1, 12]. However, we often do not know how noisy our training dataset is. Motivated by this practical need, this paper explores new methods of re-weighting training examples that are effective in both scenarios. Intuitively, if a model has already predicted some examples correctly with high confidence, those samples may be too easy to contain useful information for improving that model further. Similarly, if some examples are always predicted incorrectly over many iterations of training, these examples may just be too difficult/noisy and may degrade the model. This suggests that we should somehow prefer uncertain samples that are predicted incorrectly sometimes during training and correctly at 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Cat Images Training Mini-batch Iterations Dog
 0.2 Emphasize? Self Paced Learning Hard Example Mining Active Learning Easy Hard Uncertain P(class | image) Cat
 0.4 Cat
 0.8 Cat
 0.9 Frog
 0.2 Frog
 0.3 Methods Figure 1: The proposed methods emphasize uncertain samples based on previous prediction history. other times, as illustrated in Figure 1. This preference is consistent with common variance reduction strategies in active learning [43]. Previous studies suggest that finding informative unlabeled samples to label is related to selecting already-labeled samples to optimize the model parameters [14]. As reported in the previous studies [42, 6], models can sometimes achieve lower generalization error after being trained with only a subset of actively selected training data. In other words, focusing on informative samples can be beneficial even when all labels are available. We propose two lightweight methods that actively emphasize uncertain samples to improve minibatch SGD for classification. One method measures the variance of prediction probabilities, while the other one estimates the closeness between the prediction probabilities and the decision threshold. For logistic regression, both methods can be proven to reduce the uncertainty in the model parameters under reasonable approximations. We present extensive experiments on CIFAR 10, CIFAR 100, MNIST (image classification), Question Type (sentence classification), CoNLL 2003, and OntoNote 5.0 (Named entity Recognition), as well as on different architectures, including multiple class logistic regression, fully-connected networks, convolutional neural networks (CNNs) [26], and residual networks [16]. The results show that active bias makes neural networks more robust without prior knowledge of noise, and reduces the generalization error by 1% –18% even on training sets having few (if any) annotation errors. 2 Related work As (deep) neural networks become more widespread, many methods have recently been proposed to improve SGD training. When using (mini-batch) SGD, the randomness of the gradient sometimes slows down the optimization, so one common approach is to use the gradient computed in previous iterations to stabilize the process. Examples include momentum [38], stochastic variance reduced gradient (SVRG) [21], and proximal stochastic variance reduced gradient (Prox-SVRG) [49]. Other work proposes variants of semi-stochastic algorithms to approximate the exact gradient direction and reduce the gradient variance [47, 34]. More recently, supervised optimization methods like learning by learning [3] also show great potential in this problem. In addition to the high variance of the gradient, another issue with SGD is the difficulty of tuning the learning rate. Like Quasi-Newton methods, several methods adaptively adjust learning rates based on local curvature [2, 40], while ADAGRAD [11] applies different learning rates to different dimensions. ADAM [23] combines several of these techniques and is widely used in practice. More recently, some studies accelerate SGD by weighting each class differently [13] or weighting each sample differently as we do [18, 51, 29, 12, 1, 44], and their experiments suggest that the methods are often compatible with other techniques such as Prox-SVRG, ADAGRAD, or ADAM [29, 13]. Notice that Gao et al. [12] discuss the idea of selecting uncertain examples for SGD based on active learning, but their proposed methods choose each sample according to the magnitude of its gradient as in ISSGD [1], which actually prefers more difficult examples. The aforementioned methods focus on accelerating the optimization of a fixed loss function given a fixed model. Many of these methods adopt importance sampling. That is, if the method prefers to 2 select harder examples, the learning rate corresponding to those examples will be lower. This makes gradient estimation unbiased [18, 51, 1, 12, 13], which guarantees convergence [51, 13]. On the other hand, to make models more robust to outliers, some approaches inject bias into the loss function in order to emphasize easier examples [37, 48, 27, 35]. Some variants of the strategy gradually increase the loss of hard examples [32], as in self-paced learning [25]. To alleviate the local minimum problem during training, other techniques that smooth the loss function have been proposed recently [8, 15]. Nevertheless, to our knowledge, it remains an unsolved challenge to balance the easy and difficult training examples to facilitate training while remaining robust to outliers. 3 Methods In this section, we first discuss the baseline methods against which we shall compare and introduce some notations which we are going to use later on. We then present our two active bias methods based on prediction variance and closeness to the decision threshold. 3.1 Baselines Due to its simplicity and generally good performance, the most widely used version of SGD samples each training instance uniformly. This basic strategy has two variants. The first samples with replacement. Let D = (xi, yi)i indicate the training dataset. The probability of selecting each sample is equal (i.e., Ps(i|D) = 1 |D|), so we call it SGD Uniform (SGD-Uni). The second samples without replacement. Let Se be the set of samples we have already used in the current epoch. Then, the sampling probability Ps(i|Se, D) would become ( 1 |D|−|Se|)1i/∈Se, where 1 is an indicator function. This version scans through all of the examples in each epoch, so we call it SGD-Scan. We propose a simple baseline which selects harder examples with higher probability, as done by Loshchilov and Hutter [29]. Specifically, we let Ps(i|H, Se, D) ∝1 −¯pHt−1 i (yi|xi) + ϵD, where Ht−1 i is the history of prediction probability which stores all p(yi|xi) when xi is selected to train the network before the current iteration t, H = S i Ht−1 i , ¯pHt−1 i (yi|xi) is the average probability of classifying sample i into its correct class yi over all the stored p(yi|xi) in Ht−1 i , and ϵD is a smoothness constant. Notice that by only considering p(yi|xi) in Ht−1 i , we won’t need to perform extra forward passes. We refer to this simple baseline as SGD Sampled by Difficulty (SGD-SD). In practice, SGD-Scan often works better than SGD-Uni because it ensures that the model sees all of the training examples in each epoch. To emphasize difficult examples while applying SGD-Scan, we weight each sample differently in the loss function. That is, the loss function is modified as L = P i vi · lossi(W) + λR(W), where W are the parameters in the model, lossi(W) is the prediction loss, and λR(W) is the regularization term of the model. The weight of the ith sample vi can be set as 1 ND (1 −¯pHt−1 i (yi|xi) + ϵD), where ND is a normalization constant making the average of vi equal to 1. We want to keep the average of the vi fixed so that we do not change the global learning rate. We denote this method SGD Weighted by Difficulty (SGD-WD). Models usually cannot fit outliers well, so SGD-SD and SGD-WD would not be robust to noise. To make a model unbiased, importance sampling can be used. That is, we can let Ps(i|H, Se, D) ∝ 1 −¯pHt−1 i (yi|xi) + ϵD and vi = ND(1 −¯pHt−1 i (yi|xi) + ϵD)−1, which is similar to an approach used by Hinton [18]. We refer to this as SGD Importance-Sampled by Difficulty (SGD-ISD). In addition, we propose two simple baselines that emphasize easy examples, as in self-paced learning. Based on the same naming convention, SGD Sampled by Easiness (SGD-SE) denotes that Ps(i|H, Se, D) ∝¯pHt−1 i (yi|xi) + ϵE, while SGD Weighted by Easiness (SGD-WE) sets vi = 1 NE (¯pHt−1 i (yi|xi) + ϵE), where NE normalizes the vi’s to have unit mean. 3.2 Prediction Variance In the active learning setting, the prediction variance can be used to measure the uncertainty of each sample for either a regression or classification problem [41]. In order to gain more information at each SGD iteration, we choose samples with high prediction variances. 3 Since the prediction variances are estimated on the fly, we would like to balance exploration and exploitation. Adopting the optimism in face of uncertainty heuristics of bandit problems [7], we draw the next sample based on the estimated prediction variance plus its confidence interval. Specifically, for SGD Sampled by Prediction Variance (SGD-SPV), we let Ps(i|H, Se, D) ∝c std conf i (H) + ϵV , where c std conf i (H) = s d var(pHt−1 i (yi|xi)) + d var(pHt−1 i (yi|xi))2 |Ht−1 i | −1 , (1) d var  pHt−1 i (yi|xi)  is the prediction variance estimated by history Ht−1 i , and |Ht−1 i | is the number of stored prediction probabilities. Assuming pHt−1 i (yi|xi) is normally distributed under the uncertainty of model parameters w, the variance of prediction variance estimation can be estimated by 2 · d var  pHt−1 i (yi|xi) 2 (|Ht−1 i | −1)−1. As we did in the baselines, adding the smoothness constant ϵV prevents the low variance instances from never being selected again. Similarly, another variant of the method sets vi = 1 NV ( c std conf i (H) + ϵV ), where NV normalizes vi like other weighted methods; we call this SGD Weighted by Prediction Variance (SGD-WPV). As in SGD-WD, SGD-WE or self-paced learning [4], we train an unbiased model for several burnin epochs at the beginning so as to judge the sampling uncertainty reasonably and stably. Other implementation details will be described in the first section of the supplementary material. Using a low learning rate, model parameters w would be close to a good local minimum after sufficient burn-in epochs, and thus the posterior distribution of w can be locally approximated by a Gaussian distribution. Furthermore, the prediction distribution p(yi|xi, w) is often locally smooth with respect to the model parameters w (i.e., small changes of model parameters only induce small changes in the prediction distribution), so a Gaussian tends to approximate the distribution of pHt−1 i (yi|xi) well in practice. Example: logistic regression Given a Gaussian prior Pr(W = w) = N(w|0, s0I) on the parameters, consider the probabilistic interpretation of logistic regression: −log(Pr(Y, W = w|X)) = − X i log(p(yi|xi, w)) −c s0 ||w||2, (2) where p(yi|xi, w) = 1 1+exp(−yiwT xi), and yi ∈{1, −1}. Since the posterior distribution of W is log-concave [39], we can use Pr(W = w|Y, X) ≈ N(w|wN, SN), where wN is maximum a posteriori (MAP) estimation, and S−1 N = ▽w ▽w −log(Pr(Y, W|X)) = X i p(yi|xi) (1 −p(yi|xi)) xixi T + 2c s0 I. (3) Then, we further approximate p(yi|xi, W) using the first order Taylor expansion p(yi|xi, W) ≈ p(yi|xi, w) + gi(w)T (W −w), where gi(w) = p(yi|xi, w) (1 −p(yi|xi, w)) xi. We can compute the prediction variance [41] with respect to the uncertainty of W V ar(p(yi|xi, W)) ≈gi(w)T SNgi(w). (4) These approximations tell us several things. First, V ar(p(yi|xi, W)) is proportional to p(yi|xi, w)2(1 −p(yi|xi, w))2, so the prediction variance is larger when the sample i is closer to the boundary. Second, when we have more sample points close to the boundary, the variance of the parameters SN is lower. That is, when we emphasize samples with high prediction variances, the uncertainty of parameters tends to be reduced, akin to the variance reduction strategy in active learning [30]. Third, with a Gaussian assumption on the posterior distribution Pr(W = w|Y, X) and the Taylor expansion, the distribution of p(yi|xi, W) in logistic regression becomes Gaussian, which justifies our previous assumption of pHt−1 i (yi|xi) for the confidence estimation of the prediction variance. Notice that there are other methods that can measure the prediction uncertainty, such as the mutual information between labels and parameters [19], but we found that the prediction variance works better in our experiments. 4 5 0 5 10 15 2 3 4 5 6 7 8 (a) Sampling distribution 0 5 10 3 4 5 6 7 (b) Training Samples 2.35 2.30 2.25 2.20 2.15 2.10 b 0.15 0.10 0.05 0.00 0.05 0.10 0.15 w[1] 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 (c) SGD-Scan parameters space 0 5 10 3 4 5 6 7 (d) SGD-Scan boundaries 2.35 2.30 2.25 2.20 2.15 2.10 b 0.15 0.10 0.05 0.00 0.05 0.10 0.15 w[1] 1.21 1.22 1.23 1.24 1.25 1.26 1.27 1.28 1.29 (e) SGD-WD parameters space 0 5 10 3 4 5 6 7 (f) SGD-WD sample weights and boundaries 2.35 2.30 2.25 2.20 2.15 2.10 b 0.15 0.10 0.05 0.00 0.05 0.10 0.15 w[1] 0.750 0.765 0.780 0.795 0.810 0.825 0.840 (g) SGD-WPV parameters space 0 5 10 3 4 5 6 7 (h) SGD-WPV sample weights and boundaries Figure 2: A toy example which compares different methods in a two-class logistic regression model. To visualize the optimization path for the classifier parameters (the red paths in (c), (e), and (g)) in two dimensions, we fix the weight corresponding to the x-axis to 0.5 and only show the weight for y-axis w[1] and bias term b. The ith sample size in (f) and (h) is proportional to vi. The toy example shows that SGD-WPV can train a more accurate model in a noisy dataset. Figure 2 illustrates a toy example. Given the same learning rate, we can see that the normal SGD in Figure 2c and 2d will have higher uncertainty when there are many outliers, and emphasizing difficult examples in Figure 2e and 2f makes it worse. On the other hand, the samples near the boundaries would have higher prediction variances (i.e., larger circles or crosses in Figure 2h) and thus higher impact on the loss function in SGD-WPV. After burn-in epochs, w becomes close to a local minimum using SGD. Then, the parameters estimated in each iteration can be viewed, approximately, as samples drawn from the posterior distribution of the parameters Pr(W = w|Y, X) [31]. Therefore, after running SGD long enough, d var  pHt−1 i (yi|xi)  can be used to approximate V ar (p(yi|xi, W)). Notice that if we directly apply bias at the beginning without running burn-in epochs, incorrect examples might be emphasized, which is also known as the local minimum problem in active learning [14]. For instance, in Figure 2, if burn-in epochs are not applied and the initial w is a vertical line on the left, the outliers close to the initial boundary would be emphasized, which slows down the convergence speed. In this simple example, we can also see that the gradient magnitude is proportional to the difficulty because −▽wlog(p(yi|xi, w)) = (1 −p(yi|xi, w)) xi. This is why we believe the SGD acceleration methods based on gradient magnitude [1, 13] can be categorized as variants of preferring difficult examples, and thus more vulnerable to outliers (like the samples on the left or right in Figure 2). 3.3 Threshold Closeness Motivated by the previous analysis, we propose a simpler and more direct approach to select samples whose correct class probability is close to the decision threshold. SGD Sampled by Threshold Closeness (SGD-STC) makes Ps(i|H, Se, D) ∝¯pHt−1 i (yi|xi)  1 −¯pHt−1 i (yi|xi)  + ϵT , where ¯pHt−1 i (yi|xi) is the average probability of classifying sample i into its correct class yi over all the stored p(yi|xi) in Ht−1 i . When there are multiple classes, this measures the closeness of the threshold for distinguishing the correct class out of the union of the rest of the classes (i.e., one-versus-rest). The method is similar to an approximation of the optimal allocation in stratified sampling proposed by Druck and McCallum [10]. Similarly, SGD Weighted by Threshold Closeness (SGD-WTC) chooses the weight of ith sample vi = 1 NT ¯pHt−1 i (yi|xi)(1−¯pHt−1 i (yi|xi))+ϵT , where NT = 1 |D| P j ¯pHt−1 j (yj|xj)(1−¯pHt−1 j (yj|xj))+ϵT . The weighting can be viewed as combining the SGD-WD and SGD-WE by multiplying their weights 5 Table 1: Model architectures. Dropouts and L2 reg (regularization) are only applied to the fullyconnected (FC) layer(s). Dataset # Conv Filter Filter # Pooling # BN # FC Dropout L2 layers size number layers layers layers keep probs reg MNIST 2 5x5 32, 64 2 0 2 0.5 0.0005 CIFAR 10 0 N/A N/A 0 0 1 1 0.01 CIFAR 100 26 or 3X3 16, 32, 64 0 13 or 1 1 0 62 31 Question Type 1 (2,3,4)x1 64 1 0 1 0.5 0.01 CoNLL 2003 3 3x1 100 0 0 1 0.5, 0.75 0.001 OntoNote 5.0 MNIST 0 N/A N/A 0 0 2 1 0 Table 2: Optimization hyper-parameters and experiment settings Dataset Optimizer Batch Learning Learning # Epochs # Burn-in # Trials size rate rate decay epochs MNIST Momentum 64 0.01 0.95 80 2 20 CIFAR 10 SGD 100 1e-6 0.5 (per 5 epochs) 30 10 30 CIFAR 100 Momentum 128 0.1 0.1 (at 80, 100, 150 90 or 20 120 epochs) 50 Question Type ADAM 64 0.001 1 250 50 100 CoNLL 2003 ADAM 128 0.0005 1 200 30 10 OntoNote 5.0 MNIST SGD 128 0.1 1 60 20 10 together. Although other uncertainty estimates such as entropy are widely used in active learning and can also be viewed as a measure of boundary closeness, we found the proposed formula works better in our experiments. When using logistic regression, after injecting the bias vi into the loss function, approximating the prediction probability based on previous history, removing the regularization and smoothness constant (i.e., p(yi|xi, w) ≈¯pHt−1 i (yi|xi), 1/s0 = 0, and ϵT = 0), we can show that X i V ar(p(yi|xi, W)) ≈ X i gi(w)T SNgi(w) ≈NT · dim(w), (5) where dim(w) is the dimension of parameters w. This will ensure that the average prediction variance drops linearly as the number of training instance increases. The derivation could be seen in the supplementary materials. 4 Experiments We test our methods on six different datasets. The results show that the active bias techniques constantly outperform the standard uniform sampling (i.e., SGD-Uni and SGD-Scan) in the deep models as well as the shallow models. For each dataset, we use an existing, publicly available implementation for the problem and emphasize samples using different methods. The architectures and hyper-parameters are summarized in Table 1. All neural networks use softmax and cross-entropy loss at the last layer. The optimization and experiment setups are listed in Table 2. As shown in the second column of the table, SGD in CNNs and residual networks actually refers to momentum or ADAM instead of vanilla SGD. All experiments use mini-batch. Like most of the widely used neural network training techniques, the proposed techniques are not applicable to every scenario. For all the datasets we tried, we found that the proposed methods are not sensitive to the hyper-parameter setup except when applying a very complicated model to a relatively smaller dataset. If a complicated model achieves 100% training accuracy within a few epochs, the most uncertain examples would often be outliers, biasing the model towards overfitting. To avoid this scenario, we modify the default hyper-parameters setup in the implementation of the text classifiers in Section 4.3 and Section 4.4 to achieve similar performance using simplified models. For all other models and datasets, we use the default hyper-parameters of the existing implementations, which should favor the SGD-Uni or SGD-Scan methods, since the default hyper-parameters are 6 Table 3: The average of the best testing error rates for different sampling methods and datasets (%). The confidence intervals are standard errors. LR means logistic regression. Datasets Model SGD-Uni SGD-SD SGD-ISD SGD-SE SGD-SPV SGD-STC MNIST CNN 0.55±0.01 0.52±0.01 0.57±0.01 0.54±0.01 0.51 ±0.01 0.51±0.01 Noisy MNIST CNN 0.83±0.01 1.00±0.01 0.84±0.01 0.69 ±0.01 0.64±0.01 0.63±0.01 CIFAR 10 LR 62.49±0.06 63.14±0.06 62.48±0.07 60.87±0.06 60.66±0.06 61.00±0.06 QT CNN 17.70±0.07 17.61±0.07 17.66±0.08 17.92±0.08 17.49±0.08 17.55±0.08 Table 4: The average of the best testing error rates and their standard errors for different weighting methods (%). For CoNLL 2003 and OntoNote 5.0, the values are 1-(F1 score). CNN, LR, RN 27, RN 63 and FC mean convolutional neural network, logistic regression, residual networks with 27 layers, residual network with 63 layers, and fully-connected network, respectively. Datasets Model SGD-Scan SGD-WD SGD-WE SGD-WPV SGD-WTC MNIST CNN 0.54±0.01 0.48±0.01 0.56±0.01 0.48±0.01 0.48±0.01 Noisy MNIST CNN 0.81±0.01 0.92±0.01 0.72±0.01 0.61±0.02 0.63±0.01 CIFAR 10 LR 62.48±0.06 63.10±0.06 60.88±0.06 60.61±0.06 61.02±0.06 CIFAR 100 RN 27 34.04±0.06 34.55±0.06 33.65±0.07 33.69±0.07 33.64±0.07 CIFAR 100 RN 63 30.70±0.06 31.57±0.09 29.92±0.09 30.02±0.08 30.16±0.09 QT CNN 17.79±0.08 17.70±0.08 17.87±0.08 17.57±0.07 17.61±0.08 CoNLL 2003 CNN 11.62±0.04 11.50±0.05 11.73±0.04 11.24±0.06 11.18±0.03 OntoNote 5.0 CNN 17.80±0.05 17.65±0.06 18.40±0.05 17.82±0.03 17.51±0.05 MNIST FC 2.85±0.03 2.17±0.01 3.08±0.03 2.68±0.02 2.34±0.03 MNIST (distill) FC 2.27±0.01 2.13±0.02 2.35±0.01 2.18±0.02 2.07±0.02 optimized for these cases. To show the reliability of the proposed methods, we do not optimize the hyper-parameters for the proposed methods or baselines. Due to the randomness in all the SGD variants, we repeat experiments and list the number of trials in Table 2. At the beginning of each trial, network weights are trained with uniform sampling SGD until validation performance starts to saturate. After these burn-in epochs, we apply different sampling/weighting methods and compare performance. The number of burn-in epochs is determined by cross-validation, and the number of epochs in each trial is set large enough to let the testing error of most methods converge. In Tables 3 and 4, we evaluate the testing performance of each method after each epoch and report the best testing performance among epochs within each trial. As previously discussed, there are various versions preferring easy or difficult examples. Some of them require extra time to collect necessary statistics such as the gradient magnitude of each sample [12, 1], change the network architecture [15, 44], or involve an annealing schedule like selfpaced learning [25, 32]. We tried self-paced learning on CIFAR 10 but found that performance usually remains the same and is sometimes sensitive to the hyper-parameters of the annealing schedule. This finding is consistent with the results from [4]. To simplify the comparison, we focus on testing the effects of steady bias based on sample difficulty (e.g., compare with SGD-SE and SGD-SD) and do not gradually change the preference during the training like self-paced learning. It is not always easy to change the sampling procedure because of the model or implementation constraints. For example, in sequence labeling tasks (CoNLL 2003 and OntoNote 5.0), the words in the same sentence need to be trained together. Thus, we only compare methods which modify the loss function (SGD-W*) with SGD-Scan for some models. For the other experiments, re-weighting examples (SGD-W*) generally gives us better performance than changing the sampling distribution (SGD-S*). It might be because we can better estimate the statistics of each sample. 4.1 MNIST We apply our method to a CNN [26] for MNIST1 using one of the Tensorflow tutorials.2 The dataset has high testing accuracy, so most of the examples are too easy for the model after a few epochs. Selecting more difficult instances can accelerate learning or improve testing accuracy [18, 29, 13]. The results from SGD-SD and SGD-WD confirm this finding while selecting uncertain examples can give us a similar or larger boost. Furthermore, we test the robustness of our methods by randomly 1http://yann.lecun.com/exdb/mnist/ 2https://github.com/tensorflow/models/blob/master/tutorials/image/mnist 7 reassigning the labels of 10% of the images, and the results indicate that the SGD-WPV improves the performance of SGD-Scan even more while SGD-SD overfits the data seriously. 4.2 CIFAR 10 and CIFAR 100 We test a simple multi-class logistic regression3 on CIFAR 10 [24].4 Images are down-sampled significantly to 32 × 32 × 3, so many examples are difficult, even for humans. SGD-SPV and SGD-SE perform significantly better than SGD-Uni here, consistent with the idea that avoiding difficult examples increases robustness to outliers. For CIFAR 100 [24], we demonstrate that the proposed approaches can also work in very deep residual networks [16].5 To show the method is not sensitive to the network depth and the number of burn-in epochs, we present results from the network with 27 layers and 90 burn-in epochs as well as the network with 63 layers and 50 burn-in epochs. Without changing architectures, emphasizing uncertain or easy examples gains around 0.5% in both settings, which is significant considering the fact that the much deeper network shows only 3% improvement here. When training a neural network, gradually reducing the learning rate (i.e., the magnitude of gradients) usually improves performance. When difficult examples are sampled less, the magnitude of gradients would be reduced. Thus, some of the improvement of SGD-SPV and SGD-SE might come from using a lower effective learning rate. Nevertheless, since we apply the aggressive learning rate decay in the experiments of CIFAR 10 and CIFAR 100, we know that the improvements from SGD-SPV and SGD-SE cannot be entirely explained by its lower effective learning rate. 4.3 Question Type To investigate whether our methods are effective for smaller text datasets, we apply them to a sentence classification dataset (i.e. Question Type (QT) [28]), which contains 1000 training examples and 500 testing examples.6 We use the CNN architecture proposed by Kim [22].7 Like many other NLP tasks, the dataset is relatively small and this CNN classifier does not inject noise to inputs like the implementation of residual networks in CIFAR 100, so this complicated model reaches 100% training accuracy within a few epochs. To address this, we reduced the model complexity by (i) decreasing the number of filters from 128 to 64, (ii) decreasing convolutional filter widths from 3,4,5 to 2,3,4, (iii) adding L2 regularization with scale 0.01, (iv) performing PCA to reduce the dimension of pre-trained word embedding from 300 to 50 and fixing the word embedding during training. Then, the proposed active bias methods perform better than other baselines in this smaller model. 4.4 Sequence Tagging Tasks We also test our methods on Named Entity Recognition (NER) in CoNLL 2003 [46] and OntoNote 5.0 [20] datasets using the CNN from Strubell et al. [45].8 Similar to Question Type, the model is too complex for our approaches. So we (i) only use 3 layers instead of 4 layers, (ii) reduce the number of filters from 300 to 100, (iii) add 0.001 L2 regularization, (iv) make the 50 dimension word embedding from Collobert et al. [9] non-trainable. The micro F1 of this smaller model only drops around 1%-2% from the original big model. Table 4 shows that our methods achieve the lowest error rate (1-F1) in both benchmarks. 4.5 Distillation Although state-of-the-art neural networks in many applications memorize examples easily [50], much simpler models can usually achieve similar performance like those in the previous two experiments. In practice, such models are often preferable due to their low computation and memory requirements. 3https://cs231n.github.io/assignments2016/assignment2/ 4https://www.cs.toronto.edu/~kriz/cifar.html 5https://github.com/tensorflow/models/tree/master/resnet 6http://cogcomp.org/Data/QA/QC/ 7https://github.com/dennybritz/cnn-text-classification-tf 8https://github.com/iesl/dilated-cnn-ner 8 We have shown that the proposed method can improve these smaller models as distillation did [17], so it is natural to check whether our methods can work well with distillation. We use an implementation9 that distills a shallow CNN with 3 convolution layers to a 2 layer fully-connected network in MNIST. The teacher network can achieve 0.8% testing error, and the temperature of softmax is set as 1. Our approaches and baselines simply apply the sample dependent weights vi to the final loss function (i.e., cross-entropy of the true labels plus cross-entropy of the prediction probability from the teacher network). In MNIST, SGD-WTC and SGD-WD can achieve similar or better improvements compared with adding distillation into SGD-Scan. Furthermore, the best performance comes from the distillation plus SGD-WTC, which shows that active bias is compatible with distillation in this dataset. 5 Conclusion Deep learning researchers often gain accuracy by employing training techniques such as momentum, dropout, batch normalization, and distillation. This paper presents a new compatible sibling to these methods, which we recommend for wide use. Our relatively simple and computationally lightweight techniques emphasize the uncertain examples (i.e., SGD-*PV and SGD-*TC). The experiments confirm that the proper bias can be beneficial to generalization performance. When the task is relatively easy (both training and testing accuracy are high), preferring more difficult examples works well. On the contrary, when the dataset is challenging or noisy (both training and testing accuracy are low), emphasizing easier samples often lead to a better performance. In both cases, the active bias techniques consistently lead to more accurate and robust neural networks as long as the classifier does not memorize all the training samples easily (i.e., training accuracy is high but testing accuracy is low). Acknowledgements This material is based on research sponsored by National Science Foundation under Grant No. 1514053 and by DARPA under agreement number FA8750-1 3-2-0020 and HRO011-15-2-0036. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright notation thereon. 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 DARPA or the U.S. Government. References [1] G. Alain, A. Lamb, C. Sankar, A. Courville, and Y. Bengio. Variance reduction in SGD by distributed importance sampling. arXiv preprint arXiv:1511.06481, 2015. [2] S.-I. Amari, H. Park, and K. Fukumizu. Adaptive method of realizing natural gradient learning for multilayer perceptrons. Neural Computation, 12(6):1399–1409, 2000. [3] M. Andrychowicz, M. Denil, S. Gomez, M. W. Hoffman, D. Pfau, T. Schaul, and N. de Freitas. Learning to learn by gradient descent by gradient descent. In NIPS, 2016. [4] V. Avramova. Curriculum learning with deep convolutional neural networks, 2015. [5] Y. Bengio, J. Louradour, R. Collobert, and J. Weston. Curriculum learning. In ICML, 2009. [6] A. Bordes, S. Ertekin, J. Weston, and L. Bottou. Fast kernel classifiers with online and active learning. Journal of Machine Learning Research, 6(Sep):1579–1619, 2005. [7] 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. [8] P. Chaudhari, A. Choromanska, S. Soatto, and Y. LeCun. Entropy-SGD: Biasing gradient descent into wide valleys. In ICLR, 2017. 9https://github.com/akamaus/mnist-distill 9 [9] R. Collobert, J. Weston, L. Bottou, M. Karlen, K. Kavukcuoglu, and P. Kuksa. Natural language processing (almost) from scratch. Journal of Machine Learning Research, 12(Aug):2493–2537, 2011. [10] G. Druck and A. McCallum. Toward interactive training and evaluation. In Proceedings of the 20th ACM international conference on Information and knowledge management, pages 947–956. ACM, 2011. [11] J. Duchi, E. Hazan, and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011. [12] J. Gao, H. Jagadish, and B. C. Ooi. Active sampler: Light-weight accelerator for complex data analytics at scale. arXiv preprint arXiv:1512.03880, 2015. [13] S. Gopal. Adaptive sampling for SGD by exploiting side information. In ICML, 2016. [14] A. Guillory, E. Chastain, and J. A. Bilmes. Active learning as non-convex optimization. In AISTATS, 2009. [15] C. Gulcehre, M. Moczulski, F. Visin, and Y. Bengio. Mollifying networks. In ICLR, 2017. [16] 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. [17] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning Workshop, 2014. [18] G. E. Hinton. To recognize shapes, first learn to generate images. Progress in brain research, 165:535–547, 2007. [19] N. Houlsby, F. Huszár, Z. Ghahramani, and M. Lengyel. Bayesian active learning for classification and preference learning. arXiv preprint arXiv:1112.5745, 2011. [20] E. Hovy, M. Marcus, M. Palmer, L. Ramshaw, and R. Weischedel. OntoNotes: the 90% solution. In HLT-NAACL, 2006. [21] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. In NIPS, 2013. [22] Y. Kim. Convolutional neural networks for sentence classification. In EMNLP, 2014. [23] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. [24] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. [25] M. P. Kumar, B. Packer, and D. Koller. Self-paced learning for latent variable models. In NIPS, 2010. [26] 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. [27] G.-H. Lee, S.-W. Yang, and S.-D. Lin. Toward implicit sample noise modeling: Deviation-driven matrix factorization. arXiv preprint arXiv:1610.09274, 2016. [28] X. Li and D. Roth. Learning question classifiers. In COLING, 2002. [29] I. Loshchilov and F. Hutter. Online batch selection for faster training of neural networks. arXiv preprint arXiv:1511.06343, 2015. [30] D. J. MacKay. Information-based objective functions for active data selection. Neural computation, 4(4):590–604, 1992. [31] S. Mandt, M. D. Hoffman, and D. M. Blei. A variational analysis of stochastic gradient algorithms. In ICML, 2016. 10 [32] S. Mandt, J. McInerney, F. Abrol, R. Ranganath, and D. Blei. Variational tempering. In AISTATS, 2016. [33] D. Meng, Q. Zhao, and L. Jiang. What objective does self-paced learning indeed optimize? arXiv preprint arXiv:1511.06049, 2015. [34] Y. Mu, W. Liu, X. Liu, and W. Fan. Stochastic gradient made stable: A manifold propagation approach for large-scale optimization. IEEE Transactions on Knowledge and Data Engineering, 2016. [35] C. G. Northcutt, T. Wu, and I. L. Chuang. Learning with confident examples: Rank pruning for robust classification with noisy labels. arXiv preprint arXiv:1705.01936, 2017. [36] T. Pi, X. Li, Z. Zhang, D. Meng, F. Wu, J. Xiao, and Y. Zhuang. Self-paced boost learning for classification. In IJCAI, 2016. [37] D. Pregibon. Resistant fits for some commonly used logistic models with medical applications. Biometrics, pages 485–498, 1982. [38] N. Qian. On the momentum term in gradient descent learning algorithms. Neural networks, 12 (1):145–151, 1999. [39] J. D. Rennie. Regularized logistic regression is strictly convex. Unpublished manuscript. URL: people. csail. mit. edu/ jrennie/ writing/ convexLR. pdf , 2005. [40] T. Schaul, S. Zhang, and Y. LeCun. No more pesky learning rates. ICML, 2013. [41] A. I. Schein and L. H. Ungar. Active learning for logistic regression: an evaluation. Machine Learning, 68(3):235–265, 2007. [42] G. Schohn and D. Cohn. Less is more: Active learning with support vector machines. In ICML, 2000. [43] B. Settles. Active learning literature survey. University of Wisconsin, Madison, 52(55-66):11, 2010. [44] A. Shrivastava, A. Gupta, and R. Girshick. Training region-based object detectors with online hard example mining. In CVPR, 2016. [45] E. Strubell, P. Verga, D. Belanger, and A. McCallum. Fast and accurate sequence labeling with iterated dilated convolutions. arXiv preprint arXiv:1702.02098, 2017. [46] E. F. Tjong Kim Sang and F. De Meulder. Introduction to the conll-2003 shared task: Languageindependent named entity recognition. In HLT-NAACL, 2003. [47] C. Wang, X. Chen, A. J. Smola, and E. P. Xing. Variance reduction for stochastic gradient optimization. In NIPS, 2013. [48] Y. Wang, A. Kucukelbir, and D. M. Blei. Reweighted data for robust probabilistic models. arXiv preprint arXiv:1606.03860, 2016. [49] L. Xiao and T. Zhang. A proximal stochastic gradient method with progressive variance reduction. SIAM Journal on Optimization, 24(4):2057–2075, 2014. [50] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017. [51] P. Zhao and T. Zhang. Stochastic optimization with importance sampling. arXiv preprint arXiv:1412.2753, 2014. 11
2017
127
6,594
SchNet: A continuous-filter convolutional neural network for modeling quantum interactions K. T. Schütt1∗, P.-J. Kindermans1, H. E. Sauceda2, S. Chmiela1 A. Tkatchenko3, K.-R. Müller1,4,5† 1 Machine Learning Group, Technische Universität Berlin, Germany 2 Theory Department, Fritz-Haber-Institut der Max-Planck-Gesellschaft, Berlin, Germany 3 Physics and Materials Science Research Unit, University of Luxembourg, Luxembourg 4 Max-Planck-Institut für Informatik, Saarbrücken, Germany 5 Dept. of Brain and Cognitive Engineering, Korea University, Seoul, South Korea ∗kristof.schuett@tu-berlin.de † klaus-robert.mueller@tu-berlin.de Abstract Deep learning has the potential to revolutionize quantum chemistry as it is ideally suited to learn representations for structured data and speed up the exploration of chemical space. While convolutional neural networks have proven to be the first choice for images, audio and video data, the atoms in molecules are not restricted to a grid. Instead, their precise locations contain essential physical information, that would get lost if discretized. Thus, we propose to use continuousfilter convolutional layers to be able to model local correlations without requiring the data to lie on a grid. We apply those layers in SchNet: a novel deep learning architecture modeling quantum interactions in molecules. We obtain a joint model for the total energy and interatomic forces that follows fundamental quantumchemical principles. Our architecture achieves state-of-the-art performance for benchmarks of equilibrium molecules and molecular dynamics trajectories. Finally, we introduce a more challenging benchmark with chemical and structural variations that suggests the path for further work. 1 Introduction The discovery of novel molecules and materials with desired properties is crucial for applications such as batteries, catalysis and drug design. However, the vastness of chemical compound space and the computational cost of accurate quantum-chemical calculations prevent an exhaustive exploration. In recent years, there have been increased efforts to use machine learning for the accelerated discovery of molecules and materials with desired properties [1–9]. However, these methods are only applied to stable systems in so-called equilibrium, i.e., local minima of the potential energy surface E(r1, . . . , rn) where ri is the position of atom i. Data sets such as the established QM9 benchmark [10] contain only equilibrium molecules. Predicting stable atom arrangements is in itself an important challenge in quantum chemistry and material science. In general, it is not clear how to obtain equilibrium conformations without optimizing the atom positions. Therefore, we need to compute both the total energy E(r1, . . . , rn) and the forces acting on the atoms Fi(r1, . . . , rn) = −∂E ∂ri (r1, . . . , rn). (1) One possibility is to use a less computationally costly, however, also less accurate quantum-chemical approximation. Instead, we choose to extend the domain of our machine learning model to both compositional (chemical) and configurational (structural) degrees of freedom. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. In this work, we aim to learn a representation for molecules using equilibrium and non-equilibrium conformations. Such a general representation for atomistic systems should follow fundamental quantum-mechanical principles. Most importantly, the predicted force field has to be curl-free. Otherwise, it would be possible to follow a circular trajectory of atom positions such that the energy keeps increasing, i.e., breaking the law of energy conservation. Furthermore, the potential energy surface as well as its partial derivatives have to be smooth, e.g., in order to be able to perform geometry optimization. Beyond that, it is beneficial that the model incorporates the invariance of the molecular energy with respect to rotation, translation and atom indexing. Being able to model both chemical and conformational variations constitutes an important step towards ML-driven quantum-chemical exploration. This work provides the following key contributions: • We propose continuous-filter convolutional (cfconv) layers as a means to move beyond grid-bound data such as images or audio towards modeling objects with arbitrary positions such as astronomical observations or atoms in molecules and materials. • We propose SchNet: a neural network specifically designed to respect essential quantumchemical constraints. In particular, we use the proposed cfconv layers in R3 to model interactions of atoms at arbitrary positions in the molecule. SchNet delivers both rotationally invariant energy prediction and rotationally equivariant force predictions. We obtain a smooth potential energy surface and the resulting force-field is guaranteed to be energyconserving. • We present a new, challenging benchmark – ISO17 – including both chemical and conformational changes3. We show that training with forces improves generalization in this setting as well. 2 Related work Previous work has used neural networks and Gaussian processes applied to hand-crafted features to fit potential energy surfaces [11–16]. Graph convolutional networks for circular fingerprint [17] and molecular graph convolutions [18] learn representations for molecules of arbitrary size. They encode the molecular structure using neighborhood relationships as well as bond features, e.g., one-hot encodings of single, double and triple bonds. In the following, we briefly review the related work that will be used in our empirical evaluation: gradient domain machine learning (GDML), deep tensor neural networks (DTNN) and enn-s2s. Gradient-domain machine learning (GDML) Chmiela et al. [19] proposed GDML as a method to construct force fields that explicitly obey the law of energy conservation. GDML captures the relationship between energy and interatomic forces (see Eq. 1) by training the gradient of the energy estimator. The functional relationship between atomic coordinates and interatomic forces is thus learned directly and energy predictions are obtained by re-integration. However, GDML does not scale well due to its kernel matrix growing quadratically with the number of atoms as well as the number of examples. Beyond that, it is not designed to represent different compositions of atom types unlike SchNet, DTNN and enn-s2s. Deep tensor neural networks (DTNN) Schütt et al. [20] proposed the DTNN for molecules that are inspired by the many-body Hamiltonian applied to the interactions of atoms. They have been shown to reach chemical accuracy on a small set of molecular dynamics trajectories as well as QM9. Even though the DTNN shares the invariances with our proposed architecture, its interaction layers lack the continuous-filter convolution interpretation. It falls behind in accuracy compared to SchNet and enn-s2s. enn-s2s Gilmer et al. [21] proposed the enn-s2s as a variant of message-passing neural networks that uses bond type features in addition to interatomic distances. It achieves state-of-the-art performance on all properties of the QM9 benchmark [21]. Unfortunately, it cannot be used for molecular dynamics predictions (MD-17). This is caused by discontinuities in their potential energy surface due to the 3ISO17 is publicly available at www.quantum-machine.org. 2 Figure 1: The discrete filter (left) is not able to capture the subtle positional changes of the atoms resulting in discontinuous energy predictions ˆE (bottom left). The continuous filter captures these changes and yields smooth energy predictions (bottom right). discreteness of the one-hot encodings in their input. In contrast, SchNet does not use such features and yields a continuous potential energy surface by using continuous-filter convolutional layers. 3 Continuous-filter convolutions In deep learning, convolutional layers operate on discretized signals such as image pixels [22, 23], video frames [24] or digital audio data [25]. While it is sufficient to define the filter on the same grid in these cases, this is not possible for unevenly spaced inputs such as the atom positions of a molecule (see Fig. 1). Other examples include astronomical observations [26], climate data [27] and the financial market [28]. Commonly, this can be solved by a re-sampling approach defining a representation on a grid [7, 29, 30]. However, choosing an appropriate interpolation scheme is a challenge on its own and, possibly, requires a large number of grid points. Therefore, various extensions of convolutional layers even beyond the Euclidean space exist, e.g., for graphs [31, 32] and 3d shapes[33]. Analogously, we propose to use continuous filters that are able to handle unevenly spaced data, in particular, atoms at arbitrary positions. Given the feature representations of n objects Xl = (xl 1, . . . , xl n) with xl i ∈RF at locations R = (r1, . . . , rn) with ri ∈RD, the continuous-filter convolutional layer l requires a filter-generating function W l : RD →RF , that maps from a position to the corresponding filter values. This constitutes a generalization of a filter tensor in discrete convolutional layers. As in dynamic filter networks [34], this filter-generating function is modeled with a neural network. While dynamic filter networks generate weights restricted to a grid structure, our approach generalizes this to arbitrary position and number of objects. The output xl+1 i for the convolutional layer at position ri is then given by xl+1 i = (Xl ∗W l)i = X j xl j ◦W l(ri −rj), (2) where "◦" represents the element-wise multiplication. We apply these convolutions feature-wise for computational efficiency [35]. The interactions between feature maps are handled by separate object-wise or, specifically, atom-wise layers in SchNet. 4 SchNet SchNet is designed to learn a representation for the prediction of molecular energies and atomic forces. It reflects fundamental physical laws including invariance to atom indexing and translation, a smooth energy prediction w.r.t. atom positions as well as energy-conservation of the predicted force fields. The energy and force predictions are rotationally invariant and equivariant, respectively. 3 Figure 2: Illustration of SchNet with an architectural overview (left), the interaction block (middle) and the continuous-filter convolution with filter-generating network (right). The shifted softplus is defined as ssp(x) = ln(0.5ex + 0.5). 4.1 Architecture Fig. 2 shows an overview of the SchNet architecture. At each layer, the molecule is represented atomwise analogous to pixels in an image. Interactions between atoms are modeled by the three interaction blocks. The final prediction is obtained after atom-wise updates of the feature representation and pooling of the resulting atom-wise energy. In the following, we discuss the different components of the network. Molecular representation A molecule in a certain conformation can be described uniquely by a set of n atoms with nuclear charges Z = (Z1, . . . , Zn) and atomic positions R = (r1, . . . rn). Through the layers of the neural network, we represent the atoms using a tuple of features Xl = (xl 1, . . . xl n), with xl i ∈RF with the number of feature maps F, the number of atoms n and the current layer l. The representation of atom i is initialized using an embedding dependent on the atom type Zi: x0 i = aZi. (3) The atom type embeddings aZ are initialized randomly and optimized during training. Atom-wise layers A recurring building block in our architecture are atom-wise layers. These are dense layers that are applied separately to the representation xl i of atom i: xl+1 i = W lxl i + bl These layers is responsible for the recombination of feature maps. Since weights are shared across atoms, our architecture remains scalable with respect to the size of the molecule. Interaction The interaction blocks, as shown in Fig. 2 (middle), are responsible for updating the atomic representations based on the molecular geometry R = (r1, . . . rn). We keep the number of feature maps constant at F = 64 throughout the interaction part of the network. In contrast to MPNN and DTNN, we do not use weight sharing across multiple interaction blocks. The blocks use a residual connection inspired by ResNet [36]: xl+1 i = xl i + vl i. As shown in the interaction block in Fig. 2, the residual vl i is computed through an atom-wise layer, an interatomic continuous-filter convolution (cfconv) followed by two more atom-wise layers with a softplus non-linearity in between. This allows for a flexible residual that incorporates interactions between atoms and feature maps. 4 (a) 1st interaction block (b) 2nd interaction block (c) 3rd interaction block Figure 3: 10x10 Å cuts through all 64 radial, three-dimensional filters in each interaction block of SchNet trained on molecular dynamics of ethanol. Negative values are blue, positive values are red. Filter-generating networks The cfconv layer including its filter-generating network are depicted at the right panel of Fig. 2. In order to satisfy the requirements for modeling molecular energies, we restrict our filters for the cfconv layers to be rotationally invariant. The rotational invariance is obtained by using interatomic distances dij = ∥ri −rj∥ as input for the filter network. Without further processing, the filters would be highly correlated since a neural network after initialization is close to linear. This leads to a plateau at the beginning of training that is hard to overcome. We avoid this by expanding the distance with radial basis functions ek(ri −rj) = exp(−γ∥dij −µk∥2) located at centers 0Å ≤µk ≤30Å every 0.1Å with γ = 10Å. This is chosen such that all distances occurring in the data sets are covered by the filters. Due to this additional non-linearity, the initial filters are less correlated leading to a faster training procedure. Choosing fewer centers corresponds to reducing the resolution of the filter, while restricting the range of the centers corresponds to the filter size in a usual convolutional layer. An extensive evaluation of the impact of these variables is left for future work. We feed the expanded distances into two dense layers with softplus activations to compute the filter weight W(ri −rj) as shown in Fig. 2 (right). Fig 3 shows 2d-cuts through generated filters for all three interaction blocks of SchNet trained on an ethanol molecular dynamics trajectory. We observe how each filter emphasizes certain ranges of interatomic distances. This enables its interaction block to update the representations according to the radial environment of each atom. The sequential updates from three interaction blocks allow SchNet to construct highly complex many-body representations in the spirit of DTNNs [20] while keeping rotational invariance due to the radial filters. 4.2 Training with energies and forces As described above, the interatomic forces are related to the molecular energy, so that we can obtain an energy-conserving force model by differentiating the energy model w.r.t. the atom positions ˆFi(Z1, . . . , Zn, r1, . . . , rn) = −∂ˆE ∂ri (Z1, . . . , Zn, r1, . . . , rn). (4) Chmiela et al. [19] pointed out that this leads to an energy-conserving force-field by construction. As SchNet yields rotationally invariant energy predictions, the force predictions are rotationally equivariant by construction. The model has to be at least twice differentiable to allow for gradient descent of the force loss. We chose a shifted softplus ssp(x) = ln(0.5ex + 0.5) as non-linearity throughout the network in order to obtain a smooth potential energy surface. The shifting ensures that ssp(0) = 0 and improves the convergence of the network. This activation function shows similarity to ELUs [37], while having infinite order of continuity. 5 Table 1: Mean absolute errors for energy predictions in kcal/mol on the QM9 data set with given training set size N. Best model in bold. N SchNet DTNN [20] enn-s2s [21] enn-s2s-ens5 [21] 50,000 0.59 0.94 – – 100,000 0.34 0.84 – – 110,462 0.31 – 0.45 0.33 We include the total energy E as well as forces Fi in the training loss to train a neural network that performs well on both properties: ℓ( ˆE, (E, F1, . . . , Fn)) = ρ∥E −ˆE∥2 + 1 n n X i=0 Fi − −∂ˆE ∂Ri ! 2 . (5) This kind of loss has been used before for fitting a restricted potential energy surfaces with MLPs [38]. In our experiments, we use ρ = 0.01 for combined energy and force training. The value of ρ was optimized empirically to account for different scales of energy and forces. Due to the relation of energies and forces reflected in the model, we expect to see improved generalization, however, at a computational cost. As we need to perform a full forward and backward pass on the energy model to obtain the forces, the resulting force model is twice as deep and, hence, requires about twice the amount of computation time. Even though the GDML model captures this relationship between energies and forces, it is explicitly optimized to predict the force field while the energy prediction is a by-product. Models such as circular fingerprints [17], molecular graph convolutions or message-passing neural networks[21] for property prediction across chemical compound space are only concerned with equilibrium molecules, i.e., the special case where the forces are vanishing. They can not be trained with forces in a similar manner, as they include discontinuities in their predicted potential energy surface caused by discrete binning or the use of one-hot encoded bond type information. 5 Experiments and results In this section, we apply the SchNet to three different quantum chemistry datasets: QM9, MD17 and ISO17. We designed the experiments such that each adds another aspect towards modeling chemical space. While QM9 only contains equilibrium molecules, for MD17 we predict conformational changes of molecular dynamics of single molecules. Finally, we present ISO17 combining both chemical and structural changes. For all datasets, we report mean absolute errors in kcal/mol for the energies and in kcal/mol/Å for the forces. The architecture of the network was fixed after an evaluation on the MD17 data sets for benzene and ethanol (see supplement). In each experiment, we split the data into a training set of given size N and use a validation set of 1,000 examples for early stopping. The remaining data is used as test set. All models are trained with SGD using the ADAM optimizer [39] with 32 molecules per mini-batch. We use an initial learning rate of 10−3 and an exponential learning rate decay with ratio 0.96 every 100,000 steps. The model used for testing is obtained using an exponential moving average over weights with decay rate 0.99. 5.1 QM9 – chemical degrees of freedom QM9 is a widely used benchmark for the prediction of various molecular properties in equilibrium [10, 40, 41]. Therefore, the forces are zero by definition and do not need to be predicted. In this setting, we train a single model that generalizes across different compositions and sizes. QM9 consists of ≈130k organic molecules with up to 9 heavy atoms of the types {C, O, N, F}. As the size of the training set varies across previous work, we trained our models each of these experimental settings. Table 1 shows the performance of various competing methods for predicting the total energy (property U0 in QM9). We provide comparisons to the DTNN [20] and the best performing MPNN configuration denoted enn-s2s and an ensemble of MPNNs (enn-s2s-ens5) [21]. SchNet consistently obtains state-of-the-art performance with an MAE of 0.31 kcal/mol at 110k training examples. 6 Table 2: Mean absolute errors for energy and force predictions in kcal/mol and kcal/mol/Å, respectively. GDML and SchNet test errors for training with 1,000 and 50,000 examples of molecular dynamics simulations of small, organic molecules are shown. SchNets were trained only on energies as well as energies and forces combined. Best results in bold. N = 1,000 N = 50,000 GDML [19] SchNet DTNN [20] SchNet forces energy both energy energy both Benzene energy 0.07 1.19 0.08 0.04 0.08 0.07 forces 0.23 14.12 0.31 – 1.23 0.17 Toluene energy 0.12 2.95 0.12 0.18 0.16 0.09 forces 0.24 22.31 0.57 – 1.79 0.09 Malonaldehyde energy 0.16 2.03 0.13 0.19 0.13 0.08 forces 0.80 20.41 0.66 – 1.51 0.08 Salicylic acid energy 0.12 3.27 0.20 0.41 0.25 0.10 forces 0.28 23.21 0.85 – 3.72 0.19 Aspirin energy 0.27 4.20 0.37 – 0.25 0.12 forces 0.99 23.54 1.35 – 7.36 0.33 Ethanol energy 0.15 0.93 0.08 – 0.07 0.05 forces 0.79 6.56 0.39 – 0.76 0.05 Uracil energy 0.11 2.26 0.14 – 0.13 0.10 forces 0.24 20.08 0.56 – 3.28 0.11 Naphtalene energy 0.12 3.58 0.16 – 0.20 0.11 forces 0.23 25.36 0.58 – 2.58 0.11 5.2 MD17 – conformational degrees of freedom MD17 is a collection of eight molecular dynamics simulations for small organic molecules. These data sets were introduced by Chmiela et al. [19] for prediction of energy-conserving force fields using GDML. Each of these consists of a trajectory of a single molecule covering a large variety of conformations. Here, the task is to predict energies and forces using a separate model for each trajectory. This molecule-wise training is motivated by the need for highly-accurate force predictions when doing molecular dynamics. Table 2 shows the performance of SchNet using 1,000 and 50,000 training examples in comparison with GDML and DTNN. Using the smaller data set, GDML achieves remarkably accurate energy and force predictions despite being only trained on forces. The energies are only used to fit the integration constant. As mentioned before, GDML does not scale well with the number of atoms and training examples. Therefore, it cannot be trained on 50,000 examples. The DTNN was evaluated only on four of these MD trajectories using the larger training set [20]. Note that the enn-s2s cannot be used on this dataset due to discontinuities in its inferred potential energy surface. We trained SchNet using just energies and using both energies and forces. While the energy-only model shows high errors for the small training set, the model including forces achieves energy predictions comparable to GDML. In particular, we observe that SchNet outperforms GDML on the more flexible molecules malonaldehyde and ethanol, while GDML reaches much lower force errors on the remaining MD trajectories that all include aromatic rings. The real strength of SchNet is its scalability, as it outperforms the DTNN in three of four data sets using 50,000 training examples using only energies in training. Including force information, SchNet consistently obtains accurate energies and forces with errors below 0.12 kcal/mol and 0.33 kcal/mol/Å, respectively. Remarkably, when training on energies and forces using 1,000 training examples, SchNet performs better than training the same model on energies alone for 50,000 examples. 7 Table 3: Mean absolute errors on C7O2H10 isomers in kcal/mol. mean predictor SchNet energy energy+forces known molecules / energy 14.89 0.52 0.36 unknown conformation forces 19.56 4.13 1.00 unknown molecules / energy 15.54 3.11 2.40 unknown conformation forces 19.15 5.71 2.18 5.3 ISO17 – chemical and conformational degrees of freedom As the next step towards quantum-chemical exploration, we demonstrate the capability of SchNet to represent a complex potential energy surface including conformational and chemical changes. We present a new dataset – ISO17 – where we consider short MD trajectories of 129 isomers, i.e., chemically different molecules with the same number and types of atoms. In contrast to MD17, we train a joint model across different molecules. We calculate energies and interatomic forces from short MD trajectories of 129 molecules drawn randomly from the largest set of isomers in QM9. While the composition of all included molecules is C7O2H10, the chemical structures are fundamentally different. With each trajectory consisting of 5,000 conformations, the data set consists of 645,000 labeled examples. We consider two scenarios with this dataset: In the first variant, the molecular graph structures present in training are also present in the test data. This demonstrates how well our model is able to represent a complex potential energy surface with chemical and conformational changes. In the more challenging scenario, the test data contains a different subset of molecules. Here we evaluate the generalization of our model to previously unseen chemical structures. We predict forces and energies in both cases and compare to the mean predictor as a baseline. We draw a subset of 4,000 steps from 80% of the MD trajectories for training and validation. This leaves us with a separate test set for each scenario: (1) the unseen 1,000 conformations of molecule trajectories included in the training set and (2) all 5,000 conformations of the remaining 20% of molecules not included in training. Table 3 shows the performance of the SchNet on both test sets. Our proposed model reaches chemical accuracy for the prediction of energies and forces for the test set of known molecules. Including forces in the training improves the performance here as well as on the set of unseen molecules. This shows that using force information does not only help to accurately predict nearby conformations of a single molecule, but indeed helps to generalize across chemical compound space. 6 Conclusions We have proposed continuous-filter convolutional layers as a novel building block for deep neural networks. In contrast to the usual convolutional layers, these can model unevenly spaced data as occurring in astronomy, climate reasearch and, in particular, quantum chemistry. We have developed SchNet to demonstrate the capabilities of continuous-filter convolutional layers in the context of modeling quantum interactions in molecules. Our architecture respects quantum-chemical constraints such as rotationally invariant energy predictions as well as rotationally equivariant, energy-conserving force predictions. We have evaluated our model in three increasingly challenging experimental settings. Each brings us one step closer to practical chemical exploration driven by machine learning. SchNet improves the state-of-the-art in predicting energies for molecules in equilibrium of the QM9 benchmark. Beyond that, it achieves accurate predictions for energies and forces for all molecular dynamics trajectories in MD17. Finally, we have introduced ISO17 consisting of 645,000 conformations of various C7O2H10 isomers. While we achieve promising results on this new benchmark, modeling chemical and conformational variations remains difficult and needs further improvement. For this reason, we expect that ISO17 will become a new standard benchmark for modeling quantum interactions with machine learning. 8 Acknowledgments This work was supported by the Federal Ministry of Education and Research (BMBF) for the Berlin Big Data Center BBDC (01IS14013A). Additional support was provided by the DFG (MU 987/20-1) and from the European Union’s Horizon 2020 research and innovation program under the Marie Sklodowska-Curie grant agreement NO 657679. K.R.M. gratefully acknowledges the BK21 program funded by Korean National Research Foundation grant (No. 2012-005741) and the Institute for Information & Communications Technology Promotion (IITP) grant funded by the Korea government (no. 2017-0-00451). References [1] M. Rupp, A. Tkatchenko, K.-R. Müller, and O. A. Von Lilienfeld. Fast and accurate modeling of molecular atomization energies with machine learning. Phys. Rev. Lett., 108(5):058301, 2012. [2] G. Montavon, M. Rupp, V. Gobre, A. Vazquez-Mayagoitia, K. Hansen, A. Tkatchenko, K.-R. Müller, and O. A. von Lilienfeld. Machine learning of molecular electronic properties in chemical compound space. New J. Phys., 15(9):095003, 2013. [3] K. Hansen, G. Montavon, F. Biegler, S. Fazli, M. Rupp, M. Scheffler, O. A. Von Lilienfeld, A. Tkatchenko, and K.-R. Müller. Assessment and validation of machine learning methods for predicting molecular atomization energies. J. Chem. Theory Comput., 9(8):3404–3419, 2013. [4] K. T. Schütt, H. Glawe, F. Brockherde, A. Sanna, K.-R. Müller, and EKU Gross. How to represent crystal structures for machine learning: Towards fast prediction of electronic properties. Phys. Rev. B, 89(20):205118, 2014. [5] K. Hansen, F. Biegler, R. Ramakrishnan, W. Pronobis, O. A. von Lilienfeld, K.-R. Müller, and A. Tkatchenko. Machine learning predictions of molecular properties: Accurate many-body potentials and nonlocality in chemical space. J. Phys. Chem. Lett., 6:2326, 2015. [6] F. A. Faber, L. Hutchison, B. Huang, Ju. Gilmer, S. S. Schoenholz, G. E. Dahl, O. Vinyals, S. Kearnes, P. F. Riley, and O. A. von Lilienfeld. Fast machine learning models of electronic and energetic properties consistently reach approximation errors better than dft accuracy. arXiv preprint arXiv:1702.05532, 2017. [7] F. Brockherde, L. Voigt, L. Li, M. E. Tuckerman, K. Burke, and K.-R. Müller. Bypassing the Kohn-Sham equations with machine learning. Nature Communications, 8(872), 2017. [8] W. Boomsma and J. Frellsen. Spherical convolutions and their application in molecular modelling. In Advances in Neural Information Processing Systems 30, pages 3436–3446. 2017. [9] M. Eickenberg, G. Exarchakis, M. Hirn, and S. Mallat. Solid harmonic wavelet scattering: Predicting quantum molecular energy from invariant descriptors of 3d electronic densities. In Advances in Neural Information Processing Systems 30, pages 6543–6552. 2017. [10] R. Ramakrishnan, P. O. Dral, M. Rupp, and O. A. von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1, 2014. [11] S. Manzhos and T. Carrington Jr. A random-sampling high dimensional model representation neural network for building potential energy surfaces. J. Chem. Phys., 125(8):084109, 2006. [12] R. Malshe, M .and Narulkar, L. M. Raff, M. Hagan, S. Bukkapatnam, P. M. Agrawal, and R. Komanduri. Development of generalized potential-energy surfaces using many-body expansions, neural networks, and moiety energy approximations. J. Chem. Phys., 130(18):184102, 2009. [13] J. Behler and M. Parrinello. Generalized neural-network representation of high-dimensional potential-energy surfaces. Phys. Rev. Lett., 98(14):146401, 2007. [14] A. P. Bartók, M. C. Payne, R. Kondor, and G. Csányi. Gaussian approximation potentials: The accuracy of quantum mechanics, without the electrons. Phys. Rev. Lett., 104(13):136403, 2010. 9 [15] J. Behler. Atom-centered symmetry functions for constructing high-dimensional neural network potentials. J. Chem. Phys., 134(7):074106, 2011. [16] A. P. Bartók, R. Kondor, and G. Csányi. On representing chemical environments. Phys. Rev. B, 87(18):184115, 2013. [17] 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 C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett, editors, NIPS, pages 2224–2232, 2015. [18] S. Kearnes, K. McCloskey, M. Berndl, V. Pande, and P. F. Riley. Molecular graph convolutions: moving beyond fingerprints. Journal of Computer-Aided Molecular Design, 30(8):595–608, 2016. [19] S. Chmiela, A. Tkatchenko, H. E. Sauceda, I. Poltavsky, K. T. Schütt, and K.-R. Müller. Machine learning of accurate energy-conserving molecular force fields. Science Advances, 3(5): e1603015, 2017. [20] K. T. Schütt, F. Arbabzadah, S. Chmiela, K.-R. Müller, and A. Tkatchenko. Quantum-chemical insights from deep tensor neural networks. Nature Communications, 8(13890), 2017. [21] J. Gilmer, S. S. Schoenholz, P. F. Riley, O. Vinyals, and G. E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, pages 1263–1272, 2017. [22] Y. LeCun, B. Boser, J. S. Denker, D. Henderson, R. E. Howard, W. Hubbard, and L. D. Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1(4): 541–551, 1989. [23] 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. [24] A. Karpathy, G. Toderici, S. Shetty, T. Leung, R. Sukthankar, and L. Fei-Fei. Large-scale video classification with convolutional neural networks. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 1725–1732, 2014. [25] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. Wavenet: A generative model for raw audio. In 9th ISCA Speech Synthesis Workshop, pages 125–125, 2016. [26] W. Max-Moerbeck, J. L. Richards, T. Hovatta, V. Pavlidou, T. J. Pearson, and A. C. S. Readhead. A method for the estimation of the significance of cross-correlations in unevenly sampled red-noise time series. Monthly Notices of the Royal Astronomical Society, 445(1):437–459, 2014. [27] K. B. Ólafsdóttir, M. Schulz, and M. Mudelsee. Redfit-x: Cross-spectral analysis of unevenly spaced paleoclimate time series. Computers & Geosciences, 91:11–18, 2016. [28] L. E. Nieto-Barajas and T. Sinha. Bayesian interpolation of unequally spaced time series. Stochastic environmental research and risk assessment, 29(2):577–587, 2015. [29] J. C. Snyder, M. Rupp, K. Hansen, K.-R. Müller, and K. Burke. Finding density functionals with machine learning. Physical review letters, 108(25):253002, 2012. [30] M. Hirn, S. Mallat, and N. Poilvert. Wavelet scattering regression of quantum chemical energies. Multiscale Modeling & Simulation, 15(2):827–863, 2017. [31] J. Bruna, W. Zaremba, A. Szlam, and Y. Lecun. Spectral networks and locally connected networks on graphs. In ICLR, 2014. [32] M. Henaff, J. Bruna, and Y. LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015. 10 [33] J. Masci, D. Boscaini, M. Bronstein, and P. Vandergheynst. Geodesic convolutional neural networks on riemannian manifolds. In Proceedings of the IEEE international conference on computer vision workshops, pages 37–45, 2015. [34] X. Jia, B. De Brabandere, T. Tuytelaars, and L. V. Gool. Dynamic filter networks. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 667–675. 2016. [35] F. Chollet. Xception: Deep learning with depthwise separable convolutions. arXiv preprint arXiv:1610.02357, 2016. [36] 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. [37] D.-A. Clevert, T. Unterthiner, and S. Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289, 2015. [38] A Pukrittayakamee, M Malshe, M Hagan, LM Raff, R Narulkar, S Bukkapatnum, and R Komanduri. Simultaneous fitting of a potential-energy surface and its corresponding force fields using feedforward neural networks. The Journal of chemical physics, 130(13):134101, 2009. [39] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In ICLR, 2015. [40] L. C. Blum and J.-L. Reymond. 970 million druglike small molecules for virtual screening in the chemical universe database GDB-13. J. Am. Chem. Soc., 131:8732, 2009. [41] J.-L. Reymond. The chemical space project. Acc. Chem. Res., 48(3):722–730, 2015. 11
2017
128
6,595
GibbsNet: Iterative Adversarial Inference for Deep Graphical Models Alex Lamb R Devon Hjelm Yaroslav Ganin Joseph Paul Cohen Aaron Courville Yoshua Bengio Abstract Directed latent variable models that formulate the joint distribution as p(x, z) = p(z)p(x | z) have the advantage of fast and exact sampling. However, these models have the weakness of needing to specify p(z), often with a simple fixed prior that limits the expressiveness of the model. Undirected latent variable models discard the requirement that p(z) be specified with a prior, yet sampling from them generally requires an iterative procedure such as blocked Gibbs-sampling that may require many steps to draw samples from the joint distribution p(x, z). We propose a novel approach to learning the joint distribution between the data and a latent code which uses an adversarially learned iterative procedure to gradually refine the joint distribution, p(x, z), to better match with the data distribution on each step. GibbsNet is the best of both worlds both in theory and in practice. Achieving the speed and simplicity of a directed latent variable model, it is guaranteed (assuming the adversarial game reaches the virtual training criteria global minimum) to produce samples from p(x, z) with only a few sampling iterations. Achieving the expressiveness and flexibility of an undirected latent variable model, GibbsNet does away with the need for an explicit p(z) and has the ability to do attribute prediction, class-conditional generation, and joint image-attribute modeling in a single model which is not trained for any of these specific tasks. We show empirically that GibbsNet is able to learn a more complex p(z) and show that this leads to improved inpainting and iterative refinement of p(x, z) for dozens of steps and stable generation without collapse for thousands of steps, despite being trained on only a few steps. 1 Introduction Generative models are powerful tools for learning an underlying representation of complex data. While early undirected models, such as Deep Boltzmann Machines or DBMs (Salakhutdinov and Hinton, 2009), showed great promise, practically they did not scale well to complicated high-dimensional settings (beyond MNIST), possibly because of optimization and mixing difficulties (Bengio et al., 2012). More recent work on Helmholtz machines (Bornschein et al., 2015) and on variational autoencoders (Kingma and Welling, 2013) borrow from deep learning tools and can achieve impressive results, having now been adopted in a large array of domains (Larsen et al., 2015). Many of the important generative models available to us rely on a formulation of some sort of stochastic latent or hidden variables along with a generative relationship to the observed data. Arguably the simplest is the directed graphical models (such as the VAE) with a factorized decomposition p(z, x) = p(z)p(x | z). In this, it is typical to assume that p(z) follows some factorized prior with simple statistics (such as Gaussian). While sampling with directed models is simple, inference and learning tends to be difficult and often requires advanced techniques such as approximate inference using a proposal distribution for the true posterior. z0 ∼N(0, I) xi ∼p(x | zi) zN ∼q(z | xN−1) xN ∼p(x | zN) zi+1 ∼q(z | xi) ˆz ∼q(z | xdata) xdata ∼q(x) D(z, x) Figure 1: Diagram illustrating the training procedure for GibbsNet. The unclamped chain (dashed box) starts with a sample from an isotropic Gaussian distribution N(0, I) and runs for N steps. The last step (iteration N) shown as a solid pink box is then compared with a single step from the clamped chain (solid blue box) using joint discriminator D. The other dominant family of graphical models are undirected graphical models, such that the joint is represented by a product of clique potentials and a normalizing factor. It is common to assume that the clique potentials are positive, so that the un-normalized density can be represented by an energy function, E and the joint is represented by p(x, z) = e−E(z,x)/Z, where Z is the normalizing constant or partition function. These so-called energy-based models (of which the Boltzmann Machine is an example) are potentially very flexible and powerful, but are difficult to train in practice and do not seem to scale well. Note also how in such models, the marginal p(z) can have a very rich form (as rich as that of p(x)). The methods above rely on a fully parameterized joint distribution (and approximate posterior in the case of directed models), to train with approximate maximum likelihood estimation (MLE, Dempster et al., 1977). Recently, generative adversarial networks (GANs, Goodfellow et al., 2014) have provided a likelihood-free solution to generative modeling that provides an implicit distribution unconstrained by density assumptions on the data. In comparison to MLE-based latent variable methods, generated samples can be of very high quality (Radford et al., 2015), and do not suffer from well-known problems associated with parameterizing noise in the observation space (Goodfellow, 2016). Recently, there have been advances in incorporating latent variables in generative adversarial networks in a way reminiscent of Helmholtz machines (Dayan et al., 1995), such as adversarially learned inference (Dumoulin et al., 2017; Donahue et al., 2017) and implicit variational inference (Huszár, 2017). These models, as being essentially complex directed graphical models, rely on approximate inference to train. While potentially powerful, there is good evidence that using an approximate posterior necessarily limits the generator in practice (Hjelm et al., 2016; Rezende and Mohamed, 2015). In contrast, it would perhaps be more appropriate to start with inference (encoder) and generative (decoder) processes and derive the prior directly from these processes. This approach, which we call GibbsNet, uses these two processes to define a transition operator of a Markov chain similar to Gibbs sampling, alternating between sampling observations and sampling latent variables. This is similar to the previously proposed generative stochastic networks (GSNs, Bengio et al., 2013) but with a GAN training framework rather than minimizing reconstruction error. By training a discriminator to place a decision boundary between the data-driven distribution (with x clamped) and the free-running model (which alternates between sampling x and z), we are able to train the model so that the two joint distributions (x, z) match. This approach is similar to Gibbs sampling in undirected models, yet, like traditional GANs, it lacks the strong parametric constraints, i.e., there is no explicit energy function. While losing some the theoretical simplicity of undirected models, we gain great flexibility and ease of training. In summary, our method offers the following contributions: • We introduce the theoretical foundation for a novel approach to learning and performing inference in deep graphical models. The resulting model of our algorithm is similar to undirected graphical models, but avoids the need for MLE-based training and also lacks an explicitly defined energy, instead being trained with a GAN-like discriminator. 2 • We present a stable way of performing inference in the adversarial framework, meaning that useful inference is performed under a wide range of architectures for the encoder and decoder networks. This stability comes from the fact that the encoder q(z | x) appears in both the clamped and the unclamped chain, so gets its training signal from both the discriminator in the clamped chain and from the gradient in the unclamped chain. • We show improvements in the quality of the latent space over models which use a simple prior for p(z). This manifests itself in improved conditional generation. The expressiveness of the latent space is also demonstrated in cleaner inpainting, smoother mixing when running blocked Gibbs sampling, and better separation between classes in the inferred latent space. • Our model has the flexibility of undirected graphical models, including the ability to do label prediction, class-conditional generation, and joint image-label generation in a single model which is not explicitly trained for any of these specific tasks. To our knowledge our model is the first model which combines this flexibility with the ability to produce high quality samples on natural images. 2 Proposed Approach: GibbsNet The goal of GibbsNet is to train a graphical model with transition operators that are defined and learned directly by matching the joint distributions of the model expectation with that with the observations clamped to data. This is analogous to and inspired by undirected graphical models, except that the transition operators, which correspond to blocked Gibbs sampling, are defined to move along a defined energy manifold, so we will make this connection throughout our formulation. We first explain GibbsNet in the simplest case where the graphical model consists of a single layer of observed units and a single layer of latent variable with stochastic mappings from one to the other as parameterized by arbitrary neural network. Like Professor Forcing (Lamb et al., 2016), GibbsNet uses a GAN-like discriminator to make two distributions match, one corresponding to the model iteratively sampling both observation, x, and latent variables, z (free-running), and one corresponding to the same generative model but with the observations, x, clamped. The free-running generator is analogous to Gibbs sampling in Restricted Boltzmann Machines (RBM, Hinton et al., 2006) or Deep Boltzmann Machines (DBM, Salakhutdinov and Hinton, 2009). In the simplest case, the free-running generator is defined by conditional distributions q(z|x) and p(x|z) which stochastically map back and forth between data space x and latent space z. To begin our free-running process, we start the chain with a latent variable sampled from a normal distribution: z ∼N(0, I), and follow this by N steps of alternating between sampling from p(x|z) and q(z|x). For the clamped version, we do simple ancestral sampling from q(z|x), given xdata is drawn from the data distribution q(x) (a training example). When the model has more layers (e.g., a hierarchy of layers with stochastic latent variables, à la DBM), the data-driven model also needs to iterate to correctly sample from the joint. While this situation highly resembles that of undirected graphical models, GibbsNet is trained adversarially so that its free-running generative states become indistinguishable from its data-driven states. In addition, while in principle undirected graphical models need to either start their chains from data or sample a very large number of steps, we find in practice GibbsNet only requires a very small number of steps (on the order of 3 to 5 with very complex datasets) from noise. An example of the free-running (unclamped) chain can be seen in Figure 2. An interesting aspect of GibbsNet is that we found that it was enough and in fact best experimentally to back-propagate discriminator gradients through a single step of the iterative procedure, yielding more stable training. An intuition for why this helps is that each step of the procedure is supposed to generate increasingly realistic samples. However, if we passed gradients through the iterative procedure, then this gradient could encourage the earlier steps to store features which have downstream value instead of immediate realistic x-values. 2.1 Theoretical Analysis We consider a simple case of an undirected graph with single layers of visible and latent units trained with alternating 2-step (p then q) unclamped chains and the asymptotic scenario where the GAN objective is properly optimized. We then ask the following questions: in spite of training for a 3 Figure 2: Evolution of samples for 20 iterations from the unclamped chain, trained on the SVHN dataset starting on the left and ending on the right. bounded number of Markov chain steps, are we learning a transition operator? Are the encoder and decoder estimating compatible conditionals associated with the stationary distribution of that transition operator? We find positive answers to both questions. A high level explanation of our argument is that if the discriminator is fooled, then the consecutive (z, x) pairs from the chain match the data-driven (z, x) pair. Because the two marginals on x from these two distributions match, we can show that the next z in the chain will form again the same joint distribution. Similarly, we can show that the next x in the chain also forms the same joint with the previous z. Because the state only depends on the previous value of the chain (as it’s Markov), then all following steps of the chain will also match the clamped distribution. This explains the result, validated experimentally, that even though we train for just a few steps, we can generate high quality samples for thousands or more steps. Proposition 1. If (a) the stochastic encoder q(z|x) and stochastic decoder p(x|z) inject noise such that the transition operator defined by their composition (p followed by q or vice-versa) allows for all possible x-to-x or z-to-z transitions (x →z →x or z →x →z), and if (b) those GAN objectives are properly trained in the sense that the discriminator is fooled in spite of having sufficient capacity and training time, then (1) the Markov chain which alternates the stochastic encoder followed by the stochastic decoder as its transition operator T (or vice-versa) has the data-driven distribution πD as its stationary distribution πT , (2) the two conditionals q(z|x) and p(x|z) converge to compatible conditionals associated with the joint πD = πT . Proof. When the stochastic decoder and encoder inject noise so that their composition forms a transition operator T with paths with non-zero probability from any state to any other state, then T is ergodic. So condition (a) implies that T has a stationary distribution πT . The properly trained GAN discriminators for each of these two steps (condition (b)) forces the matching of the distributions of the pairs (zt, xt) (from the generative trajectory) and (x, z) with x ∼q(x), the data distribution and z ∼q(z | x), both pairs converging to the same data-driven distribution πD. Because (zt, xt) has the same joint distribution as (z, x), it means that xt has the same distribution as x. Since z ∼q(z | x), when we apply q to xt, we get zt+1 which must form a joint (zt+1, xt) which has the same distribution as (z, x). Similarly, since we just showed that zt+1 has the same distribution as z and thus the same as zt, if we apply p to zt+1, we get xt+1 and the joint (zt+1, xt+1) must have the same distribution as (z, x). Because the two pairs (zt, xt) and (zt+1, xt+1) have the same joint distribution πD, it means that the transition operator T, that maps samples (zt, xt) to samples (zt+1, xt+1), maps πD to itself, i.e., πD = πT is both the data distribution and the stationary distribution of T and result (1) is obtained. Now consider the "odd" pairs (zt+1, xt) and (zt+2, xt+1) in the generated sequences. Because of (1), xt and xt+1 have the same marginal distribution πD(x). Thus when we apply the same q(z|x) to these x’s we obtain that (zt+1, xt) and (zt+2, xt+1) also have the same distribution. Following the same reasoning as for proving (1), we conclude that the associated transition operator Todd has also πD as stationary distribution. So starting from z ∼πD(z) and applying p(x | z) gives an x so that the pair (z, x) has πD as joint distribution, i.e., πD(z, x) = πD(z)p(x | z). This means that p(x | z) = πD(x,z) πD(z) is the x | z conditional of πD. Since (zt, xt) also converges to joint distribution πD, we can apply the same argument when starting from an x ∼πD(x) followed by q and obtain that πD(z, x) = πD(x)q(z | x) and so q(z|x) = πD(z,x) πD(x) is the z | x conditional of πD. This proves result (2). 4 2.2 Architecture GibbsNet always involves three networks: the inference network q(z|x), the generation network p(x|z), and the joint discriminator. In general, our architecture for these networks closely follow Dumoulin et al. (2017), except that we use the boundary-seeking GAN (BGAN, Hjelm et al., 2017) as it explicitly optimizes on matching the opposing distributions (in this case, the model expectation and the data-driven joint distributions), allows us to use discrete variables where we consider learning graphs with labels or discrete attributes, and worked well across our experiments. 3 Related Work Energy Models and Deep Boltzmann Machines The training and sampling procedure for generating from GibbsNet is very similar to that of a deep Boltzmann machine (DBM, Salakhutdinov and Hinton, 2009): both involve blocked Gibbs sampling between observation- and latent-variable layers. A major difference is that in a deep Boltzmann machine, the “decoder" p(x|z) and “encoder" p(z|x) exactly correspond to conditionals of a joint distribution p(x, z), which is parameterized by an energy function. This, in turn, puts strong constraints on the forms of the encoder and decoder. In a restricted Boltzmann machine (RBM, Hinton, 2010), the visible units are conditionally independent given the hidden units on the adjacent layer, and likewise the hidden units are conditionally independent given the visible units. This may force the layers close to the data to need to be nearly deterministic, which could cause poor mixing and thus make learning difficult. These conditional independence assumptions in RBMs and DBMs have been discussed before in the literature as a potential weakness in these models (Bengio et al., 2012). In our model, p(x|z) and q(z|x) are modeled by separate deep neural networks with no shared parameters. The disadvantage is that the networks are over-parameterized, but this has the added flexibility that these conditionals can be much deeper, can take advantage of all the recent advances in deep architectures, and have fewer conditional independence assumptions than DBMs and RBMs. Generative Stochastic Networks Like GibbsNet, generative stochastic networks (GSNs, Bengio et al., 2013) also directly parameterizes a transition operator of a Markov chain using deep neural networks. However, GSNs and GibbsNet have completely different training procedures. In GSNs, the training procedure is based on an objective that is similar to de-noising autoencoders (Vincent et al., 2008). GSNs begin by drawing a sampling from the data, iteratively corrupting it, then learning a transition operator which de-noises it (i.e., reverses that corruption), so that the reconstruction after k steps is brought closer to the original un-corrupted input. In GibbsNet, there is no corruption in the visible space, and the learning procedure never involves “walk-back" (de-noising) towards a real data-point. Instead, the processes from and to data are modeled by different networks, with the constraint of the marginal, p(x), matches the real distribution imposed through the GAN loss on the joint distributions from the clamped and unclamped phases. Non-Equilibrium Thermodynamics The Non-Equilibrium Thermodynamics method (SohlDickstein et al., 2015) learns a reverse diffusion process against a forward diffusion process which starts from real data points and gradually injects noise until the data distribution matches a analytically tractible / simple distribution. This is similar to GibbsNet in that generation involves a stochastic process which is initialized from noise, but differs in that Non-Equilibrium Thermodynamics is trained using MLE and relies on noising + reversal for training, similar to GSNs above. Generative Adversarial Learning of Markov Chains The Adversarial Markov Chain algorithm (AMC, Song et al., 2017) learns a markov chain over the data distribution in the visible space. GibbsNet and AMC are related in that they both involve adversarial training and an iterative procedure for generation. However there are major differences. GibbsNet learns deep graphical models with latent variables, whereas the AMC method learns a transition operator directly in the visible space. The AMC approach involves running chains which start from real data points and repeatedly apply the transition operator, which is different from the clamped chain used in GibbsNet. The experiments 5 shown in Figure 3 demonstrate that giving the latent variables to the discriminator in our method has a significant impact on inference. Adversarially Learned Inference (ALI) Adversarially learned inference (ALI, Dumoulin et al., 2017) learns to match distributions generative and inference distributions, p(x, z) and q(x, z) (can be thought of forward and backward models) with a discriminator, so that p(z)p(x | z) = q(x)q(z | x). In the single latent layer case, GibbsNet also has forward and reverse models, p(x | z) and q(z | x). The un-clamped chain is sampled as p(z), p(x | z), q(z | x), p(x | z), . . . and the clamped chain is sampled as q(x), q(z | x). We then adversarially encourage the clamped chain to match the equilibrium distribution of the unclamped chain. When the number of iterations is set to N = 1, GibbsNet reduces to ALI. However, in the general setting of N > 1, Gibbsnet should learn a richer representation than ALI, as the prior, p(z), is no longer forced to be the simple one at the beginning of the unclamped phase. 4 Experiments and Results The goal of our experiments is to explore and give insight into the joint distribution p(x, z) learned by GibbsNet and to understand how this joint distribution evolves over the course of the iterative inference procedure. Since ALI is identical to GibbsNet when the number of iterative inference steps is N = 1, results obtained with ALI serve as an informative baseline. From our experiments, the clearest result (covered in detail below) is that the p(z) obtained with GibbsNet can be more complex than in ALI (or other directed graphical models). This is demonstrated directly in experiments with 2-D latent spaces and indirectly by improvements in classification when directly using the variables q(z | x). We achieve strong improvements over ALI using GibbsNet even when q(z | x) has exactly the same architecture in both models. We also show that GibbsNet allows for gradual refinement of the joint, (x, z), in the sampling chain q(z | x), p(x | z). This is a result of the sampling chain making small steps towards the equilibrium distribution. This allows GibbsNet to gradually improve sampling quality when running for many iterations. Additionally it allows for inpainting and conditional generation where the conditioning information is not fixed during training, and indeed where the model is not trained specifically for these tasks. 4.1 Expressiveness of GibbsNet’s Learned Latent Variables Latent structure of GibbsNet The latent variables from q(z | x) learned from GibbsNet are more expressive than those learned with ALI. We show this in two ways. First, we train a model on the MNIST digits 0, 1, and 9 with a 2-D latent space which allows us to easily visualize inference. As seen in Figure 3, we show that GibbsNet is able to learn a latent space which is not Gaussian and has a structure that makes the different classes well separated. Semi-supervised learning Following from this, we show that the latent variables learned by GibbsNet are better for classification. The goal here is not to show state of the art results on classification, but instead to show that the requirement that p(z) be something simple (like a Gaussian, as in ALI) is undesirable as it forces the latent space to be filled. This means that different classes need to be packed closely together in that latent space, which makes it hard for such a latent space to maintain the class during inference and reconstruction. We evaluate this property on two datasets: Street View House Number (SVHN, Netzer et al., 2011) and permutation invariant MNIST. In both cases we use the latent features q(z | x) directly from a trained model, and train a 2-layer MLP on top of the latent variables, without passing gradient from the classifier through to q(z | x). ALI and GibbsNet were trained for the same amount of time and with exactly the same architecture for the discriminator, the generative network, p(x | z), and the inference network, q(z | x). On permutation invariant MNIST, ALI achieves 91% test accuracy and GibbsNet achieves 97.7% test accuracy. On SVHN, ALI achieves 66.7% test accuracy and GibbsNet achieves 79.6% test accuracy. This does not demonstrate a competitive classifier in either case, but rather demonstrates that the latent space inferred by GibbsNet keeps more information about its input image than the encoder 6 learned by ALI. This is consistent with the reported ALI reconstructions (Dumoulin et al., 2017) on SVHN where the reconstructed image and the input image show the same digit roughly half of the time. We found that ALI’s inferred latent variables not being effective for classification is a fairly robust result that holds across a variety of architectures for the inference network. For example, with 1024 units, we varied the number of fully-connected layers in ALI’s inference network between 2 and 8 and found that the classification accuracies on the MNIST validation set ranged from 89.4% to 91.0%. Using 6 layers with 2048 units on each layer and a 256 dimensional latent prior achieved 91.2% accuracy. This suggests that the weak performance of the latent variables for classification is due to ALI’s prior, and is probably not due to a lack of capacity in the inference network. Figure 3: Illustration of the distribution over inferred latent variables for real data points from the MNIST digits (0, 1, 9) learned with different models trained for roughly the same amount of time: GibbsNet with a determinstic decoder and the latent variables not given to the discriminator (a), GibbsNet with a stochastic decoder and the latent variables not given to the discriminator (b), ALI (c), GibbsNet with a deterministic decoder (f), GibbsNet with a stochastic decoder with two different runs (g and h), GibbsNet with a stochastic decoder’s inferred latent states in an unclamped chain at 1, 2 , 3, and 15 steps (d, e, i, and j, respectively) into the P-chain (d, e, i, and j, respectively). Note that we continue to see refinement in the marginal distribution of z when running for far more steps (15 steps) than we used during training (3 steps). 4.2 Inception Scores The GAN literature is limited in terms of quantitative evaluation, with none of the existing techniques (such as inception scores) being satisfactory (Theis et al., 2015). Nonetheless, we computed inception scores on CIFAR-10 using the standard method and code released from Salimans et al. (2016). In our experiments, we compared the inception scores from samples from Gibbsnet and ALI on two tasks, generation and inpainting. Our conclusion from the inception scores (Table 1) is that GibbsNet slightly improves sample quality but greatly improves the expressiveness of the latent space z, which leads to more detail being preserved in the inpainting chain and a much larger improvement in inception scores in this setting. The supplementary materials includes examples of sampling and inpainting chains for both ALI and GibbsNet which shows differences between sampling and inpainting quality that are consistent with the inception scores. Table 1: Inception Scores from different models. Inpainting results were achieved by fixing the left half of the image while running the chain for four steps. Sampling refers to unconditional sampling. Source Samples Inpainting Real Images 11.24 11.24 ALI (ours) 5.41 5.59 ALI (Dumoulin) 5.34 N/A GibbsNet 5.69 6.15 7 Figure 4: CIFAR samples on methods which learn transition operators. Non-Equilibrium Thermodynamics (Sohl-Dickstein et al., 2015) after 1000 steps (left) and GibbsNet after 20 steps (right). 4.3 Generation, Inpainting, and Learning the Image-Attribute Joint Distribution Generation Here, we compare generation on the CIFAR dataset against Non-Equilibrium Thermodynamics method (Sohl-Dickstein et al., 2015), which also begins its sampling procedure from noise. We show in Figure 4 that, even with a relatively small number of steps (20) in its sampling procedure, GibbsNet outperforms the Non-Equilibrium Thermodynamics approach in sample quality, even after many more steps (1000). Inpainting The inpainting that can be done with the transition operator in GibbsNet is stronger than what can be done with an explicit conditional generative model, such as Conditional GANs, which are only suited to inpainting when the conditioning information is known about during training or there is a strong prior over what types of conditioning will be performed at test time. We show here that GibbsNet performs more consistent and higher quality inpainting than ALI, even when the two networks share exactly the same architecture for p(x | z) and q(z | x) (Figure 5), which is consistent with our results on latent structure above. Joint generation Finally, we show that GibbsNet is able to learn the joint distribution between face images and their attributes (CelebA, Liu et al., 2015) (Figure 6). In this case, q(z | x, y) (y is the attribute) is a network that takes both the image and attribute, separately processing the two modalities before joining them into one network. p(x, y | z) is one network that splits into two networks to predict the modalities separately. Training was done with continuous boundary-seeking GAN (BGAN, Hjelm et al., 2017) on the image side (same as our other experiments) and discrete BGAN on the attribute side, which is an importance-sampling-based technique for training GANs with discrete data. 5 Conclusion We have introduced GibbsNet, a powerful new model for performing iterative inference and generation in deep graphical models. Although models like the RBM and the GSN have become less investigated in recent years, their theoretical properties worth pursuing, and we follow the theoretical motivations here using a GAN-like objective. With a training and sampling procedure that is closely related to undirected graphical models, GibbsNet is able to learn a joint distribution which converges in a very small number of steps of its Markov chain, and with no requirement that the marginal p(z) match a simple prior. We prove that at convergence of training, in spite of unrolling only a few steps of the chain during training, we obtain a transition operator whose stationary distribution also matches the data and makes the conditionals p(x | z) and q(z | x) consistent with that unique joint stationary distribution. We show that this allows the prior, p(z), to be shaped into a complicated distribution (not a simple one, e.g., a spherical Gaussian) where different classes have representations that are easily separable in the latent space. This leads to improved classification when the inferred latent variables q(z|x) are used directly. Finally, we show that GibbsNet’s flexible prior produces a flexible model which can simultaneously perform inpainting, conditional image generation, and prediction with a single model not explicitly trained for any of these specific tasks, outperforming a competitive ALI baseline with the same setup. 8 (a) SVHN inpainting after 20 steps (ALI). (b) SVHN inpainting after 20 steps (GibbsNet). Figure 5: Inpainting results on SVHN, where the right side is given and the left side is inpainted. In both cases our model’s trained procedure did not consider the inpainting or conditional generation task at all, and inpainting is done by repeatedly applying the transition operators and clamping the right side of the image to its observed value. GibbsNet’s richer latent space allows the transition operator to keep more of the structure of the input image, allowing for tighter inpainting. Figure 6: Demonstration of learning the joint distribution between images and a list of 40 binary attributes. Attributes (right) are generated from a multinomial distribution as part of the joint with the image (left). References Bengio, Y., Mesnil, G., Dauphin, Y., and Rifai, S. (2012). Better mixing via deep representations. CoRR, abs/1207.4404. Bengio, Y., Thibodeau-Laufer, E., and Yosinski, J. (2013). Deep generative stochastic networks trainable by backprop. CoRR, abs/1306.1091. Bornschein, J., Shabanian, S., Fischer, A., and Bengio, Y. (2015). Training opposing directed models using geometric mean matching. CoRR, abs/1506.03877. Dayan, P., Hinton, G. E., Neal, R. M., and Zemel, R. S. (1995). The helmholtz machine. Neural computation, 7(5):889–904. Dempster, A. P., Laird, N. M., and Rubin, D. B. (1977). Maximum likelihood from incomplete data via the em algorithm. Journal of the royal statistical society. Series B (methodological), pages 1–38. Donahue, J., Krähenbühl, P., and Darrell, T. (2017). Adversarial feature learning. In Proceedings of the International Conference on Learning Representations (ICLR). abs/1605.09782. Dumoulin, V., Belghazi, I., Poole, B., Lamb, A., Arjovsky, M., Mastropietro, O., and Courville, A. (2017). Adversarially learned inference. In Proceedings of the International Conference on Learning Representations (ICLR). arXiv:1606.00704. 9 Goodfellow, I. (2016). Nips 2016 tutorial: Generative adversarial networks. arXiv preprint arXiv:1701.00160. Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680. Hinton, G. (2010). A practical guide to training restricted boltzmann machines. Momentum, 9(1):926. Hinton, G. E., Osindero, S., and Teh, Y.-W. (2006). A fast learning algorithm for deep belief nets. Neural computation, 18(7):1527–1554. Hjelm, D., Salakhutdinov, R. R., Cho, K., Jojic, N., Calhoun, V., and Chung, J. (2016). Iterative refinement of the approximate posterior for directed belief networks. In Advances in Neural Information Processing Systems, pages 4691–4699. Hjelm, R. D., Jacob, A. P., Che, T., Cho, K., and Bengio, Y. (2017). Boundary-seeking generative adversarial networks. arXiv preprint arXiv:1702.08431. Huszár, F. (2017). Variational Inference using Implicit Distributions. ArXiv e-prints. Kingma, D. P. and Welling, M. (2013). Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114. Lamb, A., Goyal, A., Zhang, Y., Zhang, S., Courville, A., and Bengio, Y. (2016). Professor forcing: A new algorithm for training recurrent networks. Neural Information Processing Systems (NIPS) 2016. Larsen, A. B. L., Sønderby, S. K., and Winther, O. (2015). Autoencoding beyond pixels using a learned similarity metric. CoRR, abs/1512.09300. Liu, Z., Luo, P., Wang, X., and Tang, X. (2015). Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV). Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., and Ng, A. Y. (2011). Reading digits in natural images with unsupervised feature learning. In NIPS workshop on deep learning and unsupervised feature learning, volume 2011, page 5. Radford, A., Metz, L., and Chintala, S. (2015). Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434. Rezende, D. J. and Mohamed, S. (2015). Variational inference with normalizing flows. arXiv preprint arXiv:1505.05770. Salakhutdinov, R. and Hinton, G. (2009). Deep boltzmann machines. In Artificial Intelligence and Statistics, pages 448–455. Salimans, T., Goodfellow, I. J., Zaremba, W., Cheung, V., Radford, A., and Chen, X. (2016). Improved techniques for training gans. CoRR, abs/1606.03498. Sohl-Dickstein, J., Weiss, E. A., Maheswaranathan, N., and Ganguli, S. (2015). Deep unsupervised learning using nonequilibrium thermodynamics. CoRR, abs/1503.03585. Song, J., Zhao, S., and Ermon, S. (2017). Generative adversarial learning of markov chains. ICLR Workshop Track. Theis, L., van den Oord, A., and Bethge, M. (2015). A note on the evaluation of generative models. ArXiv e-prints. Vincent, P., Larochelle, H., Bengio, Y., and Manzagol, P.-A. (2008). Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pages 1096–1103. ACM. 10
2017
129
6,596
Scalable L´evy Process Priors for Spectral Kernel Learning Phillip A. Jang Andrew E. Loeb Matthew B. Davidow Andrew Gordon Wilson Cornell University Abstract Gaussian processes are rich distributions over functions, with generalization properties determined by a kernel function. When used for long-range extrapolation, predictions are particularly sensitive to the choice of kernel parameters. It is therefore critical to account for kernel uncertainty in our predictive distributions. We propose a distribution over kernels formed by modelling a spectral mixture density with a L´evy process. The resulting distribution has support for all stationary covariances—including the popular RBF, periodic, and Mat´ern kernels— combined with inductive biases which enable automatic and data efficient learning, long-range extrapolation, and state of the art predictive performance. The proposed model also presents an approach to spectral regularization, as the L´evy process introduces a sparsity-inducing prior over mixture components, allowing automatic selection over model order and pruning of extraneous components. We exploit the algebraic structure of the proposed process for O(n) training and O(1) predictions. We perform extrapolations having reasonable uncertainty estimates on several benchmarks, show that the proposed model can recover flexible ground truth covariances and that it is robust to errors in initialization. 1 Introduction Gaussian processes (GPs) naturally give rise to a function space view of modelling, whereby we place a prior distribution over functions, and reason about the properties of likely functions under this prior (Rasmussen & Williams, 2006). Given data, we then infer a posterior distribution over functions to make predictions. The generalisation behavior of the Gaussian process is determined by its prior support (which functions are a priori possible) and its inductive biases (which functions are a priori likely), which are in turn encoded by a kernel function. However, popular kernels, and even multiple kernel learning procedures, typically cannot extract highly expressive hidden representations, as was envisaged for neural networks (MacKay, 1998; Wilson, 2014). To discover such representations, recent approaches have advocated building more expressive kernel functions. For instance, spectral mixture kernels (Wilson & Adams, 2013b) were introduced for flexible kernel learning and extrapolation, by modelling a spectral density with a scale-location mixture of Gaussians, with promising results. However, Wilson & Adams (2013b) specify the number of mixture components by hand, and do not characterize uncertainty over the mixture hyperparameters. As kernel functions become increasingly expressive and parametrized, it becomes natural to also adopt a function space view of kernel learning—to represent uncertainty over the values of the kernel function, and to reflect the belief that the kernel does not have a simple form. Just as we use Gaussian processes over functions to model data, we can apply the function space view a step further in a hierarchical model—with a prior distribution over kernels. In this paper, we introduce a scalable distribution over kernels by modelling a spectral density, the Fourier transform of a kernel, with a L´evy process. We consider both scale-location mixtures of Gaussians and Laplacians as basis functions for the L´evy process, to induce a prior over kernels that 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. gives rise to the sharply peaked spectral densities that often occur in practice—providing a powerful inductive bias for kernel learning. Moreover, this choice of basis functions allows our kernel function, conditioned on the L´evy process, to be expressed in closed form. This prior distribution over kernels also has support for all stationary covariances—containing, for instance, any composition of the popular RBF, Mat´ern, rational quadratic, gamma-exponential, or spectral mixture kernels. And unlike the spectral mixture representation in Wilson & Adams (2013b), this proposed process prior allows for natural automatic inference over the number of mixture components in the spectral density model. Moreover, the priors implied by popular L´evy processes such as the gamma process and symmetric α-stable process result in even stronger complexity penalties than ℓ1 regularization, yielding sparse representations and removing mixture components which fit to noise. Conditioned on this distribution over kernels, we model data with a Gaussian process. To form a predictive distribution, we take a Bayesian model average of GP predictive distributions over a large set of possible kernel functions, represented by the support of our prior over kernels, weighted by the posterior probabilities of each of these kernels. This procedure leads to a non-Gaussian heavytailed predictive distribution for modelling data. We develop a reversible jump MCMC (RJ-MCMC) scheme (Green, 1995) to infer the posterior distribution over kernels, including inference over the number of components in the L´evy process expansion. For scalability, we pursue a structured kernel interpolation (Wilson & Nickisch, 2015) approach, in our case exploiting algebraic structure in the L´evy process expansion, for O(n) inference and O(1) predictions, compared to the standard O(n3) and O(n2) computations for inference and predictions with Gaussian processes. Flexible distributions over kernels will be especially valuable on large datasets, which often contain additional structure to learn rich statistical representations. The key contributions of this paper are summarized as follows: 1. The first fully probabilistic approach to inference with spectral mixture kernels — to incorporate kernel uncertainty into our predictive distributions, for a more realistic coverage of extrapolations. This feature is demonstrated in Section 5.3. 2. Spectral regularization in spectral kernel learning. The L´evy process prior acts as a sparsityinducing prior on mixture components, automatically pruning extraneous components. This feature allows for automatic inference over model order, a key hyperparameter which must be hand tuned in the original spectral mixture kernel paper. 3. Reduced dependence on a good initialization, a key practical improvement over the original spectral mixture kernel paper. 4. A conceptually natural and interpretable function space view of kernel learning. 2 Background We provide a review of Gaussian and L´evy processes as models for prior distributions over functions. 2.1 Gaussian Processes A stochastic process f(x) is a Gaussian process (GP) if for any finite collection of inputs X = {x1, · · · , xn} ⊂RD, the vector of function values [f(x1), · · · , f(xn)]T is jointly Gaussian. The distribution of a GP is completely determined by its mean function m(x), and covariance kernel k(x, x′). A GP used to specify a distribution over functions is denoted as f(x) ∼ GP(m(x), k(x, x′)), where E[f(xi)] = m(xi) and cov(f(x), f(x′)) = k(x, x′). The generalization properties of the GP are encoded by the covariance kernel and its hyperparameters. By exploiting properties of joint Gaussian variables, we can obtain closed form expressions for conditional mean and covariance functions of unobserved function values given observed function values. Given that f(x) is observed at n training inputs X with values f = [f(x1), · · · , f(xn)]T , the predictive distribution of the unobserved function values f∗at n∗testing inputs X∗is given by f∗|X∗, X, θ ∼N(¯f∗, cov(f∗)), (1) ¯f∗= mX∗+ KX∗,XK−1 X,X(f −mX), (2) cov(f∗) = KX∗,X∗−KX∗,XK−1 X,XKX,X∗. (3) where KX∗,X for example denotes the n∗× n matrix of covariances evaluated at X∗and X. 2 The popular radial basis function (RBF) kernel has the following form: kRBF(x, x′) = exp(−0.5 ∥x −x′∥2 /ℓ2). (4) GPs with RBF kernels are limited in their expressiveness and act primarily as smoothing interpolators, because the only covariance structure they can learn from data is the length scale ℓ, which determines how quickly covariance decays with distance. Wilson & Adams (2013b) introduce the more expressive spectral mixture (SM) kernel capable of extracting more complex covariance structures than the RBF kernel, formed by placing a scale-location mixture of Gaussians in the spectrum of the covariance kernel. The RBF kernel in comparison can only model a single Gaussian centered at the origin in frequency (spectral) space. 2.2 L´evy Processes A stochastic process {L(ω)}ω∈R+ is a L´evy process if it has stationary, independent increments and it is continuous in probability. In other words, L must satisfy 1. L(0) = 0, 2. L(ω0), L(ω1) −L(ω0), · · · , L(ωn) −L(ωn−1) are independent ∀ω0 ≤ω1 ≤· · · ≤ωn, 3. L(ω2) −L(ω1) d= L(ω2 −ω1) ∀ω2 ≥ω1, 4. lim h→0 P(|L(ω + h) −L(ω)| ≥ε) = 0 ∀ε > 0 ∀ω ≥0. 0 2 4 6 8 10 x -5 0 5 10 15 f(x) β1 β2 β3 ω1 ω2 ω3 Figure 1: Annotated realization of a compound Poisson process, a special case of a L´evy process. The ωj represent jump locations, and βj represent jump magnitudes. By the L´evy-Khintchine representation, the distribution of a (pure jump) L´evy process is completely determined by its L´evy measure. That is, the characteristic function of L(ω) is given by: log E[eiuL(ω)] = ω Z Rd\{0} eiu·β −1 −iu · β1|β|≤1  ν(dβ). where the L´evy measure ν(dβ) is any σ-finite measure which satisfies the following integrability condition Z Rd\{0} (1 ∧β2)ν(dβ) < ∞. A L´evy process can be viewed as a combination of a Brownian motion with drift and a superposition of independent Poisson processes with differing jump sizes β. The L´evy measure ν(dβ) determines the expected number of Poisson events per unit of time for any particular jump size β. The Brownian component of a L´evy process will not be considered for this model. For higher dimension input spaces ω ∈Ω, one defines the more general notion of L´evy random measure, which is also characterized by its L´evy measure ν(dβdω) (Wolpert et al., 2011) . We will show that the sample realizations of L´evy processes can be used to draw sample parameters for adaptive basis expansions. 2.3 L´evy Process Priors over Adaptive Expansions Suppose we wish to specify a prior over the class of adaptive expansions: n f : X →R f(x) = PJ j=1 βjφ(x, ωj) o . Through a simple manipulation, we can rewrite f(x) into the form of a stochastic integral: f(x) = J X j=1 βjφ(x, ωj) = J X j=1 βj Z Ω φ(x, ω)δωj(ω)dω = Z Ω φ(x, ω) J X j=1 βjδωj(ω)dω | {z } =dL(ω) . Hence, by specifying a prior for the measure L(ω), we can simultaneously specify a prior for all of the parameters {J, (β1, ω1), ..., (βJ, ωJ)} of the expansion. L´evy random measures provide a 3 family of priors naturally suited for this purpose, as there is a one-to-one correspondence between the jump behavior of the L´evy prior and the components of the expansion. To illustrate this point, suppose the basis function parameters ωj are one-dimensional and consider the integral of dL(ω) from 0 to ω. L(ω) = Z ω 0 dL(ξ) = Z ω 0 J X j=1 βjδωj(ξ)dξ = J X j=1 βj1[0,ω](ωj). We see in Figure 1 that PJ j=1 βj1[0,ω](ωj) resembles the sample path of a compound Poisson process, with the number of jumps J, jump sizes βj, and jump locations ωj corresponding to the number of basis functions, basis function weights, and basis function parameters respectively. We can use a compound Poisson process to define a prior over all such piecewise constant paths. More generally, we can use a L´evy process to define a prior for L(ω). Through the L´evy-Khintchine representation, the jump behavior of the prior is characterized by a L´evy measure ν(dβdω) which controls the mean number of Poisson events in every region of the parameter space, encoding the inductive biases of the model. As the number of parameters in this framework is random, we use a form of trans-dimensional reversible jump Markov chain Monte Carlo (RJ-MCMC) to sample the parameter space (Green, 2003). Popular L´evy processes such as the gamma process, symmetric gamma process, and the symmetric α-stable process each possess desirable properties for different situations. The gamma process is able to produce strictly positive gamma distributed βj without transforming the output space. The symmetric gamma process can produce both positive and negative βj, and according to Wolpert et al. (2011) can achieve nearly all the commonly used isotropic geostatistical covariance functions. The symmetric α-stable process can produce heavy-tailed distributions for βj and is appropriate when one might expect the basis expansion to be dominated by a few heavily weighted functions. While one could dispense with L´evy processes and place Gaussian or Laplace priors on βj to obtain ℓ2 or ℓ1 regularization on the expansions, respectively, a key benefit particular to these L´evy process priors are that the implied priors on the coefficients yield even stronger complexity penalties than ℓ1 regularization. This property encourages sparsity in the expansions and permits scalability of our MCMC algorithm. Refer to the supplementary material for an illustration of the joint priors on coefficients, which exhibit concave contours in contrast to the convex elliptical and diamond contours of ℓ2 and ℓ1 regularization. Furthermore, in the log posterior for the L´evy process there is a log(J!) complexity penalty term which further encourages sparsity in the expansions. Refer to Clyde & Wolpert (2007) for further details. 3 L´evy Distributions over Kernels In this section, we motivate our choice of prior over kernel functions and describe how to generate samples from this prior distribution in practice. 3.1 L´evy Kernel Processes By Bochner’s Theorem (1959), a continuous stationary kernel can be represented as the Fourier dual of a spectral density: k(τ) = Z RD S(s)e2πis⊤τds, S(s) = Z RD k(τ)e−2πis⊤τdτ. (5) Hence, the spectral density entirely characterizes a stationary kernel. Therefore, it can be desirable to model the spectrum rather than the kernel, since we can then view kernel estimation through the lens of density estimation. In order to emulate the sharp peaks that characterize frequency spectra of natural phenomena, we model the spectral density with a location-scale mixture of Laplacian components: φL(s, ωj) = λj 2 e−λj|s−χj|, ωj ≡(χj, λj) ∈[0, fmax] × R+. (6) Then the full specification of the symmetric spectral mixture is S(s) = 1 2 h ˜S(s) + ˜S(−s) i , ˜S(s) = J X j=1 βjφL(s, ωj). (7) 4 As Laplacian spikes have a closed form inverse Fourier transform, the spectral density S(s) represents the following kernel function: k(τ) = J X j=1 βj λ2 j λ2 j + 4π2τ 2 cos(2πχjτ). (8) The parameters J, βj, χj, λj can be interpreted through Eq. (8). The total number of terms to the mixture is J, while βj is the scale of the jth frequency contribution, χj is its central frequency, and λj governs how rapidly the term decays (a high λ results in confident, long-term periodic extrapolation). Other basis functions can be used in place of φL to model the spectrum as well. For example, if a Gaussian mixture is chosen, along with maximum likelihood estimation for the learning procedure, then we obtain the spectral mixture kernel (Wilson & Adams, 2013b). As the spectral density S(s) takes the form of an adaptive expansion, we can define a L´evy prior over all such densities and hence all corresponding kernels of the above form. For a chosen basis function φ(s, ω) and L´evy measure ν(dβdω) we say that k(τ) is drawn from a L´evy kernel process (LKP), denoted as k(τ) ∼ LKP(φ, ν). Wolpert et al. (2011) discuss the necessary regularity conditions for φ and ν. In summary, we propose the following hierarchical model over functions f(x)|k(τ) ∼GP(0, k(τ)), τ = x −x′, k(τ) ∼LKP(φ, ν). (9) 0 0.05 0.1 0.15 0.2 Frequency 0 2 4 Power 0 0.05 0.1 0.15 0.2 Frequency 0 0.5 1 Power 0 0.05 0.1 0.15 0.2 Frequency 0 0.5 1 1.5 Power 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 τ -0.1 0 0.1 0.2 K(τ) 0 2 4 6 8 10 12 14 16 18 20 X -0.5 0 0.5 f(X) Figure 2: Samples from a L´evy kernel mixture prior distribution. (top) Three spectra with Laplace components drawn from a L´evy process prior. (middle) The corresponding stationary covariance kernel functions and the prior mean with two standard deviations of the model, as determined by 10,000 samples. (bottom) GP samples with the respective covariance kernel functions. Figure 2 shows three samples from the L´evy process specified through Eq. (7) and their corresponding covariance kernels. We also show one GP realization for each of the kernel functions. By placing a L´evy process prior over spectral densities, we induce a L´evy kernel process prior over stationary covariance functions. 3.2 Sampling L´evy Priors We now discuss how to generate samples from the L´evy kernel process in practice. In short, the kernel parameters are drawn according to {J, {(βj, ωj)}J j=1} ∼L´evy(ν(dβdω)), and then Eq. (8) is used to evaluate k ∼ LKP(φL, ν) at values of τ. Recall from Section 2.3 that the choice of L´evy measure ν is completely determined by the choice of the corresponding L´evy process and vice versa. Though the processes mentioned there produce sample paths with infinitely many jumps (and cannot be sampled directly), almost all jumps are infinitesimally small, and therefore these processes can be approximated in L2 by a compound Poisson process with a jump size distribution truncated by ε. Once the desired L´evy process is chosen and the truncation bound is set, the basis expansion parameters are generated by drawing J ∼Poisson(ν+ ε ), and then drawing J i.i.d. samples β1, · · · , βJ ∼πβ(dβ), and J i.i.d. samples ω1, · · · , ωJ ∼πω(dω). Refer to the supplementary material for L2 error bounds and formulas for ν+ ε = νε(R × Ω) for the gamma, symmetric gamma, and symmetric α-stable processes. The form of πβ(βj) also depends on the choice of L´evy process and can be found in the supplementary material, with further details in Wolpert et al. (2011). We choose to draw χ from an uninformed uniform prior over a reasonable range in the frequency domain, and λ from a gamma distribution, λ ∼Gamma(aλ, bλ). The choices for aλ, bλ, and the frequency limits are left as hyperparameters, which can have their own hyperprior distributions. After drawing the 3J values that specify 5 a L´evy process realization, the corresponding covariance function can be evaluated through the analytical expression for the inverse Fourier transform (e.g. Eq. (8) for Laplacian frequency mixture components). 4 Scalable Inference Given observed data D = {xi, yi}N i=1, we wish to infer p(y(x∗)|D, x∗) over some test set of inputs x∗for interpolation and extrapolation. We model observations y(x) with a hierarchical model: y(x)|f(x) = f(x) + ε(x), ε(x) iid∼N(0, σ2), (10) f(x)|k(τ) ∼GP(0, k(τ)), τ = x −x′, (11) k(τ) ∼LKP(φ, ν). (12) Computing the posterior distributions by marginalizing over the LKP will yield a heavy-tailed nonGaussian process for y(x∗) = y∗given by an infinite Gaussian mixture model: p(y∗|D) = Z p(y∗|k, D)p(k|D)dk ≈1 H H X h=1 p(y∗|kh), kh ∼p(k|D). (13) We compute this approximating sum using H RJ-MCMC samples (Green, 2003). Each sample draws a kernel from the posterior kh ∼p(k|D) distribution. Each sample of kh enables us to draw a sample from the posterior predictive distribution p(y∗|D), from which we can estimate the predictive mean and variance. Although we have chosen a Gaussian observation model in Eq. (10) (conditioned on f(x)), all of the inference procedures we have introduced here would also apply to non-Gaussian likelihoods, such as for Poisson processes with Gaussian process intensity functions, or classification. The sum in Eq. (13) requires drawing kernels from the distribution p(k|D). This is a difficult distribution to approximate, particularly because there is not a fixed number of parameters as J varies. We employ RJ-MCMC, which extends the capability of conventional MCMC to allow sequential samples of different dimensions to be drawn (Green, 2003). Thus, a posterior distribution is not limited to coefficients and other parameters of a fixed basis expansion, but can represent a changing number of basis functions, as required by the description of L´evy processes described in the previous section. Indeed, RJ-MCMC can be used to automatically learn the appropriate number of basis functions in an expansion. In the case of spectral kernel learning, inferring the number of basis functions corresponds to automatically learning the important frequency contributions to a GP kernel, which can lead to new interpretable insights into our data. 4.1 Initialization Considerations The choice of an initialization procedure is often an important practical consideration for machine learning tasks due to severe multimodality in a likelihood surface (Neal, 1996). In many cases, however, we find that spectral kernel learning with RJ-MCMC can automatically learn salient frequency contributions with a simple initialization, such as a uniform covering over a broad range of frequencies with many sharp peaks. The frequencies which are not important in describing the data are quickly attenuated or removed within RJ-MCMC learning. Typically only a few hundred RJ-MCMC iterations are needed to discover the salient frequencies in this way. Wilson (2014) proposes an alternative structured approach to initialization in previous spectral kernel modelling work. First, pass the (squared) data through a Fourier transform to obtain an empirical spectral density, which can be treated as observed. Next, fit the empirical spectral density using a standard Gaussian mixture density estimation procedure, assuming a fixed number of mixture components. Then, use the learned parameters of the Gaussian mixture as an initialization of the spectral mixture kernel hyperparameters, for Gaussian process marginal likelihood optimization. We observe successful adaptation of this procedure to our L´evy process method, replacing the approximation with Laplacian mixture terms and using the result to initialize RJ-MCMC. 4.2 Scalability As with other GP based kernel methods, the computational bottleneck lies in the evaluation of the log marginal likelihood during MCMC, which requires computing (KX,X + σ2I)−1y and 6 log |KX,X + σ2I| for an n × n kernel matrix KX,X evaluated at the n training points X. A direct approach through computing the Cholesky decomposition of the kernel matrix requires O(n3) computations and O(n2) storage, restricting the size of training sets to O(104). Furthermore, this computation must be performed at every iteration of RJ-MCMC, compounding standard computational constraints. However, this bottleneck can be readily overcome through the Structured Kernel Interpolation approach introduced in Wilson & Nickisch (2015), which approximates the kernel matrix as ˜KX,X′ = MXKZ,ZM ⊤ X′ for an exact kernel matrix KZ,Z evaluated on a much smaller set of m ≪n inducing points, and a sparse interpolation matrix MX which facilitates fast computations. The calculation reduces to O(n + g(m)) computations and O(n + g(m)) storage. As described in Wilson & Nickisch (2015), we can impose Toeplitz structure on KZ,Z for g(m) = m log m, allowing our RJ-MCMC procedure to train on massive datasets. 5 Experiments We conduct four experiments in total. In order to motivate our model for kernel learning in later experiments, we first demonstrate the ability of a L´evy process to recover—through direct regression—an observed noise-contaminated spectrum that is characteristic of sharply peaked naturally occurring spectra. In the second experiment we demonstrate the robustness of our RJMCMC sampler by automatically recovering the generative frequencies of a known kernel, even in presence of significant noise contamination and poor initializations. In the third experiment we demonstrate the ability of our method to infer the spectrum of airline passenger data, to perform long-range extrapolations on real data, and to demonstrate the utility of accounting for uncertainty in the kernel. In the final experiment we demonstrate the scalability of our method through training the model on a 100,000 data point sound waveform. Code is available at https: //github.com/pjang23/levy-spectral-kernel-learning. 5.1 Explicit Spectrum Modelling 0 1 2 3 4 5 6 7 8 9 10 x 0 10 20 30 40 50 f(x) Figure 3: L´evy process regression on a noisy test function (black). The fit (red) captures the locations and scales of each spike while ignoring noise, but falls slightly short at its modes since the black spikes are parameterized as (1 + |x|)−4 rather than Laplacian. We begin by applying a L´evy process directly for function modelling (known as LARK regression), with inference as described in Wolpert et al. (2011), and Laplacian basis functions. We choose an out of class test function proposed by Donoho & Johnstone (1993) that is standard in wavelet literature. The spatially inhomogeneous function is defined to represent spectral densities that arise in scientific and engineering applications. Gaussian i.i.d. noise is added to give a signal-to-noise ratio of 7, to be consistent with previous studies of the test function Wolpert et al. (2011). The noisy test function and LARK regression fit are shown in Figure 3. The synthetic spectrum is well characterized by the L´evy process, with no “false positive” basis function terms fitting the noise owing to the strong regularization properties of the L´evy prior. By contrast, GP regression with an RBF kernel learns a length scale of 0.07 through maximum marginal likelihood training: the Gaussian process posterior can fit the sharp peaks in the test function only if it also overfits to the additive noise. The point of this experiment is to show that the L´evy process with Laplacian basis functions forms a natural prior over spectral densities. In other words, samples from this prior will typically look like the types of spectra that occur in practice. Thus, this process will have a powerful inductive bias when used for kernel learning, which we explore in the next experiments. 7 5.2 Ground Truth Recovery 0 0.2 0.4 Frequency 100 200 300 400 Power 0 10 20 30 40 50 X -10 -5 0 5 f(X) Figure 4: Ground truth recovery of known frequency components. (left) The spectrum of the Gaussian process that was used to generate the noisy training data is shown in black. From these noisy data and the erroneous spectral initialization shown in dashed blue, the maximum a posteriori estimate of the spectral density (over 1000 RJMCMC steps) is shown in red. A SM kernel also identifies the salient frequencies, but with broader support, shown in magenta. (right) Noisy training data are shown with a scatterplot, with withheld testing data shown in green. The learned posterior predictive distribution (mean in black, with 95% credible set in grey) captures the test data. We next demonstrate the ability of our method to recover the generative frequencies of a known kernel and its robustness to noise and poor initializations. Data are generated from a GP with a kernel having two spectral Laplacian peaks, and partitioned into training and testing sets containing 256 points each. Moreover, the training data are contaminated with i.i.d. Gaussian noise (signal-to-noise ratio of 85%). Based on these observed training data (depicted as black dots in Figure 4, right), we estimate the kernel of the Gaussian process by inferring its spectral density (Figure 4, left) using 1000 RJ-MCMC iterations. The empirical spectrum initialization described in section 4.1 results in the discovery of the two generative frequencies. Critically, we can also recover these salient frequencies even with a very poor initialization, as shown in Figure 4 (left). For comparison, we also train a Gaussian SM kernel, initializing based on the empirical spectrum. The resulting kernel spectrum (Figure 4, magenta curve) does recover the salient frequencies, though with less confidence and higher overhead than even a poor initialization and spectral kernel learning with RJ-MCMC. 5.3 Spectral Kernel Learning for Long-Range Extrapolation Figure 5: Learning of Airline passenger data. Training data is scatter plotted, with withheld testing data shown in green. The learned posterior distribution with the proposed approach (mean in black, with 95% credible set in grey) captures the periodicity and the rising trend in the test data. The analogous 95% interval using a GP with a SM kernel is illustrated in magenta. We next demonstrate the ability of our method to perform long-range extrapolation on real data. Figure 5 shows a time series of monthly airline passenger data from 1949 to 1961 (Hyndman, 2005). The data show a long-term rising trend as well as a short term seasonal waveform, and an absence of white noise artifacts. As with Wilson & Adams (2013b), the first 96 monthly data points are used to train the model and the last 48 months (4 years) are withheld as testing data, indicated in green. With an initialization from the empirical spectrum and 2500 RJ-MCMC steps, the model is able to automatically learn the necessary frequencies and the shape of the spectral density to capture both the rising trend and the seasonal waveform, allowing for accurate long-range extrapolations without pre-specifying the number of model components in advance. This experiment also demonstrates the impact of accounting for uncertainty in the kernel, as the withheld data often appears near or crosses the upper bound of the 95% predictive bands of the SM fit, whereas our model yields wider and more conservative predictive bands that wholly capture the test data. As the SM extrapolations are highly sensitive to the choice of parameter values, fixing the parameters of the kernel will yield overconfident predictions. The L´evy process prior allows us to account for a range of possible kernel parameters so we can achieve a more realistically broad coverage of possible extrapolations. Note that the L´evy process over spectral densities induces a prior over kernel functions. Figure 6 shows a side-by-side comparison of covariance function draws from the prior and posterior distributions over kernels. We see that sample covariance functions from the prior vary quite significantly, but are concentrated in the posterior, with movement towards the empirical covariance function. 8 Figure 6: Covariance function draws from the kernel prior (left) and posterior (right) distributions, with the empirical covariance function shown in black. After RJ-MCMC, the covariance distribution centers upon the correct frequencies and order of magnitude. 5.4 Scalability Demonstration 0.008 0.009 0.01 0.011 0.012 0.013 0.014 0.015 X (Seconds) -0.4 -0.2 0 0.2 0.4 f(X) Figure 7: Learning of a natural sound texture. A close-up of the training interval is displayed with the true waveform data scatter plotted. The learned posterior distribution (mean in black, with 95% credible set in grey) retains the periodicity of the signal within the corrupted interval. Three samples are drawn from the posterior distribution. A flexible and fully Bayesian approach to kernel learning can come with some additional computational overhead. Here we demonstrate the scalability that is achieved through the integration of SKI (Wilson & Nickisch, 2015) with our L´evy process model. We consider a 100,000 data point waveform, taken from the field of natural sound modelling (Turner, 2010). A L´evy kernel process is trained on a sound texture sample of howling wind with the middle 10% removed. Training involved initialization from the signal empirical covariance and 500 RJ-MCMC samples, and took less than one hour using an Intel i7 3.4 GHz CPU and 8 GB of memory. Four distinct mixture components in the model were automatically identified through the RJ-MCMC procedure. The learned kernel is then used for GP infilling with 900 training points, taken by down-sampling the training data, which is then applied to the original 44,100 Hz natural sound file for infilling. The GP posterior distribution over the region of interest is shown in Figure 7, along with sample realizations, which appear to capture the qualitative behavior of the waveform. This experiment demonstrates the applicability of our proposed kernel learning method to large datasets, and shows promise for extensions to higher dimensional data. 6 Discussion We introduced a distribution over covariance kernel functions that is well suited for modelling quasiperiodic data. We have shown how to place a L´evy process prior over the spectral density of a stationary kernel. The resulting hierarchical model allows the incorporation of kernel uncertainty into the predictive distribution. Through the spectral regularization properties of L´evy process priors, we found that our trans-dimensional sampling procedure is suitable for automatically performing inference over model order, and is robust over initialization strategies. Finally, we incorporated structured kernel interpolation into our training and inference procedures for linear time scalability, enabling experiments on large datasets. The key advances over conventional spectral mixture kernels are in being able to interpretably and automatically discover the number of mixture components, and in representing uncertainty over the kernel. Here, we considered one dimensional inputs and stationary processes to most clearly elucidate the key properties of L´evy kernel processes. However, one could generalize this process to multidimensional non-stationary kernel learning by jointly inferring properties of transformations over inputs alongside the kernel hyperparameters. Alternatively, one could consider neural networks as basis functions in the L´evy process, inferring distributions over the parameters of the network and the numbers of basis functions as a step towards automating neural network architecture construction. 9 Acknowledgements. This work is supported in part by the Natural Sciences and Engineering Research Council of Canada (PGS-D 502888) and the National Science Foundation DGE 1144153 and IIS-1563887 awards. References Bochner, S. Lectures on Fourier Integrals.(AM-42), volume 42. Princeton University Press, 1959. Clyde, Merlise A and Wolpert, Robert L. Nonparametric function estimation using overcomplete dictionaries. Bayesian Statistics, 8:91–114, 2007. Donoho, D. and Johnstone, J.M. Ideal spatial adaptation by wavelet shrinkage. Biometrika, 81(3): 425–455, 1993. Green, P.J. Reversible jump monte carlo computation and bayesian model determination. Biometrika, 89(4):711–732, 1995. Green, P.J. Trans-dimensional Markov chain Monte Carlo, chapter 6. Oxford University Press, 2003. Hyndman, R.J. Time series data library. 2005. http://www-personal.buseco.monash. edu.au/˜hyndman/TSDL/. MacKay, David J.C. Introduction to Gaussian processes. In Bishop, Christopher M. (ed.), Neural Networks and Machine Learning, chapter 11, pp. 133–165. Springer-Verlag, 1998. Micchelli, Charles A, Xu, Yuesheng, and Zhang, Haizhang. Universal kernels. Journal of Machine Learning Research, 7(Dec):2651–2667, 2006. Neal, R.M. Bayesian Learning for Neural Networks. Springer Verlag, 1996. ISBN 0387947248. Rasmussen, C. E. and Williams, C. K. I. Gaussian processes for Machine Learning. The MIT Press, 2006. Turner, R. Statistical models for natural sounds. PhD thesis, University College London, 2010. Wilson, A.G. and Adams, R.P. Gaussian process kernels for pattern discovery and extrapolation supplementary material and code. 2013a. http://mlg.eng.cam.ac.uk/andrew/ smkernelsupp.pdf. Wilson, Andrew Gordon. Covariance kernels for fast automatic pattern discovery and extrapolation with Gaussian processes. PhD thesis, University of Cambridge, 2014. Wilson, Andrew Gordon and Adams, Ryan Prescott. Gaussian process kernels for pattern discovery and extrapolation. International Conference on Machine Learning (ICML), 2013b. Wilson, Andrew Gordon and Nickisch, Hannes. Kernel interpolation for scalable structured Gaussian processes (KISS-GP). International Conference on Machine Learning (ICML), 2015. Wolpert, R.L., Clyde, M.A., and Tu, C. Stochastic expansions using continuous dictionaries: L´evy adaptive regression kernels. The Annals of Statistics, 39(4):1916–1962, 2011. 10
2017
13
6,597
Bayesian GAN Yunus Saatchi Uber AI Labs Andrew Gordon Wilson Cornell University Abstract Generative adversarial networks (GANs) can implicitly learn rich distributions over images, audio, and data which are hard to model with an explicit likelihood. We present a practical Bayesian formulation for unsupervised and semi-supervised learning with GANs. Within this framework, we use stochastic gradient Hamiltonian Monte Carlo to marginalize the weights of the generator and discriminator networks. The resulting approach is straightforward and obtains good performance without any standard interventions such as label smoothing or mini-batch discrimination. By exploring an expressive posterior over the parameters of the generator, the Bayesian GAN avoids mode-collapse, produces interpretable and diverse candidate samples, and provides state-of-the-art quantitative results for semi-supervised learning on benchmarks including SVHN, CelebA, and CIFAR-10, outperforming DCGAN, Wasserstein GANs, and DCGAN ensembles. 1 Introduction Learning a good generative model for high-dimensional natural signals, such as images, video and audio has long been one of the key milestones of machine learning. Powered by the learning capabilities of deep neural networks, generative adversarial networks (GANs) [4] and variational autoencoders [6] have brought the field closer to attaining this goal. GANs transform white noise through a deep neural network to generate candidate samples from a data distribution. A discriminator learns, in a supervised manner, how to tune its parameters so as to correctly classify whether a given sample has come from the generator or the true data distribution. Meanwhile, the generator updates its parameters so as to fool the discriminator. As long as the generator has sufficient capacity, it can approximate the CDF inverse-CDF composition required to sample from a data distribution of interest. Since convolutional neural networks by design provide reasonable metrics over images (unlike, for instance, Gaussian likelihoods), GANs using convolutional neural networks can in turn provide a compelling implicit distribution over images. Although GANs have been highly impactful, their learning objective can lead to mode collapse, where the generator simply memorizes a few training examples to fool the discriminator. This pathology is reminiscent of maximum likelihood density estimation with Gaussian mixtures: by collapsing the variance of each component we achieve infinite likelihood and memorize the dataset, which is not useful for a generalizable density estimate. Moreover, a large degree of intervention is required to stabilize GAN training, including label smoothing and mini-batch discrimination [9, 10]. To help alleviate these practical difficulties, recent work has focused on replacing the Jensen-Shannon divergence implicit in standard GAN training with alternative metrics, such as f-divergences [8] or Wasserstein divergences [1]. Much of this work is analogous to introducing various regularizers for maximum likelihood density estimation. But just as it can be difficult to choose the right regularizer, it can also be difficult to decide which divergence we wish to use for GAN training. It is our contention that GANs can be improved by fully probabilistic inference. Indeed, a posterior distribution over the parameters of the generator could be broad and highly multimodal. GAN training, which is based on mini-max optimization, always estimates this whole posterior distribution 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. over the network weights as a point mass centred on a single mode. Thus even if the generator does not memorize training examples, we would expect samples from the generator to be overly compact relative to samples from the data distribution. Moreover, each mode in the posterior over the network weights could correspond to wildly different generators, each with their own meaningful interpretations. By fully representing the posterior distribution over the parameters of both the generator and discriminator, we can more accurately model the true data distribution. The inferred data distribution can then be used for accurate and highly data-efficient semi-supervised learning. In this paper, we propose a simple Bayesian formulation for end-to-end unsupervised and semisupervised learning with generative adversarial networks. Within this framework, we marginalize the posteriors over the weights of the generator and discriminator using stochastic gradient Hamiltonian Monte Carlo. We interpret data samples from the generator, showing exploration across several distinct modes in the generator weights. We also show data and iteration efficient learning of the true distribution. We also demonstrate state of the art semi-supervised learning performance on several benchmarks, including SVHN, MNIST, CIFAR-10, and CelebA. The simplicity of the proposed approach is one of its greatest strengths: inference is straightforward, interpretable, and stable. Indeed all of the experimental results were obtained without many of the ad-hoc techniques often used to train standard GANs. We have made code and tutorials available at https://github.com/andrewgordonwilson/bayesgan. 2 Bayesian GANs Given a dataset D = {x(i)} of variables x(i) ∼pdata(x(i)), we wish to estimate pdata(x). We transform white noise z ∼p(z) through a generator G(z; θg), parametrized by θg, to produce candidate samples from the data distribution. We use a discriminator D(x; θd), parametrized by θd, to output the probability that any x comes from the data distribution. Our considerations hold for general G and D, but in practice G and D are often neural networks with weight vectors θg and θd. By placing distributions over θg and θd, we induce distributions over an uncountably infinite space of generators and discriminators, corresponding to every possible setting of these weight vectors. The generator now represents a distribution over distributions of data. Sampling from the induced prior distribution over data instances proceeds as follows: (1) Sample θg ∼p(θg); (2) Sample z(1), . . . , z(n) ∼p(z); (3) ˜x(j) = G(z(j); θg) ∼pgenerator(x). For posterior inference, we propose unsupervised and semi-supervised formulations in Sec 2.1 - 2.2. We note that in an exciting recent work Tran et al. [11] briefly mention using a variational approach to marginalize weights in a generative model, as part of a general exposition on hierarchical implicit models (see also Karaletsos [5] for a nice theoretical exploration of related topics in graphical model message passing). While this related work is promising, our approach has several key differences: (1) our GAN representation is quite different, with novel formulations for the conditional posteriors, preserving a clear competition between generator and discriminator; (2) our representation for the posteriors is straightforward, provides novel formulations for unsupervised and semi-supervised learning, and has state of the art results on many benchmarks. Conversely, Tran et al. [11] is only pursued for fully supervised learning on a few small datasets; (3) we use sampling to explore a full posterior over the weights, whereas Tran et al. [11] perform a variational approximation centred on one of the modes of the posterior (and due to the properties of the KL divergence is prone to an overly compact representation of even that mode); (4) we marginalize z in addition to θg, θd; and (5) the ratio estimation approach in [11] limits the size of the neural networks they can use, whereas in our experiments we can use comparably deep networks to maximum likelihood approaches. In the experiments we illustrate the practical value of our formulation. Although the high level concept of a Bayesian GAN has been informally mentioned in various contexts, to the best of our knowledge we present the first detailed treatment of Bayesian GANs, including novel formulations, sampling based inference, and rigorous semi-supervised learning experiments. 2 2.1 Unsupervised Learning To infer posteriors over θg, θd, we propose to iteratively sample from the following conditional posteriors: p(θg|z, θd) ∝ ng Y i=1 D(G(z(i); θg); θd) ! p(θg|αg) (1) p(θd|z, X, θg) ∝ nd Y i=1 D(x(i); θd) × ng Y i=1 (1 −D(G(z(i); θg); θd)) × p(θd|αd) . (2) p(θg|αg) and p(θd|αd) are priors over the parameters of the generator and discriminator, with hyperparameters αg and αd, respectively. nd and ng are the numbers of mini-batch samples for the discriminator and generator, respectively.1 We define X = {x(i)}nd i=1. We can intuitively understand this formulation starting from the generative process for data samples. Suppose we were to sample weights θg from the prior p(θg|αg), and then condition on this sample of the weights to form a particular generative neural network. We then sample white noise z from p(z), and transform this noise through the network G(z; θg) to generate candidate data samples. The discriminator, conditioned on its weights θd, outputs a probability that these candidate samples came from the data distribution. Eq. (1) says that if the discriminator outputs high probabilities, then the posterior p(θg|z, θd) will increase in a neighbourhood of the sampled setting of θg (and hence decrease for other settings). For the posterior over the discriminator weights θd, the first two terms of Eq. (2) form a discriminative classification likelihood, labelling samples from the actual data versus the generator as belonging to separate classes. And the last term is the prior on θd. Classical GANs as maximum likelihood Moreover, our proposed probabilistic approach is a natural Bayesian generalization of the classical GAN: if one uses uniform priors for θg and θd, and performs iterative MAP optimization instead of posterior sampling over Eq. (1) and (2), then the local optima will be the same as for Algorithm 1 of Goodfellow et al. [4]. We thus sometimes refer to the classical GAN as the ML-GAN. Moreover, even with a flat prior, there is a big difference between Bayesian marginalization over the whole posterior versus approximating this (often broad, multimodal) posterior with a point mass as in MAP optimization (see Figure 3, Supplement). Marginalizing the noise In prior work, GAN updates are implicitly conditioned on a set of noise samples z. We can instead marginalize z from our posterior updates using simple Monte Carlo: p(θg|θd) = Z p(θg, z|θd)dz = Z p(θg|z, θd) =p(z) z }| { p(z|θd) dz ≈1 Jg Jg X j=1 p(θg|z(j), θd) , z(j) ∼p(z) By following a similar derivation, p(θd|θg) ≈ 1 Jd PJd j p(θd|z(j), X, θg), z(j) ∼p(z). This specific setup has several nice features for Monte Carlo integration. First, p(z) is a white noise distribution from which we can take efficient and exact samples. Secondly, both p(θg|z, θd) and p(θd|z, X, θg), when viewed as a function of z, should be reasonably broad over z by construction, since z is used to produce candidate data samples in the generative procedure. Thus each term in the simple Monte Carlo sum typically makes a reasonable contribution to the total marginal posterior estimates. We do note, however, that the approximation will typically be worse for p(θd|θg) due to the conditioning on a minibatch of data in Equation 2. Posterior samples By iteratively sampling from p(θg|θd) and p(θd|θg) at every step of an epoch one can, in the limit, obtain samples from the approximate posteriors over θg and θd. Having such samples can be very useful in practice. Indeed, one can use different samples for θg to alleviate GAN collapse and generate data samples with an appropriate level of entropy, as well as forming a committee of generators to strengthen the discriminator. The samples for θd in turn form a committee of discriminators which amplifies the overall adversarial signal, thereby further improving the unsupervised learning process. Arguably, the most rigorous method to assess the utility of these posterior samples is to examine their effect on semi-supervised learning, which is a focus of our experiments in Section 4. 1For mini-batches, one must make sure the likelihood and prior are scaled appropriately. See Supplement. 3 2.2 Semi-supervised Learning We extend the proposed probabilistic GAN formalism to semi-supervised learning. In the semisupervised setting for K-class classification, we have access to a set of n unlabelled observations, {x(i)}, as well as a (typically much smaller) set of ns observations, {(x(i) s , y(i) s )}Ns i=1, with class labels y(i) s ∈{1, . . . , K}. Our goal is to jointly learn statistical structure from both the unlabelled and labelled examples, in order to make much better predictions of class labels for new test examples x∗than if we only had access to the labelled training inputs. In this context, we redefine the discriminator such that D(x(i) = y(i); θd) gives the probability that sample x(i) belongs to class y(i). We reserve the class label 0 to indicate that a data sample is the output of the generator. We then infer the posterior over the weights as follows: p(θg|z, θd) ∝ ng Y i=1 K X y=1 D(G(z(i); θg) = y; θd) ! p(θg|αg) (3) p(θd|z, X, ys, θg) ∝ nd Y i=1 K X y=1 D(x(i) = y; θd) ng Y i=1 D(G(z(i); θg) = 0; θd) Ns Y i=1 (D(x(i) s = y(i) s ; θd))p(θd|αd) (4) During every iteration we use ng samples from the generator, nd unlabeled samples, and all of the Ns labeled samples, where typically Ns ≪n. As in Section 2.1, we can approximately marginalize z using simple Monte Carlo sampling. Much like in the unsupervised learning case, we can marginalize the posteriors over θg and θd. To compute the predictive distribution for a class label y∗at a test input x∗we use a model average over all collected samples with respect to the posterior over θd: p(y∗|x∗, D) = Z p(y∗|x∗, θd)p(θd|D)dθd ≈1 T T X k=1 p(y∗|x∗, θ(k) d ) , θ(k) d ∼p(θd|D) . (5) We will see that this model average is effective for boosting semi-supervised learning performance. In Section 3 we present an approach to MCMC sampling from the posteriors over θg and θd. 3 Posterior Sampling with Stochastic Gradient HMC In the Bayesian GAN, we wish to marginalize the posterior distributions over the generator and discriminator weights, for unsupervised learning in 2.1 and semi-supervised learning in 2.2. For this purpose, we use Stochastic Gradient Hamiltonian Monte Carlo (SGHMC) [3] for posterior sampling. The reason for this choice is three-fold: (1) SGHMC is very closely related to momentum-based SGD, which we know empirically works well for GAN training; (2) we can import parameter settings (such as learning rates and momentum terms) from SGD directly into SGHMC; and most importantly, (3) many of the practical benefits of a Bayesian approach to GAN inference come from exploring a rich multimodal distribution over the weights θg of the generator, which is enabled by SGHMC. Alternatives, such as variational approximations, will typically centre their mass around a single mode, and thus provide a unimodal and otherwise compact representation for the distribution, due to asymmetric biases of the KL-divergence. The posteriors in Equations 3 and 4 are both amenable to HMC techniques as we can compute the gradients of the loss with respect to the parameters we are sampling. SGHMC extends HMC to the case where we use noisy estimates of such gradients in a manner which guarantees mixing in the limit of a large number of minibatches. For a detailed review of SGHMC, please see Chen et al. [3]. Using the update rules from Eq. (15) in Chen et al. [3], we propose to sample from the posteriors over the generator and discriminator weights as in Algorithm 1. Note that Algorithm 1 outlines standard momentum-based SGHMC: in practice, we found it helpful to speed up the “burn-in” process by replacing the SGD part of this algorithm with Adam for the first few thousand iterations, after which we revert back to momentum-based SGHMC. As suggested in Appendix G of Chen et al. [3], we employed a learning rate schedule which decayed according to γ/d where d is set to the number of unique “real” datapoints seen so far. Thus, our learning rate schedule converges to γ/N in the limit, where we have defined N = |D|. 4 Algorithm 1 One iteration of sampling for the Bayesian GAN. α is the friction term for SGHMC, η is the learning rate. We assume that the stochastic gradient discretization noise term ˆβ is dominated by the main friction term (this assumption constrains us to use small step sizes). We take Jg and Jd simple MC samples for the generator and discriminator respectively, and M SGHMC samples for each simple MC sample. We rescale to accommodate minibatches as in the supplementary material. • Represent posteriors with samples {θj,m g }Jg,M j=1,m=1 and {θj,m d }Jd,M j=1,m=1 from previous iteration for number of MC iterations Jg do • Sample Jg noise samples {z(1), . . . , z(Jg)} from noise prior p(z). Each z(i) has ng samples. • Update sample set representing p(θg|θd) by running SGHMC updates for M iterations: θj,m g ←θj,m g + v; v ←(1 −α)v + η ∂log P i P k p(θg|z(i), θk,m d )  ∂θg + n; n ∼N(0, 2αηI) • Append θj,m g to sample set. end for for number of MC iterations Jd do • Sample minibatch of Jd noise samples {z(1), . . . , z(Jd)} from noise prior p(z). • Sample minibatch of nd data samples x. • Update sample set representing p(θd|z, θg) by running SGHMC updates for M iterations: θj,m d ←θj,m d + v; v ←(1 −α)v + η ∂log P i P k p(θd|z(i), x, θk,m g )  ∂θd + n; n ∼N(0, 2αηI) • Append θj,m d to sample set. end for 4 Experiments We evaluate our proposed Bayesian GAN (henceforth titled BayesGAN) on six benchmarks (synthetic, MNIST, CIFAR-10, SVHN, and CelebA) each with four different numbers of labelled examples. We consider multiple alternatives, including: the DCGAN [9], the recent Wasserstein GAN (W-DCGAN) [1], an ensemble of ten DCGANs (DCGAN-10) which are formed by 10 random subsets 80% the size of the training set, and a fully supervised convolutional neural network. We also compare to the reported MNIST result for the LFVI-GAN, briefly mentioned in a recent work [11], where they use fully supervised modelling on the whole dataset with a variational approximation. We interpret many of the results from MNIST in detail in Section 4.2, and find that these observations carry forward to our CIFAR-10, SVHN, and CelebA experiments. For all real experiments except MNIST we use a 6-layer Bayesian deconvolutional GAN (BayesGAN) for the generative model G(z|θg) (see Radford et al. [9] for further details about structure). The corresponding discriminator is a 6-layer 2-class DCGAN for the unsupervised GAN and a 6-layer, K + 1 class DCGAN for a semi-supervised GAN performing classification over K classes. The connectivity structure of the unsupervised and semi-supervised DCGANs were the same as for the BayesGAN. As recommended by [10], we used feature matching for all models on semi-supervised experiments. For MNIST we found that 4-layers for all networks worked slightly better across the board, due to the added simplicity of the dataset. Note that the structure of the networks in Radford et al. [9] are slightly different from [10] (e.g. there are 4 hidden layers and fewer filters per layer), so one cannot directly compare the results here with those in Salimans et al. [10]. Our exact architecture specification is also given in our codebase. The performance of all methods could be improved through further calibrating architecture design for each individual benchmark. For the Bayesian GAN we place a N(0, 10I) prior on both the generator and discriminator weights and approximately integrate out z using simple Monte Carlo samples. We run Algorithm 1 for 5000 iterations and then collect weight samples every 1000 iterations and record out-of-sample predictive accuracy using Bayesian model averaging (see Eq. 5). For Algorithm 1 we set Jg = 10, Jd = 1, M = 2, and nd = ng = 64. All experiments were performed on a single TitanX GPU for consistency, but BayesGAN and DCGAN-10 could be sped up to approximately the same runtime as DCGAN through multi-GPU parallelization. 5 In Table 1 we summarize the semi-supervised results, where we see consistently improved performance over the alternatives. All runs are averaged over 10 random subsets of labeled examples for estimating error bars on performance (Table 1 shows mean and 2 standard deviations). We also qualitatively illustrate the ability for the Bayesian GAN to produce complementary sets of data samples, corresponding to different representations of the generator produced by sampling from the posterior over the generator weights (Figures 1, 2, 5). The supplement also contains additional plots of accuracy per epoch for semi-supervised experiments. 4.1 Synthetic Dataset We present experiments on a multi-modal synthetic dataset to test the ability to infer a multi-modal posterior p(θg|D). This ability not only helps avoid the collapse of the generator to a couple training examples, an instance of overfitting in regular GAN training, but also allows one to explore a set of generators with different complementary properties, harmonizing together to encapsulate a rich data distribution. We generate D-dimensional synthetic data as follows: z ∼N(0, 10 ∗Id), A ∼N(0, ID×d), x = Az + ϵ, ϵ ∼N(0, 0.01 ∗ID), d ≪D We then fit both a regular GAN and a Bayesian GAN to such a dataset with D = 100 and d = 2. The generator for both models is a two-layer neural network: 10-1000-100, fully connected, with ReLU activations. We set the dimensionality of z to be 10 in order for the DCGAN to converge (it does not converge when d = 2, despite the inherent dimensionality being 2!). Consistently, the discriminator network has the following structure: 100-1000-1, fully-connected, ReLU activations. For this dataset we place an N(0, I) prior on the weights of the Bayesian GAN and approximately integrate out z using J = 100 Monte-Carlo samples. Figure 1 shows that the Bayesian GAN does a much better job qualitatively in generating samples (for which we show the first two principal components), and quantitatively in terms of Jensen-Shannon divergence (JSD) to the true distribution (determined through kernel density estimates). In fact, the DCGAN (labelled ML GAN as per Section 2) begins to eventually increase in testing JSD after a certain number of training iterations, which is reminiscent of over-fitting. When D = 500, we still see good performance with the Bayesian GAN. We also see, with multidimensional scaling [2], that samples from the posterior over Bayesian generator weights clearly form multiple distinct clusters, indicating that the SGHMC sampling is exploring multiple distinct modes, thus capturing multimodality in weight space as well as in data space. 4.2 MNIST MNIST is a well-understood benchmark dataset consisting of 60k (50k train, 10k test) labeled images of hand-written digits. Salimans et al. [10] showed excellent out-of-sample performance using only a small number of labeled inputs, convincingly demonstrating the importance of good generative modelling for semi-supervised learning. Here, we follow their experimental setup for MNIST. We evaluate the Bayesian DCGAN for semi-supervised learning using Ns = {20, 50, 100, 200} labelled training examples. We see in Table 1 that the Bayesian GAN has improved accuracy over the DCGAN, the Wasserstein GAN, and even an ensemble of 10 DCGANs! Moreover, it is remarkable that the Bayesian GAN with only 100 labelled training examples (0.2% of the training data) is able to achieve 99.3% testing accuracy, which is comparable with a state of the art fully supervised method using all 50, 000 training examples! We show a fully supervised model using ns samples to generally highlight the practical utility of semi-supervised learning. Moreover, Tran et al. [11] showed that a fully supervised LFVI-GAN, on the whole MNIST training set (50, 000 labelled examples) produces 140 classification errors – almost twice the error of our proposed Bayesian GAN approach using only ns = 100 (0.2%) labelled examples! We suspect this difference largely comes from (1) the simple practical formulation of the Bayesian GAN in Section 2, (2) marginalizing z via simple Monte Carlo, and (3) exploring a broad multimodal posterior distribution over the generator weights with SGHMC with our approach versus a variational approximation (prone to over-compact representations) centred on a single mode. We can also see qualitative differences in the unsupervised data samples from our Bayesian DCGAN and the standard DCGAN in Figure 2. The top row shows sample images produced from six generators produced from six samples over the posterior of the generator weights, and the bottom row shows sample data images from a DCGAN. We can see that each of the six panels in the top row have 6 Figure 1: Left: Samples drawn from pdata(x) and visualized in 2-D after applying PCA. Right 2 columns: Samples drawn from pMLGAN(x) and pBGAN(x) visualized in 2D after applying PCA. The data is inherently 2-dimensional so PCA can explain most of the variance using 2 principal components. It is clear that the Bayesian GAN is capturing all the modes in the data whereas the regular GAN is unable to do so. Right: (Top 2) Jensen-Shannon divergence between pdata(x) and p(x; θ) as a function of the number of iterations of GAN training for D = 100 (top) and D = 500 (bottom). The divergence is computed using kernel density estimates of large sample datasets drawn from pdata(x) and p(x; θ), after applying dimensionality reduction to 2-D (the inherent dimensionality of the data). In both cases, the Bayesian GAN is far more effective at minimizing the Jensen-Shannon divergence, reaching convergence towards the true distribution, by exploring a full distribution over generator weights, which is not possible with a maximum likelihood GAN (no matter how many iterations). (Bottom) The sample set {θk g} after convergence viewed in 2-D using Multidimensional Scaling (using a Euclidean distance metric between weight samples) [2]. One can clearly see several clusters, meaning that the SGHMC sampling has discovered pronounced modes in the posterior over the weights. qualitative differences, almost as if a different person were writing the digits in each panel. Panel 1 (top left), for example, is quite crisp, while panel 3 is fairly thick, and panel 6 (top right) has thin and fainter strokes. In other words, the Bayesian GAN is learning different complementary generative hypotheses to explain the data. By contrast, all of the data samples on the bottom row from the DCGAN are homogenous. In effect, each posterior weight sample in the Bayesian GAN corresponds to a different style, while in the standard DCGAN the style is fixed. This difference is further illustrated for all datasets in Figure 5 (supplement). Figure 3 (supplement) also further emphasizes the utility of Bayesian marginalization versus optimization, even with vague priors. However, we do not necessarily expect high fidelity images from any arbitrary generator sampled from the posterior over generators; in fact, such a generator would probably have less posterior probability than the DCGAN, which we show in Section 2 can be viewed as a maximum likelihood analogue of our approach. The advantage in the Bayesian approach comes from representing a whole space of generators alongside their posterior probabilities. Practically speaking, we also stress that for reasonable sample generation from the maximumlikelihood DCGAN we had to resort to using tricks including minibatch discrimination, feature normalization and the addition of Gaussian noise to each layer of the discriminator. The Bayesian DCGAN needed none of these tricks. This robustness arises from a Gaussian prior over the weights which provides a useful inductive bias, and due to the MCMC sampling procedure which alleviates 7 Table 1: Detailed supervised and semi-supervised learning results for all datasets. In almost all experiments BayesGAN outperforms DCGAN and W-DCGAN substantially, and typically even outperforms ensembles of DCGANs. The runtimes, per epoch, in minutes, are provided in rows including the dataset name. While all experiments were performed on a single GPU, note that DCGAN-10 and BayesGAN methods can be sped up straightforwardly using multiple GPUs to obtain a similar runtime to DCGAN. Note also that the BayesGAN is generally much more efficient per epoch than the alternatives, as per Figure 4 (supplement). Results are averaged over 10 random supervised subsets ± 2 stdev. Standard train/test splits are used for MNIST, CIFAR-10 and SVHN. For CelebA we use a test set of size 10k. Test error rates are across the entire test set. Ns No. of misclassifications for MNIST. Test error rate for others. Supervised DCGAN W-DCGAN DCGAN-10 BayesGAN MNIST N=50k, D = (28, 28) 16 19 112 39 20 — 1618 ± 388 1623 ± 325 1453 ± 532 1402 ± 422 50 — 432 ± 187 412 ± 199 329 ± 139 321 ± 194 100 2134 ± 525 121 ± 18 134 ± 28 102 ± 11 98 ± 13 200 1389 ± 438 95 ± 7 91 ± 10 88 ± 6 82 ± 5 CIFAR-10 N=50k, D = (32, 32, 3) 34 38 217 102 1000 63.4 ± 2.6 48.6 ± 3.4 46.1 ± 3.6 39.6 ± 2.8 41.3 ± 5.1 2000 56.1 ± 2.1 34.1 ± 4.1 35.8 ± 3.8 32.4 ± 2.9 31.4 ± 3.6 4000 51.4 ± 2.9 30.8 ± 4.6 31.1 ± 4.7 27.4 ± 3.2 25.9 ± 3.7 8000 47.2 ± 2.2 25.1 ± 3.3 24.4 ± 5.5 22.6 ± 2.2 23.1 ± 3.9 SVHN N=75k, D = (32, 32, 3) 31 34 286 107 500 53.5 ± 2.5 38.2 ± 3.1 36.1 ± 4.2 31.8 ± 4.1 32.8 ± 4.4 1000 37.3 ± 3.1 23.6 ± 4.6 22.1 ± 4.8 19.8 ± 2.1 21.9 ± 3.5 2000 26.3 ± 2.1 21.2 ± 3.1 21.0 ± 1.3 17.1 ± 2.3 16.3 ± 2.4 4000 20.8 ± 1.8 18.2 ± 1.7 17.1 ± 1.2 13.0 ± 1.9 12.7 ± 1.4 CelebA N=100k, D = (50, 50, 3) 109 117 767 387 1000 53.8 ± 4.2 48.1 ± 4.8 45.5 ± 5.9 43.3 ± 5.3 42.4 ± 6.7 2000 36.7 ± 3.2 31.1 ± 3.2 30.1 ± 3.3 28.2 ± 1.3 26.8 ± 4.2 4000 34.3 ± 3.8 28.3 ± 3.2 26.0 ± 2.1 21.3 ± 1.2 22.6 ± 3.7 8000 31.1 ± 4.2 22.5 ± 1.5 21.0 ± 1.9 20.1 ± 1.4 19.4 ± 3.4 the risk of collapse and helps explore multiple modes (and uncertainty within each mode). To be balanced, we also stress that in practice the risk of collapse is not fully eliminated – indeed, some samples from p(θg|D) still produce generators that create data samples with too little entropy. In practice, sampling is not immune to becoming trapped in sharply peaked modes. We leave further analysis for future work. Figure 2: Top: Data samples from six different generators corresponding to six samples from the posterior over θg. The data samples show that each explored setting of the weights θg produces generators with complementary high-fidelity samples, corresponding to different styles. The amount of variety in the samples emerges naturally using the Bayesian approach. Bottom: Data samples from a standard DCGAN (trained six times). By contrast, these samples are homogenous in style. 4.3 CIFAR-10 CIFAR-10 is also a popular benchmark dataset [7], with 50k training and 10k test images, which is harder to model than MNIST since the data are 32x32 RGB images of real objects. Figure 5 shows 8 datasets produced from four different generators corresponding to samples from the posterior over the generator weights. As with MNIST, we see meaningful qualitative variation between the panels. In Table 1 we also see again (but on this more challenging dataset) that using Bayesian GANs as a generative model within the semi-supervised learning setup significantly decreases test set error over the alternatives, especially when ns ≪n. 4.4 SVHN The StreetView House Numbers (SVHN) dataset consists of RGB images of house numbers taken by StreetView vehicles. Unlike MNIST, the digits significantly differ in shape and appearance. The experimental procedure closely followed that for CIFAR-10. There are approximately 75k training and 25k test images. We see in Table 1 a particularly pronounced difference in performance between BayesGAN and the alternatives. Data samples are shown in Figure 5. 4.5 CelebA The large CelebA dataset contains 120k celebrity faces amongst a variety of backgrounds (100k training, 20k test images). To reduce background variations we used a standard face detector [12] to crop the faces into a standard 50 × 50 size. Figure 5 shows data samples from the trained Bayesian GAN. In order to assess performance for semi-supervised learning we created a 32-class classification task by predicting a 5-bit vector indicating whether or not the face: is blond, has glasses, is male, is pale and is young. Table 1 shows the same pattern of promising performance for CelebA. 5 Discussion By exploring rich multimodal distributions over the weight parameters of the generator, the Bayesian GAN can capture a diverse set of complementary and interpretable representations of data. We have shown that such representations can enable state of the art performance on semi-supervised problems, using a simple inference procedure. Effective semi-supervised learning of natural high dimensional data is crucial for reducing the dependency of deep learning on large labelled datasets. Often labeling data is not an option, or it comes at a high cost – be it through human labour or through expensive instrumentation (such as LIDAR for autonomous driving). Moreover, semi-supervised learning provides a practical and quantifiable mechanism to benchmark the many recent advances in unsupervised learning. Although we use MCMC, in recent years variational approximations have been favoured for inference in Bayesian neural networks. However, the likelihood of a deep neural network can be broad with many shallow local optima. This is exactly the type of density which is amenable to a sampling based approach, which can explore a full posterior. Variational methods, by contrast, typically centre their approximation along a single mode and also provide an overly compact representation of that mode. Therefore in the future we may generally see advantages in following a sampling based approach in Bayesian deep learning. Aside from sampling, one could try to better accommodate the likelihood functions common to deep learning using more general divergence measures (for example based on the family of α-divergences) instead of the KL divergence in variational methods, alongside more flexible proposal distributions. In the future, one could also estimate the marginal likelihood of a probabilistic GAN, having integrated away distributions over the parameters. The marginal likelihood provides a natural utility function for automatically learning hyperparameters, and for performing principled quantifiable model comparison between different GAN architectures. It would also be interesting to consider the Bayesian GAN in conjunction with a non-parametric Bayesian deep learning framework, such as deep kernel learning [13, 14]. We hope that our work will help inspire continued exploration into Bayesian deep learning. Acknowledgements We thank Pavel Izmailov and Ben Athiwaratkun for helping to create a tutorial for the codebase, helpful comments and validation. We also thank Soumith Chintala for helpful advice. We thank NSF IIS-1563887 for support. 9 References [1] Arjovsky, M., Chintala, S., and Bottou, L. (2017). Wasserstein GAN. arXiv preprint arXiv:1701.07875. [2] Borg, I. and Groenen, P. J. (2005). Modern multidimensional scaling: Theory and applications. Springer Science & Business Media. [3] Chen, T., Fox, E., and Guestrin, C. (2014). Stochastic gradient Hamiltonian Monte Carlo. In Proc. International Conference on Machine Learning. [4] Goodfellow, I., Pouget-Abadie, J., Mirza, M., Xu, B., Warde-Farley, D., Ozair, S., Courville, A., and Bengio, Y. (2014). Generative adversarial nets. In Advances in neural information processing systems, pages 2672–2680. [5] Karaletsos, T. (2016). Adversarial message passing for graphical models. arXiv preprint arXiv:1612.05048. [6] Kingma, D. P. and Welling, M. (2013). Auto-encoding variational Bayes. arXiv preprint arXiv:1312.6114. [7] Krizhevsky, A., Nair, V., and Hinton, G. (2010). Cifar-10 (Canadian institute for advanced research). [8] Nowozin, S., Cseke, B., and Tomioka, R. (2016). f-GAN: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pages 271–279. [9] Radford, A., Metz, L., and Chintala, S. (2015). Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434. [10] Salimans, T., Goodfellow, I. J., Zaremba, W., Cheung, V., Radford, A., and Chen, X. (2016). Improved techniques for training gans. CoRR, abs/1606.03498. [11] Tran, D., Ranganath, R., and Blei, D. (2017). Hierarchical implicit models and likelihood-free variational inference. In Advances in Neural Information Processing Systems, pages 5529–5539. [12] Viola, P. and Jones, M. J. (2004). Robust real-time face detection. Int. J. Comput. Vision, 57(2):137–154. [13] Wilson, A. G., Hu, Z., Salakhutdinov, R., and Xing, E. P. (2016a). Deep kernel learning. Artificial Intelligence and Statistics. [14] Wilson, A. G., Hu, Z., Salakhutdinov, R. R., and Xing, E. P. (2016b). Stochastic variational deep kernel learning. In Advances in Neural Information Processing Systems, pages 2586–2594. 10
2017
130
6,598
Alternating minimization for dictionary learning with random initialization Niladri S. Chatterji University of California, Berkeley chatterji@berkeley.edu Peter L. Bartlett University of California, Berkeley peter@berkeley.edu Abstract We present theoretical guarantees for an alternating minimization algorithm for the dictionary learning/sparse coding problem. The dictionary learning problem is to factorize vector samples y1, y2, . . . , yn into an appropriate basis (dictionary) A∗and sparse vectors x1∗, . . . , xn∗. Our algorithm is a simple alternating minimization procedure that switches between ℓ1 minimization and gradient descent in alternate steps. Dictionary learning and specifically alternating minimization algorithms for dictionary learning are well studied both theoretically and empirically. However, in contrast to previous theoretical analyses for this problem, we replace a condition on the operator norm (that is, the largest magnitude singular value) of the true underlying dictionary A∗with a condition on the matrix infinity norm (that is, the largest magnitude term). Our guarantees are under a reasonable generative model that allows for dictionaries with growing operator norms, and can handle an arbitrary level of overcompleteness, while having sparsity that is information theoretically optimal. We also establish upper bounds on the sample complexity of our algorithm. Erratum, August 7, 2019: An earlier version of this paper appeared in NIPS 2017 which had an erroneous claim about convergence guarantees with random initialization. The main result – Theorem 3 – has been corrected by adding an assumption about the initialization (Assumption B1). 1 Introduction In the problem of sparse coding/dictionary learning, given i.i.d. samples y1, y2, . . . , yn ∈Rd produced from the generative model yi = A∗xi∗ (1) for i ∈{1, 2, . . . , n}, the goal is to recover a fixed dictionary A∗∈Rd×r and s-sparse vectors xi∗∈Rr. (An s-sparse vector has no more than s non-zero entries.) In many problems of interest, the dictionary is often overcomplete, that is, r ≥d. This is believed to add flexibility in modeling and robustness. This model was first proposed in neuroscience as an energy minimization heuristic that reproduces features of the V1 region of the visual cortex (Olshausen and Field, 1997; Lewicki and Sejnowski, 2000). It has also been an extremely successful approach to identifying low dimensional structure in high dimensional data; it is used extensively to find features in images, speech and video (see, for example, references in Elad and Aharon, 2006). Most formulations of dictionary learning tend to yield non-convex optimization problems. For example, note that if either xi∗or A∗were known, given yi, this would just be a (matrix/sparse) regression problem. However, estimating both xi∗and A∗simultaneously leads to both computational as well as statistical complications. The heuristic of alternating minimization works well empirically for dictionary learning. At each step, first an estimate of the dictionary is held fixed while the sparse 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. coefficients are estimated; next, using these sparse coefficients the dictionary is updated. Note that in each step the sub-problem has a convex formulation, and there is a range of efficient algorithms that can be used. This heuristic has been very successful empirically, and there has also been significant recent theoretical progress in understanding its performance, which we discuss next. 1.1 Related Work A recent line of work theoretically analyzes local linear convergence rates for alternating minimization procedures applied to dictionary learning (Agarwal et al., 2014; Arora et al., 2015). Arora et al. (2015) present a neurally plausible algorithm that recovers the dictionary exactly for sparsity up to s = O( √ d/(µ log(d))), where µ/ √ d is the level of incoherence in the dictionary (which is a measure of the similarity of the columns; see Assumption A1 below). Agarwal et al. (2014) analyze a least squares/ℓ1 minimization scheme and show that it can tolerate sparsity up to s = O(d1/6). Both of these establish local linear convergence guarantees for the maximum column-wise distance. Exact recovery guarantees require a singular-value decomposition (SVD) or clustering based procedure to initialize their dictionary estimates (see also the previous work Arora et al., 2013; Agarwal et al., 2013). For the undercomplete case (when r ≤d), Sun et al. (2017) provide a Riemannian trust region method that can tolerate sparsity s = O(d), while earlier work by Spielman et al. (2012) provides an algorithm that works in this setting for sparsity O( √ d). Local and global optima of non-convex formulations for the problem have also been extensively studied in (Wu and Yu, 2015; Gribonval et al., 2015; Gribonval and Nielsen, 2003), among others. Apart from alternating minimization, other approaches (without theoretical convergence guarantees) for dictionary learning include K-SVD (Aharon et al., 2006) and MOD (Engan et al., 1999). There is also a nice formulation by Barak et al. (2015), based on the sum-of-squares hierarchy. Recently, Hazan and Ma (2016) provide guarantees for improper dictionary learning, where instead of learning a dictionary, they learn a comparable encoding via convex relaxations. Our work also adds to the recent literature on analyzing alternating minimization algorithms (Jain et al., 2013; Netrapalli et al., 2013, 2014; Hardt, 2014; Balakrishnan et al., 2017). 1.2 Contributions Our main contribution is to present new conditions under which alternating minimization for dictionary learning converges at a linear rate to the optimum. We impose a condition on the matrix infinity norm (largest magnitude entry) of the underlying dictionary. This allows dictionaries with operator norm growing with dimension (d, r). The error rates are measured in the matrix infinity norm, which is sharper than the previous error rates in maximum column-wise error. Our results hold for a rather arbitrary level of overcompleteness, r = O(poly(d)). We establish convergence results for sparsity level s = O( √ d), which is information theoretically optimal for incoherent dictionaries and improves the previously best known results in the overcomplete setting by a logarithmic factor. Our algorithm is simple, involving an ℓ1-minimization step followed by a gradient update for the dictionary. A key step in our proofs is an analysis of a robust sparse estimator—{ℓ1, ℓ2, ℓ∞}-MU Selector— under fixed (worst case) corruption in the dictionary. We prove that this estimator is minimax optimal in this setting, which might be of independent interest. 1.3 Organization In Section 2, we present our alternating minimization algorithm and discuss the sparse regression estimator. In Section 3, we list the assumptions under which our algorithm converges and state the main convergence result. Finally, in Section 4, we prove convergence of our algorithm. We defer technical lemmas, analysis of the sparse regression estimator, and minimax analysis to the appendix. Notation For a vector v ∈Rd, vi denotes the ith component of the vector, ∥v∥p denotes the ℓp norm, supp(v) denotes the support of a vector v, that is, the set of non-zero entries of the vector, sgn(v) denotes 2 Algorithm 1: Alternating Minimization for Dictionary Learning Input : Step size η, samples {yk}n k=1, initial estimate A(0), number of steps T, thresholds {τ (t)}T t=1, initial radius R(0) and parameters {γ(t)}T t=1, {λ(t)}T t=1 and {ν(t)}T t=1. 1 for t = 1, 2, . . . , T do 2 for k = 1, 2, . . . , n do 3 wk,(t) = MUSγ(t),λ(t),ν(t)(yk, A(t−1), R(t−1)) 4 for l = 1, 2, 3 . . . , r do 5 xk,(t) l = wk,(t) l I  |wk,(t) l | > τ (t) , (xk,(t) is the sparse estimate) 6 end 7 end 8 for i = 1, 2, . . . , d do 9 for j = 1, 2, . . . , r do 10 A(t) ij = A(t−1) ij −η n Pn k=1 hPr p=1  A(t−1) ip xk,(t) p xk,(t) j −yk i xk,(t) j i 11 end 12 end 13 R(t) = 7 8R(t−1). 14 end the sign of the vector v, that is, a vector with sgn(v)i = 1 if vi > 0, sgn(v)i = −1 if vi < 0 and sgn(v)i = 0 if vi = 0. For a matrix W, Wi denotes the ith column, Wij is the element in the ith row and jth column, ∥W∥op denotes the operator norm, and ∥W∥∞denotes the maximum of the magnitudes of the elements of W. For a set J, we denote its cardinality by |J|. Throughout the paper, we use C multiple times to denote global constants that are independent of the problem parameters and dimension. We denote the indicator function by I(·). 2 Algorithm Given an initial estimate of the dictionary A(0) we alternate between an ℓ1 minimization procedure (specifically the {ℓ1, ℓ2, ℓ∞}-MU Selector—MUSγ,λ,ν in the algorithm—followed by a thresholding step) and a gradient step, under sample ℓ2 loss, to update the dictionary. We analyze this algorithm and demand linear convergence at a rate of 7/8; convergence analysis for other rates follows in the same vein with altered constants. Below we state the permitted range for the various parameters in the algorithm above. 1. Step size: We need to set the step size in the range 3r/4s < η < r/s. 2. Threshold: At each step set the threshold at τ (t) = 16R(t−1)M(R(t−1)(s + 1) + s/ √ d). 3. Tuning parameters: We need to pick λ(t) and ν(t) such that the assumption (D5) is satisfied. A choice that is suitable that satisfies this assumption is 128s  R(t−1)2 ≤ν(t) ≤3, 32  s3/2  R(t−1)2 + s3/2R(t−1) d1/2   4 + 6 √s  ≤λ(t) ≤3. We need to set γ(t) as specified by Theorem 16, γ(t) = √s  R(t−1)2 + rs dR(t−1). 2.1 Sparse Regression Estimator Our proof of convergence for Algorithm 1 also goes through with a different choices of robust sparse regression estimators, however, we can establish the tightest guarantees when the {ℓ1, ℓ2, ℓ∞}-MU 3 Selector is used in the sparse regression step. The {ℓ1, ℓ2, ℓ∞}-MU Selector (Belloni et al., 2014) was established as a modification of the Dantzig selector to handle uncertainty in the dictionary. There is a beautiful line of work that precedes this that includes (Rosenbaum et al., 2010, 2013; Belloni et al., 2016). There are also modified non-convex LASSO programs that have been studied (Loh and Wainwright, 2011) and Orthogonal Matching Pursuit algorithms under in-variable errors (Chen and Caramanis, 2013). However these estimators require the error in the dictionary to be stochastic and zero mean which makes them less suitable in this setting. Also note that standard ℓ1 minimization estimators like the LASSO and Dantzig selector are highly unstable under errors in the dictionary and would lead to much worse guarantees in terms of radius of convergence (as studied in Agarwal et al., 2014). We establish the error guarantees for a robust sparse estimator {ℓ1, ℓ2, ℓ∞}MU Selector under fixed corruption in the dictionary. We also establish that this estimator is minimax optimal when the error in the sparse estimate is measured in infinity norm ∥ˆθ −θ∗∥∞and the dictionary is corrupted. The {ℓ1, ℓ2, ℓ∞}-MU Selector Define the estimator ˆθ such that (ˆθ, ˆt, ˆu) ∈Rr ×R+ ×R+ is the solution to the convex minimization problem min θ,t,u ( ∥θ∥1 + λt + νu θ ∈Rr, 1 dA⊤y −Aθ  ∞≤γt + R2u, ∥θ∥2 ≤t, ∥θ∥∞≤u ) (2) where, γ, λ and ν are tuning parameters that are chosen appropriately. R is an upper bound on the error in our dictionary measured in matrix infinity norm. Henceforth the first coordinate (ˆθ) of this estimator is called MUSγ,λ,ν(y, A, R), where the first argument is the sample, the second is the matrix, and the third is the value of the upper bound on the error of the dictionary measured in infinity norm. We will see that under our assumptions we will be able to establish an upper bound on the error on the estimator, ∥ˆθ −θ∗∥∞≤16RM  R(s + 1) + s/ √ d  , where |θ∗ j | ≤M ∀j. We define a threshold at each step τ = 16RM(R(s+1)+s/ √ d). The thresholded estimate ˜θ is defined as ˜θi = ˆθiI[|ˆθi| > τ] ∀i ∈{1, 2, . . . , r}. (3) Our assumptions will ensure that we have the guarantee sgn(˜θ) = sgn(θ∗). This will be crucial in our proof of convergence. The analysis of this estimator is presented in Appendix B. To identify the signs of the sparse covariates correctly using this class of thresholded estimators, we would like in the first step to use an estimator ˆθ that is optimal, as this would lead to tighter control over the radius of convergence. This makes the choice of {ℓ1, ℓ2, ℓ∞}-MU Selector natural, as we will show it is minimax optimal under certain settings. Theorem 1 (informal). Define the sets of matrices A = {B ∈Rd×r ∥Bi∥2 ≤1, ∀i ∈{1, . . . , r}} and W = {P ∈Rd×r ∥P∥∞≤R} with R = O(1/√s). Then there exists an A∗∈A and W ∈W with A ≜A∗+ W such that inf ˆT sup θ∗∥ˆT −θ∗∥∞≥CRL s 1 −log(s) log(r) ! , (4) where the inf ˆT is over all measurable estimators ˆT with input (A∗θ∗, A, R), and the sup is over s-sparse vectors θ∗with 2-norm L > 0. Remark 2. Note that when R = O(1/√s) and s = O( √ d), this lower bound matches the upper bound we have for Theorem 16 (up to logarithmic factors) and hence the {ℓ1, ℓ2, ℓ∞}-MU Selector is minimax optimal. The proof of this theorem follows by Fano’s method and is relegated to Appendix C. 4 2.2 Gradient Update for the dictionary We note that the update to the dictionary at each step in Algorithm 1 is as follows A(t) ij = A(t−1) ij −η 1 n n X k=1 " r X p=1  A(t−1) ip xk,(t) p xk,(t) j −yk i xk,(t) j #! | {z } ≜ˆg(t) ij , for i ∈{1, . . . , d}, j ∈{1, . . . , r} and t ∈{1, . . . , T}. If we consider the loss function at time step t built using the vector samples y1, . . . , yn and sparse estimates x1,(t), . . . , xn,(t), Ln(A) = 1 2n n X k=1 yk −Axk,(t) 2 2 , ∀A ∈Rd×r, we can identify the update to the dictionary ˆg(t) as the gradient of this loss function evaluated at A(t−1), ˆg(t) = ∂Ln(A) ∂A A(t−1). 3 Main Results and Assumptions In this section we state our convergence result and state the assumptions under which our results are valid. 3.1 Assumptions Assumptions on A∗ (A1) Incoherence: We assume the the true underlying dictionary is µ/ √ d-incoherent |⟨A∗ i , A∗ j⟩| ≤µ √ d ∀i, j ∈{1, . . . , r} such that, i ̸= j. This is a standard assumption in the sparse regression literature when support recovery is of interest. It was introduced in (Fuchs, 2004; Tropp, 2006) in signal processing and independently in (Zhao and Yu, 2006; Meinshausen and B¨uhlmann, 2006) in statistics. We can also establish guarantees under the strictly weaker ℓ∞-sensitivity condition (cf. Gautier and Tsybakov, 2011) used in analyzing sparse estimators under in-variable uncertainty in (Belloni et al., 2016; Rosenbaum et al., 2013). The {ℓ1, ℓ2, ℓ∞}-MU selector that we use for our sparse recovery step also works with this more general assumption, however for ease of exposition we assume A∗to be µ/ √ d-incoherent. (A2) Normalized Columns: We assume that all the columns of A∗are normalized to 1, ∥A∗ i ∥2 = 1 ∀i ∈{1, . . . , r}. Note that the samples {yi}n i=1 are invariant when we scale the columns of A∗or under permutations of its columns. Thus we restrict ourselves to dictionaries with normalized columns and label the entire equivalence class of dictionaries with permuted columns and varying signs as A∗. (A3) Bounded max-norm: We assume that A∗is bounded in matrix infinity norm ∥A∗∥∞≤Cb s , where Cb = 1/2000M 2. This is in contrast with previous work that imposes conditions on the operator norm of A∗(Arora et al., 2015; Agarwal et al., 2014; Arora et al., 2013). Our assumptions help provide guarantees under alternate assumptions and it also allows the operator norm to grow with dimension, whereas earlier work requires A∗to be such that ∥A∗∥op ≤C p r/d  . In general the infinity norm and operator norm balls are hard to 5 compare. However, one situation where a comparison is possible is if we assume the entries of the dictionary to be drawn iid from a Gaussian distribution N(0, σ2). Then by standard concentration theorems, for the operator norm condition to be satisfied we would need the variance (σ2) of the distribution to scale as O(1/d) while, for the infinity norm condition to be satisfied we need the variance to be ˜O(1/s2). This means that modulo constants the variance can be much larger for the infinity norm condition to be satisfied than for the operator norm condition. (A4) Separation: We assume that ∀i ∈{1, . . . , r} ∥A∗ i ∥∞> 3Cb 4s , and, min z∈{−1,1}∥A∗ i −zA∗ j∥∞≥3Cb 2s ∀j ̸= i ∈{1, . . . , r}. This condition ensures that two dictionaries in the equivalence class with varying signs of columns or permutations are separated in infinity norm. The first condition ensures that for any column A∗ i and −A∗ i are separated ∥A∗ i −(−A∗ i )∥∞≥3Cb/2s. Assumption on the initial estimate and initialization (B1) We require an initial estimate for the dictionary A(0) that is close in infinity norm, ∥A(0) −A∗∥∞≤Cb 2s . This initialization combined with the separation condtion above ensures that the initial estimate A(0) is close to only one dictionary in the equivalence class. The algorithm is going to be contractive, hence this will hold true throughout the run of the algorithm. Assumptions on x∗ Next we assume a generative model on the s-sparse covariates x∗. Here are the assumptions we make about the (unknown) distribution of x∗. (C1) Conditional Independence: We assume that distribution of non-zero entries of x∗is conditionally independent and identically distributed. That is, x∗ i ⊥⊥x∗ j|x∗ i , x∗ j ̸= 0. (C2) Sparsity Level:We assume that the level of sparsity s is bounded 2 ≤s ≤min(2 √ d, Cb √ d, C √ d/µ), where C is an appropriate global constant such that A∗satisfies assumption (D3), see Remark 15. For incoherent dictionaries, this upper bound is tight up to constant factors for sparse recovery to be feasible (Donoho and Huo, 2001; Gribonval and Nielsen, 2003). (C3) Boundedness: Conditioned on the event that i is in the subset of non-zero entries, we have m ≤|x∗ i | ≤M, with m ≥32R(0)M(R(0)(s + 1) + s/ √ d) and M > 1. This is needed for the thresholded sparse estimator to correctly predict the sign of the true covariate (sgn(x) = sgn(x∗)). We can also relax the boundedness assumption: it suffices for the x∗ i to have sub-Gaussian distributions. (C4) Probability of support: The probability of i being in the support of x∗is uniform over all i ∈{1, 2, . . . , r}. This translates to Pr(x∗ i ̸= 0) = s r ∀i ∈{1, . . . , r}, Pr(x∗ i , x∗ j ̸= 0) = s(s −1) r(r −1) ∀i ̸= j ∈{1, . . . , r}. (C5) Mean and variance of variables in the support: We assume that the non-zero random variables in the support of x∗are centered and are normalized E(x∗ i |x∗ i ̸= 0) = 0, E(x∗2 i |x∗ i ̸= 0) = 1. We note that these assumptions (A1), (A2) and (C1) - (C5) are similar to those made in (Arora et al., 2015; Agarwal et al., 2014). Agarwal et al. (2014) require the matrices to satisfy the restricted isometry property, which is strictly weaker than µ/ √ d-incoherence, however they can tolerate a much lower level of sparsity (d1/6). 6 3.2 Main Result Theorem 3. Suppose that true dictionary A∗and the distribution of the s-sparse samples x∗satisfy the assumptions stated in Section 3.1 and we are given an estimate A(0) such that ∥A(0) −A∗∥∞ ≤ R(0) ≤ Cb/2s. If we are given {n(t)}T t=1 i.i.d. samples in every iteration with n(t) = Ω  r s(R(t−1))2 log(dr/δ)  then Algorithm 1 with parameters ({τ (t)}T t=1, {γ(t)}T t=1, {λ(t)}T t=1, {ν(t)}T t=1, η) chosen as specified in Section 3.1 after T iterations returns a dictionary A(T ) such that, ∥A(T ) −A∗∥∞≤ 7 8 T R(0), with probability 1 −Tδ. 4 Proof of Convergence In this section we prove the main convergence result. To prove this we analyze the gradient update to the dictionary at each step. We can decompose this gradient update (which is a random variable) into a first term which is its expected value and a second term which is its deviation from expectation. We will prove a deterministic convergence result by working with the expected value of the gradient and then appeal to standard concentration arguments to control the deviation of the gradient from its expected value with high probability. By Lemma 8, Algorithm 1 is guaranteed to estimate the sign pattern correctly at every round of the algorithm, sgn(x) = sgn(x∗) (see proof in Appendix A.1). Also note that by assumption (B1), the initial dictionary A(0) is close to only one dictionary A∗in the equivalence class. To un-clutter notation let, A∗ ij = a∗ ij, A(t) ij = aij, A(t+1) ij = a ′ ij. The kth coordinate of the mth covariate is written as xm∗ k . Similarly let xm k be the kth coordinate of the estimate of the mth covariate at step t. Finally let R(t) = R, n(t) = n and ˆgij be the (i, j)th element of the gradient with n (n(t)) samples at step t. Unwrapping the expression for ˆgij we get, ˆgij = 1 n n X m=1 " r X k=1 aikxm k xm j  −ym i xm j # = 1 n n X m=1 " r X k=1  aikxm k −a∗ ikxm∗ k  xm j # = E " r X k=1  aikxk −a∗ ikx∗ k  xj # + " 1 n n X m=1 " r X k=1  aikxm k −a∗ ikxm∗ k  xm j # −E " r X k=1  aikxk −a∗ ikx∗ k  xj ## = gij + ˆgij −gij | {z } ≜ϵn , where gij denotes (i, j)th element of the expected value (infinite samples) of the gradient. The second term ϵn is the deviation of the gradient from its expected value. By Theorem 10 we can control the deviation of the sample gradient from its mean via an application of McDiarmid’s inequality. With this notation in place we are now ready to prove Theorem 3. Proof [Proof of Theorem 3] First we analyze the structure of the expected value of the gradient. Step 1: Unwrapping the expected value of the gradient we find it decomposes into three terms gij = E aijx2 j −a∗ ijx∗ jxj  + E  X k̸=j aikxkxj −a∗ ikx∗ kxj   = (aij −a∗ ij)s rE  x2 j|x∗ j ̸= 0  | {z } ≜gc ij + a∗ ij s rE  (xj −x∗ j)xj|x∗ j ̸= 0  | {z } ≜Ξ1 + E  X k̸=j aikxkxj −a∗ ikx∗ kxj   | {z } ≜Ξ2 . 7 The first term gc ij points in the correct direction and will be useful in converging to the right answer. The other terms could be in a bad direction and we will control their magnitude with Lemma 5 such that |Ξ1| + |Ξ2| ≤ s 3rR. The proof of Lemma 5 is the main technical challenge in the convergence analysis to control the error in the gradient. Its proof is deferred to the appendix. Step 2: Given this bound, we analyze the gradient update, a ′ ij = aij −ηˆgij = aij −η(gij + ϵn) = aij −η  gc ij + (Ξ1 + Ξ2) + ϵn  . So if we look at the distance to the optimum a∗ ij we have the relation, a ′ ij −a∗ ij = aij −a∗ ij −η(aij −a∗ ij)s rE  x2 j|x∗ j ̸= 0  −η {(Ξ1 + Ξ2) + ϵn} . Taking absolute values, we get |a ′ ij −a∗ ij| (i) ≤  1 −η s rE  x2 j|x∗ j ̸= 0  |aij −a∗ ij| + η {|Ξ1| + |Ξ2| + |ϵn|} (ii) ≤  1 −η s rE  x2 j|x∗ j ̸= 0  |aij −a∗ ij| + η  s 3rR  + η|ϵn| ≤  1 −η s r  E  x2 j|x∗ j ̸= 0  −1 3  R + η|ϵn|, provided the first term is at non-negative. Here, (i) follows by triangle inequality and (ii) is by Lemma 5. Next we give an upper and lower bound on E  x2 j|x∗ j ̸= 0  . We would expect that as R gets smaller this variance term approaches E  x∗2 j |x∗ j ̸= 0  = 1. By invoking Lemma 6 we can bound this term to be 2 3 ≤E  x2 j|x∗ j ̸= 0  ≤4 3. We want the first term to contract at a rate 3/4; it suffices to have 0 (i) ≤  1 −η s r  E  x2 j|x∗ j ̸= 0  −1 3  (ii) ≤3 4. Coupled with Lemma 6, Inequality (i) follows from η ≤r s while (ii) follows from η ≥3r 4s. We also have by Theorem 10 that η|ϵn| ≤R/8 with probability 1 −δ. So if we unroll the bound for t steps we have, |a(t) ij −a∗ ij| ≤3 4R(t−1) + η|ϵn| ≤3 4R(t−1) + 1 8R(t−1) = 7 8R(t−1) ≤ 7 8 t R(0). We also have η|ϵn| ≤R/8 ≤R(0)/8 with probability at least 1 −δ in each iteration, for all t ∈{1, . . . , T}; thus by taking a union bound over the iterations we are guaranteed to remain in our initial ball of radius R(0) with high probability, completing the proof. 5 Conclusion An interesting question would be to further explore and analyze the range of algorithms for which alternating minimization works and identifying the conditions under which they provably converge. Going beyond sparsity √ d still remains challenging, and as noted in previous work alternating minimization also appears to break down experimentally and new algorithms are required in this regime. Also all theoretical work on analyzing alternating minimization for dictionary learning seems to rely on identifying the signs of the samples (x∗) correctly at every step. It would be an interesting theoretical question to analyze if this is a necessary condition or if an alternate proof strategy and consequently a bigger radius of convergence are possible. Lastly, it is not known what the optimal sample complexity for this problem is and lower bounds there could be useful in designing more sample efficient algorithms. Acknowledgments We gratefully acknowledge the support of the NSF through grant IIS-1619362, and of the Australian Research Council through an Australian Laureate Fellowship (FL110100281) and through the ARC 8 Centre of Excellence for Mathematical and Statistical Frontiers. Thanks also to the Simons Institute for the Theory of Computing Spring 2017 Program on Foundations of Machine Learning. The authors would like to thank Sahand Negahban for pointing out an error in the µ-incoherence assumption in an earlier version. The authors would like to thank Shivam Garg for pointing us to an error in the claim about random initialization in a previous version of this paper. References Agarwal, A., A. Anandkumar, P. Jain, P. Netrapalli, and R. Tandon (2014). Learning sparsely used overcomplete dictionaries. In COLT, pp. 123–137. Agarwal, A., A. Anandkumar, and P. Netrapalli (2013). A clustering approach to learn sparsely-used overcomplete dictionaries. arXiv preprint arXiv:1309.1952. Aharon, M., M. Elad, and A. Bruckstein (2006). K-SVD: An algorithm for designing overcomplete dictionaries for sparse representation. IEEE Transactions on signal processing 54(11), 4311– 4322. Arora, S., R. Ge, T. Ma, and A. Moitra (2015). Simple, efficient, and neural algorithms for sparse coding. In COLT, pp. 113–149. Arora, S., R. Ge, and A. Moitra (2013). New algorithms for learning incoherent and overcomplete dictionaries. Balakrishnan, S., M. J. Wainwright, B. Yu, et al. (2017). Statistical guarantees for the EM algorithm: From population to sample-based analysis. The Annals of Statistics 45(1), 77–120. Barak, B., J. A. Kelner, and D. Steurer (2015). Dictionary learning and tensor decomposition via the sum-of-squares method. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, pp. 143–151. ACM. Belloni, A., M. Rosenbaum, and A. B. Tsybakov (2014). An {ℓ1, ℓ2, ℓ∞}-Regularization Approach to High-Dimensional Errors-in-variables Models. arXiv preprint arXiv:1412.7216. Belloni, A., M. Rosenbaum, and A. B. Tsybakov (2016). Linear and conic programming estimators in high dimensional errors-in-variables models. Journal of the Royal Statistical Society: Series B (Statistical Methodology). Boucheron, S., G. Lugosi, and P. Massart (2013). Concentration inequalities: A nonasymptotic theory of independence. Oxford university press. Chen, Y. and C. Caramanis (2013). Noisy and Missing Data Regression: Distribution-Oblivious Support Recovery. Donoho, D. L. and X. Huo (2001). Uncertainty principles and ideal atomic decomposition. IEEE Transactions on Information Theory 47(7), 2845–2862. Elad, M. and M. Aharon (2006). Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image processing 15(12), 3736–3745. Engan, K., S. O. Aase, and J. H. Husoy (1999). Method of optimal directions for frame design. In Acoustics, Speech, and Signal Processing, 1999. Proceedings., 1999 IEEE International Conference on, Volume 5, pp. 2443–2446. IEEE. Fuchs, J.-J. (2004). Recovery of exact sparse representations in the presence of noise. In Acoustics, Speech, and Signal Processing, 2004. Proceedings.(ICASSP’04). IEEE International Conference on, Volume 2, pp. ii–533. IEEE. Gautier, E. and A. Tsybakov (2011). High-dimensional instrumental variables regression and confidence sets. arXiv preprint arXiv:1105.2454. Gribonval, R., R. Jenatton, and F. Bach (2015). Sparse and spurious: dictionary learning with noise and outliers. IEEE Transactions on Information Theory 61(11), 6298–6319. 9 Gribonval, R. and M. Nielsen (2003). Sparse representations in unions of bases. IEEE transactions on Information theory 49(12), 3320–3325. Hardt, M. (2014). Understanding alternating minimization for matrix completion. In Foundations of Computer Science (FOCS), 2014 IEEE 55th Annual Symposium on, pp. 651–660. IEEE. Hazan, E. and T. Ma (2016). A Non-generative Framework and Convex Relaxations for Unsupervised Learning. In Advances in Neural Information Processing Systems, pp. 3306–3314. Jain, P., P. Netrapalli, and S. Sanghavi (2013). Low-rank matrix completion using alternating minimization. In Proceedings of the forty-fifth annual ACM symposium on Theory of computing, pp. 665–674. ACM. Lewicki, M. S. and T. J. Sejnowski (2000). Learning overcomplete representations. Neural computation 12(2), 337–365. Loh, P.-L. and M. J. Wainwright (2011). High-dimensional regression with noisy and missing data: Provable guarantees with non-convexity. In Advances in Neural Information Processing Systems, pp. 2726–2734. McDiarmid, C. (1989). On the method of bounded differences. Surveys in combinatorics 141(1), 148–188. Meinshausen, N. and P. B¨uhlmann (2006). High-dimensional graphs and variable selection with the Lasso. The annals of statistics, 1436–1462. Netrapalli, P., P. Jain, and S. Sanghavi (2013). Phase retrieval using alternating minimization. In Advances in Neural Information Processing Systems, pp. 2796–2804. Netrapalli, P., U. Niranjan, S. Sanghavi, A. Anandkumar, and P. Jain (2014). Non-convex robust PCA. In Advances in Neural Information Processing Systems, pp. 1107–1115. Olshausen, B. A. and D. J. Field (1997). Sparse coding with an overcomplete basis set: A strategy employed by V1? Vision research 37(23), 3311–3325. Rigollet, P. and A. Tsybakov (2011). Exponential screening and optimal rates of sparse estimation. The Annals of Statistics, 731–771. Rosenbaum, M., A. B. Tsybakov, et al. (2010). Sparse recovery under matrix uncertainty. The Annals of Statistics 38(5), 2620–2651. Rosenbaum, M., A. B. Tsybakov, et al. (2013). Improved matrix uncertainty selector. In From Probability to Statistics and Back: High-Dimensional Models and Processes–A Festschrift in Honor of Jon A. Wellner, pp. 276–290. Institute of Mathematical Statistics. Spielman, D. A., H. Wang, and J. Wright (2012). Exact Recovery of Sparsely-Used Dictionaries. In COLT, pp. 37–1. Sun, J., Q. Qu, and J. Wright (2017). Complete dictionary recovery over the sphere I: Overview and the geometric picture. IEEE Transactions on Information Theory 63(2), 853–884. Tropp, J. A. (2006). Just relax: Convex programming methods for identifying sparse signals in noise. IEEE transactions on information theory 52(3), 1030–1051. Tsybakov, A. B. (2009). Introduction to nonparametric estimation. Revised and extended from the 2004 French original. Translated by Vladimir Zaiats. Wu, S. and B. Yu (2015). Local identifiability of ℓ1-minimization dictionary learning: a sufficient and almost necessary condition. arXiv preprint arXiv:1505.04363. Yu, B. (1997). Assouad, Fano, and Le Cam. In Festschrift for Lucien Le Cam, pp. 423–435. Springer. Zhao, P. and B. Yu (2006). On model selection consistency of Lasso. Journal of Machine learning research 7(Nov), 2541–2563. 10
2017
131
6,599
Sparse Embedded k-Means Clustering Weiwei Liu†,♮,∗, Xiaobo Shen‡,∗, Ivor W. Tsang♮ † School of Computer Science and Engineering, The University of New South Wales ‡ School of Computer Science and Engineering, Nanyang Technological University ♮Centre for Artificial Intelligence, University of Technology Sydney {liuweiwei863,njust.shenxiaobo}@gmail.com ivor.tsang@uts.edu.au Abstract The k-means clustering algorithm is a ubiquitous tool in data mining and machine learning that shows promising performance. However, its high computational cost has hindered its applications in broad domains. Researchers have successfully addressed these obstacles with dimensionality reduction methods. Recently, [1] develop a state-of-the-art random projection (RP) method for faster k-means clustering. Their method delivers many improvements over other dimensionality reduction methods. For example, compared to the advanced singular value decomposition based feature extraction approach, [1] reduce the running time by a factor of min{n, d}ϵ2log(d)/k for data matrix X ∈Rn×d with n data points and d features, while losing only a factor of one in approximation accuracy. Unfortunately, they still require O( ndk ϵ2log(d)) for matrix multiplication and this cost will be prohibitive for large values of n and d. To break this bottleneck, we carefully build a sparse embedded k-means clustering algorithm which requires O(nnz(X)) (nnz(X) denotes the number of non-zeros in X) for fast matrix multiplication. Moreover, our proposed algorithm improves on [1]’s results for approximation accuracy by a factor of one. Our empirical studies corroborate our theoretical findings, and demonstrate that our approach is able to significantly accelerate k-means clustering, while achieving satisfactory clustering performance. 1 Introduction Due to its simplicity and flexibility, the k-means clustering algorithm [2, 3, 4] has been identified as one of the top 10 data mining algorithms. It has shown promising results in various real world applications, such as bioinformatics, image processing, text mining and image analysis. Recently, the dimensionality and scale of data continues to grow in many applications, such as biological, finance, computer vision and web [5, 6, 7, 8, 9], which poses a serious challenge in designing efficient and accurate algorithmic solutions for k-means clustering. To address these obstacles, one prevalent technique is dimensionality reduction, which embeds the original features into low dimensional space before performing k-means clustering. Dimensionality reduction encompasses two kinds of approaches: 1) feature selection (FS), which embeds the data into a low dimensional space by selecting the actual dimensions of the data; and 2) feature extraction (FE), which finds an embedding by constructing new artificial features that are, for example, linear combinations of the original features. Laplacian scores [10] and Fisher scores [11] are two basic feature selection methods. However, they lack a provable guarantee. [12] first propose a provable singular value decomposition (SVD) feature selection method. It uses the SVD to find O(klog(k/ϵ)/ϵ2) actual features such that with constant probability the clustering structure ∗The first two authors make equal contributions. 31st Conference on Neural Information Processing Systems (NIPS 2017), Long Beach, CA, USA. Table 1: Dimension reduction methods for k-means clustering. The third column corresponds to the number of selected or extracted features. The fourth column corresponds to the time complexity of each dimension reduction method. The last column corresponds to the approximation accuracy. N/A denotes not available. nnz(X) denotes the number of non-zeros in X. ϵ and δ represent the gap to optimality and the confidence level, respectively. Sparse embedding is abbreviated to SE. METHOD DESCRIPTION DIMENSIONS TIME ACCURACY [13] SVD-FE k O(nd min{n, d}) 2 FOLKLORE RP-FE O( log(n) ϵ2 ) O( ndlog(n) ϵ2log(d) ) 1 + ϵ [12] SVD-FS O( klog(k/ϵ) ϵ2 ) O(nd min{n, d}) 2 + ϵ [14] SVD-FE O( k ϵ2 ) O(nd min{n, d}) 1 + ϵ [1] RP-FE O( k ϵ2 ) O( ndk ϵ2log(d)) 2 + ϵ [15] RP-FE O( log(n) n ) O(dlog(d)n + dlog(n)) N/A THIS PAPER SE-FE O(max( k+log(1/δ) ϵ2 , 6 ϵ2δ )) O(nnz(X)) 1 + ϵ is preserved within a factor of 2 + ϵ. [13] propose a popular feature extraction approach, where k artificial features are constructed using the SVD such that the clustering structure is preserved within a factor of two. Recently, corollary 4.5 in [14]’s study improves [13]’s results, by claiming that O( k ϵ2 ) dimensions are sufficient for preserving 1 + ϵ accuracy. Because SVD is computationally expensive, we focus on another important feature extraction method that randomly projects the data into low dimensional space. [1] develop a state-of-the-art random projection (RP) method, which is based on random sign matrices. Compared to SVD-based feature extraction approaches [14], [1] reduce the running time by a factor of min{n, d}ϵ2log(d)/k2, while losing only a factor of one in approximation accuracy. They also improve the results of the folklore RP method by a factor of log(n)/k in terms of the number of embedded dimensions and the running time, while losing a factor of one in approximation accuracy. Compared to SVD-based feature selection methods, [1] reduce the embedded dimension by a factor of log(k/ϵ) and the running time by a factor of min{n, d}ϵ2log(d)/k, respectively. Unfortunately, they still require O( ndk ϵ2log(d)) for matrix multiplication and this cost will be prohibitive for large values of n and d. This paper carefully constructs a sparse matrix for the RP method that only requires O(nnz(X)) for fast matrix multiplication. Our algorithm is significantly faster than other dimensionality reduction methods, especially when nnz(X) << nd. Theoretically, we show a provable guarantee for our algorithm. Given ˜d = O(max( k+log(1/δ) ϵ2 , 6 ϵ2δ)), with probability at least 1 −O(δ), our algorithm preserves the clustering structure within a factor of 1 + ϵ, improving on the results of [12] and [1] by a factor of one for approximation accuracy. These results are summarized in Table 1. Experiments on three real-world data sets show that our algorithm outperforms other dimension reduction methods. The results verify our theoretical analysis. We organize this paper as follows. Section 2 introduces the concept of ϵ-approximation k-means clustering and our proposed sparse embedded k-means clustering algorithm. Section 3 analyzes the provable guarantee for our algorithm and experimental results are presented in Section 4. The last section provides our conclusions. 2 Sparse Embedded k-Means Clustering 2.1 ϵ-Approximation k-Means Clustering Given X ∈Rn×d with n data points and d features. We denote the transpose of the vector/matrix by superscript ′ and the logarithms to base 2 by log. Let r = rank(X). By using singular value decomposition (SVD), we have X = UΣV ′, where Σ ∈Rr×r is a positive diagonal matrix containing the singular values of X in decreasing order (σ1 ≥σ2 ≥. . . ≥σr), and U ∈Rn×r and V ∈Rd×r contain orthogonal left and right singular vectors of X. Let Uk and Vk represent U and V with all but their first k columns zeroed out, respectively, and Σk be Σ with all but its largest k singular values zeroed out. Assume k ≤r, [16] have already shown that Xk = UkΣkV ′ k is the optimal rank k 2Refer to Section 2.1 for the notations. 2 approximation to X for any unitarily invariant norm, including the Frobenius and spectral norms. The pseudoinverse of X is given by X+ = V Σ−1U ′. Assume Xr|k = X −Xk. In denotes the n × n identity matrix. Let ||X||F be the Frobenius norm of matrix X. For concision, ||A||2 represents the spectral norm of A if A is a matrix and the Euclidean norm of A if A is a vector. Let nnz(X) denote the number of non-zeros in X. The task of k-means clustering is to partition n data points in d dimensions into k clusters. Let µi be the centroid of the vectors in cluster i and c(xi) be the cluster that xi is assigned to. Assume D ∈Rn×k is the indicator matrix which has exactly one non-zero element per row, which denotes cluster membership. The i-th data point belongs to the j-th cluster if and only if Dij = 1/√zj, where zj denotes the number of data points in cluster j. Note that D′D = Ik and the i-th row of DD′X is the centroid of xi’s assigned cluster. Thus, we have Pn i=1 ||xi −µc(xi)||2 2 = ||X −DD′X||2 F . We formally define the k-means clustering task as follows, which is also studied in [12] and [1]. Definition 1 (k-Means Clustering). Given X ∈Rn×d and a positive integer k denoting the number of clusters. Let D be the set of all n × k indicator matrices D. The task of k-means clustering is to solve min D∈D ||X −DD′X||2 F (1) To accelerate the optimization of problem 1, we aim to find a ϵ-approximate solution for problem 1 by optimizing D (either exactly or approximately) over an embedded matrix ˆX ∈Rn× ˜d with ˜d < d. To measure the quality of approximation, we first define the ϵ-approximation embedded matrix: Definition 2 (ϵ-Approximation Embedded Matrix). Given 0 ≤ϵ < 1 and a non-negative constant τ. ˆX ∈Rn× ˜d with ˜d < d is a ϵ-approximation embedded matrix for X, if (1 −ϵ)||X −DD′X||2 F≤|| ˆX −DD′ ˆX||2 F + τ ≤(1 + ϵ)||X −DD′X||2 F (2) We show that a ϵ-approximation embedded matrix is sufficient for approximately optimizing problem 1: Lemma 1 (ϵ-Approximation k-Means Clustering). Given X ∈Rn×d and D be the set of all n × k indicator matrices D, let D∗= arg minD∈D ||X −DD′X||2 F . Given ˆX ∈Rn× ˜d with ˜d < d, let ˆD∗= arg minD∈D || ˆX −DD′ ˆX||2 F . If ˆX is a ϵ′-approximation embedded matrix for X, given ϵ = 2ϵ′/(1 −ϵ′), then for any γ ≥1, if || ˆX −ˆD ˆD′ ˆX||2 F ≤γ|| ˆX −ˆD∗ˆD∗′ ˆX||2 F , we have ||X −ˆD ˆD′X||2 F ≤(1 + ϵ)γ||X −D∗D∗′X||2 F Proof. By definition, we have || ˆX −ˆD∗ˆD∗′ ˆX||2 F ≤|| ˆX −D∗D∗′ ˆX||2 F and thus || ˆX −ˆD ˆD′ ˆX||2 F ≤γ|| ˆX −D∗D∗′ ˆX||2 F (3) Since ˆX is a ϵ-approximation embedded matrix for X, we have || ˆX −D∗D∗′ ˆX||2 F≤(1 + ϵ′)||X −D∗D∗′X||2 F −τ || ˆX −ˆD ˆD′ ˆX||2 F≥(1 −ϵ′)||X −ˆD ˆD′X||2 F −τ (4) Combining Eq.(3) and Eq.(4), we obtain: (1 −ϵ′)||X −ˆD ˆD′X||2 F −τ ≤|| ˆX −ˆD ˆD′ ˆX||2 F ≤γ|| ˆX −D∗D∗′ ˆX||2 F ≤(1 + ϵ′)γ||X −D∗D∗′X||2 F −τγ (5) Eq.(5) implies that ||X −ˆD ˆD′X||2 F ≤(1 + ϵ′)/(1 −ϵ′)γ||X −D∗D∗′X||2 F ≤(1 + ϵ)γ||X −D∗D∗′X||2 F (6) Remark. Lemma 1 implies that if ˆD is an optimal solution for ˆX, then it also preserves ϵapproximation for X. Parameter γ allows ˆD to be approximately global optimal for ˆX. 3 Algorithm 1 Sparse Embedded k-Means Clustering Input: X ∈Rn×d. Number of clusters k. Output: ϵ-approximate solution for problem 1. 1: Set ˜d = O(max( k+log(1/δ) ϵ2 , 6 ϵ2δ)). 2: Build a random map h so that for any i ∈[d], h(i) = j for j ∈[ ˜d] with probability 1/ ˜d. 3: Construct matrix Φ ∈{0, 1}d× ˜d with Φi,h(i) = 1, and all remaining entries 0. 4: Construct matrix Q ∈Rd×d is a random diagonal matrix whose entries are i.i.d. Rademacher variables. 5: Compute the product ˆX = XQΦ and run exact or approximate k-means algorithms on ˆX. 2.2 Sparse Embedding [1] construct a random embedded matrix for fast k-means clustering by post-multiplying X with a d × ˜d random matrix having entries 1 √ ˜d or −1 √ ˜d with equal probability. However, this method requires O( ndk ϵ2log(d)) for matrix multiplication and this cost will be prohibitive for large values of n and d. To break this bottleneck, Algorithm 1 demonstrates our sparse embedded k-means clustering, which requires O(nnz(X)) for fast matrix multiplication. Our algorithm is significantly faster than other dimensionality reduction methods, especially when nnz(X) << nd. For an index i taking values in the set {1, · · · , n}, we write i ∈[n]. Next, we state our main theorem to show that XQΦ is the ϵ-approximation embedded matrix for X: Theorem 1. Let Φ and Q be constructed as in Algorithm 1 and R = (QΦ)′ ∈R ˜d×d. Given ˜d = O(max( k+log(1/δ) ϵ2 , 6 ϵ2δ)). Then for any X ∈Rn×d, with a probability of at least 1 −O(δ), XR′ is the ϵ-approximation embedded matrix for X. 3 Proofs Let Z = In −DD′ and tr be the trace notation. Eq.(2) can be formulated as: (1 −ϵ)tr(ZXX′Z) ≤ tr(Z ˆX ˆX′Z)+τ ≤(1+ϵ)tr(ZXX′Z). Then, we try to approximate XX′ with ˆX ˆX′. To prove our main theorem, we write ˆX = XR′ and our goal is to show that tr(ZXX′Z) can be approximated by tr(ZXR′RX′Z). Lemma 2 provides conditions on the error matrix E = ˆX ˆX′ −XX′ that are sufficient to guarantee that ˆX is a ϵ-approximation embedded matrix for X. For any two symmetric matrices A, B ∈Rn×n, A ⪯B indicates that B −A is positive semidefinite. Let λi(A) denote the i-th largest eigenvalue of A in absolute value. ⟨·, ·⟩represents the inner product, and 0n×d denotes an n × d zero matrix with all its entries being zero. Lemma 2. Let C = XX′ and ˆC = ˆX ˆX′. If we write ˆC = C + E1 + E2 + E3 + E4, where: (i) E1 is symmetric and −ϵ1C ⪯E1 ⪯ϵ1C. (ii) E2 is symmetric, Pk i=1 |λi(E2)| ≤ϵ2||Xr|k||2 F , and tr(E2) ≤˜ϵ2||Xr|k||2 F . (iii) The columns of E3 fall in the column span of C and tr(E ′ 3C+E3) ≤ϵ2 3||Xr|k||2 F . (iv) The rows of E4 fall in the row span of C and tr(E4C+E ′ 4) ≤ϵ2 4||Xr|k||2 F . and ϵ1 + ϵ2 + ˜ϵ2 + ϵ3 + ϵ4 = ϵ, then ˆX is a ϵ-approximation embedded matrix for X. Specifically, we have (1 −ϵ)tr(ZCZ) ≤tr(Z ˆCZ) −min{0, tr(E2)} ≤(1 + ϵ)tr(ZCZ). The proof can be referred to [17]. Next, we show XR′ is the ϵ-approximation embedded matrix for X. We first present the following theorem: Theorem 2. Assume r > 2k and let V2k ∈Rd×r represent V with all but their first 2k columns zeroed out. We define M1 = V ′ 2k, M2 = √ k/||Xr|k||F (X −XV2kV ′ 2k) and M ∈R(n+r)×d as containing M1 as its first r rows and M2 as its lower n rows. We construct R = (QΦ)′ ∈R ˜d×d, 4 which is shown in Algorithm 1. Given ˜d = O(max( k+log(1/δ) ϵ2 , 6 ϵ2δ)), then for any X ∈Rn×d, with a probability of at least 1 −O(δ), we have (i) ||(RM ′)′(RM ′) −MM ′||2 < ϵ. (ii) |||RM ′ 2||2 F −||M ′ 2||2 F | ≤ϵk. Proof. To prove the first result, one can easily check that M1M ′ 2 = 0r×n, thus MM ′ is a block diagonal matrix with an upper left block equal to M1M ′ 1 and lower right block equal to M2M ′ 2. The spectral norm of M1M ′ 1 is 1. ||M2M ′ 2||2 = ||M2||2 2 = k||X−XV2kV ′ 2k||2 2 ||Xr|k||2 F = k||Xr|2k||2 2 ||Xr|k||2 F . As ||Xr|k||2 F ≥k||Xr|2k||2 2, we derive ||M2M ′ 2||2 ≤1. Since MM ′ is a block diagonal matrix, we have ||M||2 2 = ||MM ′||2 = max{||M1M ′ 1||2, ||M2M ′ 2||2} = 1. tr(M1M ′ 1) = 2k. tr(M2M ′ 2) = k||Xr|2k||2 F ||Xr|k||2 F . As ||Xr|k||2 F ≥||Xr|2k||2 F , we derive tr(M2M ′ 2) ≤k. Then we have ||M||2 F = tr(MM ′) = tr(M1M ′ 1) + tr(M2M ′ 2) ≤3k. Applying Theorem 6 from [18], we can obtain that given ˜d = O( k+log(1/δ) ϵ2 ), with a probability of at least 1 −δ, ||(RM ′)′(RM ′) −MM ′||2 < ϵ. The proof of the second result can be found in the Supplementary Materials. Based on Theorem 2, we show that ˆX = XR′ satisfies the conditions of Lemma 2. Lemma 3. Assume r > 2k and we construct M and R as in Theorem 2. Given ˜d = O(max( k+log(1/δ) ϵ2 , 6 ϵ2δ)), then for any X ∈Rn×d, with a probability of at least 1−O(δ), ˆX = XR′ satisfies the conditions of Lemma 2. Proof. We construct H1 ∈Rn×(n+r) as H1 = [XV2k, 0n×n], thus H1M = XV2kV ′ 2k. And we set H2 ∈Rn×(n+r) as H2 = [0n×r, ||Xr|k||F √ k In], so we have H2M = ||Xr|k||F √ k M2 = X −XV2kV ′ 2k = Xr|2k and X = H1M + H2M and we obtain the following: E = ˆX ˆX′ −XX′ = XR′RX′ −XX′ = 1⃝+ 2⃝+ 3⃝+ 4⃝ (7) Where 1⃝= H1MR′RM ′H′ 1 −H1MM ′H′ 1, 2⃝= H2MR′RM ′H′ 2 −H2MM ′H′ 2, 3⃝= H1MR′RM ′H′ 2 −H1MM ′H′ 2 and 4⃝= H2MR′RM ′H′ 1 −H2MM ′H′ 1. We bound 1⃝, 2⃝, 3⃝and 4⃝separately, showing that each corresponds to one of the error terms described in Lemma 2. Bounding 1⃝. E1 = H1MR′RM ′H′ 1 −H1MM ′H′ 1 = XV2kV ′ 2kR′RV2kV ′ 2kX′ −XV2kV ′ 2kV2kV ′ 2kX′ (8) E1 is symmetric. By Theorem 2, we know that with a probability of at least 1 −δ, ||(RM ′)′(RM ′) − MM ′||2 < ϵ holds. Then we get −ϵIn+r ⪯(RM ′)′(RM ′) −MM ′ ⪯ϵIn+r. And we derive the following: −ϵH1H′ 1 ⪯E1 ⪯ϵH1H′ 1 (9) For any vector v, v′XV2kV ′ 2kV2kV ′ 2kX′v = ||V2kV ′ 2kX′v||2 2 ≤ ||V2kV ′ 2k||2 2||X′v||2 2 = ||X′v||2 2 = v′XX′v, so H1MM ′H′ 1 = XV2kV ′ 2kV2kV ′ 2kX′ ⪯XX′. Since H1MM ′H′ 1 = XV2kV ′ 2kV2kV ′ 2kX′ = XV2kV ′ 2kX′ = H1H′ 1, we have H1H′ 1 = H1MM ′H′ 1 ⪯XX′ = C (10) Combining Eqs.(9) and (10), we arrive at a probability of at least 1 −δ, −ϵC ⪯E1 ⪯ϵC (11) satisfying the first condition of Lemma 2. Bounding 2⃝. E2 =H2MR′RM ′H′ 2 −H2MM ′H′ 2 =(X −XV2kV ′ 2k)R′R(X −XV2kV ′ 2k)′ −(X −XV2kV ′ 2k)(X −XV2kV ′ 2k)′ (12) 5 E2 is symmetric. Note that H2 just selects M2 from M and scales it by ||Xr|k||F / √ k. Using Theorem 2, we know that with a probability of at least 1 −δ, tr(E2) = ||Xr|k||2 F k tr(M2R′RM ′ 2 −M2M ′ 2) ≤ϵ||Xr|k||2 F (13) Applying Theorem 6.2 from [19] and rescaling ϵ , we can obtain a probability of at least 1 −δ, ||E2||F = ||Xr|2kR′RX′ r|2k −Xr|2kX′ r|2k||F ≤ ϵ √ k ||Xr|2k||2 F (14) Combining Eq.(14), Cauchy-Schwarz inequality and ||Xr|2k||2 F ≤||Xr|k||2 F , we get that with a probability of at least 1 −δ, k X i=1 |λi(E2)| ≤ √ k||E2||F ≤ϵ||Xr|k||2 F (15) Eqs.(13) and (15) satisfy the second conditions of Lemma 2. Bounding 3⃝. E3 =H1MR′RM ′H′ 2 −H1MM ′H′ 2 =XV2kV ′ 2kR′R(X −XV2kV ′ 2k)′ −XV2kV ′ 2k(X −XV2kV ′ 2k)′ (16) The columns of E3 are in the column span of H1M = XV2kV ′ 2k, and so in the column span of C. ||V2k||2 F = tr(V ′ 2kV2k) = 2k. As V ′ 2kV = V ′ 2kV2k, V ′ 2kX′ r|2k = V ′ 2k(V ΣU ′ −V2kΣ2kU ′ 2k) = Σ2kU ′ 2k −Σ2kU ′ 2k = 0r×n. Applying Theorem 6.2 from [19] again and rescaling ϵ, we can obtain that with a probability of at least 1 −δ, tr(E ′ 3C+E3) =||Σ−1U ′(H1MR′RM ′H′ 2 −H1MM ′H′ 2)||2 F =||V ′ 2kR′RX′ r|2k −0r×n||2 F ≤ϵ2||Xr|k||2 F (17) Thus, Eq.(17) satisfies the third condition of Lemma 2. Bounding 4⃝. E4 =H2MR′RM ′H′ 1 −H2MM ′H′ 1 =(X −XV2kV ′ 2k)R′RV2kV ′ 2kX′ −(X −XV2kV ′ 2k)V2kV ′ 2kX′ (18) E4 = E ′ 3 and thus we immediately have that with a probability of at least 1 −δ, tr(E4C+E ′ 4) ≤ϵ2||Xr|k||2 F (19) Lastly, Eqs.(11), (13), (15), (17) and (19) ensure that, for any X ∈Rn×d, ˆX = XR′ satisfies the conditions of Lemma 2 and is the ϵ-approximation embedded matrix for X with a probability of at least 1 −O(δ). 4 Experiment 4.1 Data Sets and Baselines We denote our proposed sparse embedded k-means clustering algorithm as SE for short. This section evaluates the performance of the proposed method on four real-world data sets: COIL20, SECTOR, RCV1 and ILSVRC2012. The COIL20 [20] and ILSVRC2012 [21] data sets are collected from website34, and other data sets are collected from the LIBSVM website5. The statistics of these data sets are presented in the Supplementary Materials. We compare SE with several other dimensionality reduction techniques: 3http://www.cs.columbia.edu/CAVE/software/softlib/coil-20.php 4http://www.image-net.org/challenges/LSVRC/2012/ 5https://www.csie.ntu.edu.tw/ cjlin/libsvmtools/datasets/ 6 # of dimensions 0 200 400 600 800 1000 Clustering accuracy (in %) 10 20 30 40 50 60 70 k-means SVD LLE LS RP PD SE (a) COIL20 # of dimensions 0 200 400 600 800 1000 Clustering accuracy (in %) 0 5 10 15 20 k-means SVD LLE LS RP PD SE (b) SECTOR # of dimensions 0 200 400 600 800 1000 Clustering accuracy (in %) 10 15 20 25 30 k-means RP PD SE (c) RCV1 # of dimensions 0 200 400 600 800 1000 Clustering accuracy (in %) 0 10 20 30 40 k-means RP PD SE (d) ILSVRC2012 Figure 1: Clustering accuracy of various methods on COIL20, SECTOR, RCV1 and ILSVRC2012 data sets. # of dimensions 0 200 400 600 800 1000 Preprocessing time (in second) 10-3 10-2 10-1 100 101 SVD LLE LS RP PD SE (a) COIL20 # of dimensions 0 200 400 600 800 1000 Preprocessing time (in second) 10-2 100 102 104 SVD LLE LS RP PD SE (b) SECTOR # of dimensions 0 200 400 600 800 1000 Preprocessing time (in second) 100 101 102 103 RP PD SE (c) RCV1 # of dimensions 0 200 400 600 800 1000 Preprocessing time (in second) 10-2 100 102 104 RP PD SE (d) ILSVRC2012 Figure 2: Dimension reduction time of various methods on COIL20, SECTOR, RCV1 and ILSVRC2012 data sets. # of dimensions 0 200 400 600 800 1000 Clustering time (in second) 10-2 10-1 100 101 k-means SVD LLE LS RP PD SE (a) COIL20 # of dimensions 0 200 400 600 800 1000 Clustering time (in second) 10-1 100 101 102 k-means SVD LLE LS RP PD SE (b) SECTOR # of dimensions 0 200 400 600 800 1000 Clustering time (in second) 101 102 103 k-means RP PD SE (c) RCV1 # of dimensions 0 500 1000 Clustering time (in second) 103 104 k-means RP PD SE (d) ILSVRC2012 Figure 3: Clustering time of various methods on COIL20, SECTOR, RCV1 and ILSVRC2012 data sets. • SVD: The singular value decomposition or principal components analysis dimensionality reduction approach. • LLE: The local linear embedding (LLE) algorithm is proposed by [22]. We use the code from website6 with default parameters. • LS: [10] develop the laplacian score (LS) feature selection method. We use the code from website7 with default parameters. • PD: [15] propose an advanced compression scheme for accelerating k-means clustering. We use the code from website8 with default parameters. • RP: The state-of-the-art random projection method is proposed by [1]. After dimensionality reduction, we run all methods on a standard k-means clustering package, which is from website9 with default parameters. We also compare all these methods against the standard k-means algorithm on the full dimensional data sets. To measure the quality of all methods, we report clustering accuracy based on the labelled information of the input data. Finally, we report the running 6http://www.cs.nyu.edu/ roweis/lle/ 7www.cad.zju.edu.cn/home/dengcai/Data/data.html 8https://github.com/stephenbeckr/SparsifiedKMeans 9www.cad.zju.edu.cn/home/dengcai/Data/data.html 7 times (in seconds) of both the dimensionality reduction procedure and the k-means clustering for all baselines. 4.2 Results The experimental results of various methods on all data sets are shown in Figures 1, 2 and 3. The Y axes of Figures 2 and 3 represent dimension reduction and clustering time in log scale. We can’t get the results of SVD, LLE and LS within three days on RCV1 and ILSVRC2012 data sets. Thus, these results are not reported. From Figures 1, 2 and 3, we can see that: • As the number of embedded dimensions increases, the clustering accuracy and running times of all dimensionality reduction methods increases, which is consistent with the empirical results in [1]. • Our proposed dimensionality reduction method has superior performance compared to the RP method and other baselines in terms of accuracy, which verifies our theoretical results. LLE and LS generally underperforms on the COIL20 and SECTOR data sets. • SVD and LLE are the two slowest methods compared with the other baselines in terms of dimensionality reduction time. The dimension reduction time of the RP method increases significantly with the increasing dimensions, while our method obtains a stable and lowest dimensionality reduction time. We achieve several hundred orders of magnitude faster than the RP method and other baselines. The results also support our complexity analysis. • All dimensionality reduction methods are significantly faster than standard k-means algorithm with full dimensions. Finally, we conclude that our proposed method is able to significantly accelerate k-means clustering, while achieving satisfactory clustering performance. 5 Conclusion The k-means clustering algorithm is a ubiquitous tool in data mining and machine learning with numerous applications. The increasing dimensionality and scale of data has provided a considerable challenge in designing efficient and accurate k-means clustering algorithms. Researchers have successfully addressed these obstacles with dimensionality reduction methods. These methods embed the original features into low dimensional space, and then perform k-means clustering on the embedded dimensions. SVD is one of the most popular dimensionality reduction methods. However, it is computationally expensive. Recently, [1] develop a state-of-the-art RP method for faster k-means clustering. Their method delivers many improvements over other dimensionality reduction methods. For example, compared to an advanced SVD-based feature extraction approach [14], [1] reduce the running time by a factor of min{n, d}ϵ2log(d)/k, while only losing a factor of one in approximation accuracy. They also improve the result of the folklore RP method by a factor of log(n)/k in terms of the number of embedded dimensions and the running time, while losing a factor of one in approximation accuracy. Unfortunately, it still requires O( ndk ϵ2log(d)) for matrix multiplication and this cost will be prohibitive for large values of n and d. To break this bottleneck, we carefully construct a sparse matrix for the RP method that only requires O(nnz(X)) for fast matrix multiplication. Our algorithm is significantly faster than other dimensionality reduction methods, especially when nnz(X) << nd. Furthermore, we improve the results of [12] and [1] by a factor of one for approximation accuracy. Our empirical studies demonstrate that our proposed algorithm outperforms other dimension reduction methods, which corroborates our theoretical findings. Acknowledgments We would like to thank the area chairs and reviewers for their valuable comments and constructive suggestions on our paper. This project is supported by the ARC Future Fellowship FT130100746, ARC grant LP150100671, DP170101628, DP150102728, DP150103071, NSFC 61232006 and NSFC 61672235. 8 References [1] Christos Boutsidis, Anastasios Zouzias, Michael W. Mahoney, and Petros Drineas. Randomized dimensionality reduction for k-means clustering. IEEE Trans. Information Theory, 61(2):1045–1062, 2015. [2] J. A. Hartigan and M. A. Wong. Algorithm as 136: A k-means clustering algorithm. Applied Statistics, 28(1):100–108, 1979. [3] Xiao-Bo Shen, Weiwei Liu, Ivor W. Tsang, Fumin Shen, and Quan-Sen Sun. Compressed k-means for large-scale clustering. In AAAI, pages 2527–2533, 2017. [4] Xinwang Liu, Miaomiao Li, Lei Wang, Yong Dou, Jianping Yin, and En Zhu. Multiple kernel k-means with incomplete kernels. In AAAI, pages 2259–2265, 2017. [5] Tom M. Mitchell, Rebecca A. Hutchinson, Radu Stefan Niculescu, Francisco Pereira, Xuerui Wang, Marcel Adam Just, and Sharlene D. Newman. Learning to decode cognitive states from brain images. Machine Learning, 57(1-2):145–175, 2004. [6] Jianqing Fan, Richard Samworth, and Yichao Wu. Ultrahigh dimensional feature selection: Beyond the linear model. JMLR, 10:2013–2038, 2009. [7] Jorge Sánchez, Florent Perronnin, Thomas Mensink, and Jakob J. Verbeek. Image classification with the fisher vector: Theory and practice. International Journal of Computer Vision, 105(3):222–245, 2013. [8] Yiteng Zhai, Yew-Soon Ong, and Ivor W. Tsang. The emerging “big dimensionality”. IEEE Computational Intelligence Magazine, 9(3):14–26, 2014. [9] Weiwei Liu and Ivor W. Tsang. Making decision trees feasible in ultrahigh feature and label dimensions. Journal of Machine Learning Research, 18(81):1–36, 2017. [10] Xiaofei He, Deng Cai, and Partha Niyogi. Laplacian score for feature selection. In NIPS, pages 507–514, 2005. [11] Donald H. Foley and John W. Sammon Jr. An optimal set of discriminant vectors. IEEE Trans. Computers, 24(3):281–289, 1975. [12] Christos Boutsidis, Michael W. Mahoney, and Petros Drineas. Unsupervised feature selection for the k-means clustering problem. In NIPS, pages 153–161, 2009. [13] Petros Drineas, Alan M. Frieze, Ravi Kannan, Santosh Vempala, and V. Vinay. Clustering in large graphs and matrices. In Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 291–299, 1999. [14] Dan Feldman, Melanie Schmidt, and Christian Sohler. Turning big data into tiny data: Constant-size coresets for k-means, PCA and projective clustering. In Proceedings of the Twenty-Fourth Annual ACMSIAM Symposium on Discrete Algorithms, pages 1434–1453, 2013. [15] Farhad Pourkamali Anaraki and Stephen Becker. Preconditioned data sparsification for big data with applications to PCA and k-means. IEEE Trans. Information Theory, 63(5):2954–2974, 2017. [16] Leon Mirsky. Symmetric gauge functions and unitarily invariant norms. The Quarterly Journal of Mathematics, 11:50–59, 1960. [17] Michael B. Cohen, Sam Elder, Cameron Musco, Christopher Musco, and Madalina Persu. Dimensionality reduction for k-means clustering and low rank approximation. In Proceedings of the Forty-Seventh Annual ACM on Symposium on Theory of Computing, pages 163–172, 2015. [18] Michael B. Cohen, Jelani Nelson, and David P. Woodruff. Optimal approximate matrix product in terms of stable rank. In 43rd International Colloquium on Automata, Languages, and Programming, pages 11:1–11:14, 2016. [19] Daniel M. Kane and Jelani Nelson. Sparser johnson-lindenstrauss transforms. Journal of the ACM, 61(1):4:1–4:23, 2014. [20] Rong Wang, Feiping Nie, Xiaojun Yang, Feifei Gao, and Minli Yao. Robust 2DPCA with non-greedy l1-norm maximization for image analysis. IEEE Trans. Cybernetics, 45(5):1108–1112, 2015. [21] Weiwei Liu, Ivor W. Tsang, and Klaus-Robert Müller. An easy-to-hard learning paradigm for multiple classes and multiple labels. Journal of Machine Learning Research, 18(94):1–38, 2017. [22] Sam T. Roweis and Lawrence K. Saul. Nonlinear dimensionality reduction by locally linear embedding. SCIENCE, 290:2323–2326, 2000. 9
2017
132