Datasets:
Add files using upload-large-folder tool
Browse files- md/train/-OrwaD3bG91/-OrwaD3bG91.md +241 -0
- md/train/1ODSsnoMBav/1ODSsnoMBav.md +273 -0
- md/train/3_MUAtqR0aA/3_MUAtqR0aA.md +217 -0
- md/train/6tM849_6RF9/6tM849_6RF9.md +361 -0
- md/train/8hGabvaV2GQ/8hGabvaV2GQ.md +414 -0
- md/train/9MdLwggYa02/9MdLwggYa02.md +222 -0
- md/train/9QffERDO_rJ/9QffERDO_rJ.md +485 -0
- md/train/B1zlp1bRW/B1zlp1bRW.md +412 -0
- md/train/BJGVX3CqYm/BJGVX3CqYm.md +279 -0
- md/train/BJKYvt5lg/BJKYvt5lg.md +221 -0
- md/train/BJluy2RcFm/BJluy2RcFm.md +0 -0
- md/train/BJzVUj0qtQ/BJzVUj0qtQ.md +275 -0
- md/train/BkgYPREtPr/BkgYPREtPr.md +398 -0
- md/train/BylRkAEKDH/BylRkAEKDH.md +369 -0
- md/train/ByxGkySKwH/ByxGkySKwH.md +472 -0
- md/train/EKV158tSfwv/EKV158tSfwv.md +0 -0
- md/train/H1emus0qF7/H1emus0qF7.md +534 -0
- md/train/HJGXzmspb/HJGXzmspb.md +327 -0
- md/train/HbZTcIuiMAG/HbZTcIuiMAG.md +481 -0
- md/train/HkePNpVKPB/HkePNpVKPB.md +431 -0
- md/train/HkgxasA5Ym/HkgxasA5Ym.md +259 -0
- md/train/Jnspzp-oIZE/Jnspzp-oIZE.md +276 -0
- md/train/K6y77KRUowQ/K6y77KRUowQ.md +288 -0
- md/train/KJ5h-yfUHa/KJ5h-yfUHa.md +272 -0
- md/train/KbV-UZRKb3g/KbV-UZRKb3g.md +225 -0
- md/train/QkVi6KogNbu/QkVi6KogNbu.md +536 -0
- md/train/S1g2JnRcFX/S1g2JnRcFX.md +553 -0
- md/train/S1giVsRcYm/S1giVsRcYm.md +326 -0
- md/train/S1lwRjR9YX/S1lwRjR9YX.md +297 -0
- md/train/SJeFNoRcFQ/SJeFNoRcFQ.md +0 -0
- md/train/SJg9z6VFDr/SJg9z6VFDr.md +601 -0
- md/train/SJlsFpVtDB/SJlsFpVtDB.md +0 -0
- md/train/SJxUjlBtwB/SJxUjlBtwB.md +375 -0
- md/train/SktLlGbRZ/SktLlGbRZ.md +312 -0
- md/train/SkzK4iC5Ym/SkzK4iC5Ym.md +916 -0
- md/train/SyJS-OgR-/SyJS-OgR-.md +352 -0
- md/train/SygGlIBcel/SygGlIBcel.md +296 -0
- md/train/SylJ1D1C-/SylJ1D1C-.md +437 -0
- md/train/Uq_tGs7N54M/Uq_tGs7N54M.md +301 -0
- md/train/Ut1vF_q_vC/Ut1vF_q_vC.md +429 -0
- md/train/e_yvNqkJKAW/e_yvNqkJKAW.md +271 -0
- md/train/h7FqQ6hCK18/h7FqQ6hCK18.md +355 -0
- md/train/kB8DkEKSDH/kB8DkEKSDH.md +350 -0
- md/train/pvjfA4wogD6/pvjfA4wogD6.md +255 -0
- md/train/rkpdnIqlx/rkpdnIqlx.md +319 -0
- md/train/ryeNPi0qKX/ryeNPi0qKX.md +212 -0
- md/train/ryepFJbA-/ryepFJbA-.md +323 -0
- md/train/rylNH20qFQ/rylNH20qFQ.md +331 -0
- md/train/uUlGTEbBRL/uUlGTEbBRL.md +0 -0
- pdf/train/bNdohBx9sPa.pdf +0 -0
md/train/-OrwaD3bG91/-OrwaD3bG91.md
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# What Matters for Adversarial Imitation Learning?
|
| 2 |
+
|
| 3 |
+
Manu Orsini∗, Anton Raichuk∗, Léonard Hussenot∗†, Damien Vincent, Robert Dadashi, Sertan Girgin, Matthieu Geist, Olivier Bachem, Olivier Pietquin, Marcin Andrychowicz‡
|
| 4 |
+
|
| 5 |
+
Google Research, Brain Team
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Adversarial imitation learning has become a popular framework for imitation in continuous control. Over the years, several variations of its components were proposed to enhance the performance of the learned policies as well as the sample complexity of the algorithm. In practice, these choices are rarely tested all together in rigorous empirical studies. It is therefore difficult to discuss and understand what choices, among the high-level algorithmic options as well as low-level implementation details, matter. To tackle this issue, we implement more than 50 of these choices in a generic adversarial imitation learning framework and investigate their impacts in a large-scale study $( > 5 0 0 \mathrm { k }$ trained agents) with both synthetic and human-generated demonstrations. We analyze the key results and highlight the most surprising findings.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Reinforcement Learning (RL) has shown its ability to perform complex tasks in contexts where clear reward functions can be set-up (e.g. $+ 1$ for winning a chess game) [15, 37, 40, 43] but for many real-world applications, designing a correct reward function is either tedious or impossible [20], while demonstrating a correct behavior is often easy and cheap. Therefore, imitation learning (IL, [4, 7]) might be the key to unlock the resolution of more complex tasks, such as autonomous driving, for which reward functions are much harder to design.
|
| 14 |
+
|
| 15 |
+
The simplest approach to IL is Behavioral Cloning (BC, [2]) which uses supervised learning to predict the expert’s action for any given state. However, BC is often unreliable as prediction errors compound in the course of an episode. Adversarial Imitation Learning (AIL, [14]) aims to remedy this using inspiration from Generative Adversarial Networks (GANs, [9]) and Inverse RL [3, 5, 6]: the policy is trained to generate trajectories that are indistinguishable from the expert’s ones. As in GANs, this is formalized as a two-player game where a discriminator is co-trained to distinguish between the policy and expert trajectories (or states). See App. C for a brief introduction to AIL.
|
| 16 |
+
|
| 17 |
+
A myriad of improvements over the original AIL algorithm were proposed over the years [17, 31, 41, 44, 46], from changing the discriminator’s loss function [17] to switching from on-policy to off-policy agents [31]. However, their relative performance is rarely studied in a controlled setting, and never these changes have never been compared simultaneously. The performance of these high-level choices may also depend on low-level implementation details which might be silenced in the original publications [19, 29, 36, 42], as well as the hyperparameters (HPs) used. Thus, assessing whether the proposed changes are the reason for the presented improvements becomes extremely difficult. This lack of proper comparisons slows down the overall research in imitation learning and the industrial applicability of these methods.
|
| 18 |
+
|
| 19 |
+
We investigate such high- and low-level choices in depth and study their impact on the algorithm performance. Hence, as our key contributions, we (1) implement a highly-configurable generic AIL algorithm, with various axes of variation $( > 5 0 \mathrm { H P s } )$ ), including 4 different RL algorithms and 7 regularization schemes for the discriminator, (2) conduct a large-scale $\mathrm { 5 5 0 0 k }$ trained agents) experimental study on 10 continuous-control tasks and (3) analyze the experimental results to provide practical insights and recommendations for designing novel and using existing AIL algorithms. We release this generic AIL agent, implemented in JAX [25] as part of the Acme [49] framework: https://github.com/deepmind/acme/blob/master/acme/agents/jax/ail .
|
| 20 |
+
|
| 21 |
+
Most surprising finding #1: regularizers. While many of our findings confirm common practices in AIL research, some of them are surprising or even contradict prior work. In particular, we find that standard regularizers from Supervised Learning — dropout [10] and weight decay [1] often perform similarly to the regularizers designed specifically for adversarial learning like gradient penalty [18]. Moreover, for easier environments (which were often the only ones used in prior work), we find that it is possible to achieve excellent results without using any explicit discriminator regularization.
|
| 22 |
+
|
| 23 |
+
Most surprising finding #2: human demonstrations. Not only does the performance of AIL heavily depend on whether the demonstrations were collected from a human operator or generated by an RL algorithm, but the relative performance of algorithmic choices also depends on the demonstration source. Our results suggest that artificial demonstrations are not a good proxy for human data and that the very common practice of evaluating IL algorithms only with synthetic demonstrations may lead to algorithms which perform poorly in the more realistic scenarios with human demonstrations.
|
| 24 |
+
|
| 25 |
+
# 2 Experimental design
|
| 26 |
+
|
| 27 |
+
Environments. We focus on continuous-control tasks as robotics appears as one of the main potential applications of IL and a vast majority of the IL literature thus focuses on it. In particular, we run experiments with five widely used environments from OpenAI Gym [13]: HalfCheetah-v2, Hopper-v2, Walker2d-v2, Ant-v2, and Humanoid-v2 and three manipulation environments from Adroit [21]: pen-v0, door-v0, and hammer-v0. The Adroit tasks consist in aligning a pen with a target orientation, opening a door and hammering a nail with a 5-fingered hand.
|
| 28 |
+
|
| 29 |
+
Demonstrations. For the Gym tasks, we generate demonstrations with a SAC [28] agent trained on the environment reward. For the Adroit environments, we use the “expert” and “human” datasets from D4RL [45], which are, respectively, generated by an RL agent and collected from a human operator. As far as we know, our work is the first to solve these tasks with human datasets in the imitation setup (most of the prior work concentrated on Offline RL). For all environments, we use 11 demonstration trajectories. Following prior work [14, 31, 46], we subsample expert demonstrations by only using every $2 0 ^ { \mathrm { t h } }$ state-action pair to make the tasks harder.
|
| 30 |
+
|
| 31 |
+
Adversarial Imitation Learning algorithms. We researched prior work on AIL algorithms and made a list of commonly used design decisions like policy objectives or discriminator regularization techniques. We also included a number of natural options which we have not encountered in literature (e.g. dropout [10] in the discriminator or clipping rewards bigger than a threshold). All choices are listed and explained in App. D. Then, we implemented a single highly-configurable AIL agent which exposes all these choices as configuration options in the Acme framework [49] using JAX [25] for automatic differentiation and Flax [47] for neural networks computation. The configuration space is so wide that it covers the whole family of AIL algorithms, in particular, it mostly covers the setups from AIRL [17] and DAC [31]. We plan to open source the agent implementation.
|
| 32 |
+
|
| 33 |
+
Experimental design. We created a large HP sweep (57 HPs swept, ${ > } 1 2 0 \mathrm { k }$ agents trained) in which each HP is sampled uniformly at random from a discrete set and independently from the other HPs. We manually ensured that the sampling ranges of all HPs are appropriate and cover the optimal values. Then, we analyzed the results of this initial experiment (called wide, detailed description and results in App. G), removed clearly suboptimal options and ran another experiment with the pruned sampling ranges (called main, $4 3 \mathrm { H P s }$ swept, ${ > } 2 5 0 \mathrm { k }$ agents trained, detailed description and results in App. H). The latter experiment serves as the basis for most of the conclusions drawn in this paper but we also run a few additional experiments to investigate some additional questions (App. I and App. J).
|
| 34 |
+
|
| 35 |
+
This pruning of the HP space guarantees that we draw conclusions based on training configurations which are highly competitive (training curves can be found in Fig. 24) while using a large HP sweep (including, for example, multiple different RL algorithms) ensures that our conclusions are robust and valid not only for a single RL algorithm and specific values of HPs, but are more generally applicable. Moreover, many choices may have strong interactions with other related choices, for example we find a surprisingly strong interaction between the discriminator regularization scheme and the discriminator learning rate (Sec. 4). This means that such choices need to be tuned together (as it is the case in our study) and experiments where only a single choice is varied but the interacting choices are kept fixed may lead to misleading conclusions.
|
| 36 |
+
|
| 37 |
+
Performance measure. For each HP configuration and each of the 10 environment-dataset pairs we train a policy and evaluate it 10 times through the training by running it for 50 episodes and computing the average undiscounted return using the environment reward. We then average these scores to obtain a single performance score which approximates the area under the learning curve. This ensures we assign higher scores to HP configurations that learn quickly.
|
| 38 |
+
|
| 39 |
+
Analysis. We consider two different analyses for each choice4:
|
| 40 |
+
|
| 41 |
+
Conditional 95th percentile: For each potential value of that choice (e.g., RL Algorithm $= { \tt P P 0 }$ ), we look at the performance distribution of sampled configurations with that value. We report the 95th percentile of the performance as well as error bars based on bootstrapping.5 This corresponds to an estimate of the performance one can expect if all other choices were tuned with random search and a limited budget of roughly $1 3 \mathrm { H P }$ configurations6. All scores are normalized so that 0 corresponds to a random policy and 1 to the expert performance (expert scores can be found in App. F).
|
| 42 |
+
|
| 43 |
+
Distribution of choice within top $5 \%$ configurations. We further consider for each choice the distribution of values among the top $5 \%$ HP configurations. In particular, we measure the ratio of the frequency of the given value in the top $5 \%$ of HP configurations with the best performance to the frequency of this value among all HP configurations. If certain values are over-represented in the top models (ratio higher than 1), this indicates that the specific choice is important for good performance.
|
| 44 |
+
|
| 45 |
+
We release the raw results of our experiments7 along with a Notebook allowing to load and study it8.
|
| 46 |
+
|
| 47 |
+
# 3 What matters for the agent training?
|
| 48 |
+
|
| 49 |
+
Summary of key findings. The AIRL reward function perform best for synthetic demonstrations while $- \ln ( 1 - D )$ is better for human demonstrations. Using explicit absorbing state is crucial in environments with variable length episodes. Observation normalization strongly affects the performance. Using an off-policy RL algorithm is necessary for good sample complexity while replaying expert data and pretraining with BC improves the performance only slightly.
|
| 50 |
+
|
| 51 |
+
Implicit reward function. In this section, we investigate choices related to agent training with AIL, the most salient of which is probably the choice of the implicit reward function. Let $D ( s , a )$ be the probability of classifying the given state-action pair as expert by the discriminator. In particular, we run experiments with the following reward functions: $\bar { r ( s , a ) = - \log ( 1 - D ( s , a ) ) }$ (used in the original GAIL paper [14]), $r ( s , a ) \bar { = } \log D ( s , a ) - \log ( 1 - D ( s , a ) )$ (called the AIRL reward [17]), $r ( s , a ) = \log D ( s , a )$ (a natural choice we have not encountered in literature), and the FAIRL [46] reward function $r ( s , a ) = - h ( s , a ) \cdot e ^ { h ( s , a ) }$ , where $h ( s , a )$ is the discriminator logit. It can be shown that, under the assumption that all episodes have the same length, maximizing these reward functions corresponds to the minimization of different divergences between the marginal state-action distribution of the expert and the policy. See [46] for an in-depth discussion on this topic. We also consider clipping the rewards with absolute values bigger than a threshold which is a HP.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 1: Comparison of different reward functions. The bars show the 95th percentile across HPs sampling of the average policy performance during training. Plot (a) shows the results averaged across all 10 tasks. Plots (b) and (c) show the performance on the subset of environments with variable length episodes when the absorbing state is disabled (b) or enabled (c). See Fig. 12 and Fig. 72 for the individual results in all environments.
|
| 55 |
+
|
| 56 |
+
The FAIRL reward performed much worse than all others in the initial wide experiment (Fig. 1a) and therefore was not included in our main experiment. This is mostly caused by its inferior performance with off-policy RL algorithms (Fig. 22). Moreover, reward clipping significantly helps the FAIRL reward (Fig. 23) while it does not help the other reward functions apart from some small gains for $- \ln ( 1 - D )$ (Fig. 82). Therefore, we suspect that the poor performance of the FAIRL reward function may be caused by its exponential term which may have very high magnitudes. Moreover, the FAIRL paper [46] mentions that the FAIRL reward is more sensitive to HPs than other reward functions which could also explain its poor performance in our experiments.
|
| 57 |
+
|
| 58 |
+
Fig. 25 shows that the $\ln ( D )$ reward functions performs a bit worse than the other two reward functions in the main experiment. Five out of the ten tasks used in our experiments have variable length episodes with longer episodes correlated with better behaviour (Hopper, Walker2d, Ant, Humanoid, pen) — on these tasks we can notice that $r ( s , a ) = - \ln ( 1 - \bar { D ( s , a ) } )$ often performs best and $r ( \bar { s } , a ) = \ln D ( s , a )$ worst. This can be explained by the fact that $- \ln ( 1 - D ( s , a ) ) > 0$ and $\ln D ( s , a ) < 0$ which means that the former reward encourages longer episodes and the latter one shorter ones [31]. Absorbing state (described in App. D.2) is a technique introduced in the DAC paper [31] to mitigate the mentioned bias and encourage the policy to generate episodes of similar length to demonstrations. In Fig. 1b-c we show how the performance of different reward functions compares in the environments with variable length episodes depending on whether the absorbing state is used. We can notice that without the absorbing state $\bar { r } ( s , a ) \bar { = } - \ln ( 1 - D ( s , a ) ) > \bar { 0 }$ performs much better in the environments with variable episode length which suggests that the learning is driven to a large extent by the reward bias and not actual imitation of the expert behaviour [31]. This effect disappears when the absorbing state is enabled (Fig. 1c).
|
| 59 |
+
|
| 60 |
+
Fig. 72 shows the performance of different reward functions in all environments conditioned on whether the absorbing state is used. If the absorbing state is used, the AIRL reward function performs best in all the environments with RL-generated demonstrations, and $\ln ( D )$ performs only marginally worse. The $- \ln ( 1 - D )$ reward function underperforms on the Humanoid and pen tasks while performing best with human datasets. We provide some hypothesis for this behaviour in Sec. 5, where we discuss human demonstrations in more details.
|
| 61 |
+
|
| 62 |
+
Observation normalization. We consider observation normalization which is applied to the inputs of all neural networks involved in AIL (policy, critic and discriminator). The normalization aims to transform the observations so that that each observation coordinate has mean 0 and standard deviation 1. In particular, we consider computing the normalization statistics either using only the expert demonstrations so that the normalization is fixed throughout the training, or using data from the policy being trained (called online). See App. D.6 for more details. Fig. 26 shows that input normalization significantly influences the performance with the effects on performance being often much larger than those of algorithmic choices like the reward function or RL algorithm used. Surprisingly, normalizing observations can either significantly improve or diminish performance and whether the fixed or online normalization performs better is also environment dependent.
|
| 63 |
+
|
| 64 |
+
Replaying expert data. When demonstrations as well as external rewards are available, it is common for RL algorithms to sample batches for off-policy updates from the demonstrations in addition to the replay buffer [30, 39]. We varied the ratio of the policy to expert data being replayed but found only very minor gains (Fig. 83). Moreover, in the cases when we see some benefits, it is usually best to replay 16–64 times more policy than expert data. On some tasks (Humanoid) replaying even a single expert transitions every 256 agent ones significantly hurts performance. We suspect that, in contrast to RL with demonstrations, we see little benefit from replaying expert data in the setup with learned rewards because (1) replaying expert data mostly helps when the reward signal is sparse (not the case for discriminator-based rewards), and (2) discriminator may overfit to the expert demonstrations which could result in incorrectly high rewards being assigned to expert transitions.
|
| 65 |
+
|
| 66 |
+
Pretraining with BC. We also experiment with pretraining a policy with Behavioral Cloning (BC, [2]) at the beginning of training. Despite starting from a much better policy than a random one, we usually observe that the policy quality deteriorates quickly at the beginning of training (see the pen task in Fig. 3) due to being updated using randomly initialized critic and discriminator networks, and the overall gain from pretraining is very small in most environments (Fig. 27).
|
| 67 |
+
|
| 68 |
+
RL algorithms. We run experiments with four different RL algorithms, three of which are off-policy algorithms (SAC [28], TD3 [26] and D4PG [24]), as well as PPO [22] which is nearly on-policy. Fig. 7 shows that the sample complexity of PPO is significantly worse than that of the off-policy algorithms while all off-policy algorithms perform overall similarly.
|
| 69 |
+
|
| 70 |
+
RL algorithms HPs. Fig. 8 shows that the discount factor is one of the most important HPs with the values of $0 . 9 7 - 0 . 9 9$ performing well on all tasks. Fig. 29 shows that in most environments it is better not to erase any data from the RL replay buffer and always sample from all the experience encountered so far. It is common in RL to use a noise-free version of the policy during evaluation and we observe that it indeed improves the performance (Fig. 30). The policy MLP size does not matter much (Figs. 31-32) while bigger critic networks perform significantly better (Figs. 9-10). Regarding activation functions, relu performs on par or better than tanh in all environments apart from door in which tanh is significantly better (Fig. 33). Our implementation of TD3 optionally applies gradient clipping but it does not affect the performance much (Fig. 34). D4PG can use n-step returns, this improves the performance on the Adroit tasks but hurts on the Gym suite (Fig. 35).
|
| 71 |
+
|
| 72 |
+
# 4 What matters for the discriminator training?
|
| 73 |
+
|
| 74 |
+
Summary of key findings. MLP discriminators perform on par or better than AIL-specific architectures. Explicit discriminator regularization is only important in more complicated environments (Humanoid and harder ones). Spectral norm is overall the best regularizer but standard regularizers from supervised learning often perform on par. Optimal learning rate for the discriminator may be 2–2.5 orders of magnitude lower than the one for the RL agent.
|
| 75 |
+
|
| 76 |
+
Discriminator input. In this section we look at the choices related to the discriminator training. Fig. 49 shows how the performance depends on the discriminator input. We can observe that while it is beneficial to feed actions as well as states to the discriminator, the state-only demonstrations perform almost as well. Interestingly, on the door task with human data, it is better to ignore the expert actions. We explore the results with human demonstrations in more depth in Sec. 5.
|
| 77 |
+
|
| 78 |
+
Discriminator architecture. Regarding the discriminator network, our basic architecture is an MLP but we also consider two modifications introduced in AIRL [17]: a reward shaping term and a $\log \pi ( a | s )$ logit shift which introduces a dependence on the current policy (only applicable to RL algorithms with stochastic policies, which in our case are PPO and SAC). See App. D.3 for a detailed description of these techniques. Fig. 13 shows that the logit shift significantly hurts the performance.
|
| 79 |
+
|
| 80 |
+
This is mainly due to the fact that it does not work well with SAC which is off-policy (Fig. 21). Fig. 50 shows that the shaping term does not affect the performance much. While the modifications from AIRL does not improve the sample complexity in our experiments, it is worth mentioning that they were introduced for another purpose, namely the recovery of transferable reward functions.
|
| 81 |
+
|
| 82 |
+
Regarding the size of the discriminator MLP(s), the best results on all tasks are obtained with a single hidden layer (Fig. 51), while the size of the hidden layer is of secondary importance (if it is not very small) with the exception of the tasks with human data where fewer hidden units perform significantly better (Fig. 52). All tested discriminator activation functions perform overall similarly while sigmoid performs best with human demonstrations (Fig. 53).
|
| 83 |
+
|
| 84 |
+
Discriminator training. Fig. 54 shows that it is best to use as large as possible replay buffers for sampling negative examples (i.e. agent transitions). Prior work has claimed the initialization of the last policy layer can significantly influence the performance in RL [42], thus we tried initializing the last discriminator layer with smaller weights but it does not make much difference (Fig 55).
|
| 85 |
+
|
| 86 |
+
Discriminator regularization. An overfit or too accurate discriminator can make agent’s training challenging, and therefore it is common to use additional regularization techniques when training the AIL discriminator (or GANs in general). We run experiments with a number of regularizers commonly used with AIL, namely Gradient Penalty [18] (GP, used e.g. in [31]), spectral norm [35] (e.g. in [44]), Mixup [23] (e.g. in [52]), as well as using the PUGAIL loss [41] instead of the standard cross entropy loss to train the discriminator. Apart from the above regularizers, we also run experiments with regularizers commonly used in Supervised Learning, namely dropout [10], the weight decay [1] variant from AdamW [33] as well as the entropy bonus of the discriminator output treated as a Bernoulli distribution. The detailed description of all these regularization techniques can be found in App. D.5.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 2: The 95th percentile of performance for different discriminator regularizers. The central plot shows the average performance across 5 tasks from OpenAI Gym and the right one the average performance across 5 tasks from the Adroit suite. See Fig. 56 for the plots for individual environments.
|
| 90 |
+
|
| 91 |
+
Fig. 2 shows how the performance depends on the regularizer. Spectral normalization performs overall best, while GP, dropout and weight decay all perform on par with each other and only a bit worse than spectral normalization. We find this conclusion to be quite surprising given that we have not seen dropout or weight decay being used with AIL in literature. We also notice that the regularization is generally more important on harder tasks like Humanoid or the tasks in the Adroit suite (Fig. 56).
|
| 92 |
+
|
| 93 |
+
Most of the regularizers investigated in this section have their own HPs and therefore the comparison of different regularizers depends on how these HPs are sampled. As we randomly sample the regularizer-specific HPs in this analysis, our approach favours regularizers that are not too sensitive to their HPs. At the same time, there might be regularizers that are sensitive to their HPs but for which good settings may be easily found. Fig. 67 shows that even if we condition on choosing the optimal HPs for each regularizer, the relative ranking of regularizers does not change.
|
| 94 |
+
|
| 95 |
+
Moreover, there might be correlations between the regularizer and other HPs, therefore their relative performance may depend on the distribution of all other HPs. In fact, we have found two such surprising correlations. Fig. 73 shows the performance conditioned on the regularizer used as well as the discriminator learning rate. We notice that for PUGAIL, entropy and no regularization, the performance significantly increases for lower discriminator learning rates and the best performing discriminator learning rate $( 1 0 ^ { - 6 } )$ is in fact 2-2.5 orders of magnitude lower than the best learning rate for the RL algorithm (0.0001–0.0003, Figs. 14, 38, 39, 41, 47).9 On the other hand, the remaining regularizers are not too sensitive to the discriminator learning rate. This means that the performance gap between PUGAIL, entropy and no regularization and the other regularizers is to some degree caused by the fact that the former ones are more sensitive to the learning rate and may be smaller than suggested by Fig. 2 if we adjust for the appropriate choice of the discriminator learning rate. We can notice that PUGAIL and entropy are the only regularizers which only change the discriminator loss but do not affect the internals of the discriminator neural network. Given that they are the only two regularizers benefiting from very low discriminator learning rate, we suspect that it means that a very low learning rate can play a regularizing role in the absence of an explicit regularization inside the network.
|
| 96 |
+
|
| 97 |
+
Another surprising correlation is that in some environments, the regularizer interacts strongly with observation normalization (described App. D.6) employed on discriminator inputs (see Fig. 74 for an example on Ant). These two correlations highlight the difficulty of comparing regularizers, and algorithmic choices more broadly, as their performance significantly depends on the distribution of other HPs.
|
| 98 |
+
|
| 99 |
+
We also supplement our analysis by comparing the performance of different regularizers for the best found HPs. More precisely, we choose the best value for each HP in the main experiment (listed in App. E) and run them with different regularizers. To account for the mentioned correlations with the discriminator learning rate and observation normalization, we also include these two choices in the HP sweep and choose the best performing variant (as measure by the area under the learning curve) for each regularizer and each environment.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 3: Learning curves for different discriminator regularizers when the other HPs are set to the best performing value across all tasks. The y-axis shows the average policy return normalized so that 0 corresponds to a random policy and 1 to the expert. See App. E for the HPs used. The plots shows the averages across 30 random seeds. Best seen in color.
|
| 103 |
+
|
| 104 |
+
While it is not guaranteed that the performance is going to be good at all because we greedily choose the best performing value for each HP and there might be some unaccounted HP correlations, we find that the performance is very competitive (Fig. 3). Notice that we use the same HPs in all environments and the performance can be probably improved by varying some HPs between the environments, or at least between the two environment suites.
|
| 105 |
+
|
| 106 |
+
We notice that on the four easiest tasks (HalfCheetah, Hopper, Walker2d, Ant), investigated discriminator regularizers provide no, or only minor performance improvements and excellent results can be achieved without them. On the tasks where regularization is beneficial, we usually see that there are multiple regularizers performing similarly well, with spectral normalization being one of the best regularizers in all tasks apart from the two tasks with human data where PUGAIL performs better.
|
| 107 |
+
|
| 108 |
+
Regularizers-specific HPs. For GP, the target gradient norm of 1 is slightly better in most environments but the value of 0 is significantly better in hammer-human (Fig. 57), while the penalty strength of 1 performs best overall (Fig. 58). For dropout, it is important to apply it not only to hidden layers but also to inputs (Fig. 59) and the best results are obtained for $50 \%$ input dropout and $7 5 \%$ hidden activations dropout (Figs. 59, 60 and 67). For weight decay, the optimal decay coefficient in the AIL setup is much larger than the values typically used for Supervised Learning, the value $\lambda = 1 0$ performs best in our experiments (Fig. 61). For Mixup, $\alpha = 1$ outperforms the other values on almost all tested environments (Fig. 62). For PUGAIL, the unbounded version performs much better on the Adroit suite, while the bounded version is better on the Gym tasks (Fig. 63), and positive class prior of $\eta = 0 . 7$ performs well on most tasks (Fig. 64). For the discriminator entropy bonus, the values around 0.03 performed best overall (Fig. 65). All experiments with spectral normalization enforce the Lipschitz constant of 1 for each weight matrix.
|
| 109 |
+
|
| 110 |
+
How to train efficiently? So far we have analysed how HPs affect the sample complexity of AIL algorithms. For the analysis of the HPs which influence sample complexity as well as the computational cost of running an algorithm see App. A. In particular, we describe there a simple code optimization relying on processing multiple batches at once which makes training $2 { - } 3 \mathbf { x }$ faster in wall clock time without affecting the sample complexity (Fig. 5).
|
| 111 |
+
|
| 112 |
+
# 5 Are synthetic demonstrations a good proxy for human data?
|
| 113 |
+
|
| 114 |
+
Summary of key findings Human demonstrations significantly differ from synthetic ones. Learning from human demonstrations benefits more from discriminator regularization and may work better with different discriminator inputs and reward functions than RL-generated demonstrations.
|
| 115 |
+
|
| 116 |
+
Using a dataset of human demonstrations comes with a number of additional challenges. Compared to synthetic demonstrations, the human policy can be multi-modal in that for a given state different decisions might be chosen. A typical example occurs when the human demonstrator remains idle for some time (for example to think about the next action) before taking the actual relevant action: we have two modes in that state, the relevant action has a low probability while the idle action has a very high probability. The human policy might not be exactly markovian either. Those differences are significant enough that the conclusions on synthetic datasets might not hold anymore.
|
| 117 |
+
|
| 118 |
+
In this section, we focus on the Adroit door and hammer environments for which we run experiments with human as well as synthetic demonstrations. 10 Note that on top of the aforementioned challenges, the setup with the Adroit environments using human demonstrations exhibits a few additional specifics. The demonstrations were collected letting the human decide when the task is completed: said in a different way, the demonstrator is offered an additional action to jump directly to a terminal state and this action is not available to the agent imitating the expert. The end result is a dataset of demonstrations of variable length while the agent can only generate episodes consisting of exactly 200 transitions. Note that there was no time limit imposed on the demonstrator and some of the demonstrations have a length greater than 200 transitions. Getting to the exact same state distribution as the human expert may be impossible, and imitation learning algorithms may have to make some trade-offs. The additional specificity of that setup is that the reward of the environment is not exactly what the human demonstrator optimized. In the door environment, the reward provided by the environment is the highest when the door is fully opened while the human might abort the task slightly before getting the highest reward. However, overall, we consider the reward provided by the environment as a reasonable metric to assess the quality of the trained policies. Moreover, in the hammer environment, some demonstrations have a low return and we suspect those are not successful demonstrations.11
|
| 119 |
+
|
| 120 |
+
Discriminator regularization. When comparing the results for RL-generated (adroit-expert12) and human demonstrations (adroit-human) we can notice differences on a number of HPs related to the discriminator training. Human demonstrations benefit more from using discriminator regularizers (Fig. 56) and they also work better with smaller discriminator networks (Fig. 52) trained with lower learning rates (Fig. 66). The increased need for regularization suggest that it is easier to overfit to the idiosyncrasies of human demonstrations than to those of RL policies.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 4: Comparison of discriminator inputs (a) and reward functions (b) for environments with human demonstrations. See Fig. 49 and Fig. 25 for the individual results in all environments.
|
| 124 |
+
|
| 125 |
+
Discriminator input. Fig. 4a shows the performance given the discriminator input depending on the demonstration source. For most tasks with RL-generated demonstrations, feeding actions as well as states improves the performance (Fig. 49). Yet, the opposite holds when human demonstrations are used. We suspect that it might be caused by the mentioned issue with demonstrations lengths which forces the policy to repeat a similar movement but with a different speed than the demonstrator.
|
| 126 |
+
|
| 127 |
+
Reward functions. Finally, we look at how the relative performance of different reward functions depends on the demonstration source. Fig. 4b shows that for RL-generated demonstrations the best reward function is AIRL while $- \ln ( 1 - D )$ performs better with human demonstrations. Under the assumption that the discriminator is optimal, these two reward functions correspond to the minimization of different divergences between the state (or state-action depending on the discriminator input) occupancy measures of the policy (denoted $\pi$ ) and the expert (denoted $E$ ) .
|
| 128 |
+
|
| 129 |
+
The reward function performing best with human demonstrations $( - \ln ( 1 - D ) )$ corresponds to the minimization of the Jensen-Shannon divergence (proof in [14]). Interestingly, this divergence is symmetric $( D _ { \mathrm { J S } } ( \pi | | E ) = D _ { \mathrm { J S } } ( E | | \pi ) )$ and bounded $( 0 \leq D _ { \mathrm { J S } } ( \pi | | E ) \leq \ln ( 2 ) )$ . For AIL, the symmetry means that it penalizes the policy for doing things the expert never does with exactly the same weight as for not doing some of the things the expert does while the boundedness means that the penalty for not visiting a single state is always finite. We suspect that this boundedness is beneficial for learning with human demonstrations because it may not be possible to exactly match the human distribution for the reasons explained earlier.
|
| 130 |
+
|
| 131 |
+
In contrast to Jensen-Shannon, the $D _ { \mathrm { K L } } ( \pi | | E )$ divergence which is optimized by the AIRL reward (proof in [46]) is neither symmetric, nor bounded — it penalizes the policy much more heavily for doing the things the expert never does that for not doing all the things the expert does and the penalty for visiting a single state the expert never visits is infinite (assuming a perfect discriminator).
|
| 132 |
+
|
| 133 |
+
While it is hard to draw any general conclusions only from the two investigated environments for which we had access to human demonstrations, our analysis shows that the differences between synthetic and human-generated demonstrations can influence the relative performance of different algorithmic choices. This suggests that RL-generated data are not a good proxy for human demonstrations and that the very common practice of evaluating IL only with synthetic demonstrations may lead to algorithms which perform poorly in the more realistic scenarios with human demonstrations.
|
| 134 |
+
|
| 135 |
+
# 6 Related work
|
| 136 |
+
|
| 137 |
+
The most similar work to ours is probably [44] which compares the performance of different discriminator regularizers and concludes that gradient penalty is necessary for achieving good performance with off-policy AIL algorithms. In contrast to [44], which uses a single HP configuration, we run large-scale experiments with very wide HP sweeps which allows us to reach more robust conclusions. In particular, we are able to achieve excellent sample complexity on all the environments used in [44] without using any explicit discriminator regularizer (Fig. 3).
|
| 138 |
+
|
| 139 |
+
The methodology of our study is mostly based on [42] which analyzed the importance of different choices for on-policy actor-critic methods. Our work is also similar to other large-scale studies done in other fields of Deep Learning, e.g. model-based RL [38], GANs [34], NLP [50], disentangled representations [32] and convolution network architectures [51].
|
| 140 |
+
|
| 141 |
+
# 7 Conclusions
|
| 142 |
+
|
| 143 |
+
In this empirical study, we investigate in depth many aspects of the AIL framework including discriminator architecture, training and regularization as well as many choices related to the agent training. Our key findings can be divided into three categories: (1) Corroborating prior work, e.g. for the underlying RL problem, off-policy algorithms are more sample efficient than on-policy ones; (2) Adding nuances to previous studies, e.g. while the regularization schemes encouraging Lipschitzness improve the performance, more classical regularizers like dropout or weight decay often perform on par; (3) Raising concerns: we observe a high discrepancy between the results for RL-generated and human data. We hope this study will be helpful to anyone using or designing AIL algorithms.
|
| 144 |
+
|
| 145 |
+
Additionally we released the [1] unified AIL agent we implemented in JAX within the Acme framework as well as [2] the raw data of our experiment, along with [3] a Notebook that allows to load and study them.
|
| 146 |
+
|
| 147 |
+
[1] https://github.com/deepmind/acme/tree/master/acme/agents/jax/ail [2] https://storage.googleapis.com/what-matters-in-imitation-learning/data.json [3] https://storage.googleapis.com/what-matters-in-imitation-learning/analysis_ colab.ipynb
|
| 148 |
+
|
| 149 |
+
# Acknowledgments
|
| 150 |
+
|
| 151 |
+
We thank Kamyar Ghasemipour for the discussions related to the FAIRL reward function and Lucas Beyer for the feedback on an earlier version of the manuscript.
|
| 152 |
+
|
| 153 |
+
# References
|
| 154 |
+
|
| 155 |
+
back-propagation”. In: Advances in neural information processing systems 1 (1988), pp. 177– 185.
|
| 156 |
+
[2] Dean A Pomerleau. “Efficient training of artificial neural networks for autonomous navigation”. In: Neural computation 3.1 (1991), pp. 88–97.
|
| 157 |
+
[3] Stuart Russell. “Learning agents for uncertain environments”. In: Conference on Computational learning theory. 1998.
|
| 158 |
+
[4] Stefan Schaal. “Is imitation learning the route to humanoid robots?” In: Trends in Cognitive Sciences 3.6 (1999), pp. 233–242. ISSN: 1364-6613. DOI: https : / / doi . org / 10 . 1016 / S1364- 6613(99)01327- 3. URL: http://www.sciencedirect.com/science/article/pii/ S1364661399013273.
|
| 159 |
+
[5] Andrew Y Ng, Stuart J Russell, et al. “Algorithms for inverse reinforcement learning.” In: Icml. Vol. 1. 2000, p. 2.
|
| 160 |
+
[6] Brian D Ziebart et al. “Maximum entropy inverse reinforcement learning.” In: Aaai. Vol. 8. Chicago, IL, USA. 2008, pp. 1433–1438.
|
| 161 |
+
[7] Brenna D Argall et al. “A survey of robot learning from demonstration”. In: Robotics and autonomous systems 57.5 (2009), pp. 469–483.
|
| 162 |
+
[8] Brian D Ziebart. “Modeling purposeful adaptive behavior with the principle of maximum causal entropy”. In: (2010).
|
| 163 |
+
[9] Ian J Goodfellow et al. “Generative adversarial networks”. In: arXiv preprint arXiv:1406.2661 (2014).
|
| 164 |
+
[10] Nitish Srivastava et al. “Dropout: a simple way to prevent neural networks from overfitting”. In: The journal of machine learning research 15.1 (2014), pp. 1929–1958.
|
| 165 |
+
[11] Diederik P. Kingma and Jimmy Ba. “Adam: A Method for Stochastic Optimization”. In: 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings. 2015. URL: http://arxiv.org/abs/1412.6980.
|
| 166 |
+
[12] John Schulman et al. “High-dimensional continuous control using generalized advantage estimation”. In: arXiv preprint arXiv:1506.02438 (2015).
|
| 167 |
+
[13] Greg Brockman et al. “Openai gym”. In: arXiv preprint arXiv:1606.01540 (2016).
|
| 168 |
+
[14] Jonathan Ho and Stefano Ermon. “Generative adversarial imitation learning”. In: arXiv preprint arXiv:1606.03476 (2016).
|
| 169 |
+
[15] David Silver et al. “Mastering the game of Go with deep neural networks and tree search”. In: nature 529.7587 (2016), p. 484.
|
| 170 |
+
[16] Marc G Bellemare, Will Dabney, and Rémi Munos. “A distributional perspective on reinforcement learning”. In: International Conference on Machine Learning. PMLR. 2017, pp. 449– 458.
|
| 171 |
+
[17] Justin Fu, Katie Luo, and Sergey Levine. “Learning robust rewards with adversarial inverse reinforcement learning”. In: arXiv preprint arXiv:1710.11248 (2017).
|
| 172 |
+
[18] Ishaan Gulrajani et al. “Improved training of wasserstein gans”. In: arXiv preprint arXiv:1704.00028 (2017).
|
| 173 |
+
[19] Riashat Islam et al. “Reproducibility of benchmarked deep reinforcement learning tasks for continuous control”. In: arXiv preprint arXiv:1708.04133 (2017).
|
| 174 |
+
[20] Ivaylo Popov et al. “Data-efficient deep reinforcement learning for dexterous manipulation”. In: arXiv preprint arXiv:1704.03073 (2017).
|
| 175 |
+
[21] Aravind Rajeswaran et al. “Learning complex dexterous manipulation with deep reinforcement learning and demonstrations”. In: arXiv preprint arXiv:1709.10087 (2017).
|
| 176 |
+
[22] John Schulman et al. “Proximal policy optimization algorithms”. In: arXiv preprint arXiv:1707.06347 (2017).
|
| 177 |
+
[23] Hongyi Zhang et al. “mixup: Beyond empirical risk minimization”. In: arXiv preprint arXiv:1710.09412 (2017).
|
| 178 |
+
[24] Gabriel Barth-Maron et al. “Distributed distributional deterministic policy gradients”. In: arXiv preprint arXiv:1804.08617 (2018).
|
| 179 |
+
[25] James Bradbury et al. JAX: composable transformations of Python $^ +$ NumPy programs. Version 0.2.5. 2018. URL: http://github.com/google/jax.
|
| 180 |
+
[26] Scott Fujimoto, Herke Hoof, and David Meger. “Addressing function approximation error in actor-critic methods”. In: International Conference on Machine Learning. PMLR. 2018, pp. 1587–1596.
|
| 181 |
+
[27] Tuomas Haarnoja et al. “Soft actor-critic algorithms and applications”. In: arXiv preprint arXiv:1812.05905 (2018).
|
| 182 |
+
[28] Tuomas Haarnoja et al. “Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor”. In: International Conference on Machine Learning. 2018, pp. 1861–1870.
|
| 183 |
+
[29] Peter Henderson et al. “Deep reinforcement learning that matters”. In: Thirty-Second AAAI Conference on Artificial Intelligence. 2018.
|
| 184 |
+
[30] Todd Hester et al. “Deep q-learning from demonstrations”. In: Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 32. 1. 2018.
|
| 185 |
+
[31] Ilya Kostrikov et al. “Discriminator-actor-critic: Addressing sample inefficiency and reward bias in adversarial imitation learning”. In: arXiv preprint arXiv:1809.02925 (2018).
|
| 186 |
+
[32] Francesco Locatello et al. “Challenging common assumptions in the unsupervised learning of disentangled representations”. In: arXiv preprint arXiv:1811.12359 (2018).
|
| 187 |
+
[33] Ilya Loshchilov and Frank Hutter. “Fixing weight decay regularization in adam”. In: (2018).
|
| 188 |
+
[34] Mario Lucic et al. “Are gans created equal? a large-scale study”. In: Advances in neural information processing systems. 2018, pp. 700–709.
|
| 189 |
+
[35] Takeru Miyato et al. “Spectral normalization for generative adversarial networks”. In: arXiv preprint arXiv:1802.05957 (2018).
|
| 190 |
+
[36] George Tucker et al. “The mirage of action-dependent baselines in reinforcement learning”. In: arXiv preprint arXiv:1802.10031 (2018).
|
| 191 |
+
[37] Christopher Berner et al. “Dota 2 with large scale deep reinforcement learning”. In: arXiv preprint arXiv:1912.06680 (2019).
|
| 192 |
+
[38] Eric Langlois et al. “Benchmarking model-based reinforcement learning”. In: arXiv preprint arXiv:1907.02057 (2019).
|
| 193 |
+
[39] Tom Le Paine et al. “Making efficient use of demonstrations to solve hard exploration problems”. In: arXiv preprint arXiv:1909.01387 (2019).
|
| 194 |
+
[40] Oriol Vinyals et al. “Grandmaster level in StarCraft II using multi-agent reinforcement learning”. In: Nature 575.7782 (2019), pp. 350–354.
|
| 195 |
+
[41] Danfei $\mathrm { X u }$ and Misha Denil. “Positive-unlabeled reward learning”. In: arXiv preprint arXiv:1911.00459 (2019).
|
| 196 |
+
[42] Marcin Andrychowicz et al. “What matters in on-policy reinforcement learning? a large-scale empirical study”. In: arXiv preprint arXiv:2006.05990 (2020).
|
| 197 |
+
[43] OpenAI: Marcin Andrychowicz et al. “Learning dexterous in-hand manipulation”. In: The International Journal of Robotics Research 39.1 (2020), pp. 3–20.
|
| 198 |
+
[44] Lionel Blondé, Pablo Strasser, and Alexandros Kalousis. “Lipschitzness Is All You Need To Tame Off-policy Generative Adversarial Imitation Learning”. In: arXiv preprint arXiv:2006.16785 (2020).
|
| 199 |
+
[45] Justin Fu et al. “D4rl: Datasets for deep data-driven reinforcement learning”. In: arXiv preprint arXiv:2004.07219 (2020).
|
| 200 |
+
[46] Seyed Kamyar Seyed Ghasemipour, Richard Zemel, and Shixiang Gu. “A divergence minimization perspective on imitation learning methods”. In: Conference on Robot Learning. PMLR. 2020, pp. 1259–1277.
|
| 201 |
+
[47] Jonathan Heek et al. Flax: A neural network library and ecosystem for JAX. Version 0.3.3. 2020. URL: http://github.com/google/flax.
|
| 202 |
+
[48] Matteo Hessel et al. Optax: composable gradient transformation and optimisation, in JAX! Version 0.0.1. 2020. URL: http://github.com/deepmind/optax.
|
| 203 |
+
[49] Matt Hoffman et al. “Acme: A research framework for distributed reinforcement learning”. In: arXiv preprint arXiv:2006.00979 (2020).
|
| 204 |
+
[50] Jared Kaplan et al. “Scaling laws for neural language models”. In: arXiv preprint arXiv:2001.08361 (2020).
|
| 205 |
+
[51] Ilija Radosavovic et al. “Designing Network Design Spaces”. In: arXiv preprint arXiv:2003.13678 (2020).
|
| 206 |
+
|
| 207 |
+
[52] Annie Chen et al. “Batch exploration with examples for scalable robotic reinforcement learning”. In: IEEE Robotics and Automation Letters (2021).
|
| 208 |
+
|
| 209 |
+
# Checklist
|
| 210 |
+
|
| 211 |
+
1. For all authors...
|
| 212 |
+
|
| 213 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 214 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 215 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] We study general purpose imitation algorithms which are not related to any particular application.
|
| 216 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 217 |
+
|
| 218 |
+
2. If you are including theoretical results...
|
| 219 |
+
|
| 220 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 221 |
+
|
| 222 |
+
3. If you ran experiments...
|
| 223 |
+
|
| 224 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No]
|
| 225 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 226 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 227 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
|
| 228 |
+
|
| 229 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 230 |
+
|
| 231 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 232 |
+
(b) Did you mention the license of the assets? [No] D4RL demonstrations are available under Apache License 2.0
|
| 233 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 234 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 235 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 236 |
+
|
| 237 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 238 |
+
|
| 239 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 240 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 241 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/1ODSsnoMBav/1ODSsnoMBav.md
ADDED
|
@@ -0,0 +1,273 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CLDA: Contrastive Learning for Semi-Supervised Domain Adaptation
|
| 2 |
+
|
| 3 |
+
Ankit Singh
|
| 4 |
+
|
| 5 |
+
Department of Computer Science Indian Institute of Technology, Madras singh.ankit@cse.iitm.ac.in
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Unsupervised Domain Adaptation (UDA) aims to align the labeled source distribution with the unlabeled target distribution to obtain domain invariant predictive models. However, the application of well-known UDA approaches does not generalize well in Semi-Supervised Domain Adaptation (SSDA) scenarios where few labeled samples from the target domain are available. This paper proposes a simple Contrastive Learning framework for semi-supervised Domain Adaptation (CLDA) that attempts to bridge the intra-domain gap between the labeled and unlabeled target distributions and the inter-domain gap between source and unlabeled target distribution in SSDA. We suggest employing class-wise contrastive learning to reduce the inter-domain gap and instance-level contrastive alignment between the original(input image) and strongly augmented unlabeled target images to minimize the intra-domain discrepancy. We have empirically shown that both of these modules complement each other to achieve superior performance. Experiments on three well-known domain adaptation benchmark datasets, namely DomainNet, Office-Home, and Office31, demonstrate the effectiveness of our approach. CLDA achieves state-of-the-art results on all the above datasets.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Deep Convolutional networks [30, 52] have shown impressive performance in various computer vision tasks, e.g., image classification [19, 22] and action recognition [48, 23, 57, 32]. However, there is an inherent problem of generalizability with deep-learning models, i.e., models trained on one dataset(source domain) does not perform well on another domain. This loss of generalization is due to the presence of domain shift [11, 55] across the dataset. Recent works [46, 29] have shown that the presence of few labeled data from the target domain can significantly boost the performance of the convolutional neural network(CNN) based models. This observation led to the formulation of Semi-Supervised Domain Adaption (SSDA), which is a variant of Unsupervised Domain Adaptation where we have access to a few labeled samples from the target domain.
|
| 14 |
+
|
| 15 |
+
Unsupervised domain adaptation methods [42, 12, 36, 51, 35] try to transfer knowledge from the label rich source domain to the unlabeled target domain. Many such existing domain adaptation approaches [42, 12, 51] align the features of the source distribution with the target distribution without considering the category of the samples. These class-agnostic methods fail to generate discriminative features when aligning global distributions. Recently, owing to the success of contrastive approaches [6, 18, 39], in self-representation learning, some recent works [26, 28] have turned to instance-based contrastive approaches to reduce discrepancies across domains.
|
| 16 |
+
|
| 17 |
+
[46] reveals that the direct application of the well-known UDA approaches in Semi-Supervised Domain Adaptation yields sub-optimal performance. [29] has shown that supervision from labeled source and target samples can only ensure the partial cross-domain feature alignment. This creates aligned and unaligned sub-distributions of the target domain, causing intra-domain discrepancy apart from inter-domain discrepancy in SSDA.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Conceptual description of CLDA approach. (a) Intial distribution of samples from both domain .(b) Instance Contrastive Alignment ensures unlabeled target samples move into the low entropy area forming robust clusters (c) Inter-Domain Contrastive Alignment minimizes the distance between the clusters of same class from both domain (d) The clusters of both domain are well aligned and samples are far away from decision boundary.
|
| 21 |
+
|
| 22 |
+
In this work, we propose CLDA, a simple single-stage novel contrastive learning framework to address the aforementioned problem. Our framework contains two significant components to learn domain agnostic representation. First, Inter-Domain Contrastive Alignment reduces the discrepancy between centroids of the same class from the source and the target domain while increasing the distance between the class centroids of different classes from both source and target domain. This ensures clusters of the same class from both domains are near each other in latent space than the clusters of the other classes from both domains.
|
| 23 |
+
|
| 24 |
+
Second, inspired by the success of self-representation learning in semi-supervised settings [17, 6, 49], we propose to use Instance Contrastive Alignment to reduce the intra-domain discrepancy. In this, we first generate the augmented views of the unlabeled target images using image augmentation methods. Alignment of the features of the original and augmented images of the unlabeled samples from the target domain ensures that they are closer to each other in latent space. The alignment between two variants of the same image ensures that the classifier boundary lies in the low-density regions assuring that the feature representations of two variants of the unlabeled target images are similar, which helps to generate better clusters for the target domain.
|
| 25 |
+
|
| 26 |
+
In summary, our key contributions are as follows. 1) We propose a novel, simple single-stage training framework for Semi-supervised Domain Adaptation. 2)We propose using alignment at class centroids and instance levels to reduce inter and intra domain discrepancies present in SSDA. 3)We evaluate the effectiveness of different augmentation approaches, for instance-based contrastive alignment in the SSDA setting. 4)We evaluate our approach over three well-known Domain Adaptation datasets (DomainNet, Office-Home, and Office31) to gain insights. Our approach achieves the state of the art results across multiple datasets showing its effectiveness. We perform extensive ablation experiments highlighting the role of different components of our framework.
|
| 27 |
+
|
| 28 |
+
# 2 Related Works
|
| 29 |
+
|
| 30 |
+
# 2.1 Unsupervised Domain Adaptation
|
| 31 |
+
|
| 32 |
+
Unsupervised Domain Adaptation (UDA) [14] is a well-studied problem, and most UDA algorithms reduce the domain gap by matching the features of the sources and target domain [16, 4, 24, 36, 51, 27]. Feature-based alignment methods reduce the global divergence [16, 51] between source and target distribution. Adversarial learning [12, 5, 34, 35, 42, 41] based approaches have shown impressive performance in reducing the divergence between source and target domains. It involves training the model to generate features to deceive the domain classifier, invariantly making the generated features domain agnostic. Recently, Image translation methods [20, 21, 38] have been explored in UDA where an image from the target domain is translated to the source domain to be treated as an image from the source domain to overcome the divergence present across domains.
|
| 33 |
+
|
| 34 |
+
Despite remarkable progress in UDA, [46] shows the UDA approaches do not perform well in the SSDA setting, which we consider in this work.
|
| 35 |
+
|
| 36 |
+
# 2.2 Semi-Supervised Learning
|
| 37 |
+
|
| 38 |
+
Semi-Supervised Learning(SSL) aims to leverage the vast amount of unlabeled data with limited labeled data to improve classifier performance. The main difference between SSL and SSDA is that SSL uses data sampled from the same distribution while SSDA deals with data sampled from two domains with inherent domain discrepancy. The current line of work in SSL [50, 3, 31, 10] follows consistency-based approaches to reduce the intra-domain gap. Mean teacher [53] uses two copies of the same model (student model and teacher model) to ensure consistency across augmented views of the images. Weights of the teacher model are updated as the exponential moving average of the weights of the student model. Mix-Match [3] and ReMixMatch [2] use interpolation between labeled and unlabeled data to generate perturbed features. Recently introduced FixMatch [50] achieves impressive performance using the confident pseudo labels of the unlabeled samples and treating them as labels for the strongly perturbed samples. However, direct application of SSL in the SSDA setting yields sub-optimal performance as the presumption in the SSL is that distributions of labeled and unlabeled data are identical, which is not the case in SSDA.
|
| 39 |
+
|
| 40 |
+
# 2.3 Contrastive Learning
|
| 41 |
+
|
| 42 |
+
Contrastive Learning(CL) has shown impressive performance in self-representation learning [6, 1, 18, 54, 39]. Most contrastive learning methods align the representations of the positive pair (similar images) to be close to each other while making negative pairs apart. In semantic segmentation, [33] uses patch-wise contrastive learning to reduce the domain divergence by aligning the similar patches across domains. In domain adaptation, contrastive learning [28, 26] has been applied for alignment at the instance level to learn domain agnostic representations. [26, 28] use samples from the same class as positive pairs, and samples from different classes are counted as negative pairs. [26] modifies Maximum Mean Discrepancy (MMD) [16] loss to be used as a contrastive loss. In contrast to [28, 26], our work proposes to use contrastive learning in SSDA setting both at the class and instance level (across perturbed samples of the same image) to learn the semantic structure of the data better.
|
| 43 |
+
|
| 44 |
+
# 2.4 Semi-Supervised Domain Adaptation
|
| 45 |
+
|
| 46 |
+
Semi-Supervised Domain Adaptation (SSDA) aims to reduce the discrepancy between the source and target distribution in the presence of limited labeled target samples. [46] first proposed to align the source and target distributions using adversarial training. [29] shows the presence of intra domain discrepancy in the target distribution and introduces a framework to mitigate it. [25] uses consistency alongside multiple adversarial strategies on top of MME [46]. [9] introduced the meta-learning framework for Semi-Supervised Domain Adaptation. [58] breaks down the SSDA problem into two subproblems, namely, SSL in the target domain and UDA problem across the source and target domains, and learn the optimal weights of the network using co-training. [37] proposed to use pretraining of the feature extractor and consistency across perturbed samples as a simple yet effective strategy for SSDA. [44] introduces a framework for SSDA consisting of a shared feature extractor and two classifiers with opposite purposes, which are trained in an alternative fashion; where one classifier tries to cluster the target samples while the other scatter the source samples, so that target features are well aligned with source domain features. Most of the above approaches are based on adversarial training, while our work proposes to use contrastive learning-based feature alignment at the class level and the instance level to reduce discrepancy across domains.
|
| 47 |
+
|
| 48 |
+
# 3 Methodology
|
| 49 |
+
|
| 50 |
+
In this section, we present our novel Semi-Supervised Domain Adaptation approach to learn domain agnostic representation. We will first introduce the background and notations used in our work and then describe our approach and its components in detail.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Outline of our CLDA Framework Our approach consists of aligning the outputs of the neural network at two levels. At the instance level, we try to maximize the similarity between features of unlabeled target images and strongly augmented unlabeled target images using Instance Contrastive Alignment. At the class level, we pass the images from both domains through the network, where we assign the labels to features of unlabeled target images and compute the centroids of each class of the target domain. Similarly, we compute the centroids for source domain features using their class labels. Finally, we maximize the similarity between centroids of the same class across domains by employing Inter-Domain Contrastive Alignment. We also used cross-entropy loss on the labeled source and target images, apart from the above components in our framework.
|
| 54 |
+
|
| 55 |
+
# 3.1 Problem Formulation
|
| 56 |
+
|
| 57 |
+
In Semi-Supervised Domain Adaptation, we have datasets sampled from two domains. The source dataset contains labeled images $\mathcal { D } _ { s } = \{ ( x _ { i } ^ { s } , y _ { i } ^ { s } ) \} _ { i = 1 } ^ { N _ { s } } \subset \mathcal { R } ^ { d } \times \mathbf { \bar { \mathcal { V } } }$ sampled from some distribution $P _ { S } ( X , Y )$ . Besides that, we have two sets of data sampled from target domain distribution $P _ { T } ( X , Y )$ . We denote the labeled set of images sampled from the target domain as $\mathcal { D } _ { l t } = \{ ( x _ { i } ^ { l t } , y _ { i } ^ { l t } ) \} _ { i = 1 } ^ { N _ { l t } }$ . The unlabeled set sampled from target domain $\mathcal { D } _ { t } = \{ ( x _ { i } ^ { t } ) \} _ { i = 1 } ^ { N _ { t } }$ contains large number of images $( N _ { t } \gg N _ { l t } )$ without any corresponding labels associated with them. We also denote the labeled data from both domains as $\mathcal { D } _ { l } = \mathcal { D } _ { s } \cup \mathcal { D } _ { l t }$ . Labels $y _ { i } ^ { s }$ and $y _ { i } ^ { l t }$ of the samples from source and labeled target set correspond to one of the categories of the dataset having $K$ different classes/categories $i . e$ $\bar { Y = \{ 1 , 2 , . . . \bar { K } \} }$ . Our goal is to learn a task specific classifier using $D _ { s } , D _ { l t }$ and $D _ { t }$ to accurately predict labels on test data from target domain.
|
| 58 |
+
|
| 59 |
+
# 3.2 Supervised Training
|
| 60 |
+
|
| 61 |
+
Labeled source and target samples are passed through the CNN-based feature extractor $\mathcal { G } ( . )$ to obtain corresponding features, which are then passed through task-specific classifier $\mathcal F ( . )$ to minimize the well-known cross-entropy loss on the labeled images from both source and target domains.
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathcal { L } _ { s u p } = - \sum _ { k = 1 } ^ { K } ( y ^ { i } ) _ { k } \log ( \mathcal { F } ( \mathcal { G } ( ( x _ { l } ^ { i } ) ) _ { k }
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
# 3.3 Inter-Domain Contrastive Alignment
|
| 68 |
+
|
| 69 |
+
Our method is based on the observation that the samples from the same category across domains must cluster in the latent space. However, this is observed only for the source domain due to the availability of the labels. Samples from the target domain do not align to form clusters due to the domain shift between the target and the source distributions. This discrepancy between the cluster of the same category across domains is reduced by aligning the centroids of each class of source and target domain. [6, 17] have shown that having a separate projection space is beneficial for contrastive training. Instead of using a separate projection, we have used the outputs from the task-specific classifier as features to align the clusters across the domain.
|
| 70 |
+
|
| 71 |
+
We represent the centroid of the images from the source domain belonging to class $k$ as the mean of their features, which can be written as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
C _ { k } ^ { s } = \frac { \displaystyle \sum _ { i = 1 } ^ { i = B } \mathbb { 1 } _ { \{ y _ { i } ^ { s } = k \} } \mathcal { F } ( \mathcal { G } ( x _ { i } ^ { s } ) ) } { \displaystyle \sum _ { i = 1 } ^ { i = B } \mathbb { 1 } _ { \{ y _ { i } ^ { s } = k \} } }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $B$ is the size of batch. We maintain a memory bank $\displaystyle C ^ { s } = [ C _ { 1 } ^ { s } , C _ { 2 } ^ { s } , . . . . C _ { K } ^ { s } ] )$ to store the centroids of each class from source domain. We use exponential moving average to update these centroid values during the training
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
C _ { k } ^ { s } = \rho ( C _ { k } ^ { s } ) _ { s t e p } + ( 1 - \rho ) ( C _ { k } ^ { s } ) _ { s t e p - 1 }
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\rho$ is a momentum term, and $( C _ { k } ^ { s } ) _ { s t e p }$ and $( C _ { k } ^ { s } ) _ { s t e p - 1 }$ are the centroid values of class $k$ at the current and previous step, respectively.
|
| 84 |
+
|
| 85 |
+
We also need to cluster the unlabeled target samples for Inter-Domain Contrastive Alignment. The pseudo labels obtained from the task specific classifier as shown in Eq (3) is used as the class labels for the corresponding unlabeled target samples.
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\hat { y _ { i } ^ { t } } = a r g m a x ( ( \mathcal { F } ( \mathcal { G } ( x _ { i } ^ { t } ) ) )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Similar to the source domain , we also calculate the separate cluster centroid $C _ { k } ^ { t }$ for each of the class $k$ of the target samples present in the minibatch as per the Eq (2) where unlabeled target images replace the images from the source domain with their corresponding pseudo label. The model is then trained to maximize the similarity between the cluster representation of each class $k$ from the source and the target domain. $C _ { k } ^ { s }$ and $C _ { k } ^ { t }$ form the positive pair while the remaining cluster centroids from both domains form the negative pairs. The remaining clusters from both domains are pushed apart in the latent space. This is achieved through employing a modified NT-Xent (normalized temperature-scaled cross-entropy) contrastive loss [6, 39, 49, 33] for domain adaptation given by
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathcal { L } _ { c l u } ( C _ { i } ^ { t } , C _ { i } ^ { s } ) = - \log \frac { h \bigl ( C _ { i } ^ { t } , C _ { i } ^ { s } \bigr ) } { h \bigl ( C _ { i } ^ { t } , C _ { i } ^ { s } \bigr ) + \underset { t \in \{ s , t \} } { \overset { K } { \sum } } \mathbb { 1 } _ { \{ r \neq i \} } h \bigl ( C _ { i } ^ { t } , C _ { r } ^ { q } \bigr ) }
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\begin{array} { r } { h ( \mathbf { u } , \mathbf { v } ) = \exp \big ( \frac { \mathbf { u } ^ { \top } \mathbf { v } } { \| \mathbf { u } \| _ { 2 } \| \mathbf { v } \| _ { 2 } } / \tau \big ) } \end{array}$ measures the exponential of cosine similarity , $\mathbb { 1 }$ is an indicator function and $\tau$ is the temperature hyperparameter.
|
| 98 |
+
|
| 99 |
+
# 3.4 Instance Contrastive Alignment
|
| 100 |
+
|
| 101 |
+
Recent works on contrastive learning [18, 39, 6] show encouraging results in single domain settings. [28] extends contrastive learning into multi-domain settings. Inspired by such success, we employ Instance Contrastive Learning to form stable and correct cluster cores in the target domain.
|
| 102 |
+
|
| 103 |
+
To perform contrastive alignment at the instance level, we first generate a strongly augmented version of the unlabeled target image i.e $\tilde { x _ { i } ^ { t } } = \psi ( x _ { i } ^ { t } )$ where $\psi ( . )$ is the strong augmentation function [8]. Next, we employ the NT-Xent loss [6, 39] as defined in Eq (5) to ensure that these two variants of the same image are closer to each other in the latent space while the rest of the images in minibatch of size $B$ are pushed apart. This idea stems from the cluster assumption in an ideal classifier, which states the decision boundary should lie in the low-density region, ensuring consistent prediction for different augmented variants of the same image.
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathcal { L } _ { i n s } ( \tilde { x } _ { i } ^ { t } , x _ { i } ^ { t } ) = - \log \frac { h \big ( \mathcal { F } ( \mathcal { G } ( \tilde { x } _ { i } ^ { t } ) , \mathcal { F } ( \mathcal { G } ( x _ { i } ^ { t } ) ) ) } { \displaystyle \sum _ { r = 1 } ^ { B } h \big ( \mathcal { F } ( \mathcal { G } ( \tilde { x } _ { i } ^ { t } ) ) , \mathcal { F } ( \mathcal { G } ( x _ { r } ^ { t } ) ) \big ) + \displaystyle \sum _ { r = 1 } ^ { B } \mathbb { 1 } _ { \{ r \neq i \} } h \big ( \mathcal { F } ( \mathcal { G } ( \tilde { x } _ { i } ^ { t } ) ) , \mathcal { F } ( \mathcal { G } ( \tilde { x } _ { r } ^ { t } ) ) \big ) }
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
In SSDA, [29] has shown that target distribution gets divided into aligned and unaligned subdistribution in the presence of very few labeled target data. Thus, aligning the unaligned subdistribution can lead to improved performance, while perturbing the aligned sub-distribution can result in a negative transfer. Therefore, we only propagate the gradients for strongly augmented images to avoid perturbing the aligned sub-distribution in the target domain.
|
| 110 |
+
|
| 111 |
+
[6] shows stronger augmentation in contrastive learning leads to improved performance. Consistent prediction across the input and strongly augmented unlabeled images in Instance Contrastive Alignment forces the unaligned target sub-distribution to move away from the low-density region towards aligned distribution. This ensures better clustering in the unlabeled target distribution, which is validated by improved accuracy as shown in Table 5 after employing Instance Contrastive Alignment with Inter-Domain Contrastive Alignment.
|
| 112 |
+
|
| 113 |
+
Both of the components of the CLDA framework are necessary for the improved performance, as shown in Table 5 . Instance Contrastive Alignment ensures that unlabeled target samples are consistent and are in the high-density region. However, it does not assure alignment between source and unlabeled target samples. Inter-Domain Contrastive Alignment reduces the discrepancy between unlabeled target samples and source domain but unlabeled target samples closer to the decision boundary might get pushed towards the wrong classes resulting in negative transfer. Thus, combining both components results in a much better alignment of the unlabeled target samples towards the source domain, leading to improved performance of the framework.
|
| 114 |
+
|
| 115 |
+
# 3.5 Overall framework and training objective
|
| 116 |
+
|
| 117 |
+
The overall training objective employs supervised loss, Inter-Domain Contrastive Alignment and Instance Contrastive Alignment which can be formulated as follows:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\mathcal { L } _ { t o t } = \mathcal { L } _ { s u p } + \alpha * \mathcal { L } _ { c l u } + \beta * \mathcal { L } _ { i n s }
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
We train the model in our framework by employing overall training loss described as in (6).
|
| 124 |
+
|
| 125 |
+
# 4 Experiments
|
| 126 |
+
|
| 127 |
+
# 4.1 Experimental Setup
|
| 128 |
+
|
| 129 |
+
We evaluate the effectiveness of our approach on three different domain adaptation datasets: DomainNet [43], Office-Home [56] and Office31 [45]. DomainNet [43] is a large-scale domain adaptation dataset with 345 classes across 6 domains. Following MME [46], we use a subset of the dataset containing 126 categories across four domains: Real(R), Clipart(C), Sketch(S), and Painting(P). The performance on DomainNet is evaluated using 7 different combinations out of possible 12 combinations. Office-Home [56] is another widely used domain adaptation benchmark dataset with 65 classes across four domains: Art(Ar), Product $( \mathrm { P r } )$ , Clipart(Cl), and Real (Rl). We perform experiments on all possible combinations of 4 domains. Office31 [45] is a relatively smaller dataset containing just 31 categories of data across three domains- Amazon(A), Dslr(D), Webcam(W). Following prior work [46, 29], we evaluate our approach on two combinations for the office31 dataset.
|
| 130 |
+
|
| 131 |
+
For the fair comparison, we use the data-splits (train, validation, and test splits) released by [46] on Github 1. We use the same settings for the benchmark datasets as in the prior work [46, 29], including the number of labeled samples in the target domain, which are consistent across all experiments.
|
| 132 |
+
|
| 133 |
+
# 4.2 Implementation Details
|
| 134 |
+
|
| 135 |
+
Similar to the previous works on SSDA [46, 29, 9], we use Resnet34 and Alexnet as the backbone networks in our paper. We only used VGG for Office31 due to its higher memory requirements. The feature generator model is initialized with ImageNet weights, and the classifier is randomly initialized and has the same architecture as in [46, 29, 9]. All our experiments are performed using Pytorch [40].We use an identical set of hyperparameters $\langle \alpha = 4$ , $\beta = 1$ ) across all our experiments other than minibatch size. All the hyperparameters values are decided using validation performance on Product to Art experiments on the Office-Home dataset. We have set $\tau = 5$ in our experiments. Each minibatch of size $B$ contains an equal number of source and labeled target examples, while the number of unlabeled target samples is $\mu \times B$ . We study the effect of $\mu$ in section 4.5. Resnet34 experiments are performed with minibatch size, $B = 3 2$ and Alexnet models are trained with $B = 2 4$ We use $\mu = 4$ for all our experiments. We use SGD optimizer with a momentum of 0.9 and an initial learning rate of 0.01 with cosine learning rate decay for all our experiments. Weight decay is set to 0.0005 for all our models. Other details of the experiments are included in the supplementary.
|
| 136 |
+
|
| 137 |
+
Table 1: Performance Comparison in Office-Home. Numbers show top-1 accuracy values for different domain adaptation scenarios under 3-shot setting using Alexnet and Resnet34 as backbone networks. We have highlighted the best method for each transfer task. CLDA surpasses all the baseline methods in most adaptation scenarios. Our Proposed framework achieves the best average performance among all compared methods.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Net</td><td>Method</td><td>R1→C1</td><td>R1→Pr</td><td>Rl→Ar</td><td>Pr-→Rl</td><td>Pr→Cl</td><td>Pr→Ar</td><td>Ar→Pl</td><td>Ar-→C1</td><td>Ar-→Rl</td><td>CI-→Rl</td><td>Cl→Ar</td><td>C1-→Pr</td><td>Mean</td></tr><tr><td rowspan="10">Alexnet</td><td>S+T</td><td>44.6</td><td>66.7</td><td>47.7</td><td>57.8</td><td>44.4</td><td>36.1</td><td>57.6</td><td>38.8</td><td>57.0</td><td>54.3</td><td>37.5</td><td>57.9</td><td>50.0</td></tr><tr><td>DANN</td><td>47.2</td><td>66.7</td><td>46.6</td><td>58.1</td><td>44.4</td><td>36.1</td><td>57.2</td><td>39.8</td><td>56.6</td><td>54.3</td><td>38.6</td><td>57.9</td><td>50.3</td></tr><tr><td>ADR</td><td>37.8</td><td>63.5</td><td>45.4</td><td>53.5</td><td>32.5</td><td>32.2</td><td>49.5</td><td>31.8</td><td>53.4</td><td>49.7</td><td>34.2</td><td>50.4</td><td>44.5</td></tr><tr><td>CDAN</td><td>36.1</td><td>62.3</td><td>42.2</td><td>52.7</td><td>28.0</td><td>27.8</td><td>48.7</td><td>28.0</td><td>51.3</td><td>41.0</td><td>26.8</td><td>49.9</td><td>41.2</td></tr><tr><td>ENT</td><td>44.9</td><td>70.4</td><td>47.1</td><td>60.3</td><td>41.2</td><td>34.6</td><td>60.7</td><td>37.8</td><td>60.5</td><td>58.0</td><td>31.8</td><td>63.4</td><td>50.9</td></tr><tr><td>MME</td><td>51.2</td><td>73.0</td><td>50.3</td><td>61.6</td><td>47.2</td><td>40.7</td><td>63.9</td><td>43.8</td><td>61.4</td><td>59.9</td><td>44.7</td><td>64.7</td><td>55.2</td></tr><tr><td>Meta-MME</td><td>50.3</td><td>-</td><td>-</td><td>-</td><td>48.3</td><td>40.3</td><td>:</td><td>44.5</td><td>-</td><td>-</td><td>44.5</td><td>-</td><td>-</td></tr><tr><td>BiAT</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>56.4</td></tr><tr><td>APE CLDA(ours)</td><td>51.9</td><td>74.6</td><td>51.2</td><td>61.6</td><td>47.9</td><td>42.1</td><td>65.5</td><td>44.5</td><td>60.9</td><td>58.1</td><td>44.3</td><td>64.8</td><td>55.6</td></tr><tr><td></td><td>51.5</td><td>74.1</td><td>54.3</td><td>67.0</td><td>47.9</td><td>47.0</td><td>65.8</td><td>47.4</td><td>66.6</td><td>64.1</td><td>46.8</td><td>67.5</td><td>58.3</td></tr><tr><td rowspan="7">Resnet34</td><td>S+T</td><td>55.7</td><td>80.8</td><td>67.8</td><td>73.1</td><td>53.8</td><td>63.5</td><td>73.1</td><td>54.0</td><td>74.2</td><td>68.3</td><td>57.6</td><td>72.3</td><td>66.2</td></tr><tr><td>DANN</td><td>57.3</td><td>75.5</td><td>65.2</td><td>69.2</td><td>51.8</td><td>56.6</td><td>68.3</td><td>54.7</td><td>73.8</td><td>67.1</td><td>55.1</td><td>67.5</td><td>63.5</td></tr><tr><td>ENT</td><td>62.6</td><td>85.7</td><td>70.2</td><td>79.9</td><td>60.5</td><td>63.9</td><td>79.5</td><td>61.3</td><td>79.1</td><td>76.4</td><td>64.7</td><td>79.1</td><td>71.9</td></tr><tr><td>MME</td><td>64.6</td><td>85.5</td><td>71.3</td><td>80.1</td><td>64.6</td><td>65.5</td><td>79.0</td><td>63.6</td><td>79.7</td><td>76.6</td><td>67.2</td><td>79.3</td><td>73.1</td></tr><tr><td>Meta-MME</td><td>65.2</td><td>-</td><td>-</td><td>-</td><td>64.5</td><td>66.7</td><td>-</td><td>63.3</td><td>-</td><td>-</td><td>67.5</td><td>-</td><td>-</td></tr><tr><td>APE</td><td>66.4</td><td>86.2</td><td>73.4</td><td>82.0</td><td>65.2</td><td>66.1</td><td>81.1</td><td>63.9</td><td>80.2</td><td>76.8</td><td>66.6</td><td>79.9</td><td>74.0</td></tr><tr><td>CLDA (ours)</td><td>66.0</td><td>87.6</td><td>76.7</td><td>82.2</td><td>63.9</td><td>72.4</td><td>81.4</td><td>63.4</td><td>81.3</td><td>80.3</td><td>70.5</td><td>80.9</td><td>75.5</td></tr></table>
|
| 140 |
+
|
| 141 |
+
# 4.3 Baselines
|
| 142 |
+
|
| 143 |
+
We compare our CLDA framework with previous state-of-the-art SSDA approaches : MME [46], APE [29], BiAT [25] , UODA [44], Meta-MME [9] and ENT [15] using the performance reported by these papers. papers. We also included the results from adversarial based baseline methods: DANN [13], ADR [47] and CDAN [35] as reported in [46]. We also provide the $\mathbf { s } { + } \mathbf { T }$ results where the model is trained using all the labeled samples across domains.
|
| 144 |
+
|
| 145 |
+
# 4.4 Results
|
| 146 |
+
|
| 147 |
+
Table 1- 3 show top-1 accuracies and mean accuracies for different combination of domain adaptation scenarios for all three datasets in comparison with baseline SSDA methods.
|
| 148 |
+
|
| 149 |
+
Office-Home. Table 1 contains the results of the Office-Home dataset for 3-shot setting with Alexnet and Resnet34 as backbone networks. Results for the 1-shot adaptation scenarios are included in the supplementary. Our method consistently performs better than the baseline approaches and achieves $5 8 . 3 \%$ and $7 5 . 5 \%$ mean accuracy with Alexnet and Resnet34, respectively. Our approach surpasses the state-of-the-art SSDA approaches in most of the adaptation tasks. In some domain adaptation cases, such as $\mathrm { C l } \mathrm { R l }$ , $\mathbf { R } 1 \mathbf { A r }$ and $\mathrm { P r } \mathrm { A r }$ , we exceeded APE by more than $3 \%$ .
|
| 150 |
+
|
| 151 |
+
DomainNet: Our CLDA approach surpasses the performance of existing SSDA baselines as shown in Table 2. Using Alexnet backbone, our method improves over BiAT by $5 . 2 \%$ and $4 . 9 \%$ in 1-shot and 3-shot settings, respectively. We obtain similarly improved performance when we switch the neural backbone from Alexnet to Resnet34. With Resnet34 as the backbone, we gain $4 . 3 \%$ and $3 . 6 \%$ over APE in 1-shot and 3-shot settings, respectively. Similar to the Office-Home, our approach surpasses the well-known domain adaptation benchmarks methods in most domain adaptation tasks of the DomainNet dataset. Such consistent improved performance shows that our approach reduces both inter and intra domain discrepancy prevalent in SSDA.
|
| 152 |
+
|
| 153 |
+
Table 2: Performance Comparison in DomainNet. Numbers show Top-1 accuracy values for different domain adaptation scenarios under 1-shot and 3-shot settings using Alexnet and Resnet34 as backbone networks. CLDA achieves better performance than all the baseline methods in most of the domain adaptation tasks. We have highlighted the best approach for each domain adaptation task. Our Proposed framework achieves the best average performance among all compared methods.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan="2">Net</td><td rowspan="2">Method</td><td colspan="2">R→C</td><td colspan="2">R→P</td><td colspan="2">P→C</td><td colspan="2">C→S</td><td colspan="2">S→P</td><td colspan="2">R→S</td><td colspan="2">P→R</td><td colspan="2">Mean 1-shot3-shot</td></tr><tr><td>1-shot3-shot</td><td></td><td>1-shot</td><td>3-shot</td><td></td><td>1-shot3-shot</td><td>1-shot</td><td>3-shot</td><td>1-shot</td><td>3-shot</td><td>1-shot3-shot</td><td></td><td>1-shot3-shot</td><td></td><td></td><td></td></tr><tr><td rowspan="9">Alexnet</td><td>S+T</td><td>43.3</td><td>47.1</td><td>42.4</td><td>45.0 43.8</td><td>40.1 39.1</td><td>44.9</td><td>33.6</td><td>36.4</td><td>35.7</td><td>38.4</td><td>29.1</td><td>33.3</td><td>55.8</td><td>58.7</td><td>40.0 40.4</td><td>43.4</td></tr><tr><td>DANN</td><td>43.3</td><td>46.1</td><td>41.6</td><td></td><td></td><td>41.0</td><td>35.9</td><td>36.5</td><td>36.9</td><td>38.9</td><td>32.5</td><td>33.4</td><td>53.5</td><td>57.3</td><td></td><td>42.4</td></tr><tr><td>ADR</td><td>43.1</td><td>46.2</td><td>41.4</td><td>44.4</td><td>39.3</td><td>43.6</td><td>32.8</td><td>36.4</td><td>33.1</td><td>38.9</td><td>29.1</td><td>32.4</td><td>55.9</td><td>57.3</td><td>39.2</td><td>42.7</td></tr><tr><td>CDAN</td><td>46.3</td><td>46.8</td><td>45.7</td><td>45.0</td><td>38.3</td><td>42.3</td><td>27.5</td><td>29.5</td><td>30.2</td><td>33.7</td><td>28.8</td><td>31.3</td><td>56.7</td><td>58.7</td><td>39.1</td><td>41.0</td></tr><tr><td>ENT</td><td>37.0</td><td>45.5</td><td>35.6</td><td>42.6</td><td>26.8</td><td>40.4</td><td>18.9</td><td>31.1</td><td>15.1</td><td>29.6</td><td>18.0</td><td>29.6</td><td>52.2</td><td>60.0</td><td>29.1</td><td>39.8</td></tr><tr><td>MME</td><td>48.9</td><td>55.6</td><td>48.0</td><td>49.0</td><td>46.7</td><td>51.7</td><td>36.3</td><td>39.4</td><td>39.4</td><td>43.0</td><td>33.3</td><td>37.9</td><td>56.8</td><td>60.7</td><td>44.2</td><td>48.2</td></tr><tr><td>Meta-MME</td><td>1</td><td>56.4</td><td>-</td><td>50.2</td><td></td><td>51.9</td><td>,</td><td>39.6</td><td>,</td><td>43.7</td><td>-</td><td>38.7</td><td>1</td><td>60.7</td><td>-</td><td>48.8</td></tr><tr><td>BiAT</td><td>54.2</td><td>58.6</td><td>49.2</td><td>50.6</td><td>44.0</td><td>52.0</td><td>37.7</td><td>41.9</td><td>39.6</td><td>42.1</td><td>37.2</td><td>42.0</td><td>56.9</td><td>58.8</td><td>45.5</td><td>49.4</td></tr><tr><td>APE CLDA (ours)</td><td>47.7 56.3</td><td>54.6 59.9</td><td>49.0 56.0</td><td>50.5</td><td>46.9</td><td>52.1 54.6</td><td>38.5 42.5</td><td>42.6</td><td>38.5</td><td>42.2</td><td>33.8 38.0</td><td>38.7</td><td>57.5</td><td>61.4</td><td>44.6</td><td>48.9</td></tr><tr><td></td><td></td><td></td><td></td><td>57.2</td><td>50.8</td><td></td><td></td><td>47.3</td><td>46.8</td><td></td><td>51.4</td><td>42.7</td><td></td><td>64.4</td><td>67.0</td><td>50.7</td><td>54.3</td></tr><tr><td rowspan="10"></td><td>S+T</td><td>55.6</td><td>60.0</td><td>60.6</td><td>62.2</td><td>56.8</td><td>59.4</td><td>50.8</td><td>55.0</td><td>56.0</td><td>59.5</td><td>46.3</td><td>50.1</td><td>71.8</td><td>73.9</td><td>56.9</td><td>60.0</td></tr><tr><td>DANN</td><td>58.2</td><td>59.8</td><td>61.4</td><td>62.8</td><td>56.3</td><td>59.6</td><td>52.8</td><td>55.4</td><td>57.4</td><td>59.9</td><td>52.2</td><td>54.9</td><td>70.3</td><td>72.2</td><td>58.4</td><td>60.7</td></tr><tr><td>ADR</td><td>57.1</td><td>60.7</td><td>61.3</td><td>61.9</td><td>57.0</td><td>60.7</td><td>51.0</td><td>54.4</td><td>56.0</td><td>59.9</td><td>49.0</td><td>51.1</td><td>72.0</td><td>74.2</td><td>57.6</td><td>60.4</td></tr><tr><td>CDAN</td><td>65.0</td><td>69.0</td><td>64.9</td><td>67.3</td><td>63.7</td><td>68.4</td><td>53.1</td><td>57.8</td><td>63.4</td><td>65.3</td><td>54.5</td><td>59.0</td><td>73.2</td><td>78.5</td><td>62.5</td><td>66.5</td></tr><tr><td>ENT</td><td>65.2</td><td>71.0</td><td>65.9</td><td>69.2</td><td>65.4</td><td>71.1</td><td>54.6</td><td>60.0</td><td>59.7</td><td>62.1</td><td>52.1</td><td>61.1</td><td>75.0</td><td>78.6</td><td>62.6</td><td>67.6</td></tr><tr><td>MME</td><td>70.0</td><td>72.2</td><td>67.7</td><td>69.7</td><td>69.0</td><td>71.7</td><td>56.3</td><td>61.8</td><td>64.8</td><td>66.8</td><td>61.0</td><td>61.9</td><td>76.1</td><td>78.5</td><td>66.4</td><td>68.9</td></tr><tr><td>UODA</td><td>72.7</td><td>75.4</td><td>70.3</td><td>71.5</td><td>69.8</td><td>73.2</td><td>60.5</td><td>64.1</td><td>66.4</td><td>69.4</td><td>62.7</td><td>64.2</td><td>77.3</td><td>80.8</td><td>68.5</td><td>71.2</td></tr><tr><td>Meta-MME</td><td>1</td><td>73.5</td><td>1</td><td>70.3</td><td>1</td><td>72.8</td><td>-</td><td>62.8</td><td>1</td><td>68.0</td><td>-</td><td>63.8</td><td>-</td><td>79.2</td><td>-</td><td>70.1</td></tr><tr><td>BiAT</td><td>73.0</td><td>74.9</td><td>68.0</td><td>68.8</td><td>71.6</td><td>74.6</td><td>57.9</td><td>61.5</td><td>63.9</td><td>67.5</td><td>58.5</td><td>62.1</td><td>77.0</td><td>78.6</td><td>67.1</td><td>69.7</td></tr><tr><td>APE</td><td>70.4</td><td>76.6 77.7</td><td>70.8 75.1</td><td>72.1 75.7</td><td>72.9</td><td>76.7 76.4</td><td>56.7 63.7</td><td>63.1 69.7</td><td>64.5 70.2</td><td>66.1 73.7</td><td>63.0 67.1</td><td>67.8</td><td>76.6</td><td>79.4 82.9</td><td>67.6 71.9</td><td>71.7</td></tr><tr><td></td><td>CLDA (ours)</td><td>76.1</td><td></td><td></td><td></td><td>71.0</td><td></td><td></td><td></td><td></td><td></td><td>71.1</td><td>80.1</td><td></td><td></td><td>75.3</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 3: Performance Comparison in Office31. Numbers show Top-1 accuracy values for different domain adaptation scenarios under 1-shot and 3-shot settings using Alexnet and VGG as backbone networks. CLDA outperforms all the baseline approaches in both scenarios. We have highlighted the superior method on each domain adaptation task. Our Proposed framework achieves the best mean accuracy among all baseline methods.
|
| 158 |
+
|
| 159 |
+
<table><tr><td></td><td colspan="5">Alexnet</td><td colspan="6">VGG</td></tr><tr><td></td><td colspan="2">W→A</td><td colspan="2">D→A</td><td colspan="2">Mean</td><td colspan="2">W→A</td><td colspan="2">D→A</td><td colspan="2">Mean</td></tr><tr><td>Method</td><td>1-shot</td><td>3-shot</td><td>1-shot</td><td>3-shot</td><td>1-shot</td><td>3-shot</td><td>1-shot</td><td>3-shot</td><td>1-shot</td><td>3-shot</td><td>1-shot</td><td>3-shot</td></tr><tr><td>S+T</td><td>50.4</td><td>61.2</td><td>50.0</td><td>62.4</td><td>50.2</td><td>61.8</td><td>169.2</td><td>73.2</td><td>68.2</td><td>73.3</td><td>68.7</td><td>73.25</td></tr><tr><td>DANN</td><td>57.0</td><td>64.4</td><td>54.5</td><td>65.2</td><td>55.8</td><td>64.8</td><td>69.3</td><td>75.4</td><td>70.4</td><td>74.6</td><td>69.85</td><td>75.0</td></tr><tr><td>ADR</td><td>50.2</td><td>61.2</td><td>50.9</td><td>61.4</td><td>50.6</td><td>61.3</td><td>69.7</td><td>73.3</td><td>69.2</td><td>74.1</td><td>69.45</td><td>73.7</td></tr><tr><td>CDAN</td><td>50.4</td><td>60.3</td><td>48.5</td><td>61.4</td><td>49.5</td><td>60.8</td><td>65.9</td><td>74.4</td><td>64.4</td><td>71.4</td><td>65.15</td><td>72.9</td></tr><tr><td>ENT</td><td>50.7</td><td>64.0</td><td>50.0</td><td>66.2</td><td>50.4</td><td>65.1</td><td>69.1</td><td>75.4</td><td>72.1</td><td>75.1</td><td>70.6</td><td>75.25</td></tr><tr><td>MME</td><td>57.2</td><td>67.3</td><td>55.8</td><td>67.8</td><td>56.5</td><td>67.6</td><td>73.1</td><td>76.3</td><td>73.6</td><td>77.6</td><td>73.35</td><td>76.95</td></tr><tr><td>BiAT</td><td>57.9</td><td>68.2</td><td>54.6</td><td>68.5</td><td>56.3</td><td>68.4</td><td>-</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>APE</td><td>1</td><td>67.6</td><td>-</td><td>69.0</td><td>-</td><td>68.3</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>CLDA</td><td>64.6</td><td>70.5</td><td>62.7</td><td>72.5</td><td>63.6</td><td>71.5</td><td>76.2</td><td>78.6</td><td>75.1</td><td>76.7</td><td>75.6</td><td>77.6</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Office31: Similar to other datasets, our proposed method with Alexnet and VGG as neural backbone achieves the best performance in both domain adaption scenarios for office31 as shown in Table 3. Using Alexnet backbone, we beat the APE [29] by $3 . 2 \%$ in 3-shot and BiAT by $7 . 3 \%$ in 1-shot settings. We observe similar gains over all the baselines methods with VGG as the neural network backbone. This shows the efficacy of our proposed approach irrespective of the used backbone.
|
| 162 |
+
|
| 163 |
+
# 4.5 Ablation Studies
|
| 164 |
+
|
| 165 |
+
We perform extensive ablation experiments to analyze our CLDA framework and the effects of the different components and hyperparameters. We perform these experiments on the 3-shot $\mathrm { P r } \mathrm { A r }$ domain adaptation task of the Office-Home dataset using Resnet34 unless specified otherwise.
|
| 166 |
+
|
| 167 |
+
Effectiveness of Individual Modules: Our CLDA framework is composed of two modules: InterDomain Contrastive Alignment and Instance Contrastive Alignment. We investigate the significance of each component of our framework by dropping the other during training. We observe that the test accuracy drops from $7 2 . 4 \%$ to $6 8 . 3 \%$ when only Inter-Domain Contrastive Alignment is used, and it drops to $6 7 . 7 \%$ when Instance Contrastive Alignment is used alone as shown in Table 5(a). Though individual modules do not yield high performance on their own but once combined, they surpass their individual performance by a margin of around $4 \%$ .
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Augmentation</td><td>Test Accuracy(Pr→Ar)</td><td>Test Accuracy(Rl→Ar)</td></tr><tr><td>Horizontal Flipping (Hflip)</td><td>68.1</td><td>73.4</td></tr><tr><td>Hflip + Color Jitter</td><td>67.6</td><td>74.9</td></tr><tr><td>Hflip+ Color Jitter+ Grayscale</td><td>70.2</td><td>76.2</td></tr><tr><td>Rand Augment (RA) [8]</td><td>71.1</td><td>74.6</td></tr><tr><td>RA + Grayscale</td><td>72.4</td><td>76.7</td></tr><tr><td>Auto Augment [7]</td><td>69.9</td><td>75.3</td></tr></table>
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Table 4: Effect of Strong Augmentations Numbers show the test accuracy on 3-shot domain adaptation tasks of the Office-Home dataset with Resnet34 with different augmentation policies.
|
| 173 |
+
Accuracy vs Ratio of unlabeled to labeled data
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Accuracy vs Weight of Instance Contrastive Alignment
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Accuracy vs Weight of Inter-Domain Contrastive Alignment
|
| 180 |
+
Figure 3: Effect of different hyperparameters on 3-shot $\mathbf { P r } \mathbf { A r }$ (Product to Art) data adaptation scenario on the Office-Home using Resnet34. (a) Effect of varying the weight of Instance Contrastive Alignment on validation and test Accuracy (b) Effect of varying weight of Inter-Domain Contrastive Alignment on validation and test Accuracy (c) Effect of $\mu$ , ratio of unlabeled target to labeled target data on validation and test accuracy.
|
| 181 |
+
|
| 182 |
+
Effect of Different Hyperparameters: We analyze the importance of different hyperparameters used in our approach. We observe that the weight of Instance Contrastive Alignment affects the performance of our approach as the test accuracy drops from $7 2 . 4 \%$ to $7 0 . 7 \%$ when we set $\alpha$ to 1 instead of its optimal value of 4 as shown in figure 3. We also notice that increasing $\beta$ led to a reduction of the validation and test performance. We also look into the effect of $\mu$ , which is the ratio of unlabeled to labeled data in a minibatch. We observe that an increasing value of $\mu$ increases the performance till $\mu = 4$ , after which it starts to drop, as shown in figure 3.
|
| 183 |
+
|
| 184 |
+
Importance of Instance Contrastive Alignment: Instance Contrastive Alignment ensures similar representation across different variants of the unlabeled target images. This consistency is also ensured by other well-known SSL approaches like FixMatch [50]. We perform an ablation experiment replacing Instance Contrastive Alignment with FixMatch. We also compare with L1 and L2 loss to have a fair analysis. As shown in Table 5 (b) Instance Contrastive Alignment helps to achieve superior performance in comparison with other consistency-based approaches.
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan=1 colspan=1>Approach</td><td rowspan=1 colspan=1>Test Accuracy</td></tr><tr><td rowspan=1 colspan=1>CLDA w/o Instance ContrastiveCLDA w/o Inter-Domain Contrastive</td><td rowspan=1 colspan=1>68.367.7</td></tr><tr><td rowspan=1 colspan=1>CLDA (ours)</td><td rowspan=1 colspan=1>72.4</td></tr></table>
|
| 187 |
+
|
| 188 |
+
(a) Ablation Study on the effectiveness of Individual components of the CLDA framework on $\mathrm { P r } \mathrm { A r }$ adaptation task of the OfficeHome dataset using Resnet34.
|
| 189 |
+
|
| 190 |
+
<table><tr><td>Approach</td><td>Test Accuracy</td></tr><tr><td>Fix-Match</td><td>70.8</td></tr><tr><td>L1 loss</td><td>69.4</td></tr><tr><td>L2 loss</td><td>69.3</td></tr><tr><td>CLDA (ours)</td><td>72.4</td></tr></table>
|
| 191 |
+
|
| 192 |
+
(b) Ablation Study on other consistency based approaches on $\mathrm { P r } \mathrm { A r }$ domain adaptation task of the OfficeHome using Resnet34.
|
| 193 |
+
|
| 194 |
+
Table 5: Experiments to understand the significance of individual components of our framework.
|
| 195 |
+
|
| 196 |
+
Table 6: Ablation study to understand the effect of outliers in target domain. Numbers show the test accuracy of 1-shot domain adaptation tasks of the Office-Home dataset with Resnet34.
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Experiments</td><td>O samples mislabeled</td><td>8 samples mislabeled (~ 12%)</td><td>16 samples mislabeled (~ 25%)</td></tr><tr><td>Pr→Ar</td><td>66.2</td><td>66.0</td><td>65.7</td></tr><tr><td>Rl→Ar</td><td>72.6</td><td>72.05</td><td>71.56</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Effect of Other Clustering Techniques: Inter-Domain Contrastive Alignment requires pseudo labels for the unlabeled target data for clustering. In this ablation experiment, we replace our approach of using the model’s prediction as a pseudo label with K-means clustering, which we invoke after every 50 steps and use the generated centroids for the next 50 steps to obtain pseudo-class labels for unlabeled target data. We observe a drop in performance (from $7 2 . 4 \%$ to $\bar { 7 1 } . 2 \%$ ) when using K-means to obtain the pseudo label for unlabeled target images.
|
| 201 |
+
|
| 202 |
+
Effect of Augmentation Policy: We look into different augmentation policies for the Instance Contrastive Alignment. As suggested in [6], a stronger augmentation policy for contrastive learning increases the performance of the model. We find that RandAugment [8] with Grayscale augmentation policy gives better results over other augmentation policies. The influence of the strong augmentation can be observed from $\sim 4 \%$ improvement in the performance when the augmentation policy is switched from horizontal flipping to RandAugment with Grayscale. Table 4 contains the test accuracy of different augmentation policies on 3-shot $\mathrm { P r } \mathrm { A r }$ and $\mathrm { R l } \mathrm { P r }$ domain adaption tasks of the Office-Home dataset with Resnet34.
|
| 203 |
+
|
| 204 |
+
Effect of Noisy-Labeled Target Samples: In SSDA, we have few labeled samples from the target domain; however, the presence of noisy-labeled target samples can have an adverse effect on the performance. To understand the effect of noisy-labeled target samples on the framework, we conducted experiments on the 1-shot $\mathrm { P r } \mathrm { A r }$ and $\mathbf { R } 1 \mathbf { A r }$ domain adaptation scenarios of the Office-Home dataset with Resnet34, where we mislabeled some previously labeled target samples as shown in Table 6. We observe a small decrease in performance of our framework ( from $6 6 . \hat { 2 \% }$ to $6 5 . 7 \%$ for $\mathrm { P r } \mathrm { A r }$ and from $7 2 . 6 \%$ to $7 1 . 5 6 \%$ for $\mathbb { R } 1 \to \mathrm { A r }$ ) when mislabeled target samples increase from $0 \%$ to $\sim 2 5 \%$ in both domain adaptation scenarios showing the robustness of our framework.
|
| 205 |
+
|
| 206 |
+
# 5 Conclusion
|
| 207 |
+
|
| 208 |
+
In this work, we present a novel single-stage contrastive learning framework for semi-supervised domain adaptation. The framework consists of Inter-Domain Contrastive Alignment and InstanceContrastive Alignment, where the former maximizes the similarity between centroids of the same class from both domains and later maximizes the similarity between augmented views of the unlabeled target images. We show that both of the components of the framework are necessary for improved performance. We demonstrate the effectiveness of our approach on three standard domain adaptation benchmark datasets, outperforming the well-known SSDA methods.
|
| 209 |
+
|
| 210 |
+
# 6 Acknowledgments and Disclosure of Funding
|
| 211 |
+
|
| 212 |
+
The work is supported by Half-Time Research Assistantship (HTRA) grants from the Ministry of Education, India. We would also like to thank Saurav Chakraborty and Athira Nambiar for their valuable suggestions and feedback to improve the work.
|
| 213 |
+
|
| 214 |
+
# References
|
| 215 |
+
|
| 216 |
+
[1] Philip Bachman, R Devon Hjelm, and William Buchwalter. “Learning Representations by Maximizing Mutual Information Across Views”. In: Neural Information Processing Systems. 2019.
|
| 217 |
+
[2] David Berthelot, Nicholas Carlini, Ekin D. Cubuk, Alex Kurakin, Kihyuk Sohn, Han Zhang, and Colin Raffel. “ReMixMatch: Semi-Supervised Learning with Distribution Matching and Augmentation Anchoring”. In: International Conference on Learning Representations. 2020.
|
| 218 |
+
[3] David Berthelot, Nicholas Carlini, Ian Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. “MixMatch: A Holistic Approach to Semi-Supervised Learning”. In: Neural Information Processing Systems. 2019.
|
| 219 |
+
[4] Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. “Domain Separation Networks”. In: Neural Information Processing Systems. 2016.
|
| 220 |
+
[5] Chao Chen, Zhihong Chen, Boyuan Jiang, and Xinyu Jin. “Joint Domain Alignment and Discriminative Feature Learning for Unsupervised Deep Domain Adaptation”. In: AAAI Conference on Artificial Intelligence. Vol. 33. 01. 2019, pp. 3296–3303.
|
| 221 |
+
[6] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. “A Simple Framework for Contrastive Learning of Visual Representations”. In: International Conference on Machine Learning. PMLR. 2020, pp. 1597–1607.
|
| 222 |
+
[7] Ekin Dogus Cubuk, Barret Zoph, Dandelion Mané, Vijay Vasudevan, and Quoc V. Le. “AutoAugment: Learning Augmentation Strategies From Data”. In: IEEE Conference on Computer Vision and Pattern Recognition (2019), pp. 113–123.
|
| 223 |
+
[8] Ekin Dogus Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V. Le. “Randaugment: Practical automated data augmentation with a reduced search space”. In: IEEE Conference on Computer Vision and Pattern Recognition Workshops (2020), pp. 3008–3017.
|
| 224 |
+
[9] Timothy Hospedales Da Li. “Online Meta-Learning for Multi-Source and Semi-Supervised Domain Adaptation”. In: European Conference on Computer Vision. 2020.
|
| 225 |
+
[10] Zihang Dai, Zhilin Yang, Fan Yang, William W. Cohen, and Ruslan Salakhutdinov. “Good Semi-supervised Learning That Requires a Bad GAN”. In: Neural Information Processing Systems abs/1705.09783 (2017).
|
| 226 |
+
[11] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. “DeCAF: A Deep Convolutional Activation Feature for Generic Visual Recognition”. In: International Conference on Machine Learning. PMLR. 2014.
|
| 227 |
+
[12] Yaroslav Ganin and Victor Lempitsky. “Unsupervised Domain Adaptation by Backpropagation”. In: International Conference on Machine Learning. PMLR. 2015, pp. 1180–1189.
|
| 228 |
+
[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”. In: The Journal of Machine Learning Research 17.1 (2016), pp. 2096–2030.
|
| 229 |
+
[14] Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. “Domain adaptation for object recognition: An unsupervised approach”. In: IEEE International Conference on Computer Vision (2011), pp. 999–1006.
|
| 230 |
+
[15] Yves Grandvalet and Yoshua Bengio. “Semi-supervised learning by entropy minimization���. In: Neural Information Processing Systems. 2004, pp. 529–536.
|
| 231 |
+
[16] Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Schölkopf, and Alexander Smola. “A Kernel Two-Sample Test”. In: The Journal of Machine Learning Research 13.1 (2012), pp. 723–773.
|
| 232 |
+
[17] Jean-Bastien Grill, Florian Strub, Florent Altch’e, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. “Bootstrap Your Own Latent: A New Approach to Self-Supervised Learning”. In: ArXiv abs/2006.07733 (2020).
|
| 233 |
+
[18] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. “Momentum Contrast for Unsupervised Visual Representation Learning”. In: IEEE Conference on Computer Vision and Pattern Recognition (2020), pp. 9726–9735.
|
| 234 |
+
[19] Kaiming Heand, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. “Deep Residual Learning for Image Recognition”. In: IEEE Conference on Computer Vision and Pattern Recognition. 2016, pp. 770–778.
|
| 235 |
+
[20] Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei A. Efros, and Trevor Darrell. “CyCADA: Cycle-Consistent Adversarial Domain Adaptation”. In: International Conference on Machine Learning. PMLR. 2018.
|
| 236 |
+
[21] Lanqing Hu, Meina Kan, Shiguang Shan, and Xilin Chen. “Duplex Generative Adversarial Network for Unsupervised Domain Adaptation”. In: IEEE Conference on Computer Vision and Pattern Recognition (2018), pp. 1498–1507.
|
| 237 |
+
[22] Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q. Weinberger. “Densely Connected Convolutional Networks”. In: IEEE Conference on Computer Vision and Pattern Recognition (2017), pp. 2261–2269.
|
| 238 |
+
[23] Shuiwang Ji, Wei Xu, Ming Yang, and Kai Yu. “3D Convolutional Neural Networks for Human Action Recognition”. In: IEEE Transactions on Pattern Analysis and Machine Intelligence 35 (2013), pp. 221–231.
|
| 239 |
+
[24] Jian Shen and Yanru Qu and Weinan Zhang and Yong Yu. “Wasserstein Distance Guided Representation Learning for Domain Adaptation”. In: AAAI Conference on Artificial Intelligence. 2018.
|
| 240 |
+
[25] Pin Jiang, Aming Wu, Yahong Han, Yunfeng Shao, Meiyu Qi, and Bingshuai Li. “Bidirectional Adversarial Training for Semi-Supervised Domain Adaptation”. In: International Joint Conferences on Artificial Intelligence. 2020.
|
| 241 |
+
[26] Guoliang Kang, Lu Jiang, Yi Yang, and Alexander G Hauptmann. “Contrastive Adaptation Network for Unsupervised Domain Adaptation”. In: IEEE Conference on Computer Vision and Pattern Recognition (2019), pp. 4888–4897.
|
| 242 |
+
[27] Guoliang Kang, Liang Zheng, Yan Yan, and Yi Yang. “Deep Adversarial Attention Alignment for Unsupervised Domain Adaptation: the Benefit of Target Expectation Maximization”. In: European Conference on Computer Vision. 2018.
|
| 243 |
+
[28] Donghyun Kim, Kuniaki Saito, Tae-Hyun Oh, Bryan A. Plummer, Stan Sclaroff, and Kate Saenko. “Cross-domain Self-supervised Learning for Domain Adaptation with Few Source Labels”. In: IEEE International Conference on Computer Vision abs/2003.08264 (2021).
|
| 244 |
+
[29] Tae-Kyung Kim and Changick Kim. “Attract, Perturb, and Explore: Learning a Feature Alignment Network for Semi-supervised Domain Adaptation”. In: European Conference on Computer Vision. 2020.
|
| 245 |
+
[30] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. “ImageNet Classification with Deep Convolutional Neural Networks”. In: Neural Information Processing Systems 25 (2012), pp. 1097–1105.
|
| 246 |
+
[31] Chongxuan Li, Kun Xu, Zhu Jun, and Zhang Bo. “Triple Generative Adversarial Nets”. In: Neural Information Processing Systems abs/1703.02291 (2017).
|
| 247 |
+
[32] Ji Lin, Chuang Gan, and Song Han. “TSM: Temporal Shift Module for Efficient Video Understanding”. In: IEEE International Conference on Computer Vision (2019), pp. 7082– 7092.
|
| 248 |
+
[33] Weizhe Liu, David Ferstl, Samuel Schulter, Lukas Zebedin, Pascal Fua, and Christian Leistner. “Domain Adaptation for Semantic Segmentation via Patch-Wise Contrastive Learning”. In: arXiv preprint arXiv:2104.11056 (2021).
|
| 249 |
+
[34] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. “Learning Transferable Features with Deep Adaptation Networks”. In: International Conference on Machine Learning. PMLR. 2015, pp. 97–105.
|
| 250 |
+
[35] Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I. Jordan. “Conditional Adversarial Domain Adaptation”. In: Neural Information Processing Systems. 2018.
|
| 251 |
+
[36] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I. Jordan. “Unsupervised Domain Adaptation with Residual Transfer Networks”. In: Neural Information Processing Systems. 2016.
|
| 252 |
+
[37] Samarth Mishra, Kate Saenko, and Venkatesh Saligrama. “Surprisingly Simple SemiSupervised Domain Adaptation with Pretraining and Consistency”. In: ArXiv abs/2101.12727 (2021).
|
| 253 |
+
[38] Zak Murez, Soheil Kolouri, David Kriegman, Ravi Ramamoorthi, and Kyungnam Kim. “Image to Image Translation for Domain Adaptation”. In: IEEE Conference on Computer Vision and Pattern Recognition (2018), pp. 4500–4509.
|
| 254 |
+
[39] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. “Representation Learning with Contrastive Predictive Coding”. In: ArXiv abs/1807.03748 (2018).
|
| 255 |
+
[40] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. “PyTorch: An Imperative Style, High-Performance Deep Learning Library”. In: Neural Information Processing Systems. 2019.
|
| 256 |
+
[41] Sujoy Paul, Yi-Hsuan Tsai, Samuel Schulter, Amit K Roy-Chowdhury, and Manmohan Chandraker. “Domain adaptive semantic segmentation using weak labels”. In: European Conference on Computer Vision. 2020, pp. 571–587.
|
| 257 |
+
[42] Zhongyi Pei, Zhangjie Cao, Mingsheng Long, and Jianmin Wang. “Multi-Adversarial Domain Adaptation”. In: AAAI Conference on Artificial Intelligence. 2018.
|
| 258 |
+
[43] Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. “Moment Matching for Multi-Source Domain Adaptation”. In: IEEE International Conference on Computer Vision. 2019, pp. 1406–1415.
|
| 259 |
+
[44] Can Qin, Lichen Wang, Qianqian Ma, Yu Yin, Huan Wang, and Yun Fu. “Contradictory Structure Learning for Semi-supervised Domain Adaptation”. In: Proceedings of the 2021 SIAM International Conference on Data Mining (SDM). SIAM. 2021, pp. 576–584.
|
| 260 |
+
[45] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. “Adapting Visual Category Models to New Domains”. In: European Conference on Computer Vision. 2010.
|
| 261 |
+
[46] Kuniaki Saito, Donghyun Kim, Stan Sclaroff, Trevor Darrell, and Kate Saenko. “SemiSupervised Domain Adaptation via Minimax Entropy”. In: IEEE International Conference on Computer Vision (2019), pp. 8049–8057.
|
| 262 |
+
[47] Kuniaki Saito, Yoshitaka Ushiku, Tatsuya Harada, and Kate Saenko. “Adversarial Dropout Regularization”. In: International Conference on Learning Representations. 2018.
|
| 263 |
+
[48] Karen Simonyan and Andrew Zisserman. “Two-Stream Convolutional Networks for Action Recognition in Videos”. In: Neural Information Processing Systems. 2014.
|
| 264 |
+
[49] Ankit Singh, Omprakash Chakraborty, Ashutosh Varshney, Rameswar panda, Rogerio Feris, Kate Saenko, and Abir Das. “Semi-Supervised Action Recognition With Temporal Contrastive Learning”. In: IEEE Conference on Computer Vision and Pattern Recognition. June 2021, pp. 10389–10399.
|
| 265 |
+
[50] Kihyuk Sohn, David Berthelot, Chun-Liang Li, Zizhao Zhang, Nicholas Carlini, Ekin D Cubuk, Alex Kurakin, Han Zhang, and Colin Raffel. “FixMatch: Simplifying Semi-Supervised Learning with Consistency and Confidence”. In: Neural Information Processing Systems (2020).
|
| 266 |
+
[51] Baochen Sun and Kate Saenko. “Deep CORAL: Correlation Alignment for Deep Domain Adaptation”. In: European Conference on Computer Vision Workshops. 2016.
|
| 267 |
+
[52] Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander Amir Alemi. “Inceptionv4, Inception-ResNet and the Impact of Residual Connections on Learning”. In: AAAI Conference on Artificial Intelligence. 2017.
|
| 268 |
+
[53] Antti Tarvainen and Harri Valpola. “Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results”. In: Neural Information Processing Systems. 2017.
|
| 269 |
+
[54] Yonglong Tian, Dilip Krishnan, and Phillip Isola. “Contrastive Multiview Coding”. In: European Conference on Computer Vision. 2020.
|
| 270 |
+
[55] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. “Adversarial Discriminative Domain Adaptation”. In: IEEE Conference on Computer Vision and Pattern Recognition (2017), pp. 2962–2971.
|
| 271 |
+
[56] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. “Deep Hashing Network for Unsupervised Domain Adaptation”. In: IEEE Conference on Computer Vision and Pattern Recognition (2017), pp. 5385–5394.
|
| 272 |
+
[57] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. “Temporal Segment Networks for Action Recognition in Videos”. In: IEEE Transactions on Pattern Analysis and Machine Intelligence 41 (2019), pp. 2740–2755.
|
| 273 |
+
[58] Luyu Yang, Yan Wang, Mingfei Gao, Abhinav Shrivastava, Kilian Q. Weinberger, Wei-Lun Chao, and Ser-Nam Lim. “Deep Co-Training with Task Decomposition for Semi-Supervised Domain Adaptation”. In: IEEE International Conference on Computer Vision. 2021.
|
md/train/3_MUAtqR0aA/3_MUAtqR0aA.md
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Packing: Towards 2x NLP BERT Acceleration
|
| 2 |
+
|
| 3 |
+
# Anonymous
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We find that at sequence length 512 padding tokens represent in excess of $5 0 \%$ of the Wikipedia dataset used for pretraining BERT (Bidirectional Encoder Representations from Transformers). Therefore by removing all padding we achieve a $2 \mathbf { x }$ speed-up in terms of sequences/sec. To exploit this characteristic of the dataset, we develop and contrast two deterministic packing algorithms. Both algorithms rely on the assumption that sequences are interchangeable and therefore packing can be performed on the histogram of sequence lengths, rather than per sample. This transformation of the problem leads to algorithms which are fast and have linear complexity in dataset size. The shortest-pack-first histogram-packing (SPFHP) algorithm determines the packing order for the Wikipedia dataset of over 16M sequences in 0.02 seconds. The non-negative least-squares histogram-packing (NNLSHP) algorithm converges in 28.4 seconds but produces solutions which are more depth efficient, managing to get near optimal packing by combining a maximum of 3 sequences in one sample. Using the dataset with multiple sequences per sample requires additional masking in the attention layer and a modification of the MLM loss function. We demonstrate that both of these changes are straightforward to implement and have relatively little impact on the achievable performance gain on modern hardware. Finally, we pretrain BERT-Large using the packed dataset, demonstrating no loss of convergence and the desired $2 \mathbf { x }$ speed-up.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Since its introduction in 2019, BERT $ { \mathbb { I } }$ has been the backbone driving the most exciting advances in Natural Language Processing (NLP). Pre-training BERT from scratch requires substantial computational resources which may be out of reach for researchers and industry professionals. To some extent this has been addressed by the public release of pre-trained models of different sizes and depths $\left[ \left[ 2 0 \right] \right]$ . Available sizes range from tiny (2 layers with hidden size 128) to large (24 layers with hidden size 1024)[6, 5]. The introduction of ALBERT $\textcircled { 1 1 4 } \textcircled { 1 }$ further improved the accessibility of larger models. However, the dependence on pre-trained models limits the ability of researchers to explore new backbone architectures. Furthermore, it limits the extent to which practitioners in industry can leverage internal datasets and adapt the model to their particular needs. Hence, any approach that speeds up the pre-training process is desirable from an economical as well as environmental perspective.
|
| 12 |
+
|
| 13 |
+
In this paper, we present some methods to enable researchers to accelerate the pre-training of BERT by as much as $2 \mathbf { x }$ . The de-facto pre-training dataset Wikipedia, as well as many other NLP datasets, show a positively skewed distribution of sequence lengths. We show that padding tokens (wasted compute) represent $5 0 \%$ of all tokens of the Wikipedia pre-training dataset at sequence length 512. Overall, the sample lengths range between 5 tokens up to 512 (see Figure 1). Samples of length 512 represent only $2 3 . 5 \%$ of the dataset.
|
| 14 |
+
|
| 15 |
+
While processing the padding tokens wastes compute, it is the most standard approach for leveraging modern massively-parallel compute especially on GPUs. These are most efficient when applying the same operation to each sequence in a batch. By padding all sequences to the same maximum sequence length, they can easily be batched. The most obvious way to reduce the extent of padding in the dataset is to group samples by size before batching, i.e., process the shorter samples together and longer samples together. Typically such an approach would still involve padding but less than if padding all sequences to the same maximum length. For example BERT $\boxed { \pmb { \bigtriangledown } }$ is pre-trained in two phases, where the first phase uses sequence length 128 for 900K steps and the second phase uses sequence length 512 for 100K steps. However even by splitting the training in this way, the wasted compute due to padding is approximately $2 0 \%$ (see Figure $\bigstar \bigstar \bigstar \bigstar$ ). Another example of this approach is Faster Transformer $\overline { { \mathbb { I } \mathbb { 8 } \| } }$ which groups samples of similar size together in one batch and fills up with padding only to the maximum length in this batch.
|
| 16 |
+
|
| 17 |
+
More advanced approaches for reducing the padding overhead rely on custom computational kernels. Loosely these are referred to as “un-padding” approaches. In Effective Transformer $\pmb { \Vert 4 \Vert }$ , the input batch is provided as a padded matrix but padding values are dynamically removed and restored during different calculation stages. While un-padding implementations are highly sophisticated and are able to completely circumvent the processing of padding tokens, they introduce a significant overhead due to the multiple GPU kernel launches (i.e. one kernel per sequence rather than one kernel per batch). Additionally the time to process each batch will fluctuate depending on the sequence lengths in each batch i.e. batches with only shorter sequences will typically be processed faster. When working with more than one accelerator, this variability in throughput results in all devices in the cluster waiting for the device with the most compute intensive batch to finish processing. As such, un-padding approaches are not appropriate for deployment on large clusters.
|
| 18 |
+
|
| 19 |
+
The “packing” based approach introduced in this paper offers significant advantages over un-padding approaches. Firstly, packing is implemented directly at the framework level and requires no additional custom kernel implementations. Secondly, the processing time for each batch is independent of the content of the batch, allowing the packing based approach to maintain the same speed-up whether running on a single device or thousands. Third, each batch now contains a consistent number of real tokens.
|
| 20 |
+
|
| 21 |
+
While we demonstrate the effectiveness of packing specifically on the Wikipedia dataset, packing SQUaD $\mathbb { \lVert \underline { { 9 } } \rVert }$ or GLUE datasets $\mathbb { \lVert 2 2 \rVert 2 3 \rVert }$ for BERT also leads to significant speed-ups (some in excess of 9x) [1] (sections A and B). The effectiveness of packing is a result of both the length distribution of the documents in the source datasets as well as the different text preprocessing steps for BERT [7]. The use of bi-directional self-attention in BERT implies that the input sequences should contain complete sentences. If a sentence is abruptly cut short, the hidden state on other (preceding) tokens in the sequence will be affected. Language models with causal attention (only attending to previous tokens in the input) do not have this issue. For such models, if a sequence is cut short at an arbitrary token, the other tokens (which occur earlier in the sequence) will not be affected. This ability to cut sequences arbitrarily completely trivializes the packing problem. For instance, GPT-3 $\mathbb { \left[ 3 \right] }$ is trained with a maximum sequence length of 2048 where a single sequence may contain multiple segments separated by a special end of segment token. The last segment in each sequence is simply cut to meet the sequence length requirement. In the interest of computational efficiency GPT-3 does not mask the attention between different segments in a sequence. In contrast, the packing approach presented in this paper introduces a mask in the attention layer (see Section $3 . 2 )$ to prevent cross-contamination between examples in a pack. This ensures that the characteristics of the original dataset and model are matched as closely as possible.
|
| 22 |
+
|
| 23 |
+
In summary, the contributions of the paper are as follows. In Section $\bigtriangledown ,$ , we produce histograms of the Wikipedia pre-training dataset showing the high percentage of padding tokens. We present two new deterministic packing algorithms which easily pack datasets with millions of sequences in a matter of seconds (or less). We empirically show that the proposed packing algorithms produce a nearly-optimal packing scheme for Wikipedia pre-training dataset. We show how to compute the per-sequence loss by inexpensively un-packing the loss. We provide code for building an attention mask which prevents attention between tokens of different sequences in the pack. We demonstrate that the convergence of the BERT large model on the packed dataset is equivalent to that on the un-packed dataset. We show that with the packed dataset, we are able to achieve a nearly 2x throughput increase on the Wikipedia sequence length 512 pre-training dataset.
|
| 24 |
+
|
| 25 |
+
# 2 Wikipedia BERT pre-training dataset
|
| 26 |
+
|
| 27 |
+
BERT is pre-trained using masked-language modelling and next-sentence prediction on a large corpus of Wikipedia articles [5]. Each sequence is composed of one ${ \mathrm { < C L S > } }$ token followed by the first part of sentences, followed by a ${ \tt { < S E P > } }$ token, and then finally the second part of sentences. Because parts are created in sentence-level increments there is no token-level control of sequence length. Together with already short parts, empirically, this leads to significant levels of padding, especially for longer maximum sequence lengths (see Figure 1). At sequence length 128 (commonly used in phase 1 of pre-training) the theoretical speed-up is around 1.2, at sequence length 384 this increases to 1.7, and finally at sequence length 512 (commonly used for phase 2 of pre-training) it is 2.0. Despite the widespread use of the Wikipedia dataset for pre-training BERT such histograms have, to the best of our knowledge, not been published previously. This has perhaps lead to the underestimation of the speed-up opportunity available. To put things into perspective, the sequence length 512 dataset contains 8.33 billion tokens, of which 4.17 billion are padding tokens.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Wikipedia BERT pre-training dataset sequence length histograms (token count excluding padding) for different maximum sequence lengths. Based on the Wikipedia article dump from October 1st 2020. The theoretical speed-up relates to not using any padding tokens and not having any overhead from processing the different lengths.
|
| 31 |
+
|
| 32 |
+
# 3 Methods
|
| 33 |
+
|
| 34 |
+
Our approach consists of three distinct components. Firstly, we pack the data efficiently during preprocessing to make full use of the sequence length (Sections $\checkmark$ and $3 . 1 . 2 ,$ see also [1] Section D). Secondly, we adapt the self-attention mask to prevent the model from attending between different sequences in the same pack (Section $\boxed { 3 . 2 }$ . Other components of the model, such as the feed-forward layer $\scriptstyle { \left\| { \overline { { 2 1 } } } \right\| }$ , operate on a per-token basis and do not require any modification. Thirdly, we compute the loss and accuracy on a per-sequence basis to match the canonical BERT implementation (Section $\textcircled { 3 . 3 }$ This is achieved by unpacking the per-pack loss at the framework level, without the use of custom kernels. Additionally, we provide suggestions for hyperparameter adjustment (Section $3 . 4 )$ that lead to analogous convergence behavior between the packed and un-packed BERT implementations.
|
| 35 |
+
|
| 36 |
+
# 3.1 Packing algorithms
|
| 37 |
+
|
| 38 |
+
The problem of optimally concatenating multiple sequences of different length until a maximum combined length is reached can be directly framed as a bin-packing or stock cutting problem. Since an exact solution is strongly NP-complete $\mathbb { \lVert 1 3 \rVert }$ , we propose two new heuristic algorithms that are tailored to this particular instance. A detailed introduction to packing is provided in [1](Section D)
|
| 39 |
+
|
| 40 |
+
# 3.1.1 Shortest-pack-first histogram-packing (SPFHP)
|
| 41 |
+
|
| 42 |
+
Shortest-pack-first histogram-packing (SPFHP) consists of three main components. First, the packing algorithm works on the bins in the sequence length histogram (with bin size 1) rather than the individual samples. Second, we operate on the sorted data from longest to shortest sequences. This comes basically for free due to the use of histograms. Third, we apply the worst-fit algorithm [11, 26] onto this histogram, where the currently observed sample goes to the pack1 that has the most space left to reach maximum packing depth (“shortest-pack-first”). If the sample does not fit, a new pack is created. A variant is to limit the packing depth, in other words the maximum number of sequences that are allowed in a pack. Therefore, we only extend an existing pack if it is not already at maximum packing depth. The detailed code for the algorithm is provided in [1] (listing $\textcircled { 3 }$ .
|
| 43 |
+
|
| 44 |
+
# 3.1.2 Non-negative least squares histogram-packing (NNLSHP)
|
| 45 |
+
|
| 46 |
+
The proposed NNLSHP algorithm is based on re-stating the packing problem as a (weighted) nonnegative least squares problem (NNLS) $\pmb { \mathbb { D } } \|$ of the form $w A x = w b$ where $x \geq 0$ . The vector $b$ is the histogram containing the counts of all the sequence lengths in the dataset. Next, we define the $A$ matrix (the “packing matrix“) by first generating a list of all possible sequence length combinations (“strategies”) that add up exactly to the maximum sequence length. We focus specifically on strategies that consist of at most 3 sequences per pack (independent of $b$ ) and encode each strategy as a column of the sparse matrix $A$ . For example, a strategy consisting of the sequence length 128, 128, and 256 in represented a column vector that has the value 2 at the 128th row, the value 1 at the 256th row, and zero at all other rows. The variable $x$ describes the non-negative repetition count for each strategy. So a 24 in the ith row of $x$ means that the strategy represented by the ith column of $A$ should repeat 24 times. Moreover, in the un-weighted setting, $A x = b$ states that we would like to “mix” the pre-defined strategies (columns of $A$ ) such that the number of samples matches the histogram $b$ , and where each strategy is used $x \geq 0$ times. We use the residual weight $w$ to control the penalization of the $A x - b$ residual on different sequence lengths (different rows of $b$ ). Heuristically, we set the weight of 0.09 for all sequences of length 8 or smaller because they are considered acceptable padding sequences. All other sequence lengths get weight 1. After solving $w A x = w b$ for $x \geq 0$ using an off-the-shelf solver we obtain a floating point solution, which means that the repetition counts are not necessarily integers. Since we cannot use a non-natural number of strategies, we round the solution $\hat { x }$ to the nearest integer. The error introduced by this rounding is found to be negligible. Further details are provided in [1](Section D.4).
|
| 47 |
+
|
| 48 |
+
# 3.2 Attention masking for packed sequences
|
| 49 |
+
|
| 50 |
+
To maintain an implementation that is consistent with the un-packed version, we need to be able to prevent attention between tokens in the pack which belong to different sequences. Other implementations use custom attention kernels which reconstruct padding. Instead, we propose directly masking the attention matrix with a block-diagonal mask to be applied before the attention. This is straightforward to implement in modern frameworks (see Figure 2). Naturally, there is a cost to both the mask construction and applying it to the attention matrix (see Table 1, Section $4 . 1 \dot { } \dot { } )$
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Attention mask code sample [left] and example zero-one mask [right].
|
| 54 |
+
|
| 55 |
+
# 3.3 Calculating per-sequence loss and accuracy
|
| 56 |
+
|
| 57 |
+
Canonical implementations of BERT compute the cross-entropy loss for the masked language model on a per-sequence basis. Simply feeding packs of sequences to the same implementation of crossentropy would consequently result in per-pack weighting of the loss. In other words, the overall loss on the micro-batch would sum-up the losses on the individual packs, rather than individual sequences. As a result the packed BERT model would converge to a different optimum. For instance, a pack of a single sequence would contribute to the loss to the same extent as a pack of three sequences. In other words, the long sequence (single per pack) is given the same weight as the three shorter sequences in the pack of three. Empirically, a degradation of masked-language modelling accuracy on shorter sequences is indeed observed when not modifying the loss to account for packing.
|
| 58 |
+
|
| 59 |
+
To recover the per-sequence averaging behavior of the canonical un-packed BERT implementation, it is not sufficient to simply weight the loss (accuracy) on each pack by the number of sequences it contains, because the sequences in the pack have different lengths and therefore should not use the same weight.
|
| 60 |
+
|
| 61 |
+
To implement per-sequence loss, we effectively “unpack” the incoming logits and labels by working with the per-token loss. We compute the loss on all tokens belonging to the first sequence, then all tokens belonging to the second sequence, and so on. However, rather than looping through the sequences index in this way, we compute on all indexes in parallel. This minimizes the latency overhead of un-packing the loss calculation. We use the “masked lm weight” $\pmb { \mathbb { H } }$ input tensor to represent which sequence a given masked token belongs to (0, 1, 2 and so on). This is consistent with the canonical BERT implementation where this input takes a value of either 1 (belonging to the sequence) or 0 (belonging to padding) as detailed in Listing 1. The same methodology can be applied to the next-sentence prediction loss and accuracy.
|
| 62 |
+
|
| 63 |
+
# Listing 1: Loss calculation
|
| 64 |
+
|
| 65 |
+
# The number of sequences in each batch may vary 2 sequences_in_batch $=$ tf. reduce_sum (tf. reduce_max ( masked_lm_weight , -1)) 3 sequences_in_batch $=$ tf. cast ( sequences_in_batch , tf. float32 ) 4 # Create the 0/1 mask that will be used to un - packed sequences 5 masked_lm_weight $=$ tf. reshape ( masked_lm_weight , [B, 1, -1]) 6 sequence_selection $=$ tf. reshape (tf. range (1, max_sequences_per_pack + 1) , [1, -1, 1]) sequence_selection $=$ tf. cast ( masked_lm_weight $= =$ sequence_selection , tf. float32 ) 8 # Apply the mask to un - pack the loss per sequence 9 nll_per_token $=$ tf. reshape ( nll_per_token , [B, 1, -1]) 10 nll_per_sequence $=$ sequence_selection $^ { * }$ nll_per_token 11 # Normalize the per - sequence loss by the number of mlm - tokens in the sequence (as is standard ) 12 attempted $=$ tf. reduce_sum ( sequence_selection , -1, keepdims $=$ True ) 13 attempted $=$ attempted $^ +$ tf. cast ( attempted $= =$ 0, tf. float32 ) # prevent NaNs when dividing by attempted 14 nll_per_sequence $= \texttt { n l 1 }$ _per_sequence / attempted 15 # Average per - batch loss (so contributions from different batches are comparable ) 16 lm_loss $=$ tf. reduce_sum ( nll_per_sequence )/ sequences_in_batch
|
| 66 |
+
|
| 67 |
+
# 3.4 Hyperparameter adjustment
|
| 68 |
+
|
| 69 |
+
In terms of convergence behavior, the primary consequence of packing is an increase in the effective batch size (with respect to sequences and tokens) with some variation over different iterations. For instance, if each pack on average contains two sequences, the batch size (per optimization step) is effectively doubled on average. While one could subsequently reduce the computational batch size by the packing factor (average number of sequences per pack) and keep using the same hyperparameters, this is typically not desirable as it might imply under-utilizing the memory/compute.
|
| 70 |
+
|
| 71 |
+
Instead, we propose an approximate heuristic for updating the decay parameters of the LAMB optimizer $[ [ 2 5 ] ]$ . For a packed dataset with a packing factor $p$ , we update the decay parameters as: $\bar { \beta _ { 1 } } : = \beta _ { 1 } ^ { p }$ , $\beta _ { 2 } : = \beta _ { 2 } ^ { p }$ . For $p = 2$ , this corresponds to the exact parameters for calculating momentum and velocity, when updating with the same gradient twice $\scriptstyle { \mathbb { I I I } } ( { \mathrm { S e c t i o n ~ E } } )$ . A common approach is to scale the learning rate with the batch size. Note however, that we take the mean gradient instead of an accumulated sum and have already a correction by the number of samples in that regard.
|
| 72 |
+
|
| 73 |
+
Since these adjustments are only heuristics the convergence of the model will be comparable but not identical. In particular, it is unlikely that simply adjusting the hyperparameters will fully undo the impact of the increased batch size. However, with these adjustments, researchers should be able to continue to use existing configurations.
|
| 74 |
+
|
| 75 |
+
# 4 Experiments
|
| 76 |
+
|
| 77 |
+
# 4.1 Bin-packing algorithm comparison
|
| 78 |
+
|
| 79 |
+
We evaluate our algorithms using the following metrics: number of packs, number of all tokens, number of padding tokens, solution time of the packing algorithm (after histogram and strategy creation), number of strategies used, packing efficiency (the fraction of non-padding tokens in the packed dataset), the speed-up achieved compared to not packing (depth 1), and the average number of sequences per sample (packing factor). For SPFHP, we analyse different (maximum) packing depth, since packing is less efficient with smaller depth and we want to get a general understanding on how the packing depth influences the processing time. For NNLSHP, we focus on packing depth 3 because it packs the data sufficiently well.
|
| 80 |
+
|
| 81 |
+
For the speed-up analysis, we focus on the intelligence processing unit (IPU) [10] (IPU-M2000, 16 accelerator chips). A GPU dynamically loads the code into the accelerator; in contrast, the IPU works with a static precompiled kernel that gets loaded onto the chip only at the beginning. While other approaches result in excessive padding or continuous changes of the code, our approach can work with the same code for the whole dataset. So in this setting the IPU architecture would especially benefit from our approach since it avoids code changes. Nevertheless, it can be applied to any implementation on GPU or TPU. For determining the speed-up, we take advantage of the precompiled kernel. Since time measurements are quite noisy, we can profile the kernel and how many cycles it takes for processing a batch. That way, we can determine the overhead (in cycles) from processing the additional attention masking and for unpacking the loss. Combining overhead and packing factor, we get the speed-up estimate. No experiment repetitions are required since the algorithms and measurements are deterministic.
|
| 82 |
+
|
| 83 |
+
The main results for the performance metric evaluation are displayed in Table 1. The processing time for SBFHP was around $0 . 0 3 s$ and independent from the packing depth. We see that the overhead slightly increases with packing depth but that the benefits of packing outweigh the cost. The best speed-up is obtained with NNLSHP at depth 3. With a value of 1.913, it is close to the theoretical upper bound of 2.001. The results show that efficiency, packing factor, and speed-up can be viewed inter-changeably. The amount of time needed to process a sample (a pack of sequences) is barely changed relative to the un-packed implementation. The packing factor or the improvement in efficiency effectively provide an accurate estimate of the speed-up.
|
| 84 |
+
|
| 85 |
+
<table><tr><td>pack. depth</td><td>pack. algo.</td><td># packs [M]</td><td>efficiency (%)</td><td>pack. factor</td><td>overhead (%)</td><td>realized speed-up</td></tr><tr><td>1</td><td>none</td><td>16.280</td><td>49.97</td><td>1.000</td><td>0.000</td><td>1.000</td></tr><tr><td>2</td><td>SPFHP</td><td>10.102</td><td>80.52</td><td>1.612</td><td>4.283</td><td>1.544</td></tr><tr><td>3</td><td>SPFHP</td><td>9.095</td><td>89.44</td><td>1.790</td><td>4.287</td><td>1.716</td></tr><tr><td>3</td><td>NNLSHP</td><td>8.155</td><td>99.75</td><td>1.996</td><td>4.287</td><td>1.913</td></tr><tr><td>4</td><td>SPFHP</td><td>8.659</td><td>93.94</td><td>1.880</td><td>4.294</td><td>1.803</td></tr><tr><td>8</td><td>SPFHP</td><td>8.225</td><td>98.90</td><td>1.979</td><td>4.481</td><td>1.895</td></tr><tr><td>16/max</td><td>SPFHP</td><td>8.168</td><td>99.60</td><td>1.993</td><td>4.477</td><td>1.905</td></tr></table>
|
| 86 |
+
|
| 87 |
+
Table 1: Key performance results of proposed packing algorithms (SPFHP and NNLSHP). Packing depth describes the maximum number of packed sequences. Packing depth 1 is the baseline BERT implementation. Setting no limit resulted in a maximum packing depth of 16. The number of packs describes the length of the new packed dataset. Efficiency is the percentage of real tokens in the packed dataset. The packing factor describes the resulting potential speed-up compared to packing depth 1. With overhead, we denote the percentage decrease in throughput due to changes to the model to enable packing (such as the masking scheme introduced in Section $3 . 2 )$ . The realized speed-up is the combination of the speed-up due to packing (the packing factor) and the decrease in throughput due to the overhead. It is used to measure the relative speed-up in throughput and the overhead from masking and loss adjustment.
|
| 88 |
+
|
| 89 |
+
# 4.2 Learning Curves and Hyperparameter Adjustment
|
| 90 |
+
|
| 91 |
+
For depth 1 (classic BERT) and NNLSHP with depth 3, we additionally evaluate on the MLPerf 0.7 BERT pre-training benchmark $\mathbb { \left. \overline { { 1 5 } } \right. }$ . Briefly, this involves training from a standard checkpoint to a masked-language model accuracy of $7 1 . 2 \%$ using 3 million sequences with a maximum length of 512 tokens (refer to $\boxed { 1 6 }$ for details). Following this standardized benchmark supports reproduction of results even on other systems and makes sure that the reproduction effort is moderate and setup rules are clearly documented. We compare the resulting speed-up as well as the respective learning curves by evaluating the data on a held-out validation dataset. The objective of this additional evaluation is to analyse if convergence behavior is changed by the packing strategy and if the theoretical speed-up can be achieved in practice.
|
| 92 |
+
|
| 93 |
+
With packing, we effectively increase the average batch size by the packing factor $( \approx 2 )$ . However, with a different batch size, different hyperparameters are required (see Section $3 . 4 )$ and there is no mapping that will generate exact matching of results but only heuristics. In a first comparison, we use the same hyperparameters when comparing packed and unpacked training except for cutting the accumulation count by half. This way, we make sure that the batch size is constant on average.
|
| 94 |
+
|
| 95 |
+
In the second comparison, we evaluate our heuristics and how they compensate the difference in batch size. This setup is more desirable because it is beneficial to use the hardware to its full potential and cutting the batch size by half usually reduces throughput. In the third comparison, we compare two optimized setups.
|
| 96 |
+
|
| 97 |
+
The learning curves are displayed in Figure $3 .$ In the first setup, we see the curves almost matching perfectly when normalizing by the numbers of samples processed. Differences can be explained by the variation of the number of sequences in the packing batch, and general noise in the training process. Especially after the initial phase, the curves show a near-identical match.
|
| 98 |
+
|
| 99 |
+
The second setup shows bigger differences since changing the batch size and hyperparameters changes the training dynamics. We observe slower convergence early on in training due to the increased batch size. This is expected. The adjustment of the learning rate actually decreases performance probably because we correct for the increased number of sequences already in the modified loss. With the adjustment of the decay parameter of LAMB, we see matching performance at the later training stages. However, it is not feasible to completely recover the early convergence behavior of the smaller batch size by adjusting the hyperparameters. For instance doubling the batch size of unpacked BERT to 3000 and adjusting the LAMB decay parameters leads to more of a slow down in convergence than when running packed BERT with a batch size of 1500 and a packing factor of 2. Overall, in practice we observe a higher acceleration than the estimated 1.913 that goes beyond $2 \mathbf { x }$ . We explain this with slightly better fitting hyperparameters and improved data transfer.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 3: Comparison of learning curves for packed and unpacked processing with [left] same effective batch size (ebs is batch size times packing factor), [middle] different heuristic adjustments of the hyperparameters (batch size 1500 for all runs, such that ebs for packed runs is $1 5 0 0 * 2$ ), and [right] realized time-to-convergence speed-up from packing.
|
| 103 |
+
|
| 104 |
+
# 4.3 Scaling Analysis: Impact of the number of accelerators
|
| 105 |
+
|
| 106 |
+
A further advantage of packing over competing un-padding approaches is the inherent load balancing provided by packing. So called un-padding approaches rely on dynamically launching custom kernels that ignore padding. A stated advantage of such implementations is the ability to avoid computing the complete $( 5 1 2 \mathrm { ~ x ~ } 5 1 2 )$ ) attention matrix. This provides additional computational savings compared to packing, where the attention matrix is computed in its entirety and then masked. Because of these additional savings, un-padding can exceed the theoretical upper bound for speed-up from packing (2.013 on Wikipedia). As a result of the dynamic nature of the approach, the processing time with un-padding is different for each sequence in the batch, and the amount of time required to process a batch of sequences will be determined by the processing time of the longest sequence in the batch (with the sequences being processed in parallel). Furthermore, in the multiple accelerator setting the processing time on each device will vary depending on the sequences in the batch that it receives. Devices which finish early have to wait for the slowest device to finish before exchanging gradients. This load-imbalance between the devices (and inside the batch) leads to a considerable decrease in the speed-up from un-padding as the number of accelerators is increased (see Figure 4).
|
| 107 |
+
|
| 108 |
+
In contrast, packing (our approach) is inherently load-balanced. The processing time on each accelerator is independent of the content inside the batch received by the device. Any number of accelerators can therefore operate in unison without having to wait for the slowest batch to process (all per-device batches are equally fast).
|
| 109 |
+
|
| 110 |
+
To demonstrate the severity of the load-imbalance issue, we consider the scaling of an un-padding approach with a per-device batch size of 32 running on eight devices $\mathbb { \ m }$ . From there, we readily extrapolate the performance to both larger and smaller cluster sizes by fitting a Gumbel distribution to the observed processing times [1] (Section F). On a single device with batch size $3 2 { \mathrm { u n } }$ -padding outperforms packing and exceeds the theoretical upper-bound for packing.
|
| 111 |
+
|
| 112 |
+
As the number of devices increases to two or more, the proposed packing approach outperforms the dynamic un-padding approach. On a cluster with 32 accelerators the speed-up from un-padding drops to $5 0 \%$ and with 2048 devices the speed-up is only $3 0 \%$ . In contrast, the speed-up due to packing is independent of the number of accelerators and stays at 1.913. Switching to a smaller batch size would reduce the load-imbalance issue to some extent, but would also result in under-utilization of the available memory and compute.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 4: Comparison of the theoretical speed-up achievable as the number of accelerators is increased.
|
| 116 |
+
|
| 117 |
+
# 5 Conclusion
|
| 118 |
+
|
| 119 |
+
We showed that packing can be easily implemented without the need for any custom kernels while still providing a 2x speed-up. Additionally, we showed that any additional speed-ups resulting from dynamic un-padding approaches diminish for even moderate batch sizes or when additional accelerators are added. In contrast, packing is load-balanced and maintains the $2 \mathbf { x }$ throughput when scaling to large numbers of accelerators.
|
| 120 |
+
|
| 121 |
+
Furthermore, the computational overhead introduced by the attention mask and the packed persequence loss are small compared to the achieved acceleration. This overhead remains below $5 \%$ for all tested packing depths. The efficient packing algorithms presented in this paper enable us to pack millions of sequences in a matter of seconds. Compared to both the pre-processing time for the Wikipedia dataset and the training runtime, this overhead is negligible. Furthermore, we showed that performing packing as a pre-processing step does not significantly impact the training convergence. Our proposed hyperparameter adjustment scheme additionally helps practitioners easily modify existing validated optimizer settings for use with packed BERT. Further exploration of hyperparameter selection is left to future work.
|
| 122 |
+
|
| 123 |
+
When performing packing as a pre-processing step, the proposed NNLSHP and SPFHP methods achieve near optimal compression efficiency. In this offline setting, we are able to build a histogram of the dataset, and thus achieve linear time complexity with respect to the number of samples. This makes packing modern datasets with millions of sequences possible. In the future, it would be interesting to extend SPFHP to the online setting where a histogram of the entire dataset cannot be built. Another interesting direction is the packing of images of different sizes to help accelerate computer-vision applications. This is especially relevant given the recent advances in the use of transformer-based approaches in the computer vision domain, for example the visual transformer [24]. Masking out the self-attention within transformers is easier to implement than avoiding cross-contamination of convolutions applied to packed images. Finally, packing could potentially eliminate the need for two phase pre-training of BERT. Using short sequences in the first phase to reduce the waste from padding is no longer attractive for packed sequence BERT where the padding is essentially a negligible proportion of the tokens. Furthermore, the argument that the model should first learn short-term dependencies by training on short sequences neglects the fact that these same short-term patterns can be learned from longer sequences. In fact, longer-sequences may contain multiple short patterns, while also maintaining long-range consistency. Future work should explore training packed BERT from scratch and the impact of packing on fine-tuned performance.
|
| 124 |
+
|
| 125 |
+
# Broader Impact
|
| 126 |
+
|
| 127 |
+
We showed that when pre-training BERT on Wikipedia, the computational overhead taken to process padding tokens is roughly $5 0 \%$ . By eliminating this wasted computational time, the approach presented in this paper paves a way to halving the carbon footprint of training BERT-based models.
|
| 128 |
+
|
| 129 |
+
Furthermore, our approach circumvents the need for custom kernels, making the benefits of packing readily accessible to a broader audience of NLP practitioners. As such we are hopeful the research will have a positive impact on the NLP community, and do not see any disadvantage of using this approach.
|
| 130 |
+
|
| 131 |
+
Future work would need to investigate the applicability of packing on text produced by different cultures and in different languages. We have already shown that the speed-up resulting from using our methods does not only occur when pre-training BERT on Wikipedia but also on other datasets such as SQUaD and GLUE. Furthermore, the sentence length distribution of the original English language text shows similar characteristics. Our research leads us to believe that compressible distributions arise naturally in language tasks and beyond, for instance in DNA sequence lengths [9] and protein lengths $\textcircled { 8 }$ . Many such sequence modelling workloads are based on variations of the BERT/transformer architecture and would therefore easily benefit from our acceleration.
|
| 132 |
+
|
| 133 |
+
Failures in NLP can have a big impact on society; many technologies, such as Alexa, Siri, and Google Home, rely on them. Whilst any errors arising from our approach can be avoided, one potential source of error comes from the implementation. Both the attention mask and the per-sequence loss need to be modified to support packing. These changes are significantly smaller than those required by custom kernels, however they may still be time consuming to implement and debug. To help mitigate the risk of any implementation errors, we share our reference implementations of the required changes in the supplemental material [1].
|
| 134 |
+
|
| 135 |
+
# References
|
| 136 |
+
|
| 137 |
+
[1] ANONYMOUS. Supplemental Material for “Packing: Towards 2x NLP BERT Acceleration”, 2021.
|
| 138 |
+
[2] BRO, R., AND DE JONG, S. A fast non-negativity-constrained least squares algorithm. Journal of Chemometrics 11, 5 (sep 1997), 393–401.
|
| 139 |
+
[3] BROWN, T. B., MANN, B., RYDER, N., SUBBIAH, M., KAPLAN, J., DHARIWAL, P., NEELAKANTAN, A., SHYAM, P., SASTRY, G., ASKELL, A., AGARWAL, S., HERBERT-VOSS, A., KRUEGER, G., HENIGHAN, T., CHILD, R., RAMESH, A., ZIEGLER, D. M., WU, J., WINTER, C., HESSE, C., CHEN, M., SIGLER, E., LITWIN, M., GRAY, S., CHESS, B., CLARK, J., BERNER, C., MCCANDLISH, S., RADFORD, A., SUTSKEVER, I., AND AMODEI, D. Language Models are Few-Shot Learners. In Advances in Neural Information Processing Systems 33 pre-proceedings (NeurIPS 2020) (may 2020).
|
| 140 |
+
[4] BYTEDANCE INC. Effective Transformer. https://github.com/bytedance/effective_ transformer, 2021.
|
| 141 |
+
[5] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. BERT: Pre-training of deep bidirectional transformers for language understanding. NAACL HLT 2019 - 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies - Proceedings of the Conference 1 (oct 2019), 4171–4186.
|
| 142 |
+
[6] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. https://github.com/ google-research/bert, 2019.
|
| 143 |
+
[7] DEVLIN, J., CHANG, M. W., LEE, K., AND TOUTANOVA, K. Pre-training data creation script for BERT. https://github.com/google-research/bert/blob/master/ create_pretraining_data.py#L243, 2019.
|
| 144 |
+
[8] GUILLÉN, G., DIAZ-CAMINO, C., LOYOLA-TORRES, C., APARICIO-FABRE, R., HERNÁNDEZ-LÓPEZ, A., DÍAZ-SÁNCHEZ, M., AND SANCHEZ, F. Detailed analysis of
|
| 145 |
+
|
| 146 |
+
putative genes encoding small proteins in legume genomes. Frontiers in Plant Science 4 (2013), 208.
|
| 147 |
+
|
| 148 |
+
[9] HANSEN, H. B., DAMGAARD, P. B., MARGARYAN, A., STENDERUP, J., LYNNERUP, N., WILLERSLEV, E., AND ALLENTOFT, M. E. Comparing ancient dna preservation in petrous bone and tooth cementum. PLOS ONE 12, 1 (01 2017), 1–18.
|
| 149 |
+
|
| 150 |
+
[10] JIA, Z., TILLMAN, B., MAGGIONI, M., AND SCARPAZZA, D. P. Dissecting the Graphcore IPU architecture via microbenchmarking. ArXiv abs/1912.03413 (2019).
|
| 151 |
+
|
| 152 |
+
[11] JOHNSON, D. S. Near-optimal bin packing algorithms. PhD thesis, Massachusetts Institute of Technology, 1973.
|
| 153 |
+
|
| 154 |
+
[12] JOHNSON, D. S., AND GAREY, M. R. A 7160 theorem for bin packing. Journal of Complexity 1, 1 (oct 1985), 65–106.
|
| 155 |
+
|
| 156 |
+
[13] KORTE, B., AND VYGEN, J. Combinatorial Optimization, vol. 21 of Algorithms and Combinatorics. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012.
|
| 157 |
+
|
| 158 |
+
[14] LAN, Z., CHEN, M., GOODMAN, S., GIMPEL, K., SHARMA, P., AND SORICUT, R. ALBERT: A lite BERT for self-supervised learning of language representations. CoRR abs/1909.11942 (2019).
|
| 159 |
+
|
| 160 |
+
[15] MATTSON, P., REDDI, V. J., CHENG, C., COLEMAN, C., DIAMOS, G., KANTER, D., MICIKEVICIUS, P., PATTERSON, D., SCHMUELLING, G., TANG, H., WEI, G., AND WU, C. MLPerf: An Industry Standard Benchmark Suite for Machine Learning Performance. IEEE Micro 40, 2 (2020), 8–16.
|
| 161 |
+
|
| 162 |
+
[16] MLCOMMONS. v0.7 Results. https://mlcommons.org/en/training-normal-07/, 2020. Result not verified by MLPerf. Throughput/speedup is not the primary metric of MLPerf. MLPerf name and logo are trademarks. See www.mlperf.org for more information.
|
| 163 |
+
|
| 164 |
+
[17] NVIDIA. Reference numbers for BERT un-padding results. https://github.com/ mlcommons/training_results_v0.7/blob/master/NVIDIA/results/dgxa100 ngc20.06_pytorch/bert/result_0.txt, 2020. Throughput/speedup is not the primary metric of MLPerf. MLPerf name and logo are trademarks. See www.mlperf.org for more information.
|
| 165 |
+
|
| 166 |
+
[18] NVIDIA. Faster Transformer. https://github.com/NVIDIA/DeepLearningExamples/ tree/master/FasterTransformer/v1, 2021.
|
| 167 |
+
|
| 168 |
+
[19] RAJPURKAR, P., ZHANG, J., LOPYREV, K., AND LIANG, P. SQuAD: $^ { 1 0 0 , 0 0 0 + }$ questions for machine comprehension of text. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing (Austin, Texas, Nov. 2016), Association for Computational Linguistics, pp. 2383–2392.
|
| 169 |
+
|
| 170 |
+
[20] TURC, I., CHANG, M.-W., LEE, K., AND TOUTANOVA, K. Well-read students learn better: On the importance of pre-training compact models. arXiv preprint arXiv:1908.08962v2 (2019).
|
| 171 |
+
|
| 172 |
+
[21] VASWANI, A., SHAZEER, N., PARMAR, N., USZKOREIT, J., JONES, L., GOMEZ, A. N., KAISER, U., AND POLOSUKHIN, I. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems (Red Hook, NY, USA, 2017), NIPS’17, Curran Associates Inc., p. 6000–6010.
|
| 173 |
+
|
| 174 |
+
[22] WANG, A., SINGH, A., MICHAEL, J., HILL, F., LEVY, O., AND BOWMAN, S. GLUE: A multi-task benchmark and analysis platform for natural language understanding. In Proceedings of the 2018 EMNLP Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP (Brussels, Belgium, Nov. 2018), Association for Computational Linguistics, pp. 353–355.
|
| 175 |
+
|
| 176 |
+
[23] WARSTADT, A., SINGH, A., AND BOWMAN, S. R. Neural network acceptability judgments. arXiv preprint arXiv:1805.12471 (2018).
|
| 177 |
+
|
| 178 |
+
[24] WU, B., XU, C., DAI, X., WAN, A., ZHANG, P., YAN, Z., TOMIZUKA, M., GONZALEZ, J., KEUTZER, K., AND VAJDA, P. Visual transformers: Token-based image representation and processing for computer vision, 2020.
|
| 179 |
+
|
| 180 |
+
[25] YOU, Y., LI, J., REDDI, S., HSEU, J., KUMAR, S., BHOJANAPALLI, S., SONG, X., DEMMEL, J., KEUTZER, K., AND HSIEH, C.-J. Large Batch Optimization for Deep Learning: Training BERT in 76 minutes. arXiv (apr 2019).
|
| 181 |
+
|
| 182 |
+
[26] YUE, M., AND ZHANG, L. A simple proof of the inequality $M F F D ( L ) \leq 7 1 / 6 0 O P T ( L ) +$ $1 , L$ for the MFFD bin-packing algorithm. Acta Mathematicae Applicatae Sinica $^ Ḋ I I Ḍ$ , 3 (jul 1995), 318–330.
|
| 183 |
+
|
| 184 |
+
# Checklist
|
| 185 |
+
|
| 186 |
+
1. For all authors...
|
| 187 |
+
|
| 188 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] Our paper has three main claims. First, in Figure 1[right] we show the distribution of the Wikipedia and the excessive padding that it requires. Second, in Section $^ { 4 . 1 , }$ we show that we can efficiently pack the data which can be easily reproduced with the shared data and code [1]. Third, in Figure 3[right], we clearly show the $2 \mathbf { x }$ performance gain from packing and the related hyperparameter adjustment scheme.
|
| 189 |
+
(b) Did you describe the limitations of your work? [Yes] We see three potential limitations that we discuss in the paper. First, as stated in the broader impact section, our approach is clearly dependent on the sequence length distribution of the dataset. However, we looked into several other datasets beyond Wikipedia and observed even higher potential for acceleration. Second, we explain our focus on the IPU hardware with a static precompiled kernel in Section $\boxed { 4 . 1 }$ Our theoretical analysis in Section $\boxed { 4 . 3 }$ indicates that our approach benefits also other hardware. Third, our changes to the network with a modified attention mask and loss calculation come with some overhead. This is addressed in Table 1 [overhead column] in Section 4.1.
|
| 190 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] We address this point in the “Broader Impact” Section, third paragraph.
|
| 191 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 192 |
+
|
| 193 |
+
2. If you are including theoretical results...
|
| 194 |
+
|
| 195 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Detailed algorithm explanations, clarifications of assumptions, and proofs are provided in the supplemental material [1].
|
| 196 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] Section D.5, E, F in the supplemental material [1] provide the necessary derivations on theoretical results.
|
| 197 |
+
|
| 198 |
+
3. If you ran experiments...
|
| 199 |
+
|
| 200 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [N/A] To ensure results are easily reproducible, we follow the MLPerf 0.7 benchmark rules and implementation. Additionally the main packing code is provided in the supplemental material, along with histograms of the datasets, which can be used to confirm the efficiency of the packing algorithms. We are solely relying on open source datasets. The full code related to the changes to BERT will be provided with a future software release, currently anticipated in July. Simplified reference code is provided directly in the paper.
|
| 201 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] We follow the MLPerf 0.7 benchmark rules. We document the parameters that we changed and why we change them.
|
| 202 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] The packing algorithms are deterministic and have no error. Other experiments are only once to compare convergence curves.
|
| 203 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We used 16 Graphcore IPUs for acceleration on an internal cluster.
|
| 204 |
+
|
| 205 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 206 |
+
|
| 207 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] Appropriate references to the BERT authors, all datasets, and the code snippet from the HugginFace inc. are appropriately referenced with citations and links.
|
| 208 |
+
(b) Did you mention the license of the assets? [Yes] For the only taken code snippet, the license is part of the file [Listing 6 in the appendix].
|
| 209 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] New materials like packing code and histograms will be provided under an MIT license and are already listed and linked at the end of the supplemental material.
|
| 210 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] We did not curate other people’s data. We only provide a very high level aggregate of the used data.
|
| 211 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We did not curate other people’s data.
|
| 212 |
+
|
| 213 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 214 |
+
|
| 215 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] Our experiments did not include crowdsourcing or human subjects.
|
| 216 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] Our experiments did not include crowdsourcing or human subjects.
|
| 217 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] Our experiments did not include crowdsourcing or human subjects.
|
md/train/6tM849_6RF9/6tM849_6RF9.md
ADDED
|
@@ -0,0 +1,361 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Believe What You See: Implicit Constraint Approach for Offline Multi-Agent Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Yiqin Yang1†, Xiaoteng $\mathbf { M } \mathbf { a } ^ { 1 }$ †‡, Chenghao $\mathbf { L i } ^ { 1 }$ , Zewu Zheng1, Qiyuan Zhang2, Gao Huang1, Jun $\mathbf { Y a n g ^ { 1 } } \mathbf { \dot { z } }$ ‡, Qianchuan Zhao1 1Tsinghua University, 2Harbin Institute of Technology
|
| 4 |
+
{yangyiqi19, ma-xt17, lich18} $@$ mails.tsinghua.edu.cn, zzheng $1 7 @ 1 2 6 . \mathrm { c o m }$ ,
|
| 5 |
+
zhangqiyuan19@hit.edu.cn, {gaohuang, yangjun603, zhaoqc} $@$ tsinghua.edu.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Learning from datasets without interaction with environments (Offline Learning) is an essential step to apply Reinforcement Learning (RL) algorithms in real-world scenarios. However, compared with the single-agent counterpart, offline multiagent RL introduces more agents with the larger state and action space, which is more challenging but attracts little attention. We demonstrate current offline RL algorithms are ineffective in multi-agent systems due to the accumulated extrapolation error. In this paper, we propose a novel offline RL algorithm, named Implicit Constraint $Q$ -learning (ICQ), which effectively alleviates the extrapolation error by only trusting the state-action pairs given in the dataset for value estimation. Moreover, we extend ICQ to multi-agent tasks by decomposing the joint-policy under the implicit constraint. Experimental results demonstrate that the extrapolation error is successfully controlled within a reasonable range and insensitive to the number of agents. We further show that ICQ achieves the state-of-the-art performance in the challenging multi-agent offline tasks (StarCraft II). Our code is public online at https://github.com/YiqinYang/ICQ.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Recently, reinforcement learning (RL), an active learning process, has achieved massive success in various domains ranging from strategy games [59] to recommendation systems [8]. However, applying RL to real-world scenarios poses practical challenges: interaction with the real world, such as autonomous driving, is usually expensive or risky. To solve these issues, offline RL is an excellent choice to deal with practical problems [3, 24, 35, 42, 15, 28, 4, 23, 54, 12], aiming at learning from a fixed dataset without interaction with environments.
|
| 14 |
+
|
| 15 |
+
The greatest obstacle of offline RL is the distribution shift issue [16], which leads to extrapolation error, a phenomenon in which unseen state-action pairs are erroneously estimated. Unlike the online setting, the inaccurate estimated values of unseen pairs cannot be corrected by interacting with the environment. Therefore, most off-policy RL algorithms fail in the offline tasks due to intractable overgeneralization. Modern offline methods (e.g., Batch-Constrained deep Q-learning (BCQ) [16]) aim to enforce the learned policy to be close to the behavior policy or suppress the $Q$ -value directly. These methods have achieved massive success in challenging single-agent offline tasks like D4RL [14].
|
| 16 |
+
|
| 17 |
+
However, many decision processes in real-world scenarios belong to multi-agent systems, such as intelligent transportation systems [2], sensor networks [37], and power grids [7]. Compared with the single-agent counterpart, the multi-agent system has a much larger action space, which grows exponentially with the increasing of the agent number. When coming into the offline scenario, the unseen state-action pairs will grow exponentially as the number of agents increases, accumulating the extrapolation error quickly. The current offline algorithms are unsuccessful in multi-agent tasks even though they adopt the modern value-decomposition structure [26, 48, 25]. As shown in Figure 2, our results indicate that BCQ, a state-of-the-art offline algorithm, has divergent $Q$ -estimates in a simple multi-agent MDP environment (e.g., BCQ (4 agents)). The extrapolation error for value estimation is accumulated quickly as the number of agents increases, significantly impairing the performance.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: The comparison between ICQ and BCQ for the target $Q$ -value estimation. The spots denote states, and the connections between spots indicate actions. The red solid-lines denote seen pairs, and the gray dotted-lines are unseen pairs. (a) BCQ estimates $Q$ -value in a defined similar action set (orange) while unseen pairs still exist in the set with low probability. (b) ICQ only adopts seen pairs (orange) in the training set for $Q$ -value estimation.
|
| 21 |
+
|
| 22 |
+
Based on these analyses, we propose the Implicit Constraint Q-learning (ICQ) algorithm, which effectively alleviates the extrapolation error as no unseen pairs are involved in estimating $Q$ -value. Motivated by an implicit constraint optimization problem, ICQ adopts a SARSA-like approach [49] to evaluate $Q$ -values and then converts the policy learning into a supervised regression problem. By decomposing the joint-policy under the implicit constraint, we extend ICQ to the multi-agent tasks successfully. To the best of our knowledge, our work is the first study analyzing and addressing the extrapolation error in multi-agent reinforcement learning.
|
| 23 |
+
|
| 24 |
+
We evaluate our algorithm on the challenging multi-agent offline tasks based on StarCraft II [40], where a large number of agents cooperatively complete a task. Experimental results show that ICQ can control the extrapolation error within a reasonable range under any number of agents and learn from complex multi-agent datasets. Further, we evaluate the single-agent version of ICQ in D4RL, a standard single-agent offline benchmark. The results demonstrate the generality of ICQ for a wide range of task scenarios, from single-agent to multi-agent, from discrete to continuous control.
|
| 25 |
+
|
| 26 |
+
# 2 Background
|
| 27 |
+
|
| 28 |
+
Notation. The fully cooperative multi-agent tasks are usually modeled as the Dec-POMDP [31] consisting of the tuple $G \overset { \cdot } { = } \langle S , A , P , r , \Omega , \overset { \cdot } { O } , n , \gamma \rangle$ . Let $s \in S$ denote the true state of the environment. At each time step $t \in \mathbb { Z } ^ { + }$ , each agent $i \in N \equiv \left\{ 1 , \ldots , n \right\}$ chooses an action $a ^ { i } \in A$ , forming a joint action $\pmb { a } \in \mathbf { A } \equiv A ^ { n }$ . Let $P ( s ^ { \prime } \mid s , \pmb { a } ) : S \times \mathbf { A } \times S [ 0 , 1 ]$ denote the state transition function. All agents share the same reward function $r ( s , \pmb { a } ) : S \times \mathbf { A } \mathbb { R }$ .
|
| 29 |
+
|
| 30 |
+
We consider a partially observable scenario in which each agent draws individual observations $o ^ { i } \in \Omega$ according to the observation function $O ( s , a ) : \bar { S ^ { } } \times { \bf A } \Omega$ . Each agent has an action-observation history ${ \boldsymbol { \tau } } ^ { i } \in \mathbf { T } \equiv ( \Omega \times \mathbf { A } ) ^ { t }$ , on which it conditions a stochastic policy $\pi ^ { i } ( a ^ { i } \mid \tau ^ { i } )$ parameterized by $\theta _ { i } : \mathbf { T } \times \mathbf { A } [ 0 , 1 ]$ ]. The joint action-value function is defined as et $\begin{array} { r } { Q ^ { \pi } ( \tau , \boldsymbol { a } ) \triangleq \mathbb { E } _ { s _ { 0 : \infty } , \boldsymbol { a } _ { 0 : \infty } } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \mid s _ { 0 } = s , \boldsymbol { a } _ { 0 } = \boldsymbol { a } , \pi \right] } \end{array}$ , where ich con $\pi$ is the joint-policy with param-ns trajectories of the behavior $\theta = \langle \theta _ { 1 } , \ldots , \theta _ { n } \rangle$ $\boldsymbol { B }$
|
| 31 |
+
policy $\pmb { \mu }$ .
|
| 32 |
+
|
| 33 |
+
We adopt the centralized training and decentralized execution (CTDE) paradigm [43]. During training, the algorithm has access to the true state $s$ and every agent’s action-observation history $\tau _ { i }$ as well as the freedom to share all information between agents. However, during execution, each agent has access only to its action-observation history.
|
| 34 |
+
|
| 35 |
+
Batch-constrained deep Q-learning (BCQ) is a state-of-the-art offline RL method, which aims to avoid selecting an unfamiliar action at the next state during a value update. Specifically, BCQ optimizes $\pi$ by introducing perturbation model $\xi ( \tau , a , \Phi )$ and generative model $G \bar { ( } \tau ; \varphi )$ as follows
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\pi ( \tau ) = \underset { a ^ { [ i ] } + \xi ( \tau , a ^ { [ i ] } , \Phi ) } { \mathrm { a r g } \mathrm { m a x } } Q ^ { \pi } ( \tau , a ^ { [ i ] } + \xi ( \tau , a ^ { [ i ] } , \Phi ) ; \phi ) , \mathrm { s . t . } \{ a ^ { [ i ] } \sim G ( \tau ; \varphi ) \} _ { i = 1 } ^ { m } ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\pi$ selects the highest valued action from a collection of $m$ actions sampled from the generative model $G ( \tau ; \varphi )$ , which aims to produce only previously seen actions. The perturbation model $\xi ( \tau , a ^ { [ i ] } , \Phi )$ is adopted to adjust action $a ^ { [ i ] }$ in the range $[ - \Phi , \Phi ]$ to increase the diversity of actions.
|
| 42 |
+
|
| 43 |
+
# 3 Analysis of Accumulated Extrapolation Error in Multi-Agent RL
|
| 44 |
+
|
| 45 |
+
In this section, we theoretically analyze the extrapolation error propagation in offline RL, which lays the basis for Section 4. The extrapolation error mainly attributes the out-of-distribution (OOD) actions in the evaluation of $Q ^ { \pi }$ [16, 21]. To quantify the effect of OOD actions, we define the state-action pairs within the dataset as seen pairs. Otherwise, we name them as unseen pairs. We demonstrate that the extrapolation error propagation from the unseen pairs to the seen pairs is related to the size of the action space, which grows exponentially with the increasing number of agents. We further design a toy example to illustrate the inefficiency of current offline methods in multi-agent tasks.
|
| 46 |
+
|
| 47 |
+
# 3.1 Extrapolation Error Propagation in Offline RL
|
| 48 |
+
|
| 49 |
+
Following the analysis in BCQ [16], we define the tabular estimation error\* as $\epsilon _ { \mathrm { M D P } } ( \tau , a ) \ \triangleq$ $Q _ { M } ^ { \pi } ( \tau , a ) \bar { ~ } - Q _ { B } ^ { \pi } ( \tau , a )$ (here we abuse $\tau$ to denote the state for analytical clarity), where the $M$ denotes the true MDP and $\boldsymbol { B }$ denotes a new MDP computed from the batch by $P _ { B } ( \tau ^ { \prime } \mid \tau , a ) =$ $\begin{array} { r } { \mathcal { N } ( \tau , a , \tau ^ { \prime } ) / \sum _ { \tilde { \tau } } \mathcal { N } ( \tau , a , \tilde { \tau } ) } \end{array}$ . BCQ [16] has shown that $\epsilon _ { \mathrm { M D P } } ( \tau , a )$ has a Bellman-like form with the extrapolation error $\boldsymbol { \epsilon } _ { \mathrm { E X T } } ( \tau , a )$ as the "reward function":
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { l } { { \epsilon _ { \mathrm { M D P } } ( \tau , a ) \triangleq \epsilon _ { \mathrm { E X T } } ( \tau , a ) + \displaystyle \sum _ { \tau ^ { \prime } } P _ { M } ( \tau ^ { \prime } \mid \tau , a ) \gamma \displaystyle \sum _ { a ^ { \prime } } \pi ( a ^ { \prime } \mid s ^ { \prime } ) \epsilon _ { \mathrm { M D P } } ( \tau ^ { \prime } , a ^ { \prime } ) , } } \\ { { \epsilon _ { \mathrm { E X P } } ( \tau , a ) = \displaystyle \sum _ { \tau ^ { \prime } } \left( P _ { M } ( \tau ^ { \prime } \mid \tau , a ) - P _ { B } ( \tau ^ { \prime } \mid \tau , a ) \right) \left( r ( \tau , a , \tau ^ { \prime } ) + \gamma \displaystyle \sum _ { a ^ { \prime } } \pi ( a ^ { \prime } \mid \tau ^ { \prime } ) Q _ { B } ^ { \pi } ( \tau ^ { \prime } , a ^ { \prime } ) \right) . } } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
For the seen state-action pairs, $\epsilon _ { \mathrm { E X T } } ( \tau , a ) = 0$ since $P _ { M } ( \tau ^ { \prime } \mid \tau , a ) - P _ { B } ( \tau ^ { \prime } \mid \tau , a ) = 0$ in the deterministic environment. In contrast, the $\boldsymbol { \epsilon } _ { \mathrm { E X T } } ( \tau , a )$ of unseen pairs is uncontrollable and depends entirely on the initial values in tabular setting or the network generalization in DRL.
|
| 56 |
+
|
| 57 |
+
To further analyze how the extrapolation error in the unseen pairs impacts the estimation of actions in the dataset, we partition $\mathbf { \epsilon \epsilon _ { \mathbf { M D P } } }$ and EXT as $\epsilon _ { \mathrm { M D P } } = [ \epsilon _ { \mathrm { s } } , \epsilon _ { \mathrm { u } } ] ^ { \mathbf { T } }$ and $\epsilon _ { \mathbf { E X T } } = [ \mathbf { 0 } , \epsilon _ { \mathbf { b } } ] ^ { \mathrm { T } }$ respectively according to seen and unseen state-action pairs. Let denote the transition matrix of the state-action pairs as $\bar { P } _ { M } ^ { \pi } ( \tau ^ { \prime } , a ^ { \prime } \mid \tau , a ) = P _ { M } ( \tau ^ { \prime } \mid \tau , a ) \pi ( a ^ { \prime } \mid \tau ^ { \prime } )$ . We decompose the transition matrix as $P _ { M } ^ { \pi } = \left[ P _ { \mathrm { s , s } } ^ { \pi } , P _ { \mathrm { s , u } } ^ { \pi } ; P _ { \mathrm { u , s } } ^ { \pi } , P _ { \mathrm { u , u } } ^ { \pi } \right]$ according to state-action pairs’ property (e.g., $P _ { \mathrm { s , u } } ^ { \pi } ( \tau _ { \mathrm { u } } ^ { \prime } , a _ { \mathrm { u } } ^ { \prime } \mid \tau _ { \mathrm { s } } , a _ { \mathrm { s } } ) =$ $P _ { M } ( \tau _ { \mathrm { u } } ^ { \prime } \mid \tau _ { \mathrm { s } } , a _ { \mathrm { s } } ) \pi ( a _ { \mathrm { u } } ^ { \prime } \mid \tau _ { \mathrm { u } } ^ { \prime } )$ denotes the transition probability from seen to unseen pairs). Then the extrapolation error propagation can be described by the following linear system:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\left[ \epsilon _ { \mathrm { s } } \right] = \gamma \left[ P _ { \mathrm { s , s } } ^ { \pi } \quad P _ { \mathrm { s , u } } ^ { \pi } \right] \left[ \epsilon _ { \mathrm { s } } \right] + \left[ \mathbf { 0 } _ { \mathbf { \tau } } \right] .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Based on the above definitions, we have the following conclusion.
|
| 64 |
+
|
| 65 |
+
Theorem 1. Given a deterministic MDP, the propagation of $\mathbf { \epsilon _ { \mathbf { b } } }$ to $\epsilon _ { \mathrm { s } }$ is proportional to $\| P _ { \mathrm { s , u } } ^ { \pi } \| _ { \infty }$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\left\| \epsilon _ { \mathbf { s } } \right\| _ { \infty } \leq \frac { \gamma \left\| P _ { \mathbf { s } , \mathbf { u } } ^ { \pi } \right\| _ { \infty } } { ( 1 - \gamma ) \left( 1 - \gamma \left\| P _ { \mathbf { s } , \mathbf { s } } ^ { \pi } \right\| _ { \infty } \right) } \left\| \epsilon _ { \mathbf { b } } \right\| _ { \infty } .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 2: (a) An MMDP where $Q$ -estimates of BCQ will diverge as the number of agents increases. (b) The learning curve of the joint action-value function while running several agents in the given MMDP. The true values are similar in this task with different agent numbers, calculated by averaging the Monte-Carlo estimation under different agents. The $Q$ -estimates of BCQ (4 agents) diverge while our algorithm (ICQ) has accurate $Q$ -estimates. Please refer to Appendix C.2 for the complete results.
|
| 73 |
+
|
| 74 |
+
The above theorem indicates the effect of extrapolation error on seen state-action pairs is directly proportional to $\| \mathcal { P } _ { \mathrm { s , u } } ^ { \pi } \| _ { \infty }$ . In the practice, $\| P _ { \mathrm { s , u } } ^ { \pi } \| _ { \infty }$ is related to the size of action space and the dataset. If the action space is enormous, such as a multi-agent task with a number of agents, we need a larger amount of data to reduce $\| \mathcal { P } _ { \mathrm { s , u } } ^ { \pi } \| _ { \infty }$ . However, the dataset size in offline learning tasks is generally limited. Moreover, when using the networks to approximate the value function, $\mathbf { \epsilon _ { \mathbf { b } } }$ does not remain constant as for the seen $Q _ { B } \big ( \tau _ { \mathrm { u } } , a _ { \mathrm { u } } \big )$ could be arbitrary during training,hese reasons, we have to enforce the $P _ { \mathrm { s , u } } ^ { \pi } 0$ he b $Q$ -values extreme large evenvoiding using OOD actions. For example, BCQ utilizes an auxiliary generative model to constrain the target actions within a familiar action set (see Section 2 for a detailed description). However, the error propagation heavily depends on the accuracy of the generative model and is intolerable with the agent number increasing. We will demonstrate this effect in the following toy example.
|
| 75 |
+
|
| 76 |
+
# 3.2 Toy Example
|
| 77 |
+
|
| 78 |
+
We design a toy two states Multi-Agent Markov Decision Process (MMDP) to illustrate the accumulated extrapolation error in multi-agent tasks (see Figure 2a). All agents start at state $\tau _ { 2 }$ and explore rewards for 100 environment steps by taking actions $a _ { [ 1 ] } = 0$ or $a _ { [ 2 ] } = 1$ . The optimal policy is that all agents select $a _ { [ 1 ] }$ . The MMDP task has sparse rewards. The reward is 1 when following the optimal policy, otherwise, the reward is 0. The state $\tau _ { 2 }$ will transfer to $\tau _ { 1 }$ if the joint policy satisfies $\textstyle { \bar { \sum _ { i = 1 } ^ { n } a _ { i } } } \leq { \frac { n } { 2 } }$ at $\tau _ { 2 }$ , while the state $\tau _ { 1 }$ will never return to $\tau _ { 2 }$ .
|
| 79 |
+
|
| 80 |
+
We run BCQ and our method ICQ on a limited dataset, which only contain 32 trajectories generated by QMIX. Obviously, the number of unseen state-action pairs exponentially grows as the number of agents increases. We control the amount of valuable trajectories $\mathit { r } = 1 \mathit { \Theta }$ ) in different datasets equal for fair comparisons. The multi-agent version of BCQ shares the same value-decomposition structure as ICQ (see Appendix D.2).
|
| 81 |
+
|
| 82 |
+
As shown in Figure 2b, the joint action-value function learned by BCQ gradually diverges as the number of agents increases while ICQ maintains a reasonable $Q$ -value. The experimental result is consistent with Theorem 1, and we provide an additional analysis for the toy example in Appendix B.2. In summary, we show theoretically and empirically that the extrapolation error is accumulated quickly as the number of agents increases and makes the $Q$ -estimates easier to diverge.
|
| 83 |
+
|
| 84 |
+
# 4 Implicit Constraint Approach for Offline Multi-Agent RL
|
| 85 |
+
|
| 86 |
+
In this section, we give an effective method to solve the accumulated extrapolation error in offline Multi-Agent RL based on the analysis of Section 3. From the implementation perspective, we find that a practical approach towards offline RL is to estimate target $Q$ -value without sampled actions from the policy in training. We propose Implicit Constraint Q-learning (ICQ), which only trusts the seen state-action pairs in datasets for value estimation. Further, we extend ICQ to multi-agent tasks with a value decomposition framework and utilize a $\lambda$ -return method to balance the variance and bias.
|
| 87 |
+
|
| 88 |
+
# 4.1 The Implicit Constraint Q-learning (ICQ) Approach
|
| 89 |
+
|
| 90 |
+
Based on the analysis of Section 3, we find that the extrapolation error can be effectively alleviated by enforcing the actions within the dataset when calculating the target values, which is the most significant difference between offline and off-policy RL. For a formal comparison of off-policy and offline algorithms, we first introduce the standard Bellman operator $\mathcal { T } ^ { \pi }$ as follows:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
( { \cal T } ^ { \pi } Q ) ( \tau , a ) \triangleq Q ( \tau , a ) + \mathbb { E } _ { \tau ^ { \prime } } [ r + \gamma \mathbb { E } _ { a ^ { \prime } \sim \pi } [ Q ( \tau ^ { \prime } , a ^ { \prime } ) ] - Q ( \tau , a ) ] .
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
Many off-policy evaluation methods, such as the Tree Backup [10] and Expected SARSA [41], are designed based on this operator. However, when coming into the offline setting, the standard Bellman operator suffers from the OOD issue as the actions sampled from current policy $\pi$ are adopted for target $Q$ -value estimation. A natural way to avoid the OOD issue is adopting the importance sampling measure [30]:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
( { T } ^ { \pi } Q ) ( \tau , a ) = Q ( \tau , a ) + { \mathbb { E } } _ { \tau ^ { \prime } } [ r + \gamma { \mathbb { E } } _ { a ^ { \prime } \sim \mu } [ \rho ( \tau ^ { \prime } , a ^ { \prime } ) Q ( \tau ^ { \prime } , a ^ { \prime } ) ] - Q ( \tau , a ) ] ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where ρ(τ 0, a0) , π(a0|τ 0)µ(a0|τ 0) denotes the importance sampling weight. If we can calculate $\rho ( \tau ^ { \prime } , a ^ { \prime } )$ with action $a ^ { \prime }$ sampled from $\mu$ rather than $\pi$ , the unseen pairs will be avoided for target $Q$ -value estimation. In this case, the extrapolation error is theoretically avoided since $P _ { \mathrm { s , u } } ^ { \pi } 0$ . The estimated $Q$ -value based on the above operation would be stable even in complex tasks with enormous action space. However, in most real-world scenarios, it is hard to obtain the exact behavior policy to calculate $\rho ( \tau ^ { \prime } , a ^ { \prime } )$ , e.g., using expert demonstrations. Fortunately, we find that the solution of following implicit constraint optimization problem is efficient to compute the desired importance sampling weight.
|
| 103 |
+
|
| 104 |
+
# 4.1.1 Implicit Constraint Q-learning
|
| 105 |
+
|
| 106 |
+
In offline tasks, the policies similar to the behavior policy are preferred while maximizing the accumulated reward $Q ^ { \pi } ( \tau , a )$ , i.e., $D _ { \mathrm { K L } } ( \pi \parallel \mu ) [ \tau ] \le \dot { \epsilon }$ . The policy optimization with the behavior regularized constraint can be described in the following problem:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\pi _ { k + 1 } = \arg \operatorname* { m a x } _ { \pi } \mathbb { E } _ { a \sim \pi ( \cdot \vert \tau ) } [ Q ^ { \pi _ { k } } ( \tau , a ) ] , \quad \mathrm { s . t . } \quad D _ { \mathrm { K L } } ( \pi \mid \mu ) [ \tau ] \leq \epsilon .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
This problem has well studied in many previous works [36, 1, 58]. Note that the objective is a linear function of the decision variables $\pi$ and all constraints are convex functions. Thus we can obtain the optimal policy $\pi ^ { * }$ related to $\mu$ through the KKT condition [9], for which the proof is in Appendix B.4:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\pi _ { k + 1 } ^ { * } ( a \mid \tau ) = \frac { 1 } { Z ( \tau ) } \mu ( a \mid \tau ) \exp \left( \frac { Q ^ { \pi _ { k } } ( \tau , a ) } { \alpha } \right) ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\alpha > 0$ is the Lagrangian coefficient and $\begin{array} { r } { Z ( \tau ) \ = \ \sum _ { \tilde { a } } \mu ( \tilde { a } \ | \ \tau ) \exp { \left( \frac { 1 } { \alpha } Q ^ { \pi _ { k } } ( \tau , \tilde { a } ) \right) } } \end{array}$ is the normalizing partition function. Next, we calculate the ratio between $\pi$ and $\mu$ by relocating $\mu$ to the left-hand side:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\rho ( \tau , a ) = \frac { \pi _ { k + 1 } ^ { * } ( a \mid \tau ) } { \mu ( a \mid \tau ) } = \frac { 1 } { Z ( \tau ) } \exp \left( \frac { Q ^ { \pi _ { k } } ( \tau , a ) } { \alpha } \right) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Motivated on Equation 9, we define the Implicit Constraint Q-learning operator as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\mathcal { T } _ { \mathrm { I C Q } } Q ( \tau , a ) = r + \gamma \mathbb { E } _ { a ^ { \prime } \sim \mu } \left[ \frac { 1 } { Z ( \tau ^ { \prime } ) } \exp \left( \frac { Q \left( \tau ^ { \prime } , a ^ { \prime } \right) } { \alpha } \right) Q \left( \tau ^ { \prime } , a ^ { \prime } \right) \right] .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
Thus we obtain a SARAR-like algorithm which not uses any unseen pairs.
|
| 131 |
+
|
| 132 |
+
Comparison with previous methods. While BCQ learns an action generator to filter unseen pairs in $Q$ -value estimation, it cannot work in enormous action space due to the error of the generator (see Figure 1). Instead, in the value update of ICQ, we do not use the sampled actions to compute the target values, thus we alleviate extrapolation error effectively. There are some previous works, such as AWAC [29] and AWR [35], addressing the offline problem with similar constrained problem in Equation 7. However, these methods only impose the constraint on the policy loss and adopt the standard Bellman operator to evaluate $Q$ -function, which involves the unseen actions or converges to the value of behavior policy $\mu$ . Differently, we re-weight the target $Q ( \tau ^ { \prime } , a ^ { \prime } )$ with the importance sampling weight derived from the optimization problem, which makes the estimated value closer to the optimal value function.
|
| 133 |
+
|
| 134 |
+
# 4.1.2 Theoretical Analysis
|
| 135 |
+
|
| 136 |
+
The ICQ operator in Equation 10 results in a SARSA-like algorithm, which be re-written as:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
{ \mathcal T } _ { \mathrm { I C Q } } Q ( \tau , a ) = r + \gamma \sum _ { a ^ { \prime } \in \mathcal { B } } \left[ \frac { 1 } { Z ( \tau ^ { \prime } ) } \mu ( a ^ { \prime } \mid \tau ^ { \prime } ) \exp \left( \frac { 1 } { \alpha } Q \left( \tau ^ { \prime } , a ^ { \prime } \right) \right) Q \left( \tau ^ { \prime } , a ^ { \prime } \right) \right] .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
This update rule can be viewed as a regularized softmax operator [46, 34] in the offline setting. When $\alpha \to \infty$ , $\mathcal { T } _ { \mathrm { I C Q } }$ approaches $\mathcal { T } ^ { \mu }$ . When $\alpha 0$ , $\mathcal { T } _ { \mathrm { I C Q } }$ becomes the batch-constrained Bellman optimal operator $\tau _ { \mathrm { B C Q } }$ [16], which constrains the possible actions with respect to the batch:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathcal { T } _ { \mathrm { B C Q } } Q ( \tau , a ) = r + \gamma \operatorname* { m a x } _ { a ^ { \prime } \in \mathcal { B } } Q ( \tau ^ { \prime } , a ^ { \prime } ) .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$\tau _ { \mathrm { B C Q } }$ has been shown to converge to the optimal action-value function $Q ^ { * }$ of the batch, which means $\begin{array} { r } { \operatorname* { l i m } _ { k \to \infty } \mathcal { T } _ { \mathrm { B C Q } } ^ { k } Q _ { 0 } = Q ^ { * } } \end{array}$ for arbitrary $Q _ { 0 }$ . Based on this result, we show that iteratively applying $\mathcal { T } _ { \mathrm { I C Q } }$ will result in a $Q$ -function not far away from $Q ^ { * }$ :
|
| 149 |
+
|
| 150 |
+
Theorem 2. Let ${ \mathcal { T } } _ { \mathrm { I C Q } } ^ { k } Q _ { 0 }$ denote that the operator $\mathcal { T } _ { \mathrm { I C Q } }$ are iteratively applied over an initial stateaction value function $Q _ { 0 }$ for $k$ times. Then, we have $\forall ( \tau , a )$ , $\begin{array} { r } { \operatorname* { l i m } \operatorname* { s u p } _ { k \to \infty } \mathcal { T } _ { \mathrm { I C Q } } ^ { k } Q _ { 0 } ( \tau , a ) \leq Q ^ { * } ( \tau , a ) , } \end{array}$
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\operatorname* { l i m i n f } _ { k \to \infty } \ : T _ { \mathrm { I C Q } } ^ { k } Q _ { 0 } ( \tau , a ) \geq Q ^ { * } ( \tau , a ) - \frac { \gamma ( | A | - 1 ) } { ( 1 - \gamma ) } \operatorname* { m a x } \left\{ \frac { 1 } { ( \frac { 1 } { \alpha } + 1 ) C + 1 } , \frac { 2 Q _ { \operatorname* { m a x } } } { 1 + C \exp ( \frac { 1 } { \alpha } ) } \right\} ,
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
where |A| is the action space, |Aτ | is the action space for state τ , C , inf τ ∈S inf 2≤i≤|Aτ | µ(a[1] |τ )µ(a[i]|τ ) and $\mu ( a _ { [ 1 ] } \mid \tau )$ denotes the probability of choosing the expert action according to behavioral policy $\mu$ . Moreover, the upper bound of $\mathcal { T } _ { \mathrm { B C Q } } ^ { k } Q _ { 0 } - \mathcal { T } _ { \mathrm { I C Q } } ^ { k } Q _ { 0 }$ decays exponentially fast in terms of $\alpha$ .
|
| 157 |
+
|
| 158 |
+
While $\mathcal { T } _ { \mathrm { I C Q } }$ is not a contraction [5] (similar with the softmax operator), the $Q$ -values are still within a reasonable range. Further, $\mathcal { T } _ { \mathrm { I C Q } }$ converges to $\tau _ { \mathrm { B C Q } }$ with an exponential rate in terms of $\alpha$ . Our result also quantifies the difficulty in offline RL problems. Based on the definition of $\mu ( a _ { [ i ] } | \tau )$ , $C$ shows the proportion of the expert experience in the dataset. A larger $C$ corresponds to more expert experience, which induces a smaller distance between $\mathcal { T } _ { \mathrm { I C Q } } ^ { k } Q _ { 0 } ( \tau , \mathbf { \bar { a } } )$ and $Q ^ { * } ( \tau , a )$ . In contrast, with a small $C$ , the expert experience is few and the conservatism in learning is necessary.
|
| 159 |
+
|
| 160 |
+
# 4.1.3 Algorithm
|
| 161 |
+
|
| 162 |
+
Based on the derived operator $\mathcal { T } _ { \mathrm { I C Q } }$ in Equation 9, we can learn $Q ( \tau , a ; \phi )$ by minimizing
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\mathcal { I } _ { Q } ( \phi ) = \mathbb { E } _ { \tau , a , \tau ^ { \prime } , a ^ { \prime } \sim B } \left[ r + \gamma \frac { 1 } { Z ( \tau ^ { \prime } ) } \exp \left( \frac { Q \left( \tau ^ { \prime } , a ^ { \prime } ; \phi ^ { \prime } \right) } { \alpha } \right) Q \left( \tau ^ { \prime } , a ^ { \prime } ; \phi ^ { \prime } \right) - Q \left( \tau , a ; \phi \right) \right] ^ { 2 } ,
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where the $Q$ -network and the target $Q$ -network are parameterized by $\phi$ and $\phi ^ { \prime }$ respectively.
|
| 169 |
+
|
| 170 |
+
As for the policy training, we project the non-parametric optimal policy $\pi _ { k + 1 } ^ { * }$ in Equation 8 into the parameterized policy space $\theta$ by minimizing the following KL distance, which is implemented on the data distribution of the batch:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\begin{array} { r l } & { \mathcal { I } _ { \pi } ( \theta ) = \mathbb { E } _ { \tau \sim \mathcal { B } } \left[ D _ { \mathrm { K L } } \left( \pi _ { k + 1 } ^ { * } \| \pi _ { \theta } \right) [ \tau ] \right] = \mathbb { E } _ { \tau \sim \mathcal { B } } \left[ - \displaystyle \sum _ { a } \pi _ { k + 1 } ^ { * } ( a \mid \tau ) \log \frac { \pi _ { \theta } ( a \mid \tau ) } { \pi _ { k + 1 } ^ { * } ( a \mid \tau ) } \right] } \\ & { \quad \stackrel { ( a ) } { = } \mathbb { E } _ { \tau \sim \mathcal { B } } \left[ \displaystyle \sum _ { a } \frac { \pi _ { k + 1 } ^ { * } ( a \mid \tau ) } { \mu ( a \mid \tau ) } \mu ( a \mid \tau ) \left( - \log \pi _ { \theta } ( a \mid \tau ) \right) \right] } \\ & { \quad \stackrel { ( b ) } { = } \mathbb { E } _ { \tau , a \sim \mathcal { B } } \left[ - \displaystyle \frac { 1 } { Z ( \tau ) } \log ( \pi ( a \mid \tau ; \theta ) ) \exp \left( \frac { Q ( \tau , a ) } { \alpha } \right) \right] , } \end{array}
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
where $( a )$ ignores $\begin{array} { r } { \mathbb { E } _ { \tau \sim B } \left[ \sum _ { a } \pi _ { k + 1 } ^ { * } ( a \mathbin { \left| \begin{array} { l } { \tau } \end{array} \right) } \log \pi _ { k + 1 } ^ { * } ( a \mathbin { \left| \begin{array} { l } { \tau } \end{array} \right) } \right] } \end{array}$ that is not related to $\theta$ , and $( b )$ applies the importance sampling weight derived in Equation 9 under forward $\mathrm { K L }$ constraint. Note that tuning the $\alpha$ parameter in Equation 15 between 0 and $\infty$ interpolates between $Q$ -learning and behavioral cloning. See Appendix A for the complete workflow of the ICQ algorithm. We provide two implementation options to compute the normalizing partition function $Z ( \tau )$ , which is discussed in detail in Appendix D.1.
|
| 177 |
+
|
| 178 |
+
# 4.2 Extending ICQ to Multi-Agent Tasks
|
| 179 |
+
|
| 180 |
+
In the previous section, we propose an implicit constraint $Q$ -learning framework by re-weighting target $Q$ -value $Q ( \tau ^ { \prime } , a ^ { \prime } )$ in the critic loss, which is efficient to alleviate the extrapolation error. We next extend ICQ to multi-agent tasks. For notational clarity, we name the Multi- Agent version of ICQ as ICQ-MA.
|
| 181 |
+
|
| 182 |
+
# 4.2.1 Decomposed Multi-Agent Joint-Policy under Implicit Constraint
|
| 183 |
+
|
| 184 |
+
Under the CTDE framework, we have to train individual policies for decentralized execution. Besides, it is also challenging to compute $\mathbb { E } _ { \pmb { \mu } } [ \rho ( \pmb { \tau } ^ { \prime } , \pmb { a } ^ { \prime } ) Q ^ { \pi } ( \pmb { \tau } ^ { \prime } , \pmb { a } ^ { \prime } ) ]$ in multi-agent policy evaluation as its computational complexity is ${ \cal O } ( | A | ^ { n } )$ . To address the above issues, we first define the joint-policy as $\pi ( \textbf { \em a } | \textbf { \em \tau } ) \triangleq \Pi _ { i \in N } \pi ^ { i } ( a ^ { i } \ | \textbf { \ } \tau ^ { i } )$ , and then introduce a mild value-decomposition assumption:
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
Q ^ { \pi } ( \tau , a ) = \sum _ { i } w ^ { i } ( \tau ) Q ^ { i } ( \tau ^ { i } , a ^ { i } ) + b ( \tau ) ,
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 3: Mixer Network.
|
| 192 |
+
|
| 193 |
+
where $w ^ { i } ( \tau ) \geq 0$ and $b ( \tau )$ are generated by the Mixer Network whose inputs are global observation-action history (see
|
| 194 |
+
|
| 195 |
+
Figure 3). Based on the above assumptions, we propose the decomposed multi-agent joint-policy under implicit constraint in the following theorem:
|
| 196 |
+
|
| 197 |
+
Theorem 3. Assuming the joint action-value function is linearly decomposed, we can decompose the multi-agent joint-policy under implicit constraint as follows
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\pi = \underset { \pi ^ { 1 } , \ldots , \pi ^ { n } } { \arg \operatorname* { m a x } } \sum _ { i } \mathbb { E } _ { \tau ^ { i } , a ^ { i } \sim \mathcal { B } } \left[ \frac { 1 } { Z ^ { i } ( \tau ^ { i } ) } \log ( \pi ^ { i } ( a ^ { i } \mid \tau ^ { i } ) ) \exp \left( \frac { w ^ { i } ( \tau ) Q ^ { i } ( \tau ^ { i } , a ^ { i } ) } { \alpha } \right) \right] ,
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
where $\begin{array} { r } { Z ^ { i } ( \tau ^ { i } ) = \sum _ { \tilde { a } ^ { i } } \mu ^ { i } ( \tilde { a } ^ { i } \mid \tau ^ { i } ) \exp \left( \frac { 1 } { \alpha } w ^ { i } ( \tau ) Q ^ { i } ( \tau ^ { i } , \tilde { a } ^ { i } ) \right) } \end{array}$ is the normalizing partition function.
|
| 204 |
+
|
| 205 |
+
The decomposed multi-agent joint-policy has a concise form. We can train individual policies $\pi ^ { i }$ by minimizing
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\mathcal { I } _ { \pi } ( \theta ) = \sum _ { i } \mathbb { E } _ { \tau ^ { i } , a ^ { i } \sim \mathcal { B } } \left[ - \frac { 1 } { Z ^ { i } ( \tau ^ { i } ) } \log ( \pi ^ { i } ( a ^ { i } \mid \tau ^ { i } ; \theta _ { i } ) ) \exp \left( \frac { w ^ { i } ( \tau ) Q ^ { i } ( \tau ^ { i } , a ^ { i } ) } { \alpha } \right) \right] .
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
Besides, $w ^ { i } ( \tau )$ achieves the trade-off between the roles of agents. If some agents have important roles, the value of corresponding $w ^ { i } ( \tau )$ is relatively large. Also, if $w ^ { i } ( \pmb { \tau } ) 0$ , $\pi ^ { i }$ is approximately considered as the behavior cloning policy. As for the policy evaluation, we train $Q ( \tau , a ; \phi , \psi )$ by minimizing
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
\mathcal { I } _ { Q } ( \phi , \psi ) = \mathbb { E } _ { B } \left[ \sum _ { t \geq 0 } ( \gamma \lambda ) ^ { t } \left( r _ { t } + \gamma \frac { 1 } { Z ( \tau _ { t + 1 } ) } \exp \left( \frac { Q ( \tau _ { t + 1 } , a _ { t + 1 } ) } { \alpha } \right) Q ( \tau _ { t + 1 } , a _ { t + 1 } ) - Q ( \tau _ { t } , a _ { t } ) \right) \right] ^ { 2 }
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
# 4.2.2 Multi-Agent Value Estimation with $\lambda$ -return
|
| 218 |
+
|
| 219 |
+
As the offline dataset contains complete behavior trajectories, it is natural to accelerate the convergence of ICQ with the $n$ -step method. Here we adopt $Q ( \lambda )$ [27] to improve the estimation of ICQ, which weights the future temporal difference signal with a decay sequence $\lambda ^ { t }$ . Further, the constraint in Equation 7 implicitly meets the convergence condition of $\bar { Q ( \lambda ) }$ . Therefore, we extend the ICQ operator in Equation 10 to $n$ -step estimation, which is similar to $\overset { \triangledown } { Q } ( \lambda )$ :
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
( \mathcal { T } _ { \mathrm { I C Q } } ^ { \lambda } Q ) ( \tau , a ) \triangleq Q ( \tau , a ) + \mathbb { E } _ { \mu } \left[ \sum _ { \mathfrak { t } \geq 0 } ( \gamma \lambda ) ^ { \mathfrak { t } } \left( r _ { t } + \gamma \rho ( \tau _ { t + 1 } , a _ { t + 1 } ) Q ( \tau _ { t + 1 } , a _ { t + 1 } ) - Q ( \tau _ { t } , a _ { t } ) \right) \right] ,
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
where $\begin{array} { r } { \rho ( \tau _ { t } , a _ { t } ) = \frac { 1 } { Z ( \tau _ { t } ) } \exp ( \frac { 1 } { \alpha } Q ( \tau _ { t } , a _ { t } ) ) } \end{array}$ and hyper-parameter $0 \leq \lambda \leq 1$ provides the balance between bias and variance.
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 4: Performance comparison in offline StarCraft II tasks.
|
| 229 |
+
|
| 230 |
+
Table 1: Performance of ICQ with five offline RL baselines on the single-agent offline tasks with the normalized score metric proposed by D4RL benchmark [14], averaged over three random seeds with standard deviation. Scores roughly range from 0 to 100, where 0 corresponds to a random policy performance and 100 indicates an expert. The results for BC, BCQ, CQL, AWR and BRAC-p are taken from [14, 22].
|
| 231 |
+
|
| 232 |
+
<table><tr><td>Dataset type</td><td>Environment</td><td>ICQ (ours)</td><td>BC</td><td>BCQ</td><td>CQL</td><td>AWR</td><td>BRAC-p</td></tr><tr><td>fixed</td><td>antmaze-umaze</td><td>85.0 ±2.7</td><td>65.0</td><td>78.9</td><td>74.0</td><td>56.0</td><td>50.0</td></tr><tr><td>play</td><td>antmaze-medium</td><td>80.0 ±1.3</td><td>0.0</td><td>0.0</td><td>61.2</td><td>0.0</td><td>0.0</td></tr><tr><td>play</td><td>antmaze-large</td><td>51.0 ± 4.8</td><td>0.0</td><td>6.7</td><td>15.8</td><td>0.0</td><td>0.0</td></tr><tr><td>diverse</td><td>antmaze-umaze</td><td>65.0±3.3</td><td>55.0</td><td>55.0</td><td>84.0</td><td>70.3</td><td>40.0</td></tr><tr><td>diverse</td><td>antmaze-medium</td><td>65.0 ± 3.9</td><td>0.0</td><td>0.0</td><td>53.7</td><td>0.0</td><td>0.0</td></tr><tr><td>diverse</td><td>antmaze-large</td><td>44.0 ±4.2</td><td>0.0</td><td>2.2</td><td>14.9</td><td>0.0</td><td>0.0</td></tr><tr><td>expert</td><td>adroit-door</td><td>103.9 ± 3.6</td><td>101.2</td><td>99.0</td><td>1</td><td>102.9</td><td>-0.3</td></tr><tr><td>expert</td><td>adroit-relocate</td><td>109.5 ± 11.1</td><td>101.3</td><td>41.6</td><td></td><td>91.5</td><td>-0.3</td></tr><tr><td>expert</td><td>adroit-pen</td><td>123.8 ± 22.1</td><td>85.1</td><td>114.9</td><td>=</td><td>111.0</td><td>-3.5</td></tr><tr><td>expert</td><td>adroit-hammer</td><td>128.3 ± 2.5</td><td>125.6</td><td>107.2</td><td>-</td><td>39.0</td><td>0.3</td></tr><tr><td>human</td><td>adroit-door</td><td>6.4±2.4</td><td>0.5</td><td>-0.0</td><td>9.1</td><td>0.4</td><td>-0.3</td></tr><tr><td>human</td><td>adroit-relocate</td><td>1.5 ± 0.7</td><td>-0.0</td><td>-0.1</td><td>0.35</td><td>-0.0</td><td>-0.3</td></tr><tr><td>human</td><td>adroit-pen</td><td>91.3 ± 10.3</td><td>34.4</td><td>68.9</td><td>55.8</td><td>12.3</td><td>8.1</td></tr><tr><td>human</td><td>adroit-hammer</td><td>2.0±0.9</td><td>1.5</td><td>0.5</td><td>2.1</td><td>1.2</td><td>0.3</td></tr><tr><td>medium</td><td>walker2d</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td> medium</td><td></td><td>71.8±10.7 55.6±5.7</td><td>66.6</td><td>53.1</td><td>79.2</td><td>17.4</td><td>77.5</td></tr><tr><td>medium</td><td>hopper</td><td></td><td>49.0</td><td>54.5</td><td>58.0</td><td>35.9</td><td>32.7</td></tr><tr><td></td><td>halfcheetah</td><td>42.5±1.3</td><td>36.1</td><td>40.7</td><td>44.4</td><td>37.4</td><td>43.8</td></tr><tr><td>med-expert</td><td>walker2d</td><td>98.9 ± 5.2</td><td>66.8</td><td>57.5</td><td>98.7</td><td>53.8</td><td>76.9</td></tr><tr><td>med-expert</td><td>hopper</td><td>109.0±13.6</td><td>111.9</td><td>110.9</td><td>111.0</td><td>27.1</td><td>1.9</td></tr><tr><td>med-expert</td><td>halfcheetah</td><td>110.3 ±1.1</td><td>35.8</td><td>64.7</td><td>104.8</td><td>52.7</td><td>44.2</td></tr></table>
|
| 233 |
+
|
| 234 |
+
# 5 Related Work
|
| 235 |
+
|
| 236 |
+
As ICQ-MA seems to be the first work addressing the accumulated extrapolation error issue in offline MARL, we briefly review the prior single-agent offline RL works here, which can be divided into three categories: dynamic programming, model-based, and safe policy improvement methods.
|
| 237 |
+
|
| 238 |
+
Dynamic Programming. Policy constraint methods in dynamic programming [20, 3, 58, 51, 17] are most closely related to our work. They attempt to enforce $\pi$ to be close to $\mu$ under KL-divergence, Wasserstein distance [53], or MMD [47], and then only use actions sampled from $\pi$ in dynamic programming. For example, BCQ [16] constrains the mismatch between the state-action visitation of the policy and the state-action pairs contained in the batch by using a state-conditioned generative model to produce only previously seen actions. AWR [35] and ABM [42] attempt to estimate the value function of the behavior policy via Monte-Carlo or $\mathrm { T D } ( \lambda )$ . Unlike these methods, our algorithm, ICQ, estimates the $Q$ -function of the current policy using actions sampled from $\mu$ , enabling much more efficient learning. Another series of methods [52, 32, 33] aim to estimate uncertainty to determine the trustworthiness of a $Q$ -value prediction. However, the high-fidelity requirements for uncertainty estimates limit the performance of algorithms.
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
Figure 5: Module ablation study on MMM map.
|
| 242 |
+
|
| 243 |
+
Model-based and Safe Policy Improvement. Model-based methods [18, 50, 13, 56, 19] attempt to learn the model from offline data, with minimal modification to the algorithm. Nevertheless, modeling MDPs with very high-dimensional image observations and long horizons is a major open problem, which leads to limited algorithm performance [24]. Besides, safe policy improvement methods [23, 44, 6, 11] require a separately estimated model to $\mu$ to deal with unseen actions. However, accurately estimating $\mu$ is especially hard if the data come from multiple sources [29].
|
| 244 |
+
|
| 245 |
+
# 6 Experiments
|
| 246 |
+
|
| 247 |
+
In this section, we evaluate ICQ-MA and ICQ on multi-agent (StarCraft II) and single-agent (D4RL) offline benchmarks and compare them with state-of-the-art methods. Then, we conduct ablation studies on ICQ-MA. We aim to better understand each component’s effect and further analyze the main driver for the performance improvement.
|
| 248 |
+
|
| 249 |
+
# 6.1 Multi-Agent Offline Tasks on StarCraft II
|
| 250 |
+
|
| 251 |
+
We first construct the multi-agent offline datasets based on ten maps in StarCraft II (see Table 2 in Appendix E). The datasets are made by collecting DOP [55] training data. All maps share the same reward function, and each map includes 3000 trajectories. We are interested in non-expert data or multi-source data. Therefore, we artificially divide behavior policies into three levels based on the average episode return (see Table 3 in Appendix E). Then, we evenly mix data of three levels.
|
| 252 |
+
|
| 253 |
+
We compare our method against QMIX [39], multi-agent version of BCQ (BCQ-MA), CQL (CQLMA), and behavior cloning (BC-MA). To maintain consistency, BCQ-MA, CQL-MA, and BC-MA share the same linear value decomposition structure with ICQ-MA. Details for baseline implementations are in Appendix D.2. Each algorithm runs with five seeds, where the performance is evaluated ten times every 50 episodes. Details for hyper-parameters are in Appendix E.1.
|
| 254 |
+
|
| 255 |
+
We investigate ICQ-MA’s performance compared to common baselines in different scenarios. Results in Figure 4 show that ICQ-MA significantly outperforms all baselines and achieves state-of-the-art performance in all maps. QMIX, BCQ-MA, and CQL-MA have poor performances due to the accumulated extrapolation error. Interestingly, since BC does not depend on the policy evaluation, it is not subject to extrapolation error. Thus BC-MA has a sound performance as StarCraft II is near deterministic. We implement BCQ and CQL according to their official code\*.
|
| 256 |
+
|
| 257 |
+
# 6.2 Single-Agent Offline Tasks on D4RL
|
| 258 |
+
|
| 259 |
+
To compare with current offline methods, we evaluate ICQ in the single offline tasks (e.g., D4RL), including gym domains, Adroit tasks [38] and AntMaze. Specifically, adroit tasks require controlling a 24-DoF robotic hand to imitate human behavior. AntMaze requires composing parts of sub-optimal trajectories to form more optimal policies for reaching goals on a MuJoco Ant robot. Experimental result in Table 1 shows that ICQ achieves the state-of-the-art performance in many tasks compared with the current offline methods.
|
| 260 |
+
|
| 261 |
+
# 6.3 Ablation Study
|
| 262 |
+
|
| 263 |
+
We conduct ablation studies of ICQ-MA in the MMM map of StarCraft II to study the effect of different modules, value estimation, important hyper-parameters, and data quality.
|
| 264 |
+
|
| 265 |
+
Module and Value Estimation Analysis. From Figure 5, we find that if we adopt other $Q$ -value estimation methods in implicit constraint policies (e.g., $Q ( \lambda )$ [27] or Tree Backup), the corresponding algorithms (ICQ-MA $( Q ( \lambda ) )$ or ICQ-MA (Tree Backup)) have poor performances and incorrect estimated values. Suppose we train ICQ-MA without decomposed implicit constraint module (e.g., ICQ-MA (w/o decom)). In that case, the algorithm’s performance is poor, although the estimated value is smaller than the true value, confirming the necessity of decomposed policy. Besides, the performance of one-step estimation (ICQ-MA (one step)) indicates $n$ -step estimation is not the critical factor for improving ICQ-MA, while one-step estimation will introduce more bias.
|
| 266 |
+
|
| 267 |
+
The Parameter $\alpha$ . The Lagrangian coefficient $\alpha$ of implicit constraint operator directly affects the intensity of constraint, which is a critical parameter for the performance. A smaller $\alpha$ leads to a relaxing constraint and tends to maximize reward. If $\alpha 0$ , ICQ-MA is simplified to $Q$ - learning [57] while $\alpha \to \infty$ results in that ICQ-MA is equivalent to behavior cloning. Indeed, there is an intermediate value that performs best that can best provide the trade-off as in Appendix C.4.
|
| 268 |
+
|
| 269 |
+
Data Quality. It is also worth studying the performance of ICQ-MA and BC-MA with varying data quality. Specifically, we make the datasets from behavior policies of different levels (e.g., Good, Medium, and Poor). As shown in Figure 9 in Appendix C.4, ICQ-MA is not sensitive to the data quality, while the performance of BC-MA drops drastically with the data quality deteriorates. Results confirm that ICQ-MA is robust to the data quality while BC-MA strongly relies on the data quality.
|
| 270 |
+
|
| 271 |
+
Computational Complexity. With the same training steps in SMAC, BCQ-MA consumes $70 \%$ time of ICQ-MA. Although ICQ-MA takes a little long time compared with BCQ-MA, it achieves excellent performance in benchmarks. The computing infrastructure for running experiments is a server with an AMD EPYC 7702 64-Core Processor CPU.
|
| 272 |
+
|
| 273 |
+
# 7 Conclusion
|
| 274 |
+
|
| 275 |
+
In this work, we demonstrate a critical problem in multi-agent off-policy reinforcement learning with finite data, where it introduces accumulated extrapolation error in the number of agents. We empirically show the current offline algorithms are ineffective in the multi-agent offline setting. Therefore, we propose the Implicit Constraint Q-learning (ICQ) method, which effectively alleviates extrapolation error by only trusting the state-action pairs in datasets. To the best of our knowledge, the multi-agent version of ICQ is the first multi-agent offline algorithm capable of learning from complex multi-agent datasets. Due to the importance of offline tasks and multi-agent systems, we sincerely hope our algorithms can be a solid foothold for applying RL to practical applications.
|
| 276 |
+
|
| 277 |
+
# Acknowledgments and Disclosure of Funding
|
| 278 |
+
|
| 279 |
+
This work was funded by the National Natural Science Foundation of China (ID:U1813216), National Key Research and Development Project of China under Grant 2017YFC0704100 and Grant 2016YFB0901900, in part by the National Natural Science Foundation of China under Grant 61425027, the 111 International Collaboration Program of China under Grant BP2018006, and BNRist Program (BNR2019TD01009) and the National Innovation Center of High Speed Train R&D project (CX/KJ-2020-0006).
|
| 280 |
+
|
| 281 |
+
We sincerely appreciate reviewers, whose valuable comments have benefited our paper significantly!
|
| 282 |
+
|
| 283 |
+
# References
|
| 284 |
+
|
| 285 |
+
[1] Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Remi Munos, Nicolas Heess, and Martin Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations, 2018.
|
| 286 |
+
[2] Jeffrey L Adler and Victor J Blue. A cooperative multi-agent transportation management and route guidance system. Transportation Research Part C: Emerging Technologies, 10(5-6):433– 454, 2002.
|
| 287 |
+
[3] Rishabh Agarwal, Dale Schuurmans, and Mohammad Norouzi. An optimistic perspective on offline reinforcement learning. In International Conference on Machine Learning, pages 104–114. PMLR, 2020.
|
| 288 |
+
[4] Anurag Ajay, Aviral Kumar, Pulkit Agrawal, Sergey Levine, and Ofir Nachum. OPAL: Offline primitive discovery for accelerating offline reinforcement learning. In International Conference on Learning Representations, 2020.
|
| 289 |
+
[5] Kavosh Asadi and Michael L Littman. An alternative softmax operator for reinforcement learning. In International Conference on Machine Learning, pages 243–252. PMLR, 2017.
|
| 290 |
+
[6] Felix Berkenkamp, Matteo Turchetta, Angela P Schoellig, and Andreas Krause. Safe modelbased reinforcement learning with stability guarantees. arXiv preprint arXiv:1705.08551, 2017.
|
| 291 |
+
[7] Duncan S Callaway and Ian A Hiskens. Achieving controllability of electric loads. Proceedings of the IEEE, 99(1):184–199, 2010.
|
| 292 |
+
[8] Yuanjiang Cao, Xiaocong Chen, Lina Yao, Xianzhi Wang, and Wei Emma Zhang. Adversarial attacks and detection on reinforcement learning-based interactive recommender systems. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 1669–1672, 2020.
|
| 293 |
+
[9] Axel Dreves, Francisco Facchinei, Christian Kanzow, and Simone Sagratella. On the solution of the KKT conditions of generalized nash equilibrium problems. SIAM Journal on Optimization, 21(3):1082–1108, 2011.
|
| 294 |
+
[10] Damien Ernst, Pierre Geurts, and Louis Wehenkel. Tree-based batch mode reinforcement learning. Journal of Machine Learning Research, 6:503–556, 2005.
|
| 295 |
+
[11] Benjamin Eysenbach, Shixiang Gu, Julian Ibarz, and Sergey Levine. Leave no trace: Learning to reset for safe and autonomous reinforcement learning. arXiv preprint arXiv:1711.06782, 2017.
|
| 296 |
+
[12] Rasool Fakoor, Pratik Chaudhari, and Alexander J Smola. P3O: Policy-on policy-off policy optimization. In Uncertainty in Artificial Intelligence, pages 1017–1027. PMLR, 2020.
|
| 297 |
+
[13] Mehrdad Farajtabar, Yinlam Chow, and Mohammad Ghavamzadeh. More robust doubly robust off-policy evaluation. In International Conference on Machine Learning, pages 1447–1456. PMLR, 2018.
|
| 298 |
+
[14] Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4RL: Datasets for deep data-driven reinforcement learning. arXiv preprint arXiv:2004.07219, 2020.
|
| 299 |
+
[15] Scott Fujimoto, Edoardo Conti, Mohammad Ghavamzadeh, and Joelle Pineau. Benchmarking batch deep reinforcement learning algorithms. arXiv preprint arXiv:1910.01708, 2019.
|
| 300 |
+
[16] Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pages 2052–2062. PMLR, 2019.
|
| 301 |
+
[17] Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019.
|
| 302 |
+
[18] Nan Jiang and Lihong Li. Doubly robust off-policy value evaluation for reinforcement learning. In International Conference on Machine Learning, pages 652–661. PMLR, 2016.
|
| 303 |
+
[19] Gregory Kahn, Adam Villaflor, Pieter Abbeel, and Sergey Levine. Composable actionconditioned predictors: Flexible off-policy learning for robot navigation. In Conference on Robot Learning, pages 806–816. PMLR, 2018.
|
| 304 |
+
[20] Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on Robot Learning, pages 651–673. PMLR, 2018.
|
| 305 |
+
[21] Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In Advances in Neural Information Processing Systems, pages 11784–11794, 2019.
|
| 306 |
+
[22] Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020.
|
| 307 |
+
[23] Romain Laroche, Paul Trichelair, and Remi Tachet Des Combes. Safe policy improvement with baseline bootstrapping. In International Conference on Machine Learning, pages 3652–3661. PMLR, 2019.
|
| 308 |
+
[24] Sergey Levine, Aviral Kumar, George Tucker, and Justin Fu. Offline reinforcement learning: Tutorial, review, and perspectives on open problems. arXiv preprint arXiv:2005.01643, 2020.
|
| 309 |
+
[25] Chenghao Li, Chengjie Wu, Tonghan Wang, Jun Yang, Qianchuan Zhao, and Chongjie Zhang. Celebrating diversity in shared multi-agent reinforcement learning. arXiv preprint arXiv:2106.02195, 2021.
|
| 310 |
+
[26] Xiaoteng Ma, Yiqin Yang, Chenghao Li, Yiwen Lu, Qianchuan Zhao, and Jun Yang. Modeling the interaction between agents in cooperative multi-agent reinforcement learning. In Proceedings of the 20th International Conference on Autonomous Agents and MultiAgent Systems, pages 853–861, 2021.
|
| 311 |
+
[27] Rémi Munos. $\mathrm { Q } ( \lambda )$ with off-policy corrections. In Algorithmic Learning Theory: International Conference, ALT 2016, Bari, Italy, October 19-21, 2016, Proceedings, volume 9925, page 305. Springer, 2016.
|
| 312 |
+
[28] Ofir Nachum, Yinlam Chow, Bo Dai, and Lihong Li. DualDICE: Behavior-agnostic estimation of discounted stationary distribution corrections. Advances in Neural Information Processing Systems, 32:2318–2328, 2019.
|
| 313 |
+
[29] Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Accelerating online reinforcement learning with offline datasets. arXiv preprint arXiv:2006.09359, 2020.
|
| 314 |
+
[30] Radford M Neal. Annealed importance sampling. Statistics and computing, 11(2):125–139, 2001.
|
| 315 |
+
[31] Frans A Oliehoek, Christopher Amato, et al. A concise introduction to decentralized POMDPs, volume 1. Springer, 2016.
|
| 316 |
+
[32] Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 8626–8638, 2018.
|
| 317 |
+
[33] Brendan O’Donoghue, Ian Osband, Remi Munos, and Volodymyr Mnih. The uncertainty bellman equation and exploration. In International Conference on Machine Learning, pages 3836–3845, 2018.
|
| 318 |
+
[34] Ling Pan, Qingpeng Cai, and Longbo Huang. Softmax deep double deterministic policy gradients. In Advances in Neural Information Processing Systems, volume 33, pages 11767– 11777, 2020.
|
| 319 |
+
[35] Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019.
|
| 320 |
+
[36] Jan Peters, Katharina Mulling, and Yasemin Altun. Relative entropy policy search. In AAAI Conference on Artificial Intelligence, volume 24, 2010.
|
| 321 |
+
[37] Michael Rabbat and Robert Nowak. Distributed optimization in sensor networks. In Proceedings of the 3rd international symposium on Information processing in sensor networks, pages 20–27, 2004.
|
| 322 |
+
[38] Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017.
|
| 323 |
+
|
| 324 |
+
[39] Tabish Rashid, Mikayel Samvelyan, Christian Schroeder, Gregory Farquhar, Jakob Foerster, and Shimon Whiteson. QMIX: Monotonic value function factorisation for deep multi-agent reinforcement learning. In International Conference on Machine Learning, pages 4295–4304, 2018.
|
| 325 |
+
|
| 326 |
+
[40] Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim GJ Rudner, Chia-Man Hung, Philip HS Torr, Jakob Foerster, and Shimon Whiteson. The StarCraft multi-agent challenge. In International Conference on Autonomous Agents and Multiagent Systems, pages 2186–2188, 2019.
|
| 327 |
+
|
| 328 |
+
[41] Juan C Santamaria, Richard S Sutton, and Ashwin Ram. Experiments with reinforcement learning in problems with continuous state and action spaces. Adaptive behavior, 6(2):163–217, 1997.
|
| 329 |
+
|
| 330 |
+
[42] Noah Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavior modelling priors for offline reinforcement learning. In International Conference on Learning Representations, 2019.
|
| 331 |
+
|
| 332 |
+
[43] Kyunghwan Son, Daewoo Kim, Wan Ju Kang, David Earl Hostallero, and Yung Yi. QTRAN: Learning to factorize with transformation for cooperative multi-agent reinforcement learning. In International Conference on Machine Learning, pages 5887–5896, 2019.
|
| 333 |
+
|
| 334 |
+
[44] Aaron Sonabend-W, Junwei Lu, Leo A Celi, Tianxi Cai, and Peter Szolovits. Expertsupervised reinforcement learning for offline policy learning and evaluation. arXiv preprint arXiv:2006.13189, 2020.
|
| 335 |
+
|
| 336 |
+
[45] H Francis Song, Abbas Abdolmaleki, Jost Tobias Springenberg, Aidan Clark, Hubert Soyer, Jack W Rae, Seb Noury, Arun Ahuja, Siqi Liu, Dhruva Tirumala, et al. V-mpo: On-policy maximum a posteriori policy optimization for discrete and continuous control. In International Conference on Learning Representations, 2019.
|
| 337 |
+
|
| 338 |
+
[46] Zhao Song, Ron Parr, and Lawrence Carin. Revisiting the softmax bellman operator: New benefits and new perspective. In International Conference on Machine Learning, pages 5916– 5925. PMLR, 2019.
|
| 339 |
+
|
| 340 |
+
[47] Bharath K Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Schölkopf, Gert RG Lanckriet, et al. On the empirical estimation of integral probability metrics. Electronic Journal of Statistics, 6:1550–1599, 2012.
|
| 341 |
+
|
| 342 |
+
[48] Peter Sunehag, Guy Lever, Audrunas Gruslys, Wojciech Marian Czarnecki, Vinicius Zambaldi, Max Jaderberg, Marc Lanctot, Nicolas Sonnerat, Joel Z Leibo, Karl Tuyls, et al. Valuedecomposition networks for cooperative multi-agent learning based on team reward. In International Conference on Autonomous Agents and MultiAgent Systems, pages 2085–2087, 2018.
|
| 343 |
+
|
| 344 |
+
[49] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT press, 2018.
|
| 345 |
+
|
| 346 |
+
[50] Philip Thomas and Emma Brunskill. Data-efficient off-policy policy evaluation for reinforcement learning. In International Conference on Machine Learning, pages 2139–2148. PMLR, 2016.
|
| 347 |
+
|
| 348 |
+
[51] Emanuel Todorov. Linearly-solvable markov decision problems. In Advances in neural information processing systems, pages 1369–1376, 2007.
|
| 349 |
+
|
| 350 |
+
[52] Ahmed Touati, Harsh Satija, Joshua Romoff, Joelle Pineau, and Pascal Vincent. Randomized value functions via multiplicative normalizing flows. In Uncertainty in Artificial Intelligence, pages 422–432. PMLR, 2020.
|
| 351 |
+
|
| 352 |
+
[53] SS Vallender. Calculation of the wasserstein distance between probability distributions on the line. Theory of Probability & Its Applications, 18(4):784–786, 1974.
|
| 353 |
+
|
| 354 |
+
[54] Quan Vuong, Yiming Zhang, and Keith W Ross. Supervised policy update for deep reinforcement learning. In International Conference on Learning Representations, 2018.
|
| 355 |
+
|
| 356 |
+
[55] Yihan Wang, Beining Han, Tonghan Wang, Heng Dong, and Chongjie Zhang. Off-policy multi-agent decomposed policy gradients. arXiv preprint arXiv:2007.12322, 2020.
|
| 357 |
+
|
| 358 |
+
[56] Yu-Xiang Wang, Alekh Agarwal, and Miroslav Dudık. Optimal and adaptive off-policy evaluation in contextual bandits. In International Conference on Machine Learning, pages 3589–3597. PMLR, 2017.
|
| 359 |
+
[57] Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8(3-4):279–292, 1992.
|
| 360 |
+
[58] Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019.
|
| 361 |
+
[59] Deheng Ye, Zhao Liu, Mingfei Sun, Bei Shi, Peilin Zhao, Hao Wu, Hongsheng Yu, Shaojie Yang, Xipeng Wu, Qingwei Guo, et al. Mastering complex control in MOBA games with deep reinforcement learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 6672–6679, 2020.
|
md/train/8hGabvaV2GQ/8hGabvaV2GQ.md
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Watching Too Much Television is Good: Self-Supervised Audio-Visual Representation Learning from Movies and TV Shows
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 The abundance and ease of utilizing sound, along with the fact that auditory clues
|
| 11 |
+
2 reveal so much about what happens in the scene, make the audio-visual space a
|
| 12 |
+
3 perfectly intuitive choice for self-supervised representation learning. However,
|
| 13 |
+
4 the current literature suggests that training on uncurated data yields considerably
|
| 14 |
+
5 poorer representations compared to the curated alternatives collected in supervised
|
| 15 |
+
6 manner, and the gap only narrows when the volume of data significantly increases.
|
| 16 |
+
7 Furthermore, the quality of learned representations is known to be heavily influ
|
| 17 |
+
8 enced by the size and taxonomy of the curated datasets used for self-supervised
|
| 18 |
+
9 training. This begs the question of whether we are celebrating too early on catching
|
| 19 |
+
10 up with supervised learning when our self-supervised efforts still rely almost exclu
|
| 20 |
+
11 sively on curated data. In this paper, we study the efficacy of learning from Movies
|
| 21 |
+
12 and TV Shows as forms of uncurated data for audio-visual self-supervised learning.
|
| 22 |
+
13 We demonstrate that a simple model based on contrastive learning, trained on a
|
| 23 |
+
14 collection of movies and TV shows, not only dramatically outperforms more com
|
| 24 |
+
15 plex methods which are trained on orders of magnitudes larger uncurated datasets,
|
| 25 |
+
16 but also performs very competitively with the state-of-the-art that learns from
|
| 26 |
+
17 large-scale curated data. We identify that audiovisual patterns like the appearance
|
| 27 |
+
18 of the main character or prominent scenes and mise-en-scène which frequently
|
| 28 |
+
19 occur through the whole duration of a movie, lead to an overabundance of easy
|
| 29 |
+
20 negative instances in the contrastive learning formulation. Capitalizing on such
|
| 30 |
+
21 observation, we propose a hierarchical sampling policy, which despite its simplicity,
|
| 31 |
+
22 effectively improves the performance, particularly when learning from TV shows
|
| 32 |
+
23 which naturally face less semantic diversity.
|
| 33 |
+
|
| 34 |
+
# 24 1 Introduction
|
| 35 |
+
|
| 36 |
+
25 Recently, there has been tremendous progress in self-supervised learning from still images, where the
|
| 37 |
+
26 standard supervised training has been outperformed in a variety of image-related tasks [7, 8, 15, 29].
|
| 38 |
+
27 The appeal of detaching representation learning from human annotations is rooted not only in the
|
| 39 |
+
28 non-trivial challenges of scaling-up the labeling process, but also in the ill-defined task of determining
|
| 40 |
+
29 a proper taxonomy with generalization power and transferability. Both challenges only exacerbate as
|
| 41 |
+
30 we move from images to videos, where the notion of time is involved and the complexity of visual
|
| 42 |
+
31 concepts increases. Simply considering the number of training instances or even the cardinality of
|
| 43 |
+
32 the label set is not sufficient to conclude if one large-scale supervised dataset is more suitable than
|
| 44 |
+
33 another for transfer learning in video classification tasks [20]. That is, the abundance of attention
|
| 45 |
+
34 which video self-supervised learning has lately received is only to be expected. While many research
|
| 46 |
+
35 efforts in this area extend the contributions made initially in the image domain to the video domain,
|
| 47 |
+
36 others, including our work, have explored harnessing additional modalities such as audio or text for
|
| 48 |
+
37 multi-modal self-supervised learning [2, 3, 4, 22, 27, 31, 37, 36, 39].
|
| 49 |
+
38 From the current state-of-the-art one makes two major conclusions. First, the quality of learned
|
| 50 |
+
39 representations, evaluated by fine-tuning on downstream tasks, is heavily influenced by the size and
|
| 51 |
+
40 taxonomy of the pretraining datasets [2, 3, 39]. Second, an uncurated pretraining dataset yields
|
| 52 |
+
41 considerably poorer representations compared to a curated one and the gap only narrows when the
|
| 53 |
+
42 total amount of pretraining data significantly increases [3]. Curated data refers to likes of supervised
|
| 54 |
+
43 large-scale action recognition and audio classification datasets such as Kinetics [6], IG-Kinetics
|
| 55 |
+
44 [12], AudioSet [11], and YouTube-8M [1]. While the human-annotated labels are not accessed for
|
| 56 |
+
45 self-supervised pretraining, videos being trimmed and from a label set of limited cardinality with
|
| 57 |
+
46 biased sampling distribution1 implicitly acts as a sort of supervision. On the other hand, an uncurated
|
| 58 |
+
47 data refers to likes of IG-Random[3], simply a body of unlabeled videos collected blindly with
|
| 59 |
+
48 none of the aforementioned careful human-involvements. That being said, we know that something
|
| 60 |
+
49 as simple as having access to a clean object-centric training data, like Imagenet, can be indirectly
|
| 61 |
+
50 exploited by contrastive self-supervised learning in image domain to obtain additional performance
|
| 62 |
+
51 gain [41] on the downstream tasks which exhibit similar properties. The analogous to it of course are
|
| 63 |
+
52 the well trimmed closed-set curated datasets which are being extensively used in the literature for
|
| 64 |
+
53 video self-supervised pretraining, while downstream evaluations focus on benchmarks with similar
|
| 65 |
+
54 characteristics. Our work aims at comprehensively exploring the efficacy of learning from Movies
|
| 66 |
+
55 and TV Shows, as forms of uncurated data, for audio-visual self-supervised learning.
|
| 67 |
+
56 Many of us can relate to an experience in movie theaters when the sound of the engine, first perceived
|
| 68 |
+
57 by our left ear, is gradually heard more by the right ear as a car moves from the left side of the
|
| 69 |
+
58 screen to the right side. Another example is a scene in which an object, like a helicopter, approaches
|
| 70 |
+
59 the camera from distance and eventually flies over it. In this case, the perceived sound not only
|
| 71 |
+
60 changes in loudness but also transitions from front to back, in concert with the visuals, giving the
|
| 72 |
+
61 audience a more realistic feeling as if they are indeed positioned behind the camera. Besides, with
|
| 73 |
+
62 art being inherently novel, two movies even if they share genres or revolve around similar story
|
| 74 |
+
63 lines often deliver quite different experiences and portray distinct visuals, thanks to the extremely
|
| 75 |
+
64 artist-driven creative process behind such productions. We hypothesize that the aforementioned high
|
| 76 |
+
65 audio fidelity, and inherent semantic diversity characterize long-form content2 as potentially a very
|
| 77 |
+
66 rich source for self-supervised multi-modal representation learning. It is worth emphasizing that in
|
| 78 |
+
67 spirit of uncurated data, we not only blindly sample from a large collection of movies and TV shows
|
| 79 |
+
68 when constructing our pretraining dataset, but also perform ablation studies on the effect of genre
|
| 80 |
+
69 distribution, the closest we have to taxonomy in the curated datasets, confirming that the quality of
|
| 81 |
+
70 learned representations is agnostic with respect to such statistics.
|
| 82 |
+
71 To the best of our knowledge, we are the first to solely rely on uncurated data and study the efficacy of
|
| 83 |
+
72 self-supervised multi-modal representation learning from movies and TV shows. Despite meaningful
|
| 84 |
+
73 domain gap between our pretraining data and the space of downstream tasks, we obtain representations
|
| 85 |
+
74 which are very competitive with those learned from curated datasets. This is particularly important as
|
| 86 |
+
75 we follow a much simpler modeling approach in comparison with the state-of-the art.
|
| 87 |
+
|
| 88 |
+
# 76 2 Related Work
|
| 89 |
+
|
| 90 |
+
77 Self-supervised learning techniques define pretext tasks, mostly inspired by the natural structures
|
| 91 |
+
78 in the data, in order to generate supervisory signals for training. Despite the plethora of proposed
|
| 92 |
+
79 pretext tasks in the literature, these approaches can be coarsely divided into two groups, namely
|
| 93 |
+
80 pretext learning, and pretext-invariant methods. Approaches which fall in the former bucket, usually
|
| 94 |
+
81 apply a form of transform, randomly drawn from a parametric family, to the input data then optimize
|
| 95 |
+
82 for predicting the parameters of the chosen transformation. Predicting the relative position of image
|
| 96 |
+
83 patches [9], solving jigsaw puzzles [33], estimating artificial rotations [13], colorization [50], context
|
| 97 |
+
84 encoders learned through inpainting [38], and learning by counting scale and split invariant visual
|
| 98 |
+
85 primitives [34], are among many methods which belong to this category. Similar techniques have
|
| 99 |
+
86 been extended from images to videos [10, 21, 24, 25, 30, 46, 48, 49], where in addition to the
|
| 100 |
+
87 spatial context, the temporal domain, and the arrow of time have been heavily exploited. In contrast,
|
| 101 |
+
88 pretext-invariant methods [5, 7, 8, 15, 18, 17, 29, 35, 39, 44] are built on the concept of maximizing
|
| 102 |
+
89 mutual information across augmented versions of a single instance, and are mostly formulated as
|
| 103 |
+
90 contrastive learning. In other words, a pretext is used to generate different views of a single input
|
| 104 |
+
91 for which the learning algorithm aims to maximize the intra-instance similarity, across variety of
|
| 105 |
+
92 transformations. Our work falls within this category, however we function in a multi-modal realm
|
| 106 |
+
93 employing both audio and video.
|
| 107 |
+
94 Earlier works which harnessed audio and video for representation learning, have leveraged audio
|
| 108 |
+
95 visual temporal synchronization [22, 36], correspondence [4], and cross-modal clustering [3, 37]. The
|
| 109 |
+
96 work by Patrick et al.[39] proposes a generalized data transformation in order to unify a variety of
|
| 110 |
+
97 audio-visual self-supervised pretext tasks through a noise contrastive formulation. This work is close
|
| 111 |
+
98 to ours in choice of objective function and data type, yet we employ no augmentation (except modality
|
| 112 |
+
99 projection in the terminology of [39]), and solely focus on capitalizing the advantages of learning
|
| 113 |
+
100 from long-form content. Morgado et al.[31] show that cross-modal discrimination is important for
|
| 114 |
+
101 learning good audio and video representations, something which was also pointed out earlier in a
|
| 115 |
+
102 clustering framework [3]. Beyond that, [31] generalizes the notion of instance-level positive and
|
| 116 |
+
103 negative examples by exploring cross-modal agreement where multiple instances are grouped together
|
| 117 |
+
104 as positives by measuring their similarity in both the video and audio feature spaces. While we also
|
| 118 |
+
105 adopt a cross-modal noise contrastive estimation loss, we stick with the vanilla version, instance-level
|
| 119 |
+
106 positive and negatives, and do not use any memory bank feature representations. Finally, Alayrac et
|
| 120 |
+
107 al.[2] recently proposed a multi-modal versatile network capable of simultaneously learning from
|
| 121 |
+
108 audio, video and text. Building on the intuition that different modalities are of different semantic
|
| 122 |
+
109 granularity, audio and video are first compared in a fine-grained space while text is compared with
|
| 123 |
+
110 the aforementioned modalities in a lower dimensional coarse-grained space. In our experiments, we
|
| 124 |
+
111 compare with a variant of [2] where only audio and video modalities are utilized.
|
| 125 |
+
|
| 126 |
+
# 112 3 Approach
|
| 127 |
+
|
| 128 |
+
113 Notations and Architecture. Our pretraining dataset is denoted by $\mathcal { X } \ : = \ : \{ \mathcal { X } _ { n } | n \in [ 1 \cdot \cdot \cdot N ] \}$
|
| 129 |
+
114 where $\mathcal { X } _ { n } = \{ x _ { n , m } | m \in [ 1 \cdots M _ { n } ] \}$ contains $M _ { n }$ non-overlapping audiovisual snippets which are
|
| 130 |
+
115 temporally segmented from the duration of the $n ^ { t h }$ long-form content in the dataset. Each snippet
|
| 131 |
+
116 includes both audio and video modalities, formally $x _ { n , m } = ( a _ { n , m } , v _ { n , m } )$ , where $a _ { n , m } \in \mathbb { R } ^ { 1 \times \pmb { \tilde { P } } \times Q }$
|
| 132 |
+
117 and $v _ { n , m } \in \mathbb { R } ^ { 3 \times T \times H \times W }$ . $T , H$ , and $W$ denote the number of frames, height and width of the video,
|
| 133 |
+
118 while $P$ , and $Q$ respectively stand for the number of mel filters, and audio frames. Video and audio are
|
| 134 |
+
119 processed through 18-layers deep $\mathrm { R } ( 2 { + } 1 ) \mathrm { D }$ [45] and ResNet [16] architectures, respectively referred
|
| 135 |
+
120 to as $f : \mathbb { R } ^ { 3 } \check { \mathbb { R } } ^ { d _ { f } }$ and $\dot { \boldsymbol { g } } : \mathbb { R } ^ { 1 } \dot { } \mathbb { R } ^ { d _ { g } }$ . Inspired by [7], we use projection heads, $\boldsymbol { h } _ { f } : \mathbb { R } ^ { d _ { f } } \overset { \cdot } { } \mathbb { R } ^ { d }$ and
|
| 136 |
+
121 $h _ { g } : \mathbb { R } ^ { d _ { g } } \mathbb { R } ^ { d }$ , to map corresponding representations into a common $d$ -dimensional space before
|
| 137 |
+
122 computing the contrastive loss. The shallow architecture of $h _ { f }$ and $h _ { g }$ consists of two convolution
|
| 138 |
+
123 layers, separated by Batch Normalization [19] and ReLU [32], followed by global average pooling.
|
| 139 |
+
124 Once self-supervised pretraining finished, we discard the projection heads and fine-tune $f$ and $g$ for
|
| 140 |
+
125 respective downstream tasks.
|
| 141 |
+
126 Loss Function. With a slight abuse of notation3, $\boldsymbol { B } = \{ x _ { i } = ( a _ { i } , v _ { i } ) | i \in [ 1 \cdot \cdot \cdot B ] \}$ represents a
|
| 142 |
+
127 minibatch of size $B$ , where video and audio modalities associated with the $i ^ { t h }$ sample, $x _ { i }$ , are denoted
|
| 143 |
+
128 by $v _ { i }$ and $a _ { i }$ . We use $z _ { v } ^ { i } = h _ { f } ( f ( v _ { i } ) )$ and $z _ { a } ^ { i } = h _ { g } ( g ( a _ { i } ) )$ to represent the associated embeddings
|
| 144 |
+
129 generated by projection heads, and optimize the noise-contrastive loss [14] shown in 1 in order
|
| 145 |
+
130 to maximize the symmetric joint probability between audio and video. For the $i ^ { t h }$ element in the
|
| 146 |
+
131 minibatch, $( z _ { v } ^ { i } , z _ { a } ^ { i } )$ serves as the positive pair, while assuming negative pairs for both modalities,
|
| 147 |
+
132 $\mathcal { N } _ { i } = \{ ( z _ { v } ^ { i } , z _ { a } ^ { j } ) , ( \stackrel { \sim } { z } _ { v } ^ { j } , z _ { a } ^ { i } ) | j \in [ 1 \cdots B ] , i \neq j \}$ constitutes the set of negative pairs.
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\mathcal { L } = - \sum _ { i = 1 } ^ { B } \log \left( \frac { e ^ { ( z _ { v } ^ { i } ) ^ { \top } ( z _ { a } ^ { i } ) } } { e ^ { ( z _ { v } ^ { i } ) ^ { \top } ( z _ { a } ^ { i } ) } + \displaystyle \sum _ { ( z _ { v } ^ { \prime } , z _ { a } ^ { \prime } ) \in \mathcal { N } _ { i } } e ^ { ( z _ { v } ^ { \prime } ) ^ { \top } ( z _ { a } ^ { \prime } ) } } \right)
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
133 Most of the previous works [2, 31, 39] normalize the embeddings before computing the contrastive
|
| 154 |
+
134 loss and employ a temperature hyper-parameter, often denoted by $\tau$ as in [2, 31], to control the
|
| 155 |
+
35 smoothness for the distribution of pairwise similarities. In contrast, we have chosen to operate in an
|
| 156 |
+
36 unnormalized embedding space. Besides the obvious benefit of eliminating the need for tuning $\tau$ , we
|
| 157 |
+
7 empirically show that such decision does not affect the quality of the learned representations.
|
| 158 |
+
138 Sampling Policy. Contrastive loss function shown in Equation 1 is computed over $B$ training
|
| 159 |
+
139 instances, each in form of an audiovisual snippet. A naive sampling policy may ignore the fact that
|
| 160 |
+
140 snippets comprising the pretraining dataset are in fact temporal segments that were trimmed from
|
| 161 |
+
141 longer-form contents, i.e. movies and TV shows. Such an assumption treats our training data as
|
| 162 |
+
142 independent and identically distributed random variables from $\textstyle \bigcup _ { n = 1 } ^ { N } { \mathcal { X } } _ { n }$ , which constitutes the default
|
| 163 |
+
143 sampling policy that is commonly used in the general deep learning literature. However, in reality,
|
| 164 |
+
144 commonalities and correlations do exist along the temporal axis of a movie or TV show, things like
|
| 165 |
+
145 audio mastering artifacts, frequent appearance of the main character’s face and voice, thematic music,
|
| 166 |
+
146 repetitive scenes and mise-en-scène4, all of which contribute to breaking the previously discussed
|
| 167 |
+
147 i.i.d assumption. This is even more pronounced when we deal with multiple episodes of the same TV
|
| 168 |
+
148 show appearing in the pretraining dataset5. Note that, sampling from no video data is going to be i.i.d
|
| 169 |
+
149 but in this case the temporal correlations extend for much longer given our entities are movies and TV
|
| 170 |
+
150 shows. Thus, it is more accurate to think of $\mathcal { X }$ having multiple underlying domains, oriented towards
|
| 171 |
+
151 exclusive properties which different long-form contents are characterized by. We hypothesize that
|
| 172 |
+
152 during training, model gradually discovers such patterns of commonalities, which are not semantically
|
| 173 |
+
153 valuable, and latches onto those to quickly minimize Equation 1 leading to poor generalization6. The
|
| 174 |
+
154 reason being $B \ll N$ , hence for $n \sim \mathbb { U } ( 1 , N )$ and $m \neq m ^ { \prime }$ , $\mathsf { P } ( x _ { n , m } \in B \land x _ { n , m ^ { \prime } } \in B )$ is negligible.
|
| 175 |
+
155 In other words, the set of negative pairs in Equation 1 mainly includes pairs for which audio and
|
| 176 |
+
156 video come from two different movies or TV shows, thus due to the aforementioned artifacts behave
|
| 177 |
+
157 as easy negatives.
|
| 178 |
+
158 In order to quantitatively measure our hypothesis, we define different distributions, shown in Equation
|
| 179 |
+
159 2, over the space of audio-visual similarity. $S ^ { + }$ indicates the space of correct matches, i.e. where
|
| 180 |
+
160 audio and video correspond to the same snippet. $S ^ { - }$ indicates the space where audio and video do
|
| 181 |
+
161 not correspond yet belong to the same movie or TV show. Finally, $\bar { \boldsymbol { S } } ^ { \neq }$ indicates the space in which
|
| 182 |
+
162 audio and video are sampled from two distinct long-form content, hence naturally do not correspond.
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
( z _ { v } ^ { n , m } ) ^ { \mathsf { T } } ( z _ { a } ^ { n ^ { \prime } , m ^ { \prime } } ) \sim \left\{ { \begin{array} { l l } { S ^ { + } , } & { { \mathrm { i f } } \ n = n ^ { \prime } \wedge m = m ^ { \prime } } \\ { S ^ { - } , } & { { \mathrm { i f } } \ n = n ^ { \prime } \wedge m \neq m ^ { \prime } } \\ { S ^ { \neq } , } & { { \mathrm { i f } } \ n \neq n ^ { \prime } \wedge \forall ( m , m ^ { \prime } ) } \end{array} } \right.
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
163 With that, and $\mathsf { K L }$ denoting Kullback–Leibler divergence, $\mathsf { K L } ( S ^ { - } \parallel S ^ { + } )$ measures the expected
|
| 189 |
+
164 difference between positive and negative pairs within the same movie or TV show. Ideally, this should
|
| 190 |
+
165 increase as the training progresses, since the model gradually learns audio-video correspondence by
|
| 191 |
+
166 minimizing Equation 1. Meanwhile, the i.i.d assumption suggests $\mathsf { K L } ( \mathcal { S } ^ { - } \parallel \mathcal { S } ^ { + } ) \simeq \mathsf { K L } ( \mathcal { S } ^ { \neq } \parallel \mathcal { S } ^ { + } )$
|
| 192 |
+
167 and $\mathsf { K L } ( \mathcal { S } ^ { - } \parallel \mathcal { S } ^ { \neq } ) \simeq \boldsymbol { 0 }$ , yet as we empirically illustrate later, $\mathsf { K L } ( \mathcal { S } ^ { - } \parallel \mathcal { S } ^ { + } ) < \mathsf { K L } ( \mathcal { S } ^ { \neq } \parallel \mathcal { S } ^ { + } )$ and
|
| 193 |
+
168 ${ \mathsf { K L } } ( S ^ { - } \parallel S ^ { \neq } )$ is rather large, indicating that, upon convergence and on a held-out set, model has
|
| 194 |
+
169 a harder time pushing apart negative pairs when audio and video come from the same underlying
|
| 195 |
+
170 long-form content. Next, we explain how a simple alternative policy which samples $k$ snippets
|
| 196 |
+
171 from each long-form content effectively reduces both of the discrepancy measures, referring to
|
| 197 |
+
172 $\mathsf { K L } ( S ^ { - } \parallel S ^ { \neq } )$ and $\mathsf { K L } ( \mathcal { S } ^ { \neq } \parallel \mathcal { S } ^ { + } ) - \mathsf { K L } ( \mathcal { S } ^ { - } \parallel \mathcal { S } ^ { + } )$ , while yielding better generalization on a range
|
| 198 |
+
173 of downstream tasks.
|
| 199 |
+
174 To ameliorate the aforementioned optimization challenge, we take a hierarchical approach. In
|
| 200 |
+
175 particular, we first uniformly sample a long-form content, $n \sim \mathbb { U } ( 1 , N )$ , and then draw $k$ distinct
|
| 201 |
+
176 snippets from ${ \mathcal { X } } _ { n }$ , creating $\{ { \bar { x } } _ { n , m } | { \bar { m } } \in { \mathcal { M } } _ { n } \}$ , where $\mathcal { M } _ { n } \subset [ 1 \cdots M _ { n } ]$ and $| { \mathcal { M } } _ { n } | = k$ . This ensures
|
| 202 |
+
177 that for $x _ { i } \in B$ , ${ \mathcal { N } } _ { i }$ always includes $2 k - 2$ pairs sampled from the same movie or TV show to
|
| 203 |
+
178 which $x _ { i }$ belongs. By putting constraints on $\mathcal { M } _ { n }$ , specifically how temporally far from each other
|
| 204 |
+
179 the $k$ samples are drawn, we may go one step further and to some extent control the audiovisual
|
| 205 |
+
180 similarity between snippets. This serves as an additional nob to tune for hard negative sampling.
|
| 206 |
+
181 The intuition is that, the larger narrative of a professionally made movie or TV show is composed of
|
| 207 |
+
182 shorter units called scene. Each scene comprises a complete event, action, or block of storytelling and
|
| 208 |
+
183 normally takes place in one location and deals with one action. That is, if our samples are temporally
|
| 209 |
+
184 close, it is more likely for corresponding snippets to be highly correlated and/or look/sound alike.
|
| 210 |
+
185 $k \leq \mathrm { m a x } [ \mathcal { M } _ { n } ] - \mathrm { m i n } [ \mathcal { M } _ { n } ] + 1 \ \bar { \leq } \ w \leq \bar { M } _ { n }$ defines the bounds on our sampling policy, where $w$
|
| 211 |
+
186 standing for a sampling window, determines the farthest two out of $k$ samples drawn from ${ \mathcal { X } } _ { n }$ can
|
| 212 |
+
187 be. Accordingly, $w = k$ represents the case where all $k$ samples are temporally adjacent, hence
|
| 213 |
+
188 the expected audiovisual similarity is maximized due to temporal continuity in content. We show
|
| 214 |
+
189 that having such level of hard negatives, even with a small $k$ , prevents proper training and results in
|
| 215 |
+
190 performance degradation. On the other hand, $w = M _ { n }$ indicates random sampling where no temporal
|
| 216 |
+
191 constraint is imposed on $\mathcal { M } _ { n }$ , thus samples are less likely to be drawn from adjacent time-stamps.
|
| 217 |
+
192 In this case, expected audiovisual similarity (i.e. hardness of negative pairs) is mainly derived from
|
| 218 |
+
193 global content-exclusive artifacts like, color palette, frequent appearance of the main character’s face
|
| 219 |
+
194 and voice, repetitive scenes, and etc. The rest of the spectrum provides middle grounds where two
|
| 220 |
+
195 samples drawn from ${ \mathcal { X } } _ { n }$ can at most be $w + 1$ snippets apart, something reminiscent of temporal
|
| 221 |
+
196 locality. Our sampling policy can be easily implemented in a few lines of Python. Please refer to
|
| 222 |
+
197 supplemental material for further details.
|
| 223 |
+
|
| 224 |
+
# 98 4 Experiments
|
| 225 |
+
|
| 226 |
+
# 4.1 Experimental Setup
|
| 227 |
+
|
| 228 |
+
Datasets and Reproducibility. We use full-length movies and episodes of TV shows for selfsupervised pretraining. Titles are randomly chosen from a large collection spanning over a variety of genres, namely Drama, Comedy, Action, Horror, Thriller, Sci-Fi and Romance. All audio is in English language. Our Movie dataset, consists of 3.6K films with an average duration of 105 minutes. Our TV dataset includes 9.2K episodes from a total of 581 shows with an average duration of 42 minutes per episode. Each of our datasets comprises 0.7 years worth of uncurated audiovisual content, which is significantly smaller than IG-Random [3] with variants at 5 and 21 years. Scaling up our pretraining datasets to volumes comparable to the IG-Random [3] while possible is non-trivial and demands dramatically larger compute resources for training, something which we currently cannot afford. Given that we cannot publicly release our dataset due to copyright reasons, we acknowledge that it is not possible for other research groups to fully reproduce our results. However, we intend to make available the pretrained models and hope that research community finds them, along with the other contributions of this work, of value whether within the context of self-supervised learning or adoption for various downstream tasks. We would like to emphasize that similar limitations have precedents in multiple earlier works including but not limited to [3, 12, 26, 43]. To evaluate the efficacy of self-supervised audio-visual representation learning from movies and TV shows, we follow recent works [3, 39, 31, 2] and benchmark UCF101[42] and HMDB51[23] for action recognition, along with ESC50[40] for audio classification. Results for the ablation studies are reported on the split-1 of the corresponding datasets. Following the standard protocol, we report the average performance over all splits when we are comparing with the state-of-the-art.
|
| 229 |
+
|
| 230 |
+
Pretraining. Unless mentioned otherwise, we use video snippets with 16 frames at 5 fps. For data augmentation, we resize the shorter side to 190 pixels, then randomly crop them into $1 5 8 \times 1 5 8$ pixels. As for sound, we compute mel spectrogram from the raw audio at 48K sample rate using $9 6 ~ \mathrm { m e l }$ filters and an FFT window of 2048, while the number of samples between successive frames is set to 512. For data augmentation, we randomly drop out up to $2 5 \%$ from either temporal or frequency axis of the 2-D mel spectrogram image. Training uses a batch size of 512 and takes on average 42 hours on 8 NVIDIA A100 GPUs. The dimension of audio-video joint embedding space, $d$ , is set to 512.
|
| 231 |
+
|
| 232 |
+
Downstream Evaluation. For training on UCF101 [42] and HMDB51 [23], we use video clips that are 32 frames long at 10 fps. Unless mentioned otherwise, these clips are randomly chosen from the duration of the video instances. A scale jittering range of [181, 226] pixels is used and we randomly crop the video into $1 5 8 \times 1 5 8$ pixels. Furthermore, random horizontal flipping and color jittering are employed. During inference, 10 temporal clips are uniformly sampled where each is spatially cropped in 3 ways (left, center, right) resulting in a total of 30 views. We then average the model predictions across these 30 views and report top-1 classification accuracy. For training on ESC50 [40], we use 3-seconds clips which are randomly chosen from the duration of the audio instances and apply time and frequency masking to spectrogram images for data augmentation. The maximum possible length of the mask is $50 \%$ of the corresponding axis. We do not use any scale jittering or random cropping on the spectrograms. During inference, 10 temporal clips are uniformly sampled
|
| 233 |
+
|
| 234 |
+
238 and we average the model predictions across these 10 views and report top-1 classification accuracy.
|
| 235 |
+
239 For further implementation details, please refer to the supplemental material.
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 1: Ablation study of the proposed sampling policy on reducing the discrepancy measures.
|
| 239 |
+
|
| 240 |
+
# 240 4.2 Ablation Study
|
| 241 |
+
|
| 242 |
+
In the following, we discuss multiple ablation studies to assess our main hypothesis that, a hierarchical sampling policy, as described in Section 3, enables better representations to be learned by increasing the portion of hard negative pairs which the contrastive loss function observes. Here, pretraining uses $90 \%$ of either Movie or TV dataset, while the remaining $10 \%$ constitute a held-out validation set7 on which we report the discrepancy measures.
|
| 243 |
+
|
| 244 |
+
Sample size $( k )$ Figure 1a illustrates that compared to the baseline sampling denoted by $k = 1$ , our approach $k > 1 ,$ ) effectively shrinks the gap between $S ^ { - }$ and ${ \mathcal { S } } ^ { \neq }$ when measured either directly or against $S ^ { + }$ . Its pattern of behavior also perfectly follows our earlier intuition (ref. Section 3). In particular, given a fixed minibatch budget, a larger $k$ favors more training instances to be sampled from fewer number of long-form contents. That increases the portion of hard negative pairs, thus pushes the contrastive loss to more aggressively separate mismatched audio-video pairs from the same movie, which leads model to maintain less of the content-exclusive artifacts in the embedding space. In the most extreme case, $k = 6 4$ , all the training instances are sampled from the same movie. From Table 1, we observe that different variants of our sampling policy, with no imposed temporal constraint, i.e. $w = M _ { n }$ , outperform the baseline on all three downstream tasks
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 2: Effect of color jitter on the discrepancy measures.
|
| 248 |
+
|
| 249 |
+
Sampling window $\mathbf { \Pi } ^ { ( w ) }$ Smaller $w$ forces samples that belong to same movie to be drawn from a shorter temporal window, hence growing the probability that they look/sound very much alike (i.e. harder negative pairs). That is, it should further diminish the discrepancy measures. Figure 1b illustrates this behavior where we gradually increase $w$ while $k = 1 6$ . However, from Table 1, it does not seem that tuning for $w$ , i.e $w \neq M _ { n }$ , provides a meaningful gain on downstream tasks. This implies that commonalities which persist throughout the duration of a movie are sufficiently powerful signals to be exploited for generating hard negatives. We hypothesize that different scenes both within and across different movies and TV shows are of variety of length, thus a fixed $w$ is sub-optimal. Ideally, we should identify scene boundaries and and dynamically modify $w$ during sampling, something which we leave for future iterations of this work.
|
| 250 |
+
|
| 251 |
+
Temporally adjacent samples. Along the lines of previous observations, Figure 1c shows that indeed drawing temporally adjacent snippets from the same long-form content, i.e. $w = k$ , results in aggressively reducing the discrepancy measures. This behavior is agnostic with respect to $k$ yet exacerbates as $k$ grows. Note that, the contrastive loss is an instance-discrimination objective function. Therefore, forcing it to distinguish between temporally adjacent snippets, that naturally sound and look extremely similar, leaves no choice for the model but to discard valuable semantic notions, which predictably leads to poor representations, also confirmed by result reported in Table 1.
|
| 252 |
+
|
| 253 |
+
Table 1: Ablation study of the proposed sampling policy on different downstream tasks, measured by top-1 classification accuracy.
|
| 254 |
+
|
| 255 |
+
<table><tr><td colspan="5">pretraining dataset: Movie</td></tr><tr><td>k</td><td>w</td><td>HMDB51</td><td>ESC50</td><td>UCF101</td></tr><tr><td>1</td><td>1</td><td>60.32</td><td>86.50</td><td>85.69</td></tr><tr><td>4</td><td>Mn</td><td>61.37</td><td>89.91</td><td>85.38</td></tr><tr><td>8</td><td>Mn</td><td>62.09</td><td>88.75</td><td>86.06</td></tr><tr><td>16</td><td>Mn</td><td>62.92</td><td>88.33</td><td>86.30</td></tr><tr><td>32</td><td>Mn</td><td>61.04</td><td>88.00</td><td>85.98</td></tr><tr><td>64</td><td>Mn</td><td>61.30</td><td>86.83</td><td>85.43</td></tr><tr><td>16</td><td>64</td><td>60.26</td><td>87.00</td><td>83.61</td></tr><tr><td>16</td><td>128</td><td>60.58</td><td>86.50</td><td>85.30</td></tr><tr><td>16</td><td>256</td><td>62.02</td><td>87.75</td><td>84.85</td></tr><tr><td>16</td><td>512</td><td>61.30</td><td>87.08</td><td>85.38</td></tr><tr><td>16</td><td>1024</td><td>60.65</td><td>86.16</td><td>84.61</td></tr><tr><td>16</td><td>2048</td><td>61.83</td><td>87.66</td><td>85.11</td></tr><tr><td>4</td><td>4</td><td>60.19</td><td>88.00</td><td>84.66</td></tr><tr><td>16</td><td>16</td><td>56.86</td><td>88.75</td><td>82.71</td></tr><tr><td>64</td><td>64</td><td>57.45</td><td>84.58</td><td>82.68</td></tr><tr><td colspan="5">pretraining dataset:TV</td></tr><tr><td>k</td><td>w</td><td>HMDB51</td><td>ESC50</td><td>UCF101</td></tr><tr><td>1</td><td>1</td><td>56.40</td><td>85.50</td><td>84.37</td></tr><tr><td>8</td><td>Mn</td><td>61.50</td><td>87.50</td><td>85.96</td></tr><tr><td>16</td><td>Mn</td><td>61.69</td><td>89.00</td><td>85.64</td></tr><tr><td>8</td><td>64</td><td>60.58</td><td>88.00</td><td>85.96</td></tr><tr><td>8</td><td>128</td><td>60.00</td><td>85.66</td><td>85.77</td></tr><tr><td>16</td><td>256</td><td>61.30</td><td>86.41</td><td>85.01</td></tr></table>
|
| 256 |
+
|
| 257 |
+
Movies vs. TV Shows. To confirm that our sampling policy behaves consistently across both movies and TV shows, Figure 1d illustrates the discrepancy measures computed on TV dataset. We observe similar effectiveness when using $k$ and $w$ as tuning nobs for reducing either ${ \mathsf { K L } } ( S ^ { - } \parallel S ^ { \neq } )$ or the gap between ${ \mathsf { K L } } ( S ^ { - } \parallel S ^ { + } )$ and $\mathsf { K L } ( S ^ { \neq } \parallel S ^ { + } )$ . Table 1 demonstrates that different variants of our approach significantly outperform the baseline, i.e. $k = 1$ . We attribute the larger gains achieved when using TV instead of Movie dataset to the fact that content diversity is naturally lower when pretraining on TV shows since each one includes many episodes that all are characterized with the same content-exclusive artifacts.
|
| 258 |
+
|
| 259 |
+
Color jitter. We have established so far that commonalities which persist throughout the duration of a long-form content, things likely associated with color pallet, frequent appearance of the main character’s face and voice, and repetitive scenes can be exploited for learning better representations. That is, one may naturally assume that employing data augmentation techniques like color jitter should be helpful since by distorting content-exclusive visual artifacts, color jitter is expected to reduce ${ \mathsf { K L } } ( S ^ { - } \parallel S ^ { \neq } )$ . Figure 2 illustrates the effect of color jitter, where brightness, contrast, and saturation jitter values are chosen uniformly from $\mathtt { [ m a x ( 0 , 1 - \sigma ) , 1 + \sigma ] }$ . We observe that color jitter reduces the discrepancy measures for the baseline but not as much as it can be obtained by our proposed sampling policy $( k > 1 )$ ), and even then according to Table 2 only yields a slight gain on downstream tasks.
|
| 260 |
+
|
| 261 |
+
$\ell _ { 2 }$ -normalized feature space. The common practice [2, 31, 39, 7] is to compute contrastive loss in $\ell _ { 2 }$ -normalized feature space, where according to [47] the temperature hyper-parameter, $\tau$ , controls the strength of penalties on hard negative samples. We explored this with two widely-used $\tau$ values. From Table 2, we observe that compared to operating in an unnormalized embedding space, adopting such design choice results in a large performance drop on HMDB51[23] while other downstream benchmarks see only negligible gains.
|
| 262 |
+
|
| 263 |
+
Table 4: Effect of self-supervised learning from curated versus uncurated data on different downstream tasks. The “years” column indicates the duration of the pretraining datasets in years.
|
| 264 |
+
|
| 265 |
+
<table><tr><td>method</td><td>pretraining dataset</td><td>uncurated</td><td>years</td><td>HMDB51</td><td>ESC50</td><td>UCF101</td></tr><tr><td>Ours</td><td>Movie</td><td></td><td>0.7</td><td>62.9</td><td>88.3</td><td>86.3</td></tr><tr><td>Ours</td><td>TV</td><td></td><td>0.7</td><td>61.7</td><td>89.0</td><td>85.6</td></tr><tr><td>XDC[3]</td><td>IG-Random16M</td><td>√</td><td>5</td><td>55.2</td><td>84.3</td><td>84.1</td></tr><tr><td>XDC[3]</td><td>IG-Random65M</td><td>√</td><td>21</td><td>61.2</td><td>86.3</td><td>88.8</td></tr><tr><td>XDC[3]</td><td>IG-Kinetics16M</td><td>×</td><td>5</td><td>57.3</td><td>82.5</td><td>87.6</td></tr><tr><td>XDC[3]</td><td>IG-Kinetics65M</td><td>×</td><td>21</td><td>63.1</td><td>84.8</td><td>91.5</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Curated vs. Uncurated data. To the best of our knowledge, the only other uncurated dataset used for audio-visual self-supervised learning is IGRandom[3]8. Table 4 confirms that learning from uncurated movies and TV shows is extremely effective. Our results significantly exceed those of XDC[3] obtained on IG-Random16M despite using a simpler model and 7 times smaller volume of pretraining data. Even in comparison to IG-Random65M with 30 times larger data, we obtain better performances on 2 out of 3 benchmarks. The most promising of our findings though is how competitive our results are against XDC[3] when it is trained on variants of IG-Kinetics which are not only curated but also orders of magnitude larger. With all that, we confidently reject the notion that audio-visual self-supervised learning from uncurated data considerably lags behind utilizing large-scale curated datasets.
|
| 268 |
+
|
| 269 |
+
Effect of genre. The distribution of genre among movies used in our pretraining is the closest we have to taxonomy in the curated datasets. So, it is worth examining the quality of our learned representations under various genre distributions. To do so, given a fixed pretraining budget $( N = 1 . 6 \mathsf { K } )$ , we compare four different scenarios where movies used in the pretraining are distributed i) non-uniformly over all genres except Drama, and Comedies, ii) non-uniformly over Drama, and Comedies, iii) uniformly over all genres, and iv) non-uniformly over all genres. Table 3 confirms that indeed there is very little difference between the aforementioned setups when it comes to transfer learning to the downstream tasks.
|
| 270 |
+
|
| 271 |
+
Table 2: Effect of color jitter $( \sigma )$ and computing contrastive loss in $\ell _ { 2 }$ -normalized embedding space with temperature hyper-parameter $( \tau )$ on different downstream tasks.
|
| 272 |
+
|
| 273 |
+
<table><tr><td>k</td><td>0</td><td>HMDB51</td><td>ESC50</td><td>UCF101</td></tr><tr><td>1</td><td>0.0</td><td>60.32</td><td>86.50</td><td>85.69</td></tr><tr><td>16</td><td>0.0</td><td>62.92</td><td>88.33</td><td>86.30</td></tr><tr><td>1</td><td>1.0</td><td>60.45</td><td>87.66</td><td>84.82</td></tr><tr><td>16</td><td>0.5</td><td>60.13</td><td>87.75</td><td>85.98</td></tr><tr><td>16</td><td>1.0</td><td>61.11</td><td>88.33</td><td>85.93</td></tr><tr><td>k</td><td>T</td><td>HMDB51</td><td>ESC50</td><td>UCF101</td></tr><tr><td>16</td><td>0.07</td><td>60.78</td><td>87.08</td><td>86.86</td></tr><tr><td>16</td><td>0.30</td><td>60.78</td><td>89.25</td><td>85.72</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 3: Effect of genre distribution in Movie dataset on different downstream tasks. Experiments are conducted with input spatial resolution of $1 1 2 \times 1 1 2$ pixels.
|
| 276 |
+
|
| 277 |
+
<table><tr><td>setting</td><td>HMDB51</td><td>ESC50</td><td>UCF101</td></tr><tr><td>i</td><td>57.58</td><td>86.50</td><td>82.44</td></tr><tr><td>ii</td><td>56.99</td><td>85.50</td><td>82.39</td></tr><tr><td>i</td><td>56.27</td><td>85.25</td><td>82.87</td></tr><tr><td>iv</td><td>56.40</td><td>86.75</td><td>83.24</td></tr></table>
|
| 278 |
+
|
| 279 |
+
# 4.3 Comparison with state-of-the-art
|
| 280 |
+
|
| 281 |
+
Table 5 compares our proposed approach of learning from Movies and TV shows against the best performing audio-visual self-supervised learning methods. In general, our numbers are comparable with the best existing results reported in the literature, even with much less data and considerably simpler model/training procedure9. It is interesting that training on Movie dataset alone obtains
|
| 282 |
+
|
| 283 |
+
Table 5: Comparison with state-of-the-art. Dataset abbreviations: AudioSet[11], HowTo100M[28], IG-Kinetics65M [12]; their length in years is given in the “years” column. “Arch.” denotes the architecture of video backbone $( f )$ . [2]† indicates when the corresponding model use only audio and video, and not text modality. For a fair comparison, when using only Movie dataset, we train for twice as many epochs as our other variants in order to match their total number of gradient updates.
|
| 284 |
+
|
| 285 |
+
<table><tr><td>Method</td><td>Arch.</td><td>pretraining dataset</td><td>curated</td><td>years</td><td>HMDB51</td><td>UCF101</td><td>ESC50</td></tr><tr><td>GDT[39]</td><td>R(2+1)D-18</td><td>AS</td><td></td><td>1</td><td>66.1</td><td>92.5</td><td>88.5</td></tr><tr><td>GDT[39]</td><td>R(2+1)D-18</td><td>IG65M</td><td></td><td>21</td><td>72.8</td><td>95.2</td><td></td></tr><tr><td>XDC[3]</td><td>R(2+1)D-18</td><td>AS</td><td>√</td><td>1</td><td>61.0</td><td>91.2</td><td>84.8</td></tr><tr><td>XDC[3]</td><td>R(2+1)D-18</td><td>IG65M</td><td>√</td><td>21</td><td>67.4</td><td>94.2</td><td></td></tr><tr><td>AVTS[22]</td><td>MC3</td><td>AS</td><td></td><td>1</td><td>61.6</td><td>89.0</td><td>82.3</td></tr><tr><td>AVID[31]</td><td>R(2+1)D-18</td><td>AS</td><td></td><td>1</td><td>64.7</td><td>91.5</td><td>89.1</td></tr><tr><td>MMV[2]+</td><td>R(2+1)D-18</td><td>AS</td><td>√</td><td>1</td><td>70.1</td><td>91.5</td><td>85.6</td></tr><tr><td>MMV[2]+</td><td>S3D-G</td><td>AS</td><td>√</td><td>1</td><td>68.2</td><td>90.1</td><td>86.1</td></tr><tr><td>MMV[2]+</td><td>S3D-G</td><td>AS+HT</td><td>√</td><td>16</td><td>68.3</td><td>91.1</td><td>87.2</td></tr><tr><td>Ours (k=16)</td><td>R(2+1)D-18</td><td>Movie</td><td>X</td><td>0.7</td><td>64.5</td><td>87.9</td><td>88.8</td></tr><tr><td>Ours (k=8)</td><td>R(2+1)D-18</td><td>Movie+TV</td><td>X</td><td>1.4</td><td>65.0</td><td>87.7</td><td>89.1</td></tr><tr><td>Ours (k=16)</td><td>R(2+1)D-18</td><td>Movie+TV</td><td>X</td><td>1.4</td><td>65.1</td><td>88.5</td><td>89.1</td></tr><tr><td>Ours (k=32)</td><td>R(2+1)D-18</td><td>Movie+TV</td><td>X</td><td>1.4</td><td>65.6</td><td>88.7</td><td>88.2</td></tr></table>
|
| 286 |
+
|
| 287 |
+
358 comparable performance to the cases where both TV and Movie datasets are used for pretraining.
|
| 288 |
+
359 This further confirms the richness of the training data which movies and TV shows can provide
|
| 289 |
+
360 to self-supervised learning problems. We also see that increasing $k$ even beyond 8 gives further
|
| 290 |
+
361 incremental gains on action recognition benchmarks.
|
| 291 |
+
|
| 292 |
+
# 362 5 Conclusion
|
| 293 |
+
|
| 294 |
+
363
|
| 295 |
+
364
|
| 296 |
+
365
|
| 297 |
+
366
|
| 298 |
+
367
|
| 299 |
+
368
|
| 300 |
+
369
|
| 301 |
+
370
|
| 302 |
+
371
|
| 303 |
+
372
|
| 304 |
+
373
|
| 305 |
+
|
| 306 |
+
Despite its amazing recent progress, state-of-the-art self-supervised learning still heavily relies on supervised, i.e. curated, large-scale datasets for pretraining. In this work, we have shown that pretraining solely on uncurated data in forms of movies and TV shows, even at a comparatively small scale, can give rise to representations which are capable of competing with the state-of-theart of more complex architectures trained on larger curated datasets. This comes contrary to the current literature which tends to suggest that learning from uncurated data largely falls behind the use of curated alternatives. We intentionally made design decisions to keep our approach and training strategy as simple as possible to demonstrate that learning decently powerful audio-visual representations does not necessarily require gigantic data and compute resources. Through extensive set of experiments, our work establishes for the first time the efficacy of self-supervised learning of audio-visual representations from movies and TV shows.
|
| 307 |
+
|
| 308 |
+
# 374 6 Broader impact
|
| 309 |
+
|
| 310 |
+
Potential benefits. Our work shows that competitive multimodal representations can be learned from a comparatively small volume of uncurated data in the form of movies and TV shows. Besides minimizing any sort of human-involvement, which we believe must have already been paid an extra attention to in the literature, our work demonstrates that one does not require gigantic data and compute resources for effective self-supervised pretraining. Such results promise a more democratized research arena where smaller groups are not alienated due lack of sufficient compute resources. More importantly, lowering the compute requirements naturally reduces any environmental effects which training these models can potentially have.
|
| 311 |
+
|
| 312 |
+
Potential risks. Any machine learning method is susceptible to the potential underlying biases in the data. This is more important for self-supervised methods that deal with huge volumes, often not evaluated by diverse group of humans for any fairness concerns. The same is generally true in our case which requires us to make sure that titles that are included in training are diverse and inclusive.
|
| 313 |
+
|
| 314 |
+
387 References
|
| 315 |
+
388 [1] S. Abu-El-Haija, N. Kothari, J. Lee, P. Natsev, G. Toderici, B. Varadarajan, and S. Vijayanarasimhan.
|
| 316 |
+
389 Youtube-8m: A large-scale video classification benchmark. arXiv preprint arXiv:1609.08675, 2016.
|
| 317 |
+
390 [2] J.-B. Alayrac, A. Recasens, R. Schneider, R. Arandjelovic, J. Ramapuram, J. De Fauw, L. Smaira, ´
|
| 318 |
+
391 S. Dieleman, and A. Zisserman. Self-Supervised MultiModal Versatile Networks. In NeurIPS, 2020.
|
| 319 |
+
392 [3] H. Alwassel, D. Mahajan, B. Korbar, L. Torresani, B. Ghanem, and D. Tran. Self-supervised learning by
|
| 320 |
+
393 cross-modal audio-video clustering. In Advances in Neural Information Processing Systems, volume 33,
|
| 321 |
+
394 pages 9758–9770, 2020.
|
| 322 |
+
395 [4] R. Arandjelovic and A. Zisserman. Look, listen and learn. In Proceedings of the IEEE International
|
| 323 |
+
396 Conference on Computer Vision, pages 609–617, 2017.
|
| 324 |
+
397 [5] P. Bachman, R. D. Hjelm, and W. Buchwalter. Learning representations by maximizing mutual information
|
| 325 |
+
398 across views. In Advances in Neural Information Processing Systems, pages 15535–15545, 2019.
|
| 326 |
+
399 [6] J. Carreira and A. Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In
|
| 327 |
+
400 proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6299–6308,
|
| 328 |
+
401 2017.
|
| 329 |
+
402 [7] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual
|
| 330 |
+
403 representations. arXiv preprint arXiv:2002.05709, 2020.
|
| 331 |
+
404 [8] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. Hinton. Big self-supervised models are strong
|
| 332 |
+
405 semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020.
|
| 333 |
+
406 [9] C. Doersch, A. Gupta, and A. A. Efros. Unsupervised visual representation learning by context prediction.
|
| 334 |
+
407 In Proceedings of the IEEE international conference on computer vision, pages 1422–1430, 2015.
|
| 335 |
+
408 [10] B. Fernando, H. Bilen, E. Gavves, and S. Gould. Self-supervised video representation learning with
|
| 336 |
+
409 odd-one-out networks. In Proceedings of the IEEE conference on computer vision and pattern recognition,
|
| 337 |
+
410 pages 3636–3645, 2017.
|
| 338 |
+
411 [11] J. F. Gemmeke, D. P. Ellis, D. Freedman, A. Jansen, W. Lawrence, R. C. Moore, M. Plakal, and M. Ritter.
|
| 339 |
+
412 Audio set: An ontology and human-labeled dataset for audio events. In 2017 IEEE International Conference
|
| 340 |
+
413 on Acoustics, Speech and Signal Processing (ICASSP), pages 776–780. IEEE, 2017.
|
| 341 |
+
414 [12] D. Ghadiyaram, D. Tran, and D. Mahajan. Large-scale weakly-supervised pre-training for video action
|
| 342 |
+
415 recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages
|
| 343 |
+
416 12046–12055, 2019.
|
| 344 |
+
417 [13] S. Gidaris, P. Singh, and N. Komodakis. Unsupervised representation learning by predicting image
|
| 345 |
+
418 rotations. arXiv preprint arXiv:1803.07728, 2018.
|
| 346 |
+
419 [14] M. Gutmann and A. Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized
|
| 347 |
+
420 statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and
|
| 348 |
+
421 Statistics, pages 297–304, 2010.
|
| 349 |
+
422 [15] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation
|
| 350 |
+
423 learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages
|
| 351 |
+
424 9729–9738, 2020.
|
| 352 |
+
425 [16] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the
|
| 353 |
+
426 IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
|
| 354 |
+
427 [17] O. J. Hénaff, A. Srinivas, J. De Fauw, A. Razavi, C. Doersch, S. Eslami, and A. v. d. Oord. Data-efficient
|
| 355 |
+
428 image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019.
|
| 356 |
+
429 [18] R. D. Hjelm, A. Fedorov, S. Lavoie-Marchildon, K. Grewal, P. Bachman, A. Trischler, and Y. Bengio.
|
| 357 |
+
430 Learning deep representations by mutual information estimation and maximization. arXiv preprint
|
| 358 |
+
431 arXiv:1808.06670, 2018.
|
| 359 |
+
432 [19] S. Ioffe and C. Szegedy. Batch normalization: Accelerating deep network training by reducing internal
|
| 360 |
+
433 covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 361 |
+
434 [20] H. Kataoka, T. Wakamiya, K. Hara, and Y. Satoh. Would mega-scale datasets further enhance spatiotempo
|
| 362 |
+
435 ral 3d cnns? arXiv preprint arXiv:2004.04968, 2020.
|
| 363 |
+
|
| 364 |
+
36 [21] D. Kim, D. Cho, and I. S. Kweon. Self-supervised video representation learning with space-time cubic puzzles. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 8545–8552, 2019.
|
| 365 |
+
39 [22] B. Korbar, D. Tran, and L. Torresani. Cooperative learning of audio and video models from self-supervised synchronization. In Advances in Neural Information Processing Systems, pages 7763–7774, 2018. [23] H. Kuehne, H. Jhuang, E. Garrote, T. Poggio, and T. Serre. Hmdb: a large video database for human motion recognition. In 2011 International Conference on Computer Vision, pages 2556–2563. IEEE, 2011.
|
| 366 |
+
43 [24] Z. Lai and W. Xie. Self-supervised learning for video correspondence flow. arXiv preprint arXiv:1905.00875, 2019.
|
| 367 |
+
5 [25] H.-Y. Lee, J.-B. Huang, M. Singh, and M.-H. Yang. Unsupervised representation learning by sorting sequences. In Proceedings of the IEEE International Conference on Computer Vision, pages 667–676, 2017. [26] D. Mahajan, R. Girshick, V. Ramanathan, K. He, M. Paluri, Y. Li, A. Bharambe, and L. van der Maaten. Exploring the limits of weakly supervised pretraining. In Proceedings of the European Conference on Computer Vision (ECCV), pages 181–196, 2018. [27] A. Miech, J.-B. Alayrac, L. Smaira, I. Laptev, J. Sivic, and A. Zisserman. End-to-end learning of visual representations from uncurated instructional videos. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9879–9889, 2020. [28] A. Miech, D. Zhukov, J.-B. Alayrac, M. Tapaswi, I. Laptev, and J. Sivic. Howto100m: Learning a text-video embedding by watching hundred million narrated video clips. In Proceedings of the IEEE international conference on computer vision, pages 2630–2640, 2019. [29] I. Misra and L. v. d. Maaten. Self-supervised learning of pretext-invariant representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6707–6717, 2020. [30] I. Misra, C. L. Zitnick, and M. Hebert. Shuffle and learn: unsupervised learning using temporal order verification. In European Conference on Computer Vision, pages 527–544. Springer, 2016. [31] P. Morgado, N. Vasconcelos, and I. Misra. Audio-visual instance discrimination with cross-modal agreement. arXiv preprint arXiv:2004.12943, 2020.
|
| 368 |
+
63 [32] V. Nair and G. E. Hinton. Rectified linear units improve restricted boltzmann machines. In ICML, 2010.
|
| 369 |
+
4 [33] M. Noroozi and P. Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In European Conference on Computer Vision, pages 69–84. Springer, 2016.
|
| 370 |
+
6 [34] M. Noroozi, H. Pirsiavash, and P. Favaro. Representation learning by learning to count. In Proceedings of the IEEE International Conference on Computer Vision, pages 5898–5906, 2017.
|
| 371 |
+
68 [35] A. v. d. Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. [36] A. Owens and A. A. Efros. Audio-visual scene analysis with self-supervised multisensory features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 631–648, 2018. [37] A. Owens, J. Wu, J. H. McDermott, W. T. Freeman, and A. Torralba. Ambient sound provides supervision for visual learning. In European conference on computer vision, pages 801–816. Springer, 2016. [38] D. Pathak, P. Krahenbuhl, J. Donahue, T. Darrell, and A. A. Efros. Context encoders: Feature learning by inpainting. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2536–2544, 2016. [39] M. Patrick, Y. M. Asano, R. Fong, J. F. Henriques, G. Zweig, and A. Vedaldi. Multi-modal self-supervision from generalized data transformations. arXiv preprint arXiv:2003.04298, 2020. [40] K. J. Piczak. Esc: Dataset for environmental sound classification. In Proceedings of the 23rd ACM international conference on Multimedia, pages 1015–1018, 2015. [41] S. Purushwalkam and A. Gupta. Demystifying contrastive self-supervised learning: Invariances, augmentations and dataset biases. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 3407–3418, 2020.
|
| 372 |
+
[42] K. Soomro, A. R. Zamir, and M. Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012.
|
| 373 |
+
[43] C. Sun, A. Shrivastava, S. Singh, and A. Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In Proceedings of the IEEE international conference on computer vision, pages 843–852, 2017.
|
| 374 |
+
[44] Y. Tian, D. Krishnan, and P. Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019.
|
| 375 |
+
[45] D. Tran, H. Wang, L. Torresani, J. Ray, Y. LeCun, and M. Paluri. A closer look at spatiotemporal convolutions for action recognition. In Proceedings of the IEEE conference on Computer Vision and Pattern Recognition, pages 6450–6459, 2018.
|
| 376 |
+
[46] C. Vondrick, A. Shrivastava, A. Fathi, S. Guadarrama, and K. Murphy. Tracking emerges by colorizing videos. In Proceedings of the European conference on computer vision (ECCV), pages 391–408, 2018.
|
| 377 |
+
[47] F. Wang and H. Liu. Understanding the behaviour of contrastive loss. arXiv preprint arXiv:2012.09740, 2020.
|
| 378 |
+
[48] J. Wang, J. Jiao, L. Bao, S. He, Y. Liu, and W. Liu. Self-supervised spatio-temporal representation learning for videos by predicting motion and appearance statistics. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4006–4015, 2019.
|
| 379 |
+
[49] D. Xu, J. Xiao, Z. Zhao, J. Shao, D. Xie, and Y. Zhuang. Self-supervised spatiotemporal learning via video clip order prediction. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 10334–10343, 2019.
|
| 380 |
+
[50] R. Zhang, P. Isola, and A. A. Efros. Colorful image colorization. In European conference on computer vision, pages 649–666. Springer, 2016.
|
| 381 |
+
|
| 382 |
+
# Checklist
|
| 383 |
+
|
| 384 |
+
1. For all authors...
|
| 385 |
+
|
| 386 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 387 |
+
(b) Did you describe the limitations of your work? [Yes] Specifically, training data being proprietary creates concerns around reproducibility, which has precedence in the literature as mentioned in the paper. We address that partially by planning to publicly release pretrained models.
|
| 388 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes]
|
| 389 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 390 |
+
|
| 391 |
+
2. If you are including theoretical results...
|
| 392 |
+
|
| 393 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 394 |
+
|
| 395 |
+
3. If you ran experiments...
|
| 396 |
+
|
| 397 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] The data is proprietary. However, we have provided implementation of the proposed method in supplemental material and aim to publicly release the pretrained models.
|
| 398 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] They are all discussed in detail either in the main submission or in supplemental material.
|
| 399 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We only observed meaningful differences after running experiments multiple times, for ESC50[40] downstream experiments. Corresponding standard errors are reported in supplemental material.
|
| 400 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Please refer to Section 4.1.
|
| 401 |
+
|
| 402 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 403 |
+
|
| 404 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 405 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 406 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 407 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 408 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 409 |
+
|
| 410 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 411 |
+
|
| 412 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 413 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 414 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/9MdLwggYa02/9MdLwggYa02.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ROMUL: SCALE ADAPTATIVE POPULATION BASED TRAINING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In most pragmatic settings, data augmentation and regularization are essential, and require hyperparameter search. Population based training (PBT) is an effective tool for efficiently finding them as well as schedules over hyperparameters. In this paper, we compare existing PBT algorithms and contribute a new one: ROMUL, for RObust MULtistep search, which adapts its stepsize over the course of training. We report competitive results with standard models on CIFAR (image classification) as well as Penn Tree Bank (language modeling), which both depend on heavy regularization. We also open-source hoptim, a PBT library agnostic to the training framework, which is simple to use, reentrant, and provides good defaults with ROMUL.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Hyperparameter tuning is essential for good performance in most machine learning tasks, and poses numerous challenges. First, optimal hyperparameter values can change over the course of training (schedules), e.g. for learning rate, fine tuning phases, data augmentation. Hyperparameters values are also rarely independent from each other (e.g. the magnitude of individual data augmentations depends on the number of data augmentations applied), and the search space grows exponentially with the number of hyperparameters. All of that search has to be performed within a computational budget, and sometimes even within a wall-clock time budget (e.g. models that are frequently retrained on new data), requiring efficient parallelization. In practice, competitive existing methods range from random search (Bergstra & Bengio, 2012) to more advanced methods (that aim at being more compute-efficient) like sequential search (Bergstra et al., 2011; 2013; Li et al., 2018), population based training (PBT, e.g. Jaderberg et al. (2017); Ho et al. (2019)) and search structured by the space of the hyperparameters (Liu et al., 2018; Cubuk et al., 2019b).
|
| 12 |
+
|
| 13 |
+
A major drawback of advanced hyperparameter optimization methods is that they themselves require attention from the user to reliably outperform random search. In this work, we empirically study the different training dynamics of data augmentation and regularization hyperparameters across vision and language modeling tasks, in particular for multistep (sequential) hyperparameter search. A common failure mode (i) is due to hyperparameters that have a different effect on the validation loss in the short and long terms, for instance using a smaller dropout often leads to faster but worse convergence. Another common problem (ii) is that successful searches are constrained on adequate “hyper-hyperparameters” (such as value ranges or the search policy used, which in current methods are non-adaptative mutation steps). Our contributions can be summarized as follows:
|
| 14 |
+
|
| 15 |
+
• We present a robust algorithm for leveraging population based training for hyperparameter search: ROMUL (RObust MULtistep) search, which addresses (i) and (ii). We empirically study its benefits and limitations, and show that it provides good defaults that compare favorably to existing methods.
|
| 16 |
+
|
| 17 |
+
• We open-source hoptim, a simple library for sequential hyperparameter search, that provides multiple optimizers (including ROMUL), as well as toy benchmarks showcasing hyperparameter optimization problems we identified empirically and standard datasets.
|
| 18 |
+
|
| 19 |
+
# 2 HYPERPARAMETER OPTIMIZATION WITH POPULATION-BASED TRAINING
|
| 20 |
+
|
| 21 |
+
In this article, we refer to the family of algorithms that continuously tunes hyperparameters of a set of models over the course of their training as “PBT algorithms” or “PBT optimizers”. Hyperparameter optimization is thus a zero order optimization performed at a slower frequency than the (often first order, e.g. SGD) optimization of the model. A PBT step happens typically after a fixed number of epochs or updates of the model, often optimizing the loss from the validation set, continuing from an already produced “parent” checkpoint, and producing and evaluating a new checkpoint. At every PBT step, hyperparameters can be updated (mutated), incremented or decremented by some number (step size), or sampled.
|
| 22 |
+
|
| 23 |
+
There are multiple aspects to consider when designing a PBT algorithm. Technical constraints: how the optimization is distributed, with a centralized or decentralized algorithm, workers to run the trainings, how failed workers are handled. They are solved in a unified manner in the experiments we performed, by the hoptim library to implement and compare multiple algorithms. It is decoupled from the scheduling of the jobs and designed to accommodate adding more workers to scale up the training, or fewer when some are killed, for example through preemption or time-out on a shared cluster. Optimization method: how the hyper-parameters are modified throughout the training, for instance through mutations. Selection process: which individual of the population are kept, both in term of hyper-parameters and state of the neural network (checkpoint). For those last two points, some solutions are described below.
|
| 24 |
+
|
| 25 |
+
# 2.1 CHALLENGES
|
| 26 |
+
|
| 27 |
+
In order to have a clearer understanding of our proposed methods, we show below the main concerns we have observed in PBT:
|
| 28 |
+
|
| 29 |
+
Anisotropy: by definition, the optimal value of the hyperparameters considered is unknown, and oftentimes the range (or mutation scheme) provided to the algorithm is a loose estimate only. As modifying two hyperparameters with the same step size can produce effects with very different magnitudes, the user is required to to normalize the search space. But pre-tuning the hyperparameter tuner itself can be cumbersome as dynamics evolve during training. Section 3.1 provides an example based on the Rosenbrock function which illustrates this issue and highlights the interest of adaptative mutations.
|
| 30 |
+
|
| 31 |
+
Checkpoint vs. hyperparameters: comparing individuals in the population is extremely hard as improvements can be due to better hyperparameters, or better checkpoints (including potentially better batches). Better performance through better checkpoints is an optimization phenomenon (e.g. random restarts), that can bias the hyperparameter selection. We will detail this aspect in Section 4.2.
|
| 32 |
+
|
| 33 |
+
Short-term-long-term discordance: we observed empirically that hyperparameters which induce better performance in the short term are not always optimal in the longer term. This is a challenge that does not exist in classical static optimization, but is crucial for PBT since local minima are easy to reach and pose a danger for greedy algorithms. An example of such a parameter is the learning rate. Dropping the learning rate often induces a drop in the validation loss, even early in the training, and increasing it has the opposite effect, causing greedy PBT algorithms to reduce it to the minimum value too early, without being able to recover. We will detail this aspect in Section 4.1.
|
| 34 |
+
|
| 35 |
+
# 2.2 DIFFERENTIAL EVOLUTION AND ROMUL
|
| 36 |
+
|
| 37 |
+
Differential Evolution Storn & Price (1997) (DE) is a standard black-box optimization method, for minimizing $f : \mathbb { R } ^ { n } \mathbb { R }$ . It operates on a population $x ^ { i } \in \mathbb { R } ^ { n }$ for all $i \stackrel { \textstyle \dag } { \in } \{ 1 , . . . , M \}$ , $M \geq 4$ , and indefinitely repeats the following steps for each individual $x ^ { \mathrm { b a s e } }$ in the population to generate another individual called mutated vector that could replace $x ^ { \mathrm { b a s e } }$ if better:
|
| 38 |
+
|
| 39 |
+
1. given the best individual $x ^ { \mathrm { b e s t } }$ which minimizes $f$ in the population, as well as two randomly selected ones $x ^ { a }$ and $x ^ { b }$ , compute the donor $d$ , which will give part of its coefficients to the mutated vector. In the current-to-best/1 scheme we use, these are the base coefficients plus a term attracting to the best set of coefficients from the current population, and an additional random variation (a standard value for $F _ { i }$ is $F _ { 1 } = F _ { 2 } = 0 . 8$ ):
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
d = x ^ { \mathrm { b a s e } } + F _ { 1 } ( x ^ { \mathrm { b e s t } } - x ^ { \mathrm { b a s e } } ) + F _ { 2 } ( x ^ { b } - x ^ { a } )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
2. create the new mutated vector $\widetilde { x } ^ { b a s e }$ by randomly selecting each component $j \in \{ 1 , . . . , n \}$ of the base $x ^ { \mathrm { b a s e } }$ eor the donor $d$ through the binary crossover operator: $\begin{array} { r l } { \widetilde { x } _ { j } ^ { \mathrm { b a s e } } } & { { } = } \end{array}$ $\mathrm { C H O I C E } ( x _ { j } ^ { \mathrm { b a s e } } , d _ { j } )$ e. This non-linear operation lets the optimization leave the vector span of the population.
|
| 46 |
+
|
| 47 |
+
3. compute $f ( \widetilde { x } ^ { \mathrm { b a s e } } )$ and replace $x ^ { \mathrm { b a s e } }$ by $\widetilde { x } ^ { \mathrm { b a s e } }$ within the population if and only if $f ( \widetilde { x } ^ { \mathrm { b a s e } } ) \leq$ $f ( x ^ { \mathrm { b a s e } } )$ .
|
| 48 |
+
|
| 49 |
+
This method is interesting as it is already based on a population and adapts well to parameters with different dynamics while being simple and fully parallelizable. In particular, it does not rely on mutation ranges or step sizes - Equation 1 samples new parameters close to the current population, and as the population individuals go through selection this sampling is refined and becomes sharper around optimal values. In practice, if a parameter’s bounds are too loose or wrong, DE will eventually adapt after iterations of selection by removing individuals too far from the optimal value, and concentrate its computation budget on relevant values for this parameter.
|
| 50 |
+
|
| 51 |
+
In order to use it for PBT, the set of hyper-parameters is converted to a vector in $\mathbb { R } ^ { n }$ using nevergrad parametrization system (Rapin & Teytaud, 2018). However, this basic version of differential evolution (also implemented in nevergrad) is not adapted to PBT. Indeed the training function $f$ changes with the checkpoint as we are updating the parameters (not the hyperparameters) with a stochastic gradient from the task loss. The trend of $f$ is therefore typically downwards during the training, younger generations/later epochs tending to have a lower loss than their parents’, biasing the hyperperameter selection process in favor of those of the children (later steps of SGD updates) instead of in favor of better hyperparameters.
|
| 52 |
+
|
| 53 |
+
ROMUL We therefore propose an adaptation: a population of $n$ individuals is trained, after finishing their step, individuals are compared to the rest of the population. If they have one of the $n / k$ best loss (we use $k \ = \ 2$ throughout), the training continues without changing the hyperparameters, otherwise, the hyperparameters are mutated. If the hyperparameters of an individual are mutated $m$ times in a row (we use $m \ : = \ : 3$ throughout), its checkpoint is killed and replaced by one of the $n / k$ best individuals. The values of $k$ and $m$ are hyperparameters, although we did not vary them in any experiments: $k = 2$ allows to have, on average, one alternative (mutated) version to each of the ones we keep training without hyperparameter change, and $m = 3$ proved to be robust across our experiments, to select when to discard a checkpoint. If using lower $m$ values, one should consider increasing the number of epochs per PBT step to prevent culling checkpoints too early (see Section 4.1 and 4.2).
|
| 54 |
+
|
| 55 |
+
The mutation scheme is adapted to fit this use case. In Eq. 1, $x ^ { \mathrm { b a s e } }$ and $x ^ { \mathrm { b e s t } }$ are both replaced by a randomly selected set of hyperparameters $x ^ { \mathrm { { c } } }$ and $x ^ { \mathrm { d } }$ from the best $n / 2$ individuals (“rand-to-rand/1” scheme following (Storn & Price, 1997; Das & Suganthan, 2011) notations). Replacing $x ^ { \mathrm { b a s e } }$ aims at keeping the path through checkpoints unimodal, since keeping several modes with corresponding checkpoints is unnecessary. Replacing $x ^ { \mathrm { b e s t } }$ by any other ”good” (top $50 \%$ ) set of hyperparameters aims at avoiding early convergence, which we observed as one of the main problems during trainings. This also avoids a strong bias by a good checkpoint (more on this in 4.2). To avoid duplication of hyperparameters, we opt for making $F _ { 1 }$ and $F _ { 2 }$ random vectors instead of using the binary crossover non-linearity. In order to keep the initial scaling of DE, we chose ${ \bf F _ { 1 } } [ i ]$ uniformly distributed between 0 and $2 F$ (we use the common value for $F$ from vanilla DE: $F = 0 . 8$ ), and $\mathbf { F _ { 2 } } [ i ] = 2 F - \mathbf { F _ { 1 } } [ i ]$ , $\forall i$ . This ensures that the sum $\mathbf { F _ { 1 } } [ i ] + \mathbf { F _ { 2 } } [ i ] = 2 F $ $\forall i$ , as in vanilla DE. With $\odot$ the elementwise multiplication, this yields $d = x ^ { c } + \mathbf { \bar { F _ { 1 } } } \odot ( x ^ { d } - x ^ { c } ) + \mathbf { F _ { 2 } } \odot ( x ^ { b } - x ^ { a } )$ .
|
| 56 |
+
|
| 57 |
+
# 2.3 OTHER ALGORITHMS
|
| 58 |
+
|
| 59 |
+
In our experiments, we compare several algorithms briefly presented below. We aim to compare how effective they can be for practical use-cases of hyperparameter tuning, where the user does not want to tune the hyperparameters of its hyperparameter tuner, and desires meaningful defaults. The only input they take are the number of parallel trainings, the range of hyperparameters, and a hint for an initial value (e.g. the same value 0 for dropout values and data augmentation magnitudes).
|
| 60 |
+
|
| 61 |
+
Initiator PBT: We reimplemented Initiator Based Evolution, presented in Li et al. (2019). New hyper-parameters are sampled from parent hyper-parameters by adding/removing a mutation constant (for instance d $r o p o u t C h i l d = d r o p o u t P a r e n t \pm 0 . 1 )$ . A newly created checkpoint is compared to a randomly sampled checkpoint in the population: if the latter is better, the new checkpoint is discarded and the latter is forked with its hyperparameters - this ensures that only the best performing models remain eventually, and allows it to run asynchronously. For each parameter, we specify a range, and use $( h i - l o ) / 3 0$ as a mutation constant unless specified otherwise.
|
| 62 |
+
|
| 63 |
+
Truncation Selection: $N$ models are trained in parallel. Regularly, the $M$ worst performing models are stopped and replaced with clones of the $M$ bests, and hyperparameters are randomly perturbated. This scheme was first introduced in Jaderberg et al. (2017). In our experiments, we use $M = N / 4$ . For hyperparameter perturbation, we generalize the mutation scheme introduced in Ho et al. (2019): each parameter is sampled uniformly in its range $[ l o , h i ]$ with $20 \%$ probability, or incremented by random.choice([-3, -2, $^ { - 1 }$ , 0, 0, 1, 2, 3]) $\star$ (hi - lo) / 10 and then clipped to stay within $[ l o , h i ]$ .
|
| 64 |
+
|
| 65 |
+
ASHA: This is not a PBT algorithm, but a strong hyperparameter search algorithm that we compare to. In the Asynchronous Successive Halving Algorithm (ASHA, Li et al. (2018)), hyperparameters are sampled uniformly like in Random Search, but models are evaluated early and stopped if not in the top $1 / \eta$ percentile. For a given model, the first evaluation can happen after $1 , \eta , \eta ^ { 2 }$ , .. steps, making this algorithm robust to hyperparameters whose optimal value does not perform well until late in the training (Section 4.1). Unlike Initiator PBT or Truncation Selection, ASHA finds constant values for hyperparameters rather than schedules. We set the reduction factor $\eta$ to 3.
|
| 66 |
+
|
| 67 |
+
# 3 EXPERIMENTS
|
| 68 |
+
|
| 69 |
+
We ran experiments on a toy optimization problem (the Rosenbrock function), CIFAR, and Penn Tree Bank, all with the same ROMUL hyperparameters to test its robustness. Each of these experiments train in around 100 to 300 epochs, and we used 1 step per epoch, so that they all have similar time scales.
|
| 70 |
+
|
| 71 |
+
# 3.1 EXAMPLE ON A TOY OPTIMIZATION PROBLEM
|
| 72 |
+
|
| 73 |
+
Current PBT mutation schemes have fixed steps and therefore do not automatically adapt to the landscape of the optimized function. This means that they are not well-suited for anisotropic problems, which often arise in real life applications since some hyperparameters may be very important to tune finely, while other do not require the same precision. To highlight this issue, we experiment below on the Rosenbrock function: $\mathcal { R } _ { a , b } ( x , y ) = ( a - x ) ^ { 2 } + b ( y - x ^ { 2 } ) ^ { 2 }$
|
| 74 |
+
|
| 75 |
+
We will aim at minimizing $\mathcal { R } _ { 1 , 1 0 0 }$ through the surrogate $\mathcal { R } _ { \hat { a } , \hat { b } }$ , with $\hat { a }$ and $\hat { b }$ two hyperparameters handled with PBT. We initialize both parameters at 20 and bound them by -12.12 and 212.12 (using integers would be a special case since actual $a$ and $b$ values are integers). This experiment can be reproduced using the hoptim toolbox with the command: hop bench rosenbrock.
|
| 76 |
+
|
| 77 |
+
While standard PBT with random steps wastes mutations on $\hat { a }$ , DE is able to adapt its step-size to large steps on $\hat { a }$ until getting close, then smaller steps on $\hat { a }$ to tune $\hat { a }$ and $\hat { b }$ more finely. This is visible in Fig. 1a with ROMUL values of $\hat { a }$ converging quickly to around 1. The mutations then become sharper, while the ones for Initiator-PBT (small steps) are still too large and oscillate around the optimal value. Arguably, the mutation step could have been even smaller, but that would have slowed down the convergence, and these steps would be painful meta-parameters to tune at scale. Initiator-PBT with larger steps and Truncation selection are not displayed in this figure because their variations are too large.
|
| 78 |
+
|
| 79 |
+
The impact on the loss $\hat { \mathcal { R } }$ is then visible in Fig. 1b: Initiator PBT can’t decrease past 0.2 with large steps, and 0.048 with smaller steps, since it is trapped trying to optimize $\hat { a }$ while DE is able to reach better values. Fig. 1c and 1d show the trajectory of $( x , y )$ for Truncation selection and ROMUL, with the same number of training steps. Truncation selection is hampered by more random mutations. On the other hand, ROMUL is able to reach a much lower value after exhibiting a more chaotic behavior when it initially adapts to the scale of the problem. The trajectory for both versions of Initiator-PBT can be found in Fig. 2 of the appendix. Initiator-PBT with large steps (Fig. 2a) moves
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
|
| 85 |
+
(a) Rosenbrock parameter $\hat { a }$ with respect to the number of steps (optimal at 1). After ${ \approx } 5 0 $ steps, ROMUL’s distribution for $\hat { a }$ gets sharper around 1, Initiator always uses an hardcoded mutation step size.
|
| 86 |
+
|
| 87 |
+
(b) Loss $\mathcal { R } _ { 1 , 1 0 0 }$ with respect to the number of steps (lower is better, minimum value is 0). ROMUL keeps adapting and decreasing while other optimizers are locked to higher levels depending on their step sizes.
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 1: Training on the Rosenbrock benchmark. ROMUL outperforms initiator and truncation selection because it can adapt its step size. Bottom plots: Trajectories of 100 PBT training steps (16 jobs per step) on the Rosenbrock function with $a = 1$ and $b = 1 0 0$ (minimum at the red cross $( 1 , 1 )$ , trajectories go from blue to green)
|
| 91 |
+
|
| 92 |
+
very slowly to the minimum because of big extra oscillations. With smaller steps (Fig. 2b), it reaches better values through a slow and non-direct path. Tab. 3 in the appendix provides quantitative results by averaging over 20 runs, including a version of Initiator PBT in which updates are performed through multiplications by 0.8 or 1.2. In particular, ROMUL performs statically better than all over optimizers on this testbed $( p \textless 1 . 1 e \_ 5$ with a two sample Welch’s t-test). In Fig. 3 in Appendix, we also show the behavior with more variables by performing optimization on an average of Rosenbrocks functions, each with independent $a$ and $b$ variable to be estimated by PBT. Overall ROMUL performs consistently well across the board for a wide range of number of variables.
|
| 93 |
+
|
| 94 |
+
# 3.2 APPLICATION TO CIFAR (IMAGE CLASSIFICATION)
|
| 95 |
+
|
| 96 |
+
In this section, we compare various algorithms for tuning hyperparameters for image classification on CIFAR (Krizhevsky et al., 2009). We reproduce the population based augmentation (PBA) setup from (Ho et al., 2019) with their original implementation. Our algorithms train a Wide-ResNet-28- 10 model on Reduced CIFAR-10 (using $10 \%$ , i.e. 4000 images, of the training set for actual training, and the remainder as a validation set), and optimize the same 60 hyperparameters as in Ho et al. (2019): 2 magnitudes and 2 probabilities for each of the 15 possible data augmentations. For each algorithm, we take the best model in the validation set at epoch 200, and use its hyperparameters schedules to train another Wide-ResNet-28-10 model on CIFAR-10 and CIFAR-100 and finally report test accuracies at epoch 200 in Table 1. Trainings can be reproduced with the hoptim package and its benchmarking counterpart hoptim benchmarks in the cifar folder. ROMUL recovers most of the gains on CIFAR-10 $2 . 8 \%$ error vs. $2 . 6 \%$ for the SOTA and $3 . 9 \%$ for the baseline), and is a bit further away on CIFAR-100 ( $1 7 . 1 \%$ vs. $1 6 . 7 \%$ for the SOTA and $1 8 . 8 \%$ for the baseline). PBA, which yields state-of-the-art results on CIFAR, used Truncation selection PBT introduced in (Jaderberg et al., 2017), which we implemented and compared to. We adopted all the PBA hyperparameters and observe $2 . 7 \%$ on CIFAR-10 (ROMUL: $2 . 8 \%$ ) and $1 7 . 7 \%$ on CIFAR-100 (ROMUL: $1 7 . 1 \%$ ). The differences in the job and population management in hoptim may explain the difference between our implementation and theirs, which is particularly marked on the training set reduced CIFAR-10: $12 . 8 \%$ for their vs. $1 3 . 9 \%$ for our implementation.
|
| 97 |
+
|
| 98 |
+
Table 1: Classification error (lower is better) on CIFAR-10 and CIFAR-100 test sets for a WideResNet-28-10 (36M params). The algorithms run with 16 workers in parallel with the same compute budget (except when stated otherwise) on reduced CIFAR-10. After that, the schedule found is used for training the same model from scratch on CIFAR-10 and CIFAR-100
|
| 99 |
+
|
| 100 |
+
<table><tr><td>Algorithm</td><td>Reduced CIFAR-10 (10%)</td><td>CIFAR-10</td><td>CIFAR-100</td></tr><tr><td>Baseline:Wide-ResNet-28-10</td><td>n/a</td><td>3.9</td><td>18.8</td></tr><tr><td>RandAugment (Cubuk et al., 2019b)</td><td>n/a</td><td>2.7</td><td>16.7</td></tr><tr><td>PBA (3 epochs/step) (Ho et al., 2019)</td><td>12.8</td><td>2.6</td><td>16.7</td></tr><tr><td>ASHA</td><td>14.7</td><td>2.8</td><td>17.6</td></tr><tr><td>ASHA (running for double the time)</td><td>14.1</td><td>2.7</td><td>17.2</td></tr><tr><td>Truncation Selection (PBA, ours)</td><td>13.9</td><td>2.7</td><td>17.7</td></tr><tr><td>Initiator PBT (Li et al. (2019), ours)</td><td>14.7</td><td>2.9</td><td>17.9</td></tr><tr><td>ROMUL</td><td>14.0</td><td>2.8</td><td>17.1</td></tr></table>
|
| 101 |
+
|
| 102 |
+
As PBA waits for more than 1 epoch/step to evaluate a set of hyperparameters, we compared 1 epoch/step and 3 epochs/step (their setting), as it could help thwarting short-term/long-term discrepancy effects (see 4.1) and noise as explained above, but we could not identify a sufficiently generic scheme for all applications. In general, this is part of the PBT hyperparameters that are tuned in PBA, that we try to completely remove as hyperparameters in ROMUL, by being insensitive to it (in this case it does not seem to affect Truncation Selection either). For this hyperparameter, the constraint is to do PBT steps slow enough so that the number of updates is sufficiently large for the model to adapt to new mutated hyperparameters, and high enough so that PBT has enough steps to optimize the hyperparameters. In practice, trainings are long enough (regarding the number of SGD updates of the model) for a wide range of PBT steps frequencies to work.
|
| 103 |
+
|
| 104 |
+
# 3.3 APPLICATION TO THE PENN TREEBANK DATASET (LANGUAGE MODELING)
|
| 105 |
+
|
| 106 |
+
We experiment with the TransformerXL model (Dai et al., 2019) on the PTB dataset (Marcus, 1993). TranformerXL’s code is open-source and is the state-of-the-art for tranformer models on this dataset when using proper regularization, making it an interesting challenge for PBT. It comes with several dropout hyperparameters: we search for optimal values for five different dropout hyperparameters, that we describe in Table 4 in appendix. They are all initialized to 0 with standard deviation of 0.1 for ROMUL (negative values are reflected to positive values), hence not at the baseline values.
|
| 107 |
+
|
| 108 |
+
Results are reported in Table 2. Trainings can be reproduced (up to random variance) with the hoptim package and its benchmarking counterpart hoptim benchmarks in the ptb folder. The baseline TransformerXL was obtained with the author’s code and is close to the one reported in the initial paper. Noticeably, ASHA and Random Search (with a uniform prior) are not able to come close to the baseline, with more than 4 points difference in both validation and test perplexity (PPL). Truncation selection and Initiator PBT on the other hand are able to reach the baseline although they were not able to excel it in test perplexity. Only ROMUL is able to reach (marginally) better results than the reproduced baseline in test PPL with both 16 and 32 workers. A found dropout schedule is displayed in the appendix (Fig. 4) and show dropouts rapidly increasing in the beginning and stabilizing to different levels. Using 16 and 32 workers provided similar results up to noise for ROMUL (in this very case, 32 workers does not actually perform better than with 16 workers).
|
| 109 |
+
|
| 110 |
+
However, using 8 workers results in a notable drop in performance for all optimizers (Test PPL ROMUL 56.39, TruncSel 57.98, Initiator 56.33).
|
| 111 |
+
|
| 112 |
+
Table 2: Perplexity (lower is better) on PTB for a Transformer-XL with 16 layers and 24M parameters, best validation PPL before iteration 175 and corresponding test PPL, given the resources needed these values are not averaged, numbers excelling our training baseline are in bold.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>Training</td><td>workers</td><td>Validation PPL</td><td>Test PPL</td></tr><tr><td>TransformerXL SOTA (Dai et al. (2019))</td><td>1</td><td>/</td><td>54.52</td></tr><tr><td>TransformerXL SOTA (our training, their code)</td><td>1</td><td>59.65</td><td>55.43</td></tr><tr><td>ASHA</td><td>16</td><td>63.20</td><td>58.35</td></tr><tr><td>Truncation Selection PBT</td><td>16</td><td>60.24</td><td>57.29</td></tr><tr><td>Initiator PBT</td><td>16</td><td>59.42</td><td>55.80</td></tr><tr><td>ROMULPBT</td><td>16</td><td>57.83</td><td>55.16</td></tr><tr><td>Random Search</td><td>32</td><td>63.84</td><td>60.90</td></tr><tr><td>ASHA</td><td>32</td><td>64.31</td><td>61.63</td></tr><tr><td>Truncation Selection PBT</td><td>32</td><td>58.45</td><td>55.93</td></tr><tr><td>Initiator PBT</td><td>32</td><td>59.36</td><td>55.73</td></tr><tr><td>ROMUL PBT</td><td>32</td><td>58.63</td><td>55.28</td></tr></table>
|
| 115 |
+
|
| 116 |
+
# 4 DISCUSSION
|
| 117 |
+
|
| 118 |
+
# 4.1 SHORT TERM - LONG TERM DISCORDANCE
|
| 119 |
+
|
| 120 |
+
We have observed on PTB and other applications that some hyperparameters were never contributing positively to the model’s performance in the short term (eg: 1 step) but could become better on a longer term (eg: 5 steps or more), hence checkpoints need time to adapt to a new parameter set (e.g.: building more redundancy). In an experiment on PTB, we used one epoch per step for half the training and then modified it to 10 epochs per step. We observed that increasing one of the dropout contributed negatively for small steps (1 epoch), but positively for long steps (10th epochs). This is a major roadblock for PBT-based approaches since two models with different hyperparameters can’t be straightforwardly compared at every step, but only after an unknown delay. This is partially handled by being conservative on models to keep: keeping the best $50 \%$ unchanged in ROMUL, or the random tournament scheme that allows bad models to continue in Initiator PBT when assigned an even worse opponent. Fig. 5 in appendix shows such an example in another domain: a large dropout seems very detrimental early on, but very beneficial in the longer term. While this is expected for regularizations, we observe that a straightforward schedule increasing the dropout in steps (in red) is not able to compensate this - we observed the same effect with a continuous schedule. This behavior adds complexity to the task of PBT algorithms, because bad early choices can’t be compensated later. Arguably, it can be due to interactions with the learning rate scheduler used and a more appropriate schedule could help solve this issue (although it is not clear what such a schedule should be).
|
| 121 |
+
|
| 122 |
+
# 4.2 CHECKPOINTS VS HYPERPARAMETERS - SELECTION BIASES
|
| 123 |
+
|
| 124 |
+
For PBT optimizers, one critical question is how much of the loss difference between two individuals is caused by different hyperparameters, and how much about different checkpoints. Both contributions are tightly entwined making it harder to identify which hyperparameters are best.
|
| 125 |
+
|
| 126 |
+
A naive initial option to counter this is to always start a PBT step from the best checkpoint in the population. In our experiments this performed worse, at least because of the noise in the evaluation metric, but also because of the short-term long-term discrepancy detailed above (Section 4.1). We also expect that doing so could make optimizers less robust by getting trapped in local minima too easily, or aggressively discarding more promising models in the longer term.
|
| 127 |
+
|
| 128 |
+
On the opposite side of the spectrum, we experimented with never culling checkpoints, effectively performing $n$ full trainings in parallel. Conceptually, keeping checkpoints is attractive since it should add robustness to the optimizer: selected hyperparameters have to work well for more than one particular checkpoint. Indeed, this way the performance can be attributed to actual parameter schedules fitting different trainings, instead of being biased by checkpoints culling/random restarts. It also adds more variability which could be beneficial especially with respect to the short-term long-term discrepancy. That being said, we have neither observed significant improvement nor deterioration when keeping checkpoints, as long as the mutation schemes were not biased towards the best set of hyperparameters (e.g.: removing the $x ^ { \mathrm { b e s t } }$ term in Eq. 1), because doing so can make all hyperparameters converge towards the best checkpoint, making the optimization process early converge to values which are not necessarily adapted to other checkpoints.
|
| 129 |
+
|
| 130 |
+
Still, even with ROMUL’s loss-agnostic mutation scheme, some checkpoints were observed to fall behind and waste resources if not culled, so we expect that a trade-off like the one we implemented (killing checkpoints after 3 failed mutations in a row) is necessary.
|
| 131 |
+
|
| 132 |
+
Another source of selection bias is noise. While the trainings are well behaved in PTB because the shuffling of the training set is synchronized by epoch, the trainings in CIFAR are much noisier because of the randomness introduced by data augmentation and the very small training set size. PBT optimizers based on more noise-robust blackbox optimization methods could be beneficial, but it is not clear how to adapt them.
|
| 133 |
+
|
| 134 |
+
# 5 RELATED WORK
|
| 135 |
+
|
| 136 |
+
Several families of methods exist for tuning hyperparameters of neural networks. Methods closest to grid search like random search (Bergstra & Bengio, 2012) and ASHA (Li et al., 2018) are based on minimal constraints and can be parallelized extensively. Methods striving for more data-efficient search (Bergstra et al., 2011; 2013; Feurer & Hutter, 2019) are more sequential in nature, requiring convergence of some trainings before launching new ones. Population-based training approaches (Jaderberg et al., 2017; Ho et al., 2019; Li et al., 2019) loosen the requirements of training different models, as hyperparameters are changed on-the-fly during training, which also makes the search for schedules easier and less structured, i.e. not based on a predefined function.
|
| 137 |
+
|
| 138 |
+
Recent advances in automatic discovery of data augmentation policies include Population Based Augmentation (Ho et al., 2019) which we compared to in this paper (denoted Truncation Selection). Another line of work on structuring the hyperparameter space for data augmentation policy search is AutoAugment (Cubuk et al., 2019a), FastAutoAugment Lim et al. (2019) and RandAugment Cubuk et al. (2019b), the later being faster and reaching top performance on CIFAR.
|
| 139 |
+
|
| 140 |
+
PBT is used successfully in reinforcement learning (Jaderberg et al., 2017), providing diversity in self-play and progressive difficulty, so other experimental comparisons that we did include Initiator PBT from (Li et al., 2019), which presented a generic PBT setup that inspired hoptim. For nonPBT baselines we used random search (Bergstra & Bengio, 2012), and ASHA (Li et al., 2018), which is an update on HyperBand (Li et al., 2017).
|
| 141 |
+
|
| 142 |
+
# 6 CONCLUSION
|
| 143 |
+
|
| 144 |
+
We introduced ROMUL, a robust PBT algorithm that we benchmarked on standard datasets with multiple regularization and data augmentation hyperparameters. Its main strength comes from its robustness to hyperparameters definitions by automatically adapting to the scale of each parameter. Although it did not show better performance on CIFAR than PBA – that was tuned for this benchmark – we demonstrated that it is more robust to domain changes. More importantly for the practical use-cases, it constitutes a good default that does not require extensive tuning to work well. We open-sourced its implementation as well as a simple and broadly compatible PBT library.
|
| 145 |
+
|
| 146 |
+
The main difficulties we observed for PBT-based optimizers came from short-term vs. long-term effects: parameters can have a positive impact in the short term but a negative one in the longer term which may not be rectifiable. Learning rate falls in this category, since decreasing it often provides quick gains at the risk of being trapped in a local minimum. Studying how to deal with such behaviors is in our opinion the main challenge of future work.
|
| 147 |
+
|
| 148 |
+
# REFERENCES
|
| 149 |
+
|
| 150 |
+
James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. The Journal of Machine Learning Research, 13(1):281–305, 2012.
|
| 151 |
+
|
| 152 |
+
James Bergstra, Dan Yamins, and David D Cox. Hyperopt: A python library for optimizing the hyperparameters of machine learning algorithms. In Proceedings of the 12th Python in science conference, volume 13, pp. 20. Citeseer, 2013.
|
| 153 |
+
|
| 154 |
+
James S Bergstra, Remi Bardenet, Yoshua Bengio, and Bal ´ azs K ´ egl. Algorithms for hyper-parameter ´ optimization. In Advances in neural information processing systems, pp. 2546–2554, 2011.
|
| 155 |
+
|
| 156 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. Autoaugment: Learning augmentation strategies from data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 113–123, 2019a.
|
| 157 |
+
|
| 158 |
+
Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. arXiv preprint arXiv:1909.13719, 2019b.
|
| 159 |
+
|
| 160 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context. arXiv:1901.02860 [cs, stat], June 2019.
|
| 161 |
+
|
| 162 |
+
Swagatam Das and Ponnuthurai Nagaratnam Suganthan. Differential Evolution: A Survey of the State-of-the-Art. IEEE Transactions on Evolutionary Computation, 15(1):4–31, February 2011. ISSN 1089-778X, 1941-0026. doi: 10.1109/TEVC.2010.2059031.
|
| 163 |
+
|
| 164 |
+
Angela Fan, Edouard Grave, and Armand Joulin. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019.
|
| 165 |
+
|
| 166 |
+
Matthias Feurer and Frank Hutter. Hyperparameter optimization. In Automated Machine Learning, pp. 3–33. Springer, Cham, 2019.
|
| 167 |
+
|
| 168 |
+
Daniel Ho, Eric Liang, Ion Stoica, Pieter Abbeel, and Xi Chen. Population based augmentation: Efficient learning of augmentation policy schedules. arXiv preprint arXiv:1905.05393, 2019.
|
| 169 |
+
|
| 170 |
+
Max Jaderberg, Valentin Dalibard, Simon Osindero, Wojciech M. Czarnecki, Jeff Donahue, Ali Razavi, Oriol Vinyals, Tim Green, Iain Dunning, Karen Simonyan, Chrisantha Fernando, and Koray Kavukcuoglu. Population Based Training of Neural Networks. arXiv:1711.09846 [cs], November 2017. arXiv: 1711.09846.
|
| 171 |
+
|
| 172 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 173 |
+
|
| 174 |
+
Ang Li, Ola Spyra, Sagi Perel, Valentin Dalibard, Max Jaderberg, Chenjie Gu, David Budden, Tim Harley, and Pramod Gupta. A generalized framework for population based training, 2019.
|
| 175 |
+
|
| 176 |
+
Liam Li, Kevin Jamieson, Afshin Rostamizadeh, Ekaterina Gonina, Moritz Hardt, Benjamin Recht, and Ameet Talwalkar. Massively parallel hyperparameter tuning. arXiv preprint arXiv:1810.05934, 2018.
|
| 177 |
+
|
| 178 |
+
Lisha Li, Kevin Jamieson, Giulia DeSalvo, Afshin Rostamizadeh, and Ameet Talwalkar. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research, 18(1):6765–6816, 2017.
|
| 179 |
+
|
| 180 |
+
Sungbin Lim, Ildoo Kim, Taesup Kim, Chiheon Kim, and Sungwoong Kim. Fast autoaugment. In Advances in Neural Information Processing Systems, pp. 6662–6672, 2019.
|
| 181 |
+
|
| 182 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018.
|
| 183 |
+
|
| 184 |
+
Mitch Marcus. Building a Large Annotated Corpus of English: The Penn Treebank:. Technical report, Defense Technical Information Center, Fort Belvoir, VA, April 1993.
|
| 185 |
+
|
| 186 |
+
J. Rapin and O. Teytaud. Nevergrad - A gradient-free optimization platform. https://GitHub. com/FacebookResearch/Nevergrad, 2018.
|
| 187 |
+
|
| 188 |
+
Rainer Storn and Kenneth Price. Differential Evolution – A Simple and Efficient Heuristic for global Optimization over Continuous Spaces. Journal of Global Optimization, 11(4):341–359, December 1997. ISSN 1573-2916. doi: 10.1023/A:1008202821328.
|
| 189 |
+
|
| 190 |
+
A APPENDIX
|
| 191 |
+
|
| 192 |
+
A.1 ROSENBROCK EXPERIMENTS
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 2: Trajectories of 100 Initiator PBT training steps (16 jobs per step) on the Rosenbrock function with $a = 1$ and $b = 1 0 0$ (minimum at the red cross $( 1 , 1 )$ , trajectories go from blue to green)
|
| 196 |
+
|
| 197 |
+
<table><tr><td>Training</td><td>mean ( (log10)</td><td>std (log10)</td></tr><tr><td>Initiator (0.8/1.2 mult. steps)</td><td>-1.18</td><td>0.045</td></tr><tr><td>Initiator (big steps)</td><td>-0.707</td><td>0.069</td></tr><tr><td>Initiator (small steps)</td><td>-0.992</td><td>0.143</td></tr><tr><td>ROMUL</td><td>-2.101</td><td>0.678</td></tr><tr><td>Truncation Selection</td><td>-0.834</td><td>0.327</td></tr></table>
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Table 3: Final loss (in log10) mean and standard deviation for independent runs on the Rosenbrock testbed, computed over 20 runs (two-sample Welsh’s test provides $p < 1 . 1 e - 5$ when comparing each algorithm with ROMUL).
|
| 201 |
+
Figure 3: Score on the multi-variate Rosenbrock benchmark (explained in 3.1) over 20 experiments for each point. Lower is better, standard deviations are indicated. ROMUL performs well across the board for a wide range of number of variables, being surpassed only by Truncated selection in some regime $\mathbf { \bar { \rho } } n \in [ [ 8 \dots 1 \bar { 4 } ] ] ,$ ).
|
| 202 |
+
|
| 203 |
+
Table 4: The dropouts from Transformer-XL that we tune through PBT.
|
| 204 |
+
|
| 205 |
+
<table><tr><td>dropouta dropoute dropoutf dropouti dropouto</td><td>applied to multi-head attention layers to remove words from embedding layer applied to positionwise ff layers for input embedding vectors applied to the output (before the logit)</td></tr></table>
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 4: Dropout schedule of the best run of ROMUL 32 workers on PTB
|
| 209 |
+
|
| 210 |
+
A.2 LANGUAGE MODELING ON PENN TREE BANK
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 5: Lower dropout values are better early, but are outperformed by more strongly regularized models later (red, orange and blue lines) - here on wikitext103 with a 247M parameters language model from Fan et al. (2019) (Adaptive Inputs $^ +$ LayerDrop). PBT algorithms would tend to reduce dropout aggressively early on: after that, even if the dropout is increased later, the performance remains worse than training with a high dropout from the beginning (red line). Perhaps counterintuitively, this hints against increasing regularization over the course of the training - in the opposite, we observe that fine-tuning the model without dropout significatively improves test performance (purple line reaches 17.98 test perplexity) compared to the baseline (green: 18.42 test perplexity)
|
| 214 |
+
|
| 215 |
+
A.4 SLIDES FOR INTERNAL PRESENTATION
|
| 216 |
+
Table 5: Perplexity (lower is better) on PTB for a Transformer-XL with 16 layers and 24M parameters
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Training</td><td>Parallelism</td><td>Validation PPL</td><td>Test PPL</td></tr><tr><td>TransformerXL SOTA</td><td>1</td><td>59.65</td><td>55.43</td></tr><tr><td>ASHA</td><td>16</td><td>63.20</td><td>58.35</td></tr><tr><td>Truncation Selection PBT</td><td>16</td><td>60.24</td><td>57.29</td></tr><tr><td>Initiator PBT</td><td>16</td><td>59.42</td><td>55.80</td></tr><tr><td>ROMUL PBT</td><td>16</td><td>57.83</td><td>55.16</td></tr></table>
|
| 219 |
+
|
| 220 |
+
Table 6: Classification error (lower is better) on CIFAR-10 and CIFAR-100 test sets for a WideResNet-28-10 (36M params)
|
| 221 |
+
|
| 222 |
+
<table><tr><td>Algorithm</td><td>CIFAR-10</td><td>CIFAR-100</td></tr><tr><td>Baseline:Wide-ResNet-28-10</td><td>3.9</td><td>18.8</td></tr><tr><td>RandAugment (Cubuk et al., 2019b)</td><td>2.7</td><td>16.7</td></tr><tr><td>PBA (3 epochs/step) (Ho et al., 2019)</td><td>2.6</td><td>16.7</td></tr><tr><td>ASHA</td><td>2.8</td><td>17.6</td></tr><tr><td>Truncation Selection (PBA, ours)</td><td>2.7</td><td>17.7</td></tr><tr><td>Initiator PBT (Li et al. (2019), ours)</td><td>2.9</td><td>17.9</td></tr><tr><td>ROMUL</td><td>2.8</td><td>17.1</td></tr></table>
|
md/train/9QffERDO_rJ/9QffERDO_rJ.md
ADDED
|
@@ -0,0 +1,485 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Auxiliary Learning Induced Graph Convolutional Networks
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Graph convolutional networks (GCNs) have recently achieved great success in
|
| 11 |
+
2 many applications. However they suffer from an incomplete annotation problem
|
| 12 |
+
3 for complex graph-structured data. In this paper, we introduce a novel auxiliary
|
| 13 |
+
4 learning method for GCNs in a multi-task fashion, which can efficiently enrich the
|
| 14 |
+
5 data annotations. Specifically, both link prediction and label generation are used as
|
| 15 |
+
6 two auxiliary tasks to complement the primary task of node classification. These
|
| 16 |
+
7 two auxiliary tasks are jointly trained with the primary node classification task
|
| 17 |
+
8 via a graph meta-learning strategy. The experimental results demonstrate that the
|
| 18 |
+
9 proposed method consistently and significantly outperforms existing methods and
|
| 19 |
+
10 achieves state-of-the-art results on several benchmark citation network datasets.
|
| 20 |
+
|
| 21 |
+
# 11 1 Introduction
|
| 22 |
+
|
| 23 |
+
12 Graph-structured data is ubiquitous in real-world applications. However, general deep learning
|
| 24 |
+
13 methods, such as convolutional neural networks (CNNs), cannot adapt to graph-structured data
|
| 25 |
+
14 directly, because the nodes in a graph have different numbers of neighbors, which often lose the
|
| 26 |
+
15 ranking information. To handle the graph data effectively, graph convolutional networks (GCNs)
|
| 27 |
+
16 have recently been proposed and used in many applications such as biomolecular prediction [1] and
|
| 28 |
+
17 recommendation systems [2].
|
| 29 |
+
18 Previous methods focus on designing models that can extract information from both the graph
|
| 30 |
+
19 topology and node features. Specifically, existing GCN methods typically design different propagation
|
| 31 |
+
20 strategies [3, 4, 5] for each network layer and stack more network layers [6, 7, 8] to derive larger
|
| 32 |
+
21 receptive fields. However, the neighborhood aggregation is essentially a type of Laplacian smoothing
|
| 33 |
+
22 and stacking too many layers may result in over-smoothing [9]. These drawbacks of existing methods
|
| 34 |
+
23 limit further performance enhancement.
|
| 35 |
+
24 In this paper, we try to explore the bottleneck of node classification from another point of view, i.e.,
|
| 36 |
+
25 from the training data itself. As shown in Fig. 1, graph-structured data has different properties from
|
| 37 |
+
26 grid-like data such as an image. The most obvious difference is that the nodes in a graph are connected
|
| 38 |
+
27 by edges. This causes two main issues whien it comes to annotating graph-structured data, resulting in
|
| 39 |
+
28 that existing methods cannot fully leverage the graph-structured information. First, the edges in most
|
| 40 |
+
29 graph data for semi-supervised node classification are unweighted. This arbitrary edge indication
|
| 41 |
+
30 setting cannot effectively reflect the detailed graph structures. Besides, graph-structured data may be
|
| 42 |
+
31 contaminated with noisy edges. These noisy edges cannot represent the true pairwise relationships
|
| 43 |
+
32 between nodes. Second, using one-hot labels to train a graph-based model is inappropriate. One-hot
|
| 44 |
+
33 labels are widely used in various machine learning tasks, assigning a training sample to a single class.
|
| 45 |
+
34 However, nodes in a graph are connected; even nodes with different classes may have relations. In
|
| 46 |
+
35 this scenario, it is more suitable to use soft labels to assign a node to multiple classes, with different
|
| 47 |
+
36 probabilities indicating which class the node possibly belongs to.
|
| 48 |
+
37 To fully leverage the graph-structured
|
| 49 |
+
38 information for enhancing the node
|
| 50 |
+
39 classification performance of GCNs,
|
| 51 |
+
40 we introduce an auxiliary learning
|
| 52 |
+
41 scheme to the GCN framework in
|
| 53 |
+
42 a multi-task fashion. To this end,
|
| 54 |
+
43 we add two auxiliary tasks to enrich
|
| 55 |
+
44 the topology information of a graph
|
| 56 |
+
45 by softening the node labels and re
|
| 57 |
+
46 weighting the edges. Experimental
|
| 58 |
+
47 results show that our model achieves
|
| 59 |
+
48 state-of-the-art node classification per
|
| 60 |
+
49 formance on several benchmark cita
|
| 61 |
+
50 tion network datasets. Our contribu
|
| 62 |
+
51 tions are as follows:
|
| 63 |
+
52 (1) We propose two auxiliary tasks to capture more accurate graph information and enhance the
|
| 64 |
+
53 model performance. The auxiliary link prediction task ensures that the model captures more graph
|
| 65 |
+
54 topology information and generates probabilistic edges. The auxiliary label generation task softens
|
| 66 |
+
55 the one-hot labels and generates pseudo-labels for unlabeled nodes.
|
| 67 |
+
56 (2) The reconstructed edges and pseudo sudo labels derived via the two auxiliary tasks are iteratively
|
| 68 |
+
57 updated with a node classifier of the primary task based on a meta auxiliary learning strategy, resulting
|
| 69 |
+
8 in state-of-the-art node classification performance.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: The difference between image data and graphstructured data. The nodes in graph-structured data are connected. Further, in most graph data for the node classification task, edges are unweighted and noisy.
|
| 73 |
+
|
| 74 |
+
# 59 2 Related Work
|
| 75 |
+
|
| 76 |
+
Over the past few years, GCNs have achieved significant breakthroughs in graph data representation.
|
| 77 |
+
Generally, existing GCNs can be divided into spectral-based methods and spatial-based methods.
|
| 78 |
+
|
| 79 |
+
62 The spectral-based methods use graph spectral theory to define the graph convolutional operation
|
| 80 |
+
63 in a graph Fourier domain. Spectral CNN [10] follows these mathematical foundations, assuming
|
| 81 |
+
64 that a convolutional filter is a set of learnable parameters. To reduce computational complexity,
|
| 82 |
+
65 ChebNet [11] approximates a graph convolutional filter as Chebyshev polynomials of the eigenvalues.
|
| 83 |
+
66 GCN [12] introduces a first-order approximation of ChebNet and proposes a renormalization trick to
|
| 84 |
+
67 alleviate numerical instabilities and exploding/vanishing gradients. DualGCN [13] introduces a dual
|
| 85 |
+
68 GCN architecture with two graph convolutional layers in parallel to encode both local and global
|
| 86 |
+
69 structural information.
|
| 87 |
+
70 The spatial-based methods define feature aggregation in the spatial domain directly, which is more
|
| 88 |
+
71 efficient, general, and flexible [14]. The key challenge for these spatial-based methods is to apply
|
| 89 |
+
72 the convolution operation for different-sized neighborhoods, while at the same time maintaining the
|
| 90 |
+
73 weight sharing property. Neural network for graphs (NN4G) [15] is the first spatial-based method,
|
| 91 |
+
74 applying the graph convolutional operation in the spatial space. Diffusion convolutional neural
|
| 92 |
+
75 networks (DCNN) [16] consider graph convolutions as diffusion processes to efficiently learn features
|
| 93 |
+
76 that are invariant under isomorphism. Message passing neural networks (MPNN) [17] model graph
|
| 94 |
+
77 convolution as a message passing process among the nodes. The graph attention network (GAT)
|
| 95 |
+
78 [3] introduce masked self-attentional layers to assign different weights to adjacent nodes, leading to
|
| 96 |
+
79 learnable filter weights. The mixture model network (MoNet) [18] introduces pseudo-coordinates to
|
| 97 |
+
80 assign different weights to the neighbors of each node. To achieve weight sharing across different
|
| 98 |
+
81 nodes, some spatial-based models attempt to rank a node’s neighbors via certain criteria or metrics,
|
| 99 |
+
82 which transforms the graph-structured data into grid data for further processing. The large-scale
|
| 100 |
+
83 graph convolutional network (LGCN) [19] ranks a node’s neighbors via the node feature values. Then,
|
| 101 |
+
84 multiple 1D convolutional layers are stacked for feature aggregation. Approximate personalized
|
| 102 |
+
85 propagation of neural predictions (APPNP) [4] takes the personalized PageRank algorithm as the
|
| 103 |
+
86 model propagation method to avoid over-smoothing when stacking more layers or increasing the size
|
| 104 |
+
87 of the neighborhood.
|
| 105 |
+
88 Multi-task learning is designed to simultaneously learn a set of related but different tasks for ensuring
|
| 106 |
+
89 that a learning model can derive the best performance across all tasks. Different from multi-task
|
| 107 |
+
90 learning, auxiliary learning is only concerned with model performance on the primary task. For
|
| 108 |
+
91 instance, Deepstereo [20] leverages auxiliary learning to predict the relative poses of multiple cameras
|
| 109 |
+
92 for unsupervised monocular depth estimation. To improve the performance of conversational speech
|
| 110 |
+
93 recognition, auxiliary learning [21] is applied to low-level representations. Compared to the common
|
| 111 |
+
94 learning scheme, meta auxiliary learning can enhance learning performance. For instance, MAXL
|
| 112 |
+
95 [22] adopts meta-learning to automatically generate the auxiliary task labels. Pseudo Label [23] is
|
| 113 |
+
96 a semi-supervised learning method, where a deep neural network is trained using both labeled and
|
| 114 |
+
97 unlabeled data. For unlabeled data, the model picks up the class that has the maximum predicted
|
| 115 |
+
98 probability as the true label to train itself. MPL [24] extends the Pseudo Label [23] via a meta-learning
|
| 116 |
+
99 strategy, where the pseudo-labels are not generated by itself, but by a teacher network.
|
| 117 |
+
100 The existing GCNs are designed for a single task, where the properties of graph-structured data
|
| 118 |
+
101 are not fully explored. We introduce the auxiliary learning scheme to leverage more detailed graph
|
| 119 |
+
102 topology information for enhancing node classification performance.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 2: Network architecture of the vanilla GCN model. The vanilla GCN contains multiple GCN layers. Each layer captures the graph structure to generate the hidden embeddings from the previous layer (For the first layer, it is the original feature of the node) as input, and obtains the output through the message calculation, aggregation and update step. The last layer uses a softmax function to generate classification probabilities for each node.
|
| 123 |
+
|
| 124 |
+
# 3 Method
|
| 125 |
+
|
| 126 |
+
# 3.1 Preliminaries
|
| 127 |
+
|
| 128 |
+
05 Given a graph $\mathcal { G } = \{ \nu , \varepsilon , \mathbf { X } \}$ , $\nu$ is a set of nodes and $\mathcal { E }$ is a set of the edges connecting the related nodes. 06 $\mathbf { X } \in \mathbb { R } ^ { N \times d }$ represents the features matrix of the nodes, where $d$ is the dimension of the node 107 features and $N = | \nu |$ is the number of nodes.
|
| 129 |
+
|
| 130 |
+
108 The proposed method adopts the vanilla GCN [12] as the backbone network, taking the graph
|
| 131 |
+
109 adjacency matrix A, labeled training set $\mathbf { Y } _ { \mathrm { t r a i n } }$ , and original features $\mathbf { X }$ of the nodes as inputs to
|
| 132 |
+
110 perform the semi-supervised node classification task. Based on the MPNN framework [17], each
|
| 133 |
+
111 layer of the vanilla GCN is defined in three parts:
|
| 134 |
+
112 (1) Message computation: The message of node $v _ { i }$ and its neighbor node $v _ { j }$ is calculated, where
|
| 135 |
+
113 $j \in \mathcal { N } ( i )$ , as:
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\mathbf { m } _ { j } ^ { ( k ) } = \frac { 1 } { \sqrt { \deg ( i ) \deg ( j ) } } \mathbf { h } _ { j } ^ { ( k - 1 ) } \mathbf { W } ^ { ( k ) } , \ j \in \{ i \} \bigcup \mathcal { N } ( i ) .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Here, 114 $\deg ( i )$ is the degree of node $v _ { i }$ and $\mathbf { W } ^ { ( k ) } \in \mathbb { R } ^ { c _ { k - 1 } \times c _ { k } }$ are the learnable parameters of the 115 $k ^ { \mathrm { t h } }$ -layer, where $c _ { k }$ is the size of the hidden embedding.
|
| 142 |
+
|
| 143 |
+
116 (2) Aggregation: The messages of node $v _ { i }$ and its neighbors are aggregated by summing them up:
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\mathbf { m } _ { \mathcal { N } ( i ) } ^ { ( k ) } = \sum _ { j \in \{ i \} \cup \mathcal { N } ( i ) } \mathbf { m } _ { j } ^ { ( k ) } ,
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 3: The overall network architecture. Our method consists of three networks: a backbone network for the primary task and two auxiliary task networks. (1) The backbone network is a vanilla GCN, which predicts the classification results of each node. (2) The first auxiliary task network is a link predictor, which focuses on the link prediction task and generates a probabilistic edge structure as the input of the backbone network. (3) The second auxiliary task network is a label generator, which employs the label generation task to generate the pseudo soft labels for supervising the node classifier. The parts connected by the dashed arrow share the same parameters, and the red slash on the arrow indicates a stop-gradient (detach) operation.
|
| 151 |
+
|
| 152 |
+
where m(k)(i)117 denotes the aggregated message.
|
| 153 |
+
|
| 154 |
+
18 (3) Feature updating: Finally, the hidden representation is updated with the aggregated message. For
|
| 155 |
+
19 the vanilla GCN, the update function can be considered as applying a non-linear operation to the
|
| 156 |
+
120 aggregated message:
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\mathbf { h } _ { i } ^ { k } = \left\{ \begin{array} { l l } { \mathrm { s o f t m a x } ( \mathbf { m } _ { \mathcal { N } ( i ) } ^ { ( k ) } ) , } & { \mathrm { i f ~ } k = K } \\ { \mathrm { R e L U } ( \mathbf { m } _ { \mathcal { N } ( i ) } ^ { ( k ) } ) , } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
121 Here, $K$ is the number of model layers. The last layer of the vanilla GCN should output the
|
| 163 |
+
122 classification probability via a softmax function. Otherwise, a ReLU operation is used.
|
| 164 |
+
|
| 165 |
+
# 3.2 Multi-Task Network Architecture
|
| 166 |
+
|
| 167 |
+
In this paper, we propose an auxiliary learning induced GCN for semi-supervised node classification (see Fig. 3). To enhance the node classification performance of the backbone vanilla GCN, we design two auxiliary tasks: link prediction and pseudo-label generation.
|
| 168 |
+
|
| 169 |
+
127 The first $K - 1$ layers of a $K$ -layer vanilla GCN model can be considered as a feature extractor, while
|
| 170 |
+
128 the last layer can be considered as a classifier. Denoting the feature extractor and node classifier of
|
| 171 |
+
129 the backbone model as $h _ { \theta _ { 2 } }$ and $f _ { \theta _ { 1 } }$ , respectively, where $\theta _ { 1 }$ and $\theta _ { 2 }$ are the learnable parameters, the
|
| 172 |
+
130 proposed two auxiliary task networks are defined as follows.
|
| 173 |
+
|
| 174 |
+
# 3.2.1 Link Predictor
|
| 175 |
+
|
| 176 |
+
132 To enrich the edge information, we design an auxiliary link prediction task to infer the missing edges
|
| 177 |
+
133 and present the probability of edge existence. The link predictor we propose contains a decoder $\bar { R } ( \cdot )$
|
| 178 |
+
134 and the feature extractor $h _ { \theta _ { 2 } }$ of the backbone model.
|
| 179 |
+
|
| 180 |
+
The feature extractor 135 $h _ { \theta _ { 2 } } ( \cdot )$ takes reduced adjacency matrix ${ \bf A } _ { s }$ which corresponds to the sampled 136 edge set $\mathcal { E } _ { s } \subset \mathcal { E }$ , and node features $\mathbf { X }$ as inputs to generate the hidden embedding:
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\begin{array} { r } { { \bf H } _ { s } = h _ { \theta _ { 2 } } ( { \bf X } , { \bf A } _ { s } ) . } \end{array}
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
137 Then, the decoder computes the similarity between each node based on $\mathbf { H } _ { s }$ to predict the edge
|
| 187 |
+
138 existence probabilities. We simply use an inner-product calculator with a sigmoid function as the
|
| 188 |
+
139 implementation of decoder $R ( \cdot )$ . The similarity of two hidden embeddings can be computed as
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
r _ { i j } = R ( \mathbf { h } _ { i } , \mathbf { h } _ { j } ) = \sigma ( \mathbf { h } _ { i } \mathbf { h } _ { j } ^ { T } ) ,
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
140 where $\mathbf { h } _ { i }$ and $\mathbf { h } _ { j }$ denote the hidden embeddings of node $v _ { i }$ and node $v _ { j }$ in $\mathbf { H } _ { s }$ , respectively.
|
| 195 |
+
|
| 196 |
+
# 141 3.2.2 Label Generator
|
| 197 |
+
|
| 198 |
+
Although using the one-hot label is inappropriate, it is difficult to obtain soft labels with manual annotations for real graph-structured data. To tackle this issue, we introduce an auxiliary label generation task to generate soft labels that reflect the tendency of different classes each node belongs to. Label generator $g _ { \varphi } ( { \bf X } , { \bf A } )$ is a vanilla GCN, where $\varphi$ are the learnable parameters and A is the adjacency matrix. The label generation network predicts the label distribution of each node based on the graph structure $\mathbf { A }$ and the raw features $\mathbf { X }$ of the nodes, as:
|
| 199 |
+
|
| 200 |
+
$$
|
| 201 |
+
\hat { \mathbf { Y } } ^ { g } = g _ { \varphi } ( \mathbf { X } , \mathbf { A } ) ,
|
| 202 |
+
$$
|
| 203 |
+
|
| 204 |
+
where 48 $\mathbf { Y } ^ { g }$ are the predicted pseudo labels for guiding the training of the backbone network and the 49 label generator.
|
| 205 |
+
|
| 206 |
+
# 3.2.3 Node classifier
|
| 207 |
+
|
| 208 |
+
151 The node classifier carries out the primary semi-supervised node classification task in our model.
|
| 209 |
+
152 Compared to the vanilla GCN model, we add a graph reconstruction step at the beginning. The graph
|
| 210 |
+
153 adjacency matrix reconstructed with the hidden embeddings contains richer edge information since
|
| 211 |
+
154 the proposed auxiliary link prediction task can enhance the graph topology capturing ability of the
|
| 212 |
+
155 feature extractor $h _ { \theta _ { 2 } } ( \cdot )$ . However, the hidden embeddings derived by the feature extractor change
|
| 213 |
+
156 rapidly in the first few iterations, resulting in a changing reconstructed adjacency matrix. Directly
|
| 214 |
+
157 applying the reconstructed adjacency matrix to the entire backbone network increases the training
|
| 215 |
+
158 instability. Thus, we only apply it as the input of the feature extractor $h _ { \theta _ { 2 } } ( \cdot )$ , while the classifier
|
| 216 |
+
159 $f _ { \theta _ { 1 } } ( \cdot )$ still adopts the original adjacency matrix as input.
|
| 217 |
+
160 In each training iteration, the feature extractor $h _ { \theta _ { 2 } } ( \cdot )$ first generates the hidden embeddings of the
|
| 218 |
+
161 nodes $\mathbf { H } = h _ { \theta _ { 2 } } ( \mathbf { X } , \mathbf { A } )$ . The decoder uses $\mathbf { H }$ to reconstruct the adjacency matrix $\mathbf { A } _ { \mathrm { r e c o n } } = R ( \mathbf { H } , \mathbf { H } )$ .
|
| 219 |
+
162 Then, the feature extractor takes the reconstructed adjacency matrix $\mathbf { A } _ { \mathrm { r e c o n } }$ to compute the hidden
|
| 220 |
+
163 embeddings $\mathbf { H } _ { \mathrm { r e c o n } } = h _ { \theta _ { 2 } } ( \mathbf { X } , \mathbf { A } _ { \mathrm { r e c o n } } )$ .
|
| 221 |
+
64 Finally, the computed hidden embeddings $\mathbf { H } _ { \mathrm { r e c o n } }$ and the original graph adjacency matrix A are fed
|
| 222 |
+
65 to the classifier to obtain the final classification results:
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
\hat { \mathbf { Y } } ^ { f } = f _ { \theta _ { 1 } } ( \mathbf { H } _ { \mathrm { r e c o n } } , \mathbf { A } ) .
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
# 166 3.3 Auxiliary Training Phases
|
| 229 |
+
|
| 230 |
+
67 In addition to the backbone network, the proposed method contains two auxiliary task networks. In
|
| 231 |
+
68 the following, we will introduce the objectives for the node classifier $f _ { \theta _ { 1 } }$ , link predictor $h _ { \theta _ { 2 } }$ , and
|
| 232 |
+
69 label generator $g _ { \varphi }$ in order, and then leverage a meta auxiliary learning scheme to train the proposed
|
| 233 |
+
70 multi-task network.
|
| 234 |
+
|
| 235 |
+
# 3.3.1 Training the Node Classifier $f _ { \theta _ { 1 } }$
|
| 236 |
+
|
| 237 |
+
172 The purpose of the node classifier $f _ { \theta _ { 1 } } ( \cdot )$ is to carry out the graph-based semi-supervised node
|
| 238 |
+
173 classification task, which yields the final prediction results. Naturally, it is necessary to use the
|
| 239 |
+
174 classification loss between the predicted result and the real categories of nodes to supervise the
|
| 240 |
+
175 training process. At the same time, to reflect the tendency of the class a node belongs to, the training
|
| 241 |
+
176 should make the prediction labels of the classifier be close to the pseudo soft labels generated by
|
| 242 |
+
177 label generator $g _ { \varphi } ( \cdot )$ .
|
| 243 |
+
178 In the $t ^ { \mathrm { t h } }$ iteration, denoting the pseudo soft labels as $\hat { \mathbf { Y } } ^ { g ( t ) } = g _ { \varphi ^ { ( t ) } } ( \mathbf { X } , \mathbf { A } )$ , the real labels used in
|
| 244 |
+
179 training as $\mathbf { Y } _ { \mathrm { t r a i n } }$ , and the prediction results of the node classifier of the backbone network $f _ { \theta _ { 1 } }$ as
|
| 245 |
+
180 $\hat { \mathbf { Y } } ^ { f ( t ) } = f _ { \theta _ { 1 } ^ { ( t ) } } \big ( h _ { \theta _ { 2 } ^ { ( t ) } } \big ( \mathbf { X } , \mathbf { A } _ { \mathrm { r e c o n } } ^ { ( t ) } \big ) , \mathbf { A } \big )$ , the objective for the node classifier $f _ { \theta _ { 1 } } ( \cdot )$ is defined as
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
\mathcal { L } _ { \theta _ { 1 } } ^ { ( t ) } = \mathcal { L } _ { \mathrm { C E } } ( \hat { \mathbf { Y } } _ { \mathrm { t r a i n } } ^ { f ( t ) } , \mathbf { Y } _ { \mathrm { t r a i n } } ) + \mathcal { L } _ { \mathrm { M S E } } ( \hat { \mathbf { Y } } ^ { f ( t ) } , \hat { \mathbf { Y } } ^ { g ( t ) } ) .
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
181 The objective contains two parts: the loss on the real training labels, and the loss on the generated
|
| 252 |
+
182 pseudo soft labels. $\mathcal { L } _ { \mathrm { C E } }$ denotes the cross-entropy loss and $\mathcal { L } _ { \mathrm { M S E } }$ denotes the mean squared loss.
|
| 253 |
+
183 Although this objective can be used to update the learnable parameters $\theta _ { 2 }$ of the feature extractor
|
| 254 |
+
184 $h _ { \theta _ { 2 } } ( \cdot )$ , as it generates the hidden embeddings used for node classification, we only employ it to
|
| 255 |
+
185 supervise the learning of the node parameters $\theta _ { 1 }$ of the classifier $f _ { \theta _ { 1 } } ( \cdot )$ . To avoid adding unnecessary
|
| 256 |
+
186 supervision for generating the reconstructed graph adjacency matrix $\mathbf { A } _ { \mathrm { r e c o n } }$ , we add a stop-gradient
|
| 257 |
+
187 operation (detach) which is formulated as follows:
|
| 258 |
+
|
| 259 |
+
$$
|
| 260 |
+
{ \bf A } _ { \mathrm { r e c o n } } ^ { ( t ) } = { \tt d e t a c h } ( R ( { \bf H } , { \bf H } ) ) .
|
| 261 |
+
$$
|
| 262 |
+
|
| 263 |
+
# 3.3.2 Auxiliary Training for the Feature Extractor $h _ { \theta _ { 2 } }$
|
| 264 |
+
|
| 265 |
+
189 The feature extractor $h _ { \theta _ { 2 } }$ is shared by the link prediction module and the backbone network. In each
|
| 266 |
+
190 iteration, we first randomly sample a certain percentage of edges from the real edge set $\mathcal { E }$ to form a
|
| 267 |
+
191 sampled edge set $\mathcal { E } _ { s } \subset \mathcal { E }$ . Denoting the reduced graph adjacency matrix as ${ \bf A } _ { s }$ , which corresponds to
|
| 268 |
+
192 the sampled edge set $\mathcal { E } _ { s }$ , and applying a message passing operation with ${ \bf A } _ { s }$ as
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\begin{array} { r } { \mathbf { H } _ { s } ^ { ( t ) } = h _ { \theta _ { 2 } ^ { ( t ) } } ( \mathbf { X } , \mathbf { A } _ { s } ^ { ( t ) } ) , } \end{array}
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
193 then the objective for the feature extractor is defined as
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\mathcal { L } _ { \theta _ { 2 } } ^ { ( t ) } = \mathcal { L } _ { \mathrm { C E } } ( R ( \mathbf { H } _ { s } ^ { ( t ) } , \mathbf { H } _ { s } ^ { ( t ) } ) , \mathbf { A } ) .
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
Here $R ( \mathbf { H } _ { s } ^ { ( t ) } , \mathbf { H } _ { s } ^ { ( t ) } )$ represents the correlation between the hidden embeddings of each pair of nodes.
|
| 281 |
+
|
| 282 |
+
# 3.3.3 Auxiliary Training for the Label Generator $g _ { \varphi }$
|
| 283 |
+
|
| 284 |
+
The label generator $g _ { \varphi }$ is a vanilla GCN model used to predict the label distribution for each node, which naturally needs to be supervised by a classification loss. In the $t ^ { \mathrm { t h } }$ iteration, a label generator first generates the prediction results using the original graph adjacency matrix A and the node features $\mathbf { X }$ , which is formulated as $\hat { \mathbf { Y } } ^ { g ( t ) } = g _ { \varphi ^ { ( t ) } } ( \mathbf { X } , \mathbf { A } )$ . Denoting the training labels as $\mathbf { Y } _ { \mathrm { t r a i n } }$ , the objective of the label generator $g _ { \varphi }$ can be formulated as
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathcal { L } _ { \varphi } ^ { ( t ) } = \mathcal { L } _ { \mathrm { C E } } ( \hat { \mathbf { Y } } _ { \mathrm { t r a i n } } ^ { g ( t ) } , \mathbf { Y } _ { \mathrm { t r a i n } } ) .
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
# 201 3.3.4 Meta-Learning Based Training Strategy
|
| 291 |
+
|
| 292 |
+
The final node classification results only depend on the primary task, while the performance of the other modules, including the label generator and link predictor are not our ultimate concern. Simply using the classification loss to train the label generator $g _ { \varphi }$ or using the link prediction loss to train the feature extractor $h _ { \theta _ { 2 } }$ cannot provide the effects of auxiliary learning. Thus, it is crucial to make the node classifier $f _ { \theta _ { 1 } }$ perform better after it is trained with the pseudo soft labels while taking the hidden embeddings derived by the feature extractor $h _ { \theta _ { 2 } }$ as inputs. To this end, we use meta auxiliary learning to update the model parameters.
|
| 293 |
+
|
| 294 |
+
209 For the auxiliary label generation task, we consider not only the classification performance of the
|
| 295 |
+
210 label generator $g _ { \varphi }$ , but also the auxiliary effect on the node classifier. We assume that the classifier
|
| 296 |
+
211 parameters $\theta _ { 1 }$ are updated with gradient descent based on the pseudo soft labels in the $t ^ { \mathrm { t h } }$ iteration,
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\boldsymbol { \theta } _ { 1 } ^ { \prime } = \boldsymbol { \theta } _ { 1 } ^ { ( t ) } - \eta \nabla _ { \boldsymbol { \theta } _ { 1 } } \mathcal { L } _ { \mathrm { M S E } } ( \hat { \mathbf { Y } } ^ { f ( t ) } , \hat { \mathbf { Y } } ^ { g ( t ) } ) .
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
212 A direct way to evaluate the auxiliary effect of the pseudo soft labels is to compute the classification loss of the prediction given by the node classifier using the updated parameters 213 $\theta _ { 1 } ^ { \prime }$ , as
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { r } { \mathcal { L } ^ { f \prime } = \mathcal { L } _ { \mathrm { C E } } \big ( f _ { \theta _ { 1 } ^ { \prime } } \big ( h _ { \theta _ { 2 } ^ { ( t ) } } \big ( \mathbf { X } , \mathbf { A } _ { \mathrm { r e c o n } } \big ) , \mathbf { A } \big ) _ { \mathrm { t r a i n } } , \mathbf { Y } _ { \mathrm { t r a i n } } \big ) . } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
214 This loss can quantify how much performance improvement the classifier gains from the two auxiliary
|
| 309 |
+
215 tasks. Because $\theta _ { 1 } ^ { \prime }$ is updated with the pseudo soft labels generated by $g _ { \varphi } ( \cdot )$ , the loss $\mathcal { L } ^ { f \prime }$ is also a
|
| 310 |
+
216 function of $\varphi$ . This means that the objective could be used to supervise the learning of $\varphi$ . Note
|
| 311 |
+
217 that $\nabla _ { \varphi } \mathcal { L } ^ { f \prime }$ requires the gradient of the gradient to be computed [25], which can be considered as a
|
| 312 |
+
218 meta-learning strategy. The final objective of the label generator $g _ { \varphi }$ with meta-learning is formulated
|
| 313 |
+
219 as
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\mathcal { L } _ { \varphi - \mathrm { { m e t a } } } ^ { ( t ) } = \mathcal { L } _ { \varphi } ^ { ( t ) } + \mathcal { L } ^ { f \prime } .
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
220 Similar to the label generator $g _ { \varphi } ( \cdot )$ , the link predictor $h _ { \theta _ { 2 } } ^ { b }$ should derive the effective node embed
|
| 320 |
+
221 dings to enhance the node classification performance. Since the hidden embeddings used for node
|
| 321 |
+
|
| 322 |
+
# Algorithm 1 AL-GCN
|
| 323 |
+
|
| 324 |
+
Input: Graph adjacency matrix A, the node features $\mathbf { X }$ , the data labels $\mathbf { Y } _ { \mathrm { t r a i n } }$ of a training set. Output: A feature extractor $h _ { \theta _ { 2 } }$ , a node classifier $f _ { \theta _ { 1 } }$
|
| 325 |
+
|
| 326 |
+
1: Initialize learnable parameters $\theta _ { 1 } , \theta _ { 2 }$ , $\varphi$
|
| 327 |
+
2: while not converged do
|
| 328 |
+
3: # node classifier training phase
|
| 329 |
+
4: $\begin{array} { r l } & { \hat { \mathbf { Y } } ^ { g } \gets g _ { \varphi } ( \mathbf { X } , \mathbf { A } ) } \\ & { \mathbf { H } \gets h _ { \theta _ { 2 } } ( \mathbf { X } , \mathbf { A } ) } \\ & { \mathbf { A } _ { \mathrm { r e c o n } } = \mathsf { d e t a c h } ( R ( \mathbf { H } , \mathbf { H } ) ) } \\ & { \mathbf { H } _ { \mathrm { r e c o n } } \gets h _ { \theta _ { 2 } } ( \mathbf { X } , \mathbf { A } _ { \mathrm { r e c o n } } ) } \\ & { \hat { \mathbf { Y } } ^ { f } \gets f _ { \theta _ { 1 } } ( \mathbf { H } _ { \mathrm { r e c o n } } , \mathbf { A } ) } \\ & { \mathcal { L } _ { \theta _ { 1 } } \gets \mathcal { L } _ { \mathrm { C E } } ( \hat { \mathbf { Y } } _ { \mathrm { t r a i n } } ^ { f } , \mathbf { Y } _ { \mathrm { t r a i n } } ) + \mathcal { L } _ { \mathrm { M S E } } ( \hat { \mathbf { Y } } ^ { f } , \hat { \mathbf { Y } } ^ { g } ) } \\ & { \mathbf { \Delta } _ { \mathrm { r e } } ^ { \mathsf { x } } , \quad \mathbf { \Delta } _ { \mathrm { L } } ^ { \mathsf { x } } , } \end{array}$
|
| 330 |
+
5:
|
| 331 |
+
6:
|
| 332 |
+
7:
|
| 333 |
+
8:
|
| 334 |
+
9:
|
| 335 |
+
10: Update: $\theta _ { 1 } \gets \mathrm { A d a m } ( \mathcal { L } _ { \theta _ { 1 } } , \theta _ { 1 } )$
|
| 336 |
+
11: # meta-learning preparation
|
| 337 |
+
12: Compute: $-$
|
| 338 |
+
13: $\begin{array} { r l } { } & { { } \mathcal { L } _ { \mathrm { C E } } ( f ^ { b } ( h _ { \theta _ { 2 } } ^ { b } ( \mathbf { X } , \mathbf { A } _ { \mathrm { r e c o n } } ) , \mathbf { A } ) _ { \mathrm { t r a i n } } , \mathbf { Y } _ { \mathrm { t r a i n } } ) } \end{array}$
|
| 339 |
+
14: # label generator training phase
|
| 340 |
+
15: $\begin{array} { r l } & { \hat { \mathbf Y } ^ { g } \gets g _ { \varphi } ( \mathbf X , \mathbf A ) } \\ & { \mathcal { L } _ { \varphi } \gets \mathcal { L } _ { \mathrm { C E } } ( \hat { \mathbf Y } _ { \mathrm { t r a i n } } ^ { g } , \mathbf Y _ { \mathrm { t r a i n } } ) _ { , } + } \end{array}$
|
| 341 |
+
16:
|
| 342 |
+
17: Update: $\varphi \gets \mathrm { A d a m } ( \mathcal { L } _ { \varphi } , \varphi )$
|
| 343 |
+
18: # feature extractor training phase
|
| 344 |
+
19: ${ \bf A } _ { s } \gets$ RandomSample(A)
|
| 345 |
+
20: Hs ← hθ (X, As)
|
| 346 |
+
21: $\mathcal { L } _ { \boldsymbol { \theta } _ { 2 } } \gets \mathcal { L } _ { \mathrm { C E } } ( R ( \mathbf { H } _ { s } , \mathbf { H } _ { s } ) , \mathbf { A } ) + $
|
| 347 |
+
22: Update: $\theta _ { 2 } \gets \mathrm { A d a m } ( \mathcal { L } _ { \theta _ { 2 } } , \theta _ { 2 } )$
|
| 348 |
+
23: end while
|
| 349 |
+
222 classification are derived from the feature extractor $h _ { \theta _ { 2 } }$ , the objective defined in Eq. 14 can also be
|
| 350 |
+
223 considered as a function of $\theta _ { 2 }$ . Thus, the objective of the feature extractor $h _ { \theta _ { 2 } }$ with meta-learning is
|
| 351 |
+
224 defined as
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\mathcal { L } _ { \theta _ { 2 } \mathrm { - m e t a } } ^ { ( t ) } = \mathcal { L } _ { \theta _ { 2 } } ^ { ( t ) } + \mathcal { L } ^ { f ^ { \prime } } .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
225 This objective means that, except for the link prediction task, the feature extractor $h _ { \theta _ { 2 } }$ should ensure
|
| 358 |
+
226 that the generated hidden embedding enhance the classification accuracy of the node classifier $f _ { \theta _ { 1 } }$
|
| 359 |
+
227 updated with the pseudo soft labels. The overall training process is shown in Alg. 1.
|
| 360 |
+
|
| 361 |
+
# 4 Experiments
|
| 362 |
+
|
| 363 |
+
# 4.1 Experimental Settings and Compared Methods
|
| 364 |
+
|
| 365 |
+
We demonstrate the classification performance of our method via semi-supervised document classification on three citation network datasets, including Cora, Citeseer, and Pubmed [26], where nodes represent the documents and edges are citation links. Dataset statistics are summarized in Table 1.
|
| 366 |
+
|
| 367 |
+
233 The proposed method is a novel GCN, which is leveraged to carry out a node classification task.
|
| 368 |
+
234 We compare our method with several popular graph-based node classification methods including
|
| 369 |
+
235 GCN [12], GAT [3], DualGCN [13], SGC [27], and APPNP [4]. As we use a three-layer GCN as
|
| 370 |
+
236 the backbone in our proposed model, we compare both two-layer and three-layer GCNs, denoted as
|
| 371 |
+
237 GCN2 and GCN3, respectively.
|
| 372 |
+
|
| 373 |
+
For the semi-supervised node classification, we use all node features but only 20 labels per class for training and 500 nodes as the validation set. We train the proposed method for a maximum of 400 epochs using Adam [28] with a learning rate of 0.01. We use the well-trained parameters, which achieve the best performance on the validation set during the training phases, to evaluate classification accuracy on a test set of 1,000 labeled examples. We run each method 100 times and compute the average classification accuracy on a single NVIDIA GTX 1080Ti GPU. To implement all the compared methods more conveniently, we use PyG [29] as the graph-based learning framework.
|
| 374 |
+
|
| 375 |
+
Table 1: Dataset statistics.
|
| 376 |
+
|
| 377 |
+
<table><tr><td>Dataset</td><td>Nodes</td><td>Edges</td><td>Features</td><td>Classes</td></tr><tr><td>Cora</td><td>2,708</td><td>5,278</td><td>1,433</td><td>7</td></tr><tr><td>CiteSeer</td><td>3,327</td><td>4,552</td><td>3,703</td><td>6</td></tr><tr><td>Cora</td><td>19,717</td><td>44,324</td><td>500</td><td>3</td></tr></table>
|
| 378 |
+
|
| 379 |
+
Table 2: Classification results on the datasets (bold: best, underline: runner-up).
|
| 380 |
+
|
| 381 |
+
<table><tr><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td></tr><tr><td>GAT [3] DualGCN[13]</td><td>82.5 ±0.8%</td><td>71.4±0.7%</td><td>78.4± 0.4%</td></tr><tr><td rowspan="3">SGC [27] APPNP [4]</td><td>83.4 ± 0.5%</td><td>72.6 ± 0.6%</td><td>79.9 ± 0.3%</td></tr><tr><td>81.3 ± 0.7%</td><td>70.9 ± 0.6%</td><td>78.2 ± 0.5%</td></tr><tr><td>83.2 ± 0.4%</td><td>71.6 ± 0.5%</td><td>79.8 ± 0.3%</td></tr><tr><td rowspan="2">GCN2 [12] AL-GCN2 (ours)</td><td>81.5±0.7%</td><td>71.5 ± 0.5%</td><td>79.2 ± 0.4%</td></tr><tr><td>82.3 ± 0.4%</td><td>72.6 ± 0.5%</td><td>79.6± 0.5%</td></tr><tr><td rowspan="2">GCN3[12] AL-GCN3 (ours)</td><td>80.7±1.2%</td><td>68.0±1.4%</td><td>77.7 ± 0.5%</td></tr><tr><td>84.7 ± 0.4%</td><td>72.3± 0.5%</td><td>81.4± 0.6%</td></tr></table>
|
| 382 |
+
|
| 383 |
+
# 245 4.2 Experimental Results
|
| 384 |
+
|
| 385 |
+
46 In this section, we provide the experimental results of the node classification, an ablation study, and
|
| 386 |
+
47 the visualization of hidden embeddings. More experimental results, such as parameter and model
|
| 387 |
+
48 robustness studies can be found in the supplementary materials.
|
| 388 |
+
|
| 389 |
+
We conduct the node classification task on three citation network datasets. As shown in Table 2, our method consistently and significantly enhances the learning performance compared to the other methods. In particular, for the Cora dataset, the proposed method is superior to GCN by $4 . 9 \%$ Compared to the other methods, our model considers more graph-structured information via auxiliary learning. Thus, it is consistently and significantly superior to the compared methods, achieving state-of-the-art results.
|
| 390 |
+
|
| 391 |
+
# 4.3 Ablation Studies
|
| 392 |
+
|
| 393 |
+
# 4.3.1 On the Auxiliary Learning Modules
|
| 394 |
+
|
| 395 |
+
To determine how the link predictor $( P )$ and the pseudo label generator $( G )$ affect the node classification performance, we apply the following two ablation models: (1) Vanilla GCN with the link predictor, termed $\mathrm { G C N } { + } P$ . (2) Vanilla GCN with the lable generator, termed ${ \mathrm { G C N } } { + } G$ . We compare ${ \mathrm { G C N } } { \mathrm { + } } G$ and $\mathrm { G C N } { + } P$ with the proposed method, AL-GCN $( \mathbf { G } \mathbf { C } \mathbf { N } { + } \mathbf { } \mathbf { } P { + } G )$ , and the original GCN. Table 3 lists the results. As can be seen, the proposed method consistently outperforms $\mathrm { G C N } { + } P$ and ${ \mathrm { G C N } } { + } G$ . Specifically, compared to the link predictor, the label generator has more effect on the Citeseer dataset. However, for the Pubmed dataset, the link predictor has much more effect on the learning performance.
|
| 396 |
+
|
| 397 |
+
# 4.3.2 On the Reconstructed Graph Adjacency Matrix
|
| 398 |
+
|
| 399 |
+
For the backbone network, a reconstructed graph adjacency matrix via a link prediction task is used as input. To determine how the reconstructed graph adjacency matrix affects the node classification performance, we compare the proposed model with the following two models: (1) A model that takes the original graph adjacency matrix without the reconstructed one as the input of the backbone network, termed w/o-recG; (2) A model that takes only the reconstructed graph adjacency matrix as the input of the backbone network, termed w/o-oriG.
|
| 400 |
+
|
| 401 |
+
272 As shown in Table 4, our method consistently outperforms w/o-recG and w/o-oriG. This can be
|
| 402 |
+
273 attributed to the fact that the reconstructed graph adjacency matrix via the link predictor can capture
|
| 403 |
+
274 the detailed topology information of a graph and the fixed original graph adjacency matrix increases
|
| 404 |
+
275 the training stability.
|
| 405 |
+
|
| 406 |
+
Table 3: The ablation experiment results.
|
| 407 |
+
|
| 408 |
+
<table><tr><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td></tr><tr><td>GCN</td><td>80.7 ± 1.2%</td><td>68.0 ± 1.4%</td><td>77.7 ± 0.5%</td></tr><tr><td>GCN+P</td><td>83.0 ± 0.7%</td><td>70.6 ± 0.8%</td><td>81.3 ± 0.6%</td></tr><tr><td>GCN+G</td><td>83.0 ± 0.6%</td><td>71.7 ± 0.8%</td><td>78.8± 0.6%</td></tr><tr><td>GCN+P+G (AL-GCN)</td><td>84.7 ± 0.4%</td><td>72.3± 0.5%</td><td>81.4 ± 0.6%</td></tr></table>
|
| 409 |
+
|
| 410 |
+
Table 4: The ablation experiment results in terms of classification accuracy (in percent).
|
| 411 |
+
|
| 412 |
+
<table><tr><td>Method</td><td>Cora</td><td>Citeseer</td><td>Pubmed</td></tr><tr><td>GCN</td><td>80.7±1.2%</td><td>68.0±1.4%</td><td>77.7 ± 0.5%</td></tr><tr><td>w/o-recG</td><td>84.5 ± 0.5%</td><td>71.9 ± 0.6%</td><td>80.1 ± 0.5%</td></tr><tr><td>W/0-oriG</td><td>84.1 ±0.6%</td><td>71.4 ± 0.9%</td><td>80.6 ± 1.5%</td></tr><tr><td>AL-GCN</td><td>84.7 ±0.4%</td><td>72.3 ± 0.5%</td><td>81.4± 0.6%</td></tr></table>
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 4: Visualization of the hidden embedding obtained by different methods via t-SNE algorithm.
|
| 416 |
+
|
| 417 |
+
# 276 4.4 Visualization of Hidden Embeddings
|
| 418 |
+
|
| 419 |
+
To determine how the hidden embeddings affect the learning performance, we use the visualization tool t-SNE [30] to observe their distribution. As shown in Fig. 4, the embedding results of GCN and GAT are denser, and the separation of different clusters is not obvious. In contrast, the node distributions learned by our proposed method are more separate, with most of the nodes from the same classes being close to each other, resulting in obvious cluster structures. These experimental results demonstrate that the proposed method can capture more detailed structure information of a graph, including the nodes and edges, resulting in more effective hidden embeddings.
|
| 420 |
+
|
| 421 |
+
# 5 Conclusion
|
| 422 |
+
|
| 423 |
+
We have proposed a novel graph convolutional network for semi-supervised node classification. Different from existing methods, the proposed model focuses on enriching the graph data and adopts meta auxiliary learning to enhance the representations of nodes and edges in a graph. To enrich node label information, an auxiliary label generator is used to generate pseudo probabilistic labels. Meanwhile, an auxiliary link predictor is used to generate probabilistic edges to enrich the graph structure information. The enriched node and edge information can iteratively enhance the performance of the node classification task. Experimental results on several benchmark citation datasets show that the proposed model is superior to the existing methods. For future work, we note that real-world data is usually contaminated by noise, which results in a robustness problem for graph learning methods. We plan to extend our model to handle noisy data by designing a more robust learning method for graph-structured data.
|
| 424 |
+
|
| 425 |
+
# References
|
| 426 |
+
|
| 427 |
+
[1] David Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gómez-Bombarelli, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P. Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in Neural Information Processing Systems, pages 2224–2232, 2015.
|
| 428 |
+
[2] Rex Ying, Ruining He, Kaifeng Chen, Pong Eksombatchai, William L. Hamilton, and Jure Leskovec. Graph convolutional neural networks for web-scale recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 974–983, 2018. [3] Petar Velickovic, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua Bengio. Graph attention networks. In 6th International Conference on Learning Representations, 2018. [4] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In 7th International Conference on Learning Representations, 2019. [5] Xiao Wang, Meiqi Zhu, Deyu Bo, Peng Cui, Chuan Shi, and Jian Pei. AM-GCN: adaptive multichannel graph convolutional networks. In Proceedings of the 26t h ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1243–1253, 2020. [6] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken-ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In Proceedings of the 35th International Conference on Machine Learning, volume 80, pages 5449–5458, 2018. [7] Lingxiao Zhao and Leman Akoglu. Pairnorm: Tackling oversmoothing in gnns. In 8th International Conference on Learning Representations, 2020.
|
| 429 |
+
[8] Ming Chen, Zhewei Wei, Zengfeng Huang, Bolin Ding, and Yaliang Li. Simple and deep graph convolutional networks. In Proceedings of the 37th International Conference on Machine Learning, volume 119, pages 1725–1735, 2020. [9] Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Proceedings of the Thirty-Second AAAI Conference on Artificial Intelligence, pages 3538–3545, 2018.
|
| 430 |
+
[10] Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. In 2nd International Conference on Learning Representations, 2014.
|
| 431 |
+
[11] Michaël Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in Neural Information Processing Systems, pages 3837–3845, 2016.
|
| 432 |
+
[12] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In 5th International Conference on Learning Representations, 2017.
|
| 433 |
+
[13] Chenyi Zhuang and Qiang Ma. Dual graph convolutional networks for graph-based semisupervised classification. In Proceedings of the 2018 World Wide Web Conference on World Wide Web, pages 499–508, 2018.
|
| 434 |
+
[14] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. CoRR, abs/1901.00596, 2019.
|
| 435 |
+
[15] Alessio Micheli. Neural network for graphs: A contextual constructive approach. IEEE Trans. Neural Networks, 20(3):498–511, 2009.
|
| 436 |
+
[16] James Atwood and Don Towsley. Diffusion-convolutional neural networks. In Advances in Neural Information Processing Systems, pages 1993–2001, 2016.
|
| 437 |
+
[17] Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pages 1263–1272, 2017.
|
| 438 |
+
[18] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and Michael M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In 2017 IEEE Conference on Computer Vision and Pattern Recognition, pages 5425–5434, 2017.
|
| 439 |
+
[19] Hongyang Gao, Zhengyang Wang, and Shuiwang Ji. Large-scale learnable graph convolutional networks. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1416–1424, 2018.
|
| 440 |
+
[20] John Flynn, Ivan Neulander, James Philbin, and Noah Snavely. Deepstereo: Learning to predict new views from the world’s imagery. CoRR, abs/1506.06825, 2015.
|
| 441 |
+
[21] Shubham Toshniwal, Hao Tang, Liang Lu, and Karen Livescu. Multitask learning with low-level auxiliary tasks for encoder-decoder based speech recognition. In 18th Annual Conference of the International Speech Communication Association, pages 3532–3536, 2017.
|
| 442 |
+
[22] Timothy M. Hospedales, Antreas Antoniou, Paul Micaelli, and Amos J. Storkey. Meta-learning in neural networks: A survey. CoRR, abs/2004.05439, 2020.
|
| 443 |
+
[23] Dong-Hyun Lee. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on Challenges in Representation Learning, volume 3, 2013.
|
| 444 |
+
[24] Hieu Pham, Qizhe Xie, Zihang Dai, and Quoc V. Le. Meta pseudo labels. CoRR, abs/2003.10580, 2020.
|
| 445 |
+
[25] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pages 1126–1135, 2017.
|
| 446 |
+
[26] Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina EliassiRad. Collective classification in network data. AI Magazine, 29(3):93, September 2008.
|
| 447 |
+
[27] Felix Wu, Amauri H. Souza Jr., Tianyi Zhang, Christopher Fifty, Tao Yu, and Kilian Q. Weinberger. Simplifying graph convolutional networks. In Proceedings of the 36th International Conference on Machine Learning, volume 97, pages 6861–6871, 2019.
|
| 448 |
+
[28] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, 2015.
|
| 449 |
+
[29] Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. CoRR, abs/1903.02428, 2019.
|
| 450 |
+
[30] Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 451 |
+
|
| 452 |
+
# Checklist
|
| 453 |
+
|
| 454 |
+
1. For all authors...
|
| 455 |
+
|
| 456 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 457 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 458 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No]
|
| 459 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 460 |
+
|
| 461 |
+
2. If you are including theoretical results...
|
| 462 |
+
|
| 463 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 464 |
+
|
| 465 |
+
3. If you ran experiments...
|
| 466 |
+
|
| 467 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The codes are included in the supplemental material and the datasets can be downlowded by the codes automaticly.
|
| 468 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] They are included in the supplemental material.
|
| 469 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 4.1.
|
| 470 |
+
|
| 471 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4.1.
|
| 472 |
+
|
| 473 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 474 |
+
|
| 475 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4.1.
|
| 476 |
+
(b) Did you mention the license of the assets? [No]
|
| 477 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 478 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No]
|
| 479 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No]
|
| 480 |
+
|
| 481 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 482 |
+
|
| 483 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 484 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 485 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/B1zlp1bRW/B1zlp1bRW.md
ADDED
|
@@ -0,0 +1,412 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LARGE-SCALE OPTIMAL TRANSPORT AND MAPPING ESTIMATION
|
| 2 |
+
|
| 3 |
+
Vivien Seguy
|
| 4 |
+
Kyoto University
|
| 5 |
+
Graduate School of Informatics
|
| 6 |
+
vivien.seguy@iip.ist.i.kyoto-u.ac.jp
|
| 7 |
+
Bharath Bhushan Damodaran
|
| 8 |
+
Universite de Bretagne Sud´
|
| 9 |
+
IRISA, UMR 6074, CNRS
|
| 10 |
+
bharath-bhushan.damodaran@irisa.fr
|
| 11 |
+
Remi Flamary ´
|
| 12 |
+
Universite C´ ote dAzur ˆ
|
| 13 |
+
Lagrange, UMR 7293, CNRS, OCA
|
| 14 |
+
remi.flamary@unice.fr
|
| 15 |
+
|
| 16 |
+
Nicolas Courty Universite de Bretagne Sud ´ IRISA, UMR 6074, CNRS courty@univ-ubs.fr
|
| 17 |
+
|
| 18 |
+
# Antoine Rolet
|
| 19 |
+
|
| 20 |
+
# Mathieu Blondel
|
| 21 |
+
|
| 22 |
+
Kyoto University Graduate School of Informatics antoine.rolet@iip.ist.i.kyoto-u.ac.jp
|
| 23 |
+
|
| 24 |
+
NTT Communication Science Laboratories mathieu@mblondel.org
|
| 25 |
+
|
| 26 |
+
# ABSTRACT
|
| 27 |
+
|
| 28 |
+
This paper presents a novel two-step approach for the fundamental problem of learning an optimal map from one distribution to another. First, we learn an optimal transport (OT) plan, which can be thought as a one-to-many map between the two distributions. To that end, we propose a stochastic dual approach of regularized OT, and show empirically that it scales better than a recent related approach when the amount of samples is very large. Second, we estimate a Monge map as a deep neural network learned by approximating the barycentric projection of the previously-obtained OT plan. This parameterization allows generalization of the mapping outside the support of the input measure. We prove two theoretical stability results of regularized OT which show that our estimations converge to the OT plan and Monge map between the underlying continuous measures. We showcase our proposed approach on two applications: domain adaptation and generative modeling.
|
| 29 |
+
|
| 30 |
+
# 1 INTRODUCTION
|
| 31 |
+
|
| 32 |
+
Mapping one distribution to another Given two random variables $X$ and $Y$ taking values in $\mathcal { X }$ and $\mathcal { V }$ respectively, the problem of finding a map $f$ such that $f ( X )$ and $Y$ have the same distribution, denoted $f ( X ) \sim Y$ henceforth, finds applications in many areas. For instance, in domain adaptation, given a source dataset and a target dataset with different distributions, the use of a mapping to align the source and target distributions is a natural formulation (Gopalan et al., 2011) since theory has shown that generalization depends on the similarity between the two distributions (Ben-David et al., 2010). Current state-of-the-art methods for computing generative models such as generative adversarial networks (Goodfellow et al., 2014), generative moments matching networks (Li et al., 2015) or variational auto encoders (Kingma & Welling, 2013) also rely on finding $f$ such that $f ( X ) \sim Y$ . In this setting, the latent variable $X$ is often chosen as a continuous random variable, such as a Gaussian distribution, and $Y$ is a discrete distribution of real data, e.g. the ImageNet dataset. By learning a map $f$ , sampling from the generative model boils down to simply drawing a sample from $X$ and then applying $f$ to that sample.
|
| 33 |
+
|
| 34 |
+
Mapping with optimality Among the potentially many maps $f$ verifying $f ( X ) \sim Y$ , it may be of interest to find a map which satisfies some optimality criterion. Given a cost of moving mass from one point to another, one would naturally look for a map which minimizes the total cost of transporting the mass from $X$ to $Y$ . This is the original formulation of Monge (1781), which initiated the development of the optimal transport (OT) theory. Such optimal maps can be useful in numerous applications such as color transfer (Ferradans et al., 2014), shape matching (Su et al., 2015), data assimilation (Reich, 2011; 2013), or Bayesian inference (Moselhy & Marzouk, 2012). In small dimension and for some specific costs, multi-scale approaches (Merigot, 2011) or dynamic formu- ´ lations (Evans & Gangbo, 1999; Benamou & Brenier, 2000; Papadakis et al., 2014; Solomon et al., 2014) can be used to compute optimal maps, but these approaches become intractable in higher dimension as they are based on space discretization. Furthermore, maps veryfiying $f ( X ) \sim Y$ might not exist, for instance when $X$ is a constant but not $Y$ . Still, one would like to find optimal maps between distributions at least approximately. The modern approach to OT relaxes the Monge problem by optimizing over plans, i.e. distributions over the product space $\mathcal { X } \times \mathcal { V }$ , rather than maps, casting the OT problem as a linear program which is always feasible and easier to solve. However, even with specialized algorithms such as the network simplex, solving that linear program takes $O ( n ^ { 3 } \log { n } )$ time, where $n$ is the size of the discrete distribution (measure) support.
|
| 35 |
+
|
| 36 |
+
Large-scale OT Recently, Cuturi (2013) showed that introducing entropic regularization into the OT problem turns its dual into an easier optimization problem which can be solved using the Sinkhorn algorithm. However, the Sinkhorn algorithm does not scale well to measures supported on a large number of samples, since each of its iterations has an $\mathcal { O } ( n ^ { 2 } )$ complexity. In addition, the Sinkhorn algorithm cannot handle continuous probability measures. To address these issues, two recent works proposed to optimize variations of the dual OT problem through stochastic gradient methods. Genevay et al. (2016) proposed to optimize a “semi-dual” objective function. However, their approach still requires ${ \mathcal { O } } ( n )$ operations per iteration and hence only scales moderately w.r.t. the size of the input measures. Arjovsky et al. (2017) proposed a formulation that is specific to the so-called 1-Wasserstein distance (unregularized OT using the Euclidean distance as a cost function). This formulation has a simpler dual form with a single variable which can be parameterized as a neural network. This approach scales better to very large datasets and handles continuous measures, enabling the use of OT as a loss for learning a generative model. However, a drawback of that formulation is that the dual variable has to satisfy the non-trivial constraint of being a Lipschitz function. As a workaround, Arjovsky et al. (2017) proposed to use weight clipping between updates of the neural network parameters. However, this makes unclear whether the learned generative model is truly optimized in an OT sense. Besides these limitations, these works only focus on the computation of the OT objective and do not address the problem of finding an optimal map between two distributions.
|
| 37 |
+
|
| 38 |
+
Contributions We present a novel two-step approach for learning an optimal map $f$ that satisfies $f ( X ) \sim Y$ . First, we compute an optimal transport plan, which can be thought as a one-to-many map between the two distributions. To that end, we propose a new simple dual stochastic gradient algorithm for solving regularized OT which scales well with the size of the input measures. We provide numerical evidence that our approach converges faster than semi-dual approaches considered in (Genevay et al., 2016). Second, we learn an optimal map (also referred to as a Monge map) as a neural network by approximating the barycentric projection of the OT plan obtained in the first step. Parameterization of this map with a neural network allows efficient learning and provides generalization outside the support of the input measure. Fig. 1 provides a 2D example showing the computed map between a Gaussian measure and a discrete measure and the resulting density estimation. On the theoretical side, we prove the convergence of regularized optimal plans (resp. barycentric projections of regularized optimal plans) to the optimal plan (resp. Monge map) between the underlying continuous measures from which data are sampled. We demonstrate our approach on domain adaptation and generative modeling.
|
| 39 |
+
|
| 40 |
+
Notations: We denote $\mathcal { X }$ and $\mathcal { V }$ some complete metric spaces. In most applications, these are Euclidean spaces. We denote random variables such as $X$ or $Y$ as capital letters. We use $X \sim Y$ to say that $X$ and $Y$ have the same distribution, and also $X \sim \mu$ to say that $X$ is distributed according to the probability measure $\mu$ . $\operatorname { S u p p } ( \mu )$ refers to the support of $\mu$ , a subset of $\mathcal { X }$ , which is also the set of values which $X \sim \mu$ can take. Given $X \sim \mu$ and a map $f$ defined on $\operatorname { S u p p } ( \mu )$ , $f \# \mu$ is the probability distribution of $f ( X )$ . We say that a measure is continuous when it admits a density w.r.t. the Lebesgues measure. We denote id the identity map.
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 1: Example of estimated optimal map between a continuous Gaussian distribution (colored level sets) and a multi-modal discrete measure (red $+$ ). (left) Continuous source and discrete target distributions. (center left) displacement field of the estimated optimal map: each arrow is proportional to $f ( x _ { i } ) - x _ { i }$ where $( x _ { i } )$ is a uniform discrete grid. (center right) Generated samples obtained by sampling from the source distribution and applying our estimated Monge map $f$ . (right) Level sets of the resulting density (approximated as a 2D histogram over $1 0 ^ { 6 }$ samples).
|
| 44 |
+
|
| 45 |
+
# 2 BACKGROUND ON OPTIMAL TRANSPORT
|
| 46 |
+
|
| 47 |
+
The Monge Problem Consider a cost function $c \ : \ ( x , y ) \in \mathcal { X } \times \mathcal { Y } \mapsto c ( x , y ) \in \mathbb { R } ^ { + }$ , and two random variables $X \sim \mu$ and $Y \sim \nu$ taking values in $\mathcal { X }$ and $\mathcal { V }$ respectively. The Monge problem (Monge, 1781) consists in finding a map $f : \mathcal { X } \mathcal { Y }$ which transports the mass from $\mu$ to $\nu$ while minimizing the mass transportation cost,
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
{ \underset { f } { \operatorname* { i n f } } } \ \operatorname { \mathbb { E } } _ { X \sim \mu } \left[ c ( X , f ( X ) ) \right] \ { \mathrm { \ s u b j e c t { \ t o } } } \ f ( X ) \sim Y .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Monge originally considered the cost $c ( x , y ) = \| x - y \| _ { 2 }$ , but in the present article we refer to the Monge problem as Problem (1) for any cost $c$ . When $\mu$ is a discrete measure, a map $f$ satisfying the constraint may not exist: if $\mu$ is supported on a single point, no such map exists as soon as $\nu$ is not supported on a single point. In that case, the Monge problem is not feasible. However, when $\mathcal X = \mathcal { \bar { y } } = \mathbb R ^ { d }$ , $\mu$ admits a density and $c$ is the squared Euclidean distance, an important result by Brenier (1991) states that the Monge problem is feasible and that the infinum of Problem (1) is attained. The existence and uniqueness of Monge maps, also referred to as optimal maps, was later generalized to more general costs (e.g. strictly convex and super-linear) by several authors. With the notable exception of the Gaussian to Gaussian case which has a close form affine solution, computation of Monge maps remains an open problem for measures supported on high-dimensional spaces.
|
| 54 |
+
|
| 55 |
+
Kantorovich Relaxation In order to make Problem (1) always feasible, Kantorovich (1942) relaxed the Monge problem by casting Problem (1) into a minimization over couplings $( X , Y ) \sim \pi$ rather than the set of maps, where $\pi$ should have marginals equals to $\mu$ and $\nu$ ,
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\operatorname* { i n f } _ { \pi } \ \mathbb { E } _ { ( X , Y ) \sim \pi } \left[ c ( X , Y ) \right] \ \mathrm { ~ s u b j e c t ~ t o ~ } X \sim \mu , \ Y \sim \nu .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
Concretely, this relaxation allows mass at a given point $x \in \operatorname { S u p p } ( \mu )$ to be transported to several locations $y \in \operatorname { S u p p } ( \nu )$ , while the Monge problem would send the whole mass at $x$ to a unique location $f ( x )$ . This relaxed formulation is a linear program, which can be solved by specialized algorithms such as the network simplex when considering discrete measures. However, current implementations of this algorithm have a super-cubic complexity in the size of the support of $\mu$ and $\nu$ , preventing wider use of OT in large-scale settings.
|
| 62 |
+
|
| 63 |
+
Regularized OT OT regularization was introduced by Cuturi (2013) in order to speed up the computation of OT. Regularization is achieved by adding a negative-entropy penalty $R$ (defined in Eq. (5)) to the primal variable $\pi$ of Problem (2),
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\operatorname* { i n f } _ { \pi } ~ \mathbb { E } _ { ( X , Y ) \sim \pi } \left[ c ( X , Y ) \right] + \varepsilon R ( \pi ) ~ { \mathrm { s u b j e c t ~ t o ~ } } X \sim \mu , ~ Y \sim \nu .
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Besides efficient computation through the Sinkhorn algorithm, regularization also makes the OT distance differentiable everywhere w.r.t. the weights of the input measures (Blondel et al., 2018), whereas $\mathrm { O T }$ is differentiable only almost everywhere. We also consider the $L ^ { 2 }$ regularization introduced by Dessein et al. (2016), whose computation is found to be more stable since there is no exponential term causing overflow. As highlighted by Blondel et al. (2018), adding an entropy or squared $L ^ { 2 }$ norm regularization term to the primal problem (3) makes the dual problem an unconstrained maximization problem. We use this dual formulation in the next section to propose an efficient stochastic gradient algorithm.
|
| 70 |
+
|
| 71 |
+
# 3 LARGE-SCALE OPTIMAL TRANSPORT
|
| 72 |
+
|
| 73 |
+
By considering the dual of the regularized OT problem, we first show that stochastic gradient ascent can be used to maximize the resulting concave objective. A close form for the primal solution $\pi$ of Problem (3) can then be obtained by using first-order optimality conditions.
|
| 74 |
+
|
| 75 |
+
# 3.1 DUAL STOCHASTIC APPROACH
|
| 76 |
+
|
| 77 |
+
OT dual Let $X \sim \mu$ and $Y \sim \nu$ . The Kantorovich duality provides the following dual of the OT problem (2),
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\operatorname* { s u p } _ { u \in { \mathcal { C } } ( x ) , v \in { \mathcal { C } } ( { \mathcal { V } } ) } \mathbb { E } _ { ( X , Y ) \sim \mu \times \nu } \left[ u ( X ) + v ( Y ) \right] \quad { \mathrm { s u b j e c t ~ t o ~ } } u ( x ) + v ( y ) \leqslant c ( x , y ) { \mathrm { ~ f o r ~ a l l ~ } } u ( x ) + v ( y ) .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
This dual formulation suggests that stochastic gradient methods can be used to maximize the objective of Problem (4) by sampling batches from the independant coupling $\mu \times \nu$ . However there is no easy way to fulfill the constraint on $u$ and $v$ along gradient iterations. This motivates considering regularized optimal transport.
|
| 84 |
+
|
| 85 |
+
Regularized OT dual The hard constraint in Eq. (4) can be relaxed by regularizing the primal problem (2) with a strictly convex regularizer $R$ as detailed in (Blondel et al., 2018). In the present paper, we consider both entropy regularization $R _ { e }$ used in (Cuturi, 2013; Genevay et al., 2016) and $L ^ { 2 }$ regularization $R _ { L ^ { 2 } }$ ,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathfrak { L } _ { e } ( \pi ) \overset { \mathrm { d e f . } } { = } \int _ { x \times y } \left( \ln \left( \frac { d \pi ( x , y ) } { d \mu ( x ) d \nu ( y ) } \right) - 1 \right) d \pi ( x , y ) , ~ R _ { L ^ { 2 } } ( \pi ) \overset { \mathrm { d e f . } } { = } \int _ { x \times y } \left( \frac { d \pi ( x , y ) } { d \mu ( x ) d \nu ( y ) } \right) ^ { 2 } d \mu ( x ) d \nu ( y ) .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\frac { d \pi ( x , y ) } { d \mu ( x ) d \nu ( y ) }$ is the density, i.e. the Radon-Nikodym derivative, of $\pi$ w.r.t. $\mu \times \nu$ . When $\mu$ and $\nu$ are discrete, and so is $\pi$ , the integrals are replaced by sums. The dual of the regularized OT problems can be obtained through the Fenchel-Rockafellar’s duality theorem,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\operatorname* { s u p } _ { u , v } \mathbb { E } _ { ( X , Y ) \sim \mu \times \nu } \left[ u ( X ) + v ( Y ) + F _ { \varepsilon } ( u ( X ) , v ( Y ) ) \right] ,
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
F _ { \varepsilon } ( u ( x ) , v ( y ) ) = \left\{ \begin{array} { l l } { - \varepsilon e ^ { \frac { 1 } { \varepsilon } ( u ( x ) + v ( y ) - c ( x , y ) ) } \quad \mathrm { ( e n t r o p y ~ r e g . ) } } \\ { - \frac { 1 } { 4 \varepsilon } ( u ( x ) + v ( y ) - c ( x , y ) ) _ { + } ^ { 2 } \quad ( L ^ { 2 } ~ \mathrm { r e g . } ) } \end{array} \right. ~ .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
Compared to Problem (4), the constraint $u ( x ) + v ( y ) \leqslant c ( x , y )$ has been relaxed and is now enforced smoothly through a penalty term $F _ { \varepsilon } ( u ( x ) , v ( y ) )$ which is concave w.r.t. $( u , v )$ . Although we derive formula and perform experiments w.r.t. entropy and $L ^ { 2 }$ regularizations, any strictly convex regularizer which is decomposable, i.e. which can be written $\begin{array} { r } { R ( \pi ) { \bf \equiv } \sum _ { i j } R _ { i j } ( \pi _ { i j } ) } \end{array}$ (in the discrete case), gives rise to a dual problem of the form Eq. (6), and the proposed algorithms can be adapted.
|
| 102 |
+
|
| 103 |
+
Primal-Dual relationship In order to recover the solution $\pi ^ { \varepsilon }$ of the regularized primal problem (3), we can use the first-order optimality conditions of the Fenchel-Rockafellar’s duality theorem,
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r } { d \pi ^ { \varepsilon } ( x , y ) = H _ { \varepsilon } ( x , y ) d \mu ( x ) d \nu ( y ) \mathrm { ~ w h e r e ~ } H _ { \varepsilon } ( x , y ) = \left\{ \begin{array} { l l } { e ^ { \frac { u ( x ) } { \varepsilon } } e ^ { - \frac { c ( x , y ) } { \varepsilon } } e ^ { \frac { v ( y ) } { \varepsilon } } } & { ( \mathrm { e n t r o p y ~ r e g . } ) } \\ { \frac { 1 } { 2 \varepsilon } \left( u ( x ) + v ( y ) - c ( x , y ) \right) _ { + } \ : ( L ^ { 2 } \mathrm { ~ r e g . } ) } & { . } \end{array} \right. . } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Algorithm The relaxed dual (6) is an unconstrained concave problem which can be maximized through stochastic gradient methods by sampling batches from $\mu \times \nu$ . When $\mu$ is discrete, i.e. $\begin{array} { r } { \mu = \breve { \sum } _ { i = 1 } ^ { n } a _ { i } \delta _ { x _ { i } } } \end{array}$ , the dual variable $u$ is a $n$ -dimensional vector over which we carry the optimization, where $u ( x _ { i } ) \ { \stackrel { \mathrm { d e f . } } { = } } \ u _ { i }$ . When $\mu$ has a density, $u$ is a function on $\mathcal { X }$ which has to be parameterized in order to carry optimization. We thus consider deep neural networks for their ability to approximate
|
| 110 |
+
|
| 111 |
+
# Algorithm 1 Stochastic OT computation
|
| 112 |
+
|
| 113 |
+
<table><tr><td></td><td>1: Inputs: input measures μ,V; cost function c; batch size p; learning rate y. Discrete case: μ = ∑i aiδxi and u is a finite vector: u(xi) @f ui (similarly for v and v)</td></tr><tr><td>2: 3:</td><td>Continuous case: μ is a continuous measure and u is a neural network (similarly for V and u)</td></tr><tr><td></td><td>Vindicates the gradient w.r.t. the parameters</td></tr><tr><td>4:</td><td>while not converged do</td></tr><tr><td>5:</td><td>sample a batch (x1,..,xp) from μ</td></tr><tr><td>6: 7:</td><td>sample a batch (y1,.., yp) from v update u ←u+γ∑ij Vu(xi)+OuFe(u(xi),v(yj))Vu(xi)</td></tr><tr><td>8:</td><td>updateu ← U+γ∑ij Vv(yj)+OUFe(u(xi),v(yj))Vv(yj) 9: :end while</td></tr></table>
|
| 114 |
+
|
| 115 |
+
general functions. Genevay et al. (2016) used the same stochastic dual maximization approach to compute the regularized OT objective in the continuous-continuous setting. The difference lies in their pamaterization of the dual variables as kernel expansions, while we decide to use deep neural networks. Using a neural network for parameterizing a continuous dual variable was done also by Arjovsky et al. (2017). The same discussion also stands for the second dual variable $v$ . Our stochastic gradient algorithm is detailed in Alg. 1.
|
| 116 |
+
|
| 117 |
+
Convergence rates and computational cost comparison. We first discuss convergence rates in the discrete-discrete setting (i.e. both measures are discrete), where the problem is convex, while parameterization of dual variables as neural networks in the semi-discrete or continuous-continuous settings make the problem non-convex. Because the dual (6) is not strongly convex, full-gradient descent converges at a rate of $\mathcal { O } ( 1 / k )$ , where $k$ is the iteration number. SGD with a decreasing step size converges at the inferior rate of $\mathcal { O } ( 1 / \sqrt { k } )$ (Nemirovski et al., 2009), but with a $\mathcal { O } ( 1 )$ cost per iteration. The two rates can be interpolated when using mini-batches, at the cost of $\mathcal { O } ( p ^ { 2 } )$ per iteration, where $p$ is the mini-batch size. In contrast, Genevay et al. (2016) considered a semi-dual objective of the form $\mathbb { E } _ { X \sim \mu } \left[ u ( X ) + G _ { \varepsilon } ( u ( X ) ) \right]$ , with a cost per iteration which is now ${ \mathcal { O } } ( n )$ due to the computation of the gradient of √ $G _ { \varepsilon }$ . Because that objective is not strongly convex either, SGD converges at the same $O ( 1 / \sqrt { k } )$ rate, up to problem-specific constants. As noted by Genevay et al. (2016), this rate can be improved to $\mathcal { O } ( 1 / k )$ while maintaining the same iteration cost, by using stochastic average gradient (SAG) method (Schmidt et al., 2017). However, SAG requires to store past stochastic gradients, which can be problematic in a large-scale setting.
|
| 118 |
+
|
| 119 |
+
In the semi-discrete setting (i.e. one measure is discrete and the other is continuous), SGD on the semi-dual objective proposed by Genevay et al. (2016) also converges at a rate of $\mathcal { O } ( 1 / \sqrt { k } )$ , whereas we only know that Alg. 1 converges to a stationary point in this non-convex case.
|
| 120 |
+
|
| 121 |
+
In the continuous-continuous setting (i.e. both measures are continuous), Genevay et al. (2016) proposed to represent the dual variables as kernel expansions. A disadvantage of their approach, however, is the $\mathcal { O } ( k ^ { 2 } )$ cost per iteration. In contrast, our approach represents dual variables as neural networks. While non-convex, our approach preserves a $\mathcal { O } ( p ^ { 2 } )$ cost per iteration. This parameterization with neural networks was also used by Arjovsky et al. (2017) who maximized the 1-Wasserstein dual-objective function $\mathbb { E } _ { ( X , Y ) \sim \mu \times \nu } \left[ u ( X ) - u ( Y ) \right]$ . Their algorithm is hence very similar to ours, with the same complexity $\mathcal { O } ( p ^ { 2 } )$ per iteration. The main difference is that they had to constrain $u$ to be a Lipschitz function and hence relied of weight clipping in-between gradient updates. The proposed algorithm is capable of computing the regularized OT objective and optimal plans between empirical measures supported on arbitrary large numbers of samples. In statistical machine learning, one aims at estimating the underlying continuous distribution from which empirical observations have been sampled. In the context of optimal transport, one would like to approximate the true (non-regularized) optimal plan between the underlying measures. The next section states theoretical guarantees regarding this problem.
|
| 122 |
+
|
| 123 |
+
# 3.2 CONVERGENCE OF REGULARIZED OT PLANS
|
| 124 |
+
|
| 125 |
+
Consider discrete probability measures $\begin{array} { r } { \mu _ { n } = \sum _ { i = 1 } ^ { n } a _ { i } \delta _ { x _ { i } } \in P ( \mathcal { X } ) } \end{array}$ and $\textstyle \nu _ { n } = \sum _ { j = 1 } ^ { n } b _ { j } \delta _ { y _ { j } } \in P ( \mathcal { Y } )$ Analysis of entropy-regularized linear programs (Cominetti $\&$ San Mart´ın, 1994) shows that the solution $\boldsymbol { \pi } _ { n } ^ { \varepsilon }$ of the entropy-regularized problem (3) converges exponentially fast to a solution $\pi _ { n }$ of the non-regularized OT problem (2). Also, a result about stability of optimal transport (Villani, 2008)[Theorem 5.20] states that, if $\mu _ { n } \mu$ and $\nu _ { n } \to \nu$ weakly, then a sequence $\left( \pi _ { n } \right)$ of optimal transport plans between $\mu _ { n }$ and $\nu _ { n }$ converges weakly to a solution $\pi$ of the OT problem between $\mu$ and $\nu$ . We can thus write,
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\operatorname* { l i m } _ { n \to \infty } \operatorname* { l i m } _ { \varepsilon \to 0 } \pi _ { n } ^ { \varepsilon } = \pi .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
A more refined result consists in establishing the weak convergence of $\pi _ { n } ^ { \varepsilon }$ to $\pi$ when $( n , \varepsilon )$ jointly converge to $( \infty , 0 )$ . This is the result of the following theorem which states a stability property of entropy-regularized plans (proof in the Appendix).
|
| 132 |
+
|
| 133 |
+
$\mu \in P ( \mathcal { X } )$ $\nu \in P ( \mathcal { V } )$ where iscrete $\mathcal { X }$ and babi $\mathcal { V }$ are complete metric spaces. Let measures which converge weakly $\textstyle \mu _ { n } = \sum _ { i = 1 } ^ { n } a _ { i } \delta _ { x _ { i } }$ $\begin{array} { r } { \nu _ { n } = \sum _ { j = 1 } ^ { n } b _ { j } \delta _ { y _ { j } } } \end{array}$ to $\mu$ and $\nu$ respectively, and let $\left( \varepsilon _ { n } \right)$ a sequence of non-negative real numbers converging to 0 sufficiently fast. Assume the cost $c$ is continuous on $\mathcal { X } \times \mathcal { V }$ and finite. Let $\pi _ { n } ^ { \varepsilon _ { n } }$ the solution of the entropy-regularized OT problem (3) between $\mu _ { n }$ and $\nu _ { n }$ . Then, up to extraction of a subsequence, $( \pi _ { n } ^ { \varepsilon _ { n } } )$ converges weakly to the solution $\pi$ of the OT problem (2) between $\mu$ and $\nu$ ,
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\pi _ { n } ^ { \varepsilon _ { n } } \to \pi w e a k l y .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Keeping the analogy with statistical machine learning, this result is an analog to the universal consistency property of a learning method. In most applications, we consider empirical measures and $n$ is fixed, so that regularization, besides enabling dual stochastic approach, may also help learn the optimal plan between the underlying continuous measures.
|
| 140 |
+
|
| 141 |
+
So far, we have derived an algorithm for computing the regularized OT objective and regularized optimal plans regardless of $\mu$ and $\nu$ being discrete or continuous. The OT objective has been used successfully as a loss in machine learning (Montavon et al., 2015; Frogner et al., 2015; Rolet et al., 2016; 2018; Arjovsky et al., 2017; Courty et al., 2017a), whereas the use of optimal plans has straightforward applications in logistics, as well as economy (Kantorovich, 1942; Carlier, 2012) or computer graphics (Bonneel et al., 2011). In numerous applications however, we often need mappings rather than joint distributions. This is all the more motivated since Brenier (1991) proved that when the source measure is continuous, the optimal transport plan is actually induced by a map. Assuming that available data samples are sampled from some underlying continuous distributions, finding the Monge map between these continuous measures rather than a discrete optimal plan between discrete measures is essential in machine learning applications. Hence in the next section, we investigate how to recover an optimal map, i.e. find an approximate solution to the Monge problem (1), from regularized optimal plans.
|
| 142 |
+
|
| 143 |
+
# 4 OPTIMAL MAPPING ESTIMATIONS
|
| 144 |
+
|
| 145 |
+
A map can be obtained from a solution to the OT problem (2) or regularized OT problem (3) through the computation of its barycentric projection. Indeed, a solution $\pi$ of Problem (2) or (3) between a source measure $\mu$ and a target measure $\nu$ is, identifying the plan $\pi$ with its density w.r.t. a reference measure, a function $\pi : ( \bar { x , y } ) \in \mathcal { X } \times \mathcal { Y } \mapsto \mathbb { R } ^ { + }$ which can be seen as a weighted one-to-many map, i.e. $\pi$ sends $x$ to each location $y \in \operatorname { S u p p } ( \nu )$ where $\pi ( x , y ) > 0$ . A map can then be obtained by simply averaging over these $y$ according to the weights $\pi ( x , y )$ .
|
| 146 |
+
|
| 147 |
+
Definition 1. (Barycentric projection) Let $\pi$ be a solution of the OT problem (2) or regularized OT problem (3). The barycentric projection $\bar { \pi }$ w.r.t. a convex cost $d : \mathcal { V } \times \mathcal { V } \mathbb { R } ^ { + }$ is defined as,
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\bar { \pi } ( x ) = \arg \operatorname* { m i n } _ { z } \mathbb { E } _ { Y \sim \pi ( \cdot | x ) } \left[ d ( z , Y ) \right] .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
In the special case $d ( x , y ) = \| x - y \| _ { 2 } ^ { 2 }$ , Eq. (11) has the close form solution $\bar { \pi } ( x ) = \operatorname { \mathbb { E } } _ { Y \sim \pi ( \cdot | x ) } \left[ Y \right] .$ , which is equal to $\begin{array} { r } { \bar { \boldsymbol { \pi } } = \frac { \boldsymbol { \pi } \mathbf { y } ^ { t } } { a } } \end{array}$ in a discrete setting with $\mathbf { y } = ( y _ { 1 } , \dotsb , y _ { n } )$ and $a$ the weights of $\mu$ . Moreover, for the specific squared Euclidean cost $c ( x , y ) = \| x - y \| _ { 2 } ^ { 2 }$ , the barycentric projection $\bar { \pi }$ is an optimal map (Ambrosio et al., 2006)[Theorem 12.4.4], i.e. $\bar { \pi }$ is a solution to the Monge problem (1) between the source measure $\mu$ and the target measure $\bar { \pi } \# \mu$ . Hence the barycentric projection w.r.t. the squared Euclidean cost is often used as a simple way to recover optimal maps from optimal transport plans (Reich, 2013; Wang et al., 2013; Ferradans et al., 2014; Seguy & Cuturi, 2015).
|
| 154 |
+
|
| 155 |
+
<table><tr><td>lgorithm 2 Optimal map learning with SGD</td></tr><tr><td>Inputs: input measures μ, V; cost function c; dual optimal variables u and v; map fe parame-</td></tr><tr><td>terized as a deep NN; batch size n; learning rate y. while not converged do</td></tr><tr><td>sample a batch (x1,·· ,xn) from μ</td></tr><tr><td>sample a batch (y1,:.,yn) from v</td></tr><tr><td>updateθ←0-γ∑ijHe(xi,yj)Vθd(yj,fe(xi)) end while</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Formula (11) provides a pointwise value of the barycentric projection. When $\mu$ is discrete, this means that we only have mapping estimations for a finite number of points. In order to define a map which is defined everywhere, we parameterize the barycentric projection as a deep neural network. We show in the next paragraph how to efficiently learn its parameters.
|
| 158 |
+
|
| 159 |
+
Optimal map learning An estimation $f$ of the barycentric projection of a regularized plan $\pi ^ { \varepsilon }$ which generalizes outside the support of $\mu$ can be obtained by learning a deep neural network which minimizes the following objective w.r.t. the parameters $\theta$ ,
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\begin{array} { r l } & { \mathbb { E } _ { X \sim \mu } \left[ \mathbb { E } _ { Y \sim \pi ^ { \varepsilon } ( \cdot | X ) } \left[ d ( Y , f _ { \theta } ( X ) ) \right] \right] = \mathbb { E } _ { ( X , Y ) \sim \pi ^ { \varepsilon } } \left[ d ( Y , f _ { \theta } ( X ) ) \right] } \\ & { \qquad = \mathbb { E } _ { ( X , Y ) \sim \mu \times \nu } \left[ d ( Y , f _ { \theta } ( X ) ) H _ { \varepsilon } ( X , Y ) \right] . } \end{array}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
When $d ( x , y ) = \| x - y \| ^ { 2 }$ , the last term in Eq. (12) is simply a weighted sum of squared errors, with possibly an infinite number of terms whenever $\mu$ or $\nu$ are continuous. We propose to minimize the objective (12) by stochastic gradient descent, which provides the simple Algorithm 2. The OT problem being symmetric, we can also compute the opposite barycentric projection $g$ w.r.t. a cost $\bar { d } : \mathcal { X } \times \mathcal { X } \overset { } { \to } \bar { \mathbb { R } } ^ { + }$ by minimizing $\mathbb { E } _ { ( X , Y ) \sim \mu \times \nu } \left[ d ( g ( \bar { Y } ) , X ) H _ { \varepsilon } ( \bar { X } , Y ) \right]$ .
|
| 166 |
+
|
| 167 |
+
However, unless the plan $\pi$ is induced by a map, the averaging process results in having the image of the source measure by $\bar { \pi }$ only approximately equal to the target measure $\nu$ . Still, when the size of discrete measure is large and the regularization is small, we show in the next paragraph that 1) the barycentric projection of a regularized OT plan is close to the Monge map between the underlying continuous measures (Theorem 2) and 2) the image of the source measure by this barycentric projection should be close to the target measure $\nu$ (Corollary 1).
|
| 168 |
+
|
| 169 |
+
Theoretical guarantees As stated earlier, when $\mathcal { X } = \mathcal { V }$ and $c ( x , y ) = \| x - y \| _ { 2 } ^ { 2 }$ , Brenier (1991) proved that when the source measure $\mu$ is continuous, there exists a solution to the Monge problem (1). This result was generalized to more general cost functions, see (Villani, 2008)[Corollary 9.3] for details. In that case, the plan $\pi$ between $\mu$ and $\nu$ is written as $( \operatorname { i d } , f ) \# \mu$ where $f$ is the Monge map. Now considering discrete measures $\mu _ { n }$ and $\nu _ { n }$ which converge to $\mu$ (continuous) and $\nu$ respectively, we have proved in Theorem 1 that $\boldsymbol { \pi } _ { n } ^ { \varepsilon }$ converges weakly to $\pi = ( \operatorname { i d } , f ) \# \mu$ when $( n , \varepsilon ) \to ( \infty , 0 )$ . The next theorem, proved in the Appendix, shows that the barycentric projection $\bar { \pi } _ { n } ^ { \varepsilon }$ also converges weakly to the true Monge map between $\mu$ and $\nu$ , justifying our approach.
|
| 170 |
+
|
| 171 |
+
Theorem 2. Let $\mu$ be a continuous probability measure on $\mathbb { R } ^ { d }$ , and $\nu$ an arbitrary probability and measure on $\textstyle \nu _ { n } = { \frac { 1 } { n } } \sum _ { j = 1 } ^ { n } \delta _ { y _ { j } }$ $\mathbb { R } ^ { d }$ and c a cost function satisfying (Villani, 2008)[Corollary 9.3]. Let converging weakly to $\mu$ and $\nu$ n i=1 respectively. Assume that the OT solution $\begin{array} { r } { \mu _ { n } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \delta _ { x _ { i } } } \end{array}$ $\pi _ { n }$ of Problem (2) between $\mu _ { n }$ and $\nu _ { n }$ is unique for all $n$ . Let $\left( \varepsilon _ { n } \right)$ a sequence of non-negative real numbers converging sufficiently fast to 0 and $\bar { \pi } _ { n } ^ { \varepsilon _ { n } }$ the barycentric projection w.r.t. the convex cost $d = c$ of the solution $\pi _ { n } ^ { \varepsilon _ { n } }$ of the entropy-regularized OT problem (3). Then, up to extraction of $a$ subsequence,
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
( i d , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ) \# \mu _ { n } ( i d , f ) \# \mu \ w e a k l y ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where $f$ is the solution of the Monge problem (1) between $\mu$ and $\nu$ .
|
| 178 |
+
|
| 179 |
+
This theorem shows that our estimated barycentric projection is close to an optimal map between the underlying continuous measures for $n$ big and $\varepsilon$ small. The following corollary confirms the intuition that the image of the source measure by this map converges to the underlying target measure.
|
| 180 |
+
|
| 181 |
+
Corollary 1. With the same assumptions as above, ${ \bar { \pi } } _ { n } ^ { \varepsilon _ { n } } \# \mu _ { n } \to \nu$ weakly.
|
| 182 |
+
|
| 183 |
+
In terms of random variables, the last equation states that if $X _ { n } \sim \mu _ { n }$ and $Y \sim \nu$ , then $\bar { \pi } _ { n } ^ { \varepsilon _ { n } } \left( X _ { n } \right)$ converges in distribution to $Y$ .
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 2: Convergence plots of the the Stochastic Dual Algorithm 1 against a stochastic semi-dual implementation (adapted from (Genevay et al., 2016): we use SGD instead of SAG), for several entropy-regularization values. Learning rates are $\{ 5 . , 2 0 . , 2 0 . \}$ and batch sizes $\{ 1 0 2 4 , 5 0 0 , 1 0 0 \}$ respectively and are taken the same for the dual and semi-dual methods.
|
| 187 |
+
|
| 188 |
+
These theoretical results show that our estimated Monge map can thus be used to perform domain adaptation by mapping a source dataset to a target dataset, as well as perform generative modeling by mapping a continuous measure to a target discrete dataset. We demontrate this in the following section.
|
| 189 |
+
|
| 190 |
+
# 5 NUMERICAL EXPERIMENTS
|
| 191 |
+
|
| 192 |
+
# 5.1 DUAL VS SEMI-DUAL SPEED COMPARISONS
|
| 193 |
+
|
| 194 |
+
We start by evaluating the training time of our dual stochastic algorithm 1 against a stochastic semidual approach similar to (Genevay et al., 2016). In the semi-dual approach, one of the dual variable is eliminated and is computed in close form. However, this computation has ${ \mathcal { O } } ( n )$ complexity where $n$ is the size of the target measure $\nu$ . We compute the regularized OT objective with both methods on a spectral transfer problem, which is related to the color transfer problem (Reinhard et al., 2001; Pitie et al., 2007), but where images are multispectral, ´ i.e. they share a finer sampling of the light wavelength. We take two $5 0 0 \times 5 0 0$ images from the CAVE dataset (Yasuma et al., 2010) that have 31 spectral bands. As such, the optimal transport problem is computed on two empirical distributions of 250000 samples in $\mathbb { R } ^ { 3 1 }$ on which we consider the squared Euclidean ground cost $c$ . The timing evolution of train losses are reported in Figure 2 for three different regularization values $\varepsilon = \{ 0 . 0 \bar { 2 } 5 , 0 . 1 , 1 . \}$ . In the three cases, one can observe that convergence of our proposed dual algorithm is much faster.
|
| 195 |
+
|
| 196 |
+
# 5.2 LARGE SCALE DOMAIN ADAPTATION
|
| 197 |
+
|
| 198 |
+
We apply here our computation framework on an unsupervised domain adaptation (DA) task, for which optimal transport has shown to perform well on small scale datasets (Courty et al., 2017b; Perrot et al., 2016; Courty et al., 2014). This restriction is mainly due to the fact that those works only consider the primal formulation of the OT problem. Our goal here is not to compete with the state-of-the-art methods in domain adaptation but to assess that our formulation allows to scale optimal transport based domain adaptation (OTDA) to large datasets. OTDA is illustrated in Fig. 3 and follows two steps: 1) learn an optimal map between the source and target distribution, 2) map the source samples and train a classifier on them in the target domain. Our formulation also allows to use any differentiable ground cost $c$ while (Courty et al., 2017b) was limited to the squared Euclidean distance.
|
| 199 |
+
|
| 200 |
+
Datasets We consider the three cross-domain digit image datasets MNIST (Lecun et al., 1998), USPS, and SVHN (Netzer et al., 2011), which have 10 classes each. For the adaptation between MNIST and USPS, we use 60000 samples in the MNIST domain and 9298 samples in USPS domain. MNIST images are resized to the same resolution as USPS ones $( 1 6 \times 1 6 )$ ). For the adaptation between SVHN and MNIST, we use 73212 samples in the SVHN domain and 60000 samples in the MNIST domain. MNIST images are zero-padded to reach the same resolution as SVHN $( 3 2 \times 3 2 )$ and extended to three channels to match SVHN image sizes. The labels in the target domain are withheld during the adaptation. In the experiment, we consider the adaptation in three directions: M $\mathrm { I N I S T } \to \mathrm { U S P S }$ , $\mathrm { U S P S } \to \mathrm { M N I S T }$ , and $\mathrm { S V H N } \to \mathrm { M N I S T } .$
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 3: Illustration of the OT Domain Adaptation method adapted from (Courty et al., 2017b). Source samples are mapped to the target set through the barycentric projection $\bar { \pi } ^ { \varepsilon }$ . A classifier is then learned on the mapped source samples.
|
| 204 |
+
|
| 205 |
+
Table 1: Results (accuracy in $\%$ ) on domain adaptation among MNIST, USPS and SVHN datasets with entropy $( R _ { e } )$ and L2 $( R _ { L ^ { 2 } } )$ regularizations. Source only refers to 1-NN classification between source and target samples without adaptation.
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>MNIST→USPS</td><td rowspan=1 colspan=1>USPS→MNIST</td><td rowspan=1 colspan=1>SVHN→MNIST</td></tr><tr><td rowspan=7 colspan=1>Source onlyBar. proj. OTBar. proj. OT with ReBar. proj. Alg. 1 with ReBar. proj. Alg.1 with RL2Monge map Alg. 1+2 with ReMonge map Alg. 1+2 with RL2</td><td rowspan=1 colspan=1>73.47</td><td rowspan=1 colspan=1>36.97</td><td rowspan=1 colspan=1>54.33</td></tr><tr><td rowspan=1 colspan=1>57.75</td><td rowspan=1 colspan=1>52.46</td><td rowspan=2 colspan=1>intractableintractable</td></tr><tr><td rowspan=1 colspan=1>68.75</td><td rowspan=1 colspan=1>57.35</td></tr><tr><td rowspan=3 colspan=1>68.8467.877.92</td><td rowspan=1 colspan=1>57.55</td><td rowspan=2 colspan=1>58.8760.56</td></tr><tr><td rowspan=1 colspan=1>57.47</td></tr><tr><td rowspan=1 colspan=1>60.02</td><td rowspan=2 colspan=1>61.1162.88</td></tr><tr><td rowspan=1 colspan=1>72.61</td><td rowspan=1 colspan=1>60.50</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Methods and experimental setup Our goal is to demonstrate the potential of the proposed method in large-scale settings. Adaptation performance is evaluated using a 1-nearest neighbor (1-NN) classifier, since it has the advantage of being parameter free and allows better assessment of the quality of the adapted representation, as discussed in (Courty et al., 2017b). In all experiments, we consider the 1-NN classification as a baseline, where labeled neighbors are searched in the source domain and the accuracy is computed on target data. We compare our approach to previous OTDA methods where an optimal map is obtained through the discrete barycentric projection of either an optimal plan (computed with the network simplex algorithm1) or an entropy-regularized optimal plan (computed with the Sinkhorn algorithm (Cuturi, 2013)), whenever their computation is tractable. Note that these methods do not provide out-of-sample mapping. In all experiments, the ground cost $c$ is the squared Euclidean distance and the barycentric projection is computed w.r.t. that cost. We learn the Monge map of our proposed approach with either entropy or L2 regularizations. Regarding the adaptation between SVHN and MNIST, we extract deep features by learning a modified LeNet architecture on the source data and extracting the 100-dimensional features output by the top hidden layer. Adaptation is performed on those features. We report for all the methods the best accuracy over the hyperparameters on the target dataset. While this setting is unrealistic in a practical DA application, it is widely used in the DA community (Long et al., 2013) and our goal is here to investigate the relative performances of large-scale OTDA in a fair setting.
|
| 210 |
+
|
| 211 |
+
Hyper-parameters and learning rate The value for the regularization parameter is set in $\{ 5 , 2 , 0 . 9 , 0 . 5 , 0 . 1 , 0 . 0 5 , 0 . 0 1 \}$ . Adam optimizer with batch size 1000 is used to optimize the network. The learning rate is varied in $\{ 2 , 0 . 9 , 0 . 1 , 0 . 0 1 , 0 . 0 0 1 , 0 . 0 0 0 1 \}$ . The learned Monge map $f$ in Alg. 2 is parameterized as a neural network with two fully-connected hidden layers $\mathit { \Delta } d \to 2 0 0 \to 5 0 0 \to d \ u { a }$ and ReLU activations, and the weights are optimized using the Adam optimizer with learning rate equal to $1 0 ^ { - 4 }$ and batch size equal to 1000. For the Sinkhorn algorithm, regularization value is chosen from $\{ 0 . 0 1 , 0 . 1 , 0 . 5 , 0 . 9 , 2 . 0 , 5 . 0 , 1 0 . 0 \}$ .
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 4: Samples generated by our optimal generator learned through Algorithms 1 and 2.
|
| 215 |
+
|
| 216 |
+
Results Results are reported in Table 1. In all cases, our proposed approach outperforms previous OTDA algorithms. On MNIST USPS, previous OTDA methods perform worse than using directly source labels, whereas our method leads to successful adaptation results with $20 \%$ and $10 \%$ accuracy points over OT and regularized OT methods respectively. On USPS MNIST, all three algorithms lead to successful adaptation results, but our method achieves the highest adaptation results. Finally, on the challenging large-scale adaptation task SVHN MNIST, only our method is able to handle the whole datasets, and outperforms the source only results.
|
| 217 |
+
|
| 218 |
+
Comparing the results between the barycentric projection and estimated Monge map illustrates that learning a parametric mapping provides some kind of regularization, and improves the performance.
|
| 219 |
+
|
| 220 |
+
# 5.3 GENERATIVE OPTIMAL TRANSPORT (GOT)
|
| 221 |
+
|
| 222 |
+
Approach Corollary 1 shows that when the support of the discrete measures $\mu$ and $\nu$ is large and the regularization $\varepsilon$ is small, then we have approximately ${ \bar { \pi } } ^ { \varepsilon } \# \mu = \nu$ . This observation motivates the use of our Monge map estimation as a generator between an arbitrary continuous measure $\mu$ and a discrete measure $\nu$ representing the discrete distribution of some dataset. We can thus obtain a generative model by first computing regularized OT through Alg. 1 between a Gaussian measure $\mu$ and a discrete dataset $\nu$ and then compute our generator with Alg. 2. This requires to have a cost function between the latent variable $X \sim \mu$ and the discrete variable $Y \sim \nu$ . The property we gain compared to other generative models is that our generator is, at least approximately, an optimal map w.r.t. this cost. In our case, the Gaussian is taken with the same dimensionality as the discrete data and the squared Euclidean distance is used as ground cost $c$ .
|
| 223 |
+
|
| 224 |
+
Permutation-invariant MNIST We preprocess MNIST data by rescaling grayscale values in $[ - 1 , 1 ]$ . We run Alg. 1 and Alg. 2 where $\mu$ is a Gaussian whose mean and covariance are taken equal to the empirical mean and covariance of the preprocessed MNIST dataset; we have observed that this makes the learning easier. The target discrete measure $\nu$ is the preprocessed MNIST dataset. Permutation invariance means that we consider each grayscale $2 8 \times 2 8$ images as a 784-dimensional vector and do not rely on convolutional architectures. In Alg. 1 the dual potential $u$ is parameterized as a $\mathit { \Delta } d 1 0 2 4 1 0 2 4 1 \mathrm { { \Omega } }$ ) fully-connected NN with ReLU activations for each hidden layer, and the $L ^ { 2 }$ regularization is considered as it produced experimentally less blurring. The barycentric projection $f$ of Alg. 2 is parameterized as a $\mathit { \Delta } d 1 0 2 4 1 0 2 4 d \mathit { \Delta }$ ) fully-connected NN with ReLU activation for each hidden layer and a tanh activation on the output layer. We display some generated samples in Fig. 4.
|
| 225 |
+
|
| 226 |
+
# 6 CONCLUSION
|
| 227 |
+
|
| 228 |
+
We proposed two original algorithms that allow for $i$ ) large-scale computation of regularized optimal transport $\romannumeral 2$ ) learning an optimal map that moves one probability distribution onto another (the so-called Monge map). To our knowledge, our approach introduces the first tractable algorithms for computing both the regularized OT objective and optimal maps in large-scale or continuous settings. We believe that these two contributions enable a wider use of optimal transport strategies in machine learning applications. Notably, we have shown how it can be used in an unsupervised domain adaptation setting, or in generative modeling, where a Monge map acts directly as a generator. Our consistency results show that our approach is theoretically well-grounded. An interesting direction for future work is to investigate the corresponding convergence rates of the empirical regularized optimal plans. We believe this is a very complex problem since technical proofs regarding convergence rates of the empirical OT objective used e.g. in (Sriperumbudur et al., 2012; Boissard et al., 2014; Fournier & Guillin, 2015) do not extend simply to the optimal transport plans.
|
| 229 |
+
|
| 230 |
+
# ACKNOWLEDGMENTS
|
| 231 |
+
|
| 232 |
+
This work benefited from the support of the project OATMIL ANR-17-CE23-0012 of the French National Research Agency (ANR). We thank the anonymous reviewers and Arthur Mensh for the careful reading and helpful comments regarding the present article.
|
| 233 |
+
|
| 234 |
+
# REFERENCES
|
| 235 |
+
|
| 236 |
+
Luigi Ambrosio, Nicola Gigli, and Giuseppe Savare.´ Gradient flows: in metric spaces and in the space of probability measures. Springer, 2006.
|
| 237 |
+
|
| 238 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International Conference on Machine Learning, pp. 214–223, 2017.
|
| 239 |
+
|
| 240 |
+
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.
|
| 241 |
+
|
| 242 |
+
Jean-David Benamou and Yann Brenier. A computational fluid mechanics solution to the mongekantorovich mass transfer problem. Numerische Mathematik, 84(3):375–393, 2000.
|
| 243 |
+
|
| 244 |
+
Garrett Birkhoff. Three observations on linear algebra. Univ. Nac. Tucuman. Revista A ´ , 5:147–151, 1946.
|
| 245 |
+
|
| 246 |
+
Mathieu Blondel, Vivien Seguy, and Antoine Rolet. Smooth and sparse optimal transport. In Proc. of AISTATS, 2018.
|
| 247 |
+
|
| 248 |
+
Emmanuel Boissard, Thibaut Le Gouic, et al. On the mean speed of convergence of empirical and occupation measures in wasserstein distance. In Annales de l’Institut Henri Poincare, Probabilit ´ es´ et Statistiques, volume 50, pp. 539–563. Institut Henri Poincare, 2014. ´
|
| 249 |
+
|
| 250 |
+
Nicolas Bonneel, Michiel Van De Panne, Sylvain Paris, and Wolfgang Heidrich. Displacement interpolation using lagrangian mass transport. In ACM Transactions on Graphics (TOG), volume 30, pp. 158. ACM, 2011.
|
| 251 |
+
|
| 252 |
+
Yann Brenier. Polar factorization and monotone rearrangement of vector-valued functions. Communications on pure and applied mathematics, 44(4):375–417, 1991.
|
| 253 |
+
|
| 254 |
+
Guillaume Carlier. Optimal transportation and economic applications. Lecture Notes.(Cited on page 2.), 2012.
|
| 255 |
+
|
| 256 |
+
Roberto Cominetti and Jaime San Mart´ın. Asymptotic analysis of the exponential penalty trajectory in linear programming. Mathematical Programming, 67(1-3):169–187, 1994.
|
| 257 |
+
|
| 258 |
+
Nicolas Courty, Remi Flamary, and Devis Tuia. Domain adaptation with regularized optimal ´ transport. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 274–289. Springer, 2014.
|
| 259 |
+
|
| 260 |
+
Nicolas Courty, Remi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution ´ optimal transportation for domain adaptation. arXiv preprint arXiv:1705.08848, 2017a.
|
| 261 |
+
|
| 262 |
+
Nicolas Courty, Remi Flamary, Devis Tuia, and Alain Rakotomamonjy. Optimal Transport for Domain Adaptation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(9): 1853–1865, sep 2017b.
|
| 263 |
+
|
| 264 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems, pp. 2292–2300, 2013.
|
| 265 |
+
|
| 266 |
+
Arnaud Dessein, Nicolas Papadakis, and Jean-Luc Rouas. Regularized optimal transport and the rot mover’s distance. arXiv preprint arXiv:1610.06447, 2016.
|
| 267 |
+
|
| 268 |
+
Lawrence C Evans and Wilfrid Gangbo. Differential equations methods for the Monge-Kantorovich mass transfer problem, volume 653. American Mathematical Soc., 1999.
|
| 269 |
+
|
| 270 |
+
Sira Ferradans, Nicolas Papadakis, Gabriel Peyre, and Jean-Franc¸ois Aujol. Regularized discrete ´ optimal transport. SIAM Journal on Imaging Sciences, 7(3):1853–1882, 2014.
|
| 271 |
+
|
| 272 |
+
Nicolas Fournier and Arnaud Guillin. On the rate of convergence in wasserstein distance of the empirical measure. Probability Theory and Related Fields, 162(3-4):707–738, 2015.
|
| 273 |
+
|
| 274 |
+
Charlie Frogner, Chiyuan Zhang, Hossein Mobahi, Mauricio Araya, and Tomaso A Poggio. Learning with a wasserstein loss. In Advances in Neural Information Processing Systems, pp. 2053– 2061, 2015.
|
| 275 |
+
|
| 276 |
+
Aude Genevay, Marco Cuturi, Gabriel Peyre, and Francis Bach. Stochastic optimization for large- ´ scale optimal transport. In Advances in Neural Information Processing Systems, pp. 3432–3440, 2016.
|
| 277 |
+
|
| 278 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014.
|
| 279 |
+
|
| 280 |
+
Raghuraman Gopalan, Ruonan Li, and Rama Chellappa. Domain adaptation for object recognition: An unsupervised approach. In Computer Vision (ICCV), 2011 IEEE International Conference on, pp. 999–1006. IEEE, 2011.
|
| 281 |
+
|
| 282 |
+
Leonid Vitalievich Kantorovich. On the translocation of masses. In Dokl. Akad. Nauk SSSR, volume 37, pp. 199–201, 1942.
|
| 283 |
+
|
| 284 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 285 |
+
|
| 286 |
+
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. ISSN 00189219. doi: 10.1109/5.726791.
|
| 287 |
+
|
| 288 |
+
Yujia Li, Kevin Swersky, and Rich Zemel. Generative moment matching networks. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1718–1727, 2015.
|
| 289 |
+
|
| 290 |
+
Mingsheng Long, Jianmin Wang, Guiguang Ding, Jiaguang Sun, and Philip S Yu. Transfer feature learning with joint distribution adaptation. In Proceedings of the IEEE international conference on computer vision, pp. 2200–2207, 2013.
|
| 291 |
+
|
| 292 |
+
Quentin Merigot. A multiscale approach to optimal transport. In ´ Computer Graphics Forum, volume 30, pp. 1583–1592. Wiley Online Library, 2011.
|
| 293 |
+
|
| 294 |
+
G. Monge. Memoire sur la theorie des deblais et des remblais. ´ Histoire de l’Academie Royale des ´ Sciences de Paris, 1781.
|
| 295 |
+
|
| 296 |
+
Gregoire Montavon, Klaus-Robert M ´ uller, and Marco Cuturi. Wasserstein training of boltzmann ¨ machines. arXiv preprint arXiv:1507.01972, 2015.
|
| 297 |
+
|
| 298 |
+
Tarek A. El Moselhy and Youssef M. Marzouk. Bayesian inference with optimal maps. Journal of Computational Physics, 231(23):7815 – 7850, 2012. ISSN 0021-9991. doi: https:// doi.org/10.1016/j.jcp.2012.07.022. URL http://www.sciencedirect.com/science/ article/pii/S0021999112003956.
|
| 299 |
+
|
| 300 |
+
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.
|
| 301 |
+
|
| 302 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading Digits in Natural Images with Unsupervised Feature Learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011.
|
| 303 |
+
|
| 304 |
+
Nicolas Papadakis, Gabriel Peyre, and Edouard Oudet. Optimal transport with proximal splitting. ´ SIAM Journal on Imaging Sciences, 7(1):212–238, 2014.
|
| 305 |
+
|
| 306 |
+
Michael Perrot, Nicolas Courty, R ¨ emi Flamary, and Amaury Habrard. Mapping Estimation for Dis-´ crete Optimal Transport. In Neural Information Processing System, Barcelone, Spain, December 2016.
|
| 307 |
+
|
| 308 |
+
Franc¸ois Pitie, Anil C Kokaram, and Rozenn Dahyot. Automated colour grading using colour dis- ´ tribution transfer. Computer Vision and Image Understanding, 107(1):123–137, 2007.
|
| 309 |
+
|
| 310 |
+
Sebastian Reich. A dynamical systems framework for intermittent data assimilation. BIT Numerical Mathematics, 51(1):235–249, 2011.
|
| 311 |
+
|
| 312 |
+
Sebastian Reich. A nonparametric ensemble transform method for bayesian inference. SIAM Journal on Scientific Computing, 35(4):A2013–A2024, 2013.
|
| 313 |
+
|
| 314 |
+
Erik Reinhard, Michael Adhikhmin, Bruce Gooch, and Peter Shirley. Color transfer between images. IEEE Computer graphics and applications, 21(5):34–41, 2001.
|
| 315 |
+
|
| 316 |
+
Antoine Rolet, Marco Cuturi, and Gabriel Peyre. Fast dictionary learning with a smoothed wasser- ´ stein loss. In Proceedings of the 19th International Conference on Artificial Intelligence and Statistics, pp. 630–638, 2016.
|
| 317 |
+
|
| 318 |
+
Antoine Rolet, Vivien Seguy, Mathieu Blondel, and Hiroshi Sawada. Blind source separation with optimal transport non-negative matrix factorization. arXiv preprint arXiv:1802.05429, 2018.
|
| 319 |
+
|
| 320 |
+
Mark Schmidt, Nicolas Le Roux, and Francis Bach. Minimizing finite sums with the stochastic average gradient. Mathematical Programming, 162(1-2):83–112, 2017.
|
| 321 |
+
|
| 322 |
+
Vivien Seguy and Marco Cuturi. Principal geodesic analysis for probability measures under the optimal transport metric. In Advances in Neural Information Processing Systems, pp. 3312–3320, 2015.
|
| 323 |
+
|
| 324 |
+
Justin Solomon, Raif Rustamov, Leonidas Guibas, and Adrian Butscher. Earth mover’s distances on discrete surfaces. ACM Transactions on Graphics (TOG), 33(4):67, 2014.
|
| 325 |
+
|
| 326 |
+
Bharath K Sriperumbudur, Kenji Fukumizu, Arthur Gretton, Bernhard Scholkopf, Gert RG Lanck-¨ riet, et al. On the empirical estimation of integral probability metrics. Electronic Journal of Statistics, 6:1550–1599, 2012.
|
| 327 |
+
|
| 328 |
+
Zhengyu Su, Yalin Wang, Rui Shi, Wei Zeng, Jian Sun, Feng Luo, and Xianfeng Gu. Optimal mass transport for shape matching and comparison. IEEE transactions on pattern analysis and machine intelligence, 37(11):2246–2259, 2015.
|
| 329 |
+
|
| 330 |
+
Cedric Villani. ´ Optimal transport: old and new, volume 338. Springer, 2008.
|
| 331 |
+
|
| 332 |
+
Wei Wang, Dejan Slepcev, Saurav Basu, John A Ozolek, and Gustavo K Rohde. A linear optimal ˇ transportation framework for quantifying and visualizing variations in sets of images. International journal of computer vision, 101(2):254–269, 2013.
|
| 333 |
+
|
| 334 |
+
Fumihito Yasuma, Tomoo Mitsunaga, Daisuke Iso, and Shree K Nayar. Generalized assorted pixel camera: postcapture control of resolution, dynamic range, and spectrum. IEEE Transactions on Image Processing, 19(9):2241–2253, 2010.
|
| 335 |
+
|
| 336 |
+
# Appendix
|
| 337 |
+
|
| 338 |
+
# A PROOFS
|
| 339 |
+
|
| 340 |
+
# Proof of Theorem 1.
|
| 341 |
+
|
| 342 |
+
Proof. Let $\pi _ { n }$ be the solution of the OT problem (2) between $\mu _ { n }$ and $\nu _ { n }$ which has maximum entropy. A result about stability of optimal transport (Villani, 2008)[Theorem 5.20] states that, up to extraction of a subsequence, $\pi _ { n }$ converges weakly to a solution $\pi$ of the OT problem between $\mu$ and $\nu$ (regardless of $\pi _ { n }$ being the solution with maximum entropy or not). We still write $\left( \pi _ { n } \right)$ this subsequence, as well as $\left( \pi _ { n } ^ { \varepsilon _ { n } } \right)$ the corresponding subsequence.
|
| 343 |
+
|
| 344 |
+
Let $g \in \mathcal { C } _ { b } ( \mathcal { X } \times \mathcal { Y } )$ a bounded continuous function on $\mathcal { X } \times \mathcal { V }$ . We have,
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\int _ { \mathcal { X } \times \mathcal { Y } } g d \pi _ { n } ^ { \varepsilon _ { n } } - \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi = \left( \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi _ { n } ^ { \varepsilon _ { n } } - \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi _ { n } \right) + \left( \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi _ { n } - \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi \right) _ { n } ,
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
The second term in the right-hand side converges to 0 as a result of the previously mentioned stability of optimal transport (Villani, 2008)[Theorem 5.20]. We now show the convergence of the first term to 0 when $\varepsilon _ { n } \to 0$ sufficiently fast. We have,
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\begin{array} { l } { \displaystyle \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi _ { n } ^ { \varepsilon _ { n } } - \int _ { \mathcal { X } \times \mathcal { Y } } g d \pi _ { n } \bigg | = \left| \sum _ { i = 1 , n \ j = 1 , n } g ( x _ { i } , y _ { j } ) \pi _ { n } ^ { \varepsilon _ { n } } ( x _ { i } , y _ { j } ) - \sum _ { i = 1 , n \ j = 1 , n } g ( x _ { i } , y _ { j } ) \pi _ { n } ( x _ { i } , y _ { j } ) \right| } \\ { \displaystyle \leqslant M _ { g } \sum _ { i j } | \pi _ { n } ^ { \varepsilon _ { n } } ( x _ { i } , y _ { j } ) - \pi _ { n } ( x _ { i } , y _ { j } ) | } \\ { \displaystyle = M _ { g } \| \pi _ { n } ^ { \varepsilon _ { n } } - \pi _ { n } \| _ { \mathbb { R } ^ { n \times n } , 1 } } \end{array}
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
where $M _ { g }$ is an upper-bound of $g$ . A convergence result by Cominetti & San Mart´ın (1994) shows that there exists positive constants (w.r.t. $\varepsilon _ { n }$ ) $M _ { c _ { n } , \mu _ { n } , \nu _ { n } }$ and $\lambda _ { c _ { n } , \mu _ { n } , \nu _ { n } }$ such that,
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\| \pi _ { n } ^ { \varepsilon _ { n } } - \pi _ { n } \| _ { \mathbb { R } ^ { n \times n } , 1 } \leqslant M _ { c _ { n } , \mu _ { n } , \nu _ { n } } e ^ { - \frac { \lambda _ { c _ { n } , \mu _ { n } , \nu _ { n } } } { \varepsilon _ { n } } }
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
where $c _ { n } = ( c ( x _ { 1 } , y _ { 1 } ) , \cdot \cdot \cdot , c ( x _ { n } , y _ { n } ) )$ . The subscript indices indicate the dependences of each constant. Hence, we see that choosing any $\left( \varepsilon _ { n } \right)$ such that the right-hand side of Eq. (16) tends to 0 provides the results. In particular, we can take
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\varepsilon _ { n } = \frac { \lambda _ { c _ { n } , \mu _ { n } , \nu _ { n } } } { \ln ( n M _ { c _ { n } , \mu _ { n } , \nu _ { n } } ) }
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
which suffices to have the convergence of (15) to 0 for any bounded continuous function $g \in \mathcal { C } _ { b } ( \mathcal { X } \times$ $\mathcal { V }$ ). This proves the weak convergence of $\pi _ { n } ^ { \varepsilon _ { n } }$ to $\pi$ . □
|
| 369 |
+
|
| 370 |
+
# Proof of Theorem 2.
|
| 371 |
+
|
| 372 |
+
Proof. First, note that the existence of a Monge map between $\mu$ and $\nu$ follows from the absolute continuity of $\mu$ and the assumptions on the cost functions $c$ (Villani, 2008)[Corollary 9.3]. Let $g \in \mathcal { C } _ { l } ( \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } )$ a Lipschitz function on $\mathbb { R } ^ { d } \times \mathbb { R } ^ { d }$ . Let $\pi _ { n }$ be the unique (by assumption) solution of the OT problem between $\mu _ { n }$ and $\nu _ { n }$ . We have,
|
| 373 |
+
|
| 374 |
+
$$
|
| 375 |
+
\begin{array} { r l r } & { } & { \displaystyle \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ) \# \mu _ { n } - \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , f ) \# \mu = ( \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ) \# \mu _ { n } - \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ) \# \mu } \\ & { } & { \displaystyle + ( \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ) \# \mu _ { n } - \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , f ) \# \mu ) \mathrm { i d } \mu \mathrm { ) , ~ } } \end{array}
|
| 376 |
+
$$
|
| 377 |
+
|
| 378 |
+
Since $\mu _ { n }$ and $\nu _ { n }$ are uniform discrete probability measures supported on the same number of points, we know by (Birkhoff, 1946) that the optimal transport $\pi _ { n }$ is actually an optimal assignment $T _ { n }$ , so that we have $\pi _ { n } = ( \mathrm { i d } , T _ { n } ) \# \mu _ { n }$ . This also implies $\bar { \pi } _ { n } = T _ { n }$ so that $( \mathrm { i d } , \bar { \pi } _ { n } ) \# \mu _ { n } = ( \mathrm { i d } , T _ { n } ) \# \mu _ { n }$ . Hence, the second term in the right-hand side of (18) converges to 0 as a result of the stability of optimal transport (Villani, 2008)[Theorem 5.20]. Now, we show that the first term also converges to 0 for $\varepsilon _ { n }$ converging sufficiently fast to 0. By definition of the pushforward operator,
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
\int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ) \# \mu _ { n } - \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ) \# \mu _ { n } = \int _ { \mathbb { R } ^ { d } } g ( x , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ( x ) d \mu _ { n } ( x ) - \int _ { \mathbb { R } ^ { d } } g ( x , T _ { n } ( x ) ) d \mu _ { n } ( x ) \mathrm { d } \mu _ { n } \mathrm { d } \mu _ { n }
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
and we can bound,
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
\begin{array} { r l } { \displaystyle \int _ { \mathbb R ^ { d } } g ( x , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ( x ) ) d \mu _ { n } ( x ) - \displaystyle \int _ { \mathbb R ^ { d } } g ( x , T _ { n } ( x ) ) d \mu _ { n } ( x ) \bigg \rvert = \displaystyle \bigg \lvert \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } g ( x _ { i } , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ( x _ { i } ) ) - \frac { 1 } { n } \displaystyle \sum _ { i = 1 } ^ { n } g ( x _ { i } , T _ { n } ( x _ { i } ) ) } \\ { \displaystyle } & { \leqslant \displaystyle \sum _ { i } K _ { g } \| \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ( x _ { i } ) - T _ { n } ( x _ { i } ) \| _ { \mathbb R ^ { d } , 2 } } \\ { \displaystyle } & { = n K _ { g } \| \pi _ { n } ^ { \varepsilon _ { n } } Y _ { n } - \pi _ { n } Y _ { n } \| _ { \mathbb R ^ { n \times n } , 2 } } \\ { \displaystyle } & { \leqslant n K _ { g } \| \pi _ { n } ^ { \varepsilon _ { n } } - \pi _ { n } \| _ { \mathbb R ^ { n \times n } , 2 } ^ { 1 / 2 } \| Y _ { n } \| _ { \mathbb R ^ { n \times d } , 2 } ^ { 1 / 2 } } \end{array}
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
where $Y _ { n } = ( y _ { 1 } , \cdots , y _ { n } ) ^ { t }$ and $K _ { g }$ is the Lipschitz constant of $g$ . The first inequality follows from $g$ being Lipschitz. The next equality follows from the discrete close form of the barycentric projection. The last inequality is obtained through Cauchy-Schwartz. We can now use the same arguments as in the previous proof. A convergence result by Cominetti & San Mart´ın (1994) shows that there exists positive constants (w.r.t. $\varepsilon _ { n }$ ) $M _ { c _ { n } , \mu _ { n } , \nu _ { n } }$ and $\lambda _ { c _ { n } , \mu _ { n } , \nu _ { n } }$ such that,
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { r } { \| \pi _ { n } ^ { \varepsilon _ { n } } - \pi _ { n } \| _ { \mathbb { R } ^ { n \times n } , 2 } ^ { 1 / 2 } \leqslant M _ { c _ { n } , \mu _ { n } , \nu _ { n } } e ^ { - \frac { \lambda _ { c _ { n } , \mu _ { n } , \nu _ { n } } } { \varepsilon _ { n } } } \qquad } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
where $c _ { n } = ( c ( x _ { 1 } , y _ { 1 } ) , \cdot \cdot \cdot , c ( x _ { n } , y _ { n } ) )$ . The subscript indices indicate the dependences of each constant. Hence, we see that choosing any $\left( \varepsilon _ { n } \right)$ such that (21) tends to 0 provides the results. In particular, we can take
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
\varepsilon _ { n } = \frac { \lambda _ { c _ { n } , \mu _ { n } , \nu _ { n } } } { \ln ( n ^ { 2 } \| Y _ { n } \| _ { \mathbb { R } ^ { n } \times d , 2 } ^ { 1 / 2 } M _ { c _ { n } , \mu _ { n } , \nu _ { n } } ) }
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
which suffices to have the convergence of (15) to 0 for Lipschitz function $g \in \mathcal { C } _ { l } ( \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } )$ . This proves the weak convergence of $( \mathrm { i d } , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ) \# \mu _ { n }$ to $( \operatorname { i d } , f ) \# \mu$ . □
|
| 403 |
+
|
| 404 |
+
# Proof of Corollary 1.
|
| 405 |
+
|
| 406 |
+
Proof. Let $\textit { h } \in \mathcal { C } _ { b } ( \mathbb { R } ^ { d } )$ a bounded continuous function. Let $g ~ \in ~ \mathcal { C } _ { b } ( \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } )$ defined as $g : { \mathit { \Phi } } ( x , y ) \mapsto h ( y )$ . We have,
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\int _ { \mathbb { R } ^ { d } } h d \bar { \pi } _ { n } ^ { \varepsilon _ { n } } \# \mu _ { n } - \int _ { \mathbb { R } ^ { d } } h d f \# \mu = \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , \bar { \pi } _ { n } ^ { \varepsilon _ { n } } ) \# \mu _ { n } - \int _ { \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } } g d ( \mathrm { i d } , f ) \# \mu _ { n }
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
which converges to 0 by Theorem (2). Since $f \# \mu = \nu$ , this proves the corollary.
|
md/train/BJGVX3CqYm/BJGVX3CqYm.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MIXED PRECISION QUANTIZATION OF CONVNETS VIA DIFFERENTIABLE NEURAL ARCHITECTURE SEARCH
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent work in network quantization has substantially reduced the time and space complexity of neural network inference, enabling their deployment on embedded and mobile devices with limited computational and memory resources. However, existing quantization methods often represent all weights and activations with the same precision (bit-width). In this paper, we explore a new dimension of the design space: quantizing different layers with different bit-widths. We formulate this problem as a neural architecture search problem and propose a novel differentiable neural architecture search (DNAS) framework to efficiently explore its exponential search space with gradient-based optimization. Experiments show we surpass the state-of-the-art compression of ResNet on CIFAR-10 and ImageNet. Our quantized models with 21.1x smaller model size or $1 0 3 . 9 \mathrm { X }$ lower computational cost can still outperform baseline quantized or even full precision models.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recently, ConvNets have become the de-facto method in a wide range of computer vision tasks, achieving state-of-the-art performance. However, due to high computation complexity, it is nontrivial to deploy ConvNets to embedded and mobile devices with limited computational and storage budgets. In recent years, research efforts in both software and hardware have focused on lowprecision inference of ConvNets. Most of the existing quantization methods use the same precision for all (or most of) the layers of a ConvNet. However, such uniform bit-width assignment can be suboptimal since quantizing different layers can have different impact on the accuracy and efficiency of the overall network. Although mixed precision computation is widely supported in a wide range of hardware platforms such as CPUs, FPGAs, and dedicated accelerators, prior efforts have not thoroughly explored the mixed precision quantization of ConvNets.
|
| 12 |
+
|
| 13 |
+
For a ConvNet with $N$ layers and $M$ candidate precisions in each layer, we want to find an optimal assignment of precisions to minimize the cost in terms of model size, memory footprint or computation, while keeping the accuracy. An exhaustive combinatorial search has exponential time complexity $( \mathcal { O } ( M ^ { N } ) )$ . Therefore, we need a more efficient approach to explore the design space.
|
| 14 |
+
|
| 15 |
+
In this work, we propose a novel, effective, and efficient differentiable neural architecture search (DNAS) framework to solve this problem. The idea is illustrated in Fig. 1. The problem of neural architecture search (NAS) aims to find the optimal neural net architecture in a given search space. In the DNAS framework, we represent the architecture search space with a stochastic super net where nodes represent intermediate data tensors of the super net (e.g., feature maps of a ConvNet) and edges represent operators (e.g., convolution layers in a ConvNet). Any candidate architecture can be seen as a child network (sub-graph) of the super net. When executing the super net, edges are executed stochastically and the probability of execution is parameterized by some architecture parameters $\pmb \theta$ . Under this formulation, we can relax the NAS problem and focus on finding the optimal $\pmb \theta$ that gives the optimal expected performance of the stochastic super net. The child network can then be sampled from the optimal architecture distribution.
|
| 16 |
+
|
| 17 |
+
We solve for the optimal architecture parameter $\pmb \theta$ by training the stochastic super net with SGD with respect to both the network’s weights and the architecture parameter $\pmb \theta$ . To compute the gradient of $\pmb \theta$ , we need to back propagate gradients through discrete random variables that control the stochastic edge execution. To address this, we use the Gumbel SoftMax function (Jang et al. (2016)) to “soft-control” the edges. This allows us to directly compute the gradient estimation of $\pmb \theta$ with a controllable trade-off between bias and variance. Using this technique, the stochastic super net becomes fully differentiable and can be effectively and efficiently solved by SGD.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Illustration of a stochastic super net. Nodes represent data tensors and edges represent operators. Edges are executed stochastically following the distribution $P _ { \theta }$ . $\pmb \theta$ denotes the architecture parameter and $\textbf { \em w }$ denotes network weights. The stochastic super net is fully differentiable.
|
| 21 |
+
|
| 22 |
+
We apply the DNAS framework to solve the mixed precision quantization problem, by constructing a super net whose macro architecture (number of layers, filter size of each layer, etc.) is the same as the target network. Each layer of the super net contains several parallel edges representing convolution operators with quantized weights and activations with different precisions. We show that using DNAS to search for layer-wise precision assignments for ResNet models on CIFAR10 and ImageNet, we surpass the state-of-the-art compression. Our quantized models with $2 1 . 1 \mathbf { x }$ smaller model size or $1 0 3 . 9 \mathrm { X }$ smaller computational cost can still outperform baseline quantized or even full precision models. The DNAS pipeline is very fast, taking less than 5 hours on 8 V100 GPUs to complete a search on ResNet18 for ImageNet, while previous NAS algorithms (such as Zoph & Le (2016)) typically take a few hundred GPUs for several days. Last, but not least, DNAS is a general architecture search framework that can be applied to other problems such as efficient ConvNet-structure discovery. Due to the page limit, we will leave the discussion to future publications.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
Network quantization received a lot of research attention in recent years. Early works such as Han et al. (2015); Zhu et al. (2016); Leng et al. (2017) mainly focus on quantizing neural network weights while still using 32-bit activations. Quantizing weights can reduce the model size of the network and therefore reduce storage space and over-the-air communication cost. More recent works such as Rastegari et al. (2016); Zhou et al. (2016); Choi et al. (2018); Jung et al. (2018); Zhuang et al. (2018) quantize both weights and activations to reduce the computational cost on CPUs and dedicated hardware accelerators. Most of the works use the same precision for all or most of the layers of a network. The problem of mixed precision quantization is rarely explored.
|
| 27 |
+
|
| 28 |
+
Neural Architecture Search becomes an active research area in recent two years. Zoph & Le (2016) first propose to use reinforcement learning to generate neural network architectures with high accuracy and efficiency. However, the proposed method requires huge amounts of computing resources. Pham et al. (2018) propose an efficient neural architecture search (ENAS) framework that drastically reduces the computational cost. ENAS constructs a super network whose weights are shared with its child networks. They use reinforcement learning to train an RNN controller to sample better child networks from the super net. More recently, Liu et al. (2018) propose DARTS, a differentiable architecture search framework. DARTS also constructs a super net whose edges (candidate operators) are parameterized with coefficients computed by a SoftMax function. The super net is trained and edges with the highest coefficients are kept to form the child network. Our proposed DNAS framework is different from DARTS since we use a stochastic super net – in DARTS, the execution of edges are deterministic and the entire super net is trained together. In DNAS, when training the super net, child networks are sampled, decoupled from the super net and trained independently. The idea of super net and stochastic super net is also used in Saxena & Verbeek (2016); Veniat & Denoyer (2017) to explore macro architectures of neural nets. Another related work is He et al. (2018), which uses AutoML for model compression through network pruning. To the best of our knowledge, we are the first to apply neural architecture search to model quantization.
|
| 29 |
+
|
| 30 |
+
# 3 MIXED PRECISION QUANTIZATION
|
| 31 |
+
|
| 32 |
+
Normally 32-bit (full-precision) floating point numbers are used to represent weights and activations of neural nets. Quantization projects full-precision weights and activations to fixed-point numbers with lower bit-width, such as 8, 4, and 1 bit. We follow DoReFa-Net (Zhou et al. (2016)) to quantize weights and PACT (Choi et al. (2018)) to quantize activations. See Appendix A for more details.
|
| 33 |
+
|
| 34 |
+
For mixed precision quantization, we assume that we have the flexibility to choose different precisions for different layers of a network. Mixed precision computation is widely supported by hardware platforms such as CPUs, FPGAs, and dedicated accelerators. Then the problem is how should we decide the precision for each layer such that we can maintain the accuracy of the network while minimizing the cost in terms of model size or computation. Previous methods use the same precision for all or most of the layers. We expand the design space by choosing different precision assignment from $M$ candidate precisions at $N$ different layers. While exhaustive search yields $\mathcal { O } ( M ^ { N } )$ time complexity, our automated approach is efficient in finding the optimal precision assignment.
|
| 35 |
+
|
| 36 |
+
# 4 DIFFERENTIABLE NEURAL ARCHITECTURE SEARCH
|
| 37 |
+
|
| 38 |
+
# 4.1 NEURAL ARCHITECTURE SEARCH
|
| 39 |
+
|
| 40 |
+
Formally, the neural architecture search (NAS) problem can be formulated as
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\operatorname* { m i n } _ { a \in \mathcal { A } } \operatorname* { m i n } _ { { \boldsymbol w } _ { a } } \mathcal { L } ( a , { \boldsymbol w } _ { a } )
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
Here, $a$ denotes a neural architecture, $\mathcal { A }$ denotes the architecture space. ${ \pmb w } _ { a }$ denotes the weights of architecture $a$ . $\mathcal L ( \cdot , \cdot )$ represents the loss function on a target dataset given the architecture $a$ and its parameter ${ \pmb w } _ { a }$ . The loss function is differentiable with respect to ${ \pmb w } _ { a }$ , but not to $a$ . As a consequence, the computational cost of solving the problem in (1) is very high. To solve the inner optimization problem requires to train a neural network $a$ to convergence, which can take days. The outer problem has a discrete search space with exponential complexity. To solve the problem efficiently, we need to avoid enumerating the search space and evaluating each candidate architecture one-by-one.
|
| 47 |
+
|
| 48 |
+
# 4.2 DIFFERENTIABLE NEURAL ARCHITECTURE SEARCH
|
| 49 |
+
|
| 50 |
+
We discuss the idea of differentiable neural architecture search (DNAS). The idea is illustrated in Fig. 1. We start by constructing a super net to represent the architecture space $\mathcal { A }$ . The super net is essentially a computational DAG (directed acyclic graph) that is denoted as $G = ( V , E )$ . Each node $v _ { i } \in V$ of the super net represents a data tensor. Between two nodes $v _ { i }$ and $v _ { j }$ , there can be $K ^ { i j }$ edges connecting them, indexed as $e _ { k } ^ { i j }$ . Each edge represents an operator parameterized by its trainable weight $w _ { k } ^ { i j }$ . The operator takes the data tensor at $v _ { i }$ as its input and computes its output as $e _ { k } ^ { i j } ( v _ { i } ; w _ { k } ^ { i j } )$ . To compute the data tensor at $v _ { j }$ , we sum the output of all incoming edges as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
v _ { j } = \sum _ { i , k } e _ { k } ^ { i j } ( v _ { i } ; w _ { k } ^ { i j } ) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
With this representation, any neural net architecture $a \in \mathcal A$ can be represented by a subgraph $G _ { a } ( V _ { a } , E _ { a } )$ with $V _ { a } \subseteq V , E _ { a } \subseteq E$ . For simplicity, in a candidate architecture, we keep all the nodes of the graph, so $V _ { a } = V$ . And for a pair of nodes $v _ { i } , v _ { j }$ that are connected by $K ^ { i j }$ candidate edges, we only select one edge. Formally, in a candidate architecture $a$ , we re-write equation (2) as
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
v _ { j } = \sum _ { i , k } m _ { k } ^ { i j } e _ { k } ^ { i j } ( v _ { i } ; w _ { k } ^ { i j } ) ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $m _ { k } ^ { i j } \in \{ 0 , 1 \}$ is an “edge-mask” and $\begin{array} { r } { \sum _ { k } m _ { k } ^ { i j } = 1 } \end{array}$ . Note that though the value of $m _ { k } ^ { i j }$ is discrete, we can still compute the gradient to mijk . Let $_ { \mathbf { \nabla } } \mathbf { m } _ { \mathbf { \nabla } }$ be a vector that consists of $m _ { k } ^ { i j }$ for all $e _ { k } ^ { i j } \in E$ . For any architecture $a \in { \mathcal { A } }$ , we can encode it using an “edge-mask” vector $m _ { a }$ . So we re-write the loss function in equation (1) to an equivalent form as $\mathcal { L } ( m _ { a } , w _ { a } )$ .
|
| 63 |
+
|
| 64 |
+
We next convert the super net to a stochastic super net whose edges are executed stochastically. For each edge $e _ { k } ^ { i j }$ , we let $\mathbf { m } _ { k } ^ { i j } \in \{ 0 , 1 \}$ be a random variable and we execute edge $e _ { k } ^ { i j }$ when $\mathrm { m } _ { k } ^ { i j }$ is sampled to be 1. We assign each edge a parameter $\theta _ { k } ^ { i j }$ such that the probability of executing $e _ { k } ^ { i j }$ is
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
P _ { \pmb { \theta } ^ { i j } } \big ( \mathbf { m } _ { k } ^ { i j } = 1 \big ) = \mathrm { s o f t m a x } \big ( \theta _ { k } ^ { i j } \big | \pmb { \theta } ^ { i j } \big ) = \frac { \exp \bigl ( \theta _ { k } ^ { i j } \bigr ) } { \sum _ { k = 1 } ^ { K ^ { i j } } \exp \bigl ( \theta _ { k } ^ { i j } \bigr ) } .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
The stochastic super net is now parameterized by $\pmb { \theta }$ , a vector whose elements are $\theta _ { k } ^ { i j }$ for all $e _ { k } ^ { i j } \in E$ . From the distribution $P _ { \theta }$ , we can sample a mask vector $m _ { a }$ that corresponds to a candidate architecture $a \in \mathcal A$ . We can further compute the expected loss of the stochastic super net as $\mathbb { E } _ { \mathrm { a } \sim P _ { \theta } } \left[ \mathcal { L } ( \boldsymbol { m } _ { a } , \boldsymbol { w } _ { a } ) \right]$ . The expectation of the loss function is differentiable with respect to ${ \pmb w } _ { a }$ , but not directly to $\pmb \theta$ , since we cannot directly back-propagate the gradient to $\pmb { \theta }$ through the discrete random variable $\mathbf { \nabla } m _ { a }$ . To estimate the gradient, we can use Straight-Through estimation (Bengio et al. (2013)) or REINFORCE (Williams (1992)). Our final choice is to use the Gumbel Softmax technique (Jang et al. (2016)), which will be explained in the next section. Now that the expectation of the loss function becomes fully differentiable, we re-write the problem in equation (1) as
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname* { m i n } _ { \theta } \operatorname* { m i n } _ { w _ { a } } \mathbb { E } _ { \mathrm { a } \sim P _ { \theta } } \left[ \mathcal { L } ( m _ { a } , \pmb { w } _ { a } ) \right]
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
The combinatorial optimization problem of solving for the optimal architecture $a \in { \mathcal { A } }$ is relaxed to solving for the optimal architecture-distribution parameter $\pmb \theta$ that minimizes the expected loss. Once we obtain the optimal $\pmb \theta$ , we acquire the optimal architecture by sampling from $P _ { \theta }$ .
|
| 77 |
+
|
| 78 |
+
# 4.3 DNAS WITH GUMBEL SOFTMAX
|
| 79 |
+
|
| 80 |
+
We use stochastic gradient descent (SGD) to solve Equation (5). The optimization process is also denoted as training the stochastic super net. We compute the Monte Carlo estimation of the gradient
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\nabla _ { \pmb { \theta } , { \pmb w } _ { a } } \mathbb { E } _ { { \mathbf { a } } \sim P _ { \pmb { \theta } } } \left[ { \mathcal L } ( { \pmb m } _ { a } , { \pmb w } _ { a } ) \right] \approx \frac { 1 } { B } \sum _ { i = 1 } ^ { B } \nabla _ { \pmb { \theta } , { \pmb w } _ { a } } { \mathcal L } ( m _ { a _ { i } } , { \pmb w } _ { a _ { i } } ) ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $a _ { i }$ is an architecture sampled from distribution $P _ { \theta }$ and $B$ is the batch size. Equation (6) provides an unbiased estimation of the gradient, but it has high variance, since the size of the architecture space is orders of magnitude larger than any feasible batch size $B$ . Such high variance for gradient estimation makes it difficult for SGD to converge.
|
| 87 |
+
|
| 88 |
+
To address this issue, we use Gumbel Softmax proposed by Jang et al. (2016); Maddison et al. (2016) to control the edge selection. For a node pair $( v _ { i } , v _ { j } )$ , instead of applying a “hard” sampling and execute only one edge, we use Gumbel Softmax to apply a “soft” sampling. We compute $\mathrm { m } _ { k } ^ { i j }$ as
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf { m } _ { k } ^ { i j } = \mathrm { G u m b e l S o f t m a x } ( \theta _ { k } ^ { i j } | \theta ^ { i j } ) = \frac { \exp ( ( \theta _ { k } ^ { i j } + \mathbf { g } _ { k } ^ { i j } ) / \tau ) } { \sum _ { k } \exp ( ( \theta _ { k } ^ { i j } + \mathbf { g } _ { k } ^ { i j } ) / \tau ) } , \ g _ { k } ^ { i j } \sim \mathrm { G u m b e l } ( 0 , 1 ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$\mathbf { g } _ { k } ^ { i j }$ is a random variable drawn from the Gumbel distribution. Note that now $\mathrm { m } _ { k } ^ { i j }$ becomes a continuous random variable. It is directly differentiable with respect to $\theta _ { k } ^ { i j }$ and we don’t need to pass gradient through the random variable $\mathbf { g } _ { k } ^ { i j }$ . Therefore, the gradient of the loss function with respect to $\pmb \theta$ can be computed as
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\nabla _ { \theta } \mathbb { E } _ { a \sim P _ { \theta } } \left[ \mathcal { L } ( m _ { a } , w _ { a } ) \right] = \mathbb { E } _ { \mathbf { g } \sim \operatorname { G u m b e l } ( 0 , 1 ) } \left[ \frac { \partial \mathcal { L } ( m _ { a } , w _ { a } ) } { \partial \mathbf { m } _ { a } } \cdot \frac { \partial \mathbf { m } _ { a } ( \theta , \mathbf { g } ) } { \partial \theta } \right] .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
A temperature coefficient $\tau$ is used to control the behavior of the Gumbel Softmax. As $\tau \infty$ , $m ^ { i j }$ become continuous random variable following a uniform distribution. Therefore, in equation (3), all edges are executed and their outputs are averaged. The gradient estimation in equation (6) are biased but the variance is low, which is favorable during the initial stage of the training. As $\tau 0$ , $m ^ { i j }$ gradually becomes a discrete random variable following the categorical distribution of $P _ { \theta ^ { i j } }$ . When computing equation (3), only one edge is sampled to be executed. The gradient estimation then becomes unbiased but the variance is high. This is favorable towards the end of the training. In our experiment, we use an exponential decaying schedule to anneal the temperature as
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\tau = T _ { 0 } \exp ( - \eta \times e p o c h ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $T _ { 0 }$ is the initial temperature when training begins. We decay the temperature exponentially after every epoch. Using the Gumbel Softmax trick effectively stabilizes the super net training.
|
| 107 |
+
|
| 108 |
+
In some sense, our work is in the middle ground of two previous works: ENAS by Pham et al. (2018) and DARTS by Liu et al. (2018). ENAS samples child networks from the super net to be trained independently while DARTS trains the entire super net together without decoupling child networks from the super net. By using Gumbel Softmax with an annealing temperature, our DNAS pipeline behaves more like DARTS at the beginning of the search and behaves more like ENAS at the end.
|
| 109 |
+
|
| 110 |
+
# 4.4 THE DNAS PIPELINE
|
| 111 |
+
|
| 112 |
+
Based on the analysis above, we propose a differentiable neural architecture search pipeline, summarized in Algorithm 1. We first construct a stochastic super net $G$ with architecture parameter $\pmb \theta$ and weight $\textbf { \em w }$ . We train $G$ with respect to $\pmb { w }$ and $\pmb \theta$ separately and alternately. Training the weight $\pmb { w }$ optimizes all candidate edges (operators). However, different edges can have different impact on the overall performance. Therefore, we train the architecture parameter $\pmb \theta$ , to increase the probability to sample those edges with better performance, and to suppress those with worse performance. To ensure generalization, we split the dataset for architecture search into ${ { \mathcal { X } } _ { w } }$ , which is used specifically to train $\pmb { w }$ , and $\mathcal { X } _ { \theta }$ , which is used to train $\pmb \theta$ . The idea is illustrated in Fig. 1.
|
| 113 |
+
|
| 114 |
+
In each epoch, we anneal the temperature $\tau$ for gumbel softmax with the schedule in equation (9). To ensure $\textbf { \em w }$ is sufficiently trained before updating $\pmb \theta$ , we postpone the training of $\pmb \theta$ for $N _ { w }$ armup epochs. Through the training, we draw samples $a \sim P _ { \theta }$ . These sampled architectures are then trained on the training dataset $\chi _ { t r a i n }$ and evaluated on the test set $\chi _ { t e s t }$ .
|
| 115 |
+
|
| 116 |
+
# Algorithm 1: The DNAS pipeline.
|
| 117 |
+
|
| 118 |
+
Input: Stochastic super net $G = ( V , E )$ with parameter $\pmb { \theta }$ and $\pmb { w }$ , searching dataset ${ { \mathcal { X } } _ { w } }$ and $\mathcal { X } _ { \theta }$ ,
|
| 119 |
+
training dataset $\chi _ { t r a i n }$ , test dataset $\chi _ { t e s t }$ ;
|
| 120 |
+
1 $Q _ { A } \varnothing$ ;
|
| 121 |
+
2 for epoch $\iota = 0 , \cdots N$ do
|
| 122 |
+
3 $\tau T _ { 0 } \exp ( - \eta \times e p o c h )$ ;
|
| 123 |
+
4 Train $G$ with respect to $\pmb { w }$ for one epoch;
|
| 124 |
+
5 if epoch $> N _ { w a r m u p }$ then
|
| 125 |
+
6 Train $G$ with respect to $\pmb \theta$ for one epoch;
|
| 126 |
+
7 Sample architectures $a \sim P _ { \theta }$ ; Push $a$ to $Q _ { A }$ ;
|
| 127 |
+
8 end
|
| 128 |
+
9 end
|
| 129 |
+
10 for $a \in Q _ { A }$ do
|
| 130 |
+
11 Train $a$ on $\chi _ { t r a i n }$ to convergence;
|
| 131 |
+
12 Test a on Xtest;
|
| 132 |
+
13 end
|
| 133 |
+
Output: Trained architectures $Q _ { A }$ .
|
| 134 |
+
|
| 135 |
+
# 5 DNAS FOR MIXED PRECISION QUANTIZATION
|
| 136 |
+
|
| 137 |
+
We use the DNAS framework to solve the mixed precision quantization problem – deciding the optimal layer-wise precision assignment. For a ConvNet, we first construct a super net that has the same “macro-structure” (number of layers, number of filters each layer, etc.) as the given network. As shown in Fig. 2. Each node $v _ { i }$ in the super net corresponds to the output tensor (feature map) of layer-i. Each candidate edge ei,ik $e _ { k } ^ { i , i + 1 }$ represents a convolution operator whose weights or activation are quantized to a lower precision.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 2: One layer of a super net for mixed precision quantization of a ConvNet. Nodes in the super net represent feature maps, edges represent convolution operators with different bit-widths.
|
| 141 |
+
|
| 142 |
+
In order to encourage using lower-precision weights and activations, we define the loss function as
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
{ \mathcal { L } } ( a , { \boldsymbol { w } } _ { a } ) = \operatorname { C r o s s E n t r o p y } ( a ) \times { \mathcal { C } } ( C o s t ( a ) ) .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$C o s t ( a )$ denotes the cost of a candidate architecture and $\mathcal { C } ( \cdot )$ is a weighting function to balance the cross entropy term and the cost term. To compress the model size, we define the cost as
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
C o s t ( a ) = \sum _ { e _ { k } ^ { i j } \in E } m _ { k } ^ { i j } \times \# \mathrm { P A R A M } ( e _ { k } ^ { i j } ) \times \mathrm { w e i g h t } \mathrm { b i t } ( e _ { k } ^ { i j } ) ,
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $\# \mathrm { { P A R A M } ( \cdot ) }$ denotes the number of parameters of a convolution operator and weight-bit(·) denotes the bit-width of the weight. Alternatively, to reduce the computatio $m _ { k } ^ { i j }$ is the edge selection mask described in equation (3).ost by jointly compressing both weights and activations, we use the cost function
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
C o s t ( a ) = \sum _ { e _ { k } ^ { i j } \in E } m _ { k } ^ { i j } \times \# \mathrm { F L O P } ( e _ { k } ^ { i j } ) \times \mathrm { w e i g h t - b i t } ( e _ { k } ^ { i j } ) \times \mathrm { a c t - b i t } ( e _ { k } ^ { i j } ) ,
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
where $\# \mathrm { F L O P ( \cdot ) }$ denotes the number of floating point operations of the convolution operator, weight-bit $( \cdot )$ denotes the bit-width of the weight and act-bit $( \cdot )$ denotes the bit-width of the activation. Note that in a candidate architecture, $m _ { k } ^ { i j }$ have binary values $\{ 0 , 1 \}$ . In the super net, we allow $m _ { k } ^ { i j }$ to be continuous so we can compute the expected cost of the super net..
|
| 161 |
+
|
| 162 |
+
To balance the cost term with the cross entropy term in equation (10), we define where $\beta$ is a coefficient to adjust the initial value of $\mathcal { C } ( C o s t ( a ) )$ to be around 1. $\gamma$ is a coefficient to adjust the relative importance of the cost term vs. the cross-entropy term. A larger $\gamma$ leads to a stronger cost term in the loss function, which favors efficiency over accuracy.
|
| 163 |
+
|
| 164 |
+
# 6 EXPERIMENTS
|
| 165 |
+
|
| 166 |
+
# 6.1 CIFAR10 EXPERIMENTS
|
| 167 |
+
|
| 168 |
+
In the first experiment, we focus on quantizing ResNet20, ResNet56, and ResNet110 (He et al. (2016a)) on CIFAR10 (Krizhevsky & Hinton (2009)) dataset. We start by focusing on reducing model size, since smaller models require less storage and communication cost, which is important for mobile and embedded devices. We only perform quantization on weights and use full-precision activations. We conduct mixed precision search at the block level – all layers in one block use the same precision. Following the convention, we do not quantize the first and the last layer. We construct a super net whose macro architecture is exactly the same as our target network. For each block, we can choose a precision from $\{ 0 , 1 , 2 , 3 , 4 , 8 , 3 \dot { 2 } \}$ . If the precision is 0, we simply skip this block so the input and output are identical. If the precision is 32, we use the full-precision floating point weights. For all other precisions with $k$ -bit, we quantize weights to $k$ -bit fixed-point numbers. See Appendix B for more experiment details.
|
| 169 |
+
|
| 170 |
+
Our experiment result is summarized in Table 1. For each quantized model, we report its accuracy and model size compression rate compared with 32-bit full precision models. The model size is computed by equation (11). Among all the models we searched, we report the one with the highest test accuracy and the one with the highest compression rate. We compare our method with Zhu et al. (2016), where they use 2-bit (ternary) weights for all the layers of the network, except the first convolution and the last fully connect layer. From the table, we have the following observations: 1) All of our most accurate models out-perform their full-precision counterparts by up to $0 . 3 7 \%$ while still achieves $1 1 . 6 \mathrm { ~ - ~ } 1 2 . 5 X$ model size reduction. 2) Our most efficient models can achieve $1 6 . 6 - 2 0 . 3 X$ model size compression with accuracy drop less than $0 . 3 9 \%$ . 3) Compared with Zhu et al. (2016), our model achieves up to $1 . 5 9 \%$ better accuracy. This is partially due to our improved training recipe as our full-precision model’s accuracy is also higher. But it still demonstrates that our models with searched mixed precision assignment can very well preserve the accuracy.
|
| 171 |
+
|
| 172 |
+
Table 2 compares the precision assignment for the most accurate and the most efficient models for ResNet20. Note that for the most efficient model, it directly skips the 3rd block in group-1. In Fig. 3, we plot the accuracy vs. compression rate of searched architectures of ResNet110. We observe that models with random precision assignment (from epoch 0) have significantly worse compression while searched precision assignments generally have higher compression rate and accuracy.
|
| 173 |
+
|
| 174 |
+
Table 1: Mixed Precision Quantization for ResNet on CIFAR10 dataset. We report results on $\mathrm { R e s N e t } \{ 2 0 , 5 6 , 1 1 0 \}$ . In the table, we abbreviate accuracy as “Acc” and compression as “Comp”.
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="3">DNAS (ours)</td><td colspan="2">TTQ (Zhu et al. (2016))</td></tr><tr><td>Full</td><td>Most Accurate</td><td>Most Efficient</td><td>Full</td><td>2bit</td></tr><tr><td rowspan="2">ResNet20</td><td>Acc</td><td>92.35</td><td>92.72 (+0.37)</td><td>92.00 (-0.35)</td><td>91.77</td><td>91.13 (-0.64)</td></tr><tr><td>Comp</td><td>1.0</td><td>11.6</td><td>16.6</td><td>1.0</td><td>16.0</td></tr><tr><td rowspan="2">ResNet56</td><td>Acc</td><td>94.42</td><td>94.57 (+0.15)</td><td>94.12 (-0.30)</td><td>93.20</td><td>93.56 (+0.36)</td></tr><tr><td>Comp</td><td>1.0</td><td>14.6</td><td>18.93</td><td>1.0</td><td>16.0</td></tr><tr><td rowspan="2">ResNet110</td><td>Acc</td><td>94.78</td><td>95.07 (+0.29)</td><td>94.39 (-0.39)</td><td>1</td><td>-</td></tr><tr><td>Comp</td><td>1.0</td><td>12.5</td><td>20.3</td><td>1</td><td>1</td></tr></table>
|
| 177 |
+
|
| 178 |
+
<table><tr><td></td><td>g1b1 g1b2</td><td>g1b3</td><td>g2b1</td><td>g2b2</td><td>g2b3</td><td>g3b1</td><td>g3b2</td><td>g3b3</td></tr><tr><td>MostAccurate</td><td>4 4</td><td>3</td><td>3</td><td>3</td><td>4</td><td>4</td><td>3</td><td>1</td></tr><tr><td>Most Efficient</td><td>2 3</td><td>0</td><td>2</td><td>4</td><td>2</td><td>3</td><td>2</td><td>1</td></tr></table>
|
| 179 |
+
|
| 180 |
+
Table 2: Layer-wise bit-widths for the most accurate vs. the most efficient architecture of ResNet20.
|
| 181 |
+
|
| 182 |
+
# 6.2 IMAGENET EXPERIMENTS
|
| 183 |
+
|
| 184 |
+
We quantize ResNet18 and ResNet34 on the ImageNet ILSVRC2012 (Deng et al. (2009)) dataset. Different from the original ResNet (He et al. (2016a)), we use the “ReLU-only preactivation” ResNet from He et al. (2016b). Similar to the CIFAR10 experiments, we conduct mixed precision search at the block level. We do not quanitze the first and the last layer. See Appendix B for more details.
|
| 185 |
+
|
| 186 |
+
We conduct two sets of experiments. In the first set, we aim at compressing the model size, so we only quantize weights and use the cost function from equation (11). Each block contains convolution operators with weights quantized to $\{ 1 , 2 , 4 , 8 , 3 2 \}$ -bit. In the second set, we aim at compressing computational cost. So we quantize both weights and activations and use the cost function from equation (12). Each block in the super net contains convolution operators with weights and activations quantized to $\{ ( 1 , 4 ) , ( 2 , 4 ) , ( \bar { 3 } , 3 ) , ( 4 , 4 ) , ( 8 , 8 ) , ( 3 2 , 3 2 ) \}$ -bit. The first number in the tuple denotes the weight precision and the second denotes the activation precision. The DNAS search is very efficient, taking less than 5 hours on 8 V100 GPUs to finish the search on ResNet18.
|
| 187 |
+
|
| 188 |
+
Our model size compression experiment is reported in Table 3. We report two searched results for each model. “MA” denotes the searched architecture with the highest accuracy, and “ME” denotes the most efficient. We compare our results with TTQ (Zhu et al. (2016)) and ADMM (Leng et al. (2017)). TTQ uses ternary weights (stored by 2 bits) to quantize a network. For ADMM, we cite the result with $\{ - 4 , 4 \}$ configuration where weights can have 7 values and are stored by 3 bits. We report the accuracy and model size compression rate of each model. From Table 3, we have the following observations: 1) All of our most accurate models out-perform full-precision models by up to $0 . 5 \%$ while achieving 10.6-11.2X reduction of model size. 2) Our most efficient models can achieve 19.0 to $2 1 . 1 \mathrm { X }$ reduction of model size, still preserving competitive accuracy. 3) Compared with previous works, even our less accurate model has almost the same accuracy as the full-precision model with 21.1X smaller model size. This is partially because we use label-refinery (Bagherinezhad et al. (2018)) to effectively boost the accuracy of quantized models. But it still demonstrate that our searched models can very well preserve the accuracy, despite its high compression rate.
|
| 189 |
+
|
| 190 |
+
Table 3: Mixed Precision Quantization for ResNet on ImageNet for model size compression. In the table, we abbreviate accuracy as “Acc” and compression as “Comp”. “MA” denotes the most accurate model from architecture search and “ME” denotes the most efficient model.
|
| 191 |
+
|
| 192 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="3">DNAS (ours)</td><td colspan="2">TTQ</td><td>ADMM</td></tr><tr><td>Full</td><td>MA</td><td>ME</td><td>Full</td><td>2bit</td><td>3bit</td></tr><tr><td rowspan="2">ResNet18</td><td>Acc</td><td>71.03</td><td>71.21 (+0.18)</td><td>69.58 (-1.45)</td><td colspan="2">69.6</td><td>68.0 (-1.6)</td></tr><tr><td>Comp</td><td>1.0</td><td>11.2</td><td>21.1</td><td colspan="2">1.0</td><td>10.7</td></tr><tr><td>ResNet34</td><td>Acc Comp</td><td>74.12 1.0</td><td>74.61 (+0.49) 10.6</td><td>73.37 (-0.75) 19.0</td><td colspan="2"></td><td></td></tr></table>
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
|
| 196 |
+
Figure 3: Visualization of all searched architectures for ResNet110 and CIFAR10 dataset. x-axis is the compression rate of each model. y-axis is the accuracy.
|
| 197 |
+
Table 4: Mixed Precision Quantization for ResNet on ImageNet for computational cost compression. We abbreviate accuracy as “Acc” and compression rate as “Comp”. “arch- $\{ 1 , 2 , 3 \} ^ { \ast }$ are three searched architectures ranked by accuracy.
|
| 198 |
+
|
| 199 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="3">DNAS (ours)</td><td>PACT</td><td>DoReFA</td><td>QIP</td><td>GroupNet</td></tr><tr><td>arch-1</td><td>arch-2</td><td>arch-3</td><td>W4A4</td><td>W4A4</td><td>W4A4</td><td>W1A2G5</td></tr><tr><td rowspan="3">ResNet18</td><td>Acc</td><td>71.01</td><td>70.64</td><td>68.65</td><td>69.2</td><td>68.1</td><td>69.3</td><td>67.6</td></tr><tr><td>Full Acc</td><td>71.03</td><td>71.03</td><td>71.03</td><td>70.2</td><td>70.2</td><td>69.2</td><td>69.7</td></tr><tr><td>Acc △</td><td>-0.02</td><td>-0.39</td><td>-2.38</td><td>-1.0</td><td>-2.1</td><td>+0.1</td><td>-2.1</td></tr><tr><td rowspan="4">ResNet34</td><td>Comp Acc</td><td>33.2</td><td>62.9 73.98</td><td>103.5</td><td>64</td><td>64</td><td>64</td><td>102.4</td></tr><tr><td>Full Acc</td><td>74.21 74.12</td><td></td><td>73.23</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td>74.12</td><td>74.12</td><td></td><td></td><td></td><td></td></tr><tr><td>Acc△ Comp</td><td>+0.09 40.8</td><td>-0.14 59.0</td><td>-0.89 87.4</td><td></td><td></td><td></td><td></td></tr></table>
|
| 200 |
+
|
| 201 |
+
Our experiment on computational cost compression is reported in Table 4. We report three searched architectures for each model. We report the accuracy and the compression rate of the computational cost of each architecture. We compute the computational cost of each model using equation (12). We compare our results with PACT (Choi et al. (2018)), DoReFA (Zhou et al. (2016)), QIP (Jung et al. (2018)), and GroupNet (Zhuang et al. (2018)). The first three use 4-bit weights and activations. We compute their compression rate as $( 3 2 / 4 ) \times ( 3 2 / 4 ) = 6 4$ . GroupNet uses binary weights and 2-bit activations, but its blocks contain 5 parallel branches. We compute its compression rate as $( 3 2 / 1 ) \times ( 3 2 / 2 ) / 5 \approx 1 0 2 . 4$ The DoReFA result is cited from Choi et al. (2018). From table 4, we have the following observations: 1) Our most accurate architectures (arch-1) have almost the same accuracy $( - 0 . 0 2 \%$ or $+ 0 . 0 9 \%$ ) as the full-precision models with compression rates of $3 3 . 2 \mathrm { x }$ and 40.8X. 2) Comparing arch-2 with PACT, DoReFa, and QIP, we have a similar compression rate (62.9 vs 64), but the accuracy is $0 . 7 1 \mathrm { - } 1 . 9 1 \%$ higher. 3) Comparing arch-3 with GroupNet, we have slightly higher compression rate (103.5 vs. 102.4), but $1 . 0 5 \%$ higher accuracy.
|
| 202 |
+
|
| 203 |
+
# 7 CONCLUSION
|
| 204 |
+
|
| 205 |
+
In this work we focus on the problem of mixed precision quantization of a ConvNet to determine its layer-wise bit-widths. We formulate this problem as a neural architecture search (NAS) problem and propose a novel, efficient, and effective differentiable neural architecture search (DNAS) framework to solve it. Under the DNAS framework, we efficiently explore the exponential search space of the NAS problem through gradient based optimization (SGD). We use DNAS to search for layer-wise precision assignment for ResNet on CIFAR10 and ImageNet. Our quantized models with $2 1 . 1 \mathbf { x }$ smaller model size or $1 0 3 . 9 \mathrm { X }$ smaller computational cost can still outperform baseline quantized or even full precision models. DNAS is very efficient, taking less than 5 hours to finish a search on ResNet18 for ImageNet. It is also a general architecture search framework that is not limited to the mixed precision quantization problem. Its other applications will be discussed in future publications.
|
| 206 |
+
|
| 207 |
+
# REFERENCES
|
| 208 |
+
|
| 209 |
+
Hessam Bagherinezhad, Maxwell Horton, Mohammad Rastegari, and Ali Farhadi. Label refinery: Improving imagenet classification through label progression. arXiv preprint arXiv:1805.02641, 2018.
|
| 210 |
+
|
| 211 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 212 |
+
|
| 213 |
+
Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Pact: Parameterized clipping activation for quantized neural networks. arXiv preprint arXiv:1805.06085, 2018.
|
| 214 |
+
|
| 215 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. Ieee, 2009.
|
| 216 |
+
|
| 217 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 218 |
+
|
| 219 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 220 |
+
|
| 221 |
+
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, pp. 770–778, 2016a.
|
| 222 |
+
|
| 223 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pp. 630–645. Springer, 2016b.
|
| 224 |
+
|
| 225 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 784–800, 2018.
|
| 226 |
+
|
| 227 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 228 |
+
|
| 229 |
+
Sangil Jung, Changyong Son, Seohyung Lee, Jinwoo Son, Youngjun Kwak, Jae-Joon Han, and Changkyu Choi. Joint training of low-precision neural network with quantization interval parameters. arXiv preprint arXiv:1808.05779, 2018.
|
| 230 |
+
|
| 231 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 232 |
+
|
| 233 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 234 |
+
|
| 235 |
+
Cong Leng, Hao Li, Shenghuo Zhu, and Rong Jin. Extremely low bit neural network: Squeeze the last bit out with admm. arXiv preprint arXiv:1707.09870, 2017.
|
| 236 |
+
|
| 237 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018.
|
| 238 |
+
|
| 239 |
+
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.
|
| 240 |
+
|
| 241 |
+
Hieu Pham, Melody Y Guan, Barret Zoph, Quoc V Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. arXiv preprint arXiv:1802.03268, 2018.
|
| 242 |
+
|
| 243 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016.
|
| 244 |
+
|
| 245 |
+
Shreyas Saxena and Jakob Verbeek. Convolutional neural fabrics. In Advances in Neural Information Processing Systems, pp. 4053–4061, 2016.
|
| 246 |
+
|
| 247 |
+
Tom Veniat and Ludovic Denoyer. Learning time/memory-efficient deep architectures with budgeted super networks. arXiv preprint arXiv:1706.00046, 2017.
|
| 248 |
+
|
| 249 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 250 |
+
|
| 251 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 252 |
+
|
| 253 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
|
| 254 |
+
|
| 255 |
+
Bohan Zhuang, Chunhua Shen, and Ian Reid. Training compact neural networks with binary weights and low precision activations. arXiv preprint arXiv:1808.02631, 2018.
|
| 256 |
+
|
| 257 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 258 |
+
|
| 259 |
+
# APPENDIX A WEIGHT AND ACTIVATION QUANTIZATION
|
| 260 |
+
|
| 261 |
+
For readers’ convenience, we describe the functions we use to quantize weights and activations in this section. We follow DoReFa-Net (Zhou et al. (2016)) to quantize weights as
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
w _ { k } = 2 Q _ { k } ( \frac { \operatorname { t a n h } ( w ) } { 2 \operatorname* { m a x } ( | \operatorname { t a n h } ( w ) | ) } + 0 . 5 ) .
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
$w$ denotes the latent full-precision weight of a network. $Q _ { k } ( \cdot )$ denotes a $k$ -bit quantization function that quantizes a continuous value $w \in [ 0 , 1 ]$ to its nearest neighbor in $\{ \frac { i } { 2 ^ { k } - 1 } | i = 0 , \cdots , 2 ^ { k } - 1 \}$ . To quantize activations, we follow Choi et al. (2018) to use a bounded activation function followed by a quantization function as
|
| 268 |
+
|
| 269 |
+
$$
|
| 270 |
+
\begin{array} { c } { y = P A C T ( x ) = 0 . 5 ( | x | - | x - \alpha | + \alpha ) , } \\ { y _ { k } = Q _ { k } ( y / \alpha ) \cdot \alpha . } \end{array}
|
| 271 |
+
$$
|
| 272 |
+
|
| 273 |
+
Here, $x$ is the full precision activation, $y _ { k }$ is the quantized activation. $P A C T ( \cdot )$ is a function that bounds the output between $[ 0 , \alpha ]$ . $\alpha$ is a learnable upper bound of the activation function.
|
| 274 |
+
|
| 275 |
+
# APPENDIX B EXPERIMENT DETAILS
|
| 276 |
+
|
| 277 |
+
We discuss the experiment details for the CIFAR10 experiments. CIFAR10 contains 50,000 training images and 10,000 testing images to be classified into 10 categories. Image size is $3 2 \times 3 2$ . We report the accuracy on the test set. To train the super net, we randomly split $80 \%$ of the CIFAR10 training set to train the weights $\pmb { w }$ , and $20 \%$ to train the architecture parameter $\pmb \theta$ . We train the super net for 90 epochs with a batch size of 512. To train the model weights, we use SGD with momentum with an initial learning rate of 0.2, momentum of 0.9 and weight decay of $5 \times 1 0 ^ { - 4 }$ . We use the cosine decay schedule to reduce the learning rate. For architecture parameters, we use Adam optimizer (Kingma & Ba (2014)) with a learning rate of $5 \times 1 0 ^ { - 3 }$ and weight decay of $1 0 ^ { - 3 }$ . We use the cost function from equation (11). We set $\beta$ from equation (13) to 0.1 and $\gamma$ to 0.9. To control Gumbel Softmax functions, we use an initial temperature of $T _ { 0 } ~ = ~ 5 . 0$ , and we set the decaying factor $\eta$ from equation (9) to be 0.025. After every 10 epochs of training of super net, we sample 5 architectures from the distribution $P _ { \theta }$ . We train each sampled architecture for 160 epochs and use cutout (DeVries & Taylor (2017)) in data augmentation. Other hyper parameters are the same as training the super net.
|
| 278 |
+
|
| 279 |
+
We next discuss the experiment details for ImageNet experiments. ImageNet contains 1,000 classes, with roughly $1 . 3 { \bf M }$ training images and 50K validation images. Images are scaled such that their shorter side is 256 pixels and are cropped to $2 2 4 \times 2 2 4$ before feeding into the network. We report the accuracy on the validation set. Training a super net on ImageNet can be very computationally expensive. Instead, we randomly sample 40 categories from the ImageNet training set to train the super net. We use SGD with momentum to train the super net weights for 60 epochs with a batch size of 256 for ResNet18 and 128 for ResNet34. We set the initial learning rate to be 0.1 and reduce it with the cosine decay schedule. We set the momentum to 0.9. For architecture parameters, we use Adam optimizer with the a learning rate of $1 0 ^ { - 3 }$ and a weight decay of $5 \times 1 0 ^ { - 4 }$ . We set the cost coefficient $\beta$ to 0.05, cost exponent $\gamma$ to 1.2. We set $T _ { 0 }$ to be 5.0 and decay factor $\eta$ to be 0.065. We postpone the training of the architecture parameters by 10 epochs. We sample 2 architectures from the architecture distribution $P _ { \theta }$ every 10 epochs. The rest of the hyper parameters are the same as the CIFAR10 experiments. We train sampled architectures for 120 epochs using SGD with an initial learning rate of 0.1 and cosine decay schedule. We use label-refinery (Bagherinezhad et al. (2018)) in training and we use the same data augmentation as this Pytorch example1.
|
md/train/BJKYvt5lg/BJKYvt5lg.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PIXELVAE: A LATENT VARIABLE MODEL FOR NATURAL IMAGES
|
| 2 |
+
|
| 3 |
+
Ishaan Gulrajani1∗, Kundan Kumar1,2, Faruk Ahmed1, Adrien Ali Taiga1,3, Francesco Visin1,5, David Vazquez1,4, Aaron Courville1,6
|
| 4 |
+
|
| 5 |
+
1 Montreal Institute for Learning Algorithms, Universite de Montr ´ ea´
|
| 6 |
+
2 Department of Computer Science and Engineering, IIT Kanpur
|
| 7 |
+
3 CentraleSupelec ´
|
| 8 |
+
4 Computer Vision Center & Universitat Autonoma de Barcelona
|
| 9 |
+
5 Politecnico di Milano
|
| 10 |
+
6 CIFAR Fellow
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Natural image modeling is a landmark challenge of unsupervised learning. Variational Autoencoders (VAEs) learn a useful latent representation and model global structure well but have difficulty capturing small details. PixelCNN models details very well, but lacks a latent code and is difficult to scale for capturing large structures. We present PixelVAE, a VAE model with an autoregressive decoder based on PixelCNN. Our model requires very few expensive autoregressive layers compared to PixelCNN and learns latent codes that are more compressed than a standard VAE while still capturing most non-trivial structure. Finally, we extend our model to a hierarchy of latent variables at different scales. Our model achieves state-of-the-art performance on binarized MNIST, competitive performance on $6 4 \times 6 4$ ImageNet, and high-quality samples on the LSUN bedrooms dataset.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Building high-quality generative models of natural images has been a long standing challenge. Although recent work has made significant progress (Kingma & Welling, 2014; van den Oord et al., 2016a;b), we are still far from generating convincing, high-resolution natural images.
|
| 19 |
+
|
| 20 |
+
Many recent approaches to this problem are based on an efficient method for performing amortized, approximate inference in continuous stochastic latent variables: the variational autoencoder (VAE) (Kingma & Welling, 2014) jointly trains a top-down decoder generative neural network with a bottom-up encoder inference network. VAEs for images typically use rigid decoders that model the output pixels as conditionally independent given the latent variables. The resulting model learns a useful latent representation of the data and effectively models global structure in images, but has difficulty capturing small-scale features such as textures and sharp edges due to the conditional independence of the output pixels, which significantly hurts both log-likelihood and quality of generated samples compared to other models.
|
| 21 |
+
|
| 22 |
+
PixelCNNs (van den Oord et al., 2016a;b) are another state-of-the-art image model. Unlike VAEs, PixelCNNs model image densities autoregressively, pixel-by-pixel. This allows it to capture fine details in images, as features such as edges can be precisely aligned. By leveraging carefully constructed masked convolutions (van den Oord et al., 2016b), PixelCNNs can be trained efficiently in parallel on GPUs. Nonetheless, PixelCNN models are still very computationally expensive. Unlike typical convolutional architectures they do not apply downsampling between layers, which means that each layer is computationally expensive and that the depth of a PixelCNN must grow linearly with the size of the images in order for it to capture dependencies between far-away pixels. PixelCNNs also do not explicitly learn a latent representation of the data, which can be useful for downstream tasks such as semi-supervised learning.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: Samples from hierarchical PixelVAE on the LSUN bedrooms dataset.
|
| 26 |
+
|
| 27 |
+
Our contributions are as follows:
|
| 28 |
+
|
| 29 |
+
• We present PixelVAE, a latent variable model which combines the largely complementary advantages of VAEs and PixelCNNs by using PixelCNN-based masked convolutions in the conditional output distribution of a VAE. We extend PixelVAE to a hierarchical model with multiple stochastic layers and autoregressive decoders at each layer. This lets us autoregressively model not only the output pixels but also higher-level latent feature maps. On MNIST, we show that PixelVAE: (1) establishes a new state-of-the-art likelihood, (2) performs comparably to PixelCNN using far fewer computationally expensive autoregressive layers, (3) learns more compressed latent codes than a standard VAE while still accounting for most non-trivial structure, and (4) learns a latent code which separates digits better than a standard VAE.
|
| 30 |
+
• We evaluate hierarchical PixelVAE on two challenging natural image datasets $( 6 4 \times 6 4$ ImageNet and LSUN bedrooms). On $6 4 \times 6 4$ ImageNet, we report likelihood competitive with the state of the art at significantly less computational cost. On LSUN bedrooms, we generate high-quality samples and show that hierarchical PixelVAE learns to model different properties of the scene with each of its multiple layers.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
There have been many recent advancements in generative modeling of images. We briefly discuss some of these below, especially those that are related to our approach.
|
| 35 |
+
|
| 36 |
+
The Variational Autoencoder (VAE) (Kingma & Welling, 2014) is a framework to train neural networks for generation and approximate inference jointly by optimizing a variational bound on the data log-likelihood. The use of normalizing flows (Rezende & Mohamed, 2015) improves the flexibility of the VAE approximate posterior. Based on this, Kingma et al. (2016) develop an efficient formulation of an autoregressive approximate posterior model using MADE (Germain et al., 2015). In our work, we avoid the need for such flexible inference models by using autoregressive priors.
|
| 37 |
+
|
| 38 |
+
The idea of using autoregressive conditional likelihoods in VAEs has been explored in the context of language modeling in (Bowman et al., 2016), however in that work the use of latent variables fails to improve likelihood over a purely autoregressive model.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 2: Our proposed model, PixelVAE, makes use of PixelCNN to model an autoregressive decoder for a VAE. VAEs, which assume (conditional) independence among pixels, are known to suffer from blurry samples, while PixelCNN, modeling the joint distribution, produces sharp samples, but lack a latent representation that might be more useful for downstream tasks. PixelVAE combines the best of both worlds, providing a meaningful latent representation, while producing sharp samples.
|
| 42 |
+
|
| 43 |
+
Simultaneously to our work, Chen et al. (2016) present a VAE model for images with an an autoregressive output distribution. In constrast to Chen et al. (2016), who focus on models with a single layer of latent variables, we also investigate models with a hierarchy of latent variables (and corresponding autoregressive priors) and show that they enable us to scale our model to challenging natural image datasets.
|
| 44 |
+
|
| 45 |
+
Another promising recent approach is Generative Adversarial Networks (GANs) (Goodfellow et al., 2014), which pit a generator network and a discriminator network against each other. Recent work has improved training stability (Radford et al., 2015; Salimans et al., 2016) and incorporated inference networks into the GAN framework (Dumoulin et al., 2016; Donahue et al., 2016). GANs generate compelling samples compared to our work, but still exhibit unstable training dynamics and are known to underfit by ignoring modes of the data distribution (Dumoulin et al., 2016). Further, it is difficult to accurately estimate the data likelihood in GANs.
|
| 46 |
+
|
| 47 |
+
# 3 PIXELVAE MODEL
|
| 48 |
+
|
| 49 |
+
Like a VAE, our model jointly trains an “encoder” inference network, which maps an image $x$ to a posterior distribution over latent variables $z$ , and a “decoder” generative network, which models a distribution over $x$ conditioned on $z$ . The encoder and decoder networks are composed of a series of convolutional layers, respectively with strided convolutions for downsampling in the encoder and transposed convolutions for upsampling in the decoder.
|
| 50 |
+
|
| 51 |
+
As opposed to most VAE decoders that model each dimension of the output independently (for example, by modeling the output as a Gaussian with diagonal covariance), we use a conditional PixelCNN in the decoder. Our decoder models $x$ as the product of each dimension $x _ { i }$ conditioned on all previous dimensions and the latent variable $z$ :
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
p ( { \boldsymbol x } | { \boldsymbol z } ) = \prod _ { i } p ( x _ { i } | x _ { 1 } , \dots , x _ { i - 1 } , { \boldsymbol z } )
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
We first transform $z$ through a series of convolutional layers into feature maps with the same spatial resolution as the output image and then concatenate the resulting feature maps with the image. The resulting concatenated feature maps are then further processed by several PixelCNN masked convolutional layers and a final PixelCNN 256-way softmax output.
|
| 58 |
+
|
| 59 |
+
Unlike typical PixelCNN implementations, we use very few PixelCNN layers in our decoder, relying on the latent variables to model the structure of the input at scales larger than the combined receptive field of our PixelCNN layers. As a result of this, our architecture captures global structure at a much lower computational cost than a standard PixelCNN implementation.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 3: We generate top-down through a hierarchical latent space decomposition. The inference network generates latent variables by composing successive deterministic functions to compute parameters of the stochastic random variables. Dotted lines denote contributions to the cost.
|
| 63 |
+
|
| 64 |
+
# 3.1 HIERARCHICAL ARCHITECTURE
|
| 65 |
+
|
| 66 |
+
The performance of VAEs can be improved by stacking them to form a hierarchy of stochastic latent variables: in the simplest configuration, the VAE at each level models a distribution over the latent variables at the level below, with generation proceeding downward and inference upward through each level (i.e. as in Fig. 3). In convolutional architectures, the intermediate latent variables are typically organized into feature maps whose spatial resolution decreases toward higher levels.
|
| 67 |
+
|
| 68 |
+
Our model can be extended in the same way. At each level, the generator is a conditional PixelCNN over the latent features in the level below. This lets us autoregressively model not only the output distribution over pixels but also the prior over each set of latent feature maps. The higher-level PixelCNN decoders use diagonal Gaussian output layers instead of 256-way softmax, and model the dimensions within each spatial location (i.e. across feature maps) independently. This is done for simplicity, but is not a limitation of our model.
|
| 69 |
+
|
| 70 |
+
The output distributions over the latent variables for the generative and inference networks decompose as follows (see Fig. 3).
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\begin{array} { l } { { p ( z _ { 1 } , \cdot \cdot \cdot , z _ { L } ) = p ( z _ { L } ) p ( z _ { L - 1 } | z _ { L } ) \cdot \cdot \cdot p ( z _ { 1 } | z _ { 2 } ) } } \\ { { q ( z _ { 1 } , \cdot \cdot \cdot , z _ { L } | x ) = q ( z _ { 1 } | x ) \cdot \cdot \cdot q ( z _ { L } | x ) } } \end{array}
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
We optimize the negative of the evidence lower bound (sum of data negative log-likelihood and KL-divergence of the posterior over latents with the prior).
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { l } { \displaystyle - L ( x , q , p ) = - E _ { z _ { 1 } \sim q ( z _ { 1 } | x ) } \log p ( x | z _ { 1 } ) + D _ { K L } ( q ( z _ { 1 } , \cdots z _ { L } | x ) | | p ( z _ { 1 } , \cdots , z _ { L } ) ) } \\ { \displaystyle = - E _ { z _ { 1 } \sim q ( z _ { 1 } | x ) } \log p ( x | z _ { 1 } ) + \int _ { z _ { 1 } , \cdots , z _ { L } } \prod _ { j = 1 } ^ { L } q ( z _ { j } | x ) \sum _ { i = 1 } ^ { L } \log \frac { q ( z _ { i } | x ) } { p ( z _ { i } | z _ { i + 1 } ) } d z _ { 1 } . . . d z _ { L } } \\ { \displaystyle = - E _ { z _ { 1 } \sim q ( z _ { 1 } | x ) } \log p ( x | z _ { 1 } ) + \sum _ { i = 1 } ^ { L } \int _ { z _ { 1 } , \cdots , z _ { L } } \prod _ { j = 1 } ^ { L } q ( z _ { j } | x ) \log \frac { q ( z _ { i } | x ) } { p ( z _ { i } | z _ { i + 1 } ) } d z _ { 1 } . . . d z _ { L } } \\ { \displaystyle = - E _ { z _ { 1 } \sim q ( z _ { 1 } | x ) } \log p ( x | z _ { 1 } ) + \sum _ { i = 1 } ^ { L } \int _ { z _ { i } \geq z _ { i + 1 } } ^ { \infty } q ( z _ { i + 1 } | x ) q ( z _ { i } | x ) \log \frac { q ( z _ { i } | x ) } { p ( z _ { i } | z _ { i + 1 } ) } d z _ { i } d z _ { i + 1 } } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
= - E _ { z _ { 1 } \sim q ( z _ { 1 } | x ) } \log p ( x | z _ { 1 } ) + \sum _ { i = 1 } ^ { L } \mathbf { E } _ { z _ { i + 1 } \sim q ( z _ { i + 1 } | x ) } \left[ D _ { K L } ( q ( z _ { i } | x ) | | p ( z _ { i } | z _ { i + 1 } ) ) \right]
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
Note that when specifying an autoregressive prior over each latent level $z _ { i }$ , we can leverage masked convolutions (van den Oord et al., 2016b) and samples drawn independently from the approximate posterior $q ( z _ { i } \mid x )$ (i.e. from the inference network) to train efficiently in parallel on GPUs.
|
| 87 |
+
|
| 88 |
+
# 4 EXPERIMENTS
|
| 89 |
+
|
| 90 |
+
# 4.1 MNIST
|
| 91 |
+
|
| 92 |
+
Table 1: We compare performance of different models on binarized MNIST. “PixelCNN” is the model described in van den Oord et al. (2016a). Our corresponding latent variable model is “PixelVAE”. “Gated PixelCNN” and “Gated PixelVAE” use the gated activation function in van den Oord et al. (2016b). In “Gated PixelVAE without upsampling”, a linear transformation of latent variable conditions the (gated) activation in every PixelCNN layer instead of using upsampling layers.
|
| 93 |
+
|
| 94 |
+
<table><tr><td>Model</td><td>NLL Test</td></tr><tr><td>DRAW (Gregor et al., 2016)</td><td>≤80.97</td></tr><tr><td>Discrete VAE (Rolfe,2016)</td><td>= 81.01</td></tr><tr><td>IAF VAE (Kingma et al., 2016) PixelCNN (van den Oord et al., 2016a)</td><td>≈ 79.88 = 81.30</td></tr><tr><td>PixelRNN (van den Oord et al., 2016a)</td><td>= 79.20</td></tr><tr><td>VLAE (Chen et al., 2016)</td><td>= 79.03</td></tr><tr><td>Convolutional VAE</td><td>≤ 87.41</td></tr><tr><td>PixelVAE</td><td>≤ 80.64</td></tr><tr><td>Gated PixelCNN (our implementation)</td><td>= 80.10</td></tr><tr><td>GatedPixelVAE</td><td>~ 79.48 (≤ 80.02)</td></tr><tr><td>Gated PixelVAE without upsampling</td><td>~ 78.96 (≤ 79.58)</td></tr></table>
|
| 95 |
+
|
| 96 |
+
We evaluate our model on the binarized MNIST dataset (Salakhutdinov & Murray, 2008; Lecun et al., 1998) and report results in Table 1. We also experiment with a variant of our model in which each PixelCNN layer is directly conditioned on a linear transformation of latent variable, $z$ (rather than transforming $z$ first through several upsampling convolutional layers) (as in (van den Oord et al., 2016b) and find that this further improves performance, achieving an NLL upper bound comparable with the current state of the art. We estimate the marginal likelihood of our MNIST model using the importance sampling technique in Burda et al. (2015), which computes a lower bound on the likelihood whose tightness increases with the number of importance samples per datapoint. We use $N = 5 0 0 0$ samples per datapoint (higher values don’t appear to significantly affect the likelihood estimate) and achieve state-of-the-art likelihood.
|
| 97 |
+
|
| 98 |
+
# 4.1.1 USING FEW PIXELCNN LAYERS
|
| 99 |
+
|
| 100 |
+
The masked convolutional layers in PixelCNN are computationally expensive because they operate at the full resolution of the image and in order to cover the full receptive field of the image, PixelCNN typically needs a large number of them. One advantage of our architecture is that we can achieve strong performance with very few PixelCNN layers, which makes training and sampling from our model significantly faster than PixelCNN. To demonstrate this, we compare the performance of our model to PixelCNN as a function of the number of PixelCNN layers (Fig. 4a). We find that with fewer than 10 autoregressive layers, our PixelVAE model performs much better than PixelCNN. This is expected since with few layers, the effective receptive field of the PixelCNN output units is too small to capture long-range dependencies in the data.
|
| 101 |
+
|
| 102 |
+
We also observe that adding even a single PixelCNN layer has a dramatic impact on the NLL bound of PixelVAE. This is not surprising since the PixelCNN layer helps model local characteristics which are complementary to the global characteristics which a VAE with a factorized output distribution models.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 4: (a) Comparison of Negative log-likelihood upper bound of PixelVAE and NLL for PixelCNN as a function of the number of PixelCNN layers used. (b) Cost break down into KL divergence and reconstruction cost.
|
| 106 |
+
|
| 107 |
+
# 4.1.2 LATENT VARIABLE INFORMATION CONTENT
|
| 108 |
+
|
| 109 |
+
Because the autoregressive conditional likelihood function of PixelVAE is expressive enough to model some properties of the image distribution, it isn’t forced to account for those properties through its latent variables as a standard VAE is. As a result, we can expect PixelVAE to learn latent representations which are invariant to textures, precise positions, and other attributes which are more efficiently modeled by the autoregressive decoder. To empirically validate this, we train PixelVAE models with different numbers of autoregressive layers (and hence, different PixelCNN receptive field sizes) and plot the breakdown of the NLL bound for each of these models into the reconstruction term $\log p ( x | z )$ and the KL divergence term $D _ { K L } ( q ( z | x ) | | p ( z ) )$ (Fig. 4b). The KL divergence term can be interpreted as a measure of the information content in the posterior distribution $q ( z | x )$ (in the sense that in expectation, samples from $q ( z | x )$ require $K L ( q | | p )$ fewer bits to code under a code optimized for $q$ than under one optimized for $p$ (Burnham & Anderson, 2003)) and hence, models with smaller KL terms encode less information in their latent variables.
|
| 110 |
+
|
| 111 |
+
We observe a sharp drop in the $\mathrm { K L }$ divergence term when we use a single autoregressive layer compared to no autoregressive layers, indicating that the latent variables have been freed from having to encode small-scale details in the images. Since the addition of a single PixelCNN layer allows the decoder to model interactions between pixels which are at most 2 pixels away from each other (since our masked convolution filter size is $5 \times 5$ ), we can also say that most of the non-trivial (long-range) structure in the images is still encoded in the latent variables.
|
| 112 |
+
|
| 113 |
+
# 4.1.3 LATENT REPRESENTATIONS
|
| 114 |
+
|
| 115 |
+
On MNIST, given a sufficiently high-dimensional latent space, VAEs have already been shown to learn representations in which digits are well-separated (Sønderby et al., 2016). However, this task becomes more challenging as the capacity of the latent space is decreased. PixelVAE’s flexible output distribution should allow it to learn a latent representation which is invariant to small details and thus better models global factors of variation given limited capacity.
|
| 116 |
+
|
| 117 |
+
To test this, we train a PixelVAE with a two-dimensional latent space, and an equivalent VAE. We visualize the distribution of test set images in latent space and observe that PixelVAE’s latent representation separates digits significantly better than VAE (Figure 5). To quantify this difference, we train a K-nearest neighbors classifier in the latent space of each model and find that PixelVAE significantly outperforms VAE, achieving a test error of $7 . 2 \%$ compared to VAE’s $2 2 . 9 \%$ . We also note that unlike VAE, PixelVAE learns a representation in which digit identity is largely disentangled from other generative factors.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 5: Visualization of the MNIST test set in the latent space of (a) convolutional VAE and (b) PixelVAE with two latent dimensions. PixelVAE separates classes more completely than VAE.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 6: We visually inspect the variation in image features captured by the different levels of stochasticity in our model. For the two-level latent variable model trained on $6 4 \times 6 4$ LSUN bedrooms, we vary only the top-level sampling noise (top) while holding the other levels constant, vary only the middle-level noise (middle), and vary only the bottom (pixel-level) noise (bottom). It appears that the top-level latent variables learn to model room structure and overall geometry, the middle-level latents model color and texture features, and the pixel-level distribution models low-level image characteristics such as texture, alignment, shading.
|
| 124 |
+
|
| 125 |
+
# 4.2 LSUN BEDROOMS
|
| 126 |
+
|
| 127 |
+
To evaluate our model’s performance with more data and complicated image distributions, we perform experiments on the LSUN bedrooms dataset (Yu et al., 2015). We use the same preprocessing as in Radford et al. (2015) to remove duplicate images in the dataset. For quantitative experiments we use a $3 2 \times 3 2$ downsampled version of the dataset, and we present samples from a model trained on the $6 4 \times 6 4$ version.
|
| 128 |
+
|
| 129 |
+
We train a two-level PixelVAE with latent variables at $1 \times 1$ and $8 \times 8$ spatial resolutions. We find that this outperforms both a two-level convolutional VAE with diagonal Gaussian output and a singlelevel PixelVAE in terms of log-likelihood and sample quality. We also try replacing the PixelCNN layers at the higher level with a diagonal Gaussian decoder and find that this hurts log-likelihood, which suggests that multi-scale PixelVAE uses those layers effectively to autoregressively model latent features.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 7: Samples from hierarchical PixelVAE on the 64x64 ImageNet dataset.
|
| 133 |
+
|
| 134 |
+
# 4.2.1 FEATURES MODELED AT EACH LAYER
|
| 135 |
+
|
| 136 |
+
To see which features are modeled by each of the multiple layers, we draw multiple samples while varying the sampling noise at only a specific layer (either at the pixel-wise output or one of the latent layers) and visually inspect the resulting images (Fig. 6). When we vary only the pixellevel sampling (holding $z _ { 1 }$ and $z _ { 2 }$ fixed), samples are almost indistinguishable and differ only in precise positioning and shading details, suggesting that the model uses the pixel-level autoregressive distribution to model only these features. Samples where only the noise in the middle-level $( 8 ~ \times$ 8) latent variables is varied have different objects and colors, but appear to have similar basic room geometry and composition. Finally, samples with varied top-level latent variables have diverse room geometry.
|
| 137 |
+
|
| 138 |
+
# 4.3 $6 4 \times 6 4$ IMAGENET
|
| 139 |
+
|
| 140 |
+
The $6 4 \times 6 4$ ImageNet generative modeling task was introduced in (van den Oord et al., 2016a) and involves density estimation of a difficult, highly varied image distribution. We trained a heirarchical PixelVAE model (with a similar architecture to the model in section 4.2) on $6 4 \times 6 4$ ImageNet and report validation set likelihood in Table 2. Our model achieves a likelihood competitive with van den Oord et al. (2016a;b), despite being substantially less computationally complex. A visual inspection of ImageNet samples from our model (Fig. 7) also reveals them to be significantly more globally coherent than samples from PixelRNN.
|
| 141 |
+
|
| 142 |
+
<table><tr><td>Model</td><td>NLL Validation (Train)</td><td>FLOPs</td></tr><tr><td>Convolutional DRAW (Gregor et al., 2016)</td><td>≤ 4.10 (4.04)</td><td></td></tr><tr><td>Real NVP (Dinh et al.,2016)</td><td>= 4.01 (3.93)</td><td></td></tr><tr><td>PixelRNN (van den Oord et al., 2016a)</td><td>= 3.63 (3.57)</td><td>154×109</td></tr><tr><td>Gated PixelCNN(van den Oord et al., 2016b)</td><td>= 3.57 (3.48)</td><td>134 ×109</td></tr><tr><td>Hierarchical PixelVAE</td><td>≤ 3.62 (3.55)</td><td>63×109</td></tr></table>
|
| 143 |
+
|
| 144 |
+
Table 2: Model performance on $6 4 \times 6 4$ ImageNet. We achieve competitive NLL at a fraction of the computational complexity of other leading models.
|
| 145 |
+
|
| 146 |
+
# 5 CONCLUSIONS
|
| 147 |
+
|
| 148 |
+
In this paper, we introduced a VAE model for natural images with an autoregressive decoder that achieves strong performance across a number of datasets. We explored properties of our model, showing that it can generate more compressed latent representations than a standard VAE and that it can use fewer autoregressive layers than PixelCNN. We established a new state-of-the-art on binarized MNIST dataset in terms of likelihood on $6 4 \times 6 4$ ImageNet and demonstrated that our model generates high-quality samples on LSUN bedrooms.
|
| 149 |
+
|
| 150 |
+
The ability of PixelVAE to learn compressed representations in its latent variables by ignoring the small-scale structure in images is potentially very useful for downstream tasks. It would be interesting to further explore our model’s capabilities for semi-supervised classification and representation learning in future work.
|
| 151 |
+
|
| 152 |
+
# ACKNOWLEDGMENTS
|
| 153 |
+
|
| 154 |
+
The authors would like to thank the developers of Theano (Theano Development Team, 2016) and Blocks and Fuel (van Merrienboer et al., 2015). We acknowledge the support of the following ¨ agencies for research funding and computing support: Ubisoft, Nuance Foundation, NSERC, Calcul Quebec, Compute Canada, CIFAR, MEC Project TRA2014-57088-C2-1-R, SGR project 2014- SGR-1506 and TECNIOspring-FP7-ACCI grant.
|
| 155 |
+
|
| 156 |
+
# REFERENCES
|
| 157 |
+
|
| 158 |
+
Samuel R Bowman, Luke Vilnis, Oriol Vinyals, Andrew M Dai, Rafal Jozefowicz, and Samy Bengio. Generating sentences from a continuous space. 2016.
|
| 159 |
+
Yuri Burda, Roger Grosse, and Ruslan Salakhutdinov. Importance weighted autoencoders. arXiv preprint arXiv:1509.00519, 2015.
|
| 160 |
+
Kenneth P. Burnham and David R. Anderson. Model selection and multi-model inference, 2nd ed. A Practical information-theoretic approach. Springer-Verlag, pp. 78, 2003.
|
| 161 |
+
Xi Chen, Diederik P Kingma, Tim Salimans, Yan Duan, Prafulla Dhariwal, John Schulman, Ilya Sutskever, and Pieter Abbeel. Variational Lossy Autoencoder. arXiv.org, November 2016.
|
| 162 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using Real NVP. arXiv.org, May 2016.
|
| 163 |
+
Jeff Donahue, Philipp Krahenb ¨ uhl, and Trevor Darrell. Adversarial feature learning. ¨ CoRR, abs/1605.09782, 2016. URL http://arxiv.org/abs/1605.09782.
|
| 164 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. CoRR, abs/1606.00704, 2016.
|
| 165 |
+
Matthieu Germain, Karol Gregor, Iain Murray, and Hugo Larochelle. Made: Masked autoencoder for distribution estimation. CoRR, abs/1502.03509, 2015. URL https://arxiv.org/abs/ 1502.03509.
|
| 166 |
+
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, pp. 2672–2680, 2014.
|
| 167 |
+
Karol Gregor, Frederic Besse, Danilo Jimenez Rezende, Ivo Danihelka, and Daan Wierstra. Towards Conceptual Compression. arXiv.org, April 2016.
|
| 168 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. International Conference on Learning Representations (ICLR), 2014.
|
| 169 |
+
Diederik P. Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. CoRR, abs/1606.04934, 2016.
|
| 170 |
+
Yann Lecun, Lon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pp. 2278–2324, 1998.
|
| 171 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. CoRR, abs/1511.06434, 2015.
|
| 172 |
+
Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. In International Conference on Machine Learning (ICML), 2015.
|
| 173 |
+
Jason Tyler Rolfe. Discrete variational autoencoders. arXiv preprint arXiv:1609.02200, 2016.
|
| 174 |
+
Ruslan Salakhutdinov and Iain Murray. On the quantitative analysis of deep belief networks. In In Proceedings of the 25th international conference on Machine learning, 2008.
|
| 175 |
+
Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. CoRR, abs/1606.03498, 2016.
|
| 176 |
+
Casper Kaae Sønderby, Tapani Raiko, Lars Maaløe, Søren Kaae Sønderby, and Ole Winther. Ladder Variational Autoencoders. arXiv.org, February 2016.
|
| 177 |
+
Theano Development Team. Theano: A Python framework for fast computation of mathematical expressions. arXiv e-prints, abs/1605.02688, May 2016. URL http://arxiv.org/abs/ 1605.02688.
|
| 178 |
+
Aaron van den Oord, Nal Kalchbrenner, and Koray Kavukcuoglu. Pixel recurrent neural networks. ¨ In International Conference on Machine Learning (ICML), 2016a.
|
| 179 |
+
Aaron van den Oord, Nal Kalchbrenner, Oriol Vinyals, Lasse Espeholt, Alex Graves, and Koray ¨ Kavukcuoglu. Conditional image generation with pixelcnn decoders. CoRR, abs/1606.05328, 2016b. URL http://arxiv.org/abs/1606.05328.
|
| 180 |
+
Bart van Merrienboer, Dzmitry Bahdanau, Vincent Dumoulin, Dmitriy Serdyuk, David Warde- ¨ Farley, Jan Chorowski, and Yoshua Bengio. Blocks and fuel: Frameworks for deep learning. arXiv preprint, abs/1506.00619, 2015. URL http://arxiv.org/abs/1506.00619.
|
| 181 |
+
Fisher Yu, Yinda Zhang, Shuran Song, Ari Seff, and Jianxiong Xiao. LSUN: construction of a large-scale image dataset using deep learning with humans in the loop. CoRR, abs/1506.03365, 2015.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 8: Reconstructions for (a) LSUN Bedrooms and (b) $6 4 \times 6 4$ ImageNet. Left-most columns are images from the test set, and the following 5 columns are top-down generations from the highest level of latent variables. We see that the reconstructions capture high-level semantic properties of the original images while varying in most of the details. We also visualized similar reconstructions by generations from the lower level of latent variables, and in this case the reconstructions were visually indistinguishable from the original images.
|
| 185 |
+
|
| 186 |
+
# B MNIST SAMPLES
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 9: Samples from a PixelVAE with a receptive field of 7 pixels (left), a PixelCNN with an 11-pixel receptive field (middle; roughly the same computational complexity as the PixelVAE), and a PixelCNN with a 7-pixel receptive field (right).
|
| 190 |
+
|
| 191 |
+
# C MNIST RECONSTRUCTIONS
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 10: Reconstructions from the MNIST test set. Alternate columns are original (left) and reconstructed images (right).
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 11: More examples for visualizations of the variation in image features captured at different levels of stochasticity. Holding the other levels constant, we vary only the top-level sampling noise (top), only the middle-level noise (middle), and only the bottom (pixel-level) noise (bottom).
|
| 198 |
+
|
| 199 |
+
# E MODEL ARCHITECTURE
|
| 200 |
+
|
| 201 |
+
# E.1 MNIST
|
| 202 |
+
|
| 203 |
+
For our quantitative MNIST experiments, the architectures of our encoder and decoder are as follows. Unless otherwise specified, all convolutional layers use ReLU nonlinearity. We also make an open-source implementation of this model available at https://github.com/igul222/ PixelVAE.
|
| 204 |
+
|
| 205 |
+
<table><tr><td colspan="4">Encoder x → (μ,σ)</td></tr><tr><td></td><td>Kernel size</td><td>Stride</td><td>Output channels</td></tr><tr><td>Convolution Convolution</td><td>3x3</td><td>1</td><td>32</td></tr><tr><td></td><td>3x3</td><td>2</td><td>32</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>32</td></tr><tr><td>Convolution</td><td>3x3</td><td>2</td><td>64</td></tr><tr><td colspan="4">Pad 7×7 feature maps to 8×8</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td>Convolution</td><td>3x3</td><td>2</td><td>64</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td colspan="4">Flatten</td></tr><tr><td>Linear</td><td>=</td><td>1</td><td>2×latent dimensionality</td></tr></table>
|
| 206 |
+
|
| 207 |
+
<table><tr><td colspan="4">Decoder z →x</td></tr><tr><td></td><td>Kernel size</td><td>Stride</td><td>Output channels</td></tr><tr><td>Linear</td><td>=</td><td></td><td>4×4×64</td></tr><tr><td colspan="4">Reshape to (64, 4, 4)</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td>Transposed convolution</td><td>3x3</td><td>2</td><td>64</td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>64</td></tr><tr><td colspan="4">Crop 8×8 feature maps to 7×7</td></tr><tr><td>Transposed convolution</td><td>3x3</td><td>2</td><td></td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>323232</td></tr><tr><td>Transposed convolution</td><td>3x3</td><td>2</td><td></td></tr><tr><td>Convolution</td><td>3x3</td><td>1</td><td>32</td></tr><tr><td>PixelCNN gated residual block</td><td>7x7</td><td>1</td><td>32</td></tr><tr><td>PixelCNN gated residual block(s)</td><td>[5x5]×N</td><td>1</td><td>32</td></tr><tr><td>PixelCNN gated convolution</td><td>1x1</td><td>1</td><td>32</td></tr><tr><td>PixelCNN gated convolution</td><td>1x1</td><td>1</td><td>32</td></tr><tr><td>Convolution</td><td>1x1</td><td>1</td><td>1</td></tr></table>
|
| 208 |
+
|
| 209 |
+
# E.2 LSUN BEDROOMS AND $6 4 \times 6 4$ IMAGENET
|
| 210 |
+
|
| 211 |
+
The LSUN and ImageNet models use the same architecture: all encoders and decoders are residual networks; we use pre-activation residual blocks with two $3 \times 3$ convolutional layers each and ELU nonlinearity. Some residual blocks perform downsampling, using a $2 \times 2$ stride in the second convolutional layer, or upsampling, using subpixel convolution in the first convolutional layer. Weight normalization is used in masked convolutional layers; in all other layers, batch normalization is used. We optimize using Adam with learning rate 1e-3. Training proceeds for 400K iterations using batch size 48.
|
| 212 |
+
|
| 213 |
+
For further architectural details, please refer to our open-source implementation at https:// github.com/igul222/PixelVAE.
|
| 214 |
+
|
| 215 |
+
<table><tr><td rowspan=1 colspan=6>Bottom-level Encoder x →h1</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>Kernel size</td><td rowspan=1 colspan=1>Resample</td><td rowspan=1 colspan=1>Output channels</td></tr><tr><td rowspan=3 colspan=1>EmbeddingConvolutionResidual block</td><td rowspan=1 colspan=3></td><td rowspan=3 colspan=1>===</td><td rowspan=9 colspan=1>48192192256256512512512512</td></tr><tr><td rowspan=1 colspan=2>1x1</td><td rowspan=1 colspan=2>1x1</td></tr><tr><td rowspan=1 colspan=3>[3x3]×2</td></tr><tr><td rowspan=1 colspan=1>Residual block</td><td rowspan=1 colspan=3>[3x3]×2</td><td rowspan=1 colspan=1>Down ×2</td></tr><tr><td rowspan=1 colspan=1>Residual block</td><td rowspan=1 colspan=3>[3x3]×2</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Residual block</td><td rowspan=1 colspan=3>[3x3j×2</td><td rowspan=1 colspan=1>Down ×2</td></tr><tr><td rowspan=1 colspan=1>Residual block</td><td rowspan=1 colspan=3>[3x3]×2</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Residual block</td><td rowspan=1 colspan=3>[3x3j×2</td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>Residual block</td><td rowspan=1 colspan=3>[3x3]×2</td><td rowspan=1 colspan=1></td></tr></table>
|
| 216 |
+
|
| 217 |
+
<table><tr><td colspan="4">Bottom-level Decoder z1 → </td></tr><tr><td></td><td>Kernel size</td><td>Resample</td><td>Output channels</td></tr><tr><td>Convolution Residual block</td><td>1x1 [3x3]×2</td><td>1</td><td>512 512</td></tr><tr><td>Residual block Residual block</td><td>[3x3]×2 [3x3]×2</td><td></td><td>512</td></tr><tr><td>Residual block</td><td>[3x3]×2</td><td>Up ×2</td><td>512 256</td></tr><tr><td>Residual block</td><td>[3x3]×2</td><td></td><td>256</td></tr><tr><td>Residualblock</td><td>[3x3]×2</td><td>Up ×2</td><td>192</td></tr><tr><td>Residual block</td><td>[3x3]×2</td><td>=</td><td>192</td></tr><tr><td>Embedding</td><td></td><td></td><td>48</td></tr><tr><td>PixelCNN gated residual block</td><td>[3x3]×2</td><td></td><td></td></tr><tr><td>PixelCNN gated residual block</td><td>[3x3]×2</td><td></td><td>384</td></tr><tr><td>PixelCNN gated residual block</td><td>[3x3]×2</td><td></td><td>384 384</td></tr></table>
|
| 218 |
+
|
| 219 |
+
<table><tr><td colspan="4">Top-level Encoder h1 → h2</td></tr><tr><td></td><td>Kernel size</td><td>Resample</td><td>Output channels</td></tr><tr><td>Residual block Residual block Residual block Residual block Residual block Residual block Residual block</td><td>[3x3]×2 [3x3j×2 [3x3]×2 [3x3]×2 [3x3]×2 [3x3j×2 [3x3]×2</td><td>= Down ×2 Down ×2</td><td>512 512 512 512 512 512 512</td></tr></table>
|
| 220 |
+
|
| 221 |
+
<table><tr><td></td><td rowspan=1 colspan=7>Top-level Decoder z2 → 泛1</td></tr><tr><td></td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1>Kernel size</td><td rowspan=1 colspan=3>Resample</td><td rowspan=1 colspan=1>Output channels</td></tr><tr><td></td><td rowspan=1 colspan=2>Linear</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=3>-</td><td rowspan=1 colspan=1>4×4×512</td></tr><tr><td></td><td rowspan=1 colspan=7>Reshape to (512, 4, 4)</td></tr><tr><td></td><td rowspan=1 colspan=2>Residual block</td><td rowspan=1 colspan=1>[3x3]×2</td><td rowspan=6 colspan=3>Up ×2Up ×2</td><td rowspan=8 colspan=1>512512512512512512512512</td></tr><tr><td></td><td rowspan=6 colspan=2>Residual blockResidual blockResidual blockResidualblockResidual blockResidual block</td><td rowspan=1 colspan=1>[3x3]×2</td></tr><tr><td></td><td rowspan=1 colspan=1>[3x3]×2</td></tr><tr><td></td><td rowspan=1 colspan=1>[3x3]×2</td></tr><tr><td></td><td rowspan=1 colspan=1>[3x3]×2</td></tr><tr><td></td><td rowspan=1 colspan=1>[3x3]×2</td><td rowspan=2 colspan=2>x2</td></tr><tr><td></td><td rowspan=1 colspan=1>[3x3]×2</td><td rowspan=1 colspan=2></td></tr><tr><td></td><td rowspan=1 colspan=2>Residual block</td><td rowspan=1 colspan=1>[3x3]×2</td><td rowspan=1 colspan=3></td></tr><tr><td rowspan=4 colspan=3>PixelCNN convolutionPixelCNN gated residual blockPixelCNN gated residual blockPixelCNN gated residual blockConvolution</td><td rowspan=2 colspan=4>PixelCNN convolutionPixelCNN gated residual block</td><td rowspan=1 colspan=1>5x5</td></tr><tr><td rowspan=1 colspan=1>[3x3]×2</td><td></td></tr><tr><td rowspan=1 colspan=1>dualblock</td><td rowspan=1 colspan=1>[3x3]×2</td><td rowspan=1 colspan=3></td><td></td></tr><tr><td rowspan=1 colspan=1>[3x3]×21x1</td><td rowspan=1 colspan=3></td><td></td></tr></table>
|
md/train/BJluy2RcFm/BJluy2RcFm.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/BJzVUj0qtQ/BJzVUj0qtQ.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EVADING DEFENSES TO TRANSFERABLE ADVERSAR-IAL EXAMPLES BY MITIGATING ATTENTION SHIFT
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep neural networks are vulnerable to adversarial examples, which can mislead classifiers by adding imperceptible perturbations. An intriguing property of adversarial examples is their good transferability, making black-box attacks feasible in real-world applications. Due to the threat of adversarial attacks, many methods have been proposed to improve the robustness, and several state-of-the-art defenses are shown to be robust against transferable adversarial examples. In this paper, we identify the attention shift phenomenon, which may hinder the transferability of adversarial examples to the defense models. It indicates that the defenses rely on different discriminative regions to make predictions compared with normally trained models. Therefore, we propose an attention-invariant attack method to generate more transferable adversarial examples. Extensive experiments on the ImageNet dataset validate the effectiveness of the proposed method. Our best attack fools eight state-of-the-art defenses at an $8 2 \%$ success rate on average based only on the transferability, demonstrating the insecurity of the defense techniques.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent progress in machine learning and deep neural networks has led to substantial improvements in various pattern recognition tasks such as image understanding (Simonyan & Zisserman, 2015; He et al., 2016a), speech recognition (Graves et al., 2013), and machine translation (Sutskever et al., 2014). However, deep neural networks are highly vulnerable to adversarial examples (Biggio et al., 2013; Szegedy et al., 2014; Goodfellow et al., 2015). They are maliciously generated by adding small perturbations to legitimate examples, but make deep neural networks produce unreasonable predictions. The existence of adversarial examples, even in the physical world (Kurakin et al., 2016; Eykholt et al., 2018; Athalye et al., 2018b), has raised concerns in security-sensitive applications, e.g., self-driving cars, healthcare and finance.
|
| 12 |
+
|
| 13 |
+
Attacking deep neural networks has drawn an increasing attention since the generated adversarial examples can serve as a surrogate to evaluate the robustness of different models (Carlini & Wagner, 2017) and help to improve the robustness (Goodfellow et al., 2015; Madry et al., 2018). Several methods have been proposed to generate adversarial examples with the knowledge of the gradient information of a given model, such as fast gradient sign method (Goodfellow et al., 2015), basic iterative method (Kurakin et al., 2016), and Carlini & Wagner (2017)’s method, which are known as white-box attacks. Moreover, it is shown that adversarial examples have cross-model transferability (Liu et al., 2017), i.e., the adversarial examples crafted for one model can fool a different model with a high probability. The transferability of adversarial examples enables practical black-box attacks to real-world applications and induces serious security issues.
|
| 14 |
+
|
| 15 |
+
The threat of adversarial examples has motivated extensive research on building robust models or techniques to defend against adversarial attacks. These include training with adversarial examples (Goodfellow et al., 2015; Kurakin et al., 2017; Tramer et al., 2018; Madry et al., 2018), image de- \` noising/transformation (Liao et al., 2018; Xie et al., 2018a; Guo et al., 2018), leveraging generative models to move adversarial examples towards data manifold (Song et al., 2018; Samangouei et al., 2018), and theoretically-certified defenses (Raghunathan et al., 2018; Wong & Kolter, 2018). Although the non-certified defenses have demonstrated robustness against common attacks, they do so by causing obfuscated gradients, which can be easily circumvented by new attacks (Athalye et al., 2018a). However, some of the defenses (Tramer et al., 2018; Liao et al., 2018; Xie et al., 2018a; \`
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Demonstration of the attention shift phenomenon of the defense models compared with normally trained models. We adopt class activation mapping (Zhou et al., 2016) to visualize the attentive regions of three normally trained models—Inception v3 (Szegedy et al., 2016), Inception ResNet v2 (Szegedy et al., 2017), ResNet 152 (He et al., 2016a) and four defense models (Tramer\` et al., 2018; Liao et al., 2018; Xie et al., 2018a; Guo et al., 2018). These defense models focus their attention on slightly different regions compared with normally trained models, which may affect the transferability of adversarial examples.
|
| 19 |
+
|
| 20 |
+
Guo et al., 2018) claim to be resistant to transferable adversarial examples, making black-box attacks difficult to evade these defenses.
|
| 21 |
+
|
| 22 |
+
In this paper, we identify attention shift, that the defenses make predictions based on slightly different discriminative regions compared with normally trained models, as a phenomenon which may hinder the transferability of adversarial examples to the defense models. For example, we show the attention maps of several normally trained models and defense models in Fig. 1, to represent the discriminative regions for their predictions. It is apparent that the normally trained models have similar attention maps while the defenses induce shifting attention maps. The attention shift of the defenses is caused by either training under different data distributions (Tramer et al., 2018) or transforming \` the inputs before classification (Liao et al., 2018; Xie et al., 2018a; Guo et al., 2018). Therefore, the transferability of adversarial examples is largely reduced to the defenses since the structure information hidden in adversarial perturbations may be easily overlooked if a model focuses its attention on different regions.
|
| 23 |
+
|
| 24 |
+
To mitigate the effect of attention shift and evade the defenses by transferable adversarial examples, we propose an attention-invariant attack method. In particular, we generate an adversarial example for an ensemble of examples composed of an legitimate one and its shifted versions. Therefore the resultant adversarial example is less sensitive to the attentive region of the white-box model being attacked and may have a bigger chance to fool another black-box model with a defense mechanism based on attention shift. We further show that this method can be simply implemented by convolving the gradient with a pre-defined kernel under a mild assumption. The proposed method can be integrated into any gradient-based attack methods such as fast gradient sign method and basic iterative method. Extensive experiments demonstrate that the proposed attention-invariant attack method helps to improve the success rates of black-box attacks against the defense models by a large margin. Our best attack reaches an average success rate of $8 2 \%$ to evade eight state-of-the-art defenses based only on the transferability, thus demonstrating the insecurity of the current defenses.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Adversarial Examples. Deep neural networks are shown to be vulnerable to adversarial examples first in the visual domain (Szegedy et al., 2014). Then several methods are proposed to generate adversarial examples for the purpose of high success rates and minimal size of perturbations (Goodfellow et al., 2015; Kurakin et al., 2016; Carlini & Wagner, 2017). They also exist in the physical world (Kurakin et al., 2016; Eykholt et al., 2018; Athalye et al., 2018b). Although adversarial examples are recently crafted for many domains, we focus on image classification tasks in this paper.
|
| 29 |
+
|
| 30 |
+
Black-box Attacks. Black-box adversaries have no access to the architecture or parameters of the target model, which are under a more challenging threat model to perform attacks. The transferability of adversarial examples provides an opportunity to attack a black-box model (Liu et al., 2017).
|
| 31 |
+
|
| 32 |
+
Several methods (Dong et al., 2018; Xie et al., 2018b) have been proposed to improve the transferability, which enable powerful black-box attacks. Besides the transfer-based black-box attacks, there is another line of works that perform attacks based on adaptive queries. For example, Papernot et al. (2017) use queries to distill the knowledge of the target model and train a surrogate model. It therefore turns the black-box attacks to the white-box attacks. Recent methods use queries to estimate the gradient or the decision boundary of the black-box model (??) to generate adversarial examples. However, these methods usually require tremendous number of queries, which may be impractical in real-world applications. In this paper, we resort to transferable adversarial examples for black-box attacks.
|
| 33 |
+
|
| 34 |
+
Defend against Adversarial Attacks. A large variety of methods have been proposed to increase the robustness of deep learning models. Besides directly making the models produce correct predictions for adversarial examples, some methods attempt to detect them instead (?Metzen et al., 2017; ?). However most of the non-certified defenses demonstrate the robustness by causing obfuscated gradients, which are successfully circumvented by new developed attacks (Athalye et al., 2018a). Although these defenses are not robust in the white-box setting, some of them (Tramer et al., 2018; \` Liao et al., 2018; Xie et al., 2018a; Guo et al., 2018) empirically show the resistance against transferable adversarial examples in the black-box setting. In this paper, we focus on generating more transferable adversarial examples against these defenses.
|
| 35 |
+
|
| 36 |
+
# 3 METHODOLOGY
|
| 37 |
+
|
| 38 |
+
In this section, we provide the detailed description of our algorithm. Let $\pmb { x } ^ { r e a l }$ denote a real example and $y$ denote the corresponding ground-truth label. Given a classifier $f ( { \pmb x } ) : \mathcal { X } \mathcal { Y }$ that outputs a label as the prediction for an input, we want to generate an adversarial example $\pmb { x } ^ { a d v }$ which is visually indistinguishable from $\pmb { x } ^ { \bar { r } e a l }$ but fools the classifier, i.e., $f ( \mathbf { x } ^ { a d v } ) \neq \dot { y }$ .1 In most cases, the $L _ { p }$ norm of the adversarial perturbation is required to be smaller than a threshold $\epsilon$ as $\mid \mid \pmb { x } ^ { a d v } -$ $\pmb { x } ^ { r e a l } | | _ { p } \leq \epsilon$ . In this paper, we use the $L _ { \infty }$ norm as the measurement. For adversarial example generation, the objective is to maximize the loss function $J ( \pmb { x } ^ { a d v } , y )$ of the classifier, where $J$ is often the cross-entropy loss. So the constrained optimization problem can be written as
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\underset { \pmb { x } ^ { a d v } } { \arg \operatorname* { m a x } } J ( \pmb { x } ^ { a d v } , y ) , \quad \mathrm { s . t . } \ \| \pmb { x } ^ { a d v } - \pmb { x } ^ { r e a l } \| _ { \infty } \leq \epsilon .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
To solve this optimization problem, the gradient of the loss function with respect to the input needs to be calculated, termed as white-box attacks. However in some cases, we cannot get access to the gradient of the classifier, where we need to perform attacks in the black-box manner. We resort to transferable adversarial examples which are generated for a different white-box classifier but have high transferability for black-box attacks.
|
| 45 |
+
|
| 46 |
+
# 3.1 GRADIENT-BASED ADVERSARIAL ATTACK METHODS
|
| 47 |
+
|
| 48 |
+
Several methods have been proposed to solve the optimization problem in Eq. (1). We give a brief introduction of them in this section.
|
| 49 |
+
|
| 50 |
+
Fast Gradient Sign Method (FGSM) (Goodfellow et al., 2015) generates an adversarial example $\pmb { x } ^ { a d v }$ by linearizing the loss function in the input space and performing one-step update as
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r } { \pmb { x } ^ { a d v } = \pmb { x } ^ { r e a l } + \epsilon \cdot \mathrm { s i g n } ( \nabla _ { \pmb { x } } J ( \pmb { x } ^ { r e a l } , y ) ) , } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $\nabla _ { x } J$ is the gradient of the loss function with respect to $_ { \textbf { \em x } }$ . $\mathrm { s i g n } ( \cdot )$ is the sign function to make the perturbation meet the $L _ { \infty }$ norm bound. FGSM can generate more transferable adversarial examples but is usually not effective enough for attacking white-box models (Kurakin et al., 2017).
|
| 57 |
+
|
| 58 |
+
Basic Iterative Method (BIM) (Kurakin et al., 2016) extends FGSM by iteratively applying gradient updates multiple times with a small step size $\alpha$ , which can be expressed as
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r } { { \pmb x } _ { 0 } ^ { a d v } = { \pmb x } ^ { r e a l } , { \pmb x } _ { t + 1 } ^ { a d v } = { \pmb x } _ { t } ^ { a d v } + \alpha \cdot \mathrm { s i g n } ( \nabla _ { \pmb x } J ( { \pmb x } _ { t } ^ { a d v } , y ) ) . } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
To restrict the generated adversarial examples within the $\epsilon$ -ball of $\pmb { x } ^ { r e a l }$ , we can clip $\pmb { x } _ { t } ^ { a d v }$ after each update or set $\alpha = \epsilon / T$ with $T$ being the number of iterations. It has been shown that BIM induces
|
| 65 |
+
|
| 66 |
+
much more powerful white-box attacks than FGSM at the cost of worse transferability (Kurakin et al., 2017; Dong et al., 2018).
|
| 67 |
+
|
| 68 |
+
Momentum Iterative Fast Gradient Sign Method (MI-FGSM) (Dong et al., 2018) proposes to improve the transferability of adversarial examples by integrating a momentum term into the iterative attack method. The update procedure is
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
{ \pmb g } _ { t + 1 } = \mu \cdot { \pmb g } _ { t } + \frac { \nabla _ { \pmb x } J ( { \pmb x } _ { t } ^ { a d v } , \pmb y ) } { \| \nabla _ { \pmb x } J ( { \pmb x } _ { t } ^ { a d v } , \pmb y ) \| _ { 1 } } , \quad { \pmb x } _ { t + 1 } ^ { a d v } = { \pmb x } _ { t } ^ { a d v } + { \alpha } \cdot \mathrm { s i g n } ( { \pmb g } _ { t + 1 } ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\mathbf { \nabla } _ { \mathbf { \boldsymbol { g } } _ { t } }$ gathers the gradient information up to the $t$ -th iteration with a decay factor $\mu$
|
| 75 |
+
|
| 76 |
+
Diverse Inputs Iterative Fast Gradient Sign Method (Xie et al., 2018b) applies random transformations to the inputs and feeds the transformed images into the classifier for gradient calculation. The image transformation includes random resizing and padding with a given probability. This method can be combined with the momentum-based method to further improve the transferability.
|
| 77 |
+
|
| 78 |
+
Carlini $\pmb { \& }$ Wagner (2017)’s method is a powerful optimization-based method. It uses an auxiliary variable ${ \pmb v } ^ { a d v }$ as $\pmb { x } ^ { a d v } = \textstyle { \frac { 1 } { 2 } } ( \operatorname { t a n h } ( \pmb { v } ^ { a d v } ) + \dot { 1 } )$ , and optimizes ${ \pmb v } ^ { a d v }$ by solving
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\underset { \pmb { v } ^ { a d v } } { \arg \operatorname* { m i n } } \parallel \frac { 1 } { 2 } ( \operatorname { t a n h } ( \pmb { v } ^ { a d v } ) + 1 ) - \pmb { x } ^ { r e a l } \parallel _ { p } - c \cdot J ( \frac { 1 } { 2 } ( \operatorname { t a n h } ( \pmb { v } ^ { a d v } ) + 1 ) , y ) ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where the loss function $J$ could be different from the cross-entropy loss. This method aims to find adversarial examples with minimal size of perturbations, to measure the robustness of different models. It also lacks the efficacy for black-box attacks like BIM.
|
| 85 |
+
|
| 86 |
+
# 3.2 ATTENTION-INVARIANT ATTACK METHOD
|
| 87 |
+
|
| 88 |
+
Although many attack methods (Dong et al., 2018; Xie et al., 2018b) can generate adversarial examples with very high transferability across normally trained models, they are less effective to attack defense models in the black-box manner. Some of the defenses (Tramer et al., 2018; Liao et al., \` 2018; Xie et al., 2018a; Guo et al., 2018) are shown to be quite robust against black-box attacks. So we want to answer that: Are these defenses really free from transferable adversarial examples?
|
| 89 |
+
|
| 90 |
+
We identify the attention shift phenomenon which may inhibit the transferability of adversarial examples to the defenses. The attention shift refers to that the discriminative regions used by the defenses to identify object categories are slightly different from those used by normally trained models, as shown in Fig. 1. The adversarial examples generated for one model can be hardly transferred to another model with attention shift since that the structure information in adversarial perturbations may be easily destroyed if the model focuses its attention on different regions.
|
| 91 |
+
|
| 92 |
+
To reduce the effect of attention shift, we propose an attention-invariant attack method. In particular, rather than optimizing the objective function at a single point as Eq. (1), the proposed method uses a set of shifted images to optimize an adversarial example as
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\arg \operatorname* { m a x } _ { \pmb { x } ^ { a d v } } \sum _ { i , j } w _ { i j } J ( T _ { i j } ( \pmb { x } ^ { a d v } ) , y ) , \mathrm { s . t . } \| \pmb { x } ^ { a d v } - \pmb { x } ^ { r e a l } \| _ { \infty } \leq \epsilon ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $T _ { i j } ( { \pmb x } )$ is a transformation operation that shifts image $_ { \textbf { \em x } }$ by $i$ and $j$ pixels along the twodimensions respectively, i.e., each pixel $( a , b )$ of the transformed image is $T _ { i j } ( { \pmb x } ) _ { a , b } = x _ { a - i , b - j }$ , and $w _ { i j }$ is the weight for the loss $J ( T _ { i j } ( \pmb { x } ^ { a d v } ) , y )$ . We set $i , j \in \{ - k , . . . , 0 , . . . , k \}$ with $k$ being the maximal number of pixels to shift. With this method, the generated adversarial perturbations are less sensitive to the attentive regions of the white-box model, which may be transferred to another model with a higher success rate. However, we need to calculate the gradients for $( 2 k + 1 ) ^ { 2 }$ images, which introduces much more computations. Sampling a small number of shifted images for gradient calculation is a feasible way (Athalye et al., 2018b). But we show that we can perform attacks by calculating the gradient for only one image under a mild assumption.
|
| 99 |
+
|
| 100 |
+
Convolutional neural networks are known to have the shift-invariant property (LeCun & Bengio, 1995), that an object in the input can be recognized in spite of its position. Pooling layers contribute resilience to slight transformation of the input. Therefore, we make an assumption that the shifted image $T _ { i j } ( { \pmb x } )$ is almost the same as $_ { \textbf { \em x } }$ as inputs to the models, as well as their gradients
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\nabla _ { \pmb { x } } J ( \pmb { x } , y ) \big | _ { \pmb { x } = T _ { i j } ( \hat { \pmb { x } } ) } \approx \nabla _ { \pmb { x } } J ( \pmb { x } , y ) \big | _ { \pmb { x } = \hat { \pmb { x } } } .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Based on this assumption, we calculate the gradient of the loss defined in Eq. (6) at a point $\hat { \pmb x }$ as
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\begin{array} { r l } { { \nabla _ { x } \big ( \sum _ { i , j } w _ { i j } J ( T _ { i j } ( x ) , y ) \big ) \big | _ { x = \hat { x } } = \sum _ { i , j } w _ { i j } \nabla _ { x } J ( T _ { i j } ( x ) , y ) \big | _ { x = \hat { x } } } } \\ & { = \displaystyle \sum _ { i , j } w _ { i j } \big ( \nabla _ { T _ { i j } ( x ) } J ( T _ { i j } ( x ) , y ) \cdot \frac { \partial T _ { i j } ( x ) } { \partial x } \big ) \Big | _ { x = \hat { x } } } \\ & { = \displaystyle \sum _ { i , j } w _ { i j } T _ { - i - j } \big ( \nabla _ { x } J ( x , y ) \big | _ { x = T _ { i j } ( \hat { x } ) } \big ) } \\ & { \approx \displaystyle \sum _ { i , j } w _ { i j } T _ { - i - j } \big ( \nabla _ { x } J ( x , y ) \big | _ { x = \hat { x } } \big ) . } \end{array}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Given Eq. (8), we do not need to calculate the gradients for $( 2 k + 1 ) ^ { 2 }$ images. Instead, we only need to get the gradient for the unchanged image $\hat { \pmb x }$ and then average all the shifted gradients. This procedure is equivalent to convolving the gradient with a kernel composed of all the weights $w _ { i j }$ as
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\sum _ { i , j } \left. w _ { i j } T _ { - i - j } ( \nabla _ { \pmb { x } } J ( \pmb { x } , y ) \bigr | _ { \pmb { x } = \pmb { \hat { x } } } ) \Leftrightarrow W * \nabla _ { \pmb { x } } J ( \pmb { x } , y ) \right| _ { \pmb { x } = \pmb { \hat { x } } } ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $W$ is the kernel matrix of size $( 2 k + 1 ) \times ( 2 k + 1 )$ with $W _ { i , j } \ : = \ : w _ { - i - j }$ . In this paper, we generate the kernel $W$ from a two-dimensional Gaussian function because: 1) the images with bigger shifts have relatively lower weights to make the adversarial perturbation fool the model at the unshifted image effectively; 2) by using a Gaussian function, this procedure is known as Gaussian blur, which is widely used in image processing.
|
| 119 |
+
|
| 120 |
+
Note that we only illustrate how to calculate the gradient of the loss function defined in Eq. (6), but do not specify the update algorithm for generating adversarial examples. This indicates that our method can be integrated into any gradient-based attack methods including FGSM, BIM, MI-FGSM, etc. Specifically, in each step we calculate the gradient then convolve the gradient with the pre-defined kernel $\nabla _ { \pmb { x } } J ( \pmb { x } _ { t } ^ { a d v } , y )$ at the current solution y get the new solution $\pmb { x } _ { t } ^ { a d v }$ $W$ $\pmb { x } _ { t + 1 } ^ { a d v }$
|
| 121 |
+
|
| 122 |
+
# 4 EXPERIMENTS
|
| 123 |
+
|
| 124 |
+
In this section, we present the experimental results to demonstrate the effectiveness of the proposed method on improving the transferability of adversarial examples to the defense models.
|
| 125 |
+
|
| 126 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 127 |
+
|
| 128 |
+
We use an ImageNet-compatible dataset2 comprised of 1000 images to conduct experiments. This dataset was used in the NIPS 2017 adversarial competition. We include eight defense models which are shown to be robust agsinst black-box attacks on the ImageNet dataset. These are
|
| 129 |
+
|
| 130 |
+
• Inc- $\mathbf { \Delta } \cdot \mathbf { v } 3 _ { \mathrm { e n s 3 } }$ , Inc- $\mathbf { \nabla \cdot v } 3 _ { \mathrm { e n s 4 } }$ , IncRes- $\cdot \mathrm { v } 2 _ { \mathrm { e n s } }$ (Tramer et al., 2018); \`
|
| 131 |
+
• high-level representation guided denoiser (HGD, rank-1 submission in the NIPS 2017 defense competition) (Liao et al., 2018); input transformation through random resizing and padding (R&P, rank-2 submission in the NIPS 2017 defense competition) (Xie et al., 2018a); input transformation through JPEG compression or total variance minimization (TVM) (Guo et al., 2018);
|
| 132 |
+
• rank-3 submission3 in the NIPS 2017 defense competition (NIPS-r3).
|
| 133 |
+
|
| 134 |
+
To attack these defenses based on the transferability, we also include four normally trained models— Inception v3 (Inc-v3) (Szegedy et al., 2016), Inception v4 (Inc-v4), Inception ResNet v2 (IncResv2) (Szegedy et al., 2017), and ResNet v2-152 (Res-v2-152) (He et al., 2016b), as the white-box models to generate adversarial examples.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 2: The adversarial examples generated for Inc-v3 using FGSM and A-FGSM.
|
| 138 |
+
|
| 139 |
+
Table 1: The success rates $( \% )$ ) of black-box attacks against eight defenses. The adversarial examples are crafted for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using FGSM and A-FGSM.
|
| 140 |
+
|
| 141 |
+
<table><tr><td></td><td>Attack</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td><td>HGD</td><td>R&P</td><td>JPEG</td><td>TVM</td><td>NIPS-r3</td></tr><tr><td rowspan="2">Inc-v3</td><td>FGSM</td><td>15.6</td><td>14.7</td><td>7.0</td><td>2.1</td><td>6.5</td><td>19.9</td><td>18.8</td><td>9.8</td></tr><tr><td>A-FGSM</td><td>28.2</td><td>28.9</td><td>22.3</td><td>18.4</td><td>19.8</td><td>25.5</td><td>30.7</td><td>24.5</td></tr><tr><td rowspan="2">Inc-v4</td><td>FGSM</td><td>16.2</td><td>16.1</td><td>9.0</td><td>2.6</td><td>7.9</td><td>21.8</td><td>19.9</td><td>11.5</td></tr><tr><td>A-FGSM</td><td>28.2</td><td>28.3</td><td>21.4</td><td>18.1</td><td>21.6</td><td>27.9</td><td>31.8</td><td>24.6</td></tr><tr><td rowspan="2">IncRes-v2</td><td>FGSM</td><td>18.0</td><td>17.2</td><td>10.2</td><td>3.9</td><td>9.9</td><td>24.7</td><td>23.4</td><td>13.3</td></tr><tr><td>A-FGSM</td><td>32.8</td><td>33.6</td><td>28.1</td><td>25.4</td><td>28.1</td><td>32.4</td><td>38.5</td><td>31.4</td></tr><tr><td rowspan="2">Res-v2-152</td><td>FGSM</td><td>20.2</td><td>17.7</td><td>9.9</td><td>3.6</td><td>8.6</td><td>24.0</td><td>22.0</td><td>12.5</td></tr><tr><td>A-FGSM</td><td>34.6</td><td>34.5</td><td>27.8</td><td>24.4</td><td>27.4</td><td>32.7</td><td>38.1</td><td>30.1</td></tr></table>
|
| 142 |
+
|
| 143 |
+
In our experiments, we integrate our method into the fast gradient sign method (FGSM) (Goodfellow et al., 2015), momentum iterative fast gradient sign method (MI-FGSM) (Dong et al., 2018) and diverse input iterative fast gradient sign method with momentum (DIM) (Xie et al., 2018b). We do not include the basic iterative method and Carlini & Wagner (2017)’s method since that they are not good at generating transferable adversarial examples (Dong et al., 2018). We denote the attacks combined with our attention-invariant method as A-FGSM, A-MI-FGSM and A-DIM respectively.
|
| 144 |
+
|
| 145 |
+
For the settings of hyper-parameters, we set the maximum perturbation to be $\epsilon = 1 6$ among all experiments with pixel value in $[ 0 , 2 5 5 ]$ . For the iterative attack methods, we set the number of iteration as 10 and the step size as $\alpha = 1 . 6$ . For MI-FGSM and A-MI-FGSM, we adopt the default dacay factor $\mu = 1 . 0$ . For DIM and A-DIM, the transformation probability is set to 0.7. Please note that the settings for each attack method and its attention-invariant version are the same, because our method is not concerned with the specific attack precedure.
|
| 146 |
+
|
| 147 |
+
# 4.2 SINGLE-MODEL ATTACKS
|
| 148 |
+
|
| 149 |
+
We first perform adversarial attacks for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using FGSM, MI-FGSM, DIM and their extensions by combining with the proposed attention-invariant attack method as A-FGSM, A-MI-FGSM and A-DIM. We then use the generated adversarial examples to attack the eight defense models we consider based only on the transferability. We report the success rates of black-box attacks in Table 1, Table 2 and Table 3, where the success rates are the misclassification rates of the corresponding defense models with adversarial images as inputs. In the attention-invariant based attacks, we set the size of the kernel matrix $W$ as $1 5 \times 1 5$ across all experiments, and we will study the effect of kernel size in Section 4.4.
|
| 150 |
+
|
| 151 |
+
From the tables, we observe that the success rates against the defenses are improved by a large margin when using the proposed method regardless of the attack algorithms or the white-box models being attacked. In general, the attention-invariant based attacks consistently outperform the baseline attacks by $5 \% \sim 3 0 \%$ . In particular, when using A-DIM, the combination of our method and DIM, to attack the IncRes-v2 model, the resultant adversarial examples have about $6 0 \%$ success rates against the defenses (as shown in Table 3). It demonstrates the vulnerability of the current defenses against black-box attacks. The results also validate the effectiveness of the proposed method. Although we only compare the results of our attack method with baseline methods against the defense models, our attacks remain the success rates of baseline attacks in the white-box setting and the black-box setting against normally trained models, which will be shown in the Appendix.
|
| 152 |
+
|
| 153 |
+
Table 2: The success rates $( \% )$ of black-box attacks against eight defenses. The adversarial examples are crafted for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using MI-FGSM and A-MIFGSM.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td>Attack</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td><td>HGD</td><td>R&P</td><td>JPEG</td><td>TVM</td><td>NIPS-r3</td></tr><tr><td rowspan="2">Inc-v3</td><td>MI-FGSM</td><td>20.5</td><td>17.4</td><td>9.5</td><td>6.9</td><td>8.7</td><td>20.3</td><td>19.4</td><td>12.9</td></tr><tr><td>A-MI-FGSM</td><td>35.8</td><td>35.1</td><td>25.8</td><td>25.7</td><td>23.9</td><td>28.2</td><td>34.9</td><td>26.7</td></tr><tr><td rowspan="2">Inc-v4</td><td>MI-FGSM</td><td>22.1</td><td>20.1</td><td>12.1</td><td>9.6</td><td>12.1</td><td>26.0</td><td>24.8</td><td>15.6</td></tr><tr><td>A-MI-FGSM</td><td>36.7</td><td>39.2</td><td>28.7</td><td>27.8</td><td>28.0</td><td>31.6</td><td>38.4</td><td>29.5</td></tr><tr><td rowspan="2">IncRes-v2</td><td>MI-FGSM</td><td>31.3</td><td>27.2</td><td>19.7</td><td>19.6</td><td>18.6</td><td>31.6</td><td>34.4</td><td>22.7</td></tr><tr><td>A-MI-FGSM</td><td>50.7</td><td>51.7</td><td>49.3</td><td>45.1</td><td>45.2</td><td>45.9</td><td>55.4</td><td>46.2</td></tr><tr><td rowspan="2">Res-v2-152</td><td>MI-FGSM</td><td>25.1</td><td>23.7</td><td>13.3</td><td>15.1</td><td>14.6</td><td>31.2</td><td>24.5</td><td>18.0</td></tr><tr><td>A-MI-FGSM</td><td>39.9</td><td>37.7</td><td>32.8</td><td>31.8</td><td>31.1</td><td>38.3</td><td>41.2</td><td>34.4</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 3: The success rates $( \% )$ of black-box attacks against eight defenses. The adversarial examples are crafted for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using DIM and A-DIM.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Attack</td><td rowspan=1 colspan=1>Inc-v3ens3</td><td rowspan=1 colspan=1>Inc-v3ens4</td><td rowspan=1 colspan=1>IncRes-v2ens</td><td rowspan=1 colspan=1>HGD</td><td rowspan=1 colspan=1>R&P</td><td rowspan=1 colspan=1>JPEG</td><td rowspan=1 colspan=1>TVM</td><td rowspan=1 colspan=1>NIPS-r3</td></tr><tr><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>24.246.9</td><td rowspan=1 colspan=1>24.347.1</td><td rowspan=1 colspan=1>13.037.4</td><td rowspan=1 colspan=1>9.738.3</td><td rowspan=1 colspan=1>13.336.8</td><td rowspan=1 colspan=1>30.737.0</td><td rowspan=1 colspan=1>24.444.2</td><td rowspan=1 colspan=1>18.041.4</td></tr><tr><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>28.348.6</td><td rowspan=1 colspan=1>27.547.5</td><td rowspan=1 colspan=1>15.638.7</td><td rowspan=1 colspan=1>14.640.3</td><td rowspan=1 colspan=1>17.239.3</td><td rowspan=1 colspan=1>38.643.5</td><td rowspan=1 colspan=1>29.145.6</td><td rowspan=1 colspan=1>14.141.9</td></tr><tr><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>41.261.3</td><td rowspan=1 colspan=1>40.060.1</td><td rowspan=1 colspan=1>27.959.5</td><td rowspan=1 colspan=1>32.458.7</td><td rowspan=1 colspan=1>30.261.4</td><td rowspan=1 colspan=1>47.255.7</td><td rowspan=1 colspan=1>41.766.2</td><td rowspan=1 colspan=1>37.661.5</td></tr><tr><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>40.556.1</td><td rowspan=1 colspan=1>36.055.5</td><td rowspan=1 colspan=1>24.149.5</td><td rowspan=1 colspan=1>32.651.8</td><td rowspan=1 colspan=1>26.450.4</td><td rowspan=1 colspan=1>42.450.8</td><td rowspan=1 colspan=1>36.855.7</td><td rowspan=1 colspan=1>34.452.9</td></tr></table>
|
| 160 |
+
|
| 161 |
+
We show several adversarial images generated for the Inc-v3 model by FGSM and A-FGSM in Fig. 2. It can be seen that by using A-FGSM, in which the gradients are convolved by a kernel $W$ before applying to the raw images, the adversarial perturbations are much smoother than those generated by FGSM. The smooth effect also exists in other attention-invariant based attacks.
|
| 162 |
+
|
| 163 |
+
# 4.3 ENSEMBLE-BASED ATTACKS
|
| 164 |
+
|
| 165 |
+
In this section, we further present the results when adversarial examples are generated for an ensemble of models. Liu et al. (2017) have shown that attacking multiple models at the same time can improve the transferability of the generated adversarial examples. It is due to that if an example remains adversarial for multiple models, it is more likely to transfer to another black-box model.
|
| 166 |
+
|
| 167 |
+
We adopt the ensemble method proposed by Dong et al. (2018), which fuses the logit activations of different models. We attack the ensemble of Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 with equal ensemble weights using FGSM, A-FGSM, MI-FGSM, A-FGSM, DIM and A-DIM respectively. We also set the kernel size in the attention-invariant based attacks as $1 5 \times 1 5$ .
|
| 168 |
+
|
| 169 |
+
In Table 4, we show the results of black-box attacks against the eight defenses. The proposed method also improves the success rates across all experiments over the baseline attacks. It should by noted that the adversarial examples generated by A-DIM can fool the state-of-the-art defenses at an $8 2 \%$ success rate on average based on the transferability. And the adversarial examples are generated for normally trained models unaware of the defense strategies. The results in the paper demonstrate that the current defenses are far from real security, and cannot be deployed in real-world applications.
|
| 170 |
+
|
| 171 |
+
# 4.4 THE EFFECT OF KERNEL SIZE
|
| 172 |
+
|
| 173 |
+
The size of the kernel $W$ plays a key role for improving the success rates of black-box attacks. If the kernel size equals to $1 \times 1$ , the attention-invariant based attacks degenerate to their vanilla versions. Therefore, we conduct an ablation study to examine the effect of different kernel sizes.
|
| 174 |
+
|
| 175 |
+
We attack the Inc-v3 model by A-FGSM, A-MI-FGSM and A-DIM with the kernel length ranging from 1 to 21 with a granularity 2. In Fig. 3, we show the success rates against five defense models—
|
| 176 |
+
|
| 177 |
+
Table 4: The success rates $( \% )$ of black-box attacks against eight defenses. The adversarial examples are crafted for the ensemble of Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 using FGSM, A-FGSM, MI-FGSM, A-MI-FGSM, DIM and A-DIM.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Attack</td><td>Inc-v3ens3</td><td>Inc-v3ens4</td><td>IncRes-v2ens</td><td>HGD</td><td>R&P</td><td>JPEG</td><td>TVM</td><td>NIPS-r3</td></tr><tr><td>FGSM</td><td>27.5</td><td>23.7</td><td>13.4</td><td>4.9</td><td>13.8</td><td>38.1</td><td>30.0</td><td>19.8</td></tr><tr><td>A-FGSM</td><td>39.1</td><td>38.8</td><td>31.6</td><td>29.9</td><td>31.2</td><td>43.3</td><td>39.8</td><td>33.9</td></tr><tr><td>MI-FGSM</td><td>50.5</td><td>48.3</td><td>32.8</td><td>38.6</td><td>32.8</td><td>67.7</td><td>50.1</td><td>43.9</td></tr><tr><td>A-MI-FGSM</td><td>76.4</td><td>74.4</td><td>69.6</td><td>73.3</td><td>68.3</td><td>77.2</td><td>72.1</td><td>71.4</td></tr><tr><td>DIM</td><td>66.0</td><td>63.3</td><td>45.9</td><td>57.7</td><td>51.7</td><td>82.5</td><td>64.1</td><td>63.7</td></tr><tr><td>A-DIM</td><td>84.8</td><td>82.7</td><td>78.0</td><td>82.6</td><td>81.4</td><td>83.4</td><td>79.8</td><td>83.1</td></tr></table>
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 3: The success rates $( \% )$ of the adversarial examples generated for Inc-v3 agasinst IncRes$\mathrm { v } 2 _ { \mathrm { e n s } }$ , HGD, R&P, TVM and NIPS-r3, with the kernel length ranging from 1 to 21.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: The adversarial examples generated for Inc-v3 by A-FGSM with different kernel sizes.
|
| 186 |
+
|
| 187 |
+
IncRes- $\mathbf { \nabla } \cdot \mathbf { v } 2 _ { \mathrm { e n s } }$ , HGD, R&P, TVM and NIPS-r3. The success rate continues increasing at first, and turns to remain stable after the kernel size exceeds $1 5 \times 1 5$ .
|
| 188 |
+
|
| 189 |
+
We also show the adversarial images generated for the Inc-v3 model by A-FGSM with different kernel sizes in Fig. 4. Due to the smooth effect given by the kernel, we can see that the adversarial perturbations are smoother when using a bigger kernel.
|
| 190 |
+
|
| 191 |
+
# 5 CONCLUSION
|
| 192 |
+
|
| 193 |
+
In this paper, we propose an attention-invariant attack method to mitigate the attention shift phenomenon and generate more transferable adversarial examples against the defense models. Our method optimizes an adversarial image by using a set of shifted images. Based on an assumption, our method is simply implemented by convolving the gradient with a pre-defined kernel, and can be integrated into any gradient-based attack methods. We conduct experiments to validate the effectiveness of the proposed method. Our best attack A-DIM, the combination of the proposed attentioninvariant method and diverse input iterative method (Xie et al., 2018b), can fool eight state-of-the-art defenses at an $8 2 \%$ success rate on average, where the adversarial examples are generated against four normally trained models. The results identify the vulnerability of the current defenses, which raises security issues for the development of more robust deep learning models.
|
| 194 |
+
|
| 195 |
+
# REFERENCES
|
| 196 |
+
|
| 197 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, 2018a.
|
| 198 |
+
|
| 199 |
+
Anish Athalye, Logan Engstrom, Andrew Ilyas, and Kevin Kwok. Synthesizing robust adversarial examples. In ICML, 2018b.
|
| 200 |
+
|
| 201 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Pavel Laskov, Giorgio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In Th European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 387–402, 2013.
|
| 202 |
+
|
| 203 |
+
Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, 2017.
|
| 204 |
+
|
| 205 |
+
Yinpeng Dong, Fangzhou Liao, Tianyu Pang, Hang Su, Jun Zhu, Xiaolin Hu, and Jianguo Li. Boosting adversarial attacks with momentum. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 206 |
+
|
| 207 |
+
Kevin Eykholt, Ivan Evtimov, Earlence Fernandes, Bo Li, Amir Rahmati, Chaowei Xiao, Atul Prakash, Tadayoshi Kohno, and Dawn Song. Robust physical-world attacks on deep learning visual classification. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 208 |
+
|
| 209 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 210 |
+
|
| 211 |
+
Alex Graves, Abdel Rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In IEEE International Conference on Acoustics, Speech and Signal Processing, pp. 6645–6649, 2013.
|
| 212 |
+
|
| 213 |
+
Chuan Guo, Mayank Rana, Moustapha Cisse, and Laurens Van Der Maaten. Countering adversarial images using input transformations. In ICLR, 2018.
|
| 214 |
+
|
| 215 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016a.
|
| 216 |
+
|
| 217 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016b.
|
| 218 |
+
|
| 219 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 220 |
+
|
| 221 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. In ICLR, 2017.
|
| 222 |
+
|
| 223 |
+
Yann LeCun and Yoshua Bengio. Convolutional networks for images, speech, and time series. Handbook of Brain Theory and Neural Networks, 1995.
|
| 224 |
+
|
| 225 |
+
Fangzhou Liao, Ming Liang, Yinpeng Dong, Tianyu Pang, Xiaolin Hu, and Jun Zhu. Defense against adversarial attacks using high-level representation guided denoiser. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2018.
|
| 226 |
+
|
| 227 |
+
Yanpei Liu, Xinyun Chen, Chang Liu, and Dawn Song. Delving into transferable adversarial examples and black-box attacks. In ICLR, 2017.
|
| 228 |
+
|
| 229 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 230 |
+
|
| 231 |
+
Jan Hendrik Metzen, Tim Genewein, Volker Fischer, and Bastian Bischoff. On detecting adversarial perturbations. In ICLR, 2017.
|
| 232 |
+
|
| 233 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, 2017.
|
| 234 |
+
|
| 235 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. In ICLR, 2018.
|
| 236 |
+
|
| 237 |
+
Pouya Samangouei, Maya Kabkab, and Rama Chellappa. Defense-gan: Protecting classifiers against adversarial attacks using generative models. In ICLR, 2018.
|
| 238 |
+
|
| 239 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In ICLR, 2015.
|
| 240 |
+
|
| 241 |
+
Yang Song, Taesup Kim, Sebastian Nowozin, Stefano Ermon, and Nate Kushman. Pixeldefend: Leveraging generative models to understand and defend against adversarial examples. In ICLR, 2018.
|
| 242 |
+
|
| 243 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NIPS, pp. 3104–3112, 2014.
|
| 244 |
+
|
| 245 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 246 |
+
|
| 247 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
|
| 248 |
+
|
| 249 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, 2017.
|
| 250 |
+
|
| 251 |
+
Florian Tramer, Alexey Kurakin, Nicolas Papernot, Dan Boneh, and Patrick McDaniel. Ensemble \` adversarial training: Attacks and defenses. In ICLR, 2018.
|
| 252 |
+
|
| 253 |
+
Eric Wong and J. Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In ICML, 2018.
|
| 254 |
+
|
| 255 |
+
Cihang Xie, Jianyu Wang, Zhishuai Zhang, Zhou Ren, and Alan Yuille. Mitigating adversarial effects through randomization. In ICLR, 2018a.
|
| 256 |
+
|
| 257 |
+
Cihang Xie, Zhishuai Zhang, Jianyu Wang, Yuyin Zhou, Zhou Ren, and Alan Yuille. Improving transferability of adversarial examples with input diversity. 2018b.
|
| 258 |
+
|
| 259 |
+
Bolei Zhou, Aditya Khosla, Agata Lapedriza, Aude Oliva, and Antonio Torralba. Learning deep features for discriminative localization. In CVPR, 2016.
|
| 260 |
+
|
| 261 |
+
# APPENDIX
|
| 262 |
+
|
| 263 |
+
We further show the results of the proposed attention-invariant attack method for white-box attacks and black-box attacks against normally trained models. We adopt the same settings for attacks. We also generate adversarial examples for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using FGSM, A-FGSM, MI-FGSM, A-MI-FGSM, DIM and A-DIM. For the attention-invariant based attacks, we set the kernel size as $7 \times 7$ since that the normally trained models have similar attentions. We then use these adversarial examples to attack six normally trained models—Inc-v3, Inc-v4, IncRes-v2, Res-v2-152, VGG-16 and Res-v1-152. The results are shown in Table 5, Table 6 and Table 7. The attention-invariant based attacks get better results in most cases than the baseline attacks.
|
| 264 |
+
|
| 265 |
+
Table 5: The success rates $( \% )$ of adversarial attacks against six normally trained models—Inc-v3, Inc-v4, IncRes-v2, Res-v2-152, VGG-16 and Res-v1-152. The adversarial examples are crafted for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using FGSM and A-FGSM. \* indicates the white-box attacks.
|
| 266 |
+
|
| 267 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Attack</td><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>VGG-16</td><td rowspan=1 colspan=1>Res-v1-152</td></tr><tr><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>FGSMA-FGSM</td><td rowspan=1 colspan=1>79.6*75.4*</td><td rowspan=1 colspan=1>35.937.3</td><td rowspan=1 colspan=1>30.632.1</td><td rowspan=1 colspan=1>30.234.1</td><td rowspan=1 colspan=1>49.762.0</td><td rowspan=1 colspan=1>36.344.9</td></tr><tr><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>FGSMA-FGSM</td><td rowspan=1 colspan=1>43.145.3</td><td rowspan=1 colspan=1>72.6*68.1*</td><td rowspan=1 colspan=1>32.533.7</td><td rowspan=1 colspan=1>34.335.4</td><td rowspan=1 colspan=1>50.763.3</td><td rowspan=1 colspan=1>37.746.2</td></tr><tr><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>FGSMA-FGSM</td><td rowspan=1 colspan=1>44.349.7</td><td rowspan=1 colspan=1>36.141.5</td><td rowspan=1 colspan=1>64.3*63.7*</td><td rowspan=1 colspan=1>31.940.1</td><td rowspan=1 colspan=1>49.464.2</td><td rowspan=1 colspan=1>38.646.7</td></tr><tr><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>FGSMA-FGSM</td><td rowspan=1 colspan=1>40.146.4</td><td rowspan=1 colspan=1>34.039.3</td><td rowspan=1 colspan=1>30.333.4</td><td rowspan=1 colspan=1>81.3*78.9*</td><td rowspan=1 colspan=1>50.564.7</td><td rowspan=1 colspan=1>40.850.4</td></tr></table>
|
| 268 |
+
|
| 269 |
+
Table 6: The success rates $( \% )$ of adversarial attacks against six normally trained models—Inc-v3, Inc-v4, IncRes-v2, Res-v2-152, VGG-16 and Res-v1-152. The adversarial examples are crafted for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using MI-FGSM and A-MI-FGSM. \* indicates the white-box attacks.
|
| 270 |
+
|
| 271 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Attack</td><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>VGG-16</td><td rowspan=1 colspan=1>Res-v1-152</td></tr><tr><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>MI-FGSMA-MI-FGSM</td><td rowspan=1 colspan=1>97.8*97.9*</td><td rowspan=1 colspan=1>47.152.4</td><td rowspan=1 colspan=1>46.447.9</td><td rowspan=1 colspan=1>38.741.1</td><td rowspan=1 colspan=1>50.363.4</td><td rowspan=1 colspan=1>38.148.1</td></tr><tr><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>MI-FGSMA-MI-FGSM</td><td rowspan=1 colspan=1>67.168.6</td><td rowspan=1 colspan=1>98.8*98.8*</td><td rowspan=1 colspan=1>54.355.3</td><td rowspan=1 colspan=1>47.047.7</td><td rowspan=1 colspan=1>58.569.0</td><td rowspan=1 colspan=1>43.251.3</td></tr><tr><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>MI-FGSMA-MI-FGSM</td><td rowspan=1 colspan=1>74.876.1</td><td rowspan=1 colspan=1>64.869.5</td><td rowspan=1 colspan=1>100.0*100.0*</td><td rowspan=1 colspan=1>54.559.6</td><td rowspan=1 colspan=1>59.374.4</td><td rowspan=1 colspan=1>50.861.5</td></tr><tr><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>MI-FGSMA-MI-FGSM</td><td rowspan=1 colspan=1>54.255.6</td><td rowspan=1 colspan=1>48.150.9</td><td rowspan=1 colspan=1>44.345.1</td><td rowspan=1 colspan=1>97.5*97.4*</td><td rowspan=1 colspan=1>52.665.6</td><td rowspan=1 colspan=1>48.759.6</td></tr></table>
|
| 272 |
+
|
| 273 |
+
Table 7: The success rates $( \% )$ of adversarial attacks against six normally trained models—Inc-v3, Inc-v4, IncRes-v2, Res-v2-152, VGG-16 and Res-v1-152. The adversarial examples are crafted for Inc-v3, Inc-v4, IncRes-v2 and Res-v2-152 respectively using DIM and A-DIM. \* indicates the white-box attacks.
|
| 274 |
+
|
| 275 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Attack</td><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>VGG-16</td><td rowspan=1 colspan=1>Res-v1-152</td></tr><tr><td rowspan=1 colspan=1>Inc-v3</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>98.3*98.5*</td><td rowspan=1 colspan=1>73.875.2</td><td rowspan=1 colspan=1>67.869.2</td><td rowspan=1 colspan=1>58.459.0</td><td rowspan=1 colspan=1>62.574.3</td><td rowspan=1 colspan=1>49.359.1</td></tr><tr><td rowspan=1 colspan=1>Inc-v4</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>81.880.7</td><td rowspan=1 colspan=1>98.2*98.7*</td><td rowspan=1 colspan=1>74.273.2</td><td rowspan=1 colspan=1>65.162.7</td><td rowspan=1 colspan=1>65.577.4</td><td rowspan=1 colspan=1>51.459.8</td></tr><tr><td rowspan=1 colspan=1>IncRes-v2</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>86.186.4</td><td rowspan=1 colspan=1>83.585.5</td><td rowspan=1 colspan=1>99.1*98.8*</td><td rowspan=1 colspan=1>73.576.3</td><td rowspan=1 colspan=1>67.979.3</td><td rowspan=1 colspan=1>62.772.2</td></tr><tr><td rowspan=1 colspan=1>Res-v2-152</td><td rowspan=1 colspan=1>DIMA-DIM</td><td rowspan=1 colspan=1>77.077.0</td><td rowspan=1 colspan=1>77.873.9</td><td rowspan=1 colspan=1>73.573.2</td><td rowspan=1 colspan=1>97.4*97.2*</td><td rowspan=1 colspan=1>67.478.4</td><td rowspan=1 colspan=1>67.877.8</td></tr></table>
|
md/train/BkgYPREtPr/BkgYPREtPr.md
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Symplectic Recurrent Neural Networks
|
| 2 |
+
|
| 3 |
+
Zhengdao Chen $^ { a , c }$ , Jianyu Zhang $^ { ^ { b , c } }$ , Martin Arjovsky $^ a$ , Léon Bottou $c , a$
|
| 4 |
+
|
| 5 |
+
$^ { a }$ New York University, New York, USA $^ { b }$ Tianjin University, Tianjin, China $_ c$ Facebook AI Research, New York, USA
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We propose Symplectic Recurrent Neural Networks (SRNNs) as learning algorithms that capture the dynamics of physical systems from observed trajectories. An SRNN models the Hamiltonian function of the system by a neural network and furthermore leverages symplectic integration, multiplestep training and initial state optimization to address the challenging numerical issues associated with Hamiltonian systems. We show SRNNs succeed reliably on complex and noisy Hamiltonian systems. We also show how to augment the SRNN integration scheme in order to handle stiff dynamical systems such as bouncing billiards.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Can machines learn physical laws from data? A recent paper (Greydanus et al., 2019), Hamiltonian Neural Networks (HNN), proposes to do so representing the Hamiltonian function $H ( q , p )$ as a multilayer neural network. The partial derivatives of this network are then trained to match the time derivatives $\dot { p }$ and $\dot { q }$ observed along the trajectories in state space.
|
| 14 |
+
|
| 15 |
+
The ordinary differential equations (ODEs) that express Hamiltonian dynamics are famous for both their mathematical elegance and their challenges to numerical integration techniques. Except maybe for the simplest Hamiltonian systems, discretization errors and measurement noise lead to quickly diverging trajectories. In other words, Hamiltonian systems can often be stiff, a concept that usually refers to differential equations where we have to take very small time-steps of integration so that the numerical solution remain stable (Lambert, 1991). A plethora of numerical integration methods, symplectic integrators, have been developed to respect the conserved quantities in Hamiltonian systems, thereby usually being more stable and structure-preserving than non-symplectic ones (Hairer et al., 2002). For example, the simplest symplectic integrator is the well-known leapfrog method, also known as the Stömer-Verlet integrator (Leimkuhler and Reich, 2005). However, even the best integrators remain severely challenged by phenomena as intuitive as a mechanical rebound or a slingshot effect, which are more severe forms of stiffness. Such numerical issues are almost doomed to conflict with the inherently approximate nature of a learning algorithm.
|
| 16 |
+
|
| 17 |
+
In the first part of this paper, we propose Symplectic Recurrent Neural Networks (SRNNs), where $( i )$ the partial derivatives of the neural-network-parametrized Hamiltonian are integrated with the leapfrog integrator and where $( i i )$ the loss is back-propagated through the ODE integration over multiple time steps. We find that in the presence of observation noise, SRNN are far more usable than HNNs. Further improvements are achieved by simultaneously optimizing the initial state and the Hamiltionian network, presenting an interesting contrast to previous literature on the hardness of general initial state optimization (Peifer and Timmer, 2007). The optimization can be motivated from a maximum likelihood estimation perspective, and we provide heuristic arguments for why the initial state optimization is likely convex given the symplecticness of the system. Furthermore, experiments in the three-body problem show that the SRNN-trained Hamiltonian compensates for discretization errors and can even outperform numerically solving the ODE using the true Hamiltonian and the same time-step size. This could be of particular interest to researchers who study the application of machine learning to numerically solving differential equations.
|
| 18 |
+
|
| 19 |
+
The second part of this paper focuses on perfect rebound as an example of the more severe form of stiffness. When a point mass rebounds without loss of energy on a perfectly rigid obstacle, the motion of the point mass is changed in ways that can be interpreted as an infinite force applied during an infinitesimal time. The precise timing of this event affects the trajectory of the point mass in ways that essentially make it impossible to merely simulate the Hamiltonian system on a predefined grid of time points. In order to address such events in learning, we augment the leapfrog integrator used in our SRNN with an additional trainable operator that models the rebound events and relates their occurrence to visual hints. Training such an augmented SRNN on observed trajectories not only learns the point mass dynamics but also learns the visual appearance of the obstacles.
|
| 20 |
+
|
| 21 |
+
# 2 Related work
|
| 22 |
+
|
| 23 |
+
Learning physics with neural networks A popular category of methods attempts to replicate the intuitive ways in which humans perceive simple physical interactions, identifying objects and learning how they relate to each other (Battaglia et al., 2016; Chang et al., 2016). Since such methods cannot be used for more general physical systems, another category of methods seeks to learn which differential equations govern the evolution of a physical system on the basis of observed trajectories. Brunton et al. (2016) assemble a small number of predefined primitives in order to find an algebraically simple solution. Lutter et al. (2019) use a neural network to model the Lagrangian function of a robotic system. Most closely related to ours, Greydanus et al. (2019) use a neural network to learn the Hamiltonian of the dynamical system in such a way that its partial derivatives match the time derivatives of the position and momentum variables, which are both assumed to be observed. Although the authors show success on a simple pendulum system, this approach does not perform well on a more complex system such as a three-body problem.
|
| 24 |
+
|
| 25 |
+
ODE-based learning and recurrent neural networks (RNNs) To learn an ODE that underlies some observed time series data, Chen et al. (2018a) proposes to solve a neuralnetwork-parameterized ODE numerically and minimize the distance between the generated time series with the observed data. To save memory, they propose to use the adjoint ODE instead of back-propagating through the ODE solver. Using stability analysis of ODEs, Chang et al. (2019) propose the AntisymmetricRNN with better trainability. Niu et al. (2019) establish a correspondence between RNNs and ODEs, and propose an RNN architecture inspired by a universal quantum computation scheme.
|
| 26 |
+
|
| 27 |
+
Summary of our main contributions: In this paper, we propose SRNN, which • learns Hamiltonian dynamics directly from position and momentum time series • performs well on noisy and complex systems such as a spring-chain system and a three-body system, and is compatible with initial state optimzation • is augmented to handle perfect rebound, an example of very stiff Hamiltonian dynamics
|
| 28 |
+
|
| 29 |
+
# 3 Framework
|
| 30 |
+
|
| 31 |
+
# 3.1 Hamiltonian systems
|
| 32 |
+
|
| 33 |
+
A Hamiltonian system of dimension $d$ is described by two vectors $p , q \in \mathbb { R } ^ { d }$ . Typically, they correspond to the momentum and position variables, respectively. The evolution of the system is determined by the Hamiltonian function $H : ( p , q , t ) \in \mathbb { R } ^ { 2 d + 1 } \mapsto H ( p , q , t ) \in \mathbb { R }$ through a system of ordinary differential equations called Hamilton’s equations,
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\dot { p } = - \frac { \partial H } { \partial q } \ , \qquad \dot { q } = + \frac { \partial H } { \partial p } \ ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where we use the dot notation to compactly represent derivatives with respect to the time variable $t$ . We are focusing in this work on Hamiltonians that are conservative,1 that is, they do not depend on the time variable $t$ , and separable,2 that is, they can be written as a
|
| 40 |
+
|
| 41 |
+
sum $H ( p , q ) = K ( p ) + V ( q )$ . In this case, (1) becomes
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\dot { p } = - V ^ { \prime } ( q ) , \dot { q } = K ^ { \prime } ( p )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
With a proper choice of the $p$ and $q$ variables, the evolution of essentially all physical systems can be described with the Hamiltonian framework. In other words, Hamilton’s equations restrict the vast space of dynamical systems to the considerably smaller space of dynamical systems that are physically plausible.
|
| 48 |
+
|
| 49 |
+
Therefore, instead of modeling the dynamics of a physical system with a neural network $f _ { \boldsymbol { \theta } } ( \boldsymbol { p } , \boldsymbol { q } )$ whose outputs are interpreted as estimates of the time derivatives $\dot { p }$ and $\dot { q }$ , we can also use a neural network $H _ { \boldsymbol \theta } ( p , q ) = K _ { \boldsymbol \theta _ { 1 } } ( p ) + V _ { \boldsymbol \theta _ { 2 } } ( q )$ with $\theta = \lfloor \theta _ { 1 } , \theta _ { 2 } \rfloor$ , whose partial derivatives $- V _ { \theta _ { 2 } } ^ { \prime } ( q )$ and $K _ { \theta _ { 1 } } ^ { \prime } ( p )$ are interpreted as the time derivatives $\dot { p }$ and $\dot { q }$ . We refer to the former as ODE neural networks (O-NET) and the latter approach as Hamiltonian neural networks (H-NET). In order to define a complete learning system, we need to explain how to determine the parameter $\theta$ of the neural networks on the basis of observed discrete trajectories. For instance, Greydanus et al. (2019) trains H-NET in a fully supervised manner using the observed tuples $( p , q , \dot { p } , \dot { q } )$ .
|
| 50 |
+
|
| 51 |
+
# 3.2 From ODEs to discrete trajectories
|
| 52 |
+
|
| 53 |
+
A numerical integrator (or ODE solver) approximates the true solution of an ODE of the form $\dot { z } = f ( z , t )$ at discrete time steps $t _ { 0 } , t _ { 1 } . . . t _ { T }$ . For instance, the simplest integrator, Euler’s integrator, starts from the initial state $z _ { \mathrm { 0 } }$ at time $t _ { 0 }$ and estimates the function $z ( t )$ at uniformly spaced time points $t _ { n } = t _ { 0 } + n \Delta t$ with the recursive expression
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
z _ { n + 1 } = z _ { n } + \Delta t f ( z _ { n } , t _ { n } )
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
In stiff ODE systems, however, using Euler’s method could easily lead to unstable solutions unless the time-step is chosen to be very small (Lambert, 1991). The development of efficient and accurate numerical integrators is the object of considerable research (Hairer et al., 2008; Hairer and Wanner, 2013). Symplectic integrators3 are particularly attractive for the integration of Hamilton’s equations (Leimkuhler and Reich, 2005). They are able to preserve quadratic invariants, and therefore usually have desired stability properties as well as being structure-preserving (McLachlan et al., 2004), even for certain non-Hamiltonian systems (Chen et al., 2018b). A simple and widely-used symplectic integrator is the leapfrog integrator. When the Hamiltonian is conservative and separable (2), it computes successive estimates $( p _ { n } , q _ { n } )$ with
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r l } & { p _ { n + 1 / 2 } = p _ { n } - \frac { 1 } { 2 } \Delta t V ^ { \prime } ( q _ { n } ) } \\ & { ~ q _ { n + 1 } = q _ { n } + \Delta t K ^ { \prime } ( p _ { n + 1 / 2 } ) } \\ & { ~ p _ { n + 1 } = p _ { n + 1 / 2 } - \frac { 1 } { 2 } \Delta t V ^ { \prime } ( q _ { n + 1 } ) } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Repeatedly executing update equations (4) is called the leapfrog algorithm, which is as computationally efficient as Euler’s method yet considerably more accurate when the ODE belongs to a Hamiltonian system (Leimkuhler and Reich, 2005).
|
| 66 |
+
|
| 67 |
+
# 3.3 Learning ODEs from discrete trajectories
|
| 68 |
+
|
| 69 |
+
Following Chen et al. (2018a), let the right hand side of the ODE be a parametric function $f _ { \theta } ( z , t )$ and let $z _ { 0 } \dots z _ { T }$ be an observed trajectory measured at uniformly spaced time points $t _ { 0 } \ldots t _ { T }$ . We can estimate the parameter $\theta$ that best represents the dynamics of the observed trajectory by minimizing the mean squared error $\begin{array} { r } { \sum _ { i = 1 } ^ { T ^ { \prime } } \| z _ { i } - \hat { z } _ { i } ( \theta ) \| _ { 2 } } \end{array}$ between the observed trajectory $\{ z _ { i } \} _ { i = 0 } ^ { I }$ and the trajectory $\{ \hat { z } _ { i } ( \theta ) \} _ { i = 0 } ^ { T }$ generated with our integrator of choice,
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\{ \hat { z } _ { i } ( \theta ) \} _ { i = 0 } ^ { T } = I n t e g r a t o r ( z _ { 0 } , f _ { \theta } , \{ t _ { i } \} _ { i = 0 } ^ { T } ) ~ .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
For instance, this minimization can be achieved using stochastic gradient descent after back-propagating through the steps of our numerical integration algorithm of choice and then through each call to the functions $f _ { \theta }$ . This can be done when $f _ { \theta } ( z )$ is a neural network (O-NET), or is the concatenation $[ - V _ { \theta _ { 2 } } ^ { \prime } ( q ) , K _ { \theta _ { 1 } } ^ { \prime } ( p ) ]$ of the partial derivatives of an H-NET
|
| 76 |
+
|
| 77 |
+
$H _ { \boldsymbol \theta } ( p , q ) = K _ { \boldsymbol \theta _ { 1 } } ( p ) + V _ { \boldsymbol \theta _ { 2 } } ( q )$ , where the partial derivatives can be expressed using the same parameters $\theta$ as the Hamiltonian $H _ { \theta } ( p , q )$ , for instance using automatic differentiation. We can then predict trajectories at testing time using the trained $f _ { \theta ^ { \ast } }$ and initial state $z _ { 0 } ^ { \mathrm { t e s t } }$ ,
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\left\{ \hat { z } _ { i } ^ { \mathrm { t e s t } } \right\} _ { i = 0 } ^ { T ^ { \mathrm { t e s t } } } = I n t e g r a t o r ( z _ { 0 } ^ { \mathrm { t e s t } } , f _ { \theta ^ { * } } , \left\{ t _ { i } \right\} _ { i = 0 } ^ { T ^ { \mathrm { t e s t } } } ) \ .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Note that neither the integrator, nor the number of steps, nor the step size, need to be the same at training and testing.
|
| 84 |
+
|
| 85 |
+
# 3.4 Symplectic Recurrent Neural Network
|
| 86 |
+
|
| 87 |
+
This framework provides a number of nearly orthogonal design options for the construction of algorithms that model dynamical systems using trajectories:
|
| 88 |
+
|
| 89 |
+
• The time derivative model could be an O-NET or H-NET. The training integrator can be any explicit integrators. In our experiments, we only focus on Euler’s integrator and the leapfrog integrator. The training trajectories can consist of a single step, $T { = } 1$ , or multiple steps, $T > 1$ . We refer to the first case as single-step and the second case as multi-step or recurrent training, because back-propagating through multiple steps of the training integrator is comparable to back-propagating through time in recurrent networks.
|
| 90 |
+
• The testing integrator can also be chosen freely and can use a different time-step size as it does not involve back-propagation.
|
| 91 |
+
|
| 92 |
+
In order to save space while describing the possibly different integrators used for training and testing, we use the labels “E-E”, “E-L”, and “L-L”, where the first letter tells which integrator was used for training —“E” for Euler and “L” for leapfrog— and the second letter indicates which integrator was used as testing time. For instance, with our terminology, the HNN model of Greydanus et al. (2019) is a “single-step E-E H-NET” with the additional subtlety that they supervise the training with actual derivatives instead of relying on finite differences between successive steps of the observed trajectories.
|
| 93 |
+
|
| 94 |
+
A Symplectic Recurrent Neural Network (SRNN) is a recurrent H-NET that relies on a symplectic integrator for both training and testing, such as, for instance, a "recurrent L-L H-NET". As shown in the rest of this paper, SRNNs are far more usable and robust than the alternatives, especially when the Hamiltonian gets complex and the data gets noisy. We believe that SRNNs may also have other potential benefits: because leapfrog preserves volumes in the state space (Hairer et al., 2002), we conjecture that vanishing and exploding gradients’ issues in backpropagating through entire state sequences are ameliorated (Arjovsky et al., 2015). Finally, because the leapfrog integrator is reversible in time, there is no need to store states during the forward pass as they can be recomputed exactly during the backward pass. We leave studying these other computational and optimization benefits as a topic of future work.
|
| 95 |
+
|
| 96 |
+
# 4 SRNN can learn complex and noisy Hamiltonian dynamics
|
| 97 |
+
|
| 98 |
+
As an example of a complex Hamiltonian system, we first present experiments performed on the spring-chain system: a chain of 20 masses with neighbors connected via springs. Each of the two masses on the ends are connected to fixed ground via another spring. The chain can be assumed to lay horizontally and the masses move vertically but no gravity is assumed. The 20 masses and the 21 spring constants are chosen randomly and independently. The training data consist of 1000 trajectories of the same chain, each of which starts from a random initial state of positions and momenta of the masses and is 10-time-step long (including the initial state). We thus take $T = 9$ when performing recurrent training. When performing single-step training, each training trajectory of length 10 is instead considered as 9 consecutive trajectories of length 2. In this way, 1000 sample trajectories of length 10 ( $T$ =9) are turned into 9000 sample trajectories of length 2 ( $T { = } 1$ ), allowing for a fair comparison between single-step training and recurrent training. During testing, the trained model is given 32 random initial states in order to predict 32 trajectories of length 100. Detailed experiment setups and model architectures are provided in Appendix A.1, and a PyTorch implementation can be found at https://github.com/zhengdao-chen/SRNN.git.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 1: Testing results in the noiseless case by single-step methods. Left: Prediction error of each method over time, measured by the L2 distance between the true and predicted positions of the 20 masses. Right: Each curve represents the position of one of the masses (number 5) as a function of time predicted by the three single-step-trained H-NET models. Plots of the other masses’ positions are provided in Appendix D.1.
|
| 102 |
+
|
| 103 |
+
# 4.1 Going symplectic - rescuing HNN with the leapfrog integrator
|
| 104 |
+
|
| 105 |
+
First, we consider the noiseless case, where the training data consist of exact values of the positions $( q )$ and momenta (p) of the masses on the chain at each discrete time point. As shown in figure 1, the prediction of a single-step E-E H-NET deviates from the ground truth quickly and is unable to capture the periodic motion. By comparison, a single-step E-E ONET yields predictions that is qualitatively reasonable. This shows that using Hamiltonian models without paying attention to the integration scheme may not be a good idea.
|
| 106 |
+
|
| 107 |
+
We then replace Euler’s integrator used during testing by a leapfrog integrator, yielding a Single-step E-L H-NET. Figure 1 shows that this helps the H-NET produce predictions that remain stable and periodic over a longer period of time. Since the training process remains the same, this implies that part of the instability and degeneration of H-NET’s predictions comes from the nature of Euler’s integrator rather than the lack of proper training.
|
| 108 |
+
|
| 109 |
+
In contrast, using a leapfrog integrator for both training and testing substantially improve the performance, as also shown again in figure 1. This improvement shows the importance of consistency between the integrators used in training and predicting modes. This can be understood with the concept of modified equations (Hairer, 1994): when we use a numerical integrator to solve an ODE, the numerical solution usually does not strictly follow the original equation due to discretization, but can be regarded as a solution to a modified version of the original equation that depends on the integrator and the time-step size. Therefore, training and testing with the same numerical integrator and time-step size could allow the system to learn a modified Hamiltonian that corrects some of the errors caused by the discretization scheme.
|
| 110 |
+
|
| 111 |
+
# 4.2 Going recurrent - using multi-step training when noise is present
|
| 112 |
+
|
| 113 |
+
Since noise is prevalent in real-world observations, we also test our models on noisy trajectories. Independent and identically distributed Gaussian noise is added to both the position and the momentum variables at each time step. Applying the single-step methods described above yield considerably worse predictions, as shown in Figure 2 (left).
|
| 114 |
+
|
| 115 |
+
This phenomenon can be controlled by training on multiple steps, effectively arriving at a type of recurrent neural network: if noise is added independently at each time-step, then having data from multiple consecutive time steps may allow us to discern the actual noiseless trajectory, analogous to performing linear regression on multiple (more than 2) noisy data points. As we see in Figure 2 (left), recurrent training consistently improves the predictions except for E-E H-NET. The best performing model is the SRNN (recurrent L-L H-Net) which improves substantially over the single-step L-L H-NET. Interestingly, the recurrent E-E H-NET does not improve over the single-step E-E H-NET, which means that recurrent training does not help if one uses a naïve integrator.
|
| 116 |
+
|
| 117 |
+
# 4.3 Initial state optimization (ISO)
|
| 118 |
+
|
| 119 |
+
However, one issue remains to be addressed: in the framework that we have adopted so far, the initial states $p _ { 0 }$ and $q _ { 0 }$ are treated as the actual initial states from which the system begins to evolve despite the added noise in observation. With noise added to the observation of $p _ { 0 }$ and $q _ { 0 }$ , our dynamical models will start from these noisy states and remain biased as we advance in time in both the training and the testing mode.
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 2: Prediction error of all methods in the noisy case measured by L2 distance, presented in two plots due to the large number of methods. Included in the left plot are the single-step-trained methods, recurrently trained methods, vanilla RNN and LSTM. Included in the right plot are the (same) recurrently trained methods, the recurrently trained methods with initial state optimization (ISO), as well as vanilla RNN and LSTM with ISO.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: Predictions made by three methods in the noisy case. The Y-axis corresponds to the position of one of the masses (number 5) on the chain.
|
| 126 |
+
|
| 127 |
+
To mitigate this issue, we propose to introduce two new parameter vectors for each sample, $\hat { p } _ { 0 }$ and $\hat { q } _ { 0 }$ , interpreted as our estimate of the actual initial states, and we let our dynamical models evolve starting from them instead of the observed $p _ { 0 }$ and $q _ { 0 }$ . Treating $\hat { p } _ { 0 }$ and $\hat { q } _ { 0 }$ as parameters, we can optimize them based on the loss function while fixing the model’s parameters, a process that we call initial state optimization (ISO). When the model is good enough, we hope that this will guide us towards the true initial states without observation noise. In Appendix B, we motivate the use of ISO from the perspective of maximum likelihood inference. In actual training, we first train the neural network parameters for 100 epochs as usual, and starting from the 101st, after every epoch we perform ISO with the L-BFGS-B algorithm (Zhu et al., 1997) on the $\hat { p } _ { 0 }$ and $\hat { q } _ { 0 }$ parameters for every training trajectory. At testing time, the model is given the noisy values of $p$ and $q$ for the first 10 time steps and must complete the trajectory for the next 200 steps. These 10 initial time steps allow us to perform the same L-BFGS-B optimization to determine the initial state $\hat { p } _ { 0 }$ before advancing in time to predict the entire trajectory.
|
| 128 |
+
|
| 129 |
+
As seen in Figure 2 (right), SRNN-ISO (i.e. SRNN equipped with ISO) clearly yields the best prediction among all the methods. Figure 3 shows the predictions of HNN, SRNN and SRNN-ISO on one test sample, and we clearly see the qualitative improvements thanks to recurrent training and ISO. O-NET also benefits from ISO while vanilla RNN and LSTM do not seem to, likely because the initial state optimization only works when we already have a reasonable model of the system. In Appendix C, we give a heuristic argument for the convexity of ISO, which helps to explain the success of using L-BFGS-B for ISO.
|
| 130 |
+
|
| 131 |
+
In summary, we have proposed three extensions to learning complex and noisy dynamics with H-NET and demonstrated the improvements they lead to: a) using the leapfrog integrator instead of Euler’s integrator; b) using recurrent instead of single-step training; and c)
|
| 132 |
+
|
| 133 |
+
Table 1: Testing results of predicting the dynamics of the spring-chain system by methods based on fixed $p _ { 0 }$ , $q _ { 0 }$ (i.e., not optimizing $p _ { 0 }$ , $q _ { 0 }$ as parameters). The error is defined as the discrepancy between the (noisy) ground truth and the predictions at each time step averaged over the first 200 time steps, where the discrepancy is measured by the L2 distance between the true and predicted positions of the 20 masses in the chain, both of which considered as 20-dimensional vectors. The mean and standard deviation are computed based on 32 testing samples, each starting from a random configuration of the chain.
|
| 134 |
+
|
| 135 |
+
Table 2: Testing results of predicting the dynamics of the spring-chain system by methods that optimize on $p _ { 0 }$ and $q _ { 0 }$ starting from their observed (noisy) values using L-BFGS-B, as explained in the text. The definition of the errors is the same as in the above table.
|
| 136 |
+
|
| 137 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Integrator (tr)</td><td rowspan=1 colspan=1>Integrator(te)</td><td rowspan=1 colspan=1>Error mean</td><td rowspan=1 colspan=1>Error std</td></tr><tr><td rowspan=6 colspan=1>single-step</td><td rowspan=3 colspan=1>O-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>6.93</td><td rowspan=1 colspan=1>1.22</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>5.87</td><td rowspan=1 colspan=1>1.04</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>7.28</td><td rowspan=1 colspan=1>1.48</td></tr><tr><td rowspan=3 colspan=1>H-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>7.24</td><td rowspan=1 colspan=1>0.64</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>3.32</td><td rowspan=1 colspan=1>0.89</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>3.36</td><td rowspan=1 colspan=1>0.67</td></tr><tr><td rowspan=8 colspan=1>recurrent</td><td rowspan=3 colspan=1>O-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>2.88</td><td rowspan=1 colspan=1>0.45</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>4.12</td><td rowspan=1 colspan=1>0.41</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>3.34</td><td rowspan=1 colspan=1>0.86</td></tr><tr><td rowspan=3 colspan=1>H-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>7.58</td><td rowspan=1 colspan=1>0.63</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>5.26</td><td rowspan=1 colspan=1>0.63</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>2.37</td><td rowspan=1 colspan=1>0.87</td></tr><tr><td rowspan=1 colspan=1>Vanilla RNN</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>4.80</td><td rowspan=1 colspan=1>0.82</td></tr><tr><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>5.95</td><td rowspan=1 colspan=1>1.05</td></tr></table>
|
| 138 |
+
|
| 139 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Integrator (tr)</td><td rowspan=1 colspan=1>Integrator (te)</td><td rowspan=1 colspan=1>Error mean</td><td rowspan=1 colspan=1>Error std</td></tr><tr><td rowspan=3 colspan=1>O-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>2.13</td><td rowspan=1 colspan=1>0.37</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>3.59</td><td rowspan=1 colspan=1>0.50</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>2.27</td><td rowspan=1 colspan=1>0.60</td></tr><tr><td rowspan=3 colspan=1>H-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>6.26</td><td rowspan=1 colspan=1>0.60</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>3.00</td><td rowspan=1 colspan=1>0.63</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>1.45</td><td rowspan=1 colspan=1>0.32</td></tr><tr><td rowspan=1 colspan=1>Vanilla RNN</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>4.72</td><td rowspan=1 colspan=1>0.94</td></tr><tr><td rowspan=1 colspan=1>LSTM</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>N/A</td><td rowspan=1 colspan=1>5.81</td><td rowspan=1 colspan=1>0.98</td></tr></table>
|
| 140 |
+
|
| 141 |
+
optimizing the initial states of each trajectory as parameters when data are noisy. Thorough comparisons of test errors are given in Tables 1 and 2, where we highlight that the SRNN (recurrent L-L H-NET) models achieve the lowest errors.
|
| 142 |
+
|
| 143 |
+
# 5 SRNN can learn the dynamics of a three-body system
|
| 144 |
+
|
| 145 |
+
Next, we test SRNN with the three-body system, which is a well-known example of a chaotic system, meaning that a small difference in the initial condition could lead to drastically different evolution trajectories, even without noise added. As a result, even when the exact equations are known, simulating it with different time-step sizes could also lead to qualitatively different solutions. Moreover, Greydanus et al. (2019) mentions that HNN does not outperform a baseline method using O-NET in learning the three-body system’s evolution. Here, we test our SRNN together with other baselines on the noiseless three-body system with the same configurations as Greydanus et al. (2019). The detailed experimental setup and model architectures are provided in Appendix A.2.
|
| 146 |
+
|
| 147 |
+
As we see in Table 3, the best-performing model is SRNN and the second-best is the singlestep L-L H-NET. Interestingly, and perhaps counter-intuitively, they even outperform the baseline method of simulating the correct equation with the same time-step size. How is this possible? In short, our explanation is that the error introduced by numerical discretization could be learned and therefore compensated for by the models we train. More concretely, once again using the concept of modified equations mentioned in Section 4.1, we argue that the ODE-based learning models, including both H-NET and O-NET models, could learn not
|
| 148 |
+
|
| 149 |
+
Table 3: Prediction error results for the three-body system with time-step $\Delta t = 1$ . The last row corresponds to numerically solving the correct underlying equations using the leapfrog integrator with time-step $\Delta t = 1$ . The other rows correspond to the different learning-based methods, same as in the spring-chain experiments.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Integrator (tr)</td><td rowspan=1 colspan=1>Integrator (te)</td><td rowspan=1 colspan=1>Error mean</td><td rowspan=1 colspan=1>Error std</td></tr><tr><td rowspan=6 colspan=1>single-step</td><td rowspan=3 colspan=1>O-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>0.65</td><td rowspan=1 colspan=1>0.16</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>1.36</td><td rowspan=1 colspan=1>0.18</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>1.33</td><td rowspan=1 colspan=1>0.20</td></tr><tr><td rowspan=3 colspan=1>H-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>1.64</td><td rowspan=1 colspan=1>0.25</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>0.88</td><td rowspan=1 colspan=1>0.33</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>0.35</td><td rowspan=1 colspan=1>0.09</td></tr><tr><td rowspan=6 colspan=1>recurrent</td><td rowspan=3 colspan=1>O-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>0.51</td><td rowspan=1 colspan=1>0.11</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>1.27</td><td rowspan=1 colspan=1>0.18</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>0.49</td><td rowspan=1 colspan=1>0.10</td></tr><tr><td rowspan=3 colspan=1>H-NET</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>0.79</td><td rowspan=1 colspan=1>0.17</td></tr><tr><td rowspan=1 colspan=1>Euler</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>1.76</td><td rowspan=1 colspan=1>0.62</td></tr><tr><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>0.26</td><td rowspan=1 colspan=1>0.07</td></tr><tr><td rowspan=1 colspan=1>simulation</td><td rowspan=1 colspan=1>true eqns.</td><td rowspan=1 colspan=1>(no training)</td><td rowspan=1 colspan=1>Leapfrog</td><td rowspan=1 colspan=1>0.47</td><td rowspan=1 colspan=1>0.18</td></tr></table>
|
| 152 |
+
|
| 153 |
+
the correct underlying equation, but rather the equation whose modified equation associated with our choice of numerical integrator and time-step size is the original equation. Hence, when the time-step size is large and the error of numerical discretization is not negligible, it is possible that the learned equation could yield better predictions than the correct one.
|
| 154 |
+
|
| 155 |
+
In addition, we also see that the recurrently trained models outperform the corresponding single-step-trained models. Plots of the predicted trajectories are provided in Appendix E.
|
| 156 |
+
|
| 157 |
+
# 6 Learning perfect rebound with an augmented SRNN
|
| 158 |
+
|
| 159 |
+
We focus in this section on the perfect rebound problem as a prototypical example of stiff ODE in a physical system. We consider a heavy billiard, subject to gravitational forces pointing downwards, and bouncing around a two-dimensional square domain delimited by impenetrable walls. Whenever it hits a wall, the billiard rebounds without loss of energy, by reversing the component of its momentum orthogonal to the wall surface. Microscopically, when the billiard hits the wall, the atomic structure deformation produces strong electromagnetic forces that reverse the momentum during a very brief timescale. Simulating this microscopic phenomenon with a Hamiltonian ODE would not only be computationally expensive, but also require a detailed knowledge of the atomic structures of the billiard and the walls. The perfect rebound is a macroscopic approximation that treats the billiard as a point mass and the rebound as an event with zero duration infinite forces. Although this approximation is convenient for high-school level derivations, the singularity makes it hard to simulate using Hamiltonian dynamics.
|
| 160 |
+
|
| 161 |
+
We propose to approach this problem by augmenting each time step of a leapfrog-based SRNN with an additional operation that models a possible rebound event,
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
p _ { t } ^ { p o s t } p _ { t } ^ { p r e } - 2 ( p _ { t } ^ { p r e } \cdot n ) n ~ ,
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
where $p _ { t } ^ { p r e }$ is the pre-rebound momentum vector and $p _ { t } ^ { p o s t }$ is the post-rebound momentum vector. When the vector $n$ is zero, this operation does not change the momentum in any way. When $n$ is a unit vector orthogonal to a wall, this operation computes the momentum reversal that is characteristic of a perfect rebound. Vectors $n$ of smaller length could also be used to model energy dissipation in manner that is reminiscent of the famous LSTM forget gate (Hochreiter and Schmidhuber, 1997).
|
| 168 |
+
|
| 169 |
+
Because the billiard trajectory depends on the exact timing of the rebound event, we also need a scalar $\alpha \in \lfloor 0 , 1 \rfloor$ that precisely places the rebound event at time $t + \alpha \Delta t$ between the successive time steps $t$ and $t + \Delta t$ . The augmented leapfrog schema then becomes
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
[ p _ { t + \alpha \Delta t } ^ { p r e } , q _ { t + \alpha \Delta t } ^ { p r e } ] \gets \{ \frac { l e a p f r o g } { \alpha \Delta t } \left[ p _ { t } , q _ { t } \right]
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
p _ { t + \alpha \Delta t } ^ { p o s t } = p _ { t + \alpha \Delta t } ^ { p r e } - 2 ( p _ { t + \alpha \Delta t } ^ { p r e } \cdot n ) n
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 4: Actual versus predicted trajectories of the heavy billiard with perfect rebound. The predictions are obtained by an SRNN plus the rebound module described in section 6.
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\left[ p _ { t + \Delta t } , q _ { t + \Delta t } \right] \underset { ( 1 - \alpha ) \Delta t } { \xleftarrow { l e a p f r o g } } \left[ p _ { t + \alpha \Delta t } ^ { p o s t } , q _ { t + \alpha \Delta t } ^ { p o s t } \right]
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
where equations (6) and (8) represent ordinary leapfrog updates (4) for time steps of respective durations $\alpha \Delta t$ and $( 1 - \alpha ) \Delta t$ . More precisely, we first compute a tentative position $\ddot { q } _ { t + \Delta t }$ and momentum $\tilde { p } _ { t + \Delta t }$ assuming no rebound,
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\left[ \tilde { p } _ { t + \Delta t } , \tilde { q } _ { t + \alpha \Delta t } \right] \underbrace { l e a p f r o g } _ { \Delta t } \left[ p _ { t } , q _ { t } \right] ,
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
then compute both $n$ and $\alpha$ as parametric functions of the tentative position $\tilde { q } _ { t + \Delta t }$ as well as the current position $q _ { t }$ , and finally apply the forward model (6–8). Note that the final state is equal to the tentative state when no rebound occurs, that is, when $n = 0$ .
|
| 193 |
+
|
| 194 |
+
Directly modeling $n$ and $\alpha$ with a neural network taking $\ddot { q } _ { t + \Delta t }$ as the input would be very inefficient because we would need to train with a lot of rebound events to precisely reveal the location of the walls. We chose instead to use visual cues in the form of a background image representing the walls. We model $n$ as the product of a direction vector $n$ and a magnitude $\gamma \in \left[ 0 , 1 \right]$ , and we want the latter to take value close to 1 when perfect rebound actually occurs between $t$ and $t + \Delta t$ and close to 0 otherwise. Both $n$ and $\alpha$ are modeled as MLPs that take as input two 10x10 neighborhoods of the background image, centered at positions $q _ { t }$ and $\ddot { q } _ { t + \Delta t }$ , respectively. In contrast, $\gamma$ is modeled as an MLP that takes as input a smaller $2 \mathrm { x } 2$ neighborhood centered at $\tilde { q } _ { t + \Delta t }$ and is trained with an additional regularization term $\| \gamma \| _ { 1 }$ in order to switch the rebound module off when it is not needed.
|
| 195 |
+
|
| 196 |
+
Training is achieved by back-propagating through the successive copies of the augmented leapfrog scheme, through the models of $n$ , $\alpha$ , and $\gamma$ , and also through the computation of the tentative $\ddot { p } _ { t + \Delta t }$ and $\ddot { q } _ { t + \Delta t }$ . We use 5000 training trajectories of length 10 starting from a randomly-sampled initial positions and velocities. Similarly, we use 32 testing trajectories of length 60. Detailed exprimental setup is included in Appendix A.3. Figure 5 plots some predicted and actual testing trajectories. Appendix F compares these results with the inferior results obtained with several baseline methods, including SRNN without the rebound module, and SRNN with a rebound module that does not learn $\alpha$ . One limitation of our method, however, results from the assumption that there is at most one rebound event per time step. Although this assumption fails when the billiard rebounds twice near a corner, as shown in the bottom right plot in Figure 5, our method still outperforms the baseline methods even in this case.
|
| 197 |
+
|
| 198 |
+
# 7 Conclusion
|
| 199 |
+
|
| 200 |
+
We propose the Symplectic Recurrent Neural Network, which learns the dynamics of Hamiltonian systems from data. Thanks to symplectic integration, multi-step training and initial state optimization, it outperforms previous methods in predicting the evolution of complex and noisy Hamiltonian systems, such as the spring-chain and the three-body systems. It can even outperform simulating with the exact equations, likely by learning to compensate for numerical discretization error. We further augment it to learn perfect rebound from data, opening up the possibility to handle stiff systems using ODE-based learning algorithms.
|
| 201 |
+
|
| 202 |
+
# Acknowledgments
|
| 203 |
+
|
| 204 |
+
The authors acknowledge stimulating discussions with Dan Roberts, Marylou Gabrié, Anna Klimovskaia, Yann Ollivier and Joan Bruna.
|
| 205 |
+
|
| 206 |
+
# References
|
| 207 |
+
|
| 208 |
+
Arjovsky, M., Shah, A., and Bengio, Y. (2015). Unitary evolution recurrent neural networks. CoRR, abs/1511.06464.
|
| 209 |
+
|
| 210 |
+
Battaglia, P. W., Pascanu, R., Lai, M., Rezende, D. J., and Kavukcuoglu, K. (2016). Interaction networks for learning about objects, relations and physics. CoRR, abs/1612.00222.
|
| 211 |
+
|
| 212 |
+
Brunton, S. L., Proctor, J. L., and Kutz, J. N. (2016). Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 113(15):3932–3937.
|
| 213 |
+
|
| 214 |
+
Chang, B., Chen, M., Haber, E., and Chi, E. H. (2019). AntisymmetricRNN: A dynamical system view on recurrent neural networks. In International Conference on Learning Representations.
|
| 215 |
+
|
| 216 |
+
Chang, M. B., Ullman, T., Torralba, A., and Tenenbaum, J. B. (2016). A compositional object-based approach to learning physical dynamics. CoRR, abs/1612.00341.
|
| 217 |
+
|
| 218 |
+
Chen, T. Q., Rubanova, Y., Bettencourt, J., and Duvenaud, D. K. (2018a). Neural ordinary differential equations. In Bengio, S., Wallach, H., Larochelle, H., Grauman, K., CesaBianchi, N., and Garnett, R., editors, Advances in Neural Information Processing Systems 31, pages 6571–6583. Curran Associates, Inc.
|
| 219 |
+
|
| 220 |
+
Chen, Z., Raman, B., and Stern, A. (2018b). Structure-preserving numerical integrators for hodgkin-huxley-type systems.
|
| 221 |
+
|
| 222 |
+
Greydanus, S., Dzamba, M., and Yosinski, J. (2019). Hamiltonian neural networks. arXiv preprint arXiv:1906.01563.
|
| 223 |
+
|
| 224 |
+
Hairer, E. (1994). Backward analysis of numerical integrators and symplectic methods. Annals of Numerical Mathematics, 1:107–132. ID: unige:12640.
|
| 225 |
+
|
| 226 |
+
Hairer, E., Lubich, C., and Wanner, G. (2002). Geometric Numerical Integration: StructurePreserving Algorithms for Ordinary Differential Equations. Springer series in computational mathematics. Springer.
|
| 227 |
+
|
| 228 |
+
Hairer, E., Nørsett, S. P., and Wanner, G. (2008). Solving Ordinary Differential Equations I: Nonstiff Problems. Springer Series in Computational Mathematics. Springer Berlin Heidelberg.
|
| 229 |
+
|
| 230 |
+
Hairer, E. and Wanner, G. (2013). Solving Ordinary Differential Equations II: Stiff and Differential - Algebraic Problems. Springer Series in Computational Mathematics. Springer Berlin Heidelberg.
|
| 231 |
+
|
| 232 |
+
Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8):1735–1780.
|
| 233 |
+
|
| 234 |
+
Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.
|
| 235 |
+
|
| 236 |
+
Lambert, J. D. (1991). Numerical Methods for Ordinary Differential Systems: The Initial Value Problem. John Wiley & Sons, Inc., New York, NY, USA.
|
| 237 |
+
Leimkuhler, B. and Reich, S. (2005). Simulating Hamiltonian Dynamics. Cambridge Monographs on Applied and Computational Mathematics. Cambridge University Press.
|
| 238 |
+
Lutter, M., Ritter, C., and Peters, J. (2019). Deep lagrangian networks: Using physics as model prior for deep learning. In International Conference on Learning Representations.
|
| 239 |
+
McLachlan, R. I., Perlmutter, M., and Quispel, G. R. W. (2004). On the nonlinear stability of symplectic integrators. BIT Numerical Mathematics, 44(1):99–117.
|
| 240 |
+
Niu, M. Y., Horesh, L., and Chuang, I. (2019). Recurrent neural networks in the eye of differential equations. arXiv preprint arXiv:1904.12933.
|
| 241 |
+
Peifer, M. and Timmer, J. (2007). Parameter estimation in ordinary differential equations for biochemical processes using the method of multiple shooting. The Institution of Engineering and Technology, Systems Biology.
|
| 242 |
+
Stapor, P., Fröhlich, F., and Hasenauer, J. (2018). Optimization and profile calculation of ODE models using second order adjoint sensitivity analysis. Bioinformatics, 34(13):i151– i159.
|
| 243 |
+
Tao, M. (2016). Explicit symplectic approximation of nonseparable hamiltonians: Algorithm and long time performance. Phys. Rev. E, 94:043303.
|
| 244 |
+
Zhu, C., Byrd, R. H., Lu, P., and Nocedal, J. (1997). Algorithm 778: L-bfgs-b: Fortran subroutines for large-scale bound-constrained optimization. ACM Trans. Math. Softw., 23(4):550–560.
|
| 245 |
+
|
| 246 |
+
# A Experiment setup
|
| 247 |
+
|
| 248 |
+
# A.1 The spring-chain experiment
|
| 249 |
+
|
| 250 |
+
We set $\Delta t = 0 . 1$ . The ground truth trajectories in both training and testing are simulated by the leapfrog integrator using $\Delta t ^ { \prime } = 0 . 0 0 1$ and coarsened into time-grids of 0.1 with a factor of 100, since simulating with a much smaller time-step leads to much more accurate solution, which we will treat as the ground truth solution.
|
| 251 |
+
|
| 252 |
+
The O-NET that represents $f _ { \theta } ( p , q )$ is a one-hidden-layer MLP with 40 input units, 2048 hidden units and 40 output units. The H-NET that represents $H _ { \boldsymbol \theta } ( p , q ) = K _ { \boldsymbol \theta _ { 1 } } ( p ) + V _ { \boldsymbol \theta _ { 2 } } ( q )$ consists of two one-hidden-layer MLPs, one for $K _ { \theta _ { 1 } }$ and the other for $V _ { \theta _ { 2 } }$ . Each of the MLPs have 20 input units, 2048 hidden units and 1 output unit. The vanilla RNN and LSTM models also have hidden states of size 2048. Implemented in PyTorch, the models are trained over 1000 epochs with the Adam optimizer (Kingma and Ba, 2014) with initial learning rate 0.001 and using the ReduceLROnPlateau scheduler $^ 4$ with patience 15 and factor 0.7.
|
| 253 |
+
|
| 254 |
+
# A.2 The three-body experiment
|
| 255 |
+
|
| 256 |
+
The ground truth trajectories are simulated by SciPy’s solve_ivp adaptive solver $^ { 5 }$ with method RK45. We coarse-grain the simulated ground truth trajectories into time-steps of $\Delta t = 1$ , so that the models developed in section 4 are numerically integrated with time-step $\Delta t = 1$ in both training and testing. We intentionally set the time-step to be relatively large, so that it becomes interesting to compare these models with a baseline method of simulating the true equations with time-step $\Delta t = 1$ . In addition, the training data consist of 100 sample trajectories of length 10 $\cdot \Delta t = 1 0$ , which are then turned into 900 trajectories of length 2 and 600 trajectories of length 5, respectively for single-step and recurrent training, in the same way as for the spring-chain experiments above.
|
| 257 |
+
|
| 258 |
+
The O-NET that represents $f _ { \boldsymbol { \theta } } ( \boldsymbol { p } , \boldsymbol { q } )$ is a three-hidden-layer MLP with 12 input units, 512 hidden units in each hidden layer and 12 output units. The H-NET that represents $H _ { \boldsymbol \theta } ( p , q ) = K _ { \boldsymbol \theta _ { 1 } } ( p ) + V _ { \boldsymbol \theta _ { 2 } } ( q )$ consists of two three-hidden-layer MLPs, one for $K _ { \theta _ { 1 } }$ and the other for $V _ { \theta _ { 2 } }$ . Each of the MLPs have 6 input units, 512 hidden units in each hidden layer and 1 output unit. The vanilla RNN and LSTM models also have hidden states of size 512. Implemented in PyTorch, the models are trained over 1000 epochs with the Adam optimizer with initial learning rate 0.0003 and using the ReduceLROnPlateau scheduler with patience 15 and factor 0.7.
|
| 259 |
+
|
| 260 |
+
# A.3 The heavy billiard experiment
|
| 261 |
+
|
| 262 |
+
The full image has size 128x128 pixels. The thickness of the wall is 12 pixels on each of the four sides, which leaves the free space of size 104x104 pixels in the middle for the billiard to move within. The billiard has size 3x3 pixels.
|
| 263 |
+
|
| 264 |
+
The O-NET that represents $f _ { \boldsymbol { \theta } } ( \boldsymbol { p } , \boldsymbol { q } )$ is a one-hidden-layer MLP with 4 input units, 32 hidden units and 4 output units. The H-NET that represents $H _ { \boldsymbol \theta } ( p , q ) = K _ { \boldsymbol \theta _ { 1 } } ( p ) + V _ { \boldsymbol \theta _ { 2 } } ( q )$ consists of two one-hidden-layer MLPs, one for $K _ { \theta _ { 1 } }$ and the other for $V _ { \theta _ { 2 } }$ . Each of the MLPs have 2 input units, 32 hidden units and 1 output unit. The vanilla RNN model also has hidden states of size 32. For the rebound module, $n$ is computed as the normalized output of a two-hidden-layer MLP, with 200 input units, 128 units in the first hidden layer, 32 units in the second hidden layer and 2 output units. $\alpha$ is also computed using a two-hiddenlayer MLP, sharing the first hidden layer units with the MLP for $n$ , and having 32 units in the second hidden layer and 1 output unit. $\gamma$ is computed by passing through sigmoid the output of a two-hidden-layer MLP, with 4 input units, 16 units in each hidden layer and 1 output unit. All of the activation functions are tanh except for the hidden-to-output activation in the MLP for $\alpha$ , where ReLU is used. Implemented in PyTorch, the models are trained over 1500 epochs with the Adam optimizer with initial learning rate 0.005 and using the ExponentialLR scheduler6 with decay factor 0.99 until the learning rate reaches 0.0001. We set $\Delta t = 0 . 1$ , and use 5000 trajectories of length $1 0 \cdot \Delta t = 1$ as training data, and 32 trajectories of length $6 0 \cdot \Delta t = 6$ as testing data.
|
| 265 |
+
|
| 266 |
+
# B The Maximum Likelihood Estimation perspective
|
| 267 |
+
|
| 268 |
+
In the presence of noise, we can interpret the learning problem described in section 3.3 above from the perspective of maximum likelihood inference, which also provides justification for treating the initial states as trainable parameters. We define models as follow:
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
\begin{array} { c } { { \hat { z } _ { i } ( \theta ) = I n t e g r a t o r ( \hat { z } _ { 0 } = z _ { 0 } , f _ { \theta } , \{ t _ { i } \} _ { i = 0 } ^ { T } ) } } \\ { { q ( z _ { i } ; \theta ) = \displaystyle \frac { 1 } { \sqrt { ( 2 \pi ) ^ { d } \sigma ^ { 2 d } } } e ^ { - \| z _ { i } - \hat { z } _ { i } ( \theta ) \| _ { 2 } ^ { 2 } / ( 2 \sigma ^ { 2 } ) } } } \\ { { P ( \{ z _ { i } \} _ { i = 1 } ^ { n } | \theta ) = \displaystyle \prod _ { i = 1 } ^ { n } q ( z _ { i } ; \theta ) = \displaystyle \frac { 1 } { ( \sqrt { 2 \pi \sigma ^ { 2 } } ) ^ { n d } } \displaystyle \prod _ { i = 1 } ^ { n } e ^ { - \| z _ { i } - \hat { z } _ { i } ( \theta ) \| _ { 2 } ^ { 2 } / ( 2 \sigma ^ { 2 } ) } , } } \end{array}
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
and $\mathcal { L } ( \boldsymbol { \theta } | \{ z _ { i } \} _ { i = 1 } ^ { n } ) = P ( \{ z _ { i } \} _ { i = 1 } ^ { n } | \boldsymbol { \theta } )$ is the likelihood function given the time-series data $\{ z _ { i } \} _ { i = 1 } ^ { n }$ Note that this model assumes independence between $z _ { i }$ and $z _ { j }$ for $i \neq j$ once $\theta$ is fixed.
|
| 275 |
+
|
| 276 |
+
If we are to perform maximum likelihood inference, we arrive at the following:
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\operatorname* { m a x } _ { \theta } : \ \log \mathcal { L } ( \theta | \{ z _ { i } \} _ { i = 1 } ^ { n } ) = - \frac { n d } 2 \log \bigl ( 2 \pi \sigma ^ { 2 } \bigr ) - \frac { 1 } { 2 \sigma ^ { 2 } } \sum _ { i = 1 } ^ { n } \| z _ { i } - \hat { z } _ { i } ( \theta ) \| _ { 2 } ^ { 2 } ,
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
which is equivalent to
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
\operatorname* { m i n } _ { \theta } \ \sum _ { i = 1 } ^ { n } \| z _ { i } - \hat { z } _ { i } ( \theta ) \| _ { 2 } ^ { 2 }
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
This provides a motivation for using the $L ^ { 2 }$ loss, as we did in the experiments.
|
| 289 |
+
|
| 290 |
+
So far, we consider $\theta$ as the only parameter of the model defined by equations 10, and therefore the only argument of the likelihood function, while $\hat { z } _ { 0 }$ is fixed to be the observed initial state $z _ { 0 }$ . As a generalization, we can consider a strictly larger family of models by allowing $z _ { 0 }$ to vary as well. In this way, we treat both $\theta$ and $z _ { 0 }$ as the parameters in the model and therefore arguments of the likelihood function that we optimize on. In other words, the model becomes
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { l } { \displaystyle \hat { z } _ { i } ( \theta , \hat { z } _ { 0 } ) = { I n t e g r a t o r ( \hat { z } _ { 0 } , f _ { \theta } , \{ t _ { i } \} _ { i = 0 } ^ { T } ) } } \\ { \displaystyle q ( z _ { i } ; \theta , \hat { z } _ { 0 } ) = \frac { 1 } { \sqrt { ( 2 \pi ) ^ { d } \sigma ^ { 2 d } } } e ^ { - { \| z _ { i } - \hat { z } _ { i } ( \theta , \hat { z } _ { 0 } ) \| _ { 2 } ^ { 2 } } / { ( 2 \sigma ^ { 2 } ) } } } \\ { \displaystyle P ( \{ z _ { i } \} _ { i = 1 } ^ { n } | \theta , \hat { z } _ { 0 } ) = \prod _ { i = 1 } ^ { n } q ( z _ { i } ; \theta ) = \frac { 1 } { ( \sqrt { 2 \pi \sigma ^ { 2 } } ) ^ { n d } } \prod _ { i = 1 } ^ { n } e ^ { - { \| z _ { i } - \hat { z } _ { i } ( \theta ) \| _ { 2 } ^ { 2 } } / { ( 2 \sigma ^ { 2 } ) } } , } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
and the optimization problem becomes
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\operatorname* { m i n } _ { \theta , \hat { z } _ { 0 } } ~ \sum _ { i = 1 } ^ { n } \| z _ { i } - \hat { z } _ { i } ( \theta , \hat { z } _ { 0 } ) \| _ { 2 } ^ { 2 } ,
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
which justifies optimizing over the initial states $p _ { 0 }$ , $q _ { 0 }$ in addition to the neural network parameters $\theta$ as described in the previous section.
|
| 303 |
+
|
| 304 |
+
Such an interpretation is similar to approaches for parameter estimation in the literature of inverse problems and systems biology, though in those cases the parameters of interest appear directly in ODEs instead of via neural networks (Peifer and Timmer, 2007; Stapor et al., 2018). In particular, jointly optimizing the parameters in the model as well as the initial value is called the initial value approach. However, despite the success we demonstrate in section 4.2, two difficulties of this approach have been pointed out: 1) The optimization could converge to local minima; 2) The numerical solution of the ODE can be unstable (Peifer and Timmer, 2007). As explained in section 4.1, using HNN together with the leapfrog integrator mitigates the second issue. But what about the first issue? In particular, even if we assume that the optimization of the neural network can work “magically” well and do not suffer from bag local minima, what about optimizing the initial value $\hat { z } _ { 0 }$ ?
|
| 305 |
+
|
| 306 |
+
# C Symplecticness and initial-state-optimization convexity
|
| 307 |
+
|
| 308 |
+
The success of optimizing on the initial state of the system in addition to the recurrent H-NET and O-NET models as described in section 4.2 raises the following question: If we already have a relatively well-trained H-NET or O-NET, is the optimization on the initial values convex? We formalize the question below and provide a heuristic answer.
|
| 309 |
+
|
| 310 |
+
$f$ or sin $\begin{array} { r } { \frac { d z } { d t } = f ( z ) } \end{array}$ we restrict our attendoes not depend on $t$ on to autonomous ODEs, which means that the function. Assuming existence and uniqueness of solutions, there exists a function that maps each initial state from $\hat { z } _ { 0 }$ for time $t$ , $\phi _ { t } ( \hat { z } _ { 0 } )$ . This function is usually called the flow map. Flow maps have also been defined for numerical solutions of ODEs, by letting $\phi _ { t } ( \hat { z } _ { 0 } ) = I n t e g r a t o r ( z _ { 0 } , f , \{ t _ { i } \} _ { i = 0 } ^ { T } )$ with $t _ { 0 } = 0$ . We can extend this definition to all the trainable models we have considered, including the models based on O-NET and H-NET by defining $\phi _ { t } ( \hat { z } _ { 0 } )$ to be the state of the system after letting the system evolve from initial state $\hat { z } _ { 0 }$ for time $t$ , for suitable choices of $t$ . For example, for O-NET, we have $\phi _ { t } ( \hat { z } _ { 0 } ) = I n t e g r a t o r ( z _ { 0 } , f _ { \theta } , \{ t _ { i } \} _ { i = 0 } ^ { T } )$ .
|
| 311 |
+
|
| 312 |
+
Suppose we impose an L2 loss on $\phi _ { t } ( \hat { z } _ { 0 } )$ , $e _ { t } ( \hat { z } _ { 0 } ) = \| \phi _ { t } ( \hat { z } _ { 0 } ) - z _ { t } \| _ { 2 } ^ { 2 }$ , where $z _ { t }$ corresponds to the observed data at time $t$ . The question is, is $e _ { t } ( z )$ a (perhaps locally) convex function of $z$ , for what functions and numerical integrators? To understand convexity, we compute the gradient and the Hessian as follow.
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\frac { \partial } { \partial z } e _ { t } ( z ) = 2 ( \phi _ { t } ( z ) - z _ { t } ) ^ { \mathsf { T } } \cdot F _ { t } ( z )
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\frac { \partial ^ { 2 } } { \partial z ^ { 2 } } e _ { t } ( z ) = 2 ( \phi _ { t } ( z ) - z _ { t } ) \cdot ^ { ( 3 ) } G _ { t } ( z ) + F _ { t } ( z ) ^ { \top } \cdot F _ { t } ( z ) ,
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
where $F _ { t } ( z )$ is the Jacobian matrix of the flow map, defined as $\begin{array} { r } { F _ { t } ( z ) _ { i j } = \frac { \partial } { \partial z _ { j } } ( \phi _ { t } ( z ) _ { i } ) } \end{array}$ , and $G _ { t } ( z )$ is a third-order tensor contains the second order derivatives of the flow map, defined $\begin{array} { r } { G _ { t } ( z ) _ { i j k } = \frac { \partial ^ { 2 } } { \partial z _ { i } z _ { j } } ( \phi _ { t } ( z ) _ { k } ) } \end{array}$ ∂ 2 . We use ·(3) to denote the dot product in the third dimension.
|
| 323 |
+
|
| 324 |
+
$F _ { t } ( z ) ^ { \mathsf { T } } \cdot F _ { t } ( z )$ is symmetric positive semidefinite for any matrix $F _ { t } ( z )$ . If $\phi _ { t }$ corresponds to either the exact flow map of a Hamiltonian system or the flow of a symplectic integrator, such as the leapfrog integrator, applied to a Hamiltonian system, then $F _ { t } ( z )$ is a symplectic matrix, implying that $\operatorname* { d e t } ( F _ { t } ( z ) ) = 1$ . Hence, $\mathrm { d e t } ( F _ { t } ( z ) ^ { \mathsf { T } } \cdot F _ { t } ( z ) ) = 1$ , which further implies that $F _ { t } ( z ) ^ { \mathsf { T } } \cdot F _ { t } ( z )$ is a positive definite matrix. Therefore, non-rigorously, when $\lVert \phi _ { t } ( z ) - z _ { t } \rVert _ { 2 }$ is small and so the first term on the right hand side of equation 16 is negligible compared to the least eigenvalue of $F _ { t } ( z ) ^ { \mathsf { T } } \cdot F _ { t } ( z )$ , the entire Hessian matrix ∂2∂z2 et(z) is also positive definite, implying strong convexity of the optimization problem.
|
| 325 |
+
|
| 326 |
+
If $\phi _ { t }$ is the exact flow map, then $\| \phi _ { t } ( z ) - z _ { t } \|$ being small means that noise in the data is small. If $\phi _ { t }$ is the flow map of a learned model, then it means that we have a model close to the true underlying system in addition to not having too much noise in the data. Translating back to the learning problem, we see that, heuristically, when the model we use is close to symplectic, which is likely if the underlying system is a Hamiltonian system, and trained to be close enough to the true underlying system, and the noise in the data is small enough, then the optimization problem on the initial state is strongly convex.
|
| 327 |
+
|
| 328 |
+
# D Additional plots of the spring-chain experiments D.1 Noiseless data (section 4.1)
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 5: Extension of Figure 1 to 10 masses on the chain (1st being the closest to one end, and $1 0 \mathrm { t h }$ being in the center).
|
| 332 |
+
|
| 333 |
+
# D.2 Noisy data (section 4.2)
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 6: Single-step E-E O-NET
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 7: Single-step E-E H-NET
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 8: Single-step L-L O-NET
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 9: Single-step L-L H-NET
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 10: Recurrent E-E O-NET
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 11: Recurrent E-E H-NET
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 12: Recurrent L-L O-NET
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 13: (SRNN) Recurrent L-L H-NET
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 14: Recurrent E-E O-NET w/ ISO
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 15: Recurrent E-E H-NET w/ ISO
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 16: Recurrent L-L O-NET w/ ISO
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Figure 17: (SRNN-ISO) Recurrent L-L H-NET w/ ISO
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Figure 18: Vanilla RNN
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 19: LSTM
|
| 376 |
+
|
| 377 |
+
In each of the plots below, the three dashdot curves represent the ground truth trajectories of the three masses, and the three sequences of dots are the predictions made by each method.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
Figure 20: Actual versus predicted trajectories of the three-body system by the various single-step-trained methods.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 21: Actual versus predicted trajectories of the three-body system by the various recurrently trained methods.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 22: Actual trajectory versus the trajectory simulated by the leapfrog integrator with time-step 1 (left) and 0.1 (right).
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 23: SRNN with a rebound module that does not learn $\alpha$ (and effectively treats $\alpha = 1$ ).
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 24: SRNN without the rebound module.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 25: Recurrent L-L O-NET with the rebound module.
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 26: Vanilla RNN.
|
md/train/BylRkAEKDH/BylRkAEKDH.md
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TABNET: ATTENTIVE INTERPRETABLE TABULAR LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose a novel high-performance interpretable deep tabular data learning network, TabNet. TabNet utilizes a sequential attention mechanism that softly selects features to reason from at each decision step and then aggregates the processed information to make a final prediction decision. By explicitly selecting sparse features, TabNet learns very efficiently as the model capacity at each decision step is fully utilized for the most relevant features, resulting in a high performance model. This sparsity also enables more interpretable decision making through the visualization of feature selection masks. We demonstrate that TabNet outperforms other neural network and decision tree variants on a wide range of tabular data learning datasets, especially those are not saturated in performance, and yields interpretable feature attributions and insights into the global model behavior.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks have been demonstrated to be very powerful in understanding images (He et al., 2015; Simonyan & Zisserman, 2014; Zagoruyko & Komodakis, 2016), text (Conneau et al., 2016; Devlin et al., 2018; Lai et al., 2015) and audio (van den Oord et al., 2016; Amodei et al., 2015; Chiu et al., 2018), yielding many important artificial intelligence use cases. For these data types, a major enabler of the rapid research and development progress is the availability of canonical neural network architectures to efficiently encode the raw data into meaningful representations. Integrated with simple decision-making layers, these canonical architectures yield high performance on new datasets and related tasks with small extra tuning effort. For example, consider the image understanding task – variants of convolutional layers with residual connections, e.g. the notable ResNet (He et al., 2015) architecture, can yield reasonably good performance on a new image dataset (e.g. in medical imaging) or a slightly different visual recognition problem (e.g. segmentation).
|
| 12 |
+
|
| 13 |
+
Our focus in this paper is tabular (structured) data. Tabular data is indeed the most common data type in the entire addressable artificial intelligent market (Chui et al., 2018). Yet, canonical neural network architectures for tabular data understanding have been under-explored. Instead, variants of ensemble decision trees still dominate data science competitions with tabular data (Kaggle, 2019b). A primary reason for the popularity of tree-based approaches is their representation power for decision manifolds with approximately hyperplane boundaries that are commonly observed for tabular data. In addition, decision tree-based approaches are easy to develop and fast to train. They are highly-interpretable in their basic form (e.g. by tracking decision nodes and edges) and various interpretability techniques have been shown to be effective for their ensemble form, e.g. (Lundberg et al., 2018). On the other hand, conventional neural network architectures based on stacked convolutional or multilayer perceptrons, may not be the best fit for tabular data decision manifolds due to being vastly overparametrized – the lack of appropriate inductive bias often causes them to fail to find robust solutions for tabular decision manifolds (Goodfellow et al., 2016). We argue here that neural network architectures for tabular data should be redesigned to account for a ‘decision-tree-like’ mapping.
|
| 14 |
+
|
| 15 |
+
Given the aforementioned benefits and reasonable performances of tree-based methods, why is deep learning worth exploring for tabular data? One obvious motivation is pushing the performance albeit an increased computational cost, especially with more training data. In addition, introduction of a high-performance deep neural network architecture unlocks the benefits of gradient descent-based end-to-end deep learning for tabular data. For example, decision tree learning (even with gradient boosting) does not utilize back-propagation into their inputs to use an error signal to guide efficient learning of complex data types. On the other hand, with a deep neural network architecture, complex data types like images can be integrated into tabular data efficiently. Another well-known challenge for tree-based methods is learning from streaming data. Most algorithms for tree learning need global statistical information to select split points and straightforward modifications such as (Ben-Haim & Tom-Tov, 2010) typically yield lower accuracy compared to learning from full data at once, yet deep neural networks show great potential for continual learning (Parisi et al., 2018). Lastly, deep learning models learn meaningful representations which enable new capabilities such as data-efficient domain adaptation (Goodfellow et al., 2016), generative modeling (e.g. using variational autoencoders or generative adversarial networks (Radford et al., 2015) or semi-supervised learning (Dai et al., 2017). As one example of these potential new capabilities, we demonstrate the potential of semi-supervised learning in the Appendix, showing the potential benefits of information extraction from unlabeled data which non-deep learning models are much weaker at.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Depiction of TabNet’s sparse feature selection for Adult Census Income prediction (Dua & Graff, 2017). TabNet employs multiple decision blocks that focus on processing a subset of input features for overall decision making. Two decision blocks shown as examples process the features that are professional occupation related and investment related in order to predict the income level.
|
| 19 |
+
|
| 20 |
+
In this paper we propose TabNet, a deep neural network architecture to make a significant leap forward towards the optimal model design for tabular data learning. Motivated by the key problems for tabular data discussed above, the design of TabNet has two goals that are often not considered jointly: state-of-the-art performance and interpretability. With decision tree motivations, TabNet brings sparsity-controlled soft feature selection, but individually for each instance. Unlike other instance-wise feature selection methods like (Chen et al., 2018) or (Yoon et al., 2019), TabNet employs a single deep learning architecture with end-to-end learning, to map the raw data to the final decision with soft feature selection. The key aspects and contributions of TabNet are:
|
| 21 |
+
|
| 22 |
+
1. In order to learn flexible representations and enable flexible integration into end-to-end learning, unlike most tabular data methods, TabNet inputs raw tabular data without any feature preprocessing and is trained using conventional gradient descent-based optimization.
|
| 23 |
+
|
| 24 |
+
2. To improve performance and interpretability, TabNet utilizes a sequential attention mechanism to choose which features to reason from at each decision step, as shown in Fig. 1. We design this feature selection to be instance-wise such that the model can decide which features to focus on separately for each input – e.g., for income classification capital gain may be a more important feature to focus on for a middle-aged individual. Explicit selection of sparse features enables interpretability as well as more efficient learning as the model parameters are fully utilized for the most salient features at the corresponding decision step.
|
| 25 |
+
|
| 26 |
+
3. Overall, our careful architecture design leads to two valuable properties for real world tabular learning problems: (1) TabNet outperforms other tabular learning models on various datasets for classification and regression problems from different domains, particularly those which are not saturated in performance; and (2) TabNet enables two kinds of interpretability: local interpretability that visualizes the importance of input features and how they are combined, and global interpretability that quantifies the amount of contribution of each input feature to the trained model.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Feature selection: Feature selection in machine learning broadly refers to the techniques for judicious selection of a subset of features that are useful to build a good predictor for a specified response variable. Commonly-used feature selection techniques such as forward feature selection and LASSO regularization (Guyon & Elisseeff, 2003) attribute importance to the features based on the entire training data set, and are referred as global methods. On the other hand, instance-wise feature selection refers to selection of the most important features, individually and differently for each input. Instance-wise feature selection was studied in (Chen et al., 2018) by training an explainer model to maximize the mutual information between the selected features and the response variable, and in (Yoon et al., 2019) by using an actor-critic framework to mimic a baseline model while optimizing the feature selection. (Ma et al., 2018) uses partial variational autoencoder to dynamically decide which piece of information to acquire next sequentially, that can be adapted for instance-wise feature selection. Unlike these approaches, our proposed method employs soft feature selection with controllable sparsity in end-to-end learning – a single model jointly performs feature selection and output mapping, enabled by the specific design of the architecture. Thus, we demonstrate superior performance with very compact representations.
|
| 31 |
+
|
| 32 |
+
Tree-based learning: Tree-based models are the most common machine learning approaches for tabular data learning. The prominent strength of tree-based models is their efficacy in picking global features with the most statistical information gain (Grabczewski & Jankowski, 2005). To improve the performance of standard tree-based models by reducing the model variance, one common approach is ensembling. Among ensembling methods, random forests (Ho, 1998) use random subsets of data with randomly selected features to grow many trees. XGBoost (Chen & Guestrin, 2016) and LightGBM (Ke et al., 2017) are the two recent ensemble decision tree approaches that dominate most of the recent data science competitions. They are based on learning the structures of trees at first, and then updating the leaves with the streaming data.
|
| 33 |
+
|
| 34 |
+
Integration of neural networks into decision trees: One direction to address the limitations of decision trees is integration of neural networks. Representing decision trees with canonical neural network building blocks, as in (Humbird et al., 2018), yields redundancy in representation and inefficient learning. Soft (neural) decision trees (Wang et al., 2017; Kontschieder et al., 2015) are proposed with differentiable decision functions, instead of non-differentiable axis aligned splits to construct trees. Yet, abandoning axis-aligned splits loses the automatic feature selection ability, which is important for learning from tabular data. In (Yang et al., 2018), a soft binning function is proposed to simulate decision trees in neural networks, which needs to enumerate all possible decisions and is inefficient. In (Ke et al., 2019), a novel neural network architecture is proposed, with the motivations of explicitly leveraging expressive feature combinations and reducing model complexity. However, learning is based on transferring knowledge from a gradient boosted decision tree. Thus, it yields very limited performance improvement compared to it, and interpretability was not considered. In (Tanno et al., 2018), a deep learning framework is proposed based on adaptively growing the architecture from primitive blocks while representation learning into edges, routing functions and leaf nodes of a decision tree. Our proposed model TabNet differs from these methods as it embeds the soft feature selection ability into a sequential attention-based network architecture, with controllable sparsity.
|
| 35 |
+
|
| 36 |
+
Attentive table-to-text models: Table-to-text models extract textual information from tabular data. Recent works (Liu et al., 2017) (Bao et al., 2019) propose an architecture based on sequential mechanism for field-level attention. Despite the high-level similarities in the architecture, TabNet aims to perform the ultimate classification or regression task considering the entire input features, rather than mapping them to a different data type.
|
| 37 |
+
|
| 38 |
+
# 3 TABNET MODEL
|
| 39 |
+
|
| 40 |
+
# 3.1 PRINCIPLES
|
| 41 |
+
|
| 42 |
+
We initially consider the implementation of a decision tree-like output manifold using conventional neural network building blocks (Fig. 2). Individual feature selection is the key idea to obtain decision boundaries in hyperplane form, which can be generalized for linear combination of features where constituent coefficients determine the proportion of each feature in the decision boundary. We aim to generalize this type of tree-like functionality by:
|
| 43 |
+
|
| 44 |
+
• Utilizing sparse instance-wise feature selection, learned based on the training dataset.
|
| 45 |
+
• Constructing a sequential multi-step architecture, where each decision step can contribute to a portion of the decision that is based on the selected features.
|
| 46 |
+
• Improving the model capacity by non-linear processing of the selected features.
|
| 47 |
+
• Ensembling via higher feature dimension and more decision steps.
|
| 48 |
+
|
| 49 |
+
# 3.2 OVERALL ARCHITECTURE
|
| 50 |
+
|
| 51 |
+
Fig. 3 depicts the TabNet architecture. Tabular data inputs are comprised of numerical and categorical features. We use the raw numerical features and we consider mapping of categorical features with trainable embeddings1. We do not consider any global normalization of features, but merely apply batch normalization. We pass the same $D$ -dimensional features $\mathbf { f } \in \mathfrak { R } ^ { B \times D }$ to each decision step, where $B$ is the batch size. TabNet is based on sequential multi-step processing, with $N _ { s t e p s }$ decision steps. The $i ^ { t h }$ step inputs the processed information from the $( i - 1 ) ^ { t h }$ step to decide which features to use and outputs the processed feature representation to be aggregated into the overall decision. The idea of top-down attention in sequential form is inspired from its applications in processing visual and language data such as for visual question answering (Hudson & Manning, 2018) or in reinforcement learning (Mott et al., 2019) while searching for a small subset of relevant information in high dimensional input. Ablation studies in Appendix focus on the impact of various TabNet design choices, explained next. Overall, the performance is not too sensetitive to most hyperparameters, and guidelines on selection of the important hyperparameters are also provided in Appendix.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 2: Illustration of decision tree-like classification using conventional neural network blocksSplit and the corresponding two-dimensional manifold ( $x _ { 1 }$ and $x _ { 2 }$ are the input dimensions, and $a$ and $d$ are constants). By employing multiplicative sparse masks to inputs, the relevant features are selected.Feature Feature The selected features are linearly transformed and after a bias addition (to represent boundaries),transformer ReLU function performs region selection by zeroing the regions that are on the negative side of theMask Attentive boundary. Aggregation of multiple regions is based on the addition operation. As $C _ { 1 }$ and $C _ { 2 }$ get larger, the decision boundary gets sharper due to the softmax.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 3: (a) TabNet architecture, composed of feature transformer, attentive transformer and feature masking at each decision step. Split block divides the processed representation into two, to be Attentive used at the attentive transformer of the subsequent step and to be used towards construction of the overall output. At each decision step, its feature selection mask can provide insights about its Prior scales +functionality, and the masks can be aggregated (using the Agg. block) ultimately to obtain global feature important attribution behavior. (b) A feature transformer block example – 4-layer network is shown, where 2 of them are shared across all decision steps and 2 of them are decision step-dependent. Each layer is composed of a fully-connected layer, batch normalization and GLU nonlinearity. (c) An attentive transformer block example – a single layer mapping is modulated with a prior scale information, which aggregates how much each feature has been used before the current decision step. Normalization of the coefficients is employed using sparsemax (Martins & Astudillo, 2016) for sparse selection of the most salient features at each decision step.
|
| 58 |
+
|
| 59 |
+
Feature selection: We employ a learnable sparse mask $\mathbf { M } [ \mathbf { i } ] \in \Re ^ { B \times D }$ for soft selection of the salient features. Through sparse selection of the most salient features, the learning capacity of a decision step is not wasted on irrelevant features, and thus the model becomes more parameter efficient. The masking is in multiplicative form, $\mathbf { M } [ \mathbf { i } ] \cdot \mathbf { f }$ . We use an attentive transformer (see Fig. 3) to obtain the masks using the processed features from the preceding step, ${ \bf a } [ { \bf i } - { \bf 1 } ]$ :
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbf { M } [ \mathbf { i } ] = \mathrm { s p a r s e m a x } ( \mathbf { P } [ \mathbf { i } - \mathbf { 1 } ] \cdot \mathrm { h } _ { i } ( \mathbf { a } [ \mathbf { i } - \mathbf { 1 } ] ) ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Sparsemax normalization (Martins & Astudillo, 2016) encourages sparsity by mapping the Euclidean projection onto the probabilistic simplex, which is observed to be superior in performance and aligned with the goal of sparse feature selection for most real-world datasets. Note that Eq. 1 has the normalization property, $\begin{array} { r } { \sum _ { j = 1 } ^ { D } \mathbf { M } [ \mathbf { i } ] _ { \mathbf { b } , \mathbf { j } } = 1 } \end{array}$ . $\mathrm { h } _ { i }$ is a trainable function, shown in Fig. 3 using a fully-connected layer, followed by batch normalization. $\mathbf { P } [ \mathbf { i } ]$ is the prior scale term, denoting how much a particular feature has been used previously:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathbf { P } [ \mathbf { i } ] = \prod _ { j = 1 } ^ { i } ( \gamma - \mathbf { M } [ \mathbf { j } ] ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\gamma$ is a relaxation parameter – when $\gamma = 1$ , a feature is enforced to be used only at one decision step and as $\gamma$ increases, more flexibility is provided to use a feature at multiple decision steps. $\mathbf { P } [ \mathbf { 0 } ]$ is initialized as all ones. To further control the sparsity of the selected features, we propose sparsity regularization in the form of entropy (Grandvalet $\&$ Bengio, 2004):
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
{ \cal L } _ { s p a r s e } = - \frac { 1 } { N _ { s t e p s } \cdot B } \sum _ { i = 1 } ^ { N _ { s t e p s } } \sum _ { b = 1 } ^ { B } \sum _ { j = 1 } ^ { D } { \bf M _ { b , j } [ i ] } \log ( { \bf M _ { b , j } [ i ] } + \epsilon ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $\epsilon$ is a small number for numerical stability. We add the sparsity regularization to the overall loss, with a coefficient $\lambda _ { s p a r s e }$ . Sparsity may provide a favorable inductive bias for convergence to higher accuracy for some datasets where most of the input features are redundant.
|
| 78 |
+
|
| 79 |
+
Feature processing: We process the filtered features using a feature transformer (see Fig. 3) to obtain the features that are split for the decision step output and information for the subsequent step:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
[ \mathbf { d } [ \mathbf { i } ] , \mathbf { a } [ \mathbf { i } ] ] = \mathbf { f } _ { i } ( \mathbf { M } [ \mathbf { i } ] \cdot \mathbf { f } ) ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $\mathbf { d } [ \mathbf { i } ] \in \Re ^ { B \times N _ { d } }$ and $\mathbf { a } [ \mathbf { i } ] \in \Re ^ { B \times N _ { a } }$ . For parameter-efficient learning and efficient convergence with the high model capacity, a feature transformer should comprise layers that are shared across all decision steps (as the same features are input across different decision steps), as well as decision step-dependent layers. In Fig. 3, we show the implementation of a block as concatenation of two shared layers and two decision step-dependent layers. Each fully-connected layer is followed by batch normalization and gated linear unit (GLU) nonlinearity (Dauphin et al., 2016) 2, eventually√ connected to a normalized residual connection with normalization. Normalization with $\sqrt { 0 . 5 }$ helps to stabilize learning by ensuring that the variance throughout the network does not change dramatically, as discussed in (Gehring et al., 2017). For faster training, we aim for very large batch sizes in practice. To improve performance with large batch sizes, all batch normalization operations, except the one applied to the input features, are implemented in ghost batch normalization (Hoffer et al., 2017) form, with a virtual batch size $B _ { V }$ and momentum $m _ { B }$ . For the input features, we observe the benefit of low-variance averaging and hence avoid ghost batch normalization. After the last layer, we split the processed representation into $\mathbf { d } [ \mathbf { i } ]$ and a[i]. Inspired by decision-tree like aggregation as in Fig. 2, we construct the overall decision embedding as:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathbf { d _ { o u t } } = \sum _ { i = 1 } ^ { N _ { s t e p s } } \mathrm { R e L U } ( \mathbf { d [ i ] } ) .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Finally, we apply a linear mapping $\mathbf { W _ { f i n a l } d _ { o u t } }$ , for the final decision. When discrete outputs are required, we additionally employ a softmax function during training (and argmax during inference).
|
| 92 |
+
|
| 93 |
+
# 4 EXPERIMENTS
|
| 94 |
+
|
| 95 |
+
We evaluate the performance of TabNet in wide range of problems, that contain regression or classification tasks. We specifically focus on tabular datasets with published benchmarks, based on notable tree-based and neural network-based approaches.
|
| 96 |
+
|
| 97 |
+
For all datasets, categorical inputs are mapped to a single-dimensional trainable scalar with a learnable embedding3 and numerical columns are input without and preprocessing.4 We use standard classification (softmax cross entropy) and regression (mean squared error) loss functions and we train until convergence. Hyperparameters of the TabNet models are optimized on a validation set and listed in Appendix. TabNet performance is not very sensitive to most hyperparameters as shown with ablation studies in Appendix. In all of the experiments where we cite results from other papers, we use the same training, validation and testing data split with the original work. Adam optimization algorithm (Kingma & Ba, 2014) and Glorot uniform initialization are used for training of all models.
|
| 98 |
+
|
| 99 |
+
# 4.1 PERFORMANCE
|
| 100 |
+
|
| 101 |
+
Comparison to methods that integrate explicit feature selection. For this comparison, we consider the 6 synthetic tabular datasets from (Chen et al., 2018). As the datasets are small (10k training samples), efficient feature selection is crucial for high performance in this task. The synthetic datasets are constructed in such a way that only a subset of the features determine the output. For Syn1, Syn2 and Syn3 datasets, the ‘salient’ features are the same for all instances, so that an accurate global feature selection mechanism should be optimal. E.g., the ground truth output of the Syn2 dataset only depends on features $X _ { 3 ^ { - } } X _ { 6 }$ . For Syn4, Syn5 and Syn6 datasets, the salient features are instance dependent. E.g., for Syn4 dataset, $X _ { 1 1 }$ is the indicator, and the ground truth output depends on either $X _ { 1 } – X _ { 2 }$ or $X _ { 3 ^ { - } } X _ { 6 }$ depending on the value of $X _ { 1 1 }$ . This instance dependence makes global feature selection suboptimal, as the globally-salient features would be redundant for some instances.
|
| 102 |
+
|
| 103 |
+
Table 1: TabNet achieves high performance with small number of network parameters. Mean and std. of test area under the receiving operating characteristic curve (AUC) on 6 synthetic datasets from (Chen et al., 2018), for TabNet vs. other feature selection-based neural network models: No sel.: using all input features without any feature selection, Global: using only globally-salient features, Tree refers to Tree Ensembles (Geurts et al., 2006), LASSO: LASSO-regularized model, L2X (Chen et al., 2018) and INVASE (Yoon et al., 2019) are instance-wise feature selection frameworks. Bold numbers are the best method for each dataset.
|
| 104 |
+
|
| 105 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Syn1</td><td rowspan=1 colspan=1>Syn2</td><td rowspan=1 colspan=1>Syn3</td><td rowspan=1 colspan=1>Syn4</td><td rowspan=1 colspan=1>Syn5</td><td rowspan=1 colspan=1>Syn6</td></tr><tr><td rowspan=1 colspan=1>No sel.</td><td rowspan=1 colspan=1>.578± .004</td><td rowspan=1 colspan=1>.789±.003</td><td rowspan=1 colspan=1>.854 ± .004</td><td rowspan=1 colspan=1>.558 ± .021</td><td rowspan=1 colspan=1>.662 ± .013</td><td rowspan=1 colspan=1>.692 ± .015</td></tr><tr><td rowspan=1 colspan=1>Tree</td><td rowspan=1 colspan=1>.574 ± .101</td><td rowspan=1 colspan=1>.872 ± .003</td><td rowspan=1 colspan=1>.899± .001</td><td rowspan=1 colspan=1>.684 ± .017</td><td rowspan=1 colspan=1>.741 ± .004</td><td rowspan=1 colspan=1>.771 ± .031</td></tr><tr><td rowspan=1 colspan=1>Lasso</td><td rowspan=1 colspan=1>.498 ± .006</td><td rowspan=1 colspan=1>.555± .061</td><td rowspan=1 colspan=1>.886± .003</td><td rowspan=1 colspan=1>.512 ± .031</td><td rowspan=1 colspan=1>.691 ± .024</td><td rowspan=1 colspan=1>.727 ± .025</td></tr><tr><td rowspan=1 colspan=1>L2X</td><td rowspan=1 colspan=1>.498 ± .005</td><td rowspan=1 colspan=1>.823 ± .029</td><td rowspan=1 colspan=1>.862 ± .009</td><td rowspan=1 colspan=1>.678 ± .024</td><td rowspan=1 colspan=1>.709 ± .008</td><td rowspan=1 colspan=1>.827 ± .017</td></tr><tr><td rowspan=1 colspan=1>INVASE</td><td rowspan=1 colspan=1>.690 ± .006</td><td rowspan=1 colspan=1>.877 ± .003</td><td rowspan=1 colspan=1>.902 ± .003</td><td rowspan=1 colspan=1>.787 ± .004</td><td rowspan=1 colspan=1>.784 ± .005</td><td rowspan=1 colspan=1>.877 ± .003</td></tr><tr><td rowspan=1 colspan=1>Global</td><td rowspan=1 colspan=1>.686 ± .005</td><td rowspan=1 colspan=1>.873 ± .003</td><td rowspan=1 colspan=1>.900 ± .003</td><td rowspan=1 colspan=1>.774 ± .006</td><td rowspan=1 colspan=1>.784 ± .005</td><td rowspan=1 colspan=1>.858 ± .004</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>.682 ± .005</td><td rowspan=1 colspan=1>.892 ± .004</td><td rowspan=1 colspan=1>.897 ± .003</td><td rowspan=1 colspan=1>.776 ± .017</td><td rowspan=1 colspan=1>.789 ± .009</td><td rowspan=1 colspan=1>.878 ± .004</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 1 shows the performance of TabNet vs. other techniques, including no selection, using only globally-salient features, Tree Ensembles (Geurts et al., 2006), LASSO regularization, L2X (Chen et al., 2018) and INVASE (Yoon et al., 2019). We observe that TabNet outperforms all other methods and is on par with INVASE. For Syn1, Syn2 and Syn3 datasets, we observe that the TabNet performance is very close to global feature selection. For Syn4, Syn5 and Syn6 datasets, we observe that TabNet improves global feature selection, which would contain redundant features. (Feature selection is visualized in Sec. 4.2.) All other methods utilize a predictive model with $4 3 \mathrm { k }$ parameters, and the total number of trainable parameters is 101k for INVASE due to the two other networks in the actor-critic framework. On the other hand, TabNet is a single neural network architecture, and the total number of parameters is 26k for Syn1-Syn3 datasets and 31k for Syn4-Syn6 datasets. This compact end-to-end representation is one of TabNet’s valuable properties.
|
| 108 |
+
|
| 109 |
+
Comparison to models that do not employ explicit feature selection. We compare TabNet to high-performance tabular data learning models that are demonstrated on the following problems:
|
| 110 |
+
|
| 111 |
+
• Forest cover type (Dua & Graff, 2017): Classification of forest cover type from cartographic variables.
|
| 112 |
+
• Poker hand (Dua & Graff, 2017): Classification of the poker hand from the raw input features of suit and rank attributes of the cards.
|
| 113 |
+
• Sarcos robotics arm inverse dynamics (Vijayakumar & Schaal, 2000): Regression for inverse dynamics of seven degrees-of-freedom of an anthropomorphic robot arm.
|
| 114 |
+
• Higgs boson (Baldi et al., 2014): Distinguishing between a signal process which produces Higgs bosons and a background process which does not.
|
| 115 |
+
|
| 116 |
+
Table 2: Performance for forest cover type dataset. The performance of the comparison models∗ are from (Mitchell et al., 2018). AutoInt models pairwise feature interactions with an attention-base deep neural network (Song et al., 2018). AutoML Tables (denoted as $\star \star$ ) is an automated machine learning development tool based on ensemble of models including linear feed-forward deep neural network, gradient boosted decision tree, AdaNet (Cortes et al., 2016) and ensembles (AutoML, 2019). For AutoML Tables $( ^ { \star \star } )$ , the amount of node hours reflects the measure of the count of searched models for the ensemble and their complexity.6 A single TabNet model, without fine-grained hyperparameter search, can outperform the accuracy of ensemble models with very thorough hyperparameter search.
|
| 117 |
+
|
| 118 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>XGBoost*</td><td rowspan=1 colspan=1>89.34*</td></tr><tr><td rowspan=1 colspan=1>LightGBM*</td><td rowspan=1 colspan=1>89.28*</td></tr><tr><td rowspan=1 colspan=1>CatBoost*</td><td rowspan=1 colspan=1>85.14*</td></tr><tr><td rowspan=1 colspan=1>AutoInt</td><td rowspan=1 colspan=1>90.24*</td></tr><tr><td rowspan=1 colspan=1>AutoML Tables (2 node hours)**</td><td rowspan=1 colspan=1>94.56**</td></tr><tr><td rowspan=1 colspan=1>AutoML Tables (5 node hours)**</td><td rowspan=1 colspan=1>94.95**</td></tr><tr><td rowspan=1 colspan=1>AutoML Tables (10 node hours)**</td><td rowspan=1 colspan=1>96.67**</td></tr><tr><td rowspan=1 colspan=1>AutoML Tables (30 node hours)**</td><td rowspan=1 colspan=1>96.93**</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>96.99</td></tr></table>
|
| 119 |
+
|
| 120 |
+
Table 3: Performance for poker hand induction dataset. The input-output relationship is deterministic and hand-crafted rules implemented with several lines of code can get $100 \%$ accuracy. Yet, neural networks and decision tree models severely suffer from the imbalanced data and cannot learn the required sorting and ranking operations with the raw input features. The results for comparison models∗ are from (Yang et al., 2018).
|
| 121 |
+
|
| 122 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>Decision tree*</td><td rowspan=1 colspan=1>50.0*</td></tr><tr><td rowspan=1 colspan=1>Multi layer perceptron*</td><td rowspan=1 colspan=1>50.0*</td></tr><tr><td rowspan=1 colspan=1>Deep neural decision tree*</td><td rowspan=1 colspan=1>65.1*</td></tr><tr><td rowspan=1 colspan=1>XGBoost</td><td rowspan=1 colspan=1>71.1</td></tr><tr><td rowspan=1 colspan=1>LightGBM</td><td rowspan=1 colspan=1>70.0</td></tr><tr><td rowspan=1 colspan=1>CatBoost</td><td rowspan=1 colspan=1>66.6</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>99.3</td></tr><tr><td rowspan=1 colspan=1>Rule-based</td><td rowspan=1 colspan=1>100.0</td></tr></table>
|
| 123 |
+
|
| 124 |
+
Tables 2-5 show the performance comparisons. We observe that TabNet outperforms multi-layer perceptrons and the variants of ensemble decision trees on all four datasets. TabNet allocates the learning capacity to salient features, and it yields a more compact model in terms of the number of parameters. When the model size is constrained, we observe the superior performance of TabNet even compared to the decision tree variants. The performance is only slightly worse than the evolutionary sparsification algorithms (Mocanu et al., 2018). Yet, the sparsity learned in TabNet is structured unlike the alternative approaches – i.e. it does not degrade the operational intensity of the model (Wen et al., 2016) and can efficiently utilize modern multi-core processors. Also note that we do not consider any matrix sparsification techniques such as adaptive pruning (Narang et al., 2017) which could further improve the parameter-efficiency.
|
| 125 |
+
|
| 126 |
+
Table 4: Performance for Sarcos robotics arm inverse dynamics dataset. Three TabNet models of different sizes are considered (denoted with -S, -M and -L). The performance of the comparison models∗ are from (Tanno et al., 2018).
|
| 127 |
+
|
| 128 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Test MSE</td><td rowspan=1 colspan=1>Numberof parameters</td></tr><tr><td rowspan=1 colspan=1>Random forest*</td><td rowspan=1 colspan=1>2.39*</td><td rowspan=1 colspan=1>16.7K</td></tr><tr><td rowspan=1 colspan=1>Stochastic decision tree*</td><td rowspan=1 colspan=1>2.11*</td><td rowspan=1 colspan=1>28K</td></tr><tr><td rowspan=1 colspan=1>Multi layer perceptron*</td><td rowspan=1 colspan=1>2.13*</td><td rowspan=1 colspan=1>0.14M</td></tr><tr><td rowspan=1 colspan=1>Adaptive neural tree ensemble*</td><td rowspan=1 colspan=1>1.23*</td><td rowspan=1 colspan=1>0.60M</td></tr><tr><td rowspan=1 colspan=1>Gradientboosted tree*</td><td rowspan=1 colspan=1>1.44*</td><td rowspan=1 colspan=1>0.99M</td></tr><tr><td rowspan=1 colspan=1>TabNet-S</td><td rowspan=1 colspan=1>1.25</td><td rowspan=1 colspan=1>6.3K</td></tr><tr><td rowspan=1 colspan=1>TabNet-M</td><td rowspan=1 colspan=1>0.28</td><td rowspan=1 colspan=1>0.59M</td></tr><tr><td rowspan=1 colspan=1>TabNet-L</td><td rowspan=1 colspan=1>0.14</td><td rowspan=1 colspan=1>1.75M</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 5: Performance on Higgs boson dataset. Two TabNet models of different sizes are considered (denoted with -S and -M). The performance of the comparison models∗ are from (Mocanu et al., 2018). Sparse evolutionary training applies non-structured sparsity integrated into training, yielding low number of parameters. With its compact representation, TabNet, (without any further pruning or extra non-structured sparsity), yields almost similar performance with sparse evolutionary training for the same number of parameters. Gradient boosted tree models are implemented using (Tensorflow, 2019), see Appendix for details.
|
| 131 |
+
|
| 132 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Test accuracy (%)</td><td rowspan=1 colspan=1>Number of parameters</td></tr><tr><td rowspan=1 colspan=1>Sparse evolutionary trained multi layer perceptron*</td><td rowspan=1 colspan=1>78.47*</td><td rowspan=1 colspan=1>81K</td></tr><tr><td rowspan=1 colspan=1>Gradient boosted tree-S</td><td rowspan=1 colspan=1>74.22</td><td rowspan=1 colspan=1>0.12M</td></tr><tr><td rowspan=1 colspan=1>Gradient boosted tree-M</td><td rowspan=1 colspan=1>75.97</td><td rowspan=1 colspan=1>0.69M</td></tr><tr><td rowspan=1 colspan=1>Multi-layer perceptron*</td><td rowspan=1 colspan=1>78.44*</td><td rowspan=1 colspan=1>2.04M</td></tr><tr><td rowspan=1 colspan=1>Gradient boosted tree-L</td><td rowspan=1 colspan=1>76.98</td><td rowspan=1 colspan=1>6.96M</td></tr><tr><td rowspan=1 colspan=1>TabNet-S</td><td rowspan=1 colspan=1>78.25</td><td rowspan=1 colspan=1>81K</td></tr><tr><td rowspan=1 colspan=1>TabNet-M</td><td rowspan=1 colspan=1>78.84</td><td rowspan=1 colspan=1>0.66M</td></tr></table>
|
| 133 |
+
|
| 134 |
+
# 4.2 INTERPRETABILITY
|
| 135 |
+
|
| 136 |
+
The feature selection masks in TabNet can be used to build insights on selected features at each step. Such capability would not be possible for conventional neural networks with fully-connected layers, as each subsequent layer hidden units would jointly process all features without sparsity-controlled selection mechanism. For feature selection masks, if $\mathbf { \bar { M } _ { b , j } } [ \mathbf { i } ] = 0$ , then $j ^ { t h }$ feature of the $b ^ { t h }$ sample should have 0 contribution to the overall decision. If $\mathrm { f } _ { i }$ were a linear function, the coefficient $\mathbf { M _ { b , j } [ i ] }$ would correspond to the feature importance of $\mathbf { f _ { b , j } }$ . Although each decision step employs non-linear processing, their outputs are combined later in a linear way. Our goal is to quantify an aggregate feature importance beyond analysis of each step as well. Combination of the masks at different decisioWe use $\begin{array} { r } { \eta _ { \mathbf { b } } [ \bar { \mathbf { i } } ] = \bar { \sum } _ { c = 1 } ^ { N _ { d } } \mathrm { R e L U } ( \mathbf { d _ { b , c } } [ \bar { \mathbf { i } } ] ) } \end{array}$ t can weigh the relative importance of each step into denote the aggregate decision contribution at $i ^ { t h }$ decision.decision step for the $b ^ { t h }$ sample. Intuitively, $\mathbf { d } _ { \mathbf { b } , \mathbf { c } } [ \mathbf { i } ] < 0$ , then all features at decision step should have 0 contribution to the overall decision and as its value increases, it plays a higher role in the overall linear combination given in Eq. 5. Scaling the decision mask at each decision step with $\eta _ { \mathbf { b } } [ \mathbf { i } ]$ , we propose the aggregate feature importance mask as:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathbf { M _ { a g g - b , j } } = \sum _ { i = 1 } ^ { N _ { s t e p s } } \eta _ { \mathbf { b } } [ \mathbf { i } ] \mathbf { M _ { b , j } } [ \mathbf { i } ] \bigg / \sum _ { j = 1 } ^ { D } \sum _ { i = 1 } ^ { N _ { s t e p s } } \eta _ { \mathbf { b } } [ \mathbf { i } ] \mathbf { M _ { b , j } } [ \mathbf { i } ] .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Normalization is used to ensure $\begin{array} { r } { \sum _ { j = 1 } ^ { D } \mathbf { M _ { a g g - b , j } } = 1 } \end{array}$ for each sample.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 4: Feature importance masks $\mathbf { M } [ \mathbf { i } ]$ (that indicate which features are selected at $i ^ { t h }$ step) and the aggregate feature importance mask $\mathbf { M _ { a g g } }$ showing the global instance-wise feature selection for Syn2 and Syn3 datasets from (Chen et al., 2018). Brighter colors show a higher value. E.g. for Syn2 dataset, only four features $( X _ { 3 } – X _ { 6 } )$ are used.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 5: Feature importance masks $\mathbf { M } [ \mathbf { i } ]$ (that indicate which features are selected at $i ^ { t h }$ step) and the aggregate feature importance mask $\mathbf { M _ { a g g } }$ showing the global instance-wise feature selection for Syn4 and Syn6 datasets from (Chen et al., 2018). Brighter colors show a higher value. E.g. for Syn4 dataset, the chosen features depend on the value of $X _ { 1 1 }$ .
|
| 149 |
+
|
| 150 |
+
Figs. 4 and 5 show the aggregate feature importance masks for the synthetic datasets discussed in Sec. 4.1 (for better illustration here, unlike Sec. 4.1, the models are trained with 10M training samples rather than 10K as we obtain sharper feature selection masks). The ground truth output of the Syn2 dataset only depends on features $X _ { 3 ^ { - } } X _ { 6 }$ , and the ground truth output of the Syn3 dataset only depends on features $X _ { 7 } – X _ { 1 0 }$ . We observe that the aggregate masks are almost all-zero for irrelevant features and they merely focus on relevant ones. For Syn4 dataset, $X _ { 1 1 }$ is the indicator, and the ground truth output depends on either $X _ { 1 } – X _ { 2 }$ or $X _ { 3 ^ { - } } X _ { 6 }$ depending on the value of $X _ { 1 1 }$ . For Syn6 dataset, $X _ { 1 1 }$ is the indicator, and the ground truth output depends on either $X _ { 3 ^ { - } } X _ { 6 }$ or $X _ { 7 } – X _ { 1 0 }$ depending on the value of $X _ { 1 1 }$ . For both, TabNet yields accurate instance-wise feature selection – it uses majority of the weights in two masks to focus on $X _ { 1 1 }$ , and assigns almost all-zero weights to irrelevant features (the ones other than one of the two feature groups based on the value of $X _ { 1 1 , }$ ).
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
Figure 6: (a) Comparison to previous work for the ratio of the feature importance of “Odor” feature to all the features of the top feature for the mushroom edibility prediction (Dua & Graff, 2017) (task: classify whether a mushroom is edible or poisonous). With “Odor” feature only, $> 9 8 . 5 \%$ test accuracy can be obtained, so a high feature importance is expected to be assigned to it, as observed with TabNet. (b) Comparison to previous work for importance ranking of features in the Adult Census Income dataset (Dua & Graff, 2017) (task: distinguish whether a person’s income is above $\$ 50,000$ . (c) Impact of the most important feature on the decision manifold. T-SNE of the decision manifold for Adult Census Income test samples and the impact of the most dominant feature ‘Age’.
|
| 154 |
+
|
| 155 |
+
Fig. 6(a) shows the feature importance score of the top feature obtained with TabNet vs. other explainability techniques from (Ibrahim et al., 2019) for mushroom edibility prediction. Mushroom edibility is a simple pattern recognition problem - TabNet achieves $100 \%$ test accuracy. It is indeed known (Dua & Graff, 2017) that with “Odor” feature only, a model can get $> 9 8 . 5 \%$ test accuracy (Dua & Graff, 2017), so a high feature importance is expected for it, as observed with TabNet. Fig. 6(b) shows the importance ranking of features for TabNet vs. other explainability techniques from (Lundberg et al., 2018) (Nbviewer, 2019) for Adult Census Income prediction. TabNet achieves $8 5 . 7 \%$ test accuracy for this problem. We observe the commonality of the most important features (“Age”, “Capital gain/loss”, “Education number”, “Relationship”) and the least important features (“Native country”, “Race”, “Gender”, “Work class”). For the same problem, Fig. 6(c) shows the impact of the most important feature on the output decision by visualizing the T-SNE of the decision manifold. A clear separation between age groups is observed, underlining the importance of the “Age” feature, as suggested by its high value in the aggregate feature importance mask of TabNet.
|
| 156 |
+
|
| 157 |
+
# 5 CONCLUSIONS
|
| 158 |
+
|
| 159 |
+
We propose TabNet, a novel deep learning architecture for tabular learning. TabNet utilizes a sequential attention mechanism to choose a subset of semantically-meaningful features to process at each decision step. The selected features are processed to the representation, that contributes to the overall decision output and sends information to the next decision step. Instance-wise feature selection enables efficient learning as the model capacity is fully used for the most salient features, and also yields more interpretable decision making via visualization of selection masks. We demonstrate that TabNet outperforms previous work across tabular datasets from different domains.
|
| 160 |
+
|
| 161 |
+
REFERENCES
|
| 162 |
+
Dario Amodei, Rishita Anubhai, Eric Battenberg, Carl Case, Jared Casper, et al. Deep speech 2: End-to-end speech recognition in english and mandarin. arXiv:1512.02595, 2015.
|
| 163 |
+
AutoML. AutoML Tables – Google Cloud, 2019. URL https://cloud.google.com/ automl-tables/.
|
| 164 |
+
P. Baldi, P. Sadowski, and D. Whiteson. Searching for exotic particles in high-energy physics with deep learning. Nature Commun., Jul 2014.
|
| 165 |
+
Pierre Baldi. Autoencoders, unsupervised learning, and deep architectures. In Proceedings of ICML Workshop on Unsupervised and Transfer Learning, volume 27 of Proceedings of Machine Learning Research, pp. 37–49, Bellevue, Washington, USA, 02 Jul 2012. PMLR.
|
| 166 |
+
J. Bao, D. Tang, N. Duan, Z. Yan, M. Zhou, and T. Zhao. Text generation from tables. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 27(2):311–320, Feb 2019.
|
| 167 |
+
Yael Ben-Haim and Elad Tom-Tov. A streaming parallel decision tree algorithm. J. Mach. Learn. Res., 11:849–872, March 2010.
|
| 168 |
+
Catboost. Benchmarks. https://github.com/catboost/benchmarks, 2019. Accessed: 2019-11-10.
|
| 169 |
+
Jianbo Chen, Le Song, Martin J. Wainwright, and Michael I. Jordan. Learning to explain: An information-theoretic perspective on model interpretation. arXiv:1802.07814, 2018.
|
| 170 |
+
Tianqi Chen and Carlos Guestrin. XGboost: A scalable tree boosting system. In KDD, 2016.
|
| 171 |
+
C. Chiu, T. N. Sainath, Y. Wu, R. Prabhavalkar, P. Nguyen, et al. State-of-the-art speech recognition with sequence-to-sequence models. In ICASSP, April 2018.
|
| 172 |
+
Michael Chui, James Manyika, Mehdi Miremadi, Nicolaus Henke, Rita Chung, et al. Notes from the ai frontier. McKinsey Global Institute, 4 2018.
|
| 173 |
+
Alexis Conneau, Holger Schwenk, Lo¨ıc Barrault, and Yann LeCun. Very deep convolutional networks for natural language processing. arXiv:1606.01781, 2016.
|
| 174 |
+
Corinna Cortes, Xavi Gonzalvo, Vitaly Kuznetsov, Mehryar Mohri, and Scott Yang. Adanet: Adaptive structural learning of artificial neural networks. arXiv:1607.01097, 2016.
|
| 175 |
+
Zihang Dai, Zhilin Yang, Fan Yang, William W. Cohen, and Ruslan Salakhutdinov. Good semisupervised learning that requires a bad GAN. arxiv:1705.09783, 2017.
|
| 176 |
+
Yann N. Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. arXiv:1612.08083, 2016.
|
| 177 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. arxiv:1810.04805, 2018.
|
| 178 |
+
Dheeru Dua and Casey Graff. UCI Machine Learning Repository, 2017. URL http://archive. ics.uci.edu/ml.
|
| 179 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N. Dauphin. Convolutional sequence to sequence learning. arXiv:1705.03122, 2017.
|
| 180 |
+
Pierre Geurts, Damien Ernst, and Louis Wehenkel. Extremely randomized trees. Machine Learning, 63(1):3–42, Apr 2006. ISSN 1573-0565. doi: 10.1007/s10994-006-6226-1.
|
| 181 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016.
|
| 182 |
+
K. Grabczewski and N. Jankowski. Feature selection with decision tree criterion. In HIS), Nov 2005.
|
| 183 |
+
Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In NIPS 2004, 2004.
|
| 184 |
+
Isabelle Guyon and Andre Elisseeff. An introduction to variable and feature selection. ´ J. Mach. Learn. Res., 3:1157–1182, March 2003.
|
| 185 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv:1512.03385, 2015.
|
| 186 |
+
Tin Kam Ho. The random subspace method for constructing decision forests. IEEE Trans. on PAMI, 20(8):832–844, Aug 1998.
|
| 187 |
+
Elad Hoffer, Itay Hubara, and Daniel Soudry. Train longer, generalize better: closing the generalization gap in large batch training of neural networks. arXiv:1705.08741, 2017.
|
| 188 |
+
Drew A. Hudson and Christopher D. Manning. Compositional attention networks for machine reasoning. arXiv:1803.03067, 2018.
|
| 189 |
+
K. D. Humbird, J. L. Peterson, and R. G. McClarren. Deep neural network initialization with decision trees. IEEE Transactions on Neural Networks and Learning Systems, 2018.
|
| 190 |
+
Mark Ibrahim, Melissa Louie, Ceena Modarres, and John W. Paisley. Global explanations of neural networks: Mapping the landscape of predictions. arXiv:1902.02384, 2019.
|
| 191 |
+
Kaggle. Rossmann store sales. https://www.kaggle.com/c/rossmann-store-sales, 2019a. Accessed: 2019-11-10.
|
| 192 |
+
Kaggle. Historical data science trends on Kaggle. https://www.kaggle.com/shivamb/ data-science-trends-on-kaggle, 2019b. Accessed: 2019-04-20.
|
| 193 |
+
Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, et al. Lightgbm: A highly efficient gradient boosting decision tree. In NIPS. 2017.
|
| 194 |
+
Guolin Ke, Jia Zhang, Zhenhui Xu, Jiang Bian, and Tie-Yan Liu. TabNN: A universal neural network solution for tabular data, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ r1eJssCqY7.
|
| 195 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2014.
|
| 196 |
+
P. Kontschieder, M. Fiterau, A. Criminisi, and S. R. Bulo. Deep neural decision forests. In \` ICCV, 2015.
|
| 197 |
+
Siwei Lai, Liheng Xu, Kang Liu, and Jun Zhao. Recurrent convolutional neural networks for text classification. In AAAI, 2015.
|
| 198 |
+
Tianyu Liu, Kexiang Wang, Lei Sha, Baobao Chang, and Zhifang Sui. Table-to-text generation by structure-aware seq2seq learning. arXiv:1711.09724, 2017.
|
| 199 |
+
Scott M. Lundberg, Gabriel G. Erion, and Su-In Lee. Consistent individualized feature attribution for tree ensembles. arXiv:1802.03888, 2018.
|
| 200 |
+
Chao Ma, Sebastian Tschiatschek, Konstantina Palla, Jose Miguel Hern ´ andez-Lobato, Sebastian ´ Nowozin, and Cheng Zhang. EDDI: efficient dynamic discovery of high-value information with partial VAE. arXiv:1809.11142, 2018.
|
| 201 |
+
Freddie Mac. Loan level dataset. http://www.freddiemac.com/research/datasets/ sf_loanlevel_dataset.page, 2019. Accessed: 2019-3-10.
|
| 202 |
+
Andre F. T. Martins and Ram ´ on Fern ´ andez Astudillo. From softmax to sparsemax: A sparse model ´ of attention and multi-label classification. arXiv:1602.02068, 2016.
|
| 203 |
+
Rory Mitchell, Andrey Adinets, Thejaswi Rao, and Eibe Frank. Xgboost: Scalable GPU accelerated learning. arXiv:1806.11248, 2018.
|
| 204 |
+
Decebal Mocanu, Elena Mocanu, Peter Stone, Phuong Nguyen, Madeleine Gibescu, and Antonio Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature Communications, 9, 12 2018.
|
| 205 |
+
Alex Mott, Daniel Zoran, Mike Chrzanowski, Daan Wierstra, and Danilo J. Rezende. S3TA: A soft, spatial, sequential, top-down attention model, 2019. URL https://openreview.net/ forum?id $_ { \cdot } =$ B1gJOoRcYQ.
|
| 206 |
+
Sharan Narang, Gregory F. Diamos, Shubho Sengupta, and Erich Elsen. Exploring sparsity in recurrent neural networks. arXiv:1704.05119, 2017.
|
| 207 |
+
Nbviewer. Notebook on Nbviewer, 2019. URL https://nbviewer.jupyter.org/ github/dipanjanS/data_science_for_all/blob/master/tds_model interpretation_xai/Human-interpretableMachineLearning-DS.ipynb#.
|
| 208 |
+
N. C. Oza. Online bagging and boosting. In 2005 IEEE International Conference on Systems, Man and Cybernetics, volume 3, pp. 2340–2345 Vol. 3, Oct 2005.
|
| 209 |
+
German Ignacio Parisi, Ronald Kemker, Jose L. Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. arXiv:1802.07569, 2018.
|
| 210 |
+
Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, and Andrey Gulin. Catboost: unbiased boosting with categorical features. In NIPS, pp. 6638–6648. 2018.
|
| 211 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. arXiv:1511.06434, 2015.
|
| 212 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv:1409.1556, 2014.
|
| 213 |
+
Weiping Song, Chence Shi, Zhiping Xiao, Zhijian Duan, Yewen Xu, Ming Zhang, and Jian Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. arxiv:1810.11921, 2018.
|
| 214 |
+
Ryutaro Tanno, Kai Arulkumaran, Daniel C. Alexander, Antonio Criminisi, and Aditya V. Nori. Adaptive neural trees. arXiv:1807.06699, 2018.
|
| 215 |
+
Tensorflow. Classifying higgs boson processes in the higgs data set, 2019. URL https://github. com/tensorflow/models/tree/master/official/boosted_trees.
|
| 216 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, et al. Wavenet: ¨ A generative model for raw audio. arXiv:1609.03499, 2016.
|
| 217 |
+
Sethu Vijayakumar and Stefan Schaal. Locally weighted projection regression: An o(n) algorithm for incremental real time learning in high dimensional space. In ICML, 2000.
|
| 218 |
+
Suhang Wang, Charu Aggarwal, and Huan Liu. Using a random forest to inspire a neural network and improving on it. In SDM, 2017.
|
| 219 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. arXiv:1608.03665, 2016.
|
| 220 |
+
Yongxin Yang, Irene Garcia Morillo, and Timothy M. Hospedales. Deep neural decision trees. arXiv:1806.06988, 2018.
|
| 221 |
+
Jinsung Yoon, James Jordon, and Mihaela van der Schaar. INVASE: Instance-wise variable selection using neural networks. In ICLR, 2019.
|
| 222 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv:1605.07146, 2016.
|
| 223 |
+
Hongyi Zhang, Moustapha Cisse, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical ´ risk minimization. arXiv:1710.09412, 2017.
|
| 224 |
+
|
| 225 |
+
# A SIMPLIFIED DIAGRAM FOR TABNET FEEDFORWARD PASS
|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
Figure 7: Simplified diagram for TabNet feedforward pass for an input with 3 features, assuming $N _ { s t e p s } = 2$ . At the first step, the model selects only the first feature, and applies feature processing on it. At the second step, the model selects the last feature, and applies the feature processing on it. Lastly, the two outputs are combined for the final decision.
|
| 229 |
+
|
| 230 |
+
# B ADDITIONAL RESULTS
|
| 231 |
+
|
| 232 |
+
# B.1 RETAIL DATASET WITH TIME COMPONENT
|
| 233 |
+
|
| 234 |
+
In this section, we show additional results on a real-world tabular data learning problem - Rossmann store sales forecasting (Kaggle, 2019a). This dataset has time-dependent features. Time information is input as day, month, and year columns. We observe that TabNet outperforms alternative methods that are commonly used for such problems.
|
| 235 |
+
|
| 236 |
+
Table 6: Performance for Rossmann store sales dataset (Kaggle, 2019a). We use the exactly same preprocessing and data split with (Catboost, 2019) - data from 2014 is used for training and validation, whereas 2015 is used for testing. The performance of the comparison models∗ are from (Catboost, 2019).
|
| 237 |
+
|
| 238 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>TestMSE</td></tr><tr><td rowspan=1 colspan=1>XGBoost*</td><td rowspan=1 colspan=1>490.83*</td></tr><tr><td rowspan=1 colspan=1>LightGBM*</td><td rowspan=1 colspan=1>504.76*</td></tr><tr><td rowspan=1 colspan=1>CatBoost*</td><td rowspan=1 colspan=1>489.75*</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>485.12</td></tr></table>
|
| 239 |
+
|
| 240 |
+
# B.2 KDD DATASETS
|
| 241 |
+
|
| 242 |
+
Table 7: Performance on three KDD datasets on Customer Relationship Management: Appetency, Churn and Upselling. We apply the similar preprocessing and data partitioning as (Prokhorenkova et al., 2018). The performance of the comparison models∗ are from (Prokhorenkova et al., 2018).
|
| 243 |
+
|
| 244 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Appetency testaccuracy (%)</td><td rowspan=1 colspan=1>Churn testaccuracy (%)</td><td rowspan=1 colspan=1>Upselling testaccuracy (%)</td></tr><tr><td rowspan=1 colspan=1>XGBoost*</td><td rowspan=1 colspan=1>98.2*</td><td rowspan=1 colspan=1>92.7*</td><td rowspan=1 colspan=1>95.1*</td></tr><tr><td rowspan=1 colspan=1>CatBoost*</td><td rowspan=1 colspan=1>98.2*</td><td rowspan=1 colspan=1>92.8*</td><td rowspan=1 colspan=1>95.1*</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>98.2</td><td rowspan=1 colspan=1>92.7</td><td rowspan=1 colspan=1>95.0</td></tr></table>
|
| 245 |
+
|
| 246 |
+
We experiment TabNet on four KDD datasets: the three Customer Relationship Management and Census Income. These datasets show saturated behavior in achievable performance (even simple
|
| 247 |
+
|
| 248 |
+
Table 8: Performance for KDD Census Income (Dua & Graff, 2017). The task is income prediction from demographic and employment related variables. The performance of the comparison models∗ are from (Oza, 2005).
|
| 249 |
+
|
| 250 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>XGBoost</td><td rowspan=1 colspan=1>95.76</td></tr><tr><td rowspan=1 colspan=1>CatBoost</td><td rowspan=1 colspan=1>95.72</td></tr><tr><td rowspan=1 colspan=1>Multi-layer perceptron*</td><td rowspan=1 colspan=1>95.19</td></tr><tr><td rowspan=1 colspan=1>Boosting, Multi-layer perceptron*</td><td rowspan=1 colspan=1>94.86</td></tr><tr><td rowspan=1 colspan=1>Bagging, Multi-layer perceptron*</td><td rowspan=1 colspan=1>95.33</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>95.49</td></tr></table>
|
| 251 |
+
|
| 252 |
+
models yield similar results). For these cases, TabNet shows very similar (or slightly worse) performance than XGBoost and CatBoost, that are known to be very robust as they contain high amount of ensembles.
|
| 253 |
+
|
| 254 |
+
# B.3 LOAN DELINQUENCY PREDICTION
|
| 255 |
+
|
| 256 |
+
Table 9: Performance for loan delinquency prediction on a proprietary dataset, constructed from (Mac, 2019). The task is to classify loan delinquency status (among four categories), from many input features including personal information and financial status. The training dataset consists of $9 3 \mathrm { k }$ samples. The dataset is highly imbalanced as the delinquency situation is observed rarely.
|
| 257 |
+
|
| 258 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Testmean perclassaccuracy</td></tr><tr><td rowspan=1 colspan=1>XGBoost</td><td rowspan=1 colspan=1>0.55</td></tr><tr><td rowspan=1 colspan=1>H2OAutoML (with 15 models)</td><td rowspan=1 colspan=1>0.60</td></tr><tr><td rowspan=1 colspan=1>Multi-layer perceptron</td><td rowspan=1 colspan=1>0.46</td></tr><tr><td rowspan=1 colspan=1>TabNet</td><td rowspan=1 colspan=1>0.86</td></tr></table>
|
| 259 |
+
|
| 260 |
+
We consider TabNet for a real-world problem in financial services industry: loan delinquency prediction. On a proprietary dataset, we demonstrate strong outperformance of TabNet, especially finding rare delinquency cases without any special techniques on anomaly detection.
|
| 261 |
+
|
| 262 |
+
# C EXPERIMENT HYPERPARAMETERS
|
| 263 |
+
|
| 264 |
+
For all datasets, we start hyperparameter tuning with a pre-defined value space. $N _ { d }$ and $N _ { a }$ are chosen from $\{ 8 , 1 6 , 2 4 , 3 2 , 6 4 , 1 2 8 \}$ , $N _ { s t e p s }$ is chosen from $\{ 3 , 4 , 5 , 6 , 7 , 8 , 9 , 1 0 \}$ , $\gamma$ is chosen from $\{ 1 . 0 , 1 . 2 , 1 . 5 , 2 . 0 \}$ , $\lambda _ { s p a r s e }$ is chosen from $\{ 0 , 0 . 0 0 0 0 0 1 , 0 . 0 0 0 1 , 0 . 0 0 1 , 0 . 0 1 , 0 . 1 \}$ , $B$ is chosen from {256, 512, 1024, 2048, 4096, 8192, 16384, 32768}, $B _ { V }$ is chosen from $\{ 2 5 6 , 5 1 2 , 1 0 2 4 , 2 0 4 8 , 4 0 9 6 \}$ and $m _ { B }$ is chosen from $\{ 0 . 6 , 0 . 7 , 0 . 8 , 0 . 9 , 0 . 9 5 , 0 . 9 8 \}$ . If the model size is not under the desired cutoff (e.g. for Table 5 comparisons), we decrease the value to satisfy the model size constraint.
|
| 265 |
+
|
| 266 |
+
# C.1 SYNTHETIC DATASETS
|
| 267 |
+
|
| 268 |
+
All TabNet models use $N _ { d } = N _ { a } = 1 6$ , $B = 3 0 0 0$ , $B _ { V } = 1 0 0$ , $m _ { B } = 0 . 7$ . For Syn1 we use $\lambda _ { s p a r s e } = 0 . 0 2$ , $N _ { s t e p s } = 4$ and $\gamma = 2 . 0$ ; for Syn2 and Syn3 we use $\lambda _ { s p a r s e } = 0 . 0 1$ , $N _ { s t e p s } = 4$ and $\gamma = 2 . 0$ ; and for Syn4, Syn5 and Syn6 we use $\lambda _ { s p a r s e } = 0 . 0 0 5$ , $N _ { s t e p s } = 5$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision step-dependent fully-connected layer, ghost batch normalization and GLU blocks. All models use Adam optimization a learning rate of 0.02 (decayed 0.7 every 200 iterations with an exponential decay) for $4 \mathrm { k \Omega }$ iterations.
|
| 269 |
+
|
| 270 |
+
For visualizations in Section 4.2, we also train TabNet models with datasets of size 10M samples. For this case, we choose $N _ { d } = N _ { a } = 3 2$ , $\lambda _ { s p a r s e } = 0 . 0 0 1$ , $B = 1 0 0 0 0$ , $B _ { V } = 1 0 0$ , $m _ { B } = 0 . 9$ Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 2k iterations with an exponential decay) for 15k iterations. For Syn2 and Syn3, $N _ { s t e p s } = 4$ and $\gamma = 2$ . For Syn4 and Syn6, $N _ { s t e p s } = 5$ and $\gamma = 1 . 5$ .
|
| 271 |
+
|
| 272 |
+
# C.2 FOREST COVER TYPE DATASET
|
| 273 |
+
|
| 274 |
+
We use the exact same partitioning of the train, evaluation and test datasets with (Mitchell et al., 2018) for a fair comparison.
|
| 275 |
+
|
| 276 |
+
TabNet model uses $N _ { d } = N _ { a } = 6 4$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 1$ , $B = 1 6 3 8 4$ , $B _ { V } = 5 1 2$ , $m _ { B } = 0 . 7$ , $N _ { s t e p s } = 5$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.02 (decayed 0.95 every $0 . 5 \mathrm { k }$ iterations with an exponential decay) for $1 3 0 \mathrm { k }$ iterations.
|
| 277 |
+
|
| 278 |
+
# C.3 POKER HANDS DATASET
|
| 279 |
+
|
| 280 |
+
TabNet uses $N _ { d } = 2 4$ , $N _ { a } = 8$ , $\lambda _ { s p a r s e } = 0 . 0 0 1$ , $B = 4 0 9 6$ , $B _ { V } = 2 5 6$ , $m _ { B } = 0 . 8$ , $N _ { s t e p s } = 4$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision step-dependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 10k iterations with an exponential decay) for 71k iterations.
|
| 281 |
+
|
| 282 |
+
# C.4 SARCOS DATASET
|
| 283 |
+
|
| 284 |
+
TabNet-S model uses $N _ { d } = N _ { a } = 8 .$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 1$ , $B = 4 0 9 6$ , $B _ { V } = 2 5 6$ , $m _ { B } = 0 . 9$ , $N _ { s t e p s } = 3$ and $\gamma = 1 . 2$ . Each feature transformer block uses one shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.01 (decayed 0.95 every $^ { 8 \mathrm { k } }$ iterations with an exponential decay) for $6 0 0 \mathrm { k }$ iterations.
|
| 285 |
+
|
| 286 |
+
TabNet-M model uses $N _ { d } = N _ { a } = 6 4$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 1$ , $B = 4 0 9 6$ , $B _ { V } = 1 2 8$ , $m _ { B } = 0 . 8$ , $N _ { s t e p s } = 7$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.01 (decayed 0.95 every 8k iterations with an exponential decay) for $6 0 0 \mathrm { k }$ iterations.
|
| 287 |
+
|
| 288 |
+
The TabNet-L model uses $N _ { d } = N _ { a } = 1 2 8$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 1$ , $B = 4 0 9 6$ , $B _ { V } = 1 2 8$ , $m _ { B } = 0 . 8$ , $N _ { s t e p s } = 5$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every 8k iterations with an exponential decay) for $6 0 0 \mathrm { k }$ iterations.
|
| 289 |
+
|
| 290 |
+
# C.5 HIGGS DATASET
|
| 291 |
+
|
| 292 |
+
TabNet-S model uses $N _ { d } = 2 4$ , $N _ { a } = 2 6$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 0 0 1$ , $B = 1 6 3 8 4$ , $B _ { V } = 5 1 2$ , $m _ { B } = 0 . 6$ , $N _ { s t e p s } = 5$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.02 (decayed 0.9 every $2 0 \mathrm { k }$ iterations with an exponential decay) for 870k iterations.
|
| 293 |
+
|
| 294 |
+
TabNet-M model uses $N _ { d } = 9 6$ , $N _ { a } = 3 2$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 0 0 1$ , $B = 8 1 9 2$ , $B _ { V } = 2 5 6$ , $m _ { B } = 0 . 9$ , $N _ { s t e p s } = 8$ and $\gamma = 2 . 0$ . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.025 (decayed 0.9 every 10k iterations with an exponential decay) for $3 7 0 \mathrm { k }$ iterations.
|
| 295 |
+
|
| 296 |
+
For gradient boosted trees, we use the implementation (Tensorflow, 2019). We choose the learning rate of 0.1 and optimize the maximum depth to 8, based on the performance. The Gradient boosted tree-S model uses 50 trees, the Gradient boosted tree-M model uses 300 trees and the Gradient boosted tree-L model uses 3000 trees.
|
| 297 |
+
|
| 298 |
+
# C.6 MUSHROOM EDIBILITY DATASET
|
| 299 |
+
|
| 300 |
+
TabNet model uses $N _ { d } = N _ { a } = 8$ , $\lambda _ { s p a r s e } = 0 . 0 0 1$ , $B = 2 0 4 8$ , $B _ { V } = 1 2 8$ , $m _ { B } = 0 . 9$ , $N _ { s t e p s } = 3$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision step-dependent
|
| 301 |
+
|
| 302 |
+
fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.01 (decayed 0.8 every 400 iterations with an exponential decay) for 10k iterations.
|
| 303 |
+
|
| 304 |
+
# C.7 ADULT CENSUS INCOME DATASET
|
| 305 |
+
|
| 306 |
+
TabNet model uses $N _ { d } = N _ { a } = 1 6$ , $\lambda _ { s p a r s e } = 0 . 0 0 0 1$ , $B = 4 0 9 6$ , $B _ { V } = 1 2 8$ , $m _ { B } = 0 . 9 8$ , $N _ { s t e p s } = 5$ and $\gamma = 1 . 5$ . Each feature transformer block uses two shared and two decision stepdependent layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.02 (decayed 0.4 every $2 . 5 \mathrm { k }$ iterations with an exponential decay) for $7 . 7 \mathrm { k }$ iterations.
|
| 307 |
+
|
| 308 |
+
When only 40 labeled examples are used instead of the full dataset, based on re-optimization of hyperparameters on the validation set, we modify $B = 1 2 8$ , $\lambda _ { s p a r s e } = 0 . 0 1$ and the learning rate of 0.005 (decayed 0.95 every 10 iterations with an exponential decay) for 100 iterations.
|
| 309 |
+
|
| 310 |
+
# C.8 ROSSMANN DATASET
|
| 311 |
+
|
| 312 |
+
TabNet model uses $N _ { d } = N _ { a } = 3 2$ , $\lambda _ { s p a r s e } = 0 . 0 0 1$ , $B \ = \ 4 0 9 6$ , $B _ { V } ~ = ~ 5 1 2$ , $m _ { B } ~ = ~ 0 . 8$ , $N _ { s t e p s } = 5$ and $\gamma = 1 . 2$ . Each feature transformer block uses two shared and two decision stepdependent fully-connected layer, ghost batch normalization and GLU blocks. Adam optimization is used with a learning rate of 0.002 (decayed 0.95 every 2000 iterations with an exponential decay) for $1 5 \mathrm { k }$ iterations.
|
| 313 |
+
|
| 314 |
+
# D GUIDELINES FOR HYPERPARAMETER SELECTION
|
| 315 |
+
|
| 316 |
+
We consider datasets ranging from $\mathord { \sim } 1 0 \mathrm { K }$ to $\mathord { \sim } 1 0 \mathbf { M }$ training points, with varying degrees of fitting difficulty. TabNet obtains high performance for all with a few general principles on hyperparameter selection:
|
| 317 |
+
|
| 318 |
+
• Most datasets yield the best results for $N _ { s t e p s } \in [ 3 , 1 0 ]$ . Typically, we observe that when there are more information-bearing features, the optimal value of $N _ { s t e p s }$ tends to be higher. On the other hand, increasing it beyond some value may adversely affect training dynamics as some paths in the network becomes deeper and there are more potentially-problematic ill-conditioned matrices. A very high value of $N _ { s t e p s }$ typically suffers from overfitting and yields poor generalization.
|
| 319 |
+
• Adjustment of the values of $N _ { d }$ and $N _ { a }$ is the most efficient way of obtaining a trade-off between performance and complexity. $N _ { d } = N _ { a }$ is a reasonable choice for most datasets. A very high value of $N _ { d }$ and $N _ { a }$ may suffer from overfitting and yield poor generalization.
|
| 320 |
+
• An optimal choice of $\gamma$ can have a major role on the overall performance. Typically a larger $N _ { s t e p s }$ value favors for a larger $\gamma$ .
|
| 321 |
+
• A large batch size is beneficial for performance - if the memory constraints permit, as large as $1 - 1 0 \%$ of the total training dataset size is suggested. The virtual batch size is typically much smaller than the batch size.
|
| 322 |
+
• Initially large learning rate is important, which should be gradually decayed until convergence.
|
| 323 |
+
|
| 324 |
+
When the model size is constrained, the hyperparameter search becomes more complicated. Because the optimal ways to increase the representation capacity may be chosen among different options, such as increasing the number of steps or the unit size. For example, increasing the number of units while slightly decreasing the step size can be a better way of optimal utilization of the limited capacity constrained by the size on the number of parameters.
|
| 325 |
+
|
| 326 |
+
# E ABLATION STUDIES
|
| 327 |
+
|
| 328 |
+
In Table 10, we show the impact of various design and hyperparameter choices. For all cases, the number of iterations is optimized on the validation set.
|
| 329 |
+
|
| 330 |
+
Table 10: Ablation studies for the TabNet model for the forest cover type dataset.
|
| 331 |
+
|
| 332 |
+
<table><tr><td rowspan=1 colspan=1>Ablation cases</td><td rowspan=1 colspan=1>Test accuracy %(difference)</td><td rowspan=1 colspan=1>Number ofparameters</td></tr><tr><td rowspan=1 colspan=1>Base(Nd = Na = 64, γ = 1.5, Nsteps = 5,Xsparse = 0.0o01, feature transformer block composedof two shared and two decision step-dependent layers,B = 16384)</td><td rowspan=1 colspan=1>96.99 (0)</td><td rowspan=1 colspan=1>470k</td></tr><tr><td rowspan=1 colspan=1>Decreasing capacity via number of units (withNd = Na =32)</td><td rowspan=1 colspan=1>94.99 (-2.00)</td><td rowspan=1 colspan=1>129k</td></tr><tr><td rowspan=1 colspan=1>Decreasing capacity via number of decision steps (withNsteps = 3)</td><td rowspan=1 colspan=1>96.22 (-0.77)</td><td rowspan=1 colspan=1>328k</td></tr><tr><td rowspan=1 colspan=1>Increasing capacity via number of decision steps (withNsteps = 9)</td><td rowspan=1 colspan=1>95.48 (-1.51)</td><td rowspan=1 colspan=1>755k</td></tr><tr><td rowspan=1 colspan=1>Decreasing capacity via all-shared feature transformerblocks</td><td rowspan=1 colspan=1>96.74 (-0.25)</td><td rowspan=1 colspan=1>143k</td></tr><tr><td rowspan=1 colspan=1>Increasing capacity via decision step-dependent featuretransformer blocks</td><td rowspan=1 colspan=1>96.76 (-0.23)</td><td rowspan=1 colspan=1>703k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with a single sharedlayer</td><td rowspan=1 colspan=1>95.32 (-1.67)</td><td rowspan=1 colspan=1>35k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with a single sharedlayer, with ReLU instead of GLU</td><td rowspan=1 colspan=1>93.92 (-3.07)</td><td rowspan=1 colspan=1>27k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with two sharedlayers</td><td rowspan=1 colspan=1>96.34 (-0.66)</td><td rowspan=1 colspan=1>71k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with two sharedlayers and 1 decision step-dependent layer</td><td rowspan=1 colspan=1>96.54 (-0.45)</td><td rowspan=1 colspan=1>271k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with a singledecision-step dependent layer</td><td rowspan=1 colspan=1>94.71 (-0.28)</td><td rowspan=1 colspan=1>105k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with a singledecision-step dependent layer,with Nd = Na = 128</td><td rowspan=1 colspan=1>96.24 (-0.75)</td><td rowspan=1 colspan=1>208k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with a singledecision-step dependent layer, with Nd = Na = 128 andreplacing GLU with ReLU</td><td rowspan=1 colspan=1>95.67 (-1.32)</td><td rowspan=1 colspan=1>139k</td></tr><tr><td rowspan=1 colspan=1>Replacing feature transformer block with a singledecision-step dependent layer, with Nd = Na = 256 andreplacing GLU with ReLU</td><td rowspan=1 colspan=1>96.41 (-0.58)</td><td rowspan=1 colspan=1>278k</td></tr><tr><td rowspan=1 colspan=1>Reducing the impact of prior scale (with γy = 3.0)</td><td rowspan=1 colspan=1>96.49 (-0.50)</td><td rowspan=1 colspan=1>470k</td></tr><tr><td rowspan=1 colspan=1>Increasing the impact of prior scale (with γ = 1.0)</td><td rowspan=1 colspan=1>96.67 (-0.32)</td><td rowspan=1 colspan=1>470k</td></tr><tr><td rowspan=1 colspan=1>No sparsity regularization (with Xsparse= 0)</td><td rowspan=1 colspan=1>96.50 (-0.49)</td><td rowspan=1 colspan=1>470k</td></tr><tr><td rowspan=1 colspan=1>High sparsity regularization (with Xsparse= 0.01)</td><td rowspan=1 colspan=1>93.87 (-3.12)</td><td rowspan=1 colspan=1>470k</td></tr><tr><td rowspan=1 colspan=1>Small batch size (B = 4096)</td><td rowspan=1 colspan=1>96.42 (-0.57)</td><td rowspan=1 colspan=1>470k</td></tr></table>
|
| 333 |
+
|
| 334 |
+
Obtaining high performance necessitates appropriately-adjusted model capacity based on the characteristics of the dataset. Decreasing the number of units $N _ { d }$ , $N _ { a }$ or the number of decision steps $N _ { s t e p s }$ are efficient ways of gradually decreasing the capacity without significant degradation in performance. On the other hand, increasing these parameters beyond some value causes optimization issues and do not yield performance benefits.
|
| 335 |
+
|
| 336 |
+
Replacing the feature transformer block with a very simpler alternative, such as a single shared layer, can still give strong performance while yielding a very compact model architecture. This shows the importance of the inductive bias introduced with feature selection and sequential attention.
|
| 337 |
+
|
| 338 |
+
To push for the performance further, increasing the depth of the feature transformer is the effective approach. While increasing the depth, parameter sharing between feature transformer blocks across different decisions is an efficient way to decrease model size without significant degradation from performance. We indeed observe the benefit of partial parameter sharing, compared to fully decision step-dependent blocks or fully shared blocks. We observe the empirical benefit of GLU, compared to conventional nonlinearities like ReLU.
|
| 339 |
+
|
| 340 |
+
The strength of sparse feature selection depends on the two parameters we introduce: $\gamma$ and $\lambda _ { s p a r s e }$ . We show that optimal choice of these two is important for performance. A $\gamma$ close to 1, or a high $\lambda _ { s p a r s e }$ may yield too tight constraints on the strength of sparsity and may hurt performance. On the other hand, there is still the benefit of a sufficient low $\gamma$ and sufficiently high $\lambda _ { s p a r s e }$ , to aid learning of the model via a favorable inductive bias.
|
| 341 |
+
|
| 342 |
+
Lastly, given the fixed model architecture, we show the benefit of large-batch training, enabled by ghost batch normalization (Hoffer et al., 2017). The optimal batch size for TabNet seems considerably higher than the conventional batch sizes used for other data types, such as images or speech.
|
| 343 |
+
|
| 344 |
+
# F MIXUP TRAINING
|
| 345 |
+
|
| 346 |
+
In (Zhang et al., 2017), mixup training was shown to be beneficial for tabular data learning, on small-scale datasets with simple neural network models comprising fully-connected layers. We experiment mixup training with TabNet and did not observe superior performance compared to standard softmax training. For Covertype dataset, the best mixup model (for mixup parameter $\alpha { = } 0 . 3$ ) yields a test accuracy of $9 6 . 2 8 \%$ , roughly $0 . 7 \%$ lower than softmax training. For Higgs dataset, for the best TabNet-S model, the best mixup model (for mixup parameter $\alpha { = } 0 . 1$ ) yields a test accuracy of $7 8 . 1 1 \%$ , roughly $0 . 1 \%$ lower than softmax training. We hypothesize that linearization of the inputs may cause significant shifts in the input distribution and thus adversely affect the feature selection blocks of TabNet.
|
| 347 |
+
|
| 348 |
+
# G SEMI-SUPERVISED LEARNING
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 8: Decoder architecture to transform the encoded representation into reconstructed tabular data features. Each decision step is composed of a feature transformer block (see Fig. 3), and a fully-connected layer.
|
| 352 |
+
|
| 353 |
+
We explore the capability of TabNet in learning semantically-meaningful representations by integrating it into an autoencoder framework (Baldi, 2012). For this purpose, we propose a simple decoder architecture, shown in Fig. 8. The decoder is composed of a feature transformer block (as given in Fig. 3), followed by a fully-connected layer at each decision step. Different decision steps are summed to output the reconstructed features.
|
| 354 |
+
|
| 355 |
+
We propose an additive reconstruction loss (with a coefficient $\lambda _ { u n s u p . }$ ) between the input features $\mathbf { X }$ and the reconstructed features $\hat { \bf X }$ . The reconstruction loss (computed over unlabeled data batch of size $B _ { U }$ ) is in the form of L2 loss, normalized with the population standard deviation of the ground truth data, and scaled by $\mathbf { S }$ :
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
L _ { u n s u p } ( \hat { \mathbf { X } } , \mathbf { X } ) = \frac { 1 } { B _ { U } \cdot D } \sum _ { b = 1 } ^ { B _ { U } } \sum _ { j = 1 } ^ { D } \left| \frac { ( \hat { \mathbf { X } } _ { \mathbf { b } , \mathbf { j } } - \mathbf { X } _ { \mathbf { b } , \mathbf { j } } ) \cdot \mathbf { S } _ { \mathbf { b } , \mathbf { j } } } { \sqrt { \frac { 1 } { B _ { U } } \sum _ { b = 1 } ^ { B _ { U } } ( \mathbf { X } _ { \mathbf { b } , \mathbf { j } } - \frac { 1 } { B _ { U } } \sum _ { b = 1 } ^ { B _ { U } } \mathbf { X } _ { \mathbf { b } , \mathbf { j } } ) ^ { 2 } } } \right| ^ { 2 }
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Normalization with the input value is observed to be crucial, as the tabular data features may have very different ranges. A straightforward approach in conventional reconstruction loss is scaling with a uniform mask, $\mathbf { S _ { b , j } } = 1 / D$ . As a more promising alternative, we propose that scaling should be based on feature importance values, such that the autoencoder should prioritize learning the representation for features that are the most important for decision making. We use the feature important mask Sb,j = M0agg−b,j/ PDj=1 M0agg−b,j to promote learning for the most salient features. M0a is inferred from the TabNet for the batch of unlabeled training samples, and fixed in the computation of loss to avoid the trivial solutions of fitting the easiest features.
|
| 362 |
+
|
| 363 |
+
For semi-supervised learning experiments, we consider the Adult Census Income dataset. We randomly choose 50 samples as the labeled set. We fix the TabNet model with the aferomentioned hyperparameters. As the original learning hyperparameters overfit very quickly for 50 samples, we reoptimize the learning rate to 0.01 (decayed 0.9 every 100 iterations with an exponential decay) and trained for 800 iterations. For the autoencoder, we also fix the TabNet architecture, and optimize the decoder and learning hyperparameters. We use a decoder architecture with $N _ { d } = N _ { a } = 1 6$ , $B = 1 2 8$ , and $m _ { B } = 0 . 9 8$ . We use an unlabeled batch size of $B _ { U } = 2 0 4 8$ . The model with uniform masking uses $\lambda _ { u n s u p } = 0 . 2$ , $\lambda _ { s p a r s e } = 0 . 0 0 5$ , the number of decoder steps of $N _ { s t e p s } = 6$ and a learning rate of 0.005 (decayed 0.95 every $4 \mathrm { k \Omega }$ iterations with an exponential decay) and trained for $2 0 . 6 \mathrm { k }$ iterations. The model with feature importance mask uses $\lambda _ { u n s u p } = 0 . 1$ , $\lambda _ { s p a r s e } = 0 . 0 0 5$ , the number of decoder steps of $N _ { s t e p s } = 4$ and a learning rate of 0.01 (decayed 0.9 every 10k iterations with an exponential decay) and trained for $6 3 \mathrm { k }$ iterations. Since feature importance masking focuses on reconstructing the most salient features, the learning capacity of the optimal decoder is lower.
|
| 364 |
+
|
| 365 |
+
Table 11: Results for semi-supervised learning for Adult Census Income, along with the supervised learning benchmarks. 50 samples with labels are randomly chosen from the training dataset. We reoptimize the learning hyperparameters on a separate validation set for a fair comparison.
|
| 366 |
+
|
| 367 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>Learning setting</td><td rowspan=1 colspan=1>Test accuracy (%)</td></tr><tr><td rowspan=1 colspan=1>50 labeled</td><td rowspan=1 colspan=1>Fully-supervised</td><td rowspan=1 colspan=1>76.8</td></tr><tr><td rowspan=1 colspan=1>50labeled+26015unlabeled</td><td rowspan=1 colspan=1>Semi-supervised (autoencoder withuniform mask)</td><td rowspan=1 colspan=1>78.9</td></tr><tr><td rowspan=1 colspan=1>50labeled+26015unlabeled</td><td rowspan=1 colspan=1>Semi-supervised (autoencoder withfeature importance mask)</td><td rowspan=1 colspan=1>80.6</td></tr><tr><td rowspan=1 colspan=1>26065labeled</td><td rowspan=1 colspan=1>Fully-supervised</td><td rowspan=1 colspan=1>85.7</td></tr></table>
|
| 368 |
+
|
| 369 |
+
Table 11 shows the semi-supervised learning performance, along with the two supervised learning benchmarks: when trained without additional unlabeled data and when trained after labeling the entire dataset. We observe a significant boost in performance with the contributions from the unlabeled data, closing the gap towards the supervised learning baseline of the entire dataset. Focusing on the most important features in autoencoding helps improving the semi-supervised learning performance.
|
md/train/ByxGkySKwH/ByxGkySKwH.md
ADDED
|
@@ -0,0 +1,472 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS NEURAL NETWORKS THAT PROVABLY KNOW WHEN THEY DON’T KNOW
|
| 2 |
+
|
| 3 |
+
Alexander Meinke University of Tübingen
|
| 4 |
+
|
| 5 |
+
Matthias Hein University of Tübingen
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
It has recently been shown that ReLU networks produce arbitrarily over-confident predictions far away from the training data. Thus, ReLU networks do not know when they don’t know. However, this is a highly important property in safety critical applications. In the context of out-of-distribution detection (OOD) there have been a number of proposals to mitigate this problem but none of them are able to make any mathematical guarantees. In this paper we propose a new approach to OOD which overcomes both problems. Our approach can be used with ReLU networks and provides provably low confidence predictions far away from the training data as well as the first certificates for low confidence predictions in a neighborhood of an out-distribution point. In the experiments we show that stateof-the-art methods fail in this worst-case setting whereas our model can guarantee its performance while retaining state-of-the-art OOD performance.1
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Deep Learning Models are being deployed in a growing number of applications. As these include more and more systems where safety is a concern, it is important to guarantee that deep learning models work as one expects them to. One topic that has received a lot of attention in this area is the problem of adversarial examples, in which a model’s prediction can be changed by introducing a small perturbation to an originally correctly classified sample. Achieving robustness against this type of perturbation is an active field of research. Empirically, adversarial training (Madry et al., 2018) performs well and provably robust models have been developed (Hein & Andriushchenko, 2017; Wong & Kolter, 2018; Raghunathan et al., 2018; Mirman et al., 2018; Cohen et al., 2019).
|
| 14 |
+
|
| 15 |
+
On the other end of the spectrum it is also important to study how deep learning models behave far away from the training samples. A simple property every classifier should satisfy is that far away from the training data, it should yield close to uniform confidence over the classes: it knows when it does not know. However, several cases of high confidence predictions far away from the training data have been reported for neural networks, e.g. fooling images (Nguyen et al., 2015), for out-of-distribution (OOD) images (Hendrycks & Gimpel, 2017a) or in medical diagnosis (Leibig et al., 2017). Moreover, it has been observed that, even on the original task, neural networks often produce overconfident predictions (Guo et al., 2017). Very recently, it has been shown theoretically that the class of ReLU networks (all neural networks which use a piecewise affine activation function), which encompasses almost all standard models, produces predictions with arbitrarily high confidences far away from the training data (Hein et al., 2019). Unfortunately, this statement holds for almost all such networks and thus without a change in the architecture one cannot avoid this phenomenon.
|
| 16 |
+
|
| 17 |
+
Traditionally, the calibration of the confidence of predictions has been considered on the indistribution (Guo et al., 2017; Lakshminarayanan et al., 2017a). However these techniques cannot be used for detection (Leibig et al., 2017). Only recently the detection of OOD inputs (Hendrycks & Gimpel, 2017a) has been tackled. The existing approaches are roughly of two types: first, postprocessing techniques that adjust the estimated confidence (DeVries & Taylor, 2018; Liang et al., 2018) which includes the baseline ODIN. Second, modification of the classifier training by integrating generative models like a VAE or GAN in order to discriminate out-distribution from in-distribution data (Lee et al., 2018a; Wang et al., 2018; Lee et al., 2018b) or approaches which enforce low confidence on OOD inputs during training (Hein et al., 2019; Hendrycks et al., 2019). Worst-case aspects of OOD detection have previously been studied in Nguyen et al. (2015); Schott et al. (2018); Hein et al. (2019); Sehwag et al. (2019), but no robustness guarantees have yet been proposed for this setting. A generalization guarantee for an out-of-distribution detection scheme is provided in Liu et al. (2018). While this is the only guarantee we are aware of, it is quite different from the type of guarantees we present in this paper. In particular, none of those approaches are able to guarantee that neural networks produce low confidence predictions far away from the training data. We prove that our classifier satisfies this requirement even when we use ReLU networks as the classifier model - without loosing performance on either the prediction task on the in-distribution nor the OOD detection performance, see Figure 1 for an illustration. Moreover, our technique allows to give upper bounds on the confidence over a whole neighborhood around a point (worst-case guarantees). We show that most state-of-the-art OOD methods can be fooled by maximizing the confidence in this ball even when starting from uniform noise images, which should be trivial to identify. The central difference from existing OOD-methods is that we have a Bayesian framework for in-and out-distribution, where we model in-and out-distribution separately. In this framework our algorithm for training neural networks follows directly as maximum likelihood estimator which is different from the more ad-hoc methods proposed in the literature. The usage of Gaussian mixture models as the density estimator is then the essential key to get the desired provable guarantees.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Illustration on toy dataset: We show the color-coded confidence in the prediction (yellow indicates high confidence $\mathrm { m a x } _ { y } \hat { p } ( y | x ) \approx 1$ , whereas dark purple regions indicate low confidence $\operatorname* { m a x } _ { y } \hat { p } ( y | x ) \approx 0 . 5 )$ for a normal neural network (left) and our CCU neural network (right). The decision boundary is shown in white which is similar for both models. Our CCU-model retains high-confidence predictions in regions close to the training data, whereas far away from the training the CCU-model outputs close to uniform confidence. In contrast the normal neural network is over-confident everywhere except very close to the decision boundary.
|
| 21 |
+
|
| 22 |
+
# 2 A GENERIC MODEL FOR CLASSIFIERS WITH CERTIFIED LOW CONFIDENCE FAR AWAY FROM THE TRAINING DATA
|
| 23 |
+
|
| 24 |
+
The model which we propose in this paper assumes that samples from an out-distribution are given to us. In image recognition we could either see the set of all images as a sample from the outdistribution (Hendrycks et al., 2019) or consider the agnostic case where we use use uniform noise on $[ 0 , 1 ] ^ { d }$ as a maximally uninformative out-distribution. In both settings one tries to discriminate these out-distribution images from images coming from a particular image recognition task and the task is to get low confidence predictions on the out-distribution images vs. higher confidence on the images from the actual task. From the general model we derive under minimal assumptions a maximum-likelihood approach where one trains both a classifier for the actual task and density estimators for in- and out-distribution jointly. As all of these quantities are coupled in our model for the conditional distribution $p ( y | x )$ we get guarantees by controlling the density estimates far away from the training data. This is a crucial difference to the approaches of Lee et al. (2018a); Wang et al. (2018); Hendrycks et al. (2019) which empirically yield good OOD performance but are not able to certify the detection mechanism.
|
| 25 |
+
|
| 26 |
+
# 2.1 A PROBABILISTIC MODEL FOR IN- AND OUT-DISTRIBUTION DATA
|
| 27 |
+
|
| 28 |
+
We assume that there exists a joint probability distribution $p ( y , x )$ over the in- and out-distribution data, where $y$ are the labels in $\{ 1 , \dots , M \}$ , $M$ is the number of classes, and $x \in \mathbb { R } ^ { d }$ , where $d$ is the input dimension. In the following, we denote the underlying probabilities/densities with $p ( y | x )$ resp.
|
| 29 |
+
|
| 30 |
+
$p ( x )$ and the estimated quantities with ${ \hat { p } } ( y | x )$ and ${ \hat { p } } ( x )$ . We are mainly interested in a discriminative framework, i.e. we want to estimate $p ( y | x )$ which one can represent via the conditional distribution of the in-distribution $p ( \boldsymbol { y } | \boldsymbol { x } , i )$ and out-distribution $p ( y | x , o )$ :
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
p ( y | x ) = p ( y | x , i ) p ( i | x ) + p ( y | x , o ) p ( o | x ) = \frac { p ( y | x , i ) p ( x | i ) p ( i ) + p ( y | x , o ) p ( x | o ) p ( o ) } { p ( x | i ) p ( i ) + p ( x | o ) p ( o ) } .
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
Note that at first it might seem strange to have a conditional distribution $p ( y | x , o )$ for out-distribution data, but until now we have made no assumptions about what in-and out-distribution are. A realistic scenario would be that at test time we are presented with instances $x$ from other classes (outdistribution) for which we expect a close to uniform $p ( y | x , o )$ .
|
| 37 |
+
|
| 38 |
+
Our model for ${ \hat { p } } ( y | x )$ has the same form as $p ( y | x )$
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\hat { p } ( y | x ) = \frac { \hat { p } ( y | x , i ) \hat { p } ( x | i ) \hat { p } ( i ) + \hat { p } ( y | x , o ) \hat { p } ( x | o ) \hat { p } ( o ) } { \hat { p } ( x | i ) \hat { p } ( i ) + \hat { p } ( x | o ) \hat { p } ( o ) } .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
Typically, out-distribution data has no relation to the actual task and thus we would like to have uniform confidence over the classes. Therefore we set in our model
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\hat { p } ( y | x , o ) = \frac { 1 } { M } \quad \mathrm { ~ a n d ~ } \quad \hat { p } ( y | x , i ) = \frac { e ^ { f _ { y } ( x ) } } { \sum _ { k = 1 } ^ { M } e ^ { f _ { k } ( x ) } } , \quad y \in \{ 1 , \dots M \} ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $f : \mathbb { R } ^ { d } \to \mathbb { R } ^ { M }$ is the classifier function (logits). This framework is generic for classifiers trained with the cross-entropy (CE) loss (as the softmax function is the correct link function for the CE loss) and we focus in particular on neural networks. For a ReLU network the classifier function $f$ is componentwise a continuous piecewise affine function and has been shown to produce asymptotically arbitrarily highly confident predictions (Hein et al., 2019), i.e. the classifier gets more confident in its predictions the further it moves away from its training data. One of the main goals of our proposal is to fix this behavior of neural networks in a provable way.
|
| 51 |
+
|
| 52 |
+
Note that with the choice of ${ \hat { p } } ( y | x , o )$ and non-zero priors for $\hat { p } ( i ) , \hat { p } ( o )$ , the full model ${ \hat { p } } ( y | x )$ can be seen as a calibrated version of ${ \hat { p } } ( y | x , i )$ , where $\hat { p } ( y | x ) \approx \hat { p } ( y | x , i )$ for inputs with ${ \hat { p } } ( x | i ) \gg { \hat { p } } ( x | o )$ and $\begin{array} { r } { \hat { p } ( y | x ) \approx \frac { 1 } { M } } \end{array}$ if $\hat { p } ( x | i ) \ll \hat { p } ( x | o )$ . However, note that only the confidence in the prediction ${ \hat { p } } ( y | x )$ is affected, the classifier decision is still done according to ${ \hat { p } } ( y | x , i )$ as the calibration does not change the ranking. Thus even if the OOD data came from the classification task we would like to solve, the trained classifier’s performance would be unaffected, only the confidence in the prediction would be damped.
|
| 53 |
+
|
| 54 |
+
For the marginal out-distribution ${ \hat { p } } ( x | o )$ there are two possible scenarios. In the first case one could concentrate on the worst case where we assume that $p ( x | o )$ is maximally uniformative (maximal entropy). This means that ${ \hat { p } } ( x | o )$ is uniform for bounded domains e.g. for images which are in $[ 0 , 1 ] ^ { \hat { d } }$ , ${ \hat { p } } ( x | o ) = 1$ for all $x \in [ 0 , 1 ] ^ { d }$ , or ${ \hat { p } } ( x | o )$ is a Gaussian for the domain of $\bar { \mathbb { R } } ^ { d }$ (the Gaussian has maximum entropy among all distributions of fixed variance). However, in this work we follow the approach of Hendrycks et al. (2019) where they used the 80 million tiny image dataset (Torralba et al., 2008) as a proxy of all possible images. Thus we estimate the density of ${ \hat { p } } ( x | o )$ using this data.
|
| 55 |
+
|
| 56 |
+
In order to get guarantees, the employed generative models for ${ \hat { p } } ( x | i )$ and ${ \hat { p } } ( x | o )$ have to be chosen in a way that allows one to control predictions far away from the training data. Variational autoencoders (VAEs) (Kingma & Welling, 2014; Rezende et al., 2014), normalizing flows (Dinh et al., 2016; Kingma & Dhariwal, 2018) and generative adversarial networks (GANs) (Goodfellow et al., 2014) are powerful generative models. However, there is no direct way to control the likelihood far away from the training data. Moreover, it has recently been discovered that VAEs, flows and GANs also suffer from overconfident likelihoods (Nalisnick et al., 2019; Hendrycks et al., 2019) far away from the data they are supposed to model as well as adversarial samples (Kos et al., 2017).
|
| 57 |
+
|
| 58 |
+
For ${ \hat { p } } ( x | o )$ and ${ \hat { p } } ( x | i )$ we use a Gaussian mixture model (GMM) which is less powerful than a VAE but has the advantage that the density estimates can be controlled far away from the training data:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\hat { p } ( x | i ) = \sum _ { k = 0 } ^ { K _ { i } } \alpha _ { k } \exp \left( - \frac { d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) , \qquad \hat { p } ( x | o ) = \sum _ { l = 0 } ^ { K _ { o } } \beta _ { l } \exp \left( - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right)
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $K _ { i } , K _ { o } \in \mathbb { N }$ are the number of centroids and $d : \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } \mathbb { R }$ is the metric
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
d ( x , y ) = \left. C ^ { - \frac { 1 } { 2 } } ( x - y ) \right. _ { 2 } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
with $C$ being a positive definite matrix and
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\alpha _ { k } = \frac { 1 } { K _ { i } } \frac { 1 } { ( 2 \pi \sigma _ { k } ^ { 2 } \operatorname * { d e t } C ) ^ { \frac { d } { 2 } } } , \quad \beta _ { l } = \frac { 1 } { K _ { o } } \frac { 1 } { ( 2 \pi \theta _ { l } ^ { 2 } \operatorname * { d e t } C ) ^ { \frac { d } { 2 } } } .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
We later fix $C$ as a slightly modified covariance matrix of the in-distribution data (see Section 4 for details). Thus one just has to estimate the centroids $\mu _ { k } , \nu _ { l }$ and the variances $\sigma _ { k } ^ { 2 } , \theta _ { l } ^ { 2 }$ . The idea of this metric is to use distances adapted to the data-distribution. Note that equation 4 is a properly normalized density in $\mathbb { R } ^ { d }$ .
|
| 77 |
+
|
| 78 |
+
# 2.2 MAXIMUM LIKELIHOOD ESTIMATION
|
| 79 |
+
|
| 80 |
+
Given models for ${ \hat { p } } ( y | x )$ and ${ \hat { p } } ( x )$ we effectively have a full generative model and apply maximum likelihood estimation to get the underlying classifier ${ \hat { p } } ( y | x , i )$ and the parameters of the Gaussian mixture models $\hat { p } ( x | i ) , \hat { p } ( x | o )$ . The only free parameter left is the probability $\hat { p } ( i ) , \hat { p } ( o )$ which we write compactly as $\begin{array} { r } { \lambda = \frac { \hat { p } ( o ) } { \hat { p } ( i ) } } \end{array}$ . In principle this parameter should be set considering the potential cost of over-confident predictions. In our experiments we simply fix it to $\lambda = 1$ .
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r l } & { \qquad \underset { ( x , y ) \sim p ( x , y ) } { \mathbb { E } } \log \Big ( \hat { p } ( y , x ) \Big ) = \underset { ( x , y ) \sim p ( x , y ) } { \mathbb { E } } \log \big ( \hat { p } ( y | x ) \big ) + \log ( \hat { p } ( x ) ) , } \\ & { \qquad = \underset { ( x , y ) \sim p ( x , y ) } { \mathbb { E } } \log \Big ( \frac { \hat { p } ( y | x , i ) \hat { p } ( x | i ) \hat { p } ( i ) + \frac { 1 } { M } \hat { p } ( x | o ) \hat { p } ( o ) } { \hat { p } ( x | i ) \hat { p } ( i ) + \hat { p } ( x | o ) \hat { p } ( o ) } \Big ) + \log \big ( \hat { p } ( x | i ) \hat { p } ( i ) + \hat { p } ( x | o ) \hat { p } ( o ) \big ) . } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
In practice, we have to compute empirical expectations from finite training data from the indistribution $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { n _ { i } }$ and out-distribution $( z _ { j } ) _ { j = 1 } ^ { \bar { n } _ { o } }$ . Labels for the out-distribution could be generated randomly via $\textstyle p ( y | x , o ) = { \frac { 1 } { M } }$ , but we obtain an unbiased estimator with lower variance by averaging over all classes directly, as was done in Lee et al. (2018a); Hein et al. (2019); Hendrycks et al. (2019). Now we can estimate the classifier $f$ and the mixture model parameters $\mu , \nu , \sigma , \theta$ via
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { c l } { \displaystyle \underset { f , \mu , \nu , \sigma , \theta } { \arg \operatorname* { m a x } } \left\{ \frac { 1 } { n _ { i } } \sum _ { i = 1 } ^ { n _ { i } } \log \left( \hat { p } ( y _ { i } | x _ { i } ) \right) + \frac { \lambda } { n _ { o } } \sum _ { j = 1 } ^ { n _ { o } } \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \log \left( \hat { p } ( m | z _ { j } ) \right) \right. } \\ { \displaystyle \left. + \frac { 1 } { n _ { i } } \sum _ { i = 1 } ^ { n _ { i } } \log ( \hat { p } ( x _ { i } ) ) + \frac { \lambda } { n _ { o } } \sum _ { j = 1 } ^ { n _ { o } } \log ( \hat { p } ( z _ { j } ) ) \right\} , } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
with
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\hat { p } ( y | x ) = \frac { \hat { p } ( y | x , i ) \hat { p } ( x | i ) + \frac { \lambda } { M } \hat { p } ( x | o ) } { \hat { p } ( x | i ) + \lambda \hat { p } ( x | o ) } \quad \mathrm { ~ a n d ~ } \quad \hat { p } ( x ) = \frac { 1 } { \lambda + 1 } \Big ( \hat { p } ( x | i ) + \lambda \hat { p } ( x | o ) \Big ) .
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Due to the bounds derived in Section 3, we denote our method by Certified Certain Uncertainty (CCU). Note that if one uses a standard neural network model with softmax, i.e. $\begin{array} { r } { \hat { p } ( y | x ) = \hat { p } ( y | x , i ) = \frac { e ^ { f _ { y } ( x ) } } { \sum _ { m = 1 } ^ { M } e ^ { f _ { m } ( x ) } } } \end{array}$ efy(x)PMm=1 efm(x) , then the first term in equation 6 would be the cross-entropy loss for the in-distribution data and the second term the cross entropy loss for the out-distribution data with a uniform distribution over the classes. For this choice of ${ \hat { p } } ( y | x )$ and neglecting the terms for ${ \hat { p } } ( x )$ we recover the approach of Hein et al. (2019); Hendrycks et al. (2019) for training a classifier which outputs uniform confidence predictions on out-distribution data where $\begin{array} { r } { \frac { \hat { p } ( i ) } { \hat { p } ( o ) } } \end{array}$ corresponds to that regularization parameter $\lambda$ . The key difference in our approach is that $\hat { p } ( y | x ) \neq \hat { p } ( y | x , i )$ and the estimated densities for in- and out distribution ${ \hat { p } } ( x | i )$ and ${ \hat { p } } ( x | o )$ lead to a confidence calibration of ${ \hat { p } } ( y | x )$ , and in turn the fit of the classifier influences the estimation of ${ \hat { p } } ( x | i )$ and ${ \hat { p } } ( x | o )$ . The major advantage of our model is that we can give guarantees on the confidence of the classifier decision far away from the training data.
|
| 99 |
+
|
| 100 |
+
# 3 PROVABLE GUARANTEES FOR CLOSE TO UNIFORM PREDICTIONS FAR AWAY FROM THE TRAINING DATA
|
| 101 |
+
|
| 102 |
+
In this section we provide two types of guarantees on the confidence of a classifier trained according to our model in equation 6. The first one says that the classifier has provably low confidence far away from the training data, where an explicit bound on the minimal distance is provided, and the second provides an upper bound on the confidence in a ball around a given input point. The latter bound resembles robustness guarantees for adversarial samples (Hein & Andriushchenko, 2017; Wong & Kolter, 2018; Raghunathan et al., 2018; Mirman et al., 2018) and is quite different from the purely empirical evaluation done in OOD detection papers as we show in Section 4.
|
| 103 |
+
|
| 104 |
+
We provide our bounds for a more general mixture model which includes our GMM in equation 4 as a special case. To our knowledge, these are the first such bounds for neural networks and thus it is the first modification of a ReLU neural network so that it provably “knows when it does not know” (Hein et al., 2019) in the sense that far away from the training data the predictions are close to uniform over the classes.
|
| 105 |
+
|
| 106 |
+
Theorem 3.1. Let $( x _ { i } ^ { ( i ) } , y _ { i } ^ { ( i ) } ) _ { i = 1 } ^ { n }$ be the training set of the in-distribution and let the model for the conditional probability be given as
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\forall x \in \mathbb { R } ^ { d } , y \in \{ 1 , \dots , M \} , \qquad { \hat { p } } ( y | x ) = { \frac { { \hat { p } } ( y | x , i ) { \hat { p } } ( x | i ) + { \frac { \lambda } { M } } { \hat { p } } ( x | o ) } { { \hat { p } } ( x | i ) + \lambda { \hat { p } } ( x | o ) } } ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\begin{array} { r } { \lambda = \frac { \hat { p } ( o ) } { \hat { p } ( i ) } > 0 } \end{array}$ and let the model for the marginal density of the in-distribution ${ \hat { p } } ( x | i )$ and out-distribution $p ( x | o )$ be given by the generalized GMMs
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\hat { p } ( x | i ) = \sum _ { k = 0 } ^ { K _ { i } } \alpha _ { k } \exp \left( - \frac { d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) , \qquad \hat { p } ( x | o ) = \sum _ { l = 0 } ^ { K _ { o } } \beta _ { l } \exp \left( - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right)
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
with $\alpha _ { k } , \beta _ { l } ~ > ~ 0$ and $\mu _ { k } , \nu _ { l } \ \in \ \mathbb { R } ^ { d } \quad \forall k \ = \ 1 , \dots K _ { i }$ , $l = 1 , \ldots , K _ { o }$ and $d : \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } $ $\mathbb { R } _ { + }$ a metric. Let $z ~ \in ~ \mathbb { R } ^ { d }$ and define k∗ = arg min d(z,µk)σ , i∗ = arg min d(z, xi), $\begin{array} { r } { l ^ { * } = \underset { l = 1 , \ldots , K _ { o } } { \arg \operatorname* { m a x } } \beta _ { l } \exp \left( - \frac { d ( z , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right) } \end{array}$ and $\begin{array} { r } { \Delta = \frac { \theta _ { l ^ { * } } ^ { 2 } } { \sigma _ { k ^ { * } } ^ { 2 } } - 1 } \end{array}$ . For any $\epsilon > 0$ , $i f \operatorname* { m i n } _ { l } \theta _ { l } > \operatorname* { m a x } _ { k } \sigma _ { k }$ and
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\operatorname* { m i n } _ { i = 1 , \ldots , n } d ( z , x _ { i } ) \geq d ( x _ { i } * , \mu _ { k ^ { * } } ) + d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) \Big [ \frac { 2 } { \Delta } + \frac { 1 } { \sqrt { \Delta } } \Big ] + \theta _ { l ^ { * } } \sqrt { \frac { 2 } { \Delta } \log \Big ( \frac { M - 1 } { \epsilon \lambda } \frac { \sum _ { k } \alpha _ { k } } { \beta _ { l ^ { * } } } \Big ) } ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
then it holds for all $m \in \{ 1 , \ldots , M \}$ that
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\hat { p } ( m | z ) \leq \frac { 1 } { M } \big ( 1 + \epsilon \big ) .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
In particular, $i f \operatorname* { m i n } _ { i } d ( z , x _ { i } ) \to \infty$ , then $\begin{array} { r } { \hat { p } ( m | z ) \to \frac { 1 } { M } } \end{array}$ .
|
| 131 |
+
|
| 132 |
+
The proof is given in Appendix A. Theorem 3.1 holds for any multi-class classifier which defines for each input a probability distribution over the labels. Given the parameters of the GMM’s it quantifies at which distance of an input $z$ to the training set the classifier achieves close to uniform confidence. The theorem holds even if we use ReLU classifiers which in their unmodified form have been shown to produce arbitrarily high confidence far away from the training data Hein et al. (2019). This is a first step towards neural networks which provably know when they don’t know.
|
| 133 |
+
|
| 134 |
+
In the next corollary, we provide an upper bound on the confidence over a ball around a given data point. This allows to give “confidence guarantees” for a whole volume and thus is much stronger than the usual pointwise evaluation of OOD methods.
|
| 135 |
+
|
| 136 |
+
Corollary 3.1. Let $x _ { 0 } \in \mathbb { R } ^ { d }$ and $R > 0$ , then with $\begin{array} { r } { \lambda = \frac { \hat { p } ( o ) } { \hat { p } ( i ) } } \end{array}$ it holds
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l } & { \underset { d ( x , x _ { 0 } ) \leq R } { \operatorname* { m a x } } \ \hat { p } ( y | x ) \leq \frac { 1 } { M } \frac { 1 + M \frac { b } { \lambda } } { 1 + \frac { b } { \lambda } } , } \\ & { b = \frac { \sum _ { k = 1 } ^ { K _ { i } } \alpha _ { k } \exp { \left( - \frac { \operatorname* { m a x } \left\{ d ( x _ { 0 } , \mu _ { k } ) - R , 0 \right\} ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) } } { \sum _ { l = 1 } ^ { K _ { o } } \beta _ { l } \exp { \left( - \frac { \left( d ( x _ { 0 } , \nu _ { l } ) + R \right) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right) } } . } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
The proof is in the Appendix B. We show in Section 4 that even though OOD methods achieve low confidence on noise images, the maximization of the confidence in a ball around a noise point (adversarial noise) yields high confidence predictions for OOD methods, whereas our classifier has provably low confidence, as certified by Corollary 3.1. The failure of OOD methods shows that the certification of entire regions is an important contribution of CCU which goes beyond the purely sampling-based evaluation.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Adversarial Noise: We maximize the confidence of the OOD methods using PGD in the ball around a uniform noise sample (seed images, left) on which CCU is guaranteed by Corollary 3.1 to yield less than $1 . 1 \frac { 1 } { M }$ maximal confidence. For each OOD method we report the image with the highest confidence. Maha and MCD use scores where lower is more confident (indicated by $^ *$ ). If we do not find a sample that has higher confidence/lower score than the median of the in-distribution, we highlight this in boldface. All other OOD methods fail on some dataset, see Table 1 for a quantitative version. ODIN at high temperatures always returns low confidence, so a value of 0.1 is not informative.
|
| 146 |
+
|
| 147 |
+
# 4 EXPERIMENTS
|
| 148 |
+
|
| 149 |
+
We evaluate the worst-case performance of various OOD detection methods within regions for which CCU yields guarantees and by standard OOD on MNIST (LeCun et al., 1998), FashionMNIST (Xiao et al., 2017), SVHN (Netzer et al., 2011), CIFAR10 and CIFAR100 (Krizhevsky & Hinton, 2009). We show that all other OOD methods yield undesired high confidence predictions in the certified low confidence regions of CCU and thus would not detect these inputs as out-distribution. For calibrating hyperparameters resp. training we use for all OOD methods the 80 Million Tiny Images (Torralba et al., 2008) as out-distribution Hendrycks et al. (2019) which yields a fair and realistic comparison.
|
| 150 |
+
|
| 151 |
+
CCU: As the Euclidean metric is known to be a relatively bad distance between two images we instead use the distance $d ( x , y ) = \left\| C ^ { - \frac { 1 } { 2 } } ( x - y ) \right\|$ , where $C$ is generated as follows. We calculate the covariance matrix $C ^ { \prime }$ on augmented in-distribution samples (see C.1). Let $( \lambda _ { i } , u _ { i } ) _ { i = 1 } ^ { d }$ be the eigenvalues/eigenvectors of $C ^ { \prime }$ . Then we set
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
C = \sum _ { i = 1 } ^ { d } \operatorname* { m a x } \{ \lambda _ { i } , 1 0 ^ { - 6 } \operatorname* { m a x } _ { j } \lambda _ { j } \} u _ { i } u _ { i } ^ { T } ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
that is we fix a lower bound on the smallest eigenvalue so that $C$ has full rank. In Hendrycks & Gimpel (2017b) a similar metric has been used for detection of adversarial images. We choose $K _ { i } =$ $K _ { o } = 1 0 0$ as the number of centroids for the GMMs. We initialize the in-GMM on augmented in-data using the EM algorithm with spherical covariance matrices in the transformed space, as in equation 4. For the out-distribution we use a subset of 20000 points for the initialization. While, initially it holds that $\forall k , l : \sigma _ { k } < \theta _ { l }$ , as required in Theorem 3.1, this is not guaranteed during the optimization of equation 6. Thus, we enforce the constraint during training by setting: $\theta _ { l } \mapsto \mathrm { m a x } \{ \theta _ { l } , \bar { 2 } \mathrm { m a x } _ { k } \sigma _ { k } \}$ at every gradient step. Since the “classifier” and “density” terms in equation 6 have very different magnitudes we choose a small learning rate of $1 e - 5$ for the parameters in the GMMs. It is also crucial to not apply weight decay to these parameters. The other hyperparameters are chosen as in the base model below.
|
| 158 |
+
|
| 159 |
+
Benchmarks: For all OOD methods we use LeNet on MNIST and a Resnet18 (for GAN and MCD we use VGG) otherwise. The hyperparameters used during training can be found in Appendix
|
| 160 |
+
|
| 161 |
+
Table 1: Worst-case performance of different OOD methods in neighborhoods around uniform noise points certified by CCU. We report the clean test error (TE) on the in-distribution (GAN and MCD use VGG). The success rate (SR) is the fraction of adversarial noise points for which the confidence/score inside the ball is higher than the median of the in-distribution’s confidence/score. The AUC quantifies detection of adversarial noise versus in-distribution. All values in $\%$ .
|
| 162 |
+
|
| 163 |
+
<table><tr><td></td><td>Base</td><td>MCD</td><td>EDL 0.4</td><td>DE 0.4</td><td>GAN 0.8</td><td>ODIN 0.5</td><td>Maha 0.9</td><td>ACET</td><td>OE 0.7</td><td>CCU</td></tr><tr><td>LSINN TE SR</td><td>AUC</td><td>0.5 0.4 100.0 99.0 1.4 8.6 5.8</td><td>100.0 0.0 5.2</td><td>100.0 7.3 4.9</td><td>43.5 54.4 5.7</td><td>100.0 0.0</td><td>100.0 11.7</td><td>0.6 0.0 100.0</td><td>100.0 35.2</td><td>0.6 0.0 100.0</td></tr><tr><td>LSINII</td><td>TE SR AUC TE</td><td>4.8 100.0 0.0 2.9</td><td>72.5 100.0 47.1 0.0 3.9 3.1</td><td>100.0 0.4</td><td>99.0 39.5 4.2</td><td>4.8 100.0 0.0 2.9</td><td>4.8 100.0 18.8 2.9</td><td>4.8 0.0 100.0 3.2</td><td>5.7 100.0 35.7 4.1</td><td>4.9 0.0 100.0</td></tr><tr><td>NH∧S SR</td><td>AUC</td><td>100.0 73.5 0.0 34.1</td><td>100.0 0.0</td><td>2.4 100.0 0.0</td><td>0.0 100.0</td><td>100.0 0.0</td><td>100.0 0.0</td><td>3.0 96.5</td><td>100.0 0.0</td><td>3.0 0.0 100.0</td></tr><tr><td>CTTIIIIEITITIT</td><td>TE SR AUC</td><td>5.6 11.7 100.0 90.5 0.0 23.9</td><td>7.0 100.0 0.0</td><td>6.7 100.0 0.0</td><td>11.7 100.0 25.3</td><td>5.6 100.0 0.0</td><td>5.6 100.0 0.0</td><td>6.1 0.0 99.9</td><td>4.7 100.0 0.0</td><td>5.8 0.0 100.0</td></tr><tr><td></td><td>TE SR AUC</td><td>23.3 45.3 100.0 100.0 0.1</td><td>31.1 100.0 17.3 0.0</td><td>27.5 100.0 0.2</td><td>43.8 89.5 15.3</td><td>23.3 100.0 0.0</td><td>23.2 100.0 0.0</td><td>25.2 3.5 95.8</td><td>24.7 100.0 2.5</td><td>25.9 0.0 100.0</td></tr></table>
|
| 164 |
+
|
| 165 |
+
C. The AUC (area under ROC) is computed by treating in-distribution versus out-distribution as a two-class problem using the confidence/score of the method as criterion. Alternatively one could report the AUPR (area under precision-recall curve) which we do in Appendix G. MCD: MonteCarlo Dropout (Gal & Ghahramani, 2016) uses dropout at train and at test time. Since it is not clear where to put the dropout layers in a ResNet, we use VGG instead. We take the softmax from 7 forward passes (Shafaei et al., 2018) and use the mean of the output for prediction and the variance as score. EDL: Evidential deep learning (Sensoy et al., 2018) replaces the softmax layer of a neural network and introduces a different loss function that encourages better uncertainty estimates. $\pmb { D } \pmb { E }$ : Deep ensembles (Lakshminarayanan et al., 2017b) average the softmax outputs of five models that were adversarially trained via FGSM (Goodfellow et al., 2015) with step size $\epsilon = 0 . 0 1$ . $\mathbf { G } A N .$ : The framework of confidence-calibrated classifiers (Lee et al., 2017) relies on training a GAN alongside a classifier such that the GAN’s generator is encouraged to generate points close to but not on the in-distribution. On these points one then enforces uniform confidence. We used their provided code to train a VGG this way, as we were unable to adapt the method to a ResNet with an acceptable test error (e.g. $\mathrm { T E } < 3 0 \%$ on SVHN). ODIN: ODIN (Liang et al., 2017) consists of two parts: a temperature $T$ by which one rescales the logits before the softmax layer P efk/T and a preprocessing step that applies a single FGSM-step (Goodfellow et al., 2015) of length $\epsilon$ before evaluating the input. The two parameters are calibrated on the out-distribution. Maha: The approach in Lee et al. (2018c) is based on computing a class-conditional Mahalanobis distance in feature space and applying an ODIN-like preprocessing step for each layer. Following Ren et al. (2019) we use a single-layer version of Lee et al. (2018c) on our networks’ penultimate layers because the multi-layer version in the original code does not support gradient-based attacks. $o E$ : Outlier exposure (Hendrycks et al., 2019) enforces uniform confidence on a large out-distribution. We use their provided code to train a model with our chosen architecture. ACET: Adversarial confidence enhanced training (ACET) (Hein et al., 2019) enforces low confidence on a ball around points from an out-distribution by running adversarial attacks during training. In order to make the comparison with OE more meaningful we use 80M tiny images to draw the seeds rather than smoothed uniform noise as in Hein et al. (2019). We refer to Appendix F for a discussion of the influence of this choice on the results.
|
| 166 |
+
|
| 167 |
+
Some of the above OOD papers optimize their hyperparameters on a validation set for each outdistribution they test on. However, this leads to different classifiers for each out-distribution dataset which seems unrealistic as we want to have good generic OOD performance and not for a particular dataset. Thus we keep the comparison realistic and fair by calibrating the hyperparameters of all methods on a subset of 80M tiny images and then evaluating on the other unseen distributions.
|
| 168 |
+
|
| 169 |
+
Table 2: AUC (in- versus out-distribution detection based on confidence/score) in percent for different OOD methods and datasets (higher is better). OE and CCU have the best OOD performance.
|
| 170 |
+
|
| 171 |
+
<table><tr><td></td><td></td><td>Base MCD</td><td>EDL</td><td>DE</td><td>GAN</td><td>ODIN</td><td>Maha</td><td>ACET</td><td>OE</td><td>CCU</td></tr><tr><td>LSINN</td><td>FMNIST EMNIST GrCIFAR10 Noise Uniform</td><td>97.4 89.2 99.7 100.0 95.2</td><td>93.1 82.0 94.7 95.2 87.9</td><td>99.3 89.0 99.7 99.9 99.9</td><td>99.2 92.1 100.0 100.0 97.9</td><td>99.4 92.8 99.1 99.3 99.9</td><td>98.7 88.9 99.9 100.0 98.2</td><td>96.8 91.6 98.7 97.2 100.0</td><td>100.0 95.0 100.0 100.0 100.0 100.0 100.0 100.0</td><td>99.9 99.9 95.8 92.0 100.0 100.0 100.0</td></tr><tr><td>JSINII</td><td>MNIST EMNIST GrCIFAR10 Noise Uniform</td><td>96.7 97.5 91.0 97.3 96.9</td><td>82.7 87.3 92.3 94.0 93.3 91.9</td><td>94.5 95.6 84.0 95.6 95.6</td><td>96.7 97.1 86.1 97.4 98.3</td><td>99.9 99.9 85.3 98.9 93.2</td><td>99.0 99.3 93.0 98.9 98.8</td><td>96.7 97.5 98.2 98.9 99.1</td><td>96.4 97.6 96.2 97.8 100.0</td><td>96.3 97.8 99.3 99.5 100.0 100.0 100.0 100.0 97.6 100.0</td></tr><tr><td>NH∧S</td><td>CIFAR10 CIFAR100 LSUN_CR Imagenet- Noise Uniform</td><td>95.4 94.5 95.6 94.7 96.4 96.8</td><td>91.4 92.0 91.8 93.1 93.1</td><td>95.9 95.6 95.3 95.7 97.1 96.5</td><td>97.9 96.8 97.6 96.1 97.9 99.0 97.7 97.8 98.2 96.2 95.6 100.0</td><td>97.9</td><td>95.9 97.1 94.8 96.7 96.5 97.2 95.1 96.8 82.7 98.0 97.8</td><td>95.2 94.8 97.1 97.3 95.8 100.0</td><td>100.0 100.0 100.0 100.0 97.8 100.0</td><td>100.0 100.0 100.0 100.0 97.4 100.0</td></tr><tr><td>CITIIII</td><td>SVHN CIFAR100 LSUN_CR Imagenet- Noise Uniform</td><td>95.8 87.3 91.9 87.5 96.5 96.8</td><td>81.9 78.6 81.3 78.4 79.9 81.0</td><td>92.3 87.3 90.8 88.2 88.9 89.9</td><td>90.3 88.2 82.9 92.0 87.7 90.3 96.6</td><td>83.9 89.9 84.0 81.8 73.0</td><td>96.7 87.5 82.8 93.3 88.1 84.1 97.6 94.4 98.8 100.0</td><td>91.5 89.2 100.0</td><td>93.7 98.8 86.9 95.3 91.2 98.6 86.5 94.7 94.8 97.3</td><td>98.2 94.2 98.2 93.3 97.0</td></tr><tr><td>CEIRIII0</td><td>SVHN CIFAR10 LSUN_CR Imagenet- Noise Uniform</td><td>78.8 78.6 81.0 80.8 73.4 93.3</td><td>59.2 58.9 59.4 59.2 58.7 62.0</td><td>80.4 73.3 74.2 76.0 65.9 29.8</td><td>83.2 76.3 81.6 78.2 67.5 36.6</td><td>75.9 69.3 79.8 73.9 73.6 100.0</td><td>81.3 79.5 81.4 81.3 76.8 93.5</td><td>77.5 59.9 79.7 70.8 90.6 94.3</td><td>73.9 77.2 78.0 79.5 62.9 100.0</td><td>98.8 93.5 81.6 95.4 83.8 86.9 99.1</td><td>100.0 94.2 80.2 95.9 81.4 94.6 100.0</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Certified robustness against adversarial noise: We sample uniform noise images as they are obviously out-distribution for all tasks and certify using Corollary 3.1 the largest ball around the uniform noise sample on which CCU attains at most 1.1· uniform confidence, that is $1 . 1 \%$ on CIFAR100 and $1 1 \%$ on all other datasets. We describe how to compute the radius of this ball in Appendix D. In principle it could be possible that the certified balls contain training or test images. In Appendix E we show that this is not the case. We construct adversarial noise samples for all OOD methods by maximizing the confidence/minimizing the score via a PGD attack with 500 steps and 50 random restarts on this ball. Further details of the attack can be found in Appendix C.2. In Table 1 we show the results of running this attack on the different models. We used 200 noise images and we report clean test error on the in-distribution, the success rate (SR) (fraction of adversarial noise points for which the confidence resp. score inside the ball is higher resp. lower than the median of the in-distribution’s confidence/score) and the AUC for the separation of the generated adversarial noise images and the in-distribution based on confidence/score. By construction, see Corollary 3.1, our method provably makes no overconfident predictions but we nevertheless run the attack on CCU as well. We note that only CCU performs perfectly on this task for all datasets - all other OOD methods fail at least on one dataset, most of them on all. We also see that ACET achieves very robust performance which may be expected as it does some kind of adversarial training for OOD detection. Nevertheless, even though they are very rare, high-confidence adversarial noise images for ACET can be found on SVHN, CIFAR10 and CIFAR100 and ACET has no guarantees. We illustrate the generated adversarial noise images for all methods in Figure 2.
|
| 174 |
+
|
| 175 |
+
OOD performance: For each dataset and method we report the AUC for the binary classification problem of discriminating in- and out-distribution based on confidence resp. score. The results are shown in Table 2. The list of datasets we use for OOD detection can be seen in Table 2. LSUN_CR refers to only the classroom class of LSUN and Imagenet- is a subset of 10000 resized Imagenet validation images, that have no overlap with CIFAR10/CIFAR100 classes. The noise dataset was obtained as in Hein et al. (2019) by first shuffling the pixels of the test images in the in-distribution and then smoothing them by a Gaussian filter of uniformly random width, followed by a rescaling so that the images have full range. GrCIFAR10 refers to the images in CIFAR10 being grayscaled and resized to $2 8 \mathbf { x } 2 8$ and Uniform describes images sampled uniformly at random from $[ 0 , \dot { 1 } ] ^ { d }$ . We see that OE and CCU have the best OOD performance. MCD is worse than the base model which confirms the results found in Leibig et al. (2017) that MCD is not useful for OOD. DE outperforms EDL but is not much better than the baseline for CIFAR10 and CIFAR100. The performance of Maha is worse than what has been reported in Lee et al. (2018c) which can have two reasons. We just use their version where one uses the scores only from the last layer and we do not calibrate hyperparameters for each test set separately but just once on the Tiny Image dataset. Especially on CIFAR10 we found that the results depend strongly on the step size. The results of ACET, GAN and ODIN are mixed but clearly outperform the baseline. Comparing Table 1 and Table 2 we see that most models perform well when evaluating on uniform noise but fail when finding the worst case in a small neighborhood around the noise point. Thus we think that such worst-case analysis should become standard in OOD evaluation.
|
| 176 |
+
|
| 177 |
+
# 5 CONCLUSION
|
| 178 |
+
|
| 179 |
+
In Hein et al. (2019) it has recently been shown that ReLU networks produce arbitrarily highly confident predictions far away from the training data, which could only be resolved by a modification of the network architecture. With CCU we present such a modification which explicitly integrates a generative model and provably show that the resulting neural network produces close to uniform predictions far away from the training data. Moreover, CCU is the only OOD method which can guarantee low confidence predictions over a whole volume rather than just pointwise and we show that all other OOD methods fail in this worst-case setting. CCU achieves this without loss in test accuracy or OOD performance. In the future it would be interesting to use more powerful generative models for which one can also guarantee their behavior far away from the training data. This is currently not the case for VAEs and GANs (Nalisnick et al., 2019; Hendrycks et al., 2019).
|
| 180 |
+
|
| 181 |
+
# ACKNOWLEDGMENTS
|
| 182 |
+
|
| 183 |
+
The author acknowledge support from the BMBF through the Tübingen AI Center (FKZ: 01IS18039A) and by the DFG TRR 248, project number 389792660 and the DFG Excellence Cluster “Machine Learning -New Perspectives for Science”, EXC 2064/1, project number 390727645. The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting Alexander Meinke.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
H. H. Bauschke and J. M. Borwein. On projection algorithms for solving convex feasibility problems. SIAM Review, 38:367–426, 1996.
|
| 188 |
+
|
| 189 |
+
Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. arXiv:1902.02918, 2019.
|
| 190 |
+
|
| 191 |
+
T. DeVries and G. W. Taylor. Learning confidence for out-of-distribution detection in neural networks. preprint, arXiv:1802.04865v1, 2018.
|
| 192 |
+
|
| 193 |
+
Laurent Dinh, Jascha Sohl-Dickstein, and Samy Bengio. Density estimation using real nvp. arXiv:1605.08803, 2016.
|
| 194 |
+
|
| 195 |
+
Y. Gal and Z. Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In ICML, 2016.
|
| 196 |
+
|
| 197 |
+
I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 198 |
+
I.J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NeurIPS, 2014.
|
| 199 |
+
C. Guo, G. Pleiss, Y. Sun, and K. Weinberger. On calibration of modern neural networks. In ICML, 2017.
|
| 200 |
+
M. Hein and M. Andriushchenko. Formal guarantees on the robustness of a classifier against adversarial manipulation. In NeurIPS, 2017.
|
| 201 |
+
M. Hein, M. Andriushchenko, and J. Bitterwolf. Why ReLU networks yield high-confidence predictions far away from the training data and how to mitigate the problem. In CVPR, 2019.
|
| 202 |
+
D. Hendrycks and K. Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In ICLR, 2017a.
|
| 203 |
+
D. Hendrycks, M. Mazeika, and T. Dietterich. Deep anomaly detection with outlier exposure. In ICLR, 2019.
|
| 204 |
+
Dan Hendrycks and Kevin Gimpel. Early methods for detecting adversarial images. In ICLR Workshop Track Proceedings, 2017b.
|
| 205 |
+
Dan Hendrycks and Kevin Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. 2017c.
|
| 206 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
|
| 207 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In NeurIPS, pp. 10215–10224, 2018.
|
| 208 |
+
J. Kos, I. Fischer, and D. Song. Adversarial examples for generative models. In ICLR Workshop, 2017.
|
| 209 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 210 |
+
B. Lakshminarayanan, A. Pritzel, and C. Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In NeurIPS, 2017a.
|
| 211 |
+
Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. In NeurIPS, pp. 6402–6413, 2017b.
|
| 212 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, Patrick Haffner, et al. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 213 |
+
K. Lee, H. Lee, K. Lee, and J. Shin. Training confidence-calibrated classifiers for detecting out-ofdistribution samples. In ICLR, 2018a.
|
| 214 |
+
K. Lee, H. Lee, K. Lee, and J. Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In NeurIPS, 2018b.
|
| 215 |
+
Kimin Lee, Honglak Lee, Kibok Lee, and Jinwoo Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. arXiv:1711.09325, 2017.
|
| 216 |
+
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In NeurIPS, pp. 7167–7177, 2018c.
|
| 217 |
+
C. Leibig, V. Allken, M. S. Ayhan, P. Berens, and S. Wahl. Leveraging uncertainty information from deep neural networks for disease detection. Scientific Reports, 7, 2017.
|
| 218 |
+
S. Liang, Y. Li, and R. Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. In ICLR, 2018.
|
| 219 |
+
|
| 220 |
+
Shiyu Liang, Yixuan Li, and R Srikant. Enhancing the reliability of out-of-distribution image detection in neural networks. arXiv:1706.02690, 2017.
|
| 221 |
+
|
| 222 |
+
Si Liu, Risheek Garrepalli, Thomas Dietterich, Alan Fern, and Dan Hendrycks. Open category detection with PAC guarantees. In PMLR, 2018.
|
| 223 |
+
|
| 224 |
+
A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Valdu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 225 |
+
|
| 226 |
+
M. Mirman, T. Gehr, and M. Vechev. Differentiable abstract interpretation for provably robust neural networks. In ICML, 2018.
|
| 227 |
+
|
| 228 |
+
E. Nalisnick, A. Matsukawa, Y. Whye Teh, D. Gorur, and B. Lakshminarayanan. Do deep generative models know what they don’t know? In ICLR, 2019.
|
| 229 |
+
|
| 230 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In AISTATS, 2011.
|
| 231 |
+
|
| 232 |
+
A. Nguyen, J. Yosinski, and J. Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In CVPR, 2015.
|
| 233 |
+
|
| 234 |
+
A. Raghunathan, J. Steinhardt, and P. Liang. Certified defenses against adversarial examples. In ICLR, 2018.
|
| 235 |
+
|
| 236 |
+
Jie Ren, Peter J Liu, Emily Fertig, Jasper Snoek, Ryan Poplin, Mark A DePristo, Joshua V Dillon, and Balaji Lakshminarayanan. Likelihood ratios for out-of-distribution detection. In NeurIPS, 2019.
|
| 237 |
+
|
| 238 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. 2014.
|
| 239 |
+
|
| 240 |
+
L. Schott, J. Rauber, M. Bethge, and W. Brendel. Towards the first adversarially robust neural network model on mnist. preprint, arXiv:1805.09190v3, 2018.
|
| 241 |
+
|
| 242 |
+
Vikash Sehwag, Arjun Nitin Bhagoji, Liwei Song, Chawin Sitawarin, Daniel Cullina, Mung Chiang, and Prateek Mittal. Better the devil you know: An analysis of evasion attacks using out-ofdistribution adversarial examples. preprint, arXiv:1905.01726, 2019.
|
| 243 |
+
|
| 244 |
+
Murat Sensoy, Lance Kaplan, and Melih Kandemir. Evidential deep learning to quantify classification uncertainty. In NeurIPS, pp. 3179–3189, 2018.
|
| 245 |
+
|
| 246 |
+
Alireza Shafaei, Mark Schmidt, and James J Little. Does your model know the digit 6 is not a cat? a less biased evaluation of" outlier" detectors. arXiv:1809.04729, 2018.
|
| 247 |
+
|
| 248 |
+
Antonio Torralba, Rob Fergus, and William T Freeman. 80 million tiny images: A large data set for nonparametric object and scene recognition. IEEE transactions on pattern analysis and machine intelligence, 30(11):1958–1970, 2008.
|
| 249 |
+
|
| 250 |
+
W. Wang, A. Wang, A. Tamar, X. Chen, and P. Abbeel. Safer classification by synthesis. preprint, arXiv:1711.08534v2, 2018.
|
| 251 |
+
|
| 252 |
+
E. Wong and J. Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In ICML, 2018.
|
| 253 |
+
|
| 254 |
+
H. Xiao, K. Rasul, and R. Vollgraf. Fashion-MNIST: a novel image dataset for benchmarking machine learning algorithms. preprint, arXiv:1708.07747, 2017.
|
| 255 |
+
|
| 256 |
+
# A APPENDIX - PROOF OF THEOREM 3.1
|
| 257 |
+
|
| 258 |
+
Theorem 3.1. Let $( x _ { i } , y _ { i } ) _ { i = 1 } ^ { n }$ be the training set of the training distribution. We define the model for the conditional probability over the classes $y \in \{ 1 , \ldots , M \}$ given $x$ as
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\hat { p } ( y | x ) = \frac { \hat { p } ( y | x , i ) \hat { p } ( x | i ) + \frac { \lambda } { M } \hat { p } ( x | o ) } { \hat { p } ( x | i ) + \lambda \hat { p } ( x | o ) } ,
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
where λ = pˆ(o) $\begin{array} { r } { \lambda = \frac { \hat { p } ( o ) } { \hat { p } ( i ) } > 0 } \end{array}$ and $M > 1$ . Further, let the model for the marginal density of the in-distribution ${ \hat { p } } ( x | i )$ and out-distribution $p ( x | o )$ be given by the generalized GMMs
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
\hat { p } ( x | i ) = \sum _ { k = 0 } ^ { K _ { i } } \alpha _ { k } \exp \left( - \frac { d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) , \qquad \hat { p } ( x | o ) = \sum _ { l = 0 } ^ { K _ { o } } \beta _ { l } \exp \left( - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right)
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
with $\alpha _ { k } , \beta _ { l } > 0$ and $\mu _ { k } , \nu _ { l } \in \mathbb { R } ^ { d } \quad \forall k = 1 , . . . K _ { i }$ , $l = 1 , \ldots , K _ { o }$ and $d : \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } \mathbb { R } _ { + }$ a metric. Let $ { \boldsymbol { z } } _ { \mathbf { \lambda } } \in { \mathcal { \mathbf { R } } } ^ { d }$ and define $\begin{array} { r l r l r l } { k ^ { * } } & { { } = } & { \underset { k = 1 , \ldots , K _ { i } } { \arg \operatorname* { m i n } } \frac { d ( z , \mu _ { k } ) } { \sigma _ { k } } , } & { i ^ { * } } & { { } = } & { \underset { i = 1 , \ldots , n } { \arg \operatorname* { m i n } } d ( z , x _ { i } ) , } \end{array}$ $\operatorname * { a r g m i n } _ { l = 1 , \dots , K _ { o } } \beta _ { l } \exp { \left( - \frac { d ( z , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right) }$ and $\begin{array} { r } { \Delta = \frac { \theta _ { l ^ { * } } ^ { 2 } } { \sigma _ { k ^ { * } } ^ { 2 } } - 1 } \end{array}$ . For any $\epsilon > 0$ , $i f \operatorname* { m i n } _ { l } \theta _ { l } > \operatorname* { m a x } _ { k } \sigma _ { k }$ and
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\operatorname* { m i n } _ { i = 1 , \ldots , n } d ( z , x _ { i } ) \geq d ( x _ { i ^ { * } } , \mu _ { k ^ { * } } ) + d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) \Big [ \frac { 2 } { \Delta } + \frac { 1 } { \sqrt { \Delta } } \Big ] + \theta _ { l ^ { * } } \sqrt { \frac { 2 } { \Delta } \log \Big ( \frac { M - 1 } { \epsilon \lambda } \frac { \sum _ { k } \alpha _ { k } } { \beta _ { l ^ { * } } } \Big ) } ,
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
then it holds for all $m \in \{ 1 , \ldots , M \}$ that
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\hat { p } ( m | z ) \leq \frac { 1 } { M } \big ( 1 + \epsilon \big ) .
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
In particular, $i f \operatorname* { m i n } _ { i } d ( z , x _ { i } ) \to \infty$ , then $\begin{array} { r } { \hat { p } ( m | z ) \to \frac { 1 } { M } } \end{array}$ .
|
| 283 |
+
|
| 284 |
+
Proof. The proof essentially hinges on upper bounding $\frac { { \hat { p } } ( z | i ) } { { \hat { p } } ( z | o ) }$ using the specific properties of the Gaussian mixture model. We note that
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\hat { p } ( y | x ) = \frac { \hat { p } ( y | x , i ) \hat { p } ( x | i ) + \frac { \lambda } { M } \hat { p } ( x | o ) } { \hat { p } ( x | i ) + \lambda \hat { p } ( x | o ) } = \frac { 1 } { M } \frac { 1 + \frac { M } { \lambda } \frac { \hat { p } ( x | i ) } { \hat { p } ( x | o ) } } { 1 + \frac { 1 } { \lambda } \frac { \hat { p } ( x | i ) } { \hat { p } ( x | o ) } } \leq \frac { 1 } { M } \left( 1 + \frac { M - 1 } { \lambda } \frac { \hat { p } ( x | i ) } { \hat { p } ( x | o ) } \right)
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
The last step holds because the function $\begin{array} { r } { g ( \xi ) = \frac { 1 + M \xi } { 1 + \xi } } \end{array}$ is monotonically increasing
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\frac { \partial g } { \partial \xi } = \frac { M - 1 } { ( 1 + \xi ) ^ { 2 } } ~ \mathrm { a n d } ~ \frac { \partial ^ { 2 } g } { \partial \xi ^ { 2 } } = - 2 \frac { M - 1 } { ( 1 + \xi ) ^ { 3 } } .
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
As the second deriviative is negative for $\xi \ge 0$ , $g$ is concave for $\xi \ge 0$ and thus
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\frac { 1 + M \xi } { 1 + \xi } = g ( \xi ) \leq g ( 0 ) + \frac { \partial g } { \partial \xi } \Big | _ { \xi = 0 } ( \xi - 0 ) = 1 + ( M - 1 ) \xi .
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
In order to achieve the required result we need to show that $\begin{array} { r } { \frac { M - 1 } { \lambda } \frac { \hat { p } ( x | i ) } { \hat { p } ( x | o ) } \le \epsilon } \end{array}$ for $x$ sufficiently far away from the training data.
|
| 303 |
+
|
| 304 |
+
We note that
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { r l r } { \frac { \hat { p } ( x | i ) } { \hat { p } ( x | o ) } = \frac { \sum _ { k } \alpha _ { k } \exp { ( - \frac { d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } ) } } { \sum _ { l } \beta _ { l } \exp { ( - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } ) } } \leq \frac { \operatorname* { m a x } _ { k } \exp { ( - \frac { d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } ) } \sum _ { k } \alpha _ { k } } { \operatorname* { m a x } _ { l } \beta _ { l } \exp { ( - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } ) } } } \\ & { } & { = \frac { \sum _ { k } \alpha _ { k } } { \beta _ { l ^ { * } } } \exp { ( - \frac { d ( x , \mu _ { k ^ { * } } ) ^ { 2 } } { 2 \sigma _ { k ^ { * } } ^ { 2 } } + \frac { d ( x , \nu _ { l ^ { * } } ) ^ { 2 } } { 2 \theta _ { l ^ { * } } ^ { 2 } } ) } } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
where k∗ = arg min d(x,µk)22σ2 and $l ^ { * } = \arg \operatorname* { m a x } _ { l } \beta _ { l } \exp ( - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } )$ Using the triangle inequality, $d ( x , \nu _ { l ^ { * } } ) \leq d ( x , \mu _ { k ^ { * } } ) + d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } )$ , we get the desired condition as
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\frac { \sum _ { k } \alpha _ { k } } { \beta _ { l ^ { * } } } \exp \left( - d ( x , \mu _ { k ^ { * } } ) ^ { 2 } \left( \frac { 1 } { 2 \sigma _ { k ^ { * } } ^ { 2 } } - \frac { 1 } { 2 \theta _ { l ^ { * } } ^ { 2 } } \right) + \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) d ( x , \mu _ { k ^ { * } } ) } { \theta _ { l ^ { * } } ^ { 2 } } + \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) ^ { 2 } } { 2 \theta _ { l ^ { * } } ^ { 2 } } \right) \leq \frac { \epsilon \lambda } { M - 1 }
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
Thus we get with a = 12σ2k∗ $\begin{array} { r } { a = \big ( \frac { 1 } { 2 \sigma _ { k ^ { * } } ^ { 2 } } - \frac { 1 } { 2 \theta _ { l ^ { * } } ^ { 2 } } \big ) } \end{array}$ , $\begin{array} { r } { b = \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) } { \theta _ { l ^ { * } } ^ { 2 } } } \end{array}$ and $\begin{array} { r } { c = \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) ^ { 2 } } { 2 \theta _ { l ^ { * } } ^ { 2 } } } \end{array}$ , $\begin{array} { r } { d = \log \left( \frac { \epsilon \lambda } { M - 1 } \frac { \beta _ { l ^ { * } } } { \sum _ { k } \alpha _ { k } } \right) } \end{array}$ , the quadratic inequality
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
- d ( x , \mu _ { k ^ { * } } ) ^ { 2 } a + d ( x , \mu _ { k ^ { * } } ) b + c \leq d ,
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
where $d < 0$ for sufficiently small $\epsilon$ . We get the solution
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
d ( x , \mu _ { k ^ { * } } ) \geq \frac { b } { 2 a } + \sqrt { \operatorname* { m a x } \left\{ 0 , \frac { c - d } { a } + \frac { b ^ { 2 } } { 4 a ^ { 2 } } \right\} } .
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
It holds, using ${ \sqrt { a + b } } \leq { \sqrt { a } } + { \sqrt { b } }$ for $a , b > 0$ ,
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\frac { b } { 2 a } + \sqrt { \operatorname* { m a x } \left\{ 0 , \frac { c - d } { a } + \frac { b ^ { 2 } } { 4 a ^ { 2 } } \right\} } \leq \frac { b } { a } + \sqrt { \frac { c } { a } } + \sqrt { \frac { - d } { a } } .
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
One can simplify
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\begin{array} { r } { \frac { b } { a } = 2 \frac { \sigma _ { k ^ { * } } ^ { 2 } \theta _ { l ^ { * } } ^ { 2 } } { \theta _ { l ^ { * } } ^ { 2 } - \sigma _ { k ^ { * } } ^ { 2 } } \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) } { \theta _ { l ^ { * } } ^ { 2 } } = 2 \frac { \sigma _ { k ^ { * } } ^ { 2 } d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) } { \theta _ { l ^ { * } } ^ { 2 } - \sigma _ { k ^ { * } } ^ { 2 } } = 2 \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) } { \frac { \theta _ { l ^ { * } } ^ { 2 } } { \sigma _ { k ^ { * } } ^ { 2 } } - 1 } } \\ { \frac { c } { a } = 2 \frac { \sigma _ { k ^ { * } } ^ { 2 } \theta _ { l ^ { * } } ^ { 2 } } { \theta _ { l ^ { * } } ^ { 2 } - \sigma _ { k ^ { * } } ^ { 2 } } \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) ^ { 2 } } { 2 \theta _ { l ^ { * } } ^ { 2 } } = \frac { \sigma _ { k ^ { * } } ^ { 2 } d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) ^ { 2 } } { \theta _ { l ^ { * } } ^ { 2 } - \sigma _ { k ^ { * } } ^ { 2 } } = \frac { d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) ^ { 2 } } { \frac { \theta _ { l ^ { * } } ^ { 2 } } { \sigma _ { k ^ { * } } ^ { 2 } } - 1 } } \end{array}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
Noting that $d ( x , \mu _ { k ^ { * } } ) \geq | d ( x , x _ { i ^ { * } } ) - d ( x _ { i ^ { * } } , \mu _ { k ^ { * } } ) |$ we get that
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
d ( x , x _ { i ^ { * } } ) \geq d ( x _ { i ^ { * } } , \mu _ { k ^ { * } } ) + { \frac { b } { a } } + { \sqrt { \frac { c } { a } } } + { \sqrt { \frac { - d } { a } } } ,
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
implies M−1 pˆ(x|i) $\begin{array} { r } { \frac { M - 1 } { \lambda } \frac { \hat { p } ( x | i ) } { \hat { p } ( x | o ) } \le \epsilon } \end{array}$ . The last statement follows directly by noting that by assumption $a > 0$ (independently of the choice of $l ^ { * }$ and $k ^ { * }$ ) and $b , c , d ( x _ { i ^ { * } } , \mu _ { k ^ { * } } )$ are bounded as $K _ { i } , K _ { o } , n$ are finite. With $\begin{array} { r } { \Delta = \frac { \theta _ { l ^ { * } } ^ { 2 } } { \sigma _ { k ^ { * } } ^ { 2 } } - 1 } \end{array}$ we can rewrite the required condition as
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
d ( x , x _ { i ^ { * } } ) \geq d ( x _ { i ^ { * } } , \mu _ { k ^ { * } } ) + d ( \mu _ { k ^ { * } } , \nu _ { l ^ { * } } ) \Big [ \frac { 2 } { \Delta } + \frac { 1 } { \sqrt { \Delta } } \Big ] + \theta _ { l ^ { * } } \sqrt { \frac { 2 } { \Delta } \log \Big ( \frac { M - 1 } { \epsilon \lambda } \frac { \sum _ { k } \alpha _ { k } } { \beta _ { l ^ { * } } } \Big ) } .
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
# B APPENDIX - PROOF OF COROLLARY 3.1
|
| 353 |
+
|
| 354 |
+
Corollary 3.1. Let $x _ { 0 } \in \mathbb { R } ^ { d }$ and $R > 0 ;$ , then with $\begin{array} { r } { \lambda = \frac { \hat { p } ( o ) } { \hat { p } ( i ) } } \end{array}$ it holds
|
| 355 |
+
|
| 356 |
+
where
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\begin{array} { r l r } & { } & { \underset { d ( x , x _ { 0 } ) \leq R } { \operatorname* { m a x } } \ \hat { p } ( y | x ) \leq \frac { 1 } { M } \frac { 1 + M \frac { b } { \lambda } } { 1 + \frac { b } { \lambda } } , } \\ & { } & { \quad \frac { \sum _ { k = 1 } ^ { K _ { i } } \alpha _ { k } \exp { \left( - \frac { \operatorname* { m a x } \left\{ d ( x _ { 0 } , \mu _ { k } ) - R , 0 \right\} ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) } } { \sum _ { l = 1 } ^ { K _ { o } } \beta _ { l } \exp { \left( - \frac { ( d ( x _ { 0 } , \nu _ { l } ) + R ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right) } } . } \end{array}
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
Proof. From the previous section we already know that pˆ(y|x) ≤ 1M 1 as long as $\begin{array} { r } { \frac { p ( x | i ) } { p ( x | o ) } \leq b } \end{array}$ .
|
| 363 |
+
Now we can separately bound the numerator and denominator within a ball of radius $R$ around $x _ { 0 }$ .
|
| 364 |
+
|
| 365 |
+
For the numerator we have
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\begin{array} { r l } { \displaystyle \operatorname* { m a x } _ { d ( x , x _ { 0 } ) \leq R } \hat { p } ( x | i ) \leq \sum _ { k = 1 } ^ { K } \alpha _ { k } \operatorname* { m a x } _ { d ( x , x _ { 0 } ) \leq R } e ^ { - \frac { d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } } } & { } \\ { \leq \sum _ { k = 1 } ^ { K } \alpha _ { k } \exp \left( - \frac { \operatorname* { m i n } _ { \operatorname* { m i n } } d ( x , \mu _ { k } ) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) } & { } \\ { \leq \sum _ { k = 1 } ^ { K } \alpha _ { k } \exp \left( - \frac { \left( \operatorname* { m a x } \left\{ d ( \mu _ { k } , x _ { 0 } ) - R , 0 \right\} \right) ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) , } \end{array}
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
where we have lower bounded $\operatorname* { m i n } _ { d ( x , x _ { 0 } ) \leq R } d ( x , \mu _ { k } )$ via the reverse triangle inequality
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\begin{array} { l l } { \displaystyle \operatorname* { m i n } _ { d ( x , x _ { 0 } ) \leq R } d ( x , \mu _ { k } ) \geq \operatorname* { m i n } _ { d ( x , x _ { 0 } ) \leq R } \lvert d ( x _ { 0 } , \mu _ { k } ) - d ( x , x _ { 0 } ) \rvert , } \\ { \geq \operatorname* { m a x } \left\{ \operatorname* { m i n } _ { d ( x , x _ { 0 } ) \leq R } ( d ( x _ { 0 } , \mu _ { k } ) - d ( x _ { 0 } , \mu _ { k } ) ) , 0 \right\} , } \\ { \geq \operatorname* { m a x } \left\{ d ( x _ { 0 } , \mu _ { k } ) - r , 0 \right\} . } \end{array}
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
The denominator can similarly be bounded via
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { r l r } { { \operatorname* { m i n } _ { d ( x , x _ { 0 } ) \leq R } \hat { p } ( x | o ) \geq \sum _ { l = 1 } ^ { K _ { o } } \beta _ { l } \operatorname* { m i n } _ { d ( x , x _ { 0 } ) \leq R } e ^ { - \frac { d ( x , \nu _ { l } ) ^ { 2 } } { 2 \theta _ { k } ^ { 2 } } } } } \\ & { } & { \geq \sum _ { l = 1 } ^ { K _ { o } } \beta _ { l } \exp ( - \frac { d ( x , x _ { 0 } ) } { 2 \theta _ { l } ^ { 2 } } \Delta \theta _ { l } ^ { 2 } ) } \\ & { } & { \geq \sum _ { l = 1 } ^ { K _ { o } } \beta _ { l } \exp ( - \frac { ( d ( x _ { 0 } , \nu _ { l } ) + R ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } ) . } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
With both of these bounds in place the conclusion immediately follows.
|
| 384 |
+
|
| 385 |
+
# C APPENDIX - EXPERIMENTAL DETAILS
|
| 386 |
+
|
| 387 |
+
Unless specified otherwise we use ADAM on MNIST with a learning rate of $1 e - 3$ and SGD with learning rate 0.1 for the other datasets. The learning rate for the GMM is always set to $1 e - 5$ . We decrease all learning rates by a factor of 10 after 50, 75 and 90 epochs. Our batch size is 128, the total number of epochs 100 and weight decay is set to $5 e - 4$ .
|
| 388 |
+
|
| 389 |
+
When training ACET, OE and CCU with 80 million tiny images we pick equal batches of in- and out-distribution data (corresponding to $p ( i ) = p ( o ) ,$ ) and concatenate them into a batches of size 256. Note that during the 100 epochs only a fraction of the 80 million tiny images are seen and so there is no risk of over-fitting.
|
| 390 |
+
|
| 391 |
+
# C.1 DATA AUGMENTATION
|
| 392 |
+
|
| 393 |
+
Our data augmentation scheme uses random crops with a padding of 2 pixels on MNIST and FMNIST. On SVHN, CIFAR10 and CIFAR100 the padding width is 4 pixels. For SVHN we fill the padding with the value at the boundary and for CIFAR we apply reflection at the boundary pixels. On top of this we include random horizontal flips on CIFAR. For MNIST and FMNIST we generate 60000 such samples and for SVHN and CIFAR 50000 samples by drawing from the clean dataset without replacement. This augmented data is used to calculate the covariance matrix from equation 12. During the actual training we use the same data augmentation scheme in a standard fashion.
|
| 394 |
+
|
| 395 |
+
# C.2 ATTACK DETAILS
|
| 396 |
+
|
| 397 |
+
We begin with a step size of 3 and for each of the 50 restarts we randomly initialize at some point in the ellipsoid. Whenever a gradient step successfully decreases the losses we increase the step size by a factor of 1.1. Whenever the loss increases instead we use backtracking and decrease the step size by a factor of 2. We apply normal PGD using the $l _ { 2 }$ -norm in the transformed space to ensure that we stay on the ellipsoid and after each gradient step we rotate back into the original space to project onto the box $[ 0 , 1 ] ^ { d }$ . The result is not guaranteed be on the ellipsoid so after the 500 steps we use the alternating projection algorithm (Bauschke & Borwein, 1996) for 10 steps which is guaranteed to converge to a point in the intersection of the ellipsoid and the box because both of these sets are convex.
|
| 398 |
+
|
| 399 |
+

|
| 400 |
+
Figure 3: Histograms of bounds: Certified radius in transformed space for different datasets.
|
| 401 |
+
|
| 402 |
+
# D APPENDIX - FINDING A THE CERTIFIABLE RADIUS
|
| 403 |
+
|
| 404 |
+
Since Corollary 3.1 does not explicitly give a radius, one has to numerically invert the bound. The bound
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
b ( R ) = \frac { \sum _ { k = 1 } ^ { K _ { i } } \alpha _ { k } \exp { \left( - \frac { \operatorname* { m a x } \{ d ( x _ { 0 } , \mu _ { k } ) - R , 0 \} ^ { 2 } } { 2 \sigma _ { k } ^ { 2 } } \right) } } { \sum _ { l = 1 } ^ { K _ { o } } \beta _ { l } \exp { \left( - \frac { ( d ( x _ { 0 } , \nu _ { l } ) + R ) ^ { 2 } } { 2 \theta _ { l } ^ { 2 } } \right) } }
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
is monotonically increasing in $R$ . Thus, for a given sample $x _ { 0 }$ one can fix a desired bound $\operatorname* { m a x } _ { d ( x , x _ { 0 } ) \leq R } \hat { p } ( x | i ) \leq \frac { 1 } { M } \nu$ , where $\nu \in ( 1 , M )$ and then find the unique solution
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
b ( R ) = \frac { \nu - 1 } { M - \nu } \lambda
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
for $R$ via bisection. This radius $\hat { R }$ will then represent the maximal radius, that one can certify using Corollary 3.1. The presumption is, of course, that for $R = 0$ one has a sufficiently low bound in the first place, i.e. that a solution exists. In our experiments on uniform noise we did not encounter a single counterexample to this assumption. We show the radii for the different datasets in Figure 3.
|
| 417 |
+
|
| 418 |
+
# E APPENDIX - ANALYSIS OF THE CERTIFIED BALLS AROUND UNIFORM NOISE IMAGES
|
| 419 |
+
|
| 420 |
+
As one can observe in Figure 2 the images which maximize the confidence in the certified ball around the uniform noise image are sometimes quite far away from the original noise image. As CCU certifies low confidence (the maximal confidence is less than $1 . 1 \times { \frac { 1 } { M } }$ - so the predicted probability distribution over the classes is very close to the uniform distribution) over the whole ball, it is a natural question what these balls look like and what kind of images they contain. In particular, it is in general not desired that the certified balls contain images from the training and test set. For each dataset we certified balls around 200 uniform noise images and for each of the certified balls we check if it contains training or test images of the corresponding dataset. We found that even though the certified balls are large, not a single training or test image was contained in any of them. This justifies the use of our proposed threat model.
|
| 421 |
+
|
| 422 |
+
A different problem could be that our threshold of $\textstyle { \frac { 1 . 1 } { M } }$ for the certification is too high and that many predictions on the test set have confidence less than this threshold. For this purpose we report in Table 3 the smallest predicted confidence of CCU on the test set $T$ , that is
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\operatorname* { m i n } _ { x \in T } \operatorname* { m a x } _ { y \in \{ 1 , . . . , M \} } \hat { p } ( y | x ) ,
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
Table 3: Lowest confidence that CCU attains on the test set (in percent) as well as total number of test points on which confidence is lower than our imposed bound of $\textstyle { \frac { 1 . 1 } { M } }$ .
|
| 429 |
+
|
| 430 |
+
<table><tr><td></td><td>min p(ylx) #< 1.1 %< M</td></tr><tr><td>MNIST</td><td>33.08 0</td></tr><tr><td>28.77</td><td>0 0 0</td></tr><tr><td>FMNIST SVHN</td><td></td></tr><tr><td>10.02 20 0.08</td><td></td></tr><tr><td>CIFAR10 10.01 CIFAR100 1.03 130</td><td>529 5.29 1.30</td></tr></table>
|
| 431 |
+
|
| 432 |
+
for each dataset and the total number of test samples where the confidence is below $\textstyle { \frac { 1 . 1 } { M } }$ . While for MNIST and FMNIST, this never happens, and for SVHN this is negligible (less than $0 . \dot { 1 } \%$ of the test set), for CIFAR10 and CIFAR100 this happens in $5 . 3 \%$ resp. $1 . 3 \%$ of the cases.
|
| 433 |
+
|
| 434 |
+
In theory, this could impair our AUC value for the detection of adversarial noise. However, in practice our bound for the confidence is quite conservative as the bound is only tight in very specific configurations of the centroids of the Gaussian mixture model which are unlikely to happen for any practical dataset, meaning that the actual maximal confidence in the certified region is typically significantly lower. In fact the AUC values of CCU are always $1 0 0 \%$ which means that for all 200 certified balls the maximal value of the confidence of CCU in any of these balls (found by our PGD attack algorithm) is lower than the minimal confidence of all predictions on the test set as reported in Table 3. On the other hand assuming here also a worst case scenario in the sense we assume that the upper bound of the maximal confidence is attained in all 200 certified balls, then the (certified) AUC value would be: $9 9 . 9 2 \%$ for SVHN, $9 4 . 7 1 \%$ for CIFAR10, and $9 8 . 7 0 \%$ for CIFAR100. Note that this theoretical lower bound on our performance is still better than all other models’ empirical performance on this task, as reported in Table 1 on both CIFAR10 and CIFAR100, and only marginally below the perfect AUC of GAN on SVHN.
|
| 435 |
+
|
| 436 |
+
# F APPENDIX - PERFORMANCE OF ACET WHEN TRAINED ON ADVERSARIAL UNIFORM NOISE
|
| 437 |
+
|
| 438 |
+
Similar to our CCU, ACET Hein et al. (2019) requires that one chooses a model for the out-distribution in order to generate their “adversarial noise” during training. We trained the ACET model with the same out-distribution model as for all other models namely using the tiny image dataset as suggested in Hendrycks et al. (2019) with a PGD attack that starts at the original point and takes 40 FGSM steps in order to maximize the maximal confidence over the classes. We use backtracking and halve the step size whenever the loss does not increase. However, the authors of Hein et al. (2019) used smoothed uniform noise and a $l _ { \infty }$ -threat model during training. Since our worst case analysis for OOD is based on attacking uniform noise images, this suggests that training ACET with uniform noise should improve the performance of ACET for the worst case analysis. We report below the results of ACET2 (the original model in the paper using tiny images for training is called ACET) based on attacking using uniform noise images during training with a $l _ { \infty }$ -threat model with $\epsilon = 0 . 3$ as suggested in Hein et al. (2019). We report the normal OOD performance in Table 4 and the worst case analysis of adversarial noise in Table 5. While it is not surprising that ACET outperforms ACET2 on the standard OOD detection task in Table 4 as it has seen more realistic “noise” images during training, the worse performance of ACET2 for the worst case analysis in Table 5 is at first sight counter-intuitive. However, note that the threat model of the attacks in our worst case analysis is the Mahalanobis-type $l _ { 2 }$ -type metric, see 12, while ACET2 uses an $l _ { \infty }$ -attack model with $\epsilon = 0 . 3$ during training. As the size of the balls for the Mahalanobis-type $l _ { 2 }$ -type metric is quite large, there is not much overlap between the two sets. This explains why ACET2 fails here. In summary, we have shown that by using tiny images as out-distribution during training, ACET improves in terms of OOD detection performance over ACET2, which is similar to the version suggested in Hein et al. (2019).
|
| 439 |
+
|
| 440 |
+
# G APPENDIX - PRECISION AND RECALL
|
| 441 |
+
|
| 442 |
+
In addition to the AUC presented in Table 2 we follow Hendrycks & Gimpel (2017c) and report the area under the precision/recall curve (AUPR). Precision at a specific threshold is defined as the
|
| 443 |
+
|
| 444 |
+
<table><tr><td>MNIST</td><td>ACET</td><td>ACET2</td></tr><tr><td>FMNIST</td><td>100.0</td><td>99.8</td></tr><tr><td>EMNIST</td><td>95.0</td><td>93.5</td></tr><tr><td>GrCIFAR10</td><td>100.0</td><td>100.0</td></tr><tr><td>Noise</td><td>100.0</td><td>100.0</td></tr><tr><td>Uniform</td><td>100.0</td><td>100.0</td></tr></table>
|
| 445 |
+
|
| 446 |
+
<table><tr><td>FMNIST</td><td>ACET</td><td>ACET2</td></tr><tr><td>MNIST</td><td>96.4</td><td>96.5</td></tr><tr><td>EMNIST</td><td>97.6</td><td>97.3</td></tr><tr><td>GrCIFAR10</td><td>96.2</td><td>91.6</td></tr><tr><td>Noise</td><td>97.8</td><td>97.1</td></tr><tr><td>Uniform</td><td>100.0</td><td>100.0</td></tr></table>
|
| 447 |
+
|
| 448 |
+
<table><tr><td>SVHN</td><td>ACET</td><td>ACET2</td><td>CIFAR10</td><td>ACET</td><td>ACET2</td></tr><tr><td>CIFAR10</td><td>95.2</td><td>94.2</td><td>SVHN</td><td>93.7</td><td>82.8</td></tr><tr><td>CIFAR100</td><td>94.8</td><td>93.7</td><td>CIFAR100</td><td>86.9</td><td>85.3</td></tr><tr><td>LSUN_CR</td><td>97.1</td><td>96.1</td><td>LSUN_CR</td><td>91.2</td><td>88.5</td></tr><tr><td>Imagenet-</td><td>97.3</td><td>95.6</td><td>Imagenet-</td><td>86.5</td><td>84.8</td></tr><tr><td>Noise</td><td>95.2</td><td>95.2</td><td>Noise</td><td>94.8</td><td>91.2</td></tr><tr><td>Uniform</td><td>100.0</td><td>100.0</td><td>Uniform</td><td>100.0</td><td>100.0</td></tr></table>
|
| 449 |
+
|
| 450 |
+
Table 4: OOD detection performance (AUC in percent) for ACET (trained around tiny images) and ACET2 (trained around uniform noise).
|
| 451 |
+
|
| 452 |
+
<table><tr><td>CIFAR100</td><td>ACET</td><td>ACET2</td></tr><tr><td>SVHN</td><td>73.9</td><td>84.6</td></tr><tr><td>CIFAR10</td><td>77.2</td><td>77.0</td></tr><tr><td>LSUN_CR</td><td>78.0</td><td>80.0</td></tr><tr><td>Imagenet-</td><td>79.5</td><td>79.4</td></tr><tr><td>Noise</td><td>62.9</td><td>66.3</td></tr><tr><td>Uniform</td><td>100.0</td><td>100.0</td></tr></table>
|
| 453 |
+
|
| 454 |
+
<table><tr><td colspan="2"></td><td>ACET</td><td>ACET2</td></tr><tr><td rowspan="3">MNIST</td><td>TE</td><td>0.6</td><td>0.6</td></tr><tr><td>SR</td><td>0.0</td><td>0.0</td></tr><tr><td>AUC</td><td>100.0</td><td>100.0</td></tr><tr><td rowspan="3">FMNIST</td><td>TE</td><td>4.8</td><td>4.6</td></tr><tr><td>SR</td><td>0.0</td><td>0.0</td></tr><tr><td>AUC</td><td>100.0</td><td>100.0</td></tr><tr><td rowspan="3">SVHN</td><td>TE SR</td><td>3.2</td><td>3.0</td></tr><tr><td></td><td>3.0</td><td>95.5</td></tr><tr><td>AUC</td><td>96.5</td><td>5.4</td></tr><tr><td rowspan="3">CIFAR10</td><td>TE</td><td>6.1</td><td>7.1</td></tr><tr><td>SR</td><td>0.0</td><td>64.5</td></tr><tr><td>AUC</td><td>99.9</td><td>35.9</td></tr><tr><td rowspan="3">CIFAR100</td><td>TE</td><td>25.2</td><td>26.2</td></tr><tr><td>SR</td><td>3.5</td><td>96.5</td></tr><tr><td>AUC</td><td>95.8</td><td>14.6</td></tr></table>
|
| 455 |
+
|
| 456 |
+
Table 6: AUPR (in- versus out-distribution detection based on confidence/score) in percent for different OOD methods and datasets (higher is better). OE and CCU have the best OOD performance.
|
| 457 |
+
|
| 458 |
+
<table><tr><td colspan="2"></td><td>Base</td><td>MCD</td><td>EDL</td><td>DE</td><td>GAN</td><td>ODIN</td><td>Maha</td><td>ACET</td><td>OE</td><td>CCU</td></tr><tr><td rowspan="4">LSINΛ</td><td>FMNIST</td><td>97.5</td><td>89.4</td><td>99.4 77.3</td><td>99.4 84.5</td><td>99.4 85.5</td><td>98.8 78.4</td><td>97.0 74.4</td><td>100.0 90.9</td><td>99.9 91.4</td><td>99.9 84.3</td></tr><tr><td rowspan="4">EMNIST GrCIFAR10 Noise</td><td>77.9 99.7</td><td>60.0</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>91.1</td><td>99.8</td><td>100.0</td><td>99.5</td><td>99.9</td><td>98.9</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>100.0 97.2</td><td>75.5 82.8</td><td>99.8 99.9</td><td>100.0 98.8</td><td>99.2</td><td>100.0</td><td>96.5</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td>Uniform MNIST</td><td>97.6</td><td>79.3</td><td>95.9</td><td>97.5</td><td>99.9 99.9</td><td>98.9 99.2</td><td>100.0</td><td>100.0</td><td>100.0</td><td>100.0</td></tr><tr><td rowspan="5">JSINIH</td><td>EMNIST GrCIFAR10</td><td>96.8</td><td>74.2</td><td>94.6</td><td>96.1</td><td>100.0</td><td>98.9</td><td>97.2 96.5</td><td>97.4 97.0</td><td>97.0 98.6</td><td>98.3 99.1</td></tr><tr><td rowspan="5">Noise Uniform</td><td>92.2</td><td>92.7</td><td>86.9</td><td>90.8</td><td>82.3</td><td>92.9</td><td>98.6</td><td>96.8</td><td>100.0</td><td>100.0</td></tr><tr><td>93.8</td><td>78.6</td><td>91.6</td><td>92.5</td><td>95.4</td><td>95.4</td><td>97.0</td><td>95.3</td><td>100.0</td><td>100.0</td></tr><tr><td>97.8</td><td>93.0</td><td>97.1</td><td>98.8</td><td>95.4</td><td>99.1</td><td></td><td></td><td></td><td></td></tr><tr><td>97.2</td><td></td><td></td><td></td><td></td><td></td><td>99.4</td><td>100.0</td><td>98.2</td><td>100.0</td></tr><tr><td rowspan="5">CIFAR10 CIFAR100 NH∧S Imagenet- Noise</td><td>96.7</td><td>96.2 95.8</td><td>98.5 98.3</td><td>99.2 99.0</td><td>98.6 98.2</td><td>97.3 96.6</td><td>99.0</td><td>97.3</td><td>100.0</td><td>100.0</td></tr><tr><td>LSUN_CR</td><td>99.9 99.9</td><td>99.9</td><td>100.0</td><td>100.0</td><td>99.9</td><td>98.8 100.0</td><td>97.0 100.0</td><td>100.0 100.0</td><td>100.0 100.0</td></tr><tr><td>96.8</td><td>96.2</td><td>98.3</td><td>99.1</td><td>98.9</td><td>96.9</td><td>98.9</td><td>98.3</td><td>100.0</td><td></td></tr><tr><td>89.1</td><td>83.6</td><td>95.6</td><td>96.8</td><td>94.5</td><td>50.3</td><td>97.0</td><td>87.3</td><td>95.6</td><td>100.0</td></tr><tr><td>98.5</td><td>97.0</td><td>98.7</td><td>98.5</td><td>100.0</td><td>98.9</td><td>99.3</td><td>100.0</td><td>100.0</td><td>93.3 100.0</td></tr><tr><td rowspan="5">CIIIIII Noise</td><td rowspan="5">SVHN CIFAR100 LSUN_CR Imagenet-</td><td>92.3</td><td>71.1</td><td>90.7</td><td>87.4</td><td>80.5</td><td>92.7</td><td>85.9</td><td>91.0</td><td>98.5</td><td>97.5</td></tr><tr><td>86.3</td><td>80.0</td><td>89.3</td><td>89.8</td><td>84.0</td><td>85.5</td><td>83.4</td><td>87.4</td><td>95.6</td><td>94.6</td></tr><tr><td>99.7</td><td>99.2</td><td>99.7</td><td>99.7</td><td>99.7</td><td>99.7</td><td>99.6</td><td>99.7</td><td>100.0</td><td>99.9</td></tr><tr><td>84.6</td><td>79.2</td><td>89.8</td><td>88.6</td><td>84.9</td><td>84.2</td><td>84.4</td><td>85.4</td><td>94.8</td><td>93.2</td></tr><tr><td>88.1 97.8</td><td>55.7</td><td>70.4</td><td>82.7</td><td>68.6</td><td>87.7</td><td>84.9</td><td>84.0</td><td>93.8</td><td>94.7</td></tr><tr><td rowspan="6">CEIRIIIO Noise Uniform</td><td rowspan="5">Uniform SVHN CIFAR10 LSUN_CR Imagenet-</td><td>67.4</td><td>83.4</td><td>94.5</td><td>98.0</td><td>82.4</td><td>99.1</td><td>100.0</td><td>100.0</td><td>99.2</td><td>100.0</td></tr><tr><td>80.9</td><td>52.9</td><td>72.0</td><td>75.6</td><td>63.4</td><td>71.0</td><td>69.1</td><td>59.4</td><td>89.6</td><td>90.8</td></tr><tr><td>99.3</td><td>66.1</td><td>75.8</td><td>79.1</td><td>72.5 99.2</td><td>81.3</td><td>61.2</td><td>79.7</td><td>84.8 99.9</td><td>83.7</td></tr><tr><td>81.9</td><td>98.3 67.1</td><td>99.0 78.8</td><td>99.3 80.7</td><td>76.5</td><td>99.3 82.0</td><td>99.2 73.8</td><td>99.1 80.8</td><td></td><td>99.9</td></tr><tr><td>51.0 95.6 66.1</td><td>36.1 53.1</td><td>34.1</td><td>47.8</td><td>44.2</td><td>56.4</td><td>79.5</td><td>25.9</td><td>85.3 69.5</td><td>83.3 88.9</td></tr></table>
|
| 459 |
+
|
| 460 |
+
number of true positives (tp) over the sum of true positives and false positives (fp), i.e.
|
| 461 |
+
|
| 462 |
+
$$
|
| 463 |
+
{ \mathrm { p r e c i s i o n } } = { \frac { \mathrm { t p } } { \mathrm { t p } + \mathrm { f p } } } .
|
| 464 |
+
$$
|
| 465 |
+
|
| 466 |
+
Recall is defined as
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
{ \mathrm { r e c a l l } } = { \frac { \mathrm { t p } } { \mathrm { t p } + \mathrm { f n } } } ,
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
where fn is the number of false negatives. We report the AUPR for all models and all datasets in Table 6. Qualitatively we find that the results do not differ from the ones reported in Table 2.
|
md/train/EKV158tSfwv/EKV158tSfwv.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/H1emus0qF7/H1emus0qF7.md
ADDED
|
@@ -0,0 +1,534 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# NEAR-OPTIMAL REPRESENTATION LEARNING FOR HIERARCHICAL REINFORCEMENT LEARNING
|
| 2 |
+
|
| 3 |
+
Ofir Nachum, Shixiang Gu, Honglak Lee & Sergey Levine∗ Google Brain {ofirnachum,shanegu,honglak,slevine}@google.co
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We study the problem of representation learning in goal-conditioned hierarchical reinforcement learning. In such hierarchical structures, a higher-level controller solves tasks by iteratively communicating goals which a lower-level policy is trained to reach. Accordingly, the choice of representation – the mapping of observation space to goal space – is crucial. To study this problem, we develop a notion of sub-optimality of a representation, defined in terms of expected reward of the optimal hierarchical policy using this representation. We derive expressions which bound the sub-optimality and show how these expressions can be translated to representation learning objectives which may be optimized in practice. Results on a number of difficult continuous-control tasks show that our approach to representation learning yields qualitatively better representations as well as quantitatively better hierarchical policies, compared to existing methods.12
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Hierarchical reinforcement learning has long held the promise of extending the successes of existing reinforcement learning (RL) methods (Gu et al., 2017; Schulman et al., 2015; Lillicrap et al., 2015) to more complex, difficult, and temporally extended tasks (Parr & Russell, 1998; Sutton et al., 1999; Barto & Mahadevan, 2003). Recently, goal-conditioned hierarchical designs, in which higher-level policies communicate goals to lower-levels and lower-level policies are rewarded for reaching states (i.e. observations) which are close to these desired goals, have emerged as an effective paradigm for hierarchical RL (Nachum et al. (2018); Levy et al. (2017); Vezhnevets et al. (2017), inspired by earlier work Dayan & Hinton (1993); Schmidhuber & Wahnsiedler (1993)). In this hierarchical design, representation learning is crucial; that is, a representation function must be chosen mapping state observations to an abstract space. Goals (desired states) are then specified by the choice of a point in this abstract space.
|
| 12 |
+
|
| 13 |
+
Previous works have largely studied two ways to choose the representation: learning the representation end-to-end together with the higher- and lower-level policies (Vezhnevets et al., 2017), or using the state space as-is for the goal space (i.e., the goal space is a subspace of the state space) (Nachum et al., 2018; Levy et al., 2017). The former approach is appealing, but in practice often produces poor results (see Nachum et al. (2018) and our own experiments), since the resulting representation is under-defined; i.e., not all possible sub-tasks are expressible as goals in the space. On the other hand, fixing the representation to be the full state means that no information is lost, but this choice is difficult to scale to higher dimensions. For example, if the state observations are entire images, the higher-level must output target images for the lower-level, which can be very difficult.
|
| 14 |
+
|
| 15 |
+
We instead study how unsupervised objectives can be used to train a representation that is more concise than the full state, but also not as under-determined as in the end-to-end approach. In order to do so in a principled manner, we propose a measure of sub-optimality of a given representation. This measure aims to answer the question: How much does using the learned representation in place of the full representation cause us to lose, in terms of expected reward, against the optimal policy? This question is important, because a useful representation will compress the state, hopefully making the learning problem easier. At the same time, the compression might cause the representation to lose information, making the optimal policy impossible to express. It is therefore critical to understand how lossy a learned representation is, not in terms of reconstruction, but in terms of the ability to represent near-optimal policies on top of this representation.
|
| 16 |
+
|
| 17 |
+
Our main theoretical result shows that, for a particular choice of representation learning objective, we can learn representations for which the return of the hierarchical policy approaches the return of the optimal policy within a bounded error. This suggests that, if the representation is learned with a principled objective, the ‘lossy-ness’ in the resulting representation should not cause a decrease in overall task performance. We then formulate a representation learning approach that optimizes this bound. We further extend our result to the case of temporal abstraction, where the higher-level controller only chooses new goals at fixed time intervals. To our knowledge, this is the first result showing that hierarchical goal-setting policies with learned representations and temporal abstraction can achieve bounded sub-optimality against the optimal policy. We further observe that the representation learning objective suggested by our theoretical result closely resembles several other recently proposed objectives based on mutual information (van den Oord et al., 2018; Ishmael Belghazi et al., 2018; Hjelm et al., 2018), suggesting an intriguing connection between mutual information and goal representations for hierarchical RL. Results on a number of difficult continuous-control navigation tasks show that our principled representation learning objective yields good qualitative and quantitative performance compared to existing methods.
|
| 18 |
+
|
| 19 |
+
# 2 FRAMEWORK
|
| 20 |
+
|
| 21 |
+
Following previous work (Nachum et al., 2018), we consider a two-level hierarchical policy on an MDP $\overset { \triangledown } { \mathcal { M } } = ( S , A , R , T )$ , in which the higher-level policy modulates the behavior of a lowerlevel policy by choosing a desired goal state and rewarding the lower-level policy for reaching this state. While prior work has used a sub-space of the state space as goals (Nachum et al., 2018), in more general settings, some type of state representation is necessary. That is, consider a state representation function $f : \mathcal { S } \overset { \vartriangle } { } \mathbb { R } ^ { d }$ . A two-level hierarchical policy on $\mathcal { M }$ is composed of a higher-level policy $\pi _ { \mathrm { h i } } ( g | s )$ , where $g \in G = \mathbb { R } ^ { d }$ is the goal space, that samples a high-level action (or goal) $g _ { t } \sim \pi _ { \mathrm { h i } } ( g | s _ { t } )$ every $c$ steps, for fixed $c$ . A non-stationary, goal-conditioned, lower-level policy $\pi _ { \mathrm { l o } } ( a | s _ { t } , g _ { t } , s _ { t + k } , k )$ then translates these high-level actions into low-level actions $a _ { t + k } \in A$ for $k \in [ 0 , c - 1 ]$ . The process is then repeated, beginning with the higher-level policy selecting another goal according to $s _ { t + c }$ . The policy $\pi _ { \mathrm { l o } }$ is trained using a goal-conditioned reward; e.g. the reward of a transition $g , s , s ^ { \prime }$ is $- D ( f ( s ^ { \prime } ) , g )$ , where $D$ is a distance function.
|
| 22 |
+
|
| 23 |
+
In this work we adopt a slightly different interpretation of the lower-level policy and its relation to $\pi _ { \mathrm { h i } }$ . Every $c$ steps, the higher-level policy chooses a goal $g _ { t }$ based on a state $s _ { t }$ . We interpret this state-goal pair as being mapped to a nonstationary policy $\pi ( a | s _ { t + k } , k ) , \pi ~ \in ~ \Pi$ , where $\Pi$ denotes the set of all possible $c$ -step policies acting on $\mathcal { M }$ . We use $\Psi$ to denote this mapping from $S \times G$ to $\Pi$ . In other words, on every $c ^ { \mathrm { t h } }$ step, we encounter some state $s _ { t } ~ \in ~ S$ . We use the higher-level policy to sample a goal
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: The hierarchical design we consider.
|
| 27 |
+
|
| 28 |
+
$g _ { t } \sim \pi _ { \mathrm { h i } } ( g | s _ { t } )$ and translate this to a policy $\pi _ { t } = \Psi ( s _ { t } , g _ { t } )$ . We then use $\pi _ { t }$ to sample actions $a _ { t + k } \sim \pi _ { t } ( a | s _ { t + k } , k )$ for $k \in [ 0 , c - 1 ]$ . The process is then repeated from $s _ { t + c }$ .
|
| 29 |
+
|
| 30 |
+
Although the difference in this interpretation is subtle, the introduction of $\Psi$ is crucial for our subsequent analysis. The communication of $g _ { t }$ is no longer as a goal which $\pi _ { \mathrm { h i } }$ desires to reach, but rather more precisely, as an identifier to a low-level behavior which $\pi _ { \mathrm { h i } }$ desires to induce or activate.
|
| 31 |
+
|
| 32 |
+
The mapping $\Psi$ is usually expressed as the result of an RL optimization over $\Pi$ ; e.g.,
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\Psi ( s _ { t } , g ) = \underset { \pi \in \Pi } { \arg \operatorname* { m a x } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } \mathbb { E } _ { P _ { \pi } ( s _ { t + k } \mid s _ { t } ) } [ - D ( f ( s _ { t + k } ) , g ) ] ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where we use $P _ { \pi } ( s _ { t + k } | s _ { t } )$ to denote the probability of being in state $s _ { t + k }$ after following $\pi$ for $k$ steps starting from $s _ { t }$ . We will consider variations on this low-level objective in later sections. From Equation 1 it is clear how the choice of representation $f$ affects $\Psi$ (albeit indirectly).
|
| 39 |
+
|
| 40 |
+
We will restrict the environment reward function $R$ to be defined only on states. We use $R _ { m a x }$ to denote the maximal absolute reward: $R _ { m a x } = \operatorname* { s u p } _ { S } | R ( s ) |$ .
|
| 41 |
+
|
| 42 |
+
# 3 HIERARCHICAL POLICY SUB-OPTIMALITY
|
| 43 |
+
|
| 44 |
+
In the previous section, we introduced two-level policies where a higher-level policy $\pi _ { \mathrm { h i } }$ chooses goals $g$ , which are translated to lower-level behaviors via $\Psi$ . The introduction of this hierarchy leads to a natural question: How much do we lose by learning $\pi _ { \mathrm { h i } }$ which is only able to act on $\mathcal { M }$ via $\Psi ?$ The choice of $\Psi$ restricts the type and number of lower-level behaviors that the higher-level policy can induce. Thus, the optimal policy on $\mathcal { M }$ is potentially not expressible by $\pi _ { \mathrm { h i } }$ . Despite the potential lossy-ness of $\Psi$ , can one still learn a hierarchical policy which is near-optimal?
|
| 45 |
+
|
| 46 |
+
To approach this question, we introduce a notion of sub-optimality with respect to the form of $\Psi$ : Let $\pi _ { \mathrm { h i } } ^ { * } ( g | s , \Psi )$ be the optimal higher-level policy acting on $G$ and using $\Psi$ as the mapping from $G$ to low-level behaviors. Let $\pi _ { \mathrm { h i e r } } ^ { * }$ be the corresponding full hierarchical policy on $\mathcal { M }$ . We will compare $\pi _ { \mathrm { h i e r } } ^ { * }$ to an optimal hierarchical policy $\pi ^ { * }$ agnostic to $\Psi$ . To define $\pi ^ { * }$ we begin by introducing an optimal higher-level policy $\pi _ { \mathrm { h i } } ^ { * * } ( \pi | s )$ agnostic to $\Psi$ ; i.e. every $c$ steps, $\pi _ { \mathrm { h i } } ^ { * * }$ samples a low-level behavior $\pi \in \Pi$ which is applied to $\mathcal { M }$ for the following $c$ steps. In this way, $\pi _ { \mathrm { h i } } ^ { * * }$ may express all possible low-level behaviors. We then denote $\pi ^ { * }$ as the full hierarchical policy resulting from $\pi _ { \mathrm { h i } } ^ { * * }$ .
|
| 47 |
+
|
| 48 |
+
We would like to compare $\pi _ { \mathrm { h i e r } } ^ { * }$ to $\pi ^ { * }$ . A natural and common way to do so is in terms of state values. Let $V ^ { \pi } ( s )$ be the future value achieved by a policy $\pi$ starting at state $s$ . We define the sub-optimality of $\Psi$ as
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathrm { S u b O p t } ( \Psi ) = \displaystyle \operatorname* { s u p } _ { s \in S } V ^ { \pi ^ { * } } ( s ) - V ^ { \pi _ { \mathrm { h i e r } } ^ { * } } ( s ) .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
The state values $V ^ { \pi _ { \mathrm { h i e r } } ^ { * } } ( s )$ are determined by the form of $\Psi$ , which is in turn determined by the choice of representation $f$ . However, none of these relationships are direct. It is unclear how a change in $f$ will result in a change to the sub-optimality. In the following section, we derive a series of bounds which establish a more direct relationship between $\mathrm { S u b O p t } \bar { ( } \Psi )$ and $f$ . Our main result will show that if one defines $\Psi$ as a slight modification of the traditional objective given in Equation 1, then one may translate sub-optimality of $\Psi$ to a practical representation learning objective for $f$ .
|
| 55 |
+
|
| 56 |
+
# 4 GOOD REPRESENTATIONS LEAD TO BOUNDED SUB-OPTIMALITY
|
| 57 |
+
|
| 58 |
+
In this section, we provide proxy expressions that bound the sub-optimality induced by a specific choice of $\Psi$ . Our main result is Claim 4, which connects the sub-optimality of $\Psi$ to both goalconditioned policy objectives (i.e., the objective in 1) and representation learning (i.e., an objective for the function $f$ ).
|
| 59 |
+
|
| 60 |
+
# 4.1 SINGLE-STEPS $\displaystyle c = 1$ ) AND DETERMINISTIC POLICIES
|
| 61 |
+
|
| 62 |
+
For ease of presentation, we begin by presenting our results in the restricted case of $c = 1$ and deterministic lower-level policies. In this setting, the class of low-level policies $\Pi$ may be taken to be simply $A$ , where $a \in \Pi$ corresponds to a policy which always chooses action $a$ . There is no temporal abstraction: The higher-level policy chooses a high-level action $g \in G$ at every step, which is translated via $\Psi$ to a low-level action $a \in A$ . Our claims are based on quantifying how many of the possible low-level behaviors (i.e., all possible state to state transitions) can be produced by $\Psi$ for different choices of $g$ . To quantify this, we make use of an auxiliary inverse goal model $\varphi ( s , a )$ , which aims to predict which goal $g$ will cause $\Psi$ to yield an action $\tilde { \boldsymbol { a } } = \boldsymbol { \Psi } ( s , g )$ that induces a next state distribution $P ( s ^ { \prime } | s , \tilde { a } )$ similar to $P ( s ^ { \prime } | s , a )$ .3 We have the following theorem, which bounds the sub-optimality in terms of total variation divergences between $P ( s ^ { \prime } | s , a )$ and $P ( s ^ { \prime } | s , \tilde { a } )$ :
|
| 63 |
+
|
| 64 |
+
Theorem 1. If there exists $\varphi : S \times A \to G$ such that,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\operatorname* { s u p } _ { s \in S , a \in A } D _ { \mathrm { T V } } ( P ( s ^ { \prime } | s , a ) | | P ( s ^ { \prime } | s , \Psi ( s , \varphi ( s , a ) ) ) ) \leq \epsilon ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
$\operatorname { S u b O p t } ( \Psi ) \leq C \epsilon$ , where $\begin{array} { r } { C = \frac { 2 \gamma } { ( 1 - \gamma ) ^ { 2 } } R _ { m a x } } \end{array}$
|
| 71 |
+
|
| 72 |
+
Proof. See Appendices A and B for all proofs.
|
| 73 |
+
|
| 74 |
+
Theorem 1 allows us to bound the sub-optimality of $\Psi$ in terms of how recoverable the effect of any action in $A$ is, in terms of transition to the next state. One way to ensure that effects of actions in $A$ are recoverable is to have an invertible $\Psi$ . That is, if there exists $\varphi : S \times A \to G$ such that $\Psi ( s , \varphi ( s , a ) ) = a$ for all $s , a$ , then the sub-optimality of $\Psi$ is 0.
|
| 75 |
+
|
| 76 |
+
However, in many cases it may not be desirable or feasible to have an invertible $\Psi$ . Looking back at Theorem 1, we emphasize that its statement requires only the effect of any action to be recoverable. That is, for any $s , \in S , a \in A$ , we require only that there exist some $g \in G$ (given by $\varphi ( s , a ) )$ which yields a similar next-state distribution. To this end, we have the following claim, which connects the sub-optimality of $\Psi$ to both representation learning and the form of the low-level objective.
|
| 77 |
+
|
| 78 |
+
Claim 2. Let $\rho ( s )$ be a prior and $f , \varphi$ be so that, for $K ( s ^ { \prime } | s , a ) \propto \rho ( s ^ { \prime } ) \exp ( - D ( f ( s ^ { \prime } ) , \varphi ( s , a ) ) ) ;$
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\operatorname* { s u p } _ { s \in S , a \in A } D _ { \mathrm { K L } } ( P ( s ^ { \prime } | s , a ) | | K ( s ^ { \prime } | s , a ) ) \le \epsilon ^ { 2 } / 8 .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
If the low-level objective is defined as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\Psi ( s , g ) = \underset { a \in A } { \operatorname { a r g m a x } } \mathbb { E } _ { P ( s ^ { \prime } \mid s , a ) } [ - D ( f ( s ^ { \prime } ) , g ) + \log \rho ( s ^ { \prime } ) - \log P ( s ^ { \prime } \mid s , a ) ] ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
then the sub-optimality of $\Psi$ is bounded by $C \epsilon$
|
| 91 |
+
|
| 92 |
+
We provide an intuitive explanation of the statement of Claim 2. First, consider that the distribution $K ( s ^ { \prime } | s , a )$ appearing in Equation 4 may be interpreted as a dynamics model determined by $f$ and $\varphi$ . By bounding the difference between the true dynamics $P ( s ^ { \prime } | s , a )$ and the dynamics $K ( s ^ { \prime } | s , a )$ implied by $f$ and $\varphi$ , Equation 4 states that the representation $f$ should be chosen in such a way that dynamics in representation space are roughly given by $\varphi ( s , a )$ . This is essentially a representation learning objective for choosing $f$ , and in Section 5 we describe how to optimize it in practice.
|
| 93 |
+
|
| 94 |
+
Moving on to Equation 5, we note that the form of $\Psi$ here is only slightly different than the onestep form of the standard goal-conditioned objective in Equation 1.5 Therefore, all together Claim 2 establishes a deep connection between representation learning (Equation 4), goal-conditioned policy learning (Equation 5), and sub-optimality.
|
| 95 |
+
|
| 96 |
+
# 4.2 TEMPORAL ABSTRACTION $( c \geq 1$ ) AND GENERAL POLICIES
|
| 97 |
+
|
| 98 |
+
We now move on to presenting the same results in the fully general, temporally abstracted setting, in which the higher-level policy chooses a high-level action $g \in G$ every $c$ steps, which is transformed via $\Psi$ to a $c$ -step lower-level behavior policy $\pi \in \Pi$ . In this setting, the auxiliary inverse goal model $\varphi ( s , \pi )$ is a mapping from $S \times \Pi$ to $G$ and aims to predict which goal $g$ will cause $\Psi$ to yield a policy $\tilde { \pi } = \Psi ( s , g )$ that induces future state distributions $P _ { \tilde { \pi } } \big ( s _ { t + k } \big | s _ { t } \big )$ similar to $P _ { \pi } { \left( { { s } _ { t + k } } \vert { { s } _ { t } } \right) }$ , for $\bar { k } \in [ 1 , c ]$ $w _ { k } \stackrel { \cdot } { = } ( \stackrel { \cdot } { 1 } - \gamma ) ^ { - 1 }$ . We weight the divergences between the distributions by weights for $k = c$ . We denote $\begin{array} { r } { \overline { { \boldsymbol { w } } } = \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } \boldsymbol { w } _ { k } } \end{array}$ k . The analogue to Theorem 1 is as for and follows:
|
| 99 |
+
|
| 100 |
+
Theorem 3. Consider a mapping $\varphi : S \times \Pi G$ and define $\epsilon _ { k } : S \times \Pi \mathbb { R }$ for $k \in [ 1 , c ]$ as,
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\epsilon _ { k } ( s _ { t } , \pi ) = D _ { \mathrm { T V } } ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | P _ { \Psi ( s _ { t } , \varphi ( s _ { t } , \pi ) ) } ( s _ { t + k } | s _ { t } ) ) .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
If
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\operatorname* { s u p } _ { s _ { t } \in S , \pi \in \Pi } \frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } \epsilon _ { k } ( s _ { t } , \pi ) \le \epsilon ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
$\operatorname { S u b O p t } ( \Psi ) \leq C \epsilon$ , where $\begin{array} { r } { C = \frac { 2 \gamma } { 1 - \gamma ^ { c } } R _ { m a x } \overline { { w } } } \end{array}$
|
| 113 |
+
|
| 114 |
+
For the analogue to Claim 2, we simply replace the single-step KL divergences and low-level rewards with a discounted weighted sum thereof:
|
| 115 |
+
|
| 116 |
+
Claim 4. Let $\rho ( s )$ be a prior over $S$ . Let $f , \varphi$ be such that,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\operatorname* { s u p } _ { s _ { t } \in S , \pi \in \Pi } \frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { K L } } ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) ) \le \epsilon ^ { 2 } / 8 ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $K ( s _ { t + k } | s _ { t } , \pi ) \propto \rho ( s _ { t + k } ) \exp ( - D ( f ( s _ { t + k } ) , \varphi ( s _ { t } , \pi ) ) ) .$
|
| 123 |
+
|
| 124 |
+
If the low-level objective is defined as
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\Psi ( s _ { t } , g ) = \underset { \pi \in \Pi } { \operatorname { a r g m a x } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } \mathbb { E } _ { P _ { \pi } ( s _ { t + k } | s _ { t } ) } [ - D ( f ( s _ { t + k } ) , g ) + \log \rho ( s _ { t + k } ) - \log P _ { \pi } ( s _ { t + k } | s _ { t } ) ] ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
then the sub-optimality of $\Psi$ is bounded by $C \epsilon$
|
| 131 |
+
|
| 132 |
+
Claim 4 is the main theoretical contribution of our work. As in the previous claim, we have a strong statement, saying that if the low-level objective is defined as in Equation 9, then minimizing the sub-optimality may be done by optimizing a representation learning objective based on Equation 8. We emphasize that Claim 4 applies to any class of low-level policies $\Pi$ , including either closed-loop or open-loop policies.
|
| 133 |
+
|
| 134 |
+
# 5 LEARNING
|
| 135 |
+
|
| 136 |
+
We now have the mathematical foundations necessary to learn representations that are provably good for use in hierarchical RL. We begin by elaborating on how we translate Equation 8 into a practical training objective for $f$ and auxiliary $\varphi$ (as well as a practical parameterization of policies $\pi$ as input to $\varphi$ ). We then continue to describe how one may train a lower-level policy to match the objective presented in Equation 9. In this way, we may learn $f$ and lower-level policy to directly optimize a bound on the sub-optimality of $\Psi$ . A pseudocode of the full algorithm is presented in the Appendix (see Algorithm 1).
|
| 137 |
+
|
| 138 |
+
# 5.1 LEARNING GOOD REPRESENTATIONS
|
| 139 |
+
|
| 140 |
+
Consider a representation function $f _ { \theta } : S \mathbb { R } ^ { d }$ and an auxiliary function $\varphi _ { \theta } : S \times \Pi \mathbb { R } ^ { d }$ , parameterized by vector $\theta$ . In practice, these are separate neural networks: $f _ { \theta _ { 1 } } , \varphi _ { \theta _ { 2 } } , \theta = [ \theta _ { 1 } , \theta _ { 2 } ]$ .
|
| 141 |
+
|
| 142 |
+
While the form of Equation 8 suggests to optimize a supremum over all $s _ { t }$ and $\pi$ , in practice we only have access to a replay buffer which stores experience $s _ { 0 } , a _ { 0 } , s _ { 1 } , a _ { 1 } , \ldots$ sampled from our hierarchical behavior policy. Therefore, we propose to choose $s _ { t }$ sampled uniformly from the replay buffer and use the subsequent $c$ actions $a _ { t : t + c - 1 }$ as a representation of the policy $\pi$ , where we use $a _ { t : t + c - 1 }$ to denote the sequence $a _ { t } , \ldots , a _ { t + c - 1 }$ . Note that this is equivalent to setting the set of candidate policies $\Pi$ to $A ^ { c }$ (i.e., $\Pi$ is the set of $c$ -step, deterministic, open-loop policies). This choice additionally simplifies the possible structure of the function approximator used for $\varphi _ { \theta }$ (a standard neural net which takes in $s _ { t }$ and $a _ { t : t + c - 1 }$ ). Our proposed representation learning objective is thus,
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
J ( \theta ) = \mathbb { E } _ { s _ { t } , a _ { t : t + c - 1 } \sim \mathrm { r e p l a y } } [ J ( \theta , s _ { t } , a _ { t : t + c - 1 } ) ] ,
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $J ( \theta , s _ { t } , a _ { t : t + c - 1 } )$ will correspond to the inner part of the supremum in Equation 8.
|
| 149 |
+
|
| 150 |
+
We now define the inner objective $J ( \theta , s _ { t } , a _ { t : t + c - 1 } )$ . To simplify notation, we use $E _ { \theta } ( s ^ { \prime } , s , \pi ) =$ $\exp ( - D ( f _ { \boldsymbol { \theta } } ( s ^ { \prime } ) , \varphi _ { \boldsymbol { \theta } } ( s , \pi ) ) )$ and use $K _ { \theta } ( s ^ { \prime } | s , \pi )$ as the distribution over $S$ such that $K _ { \theta } ( s ^ { \prime } | s , \pi ) \propto$ $\rho ( s ^ { \prime } ) E _ { \theta } ( s ^ { \prime } , s , \pi )$ . Equation 8 suggests the following learning objective on each $s _ { t } , \pi \equiv a _ { t : t + c - 1 }$ :
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\begin{array} { r l } { J ( \theta , s _ { t } , \pi ) = \displaystyle \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { K L } } \big ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | K _ { \theta } ( s _ { t + k } | s _ { t } , \pi ) \big ) } & { { } } \\ { \displaystyle } & { { } = B + \displaystyle \sum _ { k = 1 } ^ { c } - \gamma ^ { k - 1 } w _ { k } \mathbb { E } _ { P _ { \pi } ( s _ { t + k } | s _ { t } ) } \left[ \log K _ { \theta } ( s _ { t + k } | s _ { t } , \pi ) \right] } \end{array}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
= B + \sum _ { k = 1 } ^ { c } - \gamma ^ { k - 1 } w _ { k } \mathbb { E } _ { P _ { \pi } ( s _ { t + k } \mid s _ { t } ) } \left[ \log E _ { \theta } ( s _ { t + k } , s _ { t } , \pi ) \right] + \gamma ^ { k - 1 } w _ { k } \log \mathbb { E } _ { \bar { s } \sim \rho } \left[ E _ { \theta } ( \tilde { s } , s _ { t } , \pi ) \right] ,
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
where $B$ is a constant. The gradient with respect to $\theta$ is then,
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\sum _ { k = 1 } ^ { c } - \gamma ^ { k - 1 } w _ { k } \mathbb { E } _ { P _ { \pi } ( s _ { t + k } \mid s _ { t } ) } \left[ \nabla _ { \theta } \log E _ { \theta } ( s _ { t + k } , s _ { t } , \pi ) \right] + \gamma ^ { k - 1 } w _ { k } \frac { \mathbb { E } _ { \tilde { s } \sim \rho } \left[ \nabla _ { \theta } E _ { \theta } ( \tilde { s } , s _ { t } , \pi ) \right] } { \mathbb { E } _ { \tilde { s } \sim \rho } \left[ E _ { \theta } ( \tilde { s } , s _ { t } , \pi ) \right] }
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
The first term of Equation 14 is straightforward to estimate using experienced $\scriptstyle { s _ { t + 1 : t + k } }$ . We set $\rho$ to be the replay buffer distribution, so that the numerator of the second term is also straightforward. We approximate the denominator of the second term using a mini-batch $\widetilde { S }$ of states independently sampled from the replay buffer:
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\begin{array} { r } { \mathbb { E } _ { \tilde { s } \sim { \rho } } \left[ E _ { \theta } ( \tilde { s } , s _ { t } , \pi ) \right] \approx | \widetilde { S } | ^ { - 1 } \sum _ { \tilde { s } \in \widetilde { S } } E _ { \theta } ( \tilde { s } , s _ { t } , \pi ) . } \end{array}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
This completes the description of our representation learning algorithm.
|
| 173 |
+
|
| 174 |
+
Connection to Mutual Information Estimators. The form of the objective we optimize (i.e. Equation 13) is very similar to mutual information estimators, mostly CPC (van den Oord et al., 2018). Indeed, one may interpret our objective as maximizing a mutual information $M I ( s _ { t + k } ; s _ { t } , \pi )$ via an energy function given by $E _ { \theta } ( s _ { t + k } , s _ { t } , \pi )$ . The main differences between our approach and these previous proposals are as follows: (1) Previous approaches maximize a mutual information $M I ( s _ { t + k } ; s _ { t } )$ agnostic to actions or policy. (2) Previous approaches suggest to define the energy function as $\exp \bar { ( } f ( s _ { t + k } ) ^ { T } M _ { k } f ( s _ { t } ) )$ for some matrix $M _ { k }$ , whereas our energy function is based on the distance $D$ used for low-level reward. (3) Our approach is provably good for use in hierarchical RL, and hence our theoretical results may justify some of the good performance observed by others using mutual information estimators for representation learning. Different approaches to translating our theoretical findings to practical implementations may yield objectives more or less similar to CPC, some of which perform better than others (see Appendix D).
|
| 175 |
+
|
| 176 |
+
# 5.2 LEARNING A LOWER-LEVEL POLICY
|
| 177 |
+
|
| 178 |
+
Equation 9 suggests to optimize a policy $\pi _ { s _ { t } , g } ( a | s _ { t + k } , k )$ for every $s _ { t } , g$ . This is equivalent to the parameterization $\pi _ { \mathrm { l o } } ( a | s _ { t } , g , s _ { t + k } , k )$ , which is standard in goal-conditioned hierarchical designs. Standard RL algorithms may be employed to maximize the low-level reward implied by Equation 9:
|
| 179 |
+
|
| 180 |
+
$$
|
| 181 |
+
- D ( f ( s _ { t + k } ) , g ) + \log \rho ( s _ { t + k } ) - \log P _ { \pi } ( s _ { t + k } | s _ { t } ) ,
|
| 182 |
+
$$
|
| 183 |
+
|
| 184 |
+
weighted by $w _ { k }$ and where $\pi$ corresponds to $\pi _ { \mathrm { l o } }$ when the state $s _ { t }$ and goal $g$ are fixed. While the first term of Equation 16 is straightforward to compute, the log probabilities $\log \rho ( s _ { t + k } ) , \log P _ { \pi } ( s _ { t + k } | s _ { t } )$ are in general unknown. To approach this issue, we take advantage of the representation learning objective for $f , \varphi$ . When $f , \varphi$ are optimized as dictated by Equation 8, we have
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\begin{array} { r } { \log P _ { \pi } ( s _ { t + k } | s _ { t } ) \approx \log \rho ( s _ { t + k } ) - D ( f ( s _ { t + k } ) , \varphi ( s _ { t } , \pi ) ) - \log \mathbb { E } _ { \widetilde { s } \sim \rho } [ E ( \widetilde { s } , s _ { t } , \pi ) ] . } \end{array}
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
We may therefore approximate the low-level reward as
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
- D ( f ( s _ { t + k } ) , g ) + D ( f ( s _ { t + k } ) , \varphi ( s _ { t } , \pi ) ) + \log \mathbb { E } _ { \widetilde { s } \sim \rho } [ E ( \widetilde { s } , s _ { t } , \pi ) ] .
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
As in Section 5.1, we use the sampled actions $a _ { t : t + c - 1 }$ to represent $\pi$ as input to $\varphi$ . We approximate the third term of Equation 18 analogously to Equation 15. Note that this is a slight difference from standard low-level rewards, which use only the first term of Equation 18 and are unweighted.
|
| 197 |
+
|
| 198 |
+
# 6 RELATED WORK
|
| 199 |
+
|
| 200 |
+
Representation learning for RL has a rich and diverse existing literature, often interpreted as an abstraction of the original MDP. Previous works have interpreted the hierarchy introduced in hierarchical RL as an MDP abstraction of state, action, and temporal spaces (Sutton et al., 1999; Dietterich, 2000; Thomas & Barto, 2012; Bacon et al., 2017). In goal-conditioned hierarchical designs, although the representation is learned on states, it is in fact a form of action abstraction (since goals $g$ are high-level actions). While previous successful applications of goal-conditioned hierarchical designs have either learned representations naively end-to-end (Vezhnevets et al., 2017), or not learned them at all (Levy et al., 2017; Nachum et al., 2018), we take a principled approach to representation learning in hierarchical RL, translating a bound on sub-optimality to a practical learning objective.
|
| 201 |
+
|
| 202 |
+
Bounding sub-optimality in abstracted MDPs has a long history, from early work in theoretical analysis on approximations to dynamic programming models (Whitt, 1978; Bertsekas & Castanon, 1989). Extensive theoretical work on state abstraction, also known as state aggregation or model minimization, has been done in both operational research (Rogers et al., 1991; Van Roy, 2006) and RL (Dean & Givan, 1997; Ravindran & Barto, 2002; Abel et al., 2017). Notably, Li et al. (2006)
|
| 203 |
+
|
| 204 |
+
introduce a formalism for categorizing classic work on state abstractions such as bisimulation (Dean & Givan, 1997) and homomorphism (Ravindran & Barto, 2002) based on what information is preserved, which is similar in spirit to our approach. Exact state abstractions (Li et al., 2006) incur no performance loss (Dean & Givan, 1997; Ravindran & Barto, 2002), while their approximate variants generally have bounded sub-optimality (Bertsekas & Castanon, 1989; Dean & Givan, 1997; Sorg & Singh, 2009; Abel et al., 2017). While some of the prior work also focuses on learning state abstractions (Li et al., 2006; Sorg & Singh, 2009; Abel et al., 2017), they often exclusively apply to simple MDP domains as they rely on techniques such as state partitioning or Q-value based aggregation, which are difficult to scale to our experimented domains. Thus, the key differentiation of our work from these prior works is that we derive bounds which may be translated to practical representation learning objectives. Our impressive results on difficult continuous-control, high-dimensional domains is a testament to the potential impact of our theoretical findings.
|
| 205 |
+
|
| 206 |
+
Lastly, we note the similarity of our representation learning algorithm to recently introduced scalable mutual information maximization objectives such as CPC (van den Oord et al., 2018) and MINE (Ishmael Belghazi et al., 2018). This is not a surprise, since maximizing mutual information relates closely with maximum likelihood learning of energy-based models, and our bounds effectively correspond to bounds based on model-based predictive errors, a basic family of bounds in representation learning in MDPs (Sorg & Singh, 2009; Brunskill & Li, 2014; Abel et al., 2017). Although similar information theoretic measures have been used previously for exploration in RL (Still & Precup, 2012), to our knowledge, no prior work has connected these mutual information estimators to representation learning in hierarchical RL, and ours is the first to formulate theoretical guarantees on sub-optimality of the resulting representations in such a framework.
|
| 207 |
+
|
| 208 |
+
# 7 EXPERIMENTS
|
| 209 |
+
|
| 210 |
+
We evaluate our proposed representation learning objective compared to a number of baselines:
|
| 211 |
+
|
| 212 |
+
• XY: The oracle baseline which uses the $x , y$ position of the agent as the representation. • VAE: A variational autoencoder (Kingma & Welling, 2013) on raw observations. • E2C: Embed to control (Watter et al., 2015). A method which uses variational objectives to train a representation of states and actions which have locally linear dynamics. • E2E: End-to-end learning of the representation. The representation is fed as input to the higher-level policy and learned using gradients from the RL objective. • Whole obs: The raw observation is used as the representation. No representation learning. This is distinct from Nachum et al. (2018), in which a subset of the observation space was pre-determined for use as the goal space.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 2: Learned representations (2D embeddings) of our method and a number of variants on a MuJoCo Ant Maze environment, with color gradient based on episode time-step (black for beginning of episode, yellow for end). The ant travels from beginning to end of a $\supset$ -shaped corridor along an $x , y$ trajectory shown under XY. Without any supervision, our method is able to deduce this nearideal representation, even when the raw observation is given as a top-down image. Other approaches are unable to properly recover a good representation.
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
Figure 3: Results of our method and a number of variants on a suite of tasks in 10M steps of training, plotted according to median over 10 trials with $\mathrm { 3 0 ^ { t h } }$ and $7 0 ^ { \mathrm { t h } }$ percentiles. We find that outside of simple point environments, our method is the only one which can approach the performance of oracle $x , y$ representations. These results show that our method can be successful, even when the representation is learned online concurrently while learning a hierarchical policy.
|
| 219 |
+
|
| 220 |
+
We evaluate on the following continuous-control MuJoCo (Todorov et al., 2012) tasks (see Appendix C for details):
|
| 221 |
+
|
| 222 |
+
• Ant (or Point) Maze: An ant (or point mass) must navigate a $\supset$ -shaped corridor.
|
| 223 |
+
• Ant Push: An ant must push a large block to the side to reach a point behind it.
|
| 224 |
+
• Ant Fall: An ant must push a large block into a chasm so that it may walk over it to the other side without falling.
|
| 225 |
+
• Ant Block: An ant must push a small block to various locations in a square room.
|
| 226 |
+
• Ant Block Maze: An ant must push a small block through a $\supset$ -shaped corridor.
|
| 227 |
+
|
| 228 |
+
In these tasks, the raw observation is the agent’s $x , y$ coordinates and orientation as well as local coordinates and orientations of its limbs. In the Ant Block and Ant Block Maze environments we also include the $x , y$ coordinates and orientation of the block. We also experiment with more difficult raw representations by replacing the $x , y$ coordinates of the agent with a low-resolution $5 \times 5 \times 3$ top-down image of the agent and its surroundings. These experiments are labeled ‘Images’.
|
| 229 |
+
|
| 230 |
+
For the baseline representation learning methods which are agnostic to the RL training (VAE and E2C), we provide comparative qualitative results in Figure 2. These representations are the result of taking a trained policy, fixing it, and using its sampled experience to learn 2D representations of the raw observations. We find that our method can successfully deduce the underlying near-optimal $x , y$ representation, even when the raw observation is given as an image.
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
Figure 4: We investigate importance of various observation coordinates in learned representations on a difficult block-moving task. In this task, a simulated robotic ant must move a small red block from beginning to end of a $\supset$ -shaped corridor. Observations include both ant and block $x , y$ coordinates. We show the trajectory of the learned representations on the right (cyan). At four time steps, we also plot the resulting representations after perturbing the observation’s ant coordinates (green) or the observation’s block coordinates (magenta). The learned representations put a greater emphasis (i.e., higher sensitivity) on the block coordinates, which makes sense for this task as the external reward is primarily determined by the position of the block.
|
| 234 |
+
|
| 235 |
+
We provide quantitative results in Figure 3. In these experiments, the representation is learned concurrently while learning a full hierarchical policy (according to the procedure in Nachum et al. (2018)). Therefore, this setting is especially difficult since the representation learning must learn good representations even when the behavior policy is very far from optimal. Accordingly, we find that most baseline methods completely fail to make any progress. Only our proposed method is able to approach the performance of the XY oracle.
|
| 236 |
+
|
| 237 |
+
For the ‘Block’ environments, we were curious what our representation learning objective would learn, since the $x , y$ coordinate of the agent is not the only near-optimal representation. For example, another suitable representation is the $x , y$ coordinates of the small block. To investigate this, we plotted (Figure 4) the trajectory of the learned representations of a successful policy (cyan), along with the representations of the same observations with agent $x , y$ perturbed (green) or with block $x , y$ perturbed (magenta). We find that the learned representations greatly emphasize the block $x , y$ coordinates over the agent $x , y$ coordinates, although in the beginning of the episode, there is a healthy mix of the two.
|
| 238 |
+
|
| 239 |
+
# 8 CONCLUSION
|
| 240 |
+
|
| 241 |
+
We have presented a principled approach to representation learning in hierarchical RL. Our approach is motivated by the desire to achieve maximum possible return, hence our notion of sub-optimality is in terms of optimal state values. Although this notion of sub-optimality is intractable to optimize directly, we are able to derive a mathematical relationship between it and a specific form of representation learning. Our resulting representation learning objective is practical and achieves impressive results on a suite of high-dimensional, continuous-control tasks.
|
| 242 |
+
|
| 243 |
+
# ACKNOWLEDGMENTS
|
| 244 |
+
|
| 245 |
+
We thank Bo Dai, Luke Metz, and others on the Google Brain team for insightful comments and discussions.
|
| 246 |
+
|
| 247 |
+
# REFERENCES
|
| 248 |
+
|
| 249 |
+
David Abel, D Ellis Hershkowitz, and Michael L Littman. Near optimal behavior via approximate state abstraction. arXiv preprint arXiv:1701.04113, 2017.
|
| 250 |
+
Joshua Achiam, David Held, Aviv Tamar, and Pieter Abbeel. Constrained policy optimization. arXiv preprint arXiv:1705.10528, 2017.
|
| 251 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In AAAI, pp. 1726– 1734, 2017.
|
| 252 |
+
Andrew G Barto and Sridhar Mahadevan. Recent advances in hierarchical reinforcement learning. Discrete Event Dynamic Systems, 13(4):341–379, 2003.
|
| 253 |
+
Dimitri P Bertsekas and David Alfred Castanon. Adaptive aggregation methods for infinite horizon dynamic programming. IEEE transactions on Automatic Control, 34(6):589–598, 1989.
|
| 254 |
+
Emma Brunskill and Lihong Li. Pac-inspired option discovery in lifelong reinforcement learning. In International Conference on Machine Learning, pp. 316–324, 2014.
|
| 255 |
+
Peter Dayan and Geoffrey E Hinton. Feudal reinforcement learning. In Advances in neural information processing systems, pp. 271–278, 1993.
|
| 256 |
+
Thomas Dean and Robert Givan. Model minimization in markov decision processes. In AAAI/IAAI, pp. 106–111, 1997.
|
| 257 |
+
Thomas G Dietterich. Hierarchical reinforcement learning with the maxq value function decomposition. Journal of Artificial Intelligence Research, 13:227–303, 2000.
|
| 258 |
+
|
| 259 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In Robotics and Automation (ICRA), 2017 IEEE International Conference on, pp. 3389–3396. IEEE, 2017.
|
| 260 |
+
|
| 261 |
+
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.
|
| 262 |
+
|
| 263 |
+
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
|
| 264 |
+
|
| 265 |
+
Mohamed Ishmael Belghazi, Aristide Baratin, Sai Rajeswar, Sherjil Ozair, Yoshua Bengio, Aaron Courville, and R Devon Hjelm. Mine: Mutual information neural estimation. arXiv preprint arXiv:1801.04062, 2018.
|
| 266 |
+
|
| 267 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 268 |
+
|
| 269 |
+
Andrew Levy, Robert Platt, and Kate Saenko. Hierarchical actor-critic. arXiv preprint arXiv:1712.00948, 2017.
|
| 270 |
+
|
| 271 |
+
Lihong Li, Thomas J Walsh, and Michael L Littman. Towards a unified theory of state abstraction for mdps. In ISAIM, 2006.
|
| 272 |
+
|
| 273 |
+
Timothy P Lillicrap, Jonathan J Hunt, Alexander Pritzel, Nicolas Heess, Tom Erez, Yuval Tassa, David Silver, and Daan Wierstra. Continuous control with deep reinforcement learning. arXiv preprint arXiv:1509.02971, 2015.
|
| 274 |
+
|
| 275 |
+
Ofir Nachum, Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. NIPS, 2018.
|
| 276 |
+
|
| 277 |
+
Ronald Parr and Stuart J Russell. Reinforcement learning with hierarchies of machines. In Advances in neural information processing systems, pp. 1043–1049, 1998.
|
| 278 |
+
|
| 279 |
+
Balaraman Ravindran and Andrew G Barto. Model minimization in hierarchical reinforcement learning. In International Symposium on Abstraction, Reformulation, and Approximation, pp. 196–211. Springer, 2002.
|
| 280 |
+
|
| 281 |
+
David F Rogers, Robert D Plante, Richard T Wong, and James R Evans. Aggregation and disaggregation techniques and methodology in optimization. Operations Research, 39(4):553–582, 1991.
|
| 282 |
+
|
| 283 |
+
Jurgen Schmidhuber and Reiner Wahnsiedler. Planning simple trajectories using neural subgoal ¨ generators. In From Animals to Animats 2: Proceedings of the Second International Conference on Simulation of Adaptive Behavior, volume 2, pp. 196. MIT Press, 1993.
|
| 284 |
+
|
| 285 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In International Conference on Machine Learning, pp. 1889–1897, 2015.
|
| 286 |
+
|
| 287 |
+
Jonathan Sorg and Satinder Singh. Transfer via soft homomorphisms. In Proceedings of The 8th International Conference on Autonomous Agents and Multiagent Systems-Volume 2, pp. 741–748. International Foundation for Autonomous Agents and Multiagent Systems, 2009.
|
| 288 |
+
|
| 289 |
+
Susanne Still and Doina Precup. An information-theoretic approach to curiosity-driven reinforcement learning. Theory in Biosciences, 131(3):139–148, 2012.
|
| 290 |
+
|
| 291 |
+
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, 1999.
|
| 292 |
+
|
| 293 |
+
Philip S Thomas and Andrew G Barto. Motor primitive discovery. In Development and Learning and Epigenetic Robotics (ICDL), 2012 IEEE International Conference on, pp. 1–8. IEEE, 2012.
|
| 294 |
+
|
| 295 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pp. 5026– 5033. IEEE, 2012.
|
| 296 |
+
|
| 297 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 298 |
+
|
| 299 |
+
Benjamin Van Roy. Performance loss bounds for approximate value iteration with state aggregation. Mathematics of Operations Research, 31(2):234–244, 2006.
|
| 300 |
+
|
| 301 |
+
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.
|
| 302 |
+
|
| 303 |
+
Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Advances in neural information processing systems, pp. 2746–2754, 2015.
|
| 304 |
+
|
| 305 |
+
Ward Whitt. Approximations of dynamic programs, i. Mathematics of Operations Research, 3(3): 231–243, 1978.
|
| 306 |
+
|
| 307 |
+
# A PROOF OF THEOREM 3 (GENERALIZATION OF THEOREM 1)
|
| 308 |
+
|
| 309 |
+
Consider the sub-optimality with respect to a specific state $s _ { 0 }$ , $V ^ { \pi ^ { * } } ( s _ { 0 } ) - V ^ { \pi _ { \mathrm { h i e r } } ^ { * } } ( s _ { 0 } )$ . Recall that $\pi ^ { * }$ is the hierarchical result of a policy $\pi _ { \mathrm { h i } } ^ { * * } : S \Delta ( \Pi )$ , and note that $\pi _ { \mathrm { h i } } ^ { * * }$ may be assumed to be deterministic due to the Markovian nature of $\mathcal { M }$ . We may use the mapping $\varphi$ to transform $\pi _ { \mathrm { h i } } ^ { * * }$ to a high-level policy $\pi _ { \mathrm { h i } }$ on $G$ and using the mapping $\Psi$ :
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
g \sim \pi _ { \mathrm { h i } } ( - | s ) \equiv \pi \sim \pi _ { \mathrm { h i } } ^ { * * } ( - | s ) , g : = \varphi ( s , \pi ) .
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
Let $\pi _ { \mathrm { h i e r } }$ be the corresponding hierarchical policy. We will bound the quantity $V ^ { \pi ^ { * } } ( s _ { 0 } ) - V ^ { \pi _ { \mathrm { h i e r } } } ( s _ { 0 } ) .$ , which will bound $V ^ { \pi ^ { * } } ( s _ { 0 } ) - V ^ { \pi _ { \mathrm { h i e r } } ^ { * } } ( s _ { 0 } )$ . We follow logic similar to Achiam et al. (2017) and begin by bounding the total variation divergence between the $\gamma$ -discounted state visitation frequencies of the two policies.
|
| 316 |
+
|
| 317 |
+
Denote the $k$ -step state transition distributions using either $\pi ^ { * }$ or $\pi _ { \mathrm { h i e r } }$ as,
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\begin{array} { r l } & { \quad P _ { * } ^ { k } ( s ^ { \prime } | s ) = P _ { \pi _ { \mathrm { h i } } ^ { * * } ( s ) } ( s _ { t + k } = s ^ { \prime } | s _ { t } = s ) , } \\ & { \quad P _ { \mathrm { h i e r } } ^ { k } ( s ^ { \prime } | s ) = P _ { \Psi ( s , \pi _ { \mathrm { h i } } ( s ) ) } ( s _ { t + k } = s ^ { \prime } | s _ { t } = s ) , } \end{array}
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
for $k \in [ 1 , c ]$ . Considering $P _ { * } , P _ { \mathrm { h i e r } }$ as linear operators, we may express the state visitation frequencies $d _ { * } , d _ { \mathrm { h i e r } }$ of $\pi ^ { * }$ , $\pi _ { \mathrm { h i e r } }$ , respectively, as
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\begin{array} { r } { d _ { * } = ( 1 - \gamma ) A _ { * } ( I - \gamma ^ { c } P _ { * } ^ { c } ) ^ { - 1 } \mu , \qquad } \\ { d _ { \mathrm { h i e r } } = ( 1 - \gamma ) A _ { \mathrm { h i e r } } ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } \mu , \qquad } \end{array}
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
where $\mu$ is a Dirac $\delta$ distribution centered at $s _ { 0 }$ and
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\begin{array} { r } { A _ { * } = I + \displaystyle \sum _ { k = 1 } ^ { c - 1 } \gamma ^ { k } P _ { * } ^ { k } , } \\ { A _ { \mathrm { h i e r } } = I + \displaystyle \sum _ { k = 1 } ^ { c - 1 } \gamma ^ { k } P _ { \mathrm { h i e r } } ^ { k } . } \end{array}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
We will use $d _ { * } ^ { c } , d _ { \mathrm { h i e r } } ^ { c }$ to denote the every- $c$ -steps $\gamma$ -discounted state frequencies of $\pi ^ { * }$ , $\pi _ { \mathrm { h i e r } }$ ; i.e.,
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\begin{array} { c } { d _ { \ast } ^ { c } = ( 1 - \gamma ^ { c } ) ( I - \gamma ^ { c } P _ { \ast } ^ { c } ) ^ { - 1 } \mu , } \\ { d _ { \mathrm { h i e r } } ^ { c } = ( 1 - \gamma ^ { c } ) ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } \mu . } \end{array}
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
By the triangle inequality, we have the following bound on the total variation divergence $| d _ { \mathrm { h i e r } } - d _ { * } |$ :
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\begin{array} { r l } & { \left| d _ { \mathrm { h i e r } } - d _ { * } \right| \leq ( 1 - \gamma ) | A _ { \mathrm { h i e r } } ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } \mu - A _ { \mathrm { h i e r } } ( I - \gamma ^ { c } P _ { * } ^ { c } ) ^ { - 1 } \mu | } \\ & { \qquad + \left( 1 - \gamma \right) | A _ { \mathrm { h i e r } } ( I - \gamma ^ { c } P _ { * } ^ { c } ) ^ { - 1 } \mu - A _ { * } ( I - \gamma ^ { c } P _ { * } ^ { c } ) ^ { - 1 } \mu | . } \end{array}
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
We begin by attacking the first term of Equation 28. We note that
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
| A _ { \mathrm { h i e r } } | \leq | I | + \sum _ { k = 1 } ^ { c - 1 } \gamma ^ { k } | P _ { \mathrm { h i e r } } ^ { k } | = \frac { 1 - \gamma ^ { c } } { 1 - \gamma } .
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Thus the first term of Equation 28 is bounded by
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { r l } & { ( 1 - \gamma ^ { c } ) | ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } \mu - ( I - \gamma ^ { c } P _ { * } ^ { c } ) ^ { - 1 } \mu | } \\ & { \qquad = ( 1 - \gamma ^ { c } ) | ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } ( ( I - \gamma ^ { c } P _ { * } ^ { c } ) - ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ) ( I - \gamma ^ { c } P _ { * } ^ { c } ) ^ { - 1 } \mu | } \\ & { \qquad = \gamma ^ { c } | ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } ( P _ { \mathrm { h i e r } } ^ { c } - P _ { * } ^ { c } ) d _ { * } ^ { c } | . } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
By expressing $( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 }$ as a geometric series and employing the triangle inequality, we have $| ( I - \gamma ^ { c } P _ { \mathrm { h i e r } } ^ { c } ) ^ { - 1 } | \leq ( 1 - \gamma ^ { c } ) ^ { - 1 }$ , and we thus bound the whole quantity (30) by
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\gamma ^ { c } ( 1 - \gamma ^ { c } ) ^ { - 1 } | ( P _ { \mathrm { h i e r } } ^ { c } - P _ { * } ^ { c } ) d _ { * } ^ { c } | .
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
We now move to attack the second term of Equation 28. We may express this term as
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
( 1 - \gamma ) ( 1 - \gamma ^ { c } ) ^ { - 1 } | ( A _ { \mathrm { h i e r } } - A _ { * } ) d _ { * } ^ { c } | .
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
Furthermore, by the triangle inequality we have
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
| ( A _ { \mathrm { h i e r } } - A _ { * } ) d _ { * } ^ { c } | \leq \sum _ { k = 1 } ^ { c - 1 } \gamma ^ { k } | ( P _ { \mathrm { h i e r } } ^ { k } - P _ { * } ^ { k } ) d _ { * } ^ { c } | .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Therefore, recalling $w _ { k } = 1$ for $k < c$ and $w _ { k } = ( 1 - \gamma ) ^ { - 1 }$ for $k = c$ , we may bound the total variation of the state visitation frequencies as
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
\begin{array} { r l } & { \displaystyle | d _ { \mathrm { h i e r } } - d _ { * } | \le \gamma ( 1 - \gamma ) ( 1 - \gamma ^ { c } ) ^ { - 1 } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } | ( P _ { \mathrm { h i e r } } ^ { k } - P _ { * } ^ { k } ) d _ { * } ^ { c } | } \\ & { \qquad = 2 \gamma ( 1 - \gamma ) ( 1 - \gamma ^ { c } ) ^ { - 1 } \displaystyle \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } \mathbb { E } _ { s \sim d _ { * } ^ { c } } [ D _ { \mathrm { T V } } ( P _ { * } ^ { k } ( s ^ { \prime } | s ) | | P _ { \mathrm { h i e r } } ^ { k } ( s ^ { \prime } | s ) ) ] } \\ & { \qquad = 2 \gamma ( 1 - \gamma ) ( 1 - \gamma ^ { c } ) ^ { - 1 } \mathbb { E } _ { s \sim d _ { * } ^ { c } } \left[ \displaystyle \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { T V } } ( P _ { * } ^ { k } ( s ^ { \prime } | s ) | | P _ { \mathrm { h i e r } } ^ { k } ( s ^ { \prime } | s ) ) \right] . } \end{array}
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
By condition 7 of Theorem 3 we have,
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
| d _ { \mathrm { h i e r } } - d _ { * } | \le 2 \gamma ( 1 - \gamma ) ( 1 - \gamma ^ { c } ) ^ { - 1 } \overline { { w } } \epsilon
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
We now move to considering the difference in values. We have
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\begin{array} { l } { { V ^ { \pi ^ { * } } ( s _ { 0 } ) = ( 1 - \gamma ) ^ { - 1 } \displaystyle \int _ { S } d _ { * } ( s ) R ( s ) d s , } } \\ { { V ^ { \pi _ { \mathrm { h i e r } } } ( s _ { 0 } ) = ( 1 - \gamma ) ^ { - 1 } \displaystyle \int _ { S } d _ { \mathrm { h i e r } } ( s ) R ( s ) d s . } } \end{array}
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
Therefore, we have
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\begin{array} { r l } & { \bigl | V ^ { \pi ^ { * } } ( s _ { 0 } ) - V ^ { \pi _ { \mathrm { h i e r } } } ( s _ { 0 } ) \bigr | \le ( 1 - \gamma ) ^ { - 1 } R _ { m a x } \bigl | d _ { \mathrm { h i e r } } - d _ { * } \bigr | } \\ & { \qquad \le \displaystyle \frac { 2 \gamma } { 1 - \gamma ^ { c } } R _ { m a x } \overline { w } \epsilon , } \end{array}
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
as desired.
|
| 402 |
+
|
| 403 |
+
# B PROOF OF CLAIM 4 (GENERALIZATION OF CLAIM 2)
|
| 404 |
+
|
| 405 |
+
Consider a specific $s _ { t } , \pi$ . Let $K ( s ^ { \prime } | s _ { t } , \pi ) \propto \rho ( s ^ { \prime } ) \exp ( - D ( f ( s ^ { \prime } ) , \varphi ( s _ { t } , \pi ) ) )$ . Note that the definition of $\Psi \big ( s _ { t } , \varphi ( s _ { t } , \pi ) \big )$ may be expressed in terms of a KL:
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\Psi \big ( s _ { t } , \varphi \big ( s _ { t } , \pi \big ) \big ) = \underset { \pi ^ { \prime } \in \Pi } { \arg \operatorname* { m i n } } \frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { K L } } \big ( P _ { \pi ^ { \prime } } \big ( s _ { t + k } \big | s _ { t } \big ) \big | \big | K \big ( s _ { t + k } \big | s _ { t } , \pi \big ) \big ) .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Therefore we have,
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\begin{array} { r l r } { { \frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { K L } } \big ( P _ { \Psi ( s _ { t } , \varphi ( s _ { t } , \pi ) ) } { \big ( } s _ { t + k } | s _ { t } \big ) \big | | K ( s _ { t + k } | s _ { t } , \pi ) \big ) } } \\ & { } & { \leq \frac { 1 } { \overline { { w } } } \displaystyle \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { K L } } \big ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) \big ) . } \end{array}
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
By condition 8 we have,
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { K L } } ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) ) \leq \epsilon ^ { 2 } / 8 .
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
Jensen’s inequality on the sqrt function then implies
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } \sqrt { 2 D _ { \mathrm { K L } } ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) ) } \le \epsilon / 2 .
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
Pinsker’s inequality now yields,
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { T V } } \big ( P _ { \pi } \big ( s _ { t + k } \big | s _ { t } \big ) \big | \big | K \big ( s _ { t + k } \big | s _ { t } , \pi \big ) \big ) \leq \epsilon / 2 .
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
Similarly Jensen’s and Pinsker’s inequality on the LHS of Equation 43 yields
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { T V } } \big ( P _ { \Psi ( s _ { t } , \varphi ( s _ { t } , \pi ) ) } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) \big ) \leq \epsilon / 2 .
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
The triangle inequality and Equations 46 and 47 then give us,
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\begin{array} { l } { \displaystyle \frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } D _ { \mathrm { T V } } \big ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | P _ { \Psi ( s , \varphi ( s , \pi ) ) } ( s _ { t + k } | s _ { t } ) \big ) } \\ { \displaystyle \le \frac { 1 } { \overline { { w } } } \sum _ { k = 1 } ^ { c } \gamma ^ { k - 1 } w _ { k } \big ( D _ { \mathrm { T V } } ( P _ { \pi } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) ) + D _ { \mathrm { T V } } ( P _ { \Psi ( s _ { t } , \varphi ( s _ { t } , \pi ) ) } ( s _ { t + k } | s _ { t } ) | | K ( s _ { t + k } | s _ { t } , \pi ) ) \big ) } \end{array}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
as desired.
|
| 448 |
+
|
| 449 |
+
# C EXPERIMENTAL DETAILS
|
| 450 |
+
|
| 451 |
+
# C.1 ENVIRONMENTS
|
| 452 |
+
|
| 453 |
+
The environments for Ant Maze, Ant Push, and Ant Fall are as described in Nachum et al. (2018). During training, target $( x , y )$ locations are selected randomly from all possible points in the environment (in Ant Fall, the target includes a $z$ coordinate as well). Final results are evaluated on a single difficult target point, equal to that used in Nachum et al. (2018).
|
| 454 |
+
|
| 455 |
+
The Point Maze is equivalent to the Ant Maze, with size scaled down by a factor of 2 and the agent replaced with a point mass, which is controlled by actions of dimension two – one action determines a rotation on the pivot of the point mass and the other action determines a push or pull on the point mass in the direction of the pivot.
|
| 456 |
+
|
| 457 |
+
For the ‘Images’ versions of these environments, we zero-out the $x , y$ coordinates in the observation and append a low-resolution $5 \times 5 \times 3$ top-down view of the environment. The view is centered on the agent and each pixel covers the size of a large block (size equal to width of the corridor in Ant Maze). The 3 channels correspond to (1) immovable blocks (walls, gray in the videos), (2) movable blocks (shown in red in videos), and (3) chasms where the agent may fall.
|
| 458 |
+
|
| 459 |
+

|
| 460 |
+
Figure 5: The tasks we consider in this paper. Each task is a form of navigation. The agent must navigate itself (or a small red block in ‘Block’ tasks) to the target location (green arrow). We also show an example top-down view image (from an episode on the Ant Maze task). The image is centered on the agent and shows walls and blocks (at times split across multiple pixels).
|
| 461 |
+
|
| 462 |
+
The Ant Block environment puts the ant in a $1 6 \times 1 6$ square room next to a $0 . 8 \times 0 . 8 \times 0 . 4$ small movable block. The agent is rewarded based on negative L2 distance of the block to a desired target location. During training, these target locations are sampled randomly from all possible locations. Evaluation is on a target location diagonally opposite the ant.
|
| 463 |
+
|
| 464 |
+
The Ant Block Maze environment consists of the same ant and small movable block in a $\supset$ -shaped corridor. During training, these target locations are sampled randomly from all possible locations. Evaluation is on a target location at the end of the corridor.
|
| 465 |
+
|
| 466 |
+
# C.2 TRAINING DETAILS
|
| 467 |
+
|
| 468 |
+
We follow the basic training details used in Nachum et al. (2018). Some differences are listed below:
|
| 469 |
+
|
| 470 |
+
• We input the whole observation to the lower-level policy (Nachum et al. (2018) zero-out the $x , y$ coordinates for the lower-level policy).
|
| 471 |
+
• We use a Huber function for $D$ , the distance function used to compute the low-level reward.
|
| 472 |
+
• We use a goal dimension of size 2. We train the higher-level policy to output actions in $[ - 1 0 , 1 0 ] ^ { 2 }$ . These actions correspond to desired deltas in state representation.
|
| 473 |
+
• We use a Gaussian with standard deviation 5 for high-level exploration.
|
| 474 |
+
• Additional differences in low-level training (e.g. reward weights and discounting) are implemented according to Section 5.
|
| 475 |
+
|
| 476 |
+
We parameterize $f _ { \theta }$ with a feed-forward neural network with two hidden layers of dimension 100 using relu activations. The network structure for $\varphi _ { \theta }$ is identical, except using hidden layer dimensions 400 and 300. We also parameterize $\varphi ( s , \pi ) : = f _ { \boldsymbol \theta } ( s ) + \varphi _ { \boldsymbol \theta } ( s , \pi )$ . These networks are trained with the Adam optimizer using learning rate 0.0001.
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
D OBJECTIVE FUNCTION EVALUATION
|
| 480 |
+
Figure 6: For our method, we utilize an objective based on Equation 8. The objective is similar to mutual information maximizing objectives (CPC; van den Oord et al. (2018)). We compare to variants of our method that are implemented more in the style of CPC. Although we find that using a dot product rather than distance function $D$ is detrimental, a number of distance-based variants of our approach may perform similarly.
|
| 481 |
+
|
| 482 |
+
E $\beta$ -VAE
|
| 483 |
+
|
| 484 |
+

|
| 485 |
+
Figure 7: We provide additional results comparing to variants of $\beta$ -VAE (Higgins et al., 2016). We find that even with this additional hyperparameter, the VAE approach to representation learning does not perform well outside of the simple point mass environment. The drawback of the VAE is that it is encouraged to reconstruct the entire observation, despite the fact that much of it is unimportant and possibly exhibits high variance (e.g. ant joint velocities). This means that outside of environments with high-information state observation features, a VAE approach to representation learning will suffer.
|
| 486 |
+
|
| 487 |
+
# F GENERALIZATION CAPABILITY
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
Figure 8: We evaluate the ability of our learned representations to transfer from one task to another. For these experiments, we took a representation function $f$ learned on Ant Maze, fixed it, and then used it to learn a hierarchical policy on a completely different task. We evaluated the ability of the representation to transfer to “Reflected Ant Maze” (same as Ant Maze but the maze shape is changed from $\cdot \supset '$ to $\bullet _ { \bigcap } ,$ ) and “Ant Push”. We find that the representations are robust these changes to the environment and can generalize successfully. We are able to learn well-performing policies in these distinct environments even though the representation used was learned with respect to a different task.
|
| 491 |
+
|
| 492 |
+
# G ADDITIONAL QUALITATIVE RESULTS
|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
Figure 9: We replicate the results of Figure 2 but with representations learned according to data collected by a random higher-level policy. In this setting, when there is even less of a connection between the representation learning objective and the task objective, our method is able to recover near-ideal representations.
|
| 496 |
+
|
| 497 |
+
# H COMPARISON TO HIRO
|
| 498 |
+
|
| 499 |
+

|
| 500 |
+
Figure 10: Results of our method compared to the original formulation of HIRO (Nachum et al., 2018). The representation used in the original formulation of HIRO is a type of oracle - sub-goals are defined as only the position-based (i.e., not velocity-based) components of the agent observation. In our own experiments, we found this method to perform similarly to the XY oracle in non-image tasks. However, when the state observation is more complex (images) performance is much worse.
|
| 501 |
+
|
| 502 |
+
Algorithm 1 Representation learning for hierarchical RL.
|
| 503 |
+
|
| 504 |
+
Input: Replay buffer $\mathcal { D }$ , number of training steps $N$ , batch size $B$ , parameterizations $f _ { \theta } , \varphi _ { \theta } , \pi _ { \mathrm { h i } } ^ { \phi } , \bar { \pi } _ { \mathrm { l o } } ^ { \phi }$ y
|
| 505 |
+
|
| 506 |
+
function $E s t L o g P a r t ( \widetilde { S } , s _ { t } , a _ { t : t + c - 1 } )$ ## Equation 15 Return $\begin{array} { r } { \log \frac { 1 } { | \widetilde { S } | } \sum _ { \widetilde { s } \in \widetilde { S } } \exp ( - D ( f _ { \theta } ( \widetilde { s } ) , \varphi _ { \theta } ( s _ { t } , a _ { t : t + c - 1 } ) ) ) } \end{array}$ ).
|
| 507 |
+
|
| 508 |
+
# end function
|
| 509 |
+
|
| 510 |
+
function CompLowRewar $d ( g , s _ { t } , s ^ { \prime } , a _ { t : t + c - 1 } , L )$ ## Equation 18 Return $- D ( f _ { \theta } ( s ^ { \prime } ) , g ) + D ( f _ { \theta } ( s ^ { \prime } ) , \varphi _ { \theta } ( s _ { t } , a _ { t : t + c - 1 } ) ) + L$ .
|
| 511 |
+
|
| 512 |
+
# end function
|
| 513 |
+
|
| 514 |
+
function CompReprLoss $\ : \ : \beta ( s _ { t } , s ^ { \prime } , a _ { t : t + c - 1 } , \tilde { s } , L ) \ :$ ## Equation $^ { l 4 }$ Compute attractive term $J _ { \mathrm { { a t t } } } = D ( f _ { \theta } ( s ^ { \prime } ) , \varphi _ { \theta } ( s _ { t } , a _ { t : t + c - 1 } ) )$ . Compute repulsive term $J _ { \mathrm { r e p } } = \exp ( - D ( f _ { \theta } ( \tilde { s } ) , \varphi _ { \theta } ( s _ { t } , a _ { t : t + c - 1 } ) ) - \mathrm { s t o p g r a d } ( L ) ) .$ Return Jatt + Jrep.
|
| 515 |
+
|
| 516 |
+
# end function
|
| 517 |
+
|
| 518 |
+
for $T = 1$ to $N$ do
|
| 519 |
+
|
| 520 |
+
Sample experience $g , s , a , r , s ^ { \prime }$ and add to replay buffer $\mathcal { D }$ (Nachum et al., 2018).
|
| 521 |
+
Sample batch of $c$ -step transitions $\{ ( g ^ { ( i ) } , s _ { t : t + c } ^ { ( i ) } , a _ { t : t + c - 1 } ^ { ( i ) } , r _ { t : t + c - 1 } ^ { ( i ) } ) \} _ { i = 1 } ^ { B } \sim \mathcal { D }$ .
|
| 522 |
+
Sample indices into transition: $\{ k ^ { ( i ) } \} _ { i = 1 } ^ { B } \sim [ 1 , c ] ^ { B }$ .
|
| 523 |
+
Sample batch of states $\widetilde { S } = \{ \tilde { s } ^ { ( i ) } \} _ { i = 1 } ^ { B } \sim \mathcal { D }$ .
|
| 524 |
+
Estimate log-partitions $\{ L ^ { ( i ) } \} _ { i = 1 } ^ { B } = \{ E s t L o g P a r t ( \widetilde { S } , s _ { t } ^ { ( i ) } , a _ { t : t + c - 1 } ^ { ( i ) } ) \} _ { i = 1 } ^ { B } .$
|
| 525 |
+
|
| 526 |
+
// Reinforcement learning
|
| 527 |
+
|
| 528 |
+
Update Compute low-level rewards $\pi _ { \mathrm { l o } } ^ { \phi }$ i=1 (Nachum et al., 2018) with experience $\{ \tilde { r } ^ { ( i ) } \} _ { i = 1 } ^ { B } = \{ C o m p L o w R e w a r d ( g ^ { ( i ) } , s _ { t } ^ { ( i ) } , s _ { t + k ^ { ( i ) } } ^ { ( i ) } , a _ { t : t + c - 1 } ^ { ( i ) } , L ^ { ( i ) } ) \} _ { i = 1 } ^ { B } .$ $\{ ( g ^ { ( i ) } , s _ { t + k ^ { ( i ) } - 1 } ^ { ( i ) } , a _ { t + k ^ { ( i ) } - 1 } ^ { ( i ) } , \tilde { r } ^ { ( i ) } , s _ { t + k ^ { ( i ) } } ^ { ( i ) } ) \} _ { i = 1 } ^ { B } .$ i Update $\pi _ { \mathrm { h i } } ^ { \phi }$ (Nachum et al., 2018) with experience $\{ ( g ^ { ( i ) } , s _ { t : t + c } ^ { ( i ) } , a _ { t : t + c - 1 } ^ { ( i ) } , r _ { t : t + c - 1 } ^ { ( i ) } ) \} _ { i = 1 } ^ { B }$ .
|
| 529 |
+
|
| 530 |
+
// RepresentaCompute los $\begin{array} { r } { \mathfrak { s } J = \frac { 1 } { B } \sum _ { i = 1 } ^ { \tilde { B } } w _ { k ^ { ( i ) } } \gamma ^ { k ^ { ( i ) } - 1 } C o m p R e p r L o s s ( k ^ { ( i ) } , \mathfrak { s } _ { t } ^ { ( i ) } , \mathfrak { s } _ { t + k ^ { ( i ) } } ^ { ( i ) } , \mathfrak { a } _ { t : t + c - 1 } ^ { ( i ) } , \tilde { \mathfrak { s } } ^ { ( i ) } , L ^ { ( i ) } ) . } \end{array}$
|
| 531 |
+
|
| 532 |
+
Update $\theta$ based on $\nabla _ { \boldsymbol { \theta } } J$ .
|
| 533 |
+
|
| 534 |
+
# end for
|
md/train/HJGXzmspb/HJGXzmspb.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING AND INFERENCE WITH INTEGERS IN DEEP NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Shuang $\mathbf { W } \mathbf { u } ^ { 1 }$ , Guoqi $\mathbf { L i } ^ { 1 }$ , Feng Chen2, Luping Shi1
|
| 4 |
+
|
| 5 |
+
1Department of Precision Instrument
|
| 6 |
+
2Department of Automation
|
| 7 |
+
Center for Brain Inspired Computing Research
|
| 8 |
+
Beijing Innovation Center for Future Chip
|
| 9 |
+
Tsinghua University
|
| 10 |
+
{lpshi,chenfeng}@mail.tsinghua.edu.cn
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Researches on deep neural networks with discrete parameters and their deployment in embedded systems have been active and promising topics. Although previous works have successfully reduced precision in inference, transferring both training and inference processes to low-bitwidth integers has not been demonstrated simultaneously. In this work, we develop a new method termed as “WAGE” to discretize both training and inference, where weights (W), activations (A), gradients (G) and errors (E) among layers are shifted and linearly constrained to low-bitwidth integers. To perform pure discrete dataflow for fixed-point devices, we further replace batch normalization by a constant scaling layer and simplify other components that are arduous for integer implementation. Improved accuracies can be obtained on multiple datasets, which indicates that WAGE somehow acts as a type of regularization. Empirically, we demonstrate the potential to deploy training in hardware systems such as integer-based deep learning accelerators and neuromorphic chips with comparable accuracy and higher energy efficiency, which is crucial to future AI applications in variable scenarios with transfer and continual learning demands.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Recently deep neural networks (DNNs) are being widely used for numerous AI applications (Krizhevsky et al., 2012; Hinton et al., 2012; Silver et al., 2016). Depending on the massive tunable parameters, DNNs are considered to have powerful multi-level feature extraction and representation abilities. However, training DNNs needs energy-intensive devices such as GPU and CPU with high precision (float32) processing units and abundant memory, which has greatly challenged their extensive applications for portable devices. In addition, a state-of-art network often has far more weights and effective capacity to shatter all training samples (Zhang et al., 2016), leading to overfitting easily.
|
| 19 |
+
|
| 20 |
+
As a result, there is much interest in reducing the size of network during inference (Hubara et al., 2016; Rastegari et al., 2016; Li et al., 2016), as well as dedicated hardware for commercial solutions (Jouppi et al., 2017; Chen et al., 2017; Shi et al., 2015). Due to the accumulation in stochastic gradient descent (SGD) optimization, the precision demand for training is usually higher than inference (Hubara et al., 2016; Li et al., 2017). Therefore, most of the existing techniques only focus on the deployment of a well-trained compressed network, while still keeping high precision and computational complexity during training. In this work, we address this problem as how to process both training and inference with low-bitwidth integers, which is essential for implementing DNNs in dedicated hardware. To this end, two fundamental issues are addressed for discretely training DNNs: i) how to quantize all the operands and operations, and ii) how many bits or states are needed for SGD computation and accumulation.
|
| 21 |
+
|
| 22 |
+
With respect to the issues, we propose a framework termed as “WAGE” that constrains weights (W), activations (A), gradients (G) and errors (E) among all layers to low-bitwidth integers in both training and inference. Firstly, for operands, linear mapping and orientation-preserved shifting are applied to achieve ternary weights, 8-bit integers for activations and gradients accumulation. Secondly, for operations, batch normalization (Ioffe & Szegedy, 2015) is replaced by a constant scaling factor. Other techniques for fine-tuning such as SGD optimizer with momentum and L2 regularization are simplified or abandoned with little performance degradation. Considering the overall bidirectional propagation, we completely streamline inference into accumulate-compare cycles and training into low-bitwidth multiply-accumulate (MAC) cycles with alignment operations, respectively.
|
| 23 |
+
|
| 24 |
+
We heuristically explore the bitwidth requirements of integers for error computation and gradient accumulation, which have rarely been discussed in previous works. Experiments indicate that it is the relative values (orientations) rather than absolute values (orders of magnitude) in error that guides previous layers to converge. Moreover, small values have negligible effects on previous orientations though propagated layer by layer, which can be partially discarded in quantization. We leverage these phenomena and use an orientation-preserved shifting operation to constrain errors. As for the gradient accumulation, though weights are quantized to ternary values in inference, a relatively higher bitwidth is indispensable to store and accumulate gradient updates.
|
| 25 |
+
|
| 26 |
+
The proposed framework is evaluated on MNIST, CIFAR10, SVHN, ImageNet datasets. Comparing to those who only discretize weights and activations at inference time, it has comparable accuracy and can further alleviate overfitting, indicating some type of regularization. WAGE produces pure bidirectional low-precision integer dataflow for DNNs, which can be applied for training and inference in dedicated hardware neatly. We publish the code on GitHub1.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
We mainly focus on reducing precision of operands and operations in both training and inference. Orthogonal and complementary techniques for reducing complexity like network compression, pruning (Han et al., 2015; Zhou et al., 2017) and compact architectures (Howard et al., 2017) are impressively efficient but outside the scope this paper.
|
| 31 |
+
|
| 32 |
+
Weight and activation Courbariaux et al. (2015); Hubara et al. (2016) propose methods to train DNNs with binary weights (BC) and activations (BNN) successively. They add noises to weights and activations as a form of regularization but real-valued gradients are accumulated in real-valued variables, suggesting that high precision accumulation is likely required for SGD optimization. XNOR-Net (Rastegari et al., 2016) has a filter-wise scaling factor for weights to improve the performance. Convolutions in XNOR-Net can be implemented efficiently using XNOR logical units and bit-count operations. However, these floating-point factors are calculated simultaneously during training, which generally aggravates the training effort. In TWN (Li et al., 2016) and TTQ (Zhu et al., 2016) two symmetric thresholds are introduced to constrain the weights to be ternary-valued: $\{ + 1 , 0 , - 1 \}$ . They claimed a tradeoff between model complexity and expressive ability.
|
| 33 |
+
|
| 34 |
+
Gradient computation and accumulation DoReFa-Net (Zhou et al., 2016) quantizes gradients to low-bitwidth floating-point numbers with discrete states in the backward pass. TernGrad (Wen et al., 2017) quantizes gradient updates to ternary values to reduce the overhead of gradient synchronization in distributed training. Nevertheless, weights in DoReFa-Net and TernGrad are stored and updated with float32 during training like previous works. Besides, the quantization of batch normalization and its derivative is ignored. Thus, the overall computation graph for the training process is still presented with float32 and more complex with external quantization. Generally, it is difficult to apply DoReFa-Net training in an integer-based hardware directly, but it shows potential for exploring high-dimensional discrete spaces with discrete gradient descent directions.
|
| 35 |
+
|
| 36 |
+
# 3 WAGE QUANTIZATION
|
| 37 |
+
|
| 38 |
+
The main idea of WAGE quantization is to constrain four operands to low-bitwidth integers: weight $W$ and activation $^ { a }$ in inference, error $e$ and gradient $\textbf { { g } }$ in backpropagation training, see Figure 1. We extend the original definition of errors to multi-layer: error $e$ is the gradient of activation $\textbf { \em a }$ for the perspective of each convolution or fully-connected layer, while gradient $\textbf { { g } }$ particularly refers to the gradient accumulation of weight $W$ . Considering the $i$ -th layer of a feed-forward network, we
|
| 39 |
+
|
| 40 |
+
have:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
e ^ { i } = { \frac { \partial { \mathcal { L } } } { \partial a ^ { i } } } , \pmb { g } ^ { i } = { \frac { \partial { \mathcal { L } } } { \partial W ^ { i } } }
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\mathcal { L }$ is the loss function. We separate these two terms that are mixed up in most existing schemes. The gradient of weight $\textbf { { g } }$ and the gradient of activation $e$ flow to different paths in each layer, which is a fork both in inference and in backward training and generally acts as node of MAC operations.
|
| 47 |
+
|
| 48 |
+
For the forward propagation in the $i$ -th layer, assuming that weights are stored and accumulated with $k _ { G }$ -bit integers, then numerous works strive for a better quantization function $Q _ { W } ( \cdot )$ that maps higher precision weights to their $k _ { W }$ -bit reflections, for example, $[ - 0 . 9 , 0 . 1 , 0 . 7 ]$ to $[ - 1 , 0 , 1 ]$ . Although weights are accumulated with high precision like float32, the deployment of the reflections in dedicated hardware are much more memory efficient after training. Activations are quantized with function $Q _ { A } ( \cdot )$ to $k _ { A }$ bits to align the increased bitwidth caused by MACs. Weights and activations are discretized to even binary values in previous works, then MACs degrade into logical and bit-count operations that are extremely efficient (Rastegari et al., 2016).
|
| 49 |
+
|
| 50 |
+
For the backward propagation in the $i$ -th layer, the gradients of activations and weights are calculated by the derivatives of MACs that are generally considered to be in 16-bit floating-point precision at least. As illustrated in Figure 1, the MACs between $k _ { A }$ -bit inputs and $k _ { W }$ -bit weights will increase the bitwidth of outputs to $[ k _ { A } + k _ { W } - 1 ]$ in signed integer representation, and the similar broadening happens to errors $e$ as well. In consideration of training with only low-bitwidth integers, we propose additional functions $Q _ { E } ( \cdot )$ and $Q _ { G } ( \cdot )$ to constrain bitwidth of $e$ and $\textbf { { g } }$ to $k _ { E }$ bits and $k _ { G }$ bits, respectively. In general, where there is a MAC operation, there are quantization operators named $Q _ { W } ( \cdot ) , \bar { Q _ { A } ( \cdot ) } , \bar { Q _ { G } ( \cdot ) }$ and $Q _ { E } ( \cdot )$ in inference and backpropagation.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 1: Four operators $Q _ { W } ( \cdot )$ , $Q _ { A } ( \cdot )$ , $Q _ { G } ( \cdot )$ , $Q _ { E } ( \cdot )$ added in WAGE computation dataflow to reduce precision, bitwidth of signed integers are below or on the right of arrows, activations are included in MAC for concision.
|
| 54 |
+
|
| 55 |
+
# 3.1 SHIFT-BASED LINEAR MAPPING AND STOCHASTIC ROUNDING
|
| 56 |
+
|
| 57 |
+
In WAGE quantization, we adopt a linear mapping with $k$ -bit integers for simplicity, where continuous and unbounded values are discretized with uniform distance $\sigma$ :
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\sigma ( k ) = 2 ^ { 1 - k } , k \in \mathbb { N } _ { + }
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Then the basic quantization function that converts a floating-point number $x$ to its $k$ -bitwidth signed integer representation can be formulated as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
Q ( x , k ) = C l i p \left\{ \sigma ( k ) \cdot r o u n d \left[ \frac { x } { \sigma ( k ) } \right] , - 1 + \sigma ( k ) , 1 - \sigma ( k ) \right\}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where round approximates continuous values to their nearest discrete states. Clip is the saturation function that clips unbounded values to $[ - 1 + \sigma , 1 - \sigma ]$ , where the negative maximum value $- 1$ is removed to maintain symmetry. For example, $Q ( x , 2 )$ quantizes $\{ - 1 , 0 . 2 , 0 . 6 \}$ to $\{ - 0 . 5 , 0 , 0 . 5 \}$ . Equation 3 is merely used for simulation in floating-point hardware like GPU, whereas in a fixedpoint device, quantization and saturation is satisfied automatically.
|
| 70 |
+
|
| 71 |
+
Before applying linear mapping in some operands (e.g., error), we introduce an additional monolithic scaling factor for shifting values distribution to an appropriate order of magnitude, otherwise values will be all saturated or cleared by Equation 3. The scaling factor is calculated by $S h i f t$ function and then divided in later steps:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
S h i f t ( x ) = 2 ^ { r o u n d ( \log _ { 2 } x ) }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Finally, we propose stochastic rounding to substitute small and real-valued updates for gradient accumulation in training. Section 3.3.4 will detail the implementation of operator $Q _ { G } ( \cdot )$ , where high bitwidth gradients are constrained to $k _ { G }$ -bit integers stochastically by a 16-bit random number generator. Figure 2 summarizes quantization methods used in WAGE.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 2: Quantization methods used in WAGE. The notation $P , \pmb { x } , \lfloor \cdot \rfloor$ and $\lceil \cdot \rceil$ denotes probability, vector, floor and ceil, respectively. $S h i f t ( \cdot )$ refers to Equation 4 with a certain argument.
|
| 81 |
+
|
| 82 |
+
# 3.2 WEIGHT INITIALIZATION
|
| 83 |
+
|
| 84 |
+
In previous works, weights are binarized directly by sgn function or ternarized by threshold parameters calculated during training. However, BNN fails to converge without batch normalization because weight values $\pm 1$ are rather big for a typical DNN. Batch normalization not only efficiently avoids the problem of exploding and vanishing gradients, but also alleviates the demand for proper initialization. However, normalizing outputs for each layer and computing their gradients are quite complex without floating point unit (FPU). Besides, the moving averages of batch outputs occupy external memory. BNN shows a shift-based variation of batch normalization but it is hard to transform all of the elements to the fixed-point representations. As a result, weights should be cautiously initialized in this work where batch normalization is simplified to a constant scaling layer. A modified initialization method based on MSRA (He et al., 2015) can be formulated as:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
W \sim U ( - L , + L ) , L = m a x \{ \sqrt { 6 / n _ { i n } } , L _ { m i n } \} , L _ { m i n } = \beta \sigma
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $n _ { i n }$ is the layer fan-in number, and the original limit $\sqrt { 6 / n _ { i n } }$ in MSRA is calculated to keep same variance between inputs and outputs of the same layer theoretically. The additional limit $L _ { m i n }$ is a minimum value that the uniform distribution $U$ should reach, and $\beta$ is a constant greater than 1 to create overlaps between minimum step size $\sigma$ and maximum value $L$ . In case of $k _ { W }$ -bit linear mapping, if weights $W$ are quantized directly with original limits, we will get all-zero tensors when bitwidth $k _ { W }$ is small enough, e.g., 4, or fan-in $n _ { i n }$ is wide enough, where initialized weights may never reach the minimum step $\sigma$ presented by fixed-point integers. So $L _ { m i n }$ ensures that weights can go beyond $\sigma$ and quantized to non-zero values after $Q _ { W } ( \cdot )$ when initialized randomly.
|
| 91 |
+
|
| 92 |
+
# 3.3 QUANTIZATION DETAILS
|
| 93 |
+
|
| 94 |
+
# 3.3.1 WEIGHT $Q _ { W } ( \cdot )$
|
| 95 |
+
|
| 96 |
+
The modified initialization in Equation 5 will amplify weights holistically and guarantee their proper distribution, then $W$ is quantized directly with Equation 3:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\boldsymbol { W _ { q } } = \boldsymbol { Q _ { W } } ( \boldsymbol { W } ) = \boldsymbol { Q } ( \boldsymbol { W } , \boldsymbol { k _ { W } } )
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
It should be noted that the variance of weights is scaled compared to the original limit, which will cause exploding of network’s outputs. To alleviate the amplification effect, XNOR-Net proposed a filter-wise scaling factor calculated continuously with full precision. In consideration of integer implementation, we introduce a layer-wise shift-based scaling factor $\alpha$ to attenuate the amplification effect:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\alpha = m a x \{ S h i f t ( L _ { m i n } / L ) , 1 \}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\alpha$ is a pre-defined constant for each layer determined by the network structure. The modified initialization and attenuation factor $\alpha$ together approximates floating-point weights to their integer representations, except that $\alpha$ takes effect after activations to maintain precision of weights presented by $k _ { W }$ -bit integers.
|
| 109 |
+
|
| 110 |
+
# 3.3.2 ACTIVATION $Q _ { A } ( \cdot )$
|
| 111 |
+
|
| 112 |
+
As stated above, the bitwidth of operands increases after MACs. Then a typical CNN is usually followed with pooling, normalization and activation. Average pooling is avoided because mean operations will increase precision demand. Besides, we hypothesize that batch outputs of each hidden layer approximately have zero-mean, then batch normalization degenerates into to a scaling layer where trainable and batch-calculated scaling parameters are replaced by $\alpha$ mentioned in Equation 7. If activations are presented in $k _ { A }$ bits, the overall quantization of activations can be formulated as:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\pmb { a } _ { q } = Q _ { A } ( \pmb { a } ) = Q ( \pmb { a } / \alpha , k _ { A } )
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
# 3.3.3 ERROR $Q _ { E } ( \cdot )$
|
| 119 |
+
|
| 120 |
+
Errors $e$ are calculated layer by layer using the chain rule during training. Although the computation graph of backpropagation is similar to the inference, the inputs are the gradients of $\mathcal { L }$ , which are relatively small compared to actual inputs for networks. More importantly, the errors are unbounded and might have significantly larger ranges than that of activations, e.g., $[ 1 0 ^ { - 9 } , 1 0 ^ { - 4 } ]$ . DoReFa-Net first applies an affine transform on $e$ to map them into $[ - 1 , 1 ]$ , and then inverts the transform after quantization. Thus, the quantized $e$ are still presented as float32 numbers with discrete states and mostly small values.
|
| 121 |
+
|
| 122 |
+
However, experiments uncover that it is the orientations rather than orders of magnitude in errors that guides previous layers to converge, then the inverse transformation after quantization in DoReFa-Net is no longer needed. The orientation-only preservation prompts us to propagate errors with integer√ √ thoroughly, where error distribution is firstly scaled into $[ - { \sqrt { 2 } } , + { \sqrt { 2 } } ]$ by dividing a shift factor as shown in Figure 2 and then quantized by $Q ( e , k _ { E } )$ :
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\pmb { e _ { q } } = Q _ { E } ( \pmb { e } ) = Q ( \pmb { e } / S h i f t ( m a x \{ | \pmb { e } | \} ) , k _ { E } )
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $m a x \{ | e | \}$ extracts the layer-wise maximum absolute value among all elements in error $e$ , multi-channel for convolution and multi-sample for batch training. The quantization of error discards large proportion of values smaller than $\sigma$ , we will discuss the influence on accuracy later.
|
| 129 |
+
|
| 130 |
+
# 3.3.4 GRADIENT $Q _ { G } ( \cdot )$
|
| 131 |
+
|
| 132 |
+
Since we only preserve relative values of error after shifting, the gradient updates $\textbf { { g } }$ derived from MACs between backward errors $e$ and forward activations $^ { a }$ are shifted consequently. We first rescale gradients $\textbf { { g } }$ with another scaling factor and then bring in shift-based learning rate $\eta$ :
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
g _ { s } = \eta \cdot g / S h i f t ( m a x \{ | g | \} )
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
where $\eta$ is an integer power of 2. The shifted gradients $\mathbf { \nabla } _ { \mathbf { { \boldsymbol { g } } } _ { s } }$ represent for minimum step numbers and directions for updating weights. If weights are stored with $k _ { G }$ -bit numbers, the minimum step of modification will be $\pm 1$ for integers and $\pm \sigma ( k _ { G } )$ for floating-point values, respectively. The implement of learning rate $\eta$ here is quite different from that in a vanilla DNN based on float32. In WAGE, there only remain directions for weights to change and the step sizes are integer multiples of minimum step $\sigma$ . Shifted gradients $\mathbf { \nabla } _ { \mathbf { { \boldsymbol { g } } } _ { s } }$ may get greater than 1 if $\eta$ is 2 or bigger to accelerate training at the beginning, or smaller than 0.5 during latter half of training when learning rate decay is usually applied. As illustrated in Figure 2, to substitute accumulation of small gradients in latter case, we separate $\mathbf { \nabla } _ { \mathbf { { \boldsymbol { g } } } _ { s } }$ into integer parts and decimal parts, then use a 16-bit random number generator to constrain high bitwidth $\mathbf { \nabla } _ { \mathbf { { \boldsymbol { g } } } _ { s } }$ to $k _ { G }$ -bit integers stochastically:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\Delta W = Q _ { G } ( g ) = \sigma ( k _ { G } ) \cdot s g n ( g _ { s } ) \cdot \Big \{ \lfloor | g _ { s } | \rfloor + B e r n o u l l i ( | g _ { s } | - \lfloor | g _ { s } | \rfloor ) \Big \}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where Bernoulli (Zhou et al., 2016) stochastically samples decimal parts to either 0 or 1. With proper setting of $k _ { G }$ , quantization of gradients will restrict the minimum step size, which may avoid local minimum and overfitting. Furthermore, the gradients will be ternary values when $\eta$ is not greater than 1, which reduces communication costs for distributed training (Wen et al., 2017). At last, weights $W$ might exceed the range $[ - 1 + \sigma , 1 - \sigma ]$ presented by $k _ { G }$ -bit integers after updating with discrete increments $\Delta \mathbf { W }$ . So $C l i p$ function is indispensable to saturate and make sure there are only $2 ^ { k _ { G } - 1 } - 1$ states for weights accumulation. In case of the $t$ -th iteration, we have:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
W _ { t + 1 } = C l i p \left\{ { \cal W } _ { t } - \Delta { \cal W } _ { t } , - 1 + \sigma ( k _ { G } ) , 1 - \sigma ( k _ { G } ) \right\}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
# 3.4 MISCELLANEOUS
|
| 151 |
+
|
| 152 |
+
From the above, we have illustrated our quantization methods for weights, activations, gradients and errors. See Algorithm 1 for the detailed computation graph. There remain some issues to specify in an overall training process with only integers.
|
| 153 |
+
|
| 154 |
+
Gradient descent optimizer like Momentum, RMSProp and Adam contains at least one copy of gradient updates $\Delta \mathbf { W }$ or their moving average, doubling memory consumption for weights during training, which is partially equivalent to use bigger $k _ { G }$ . Since the weight updates $\Delta \mathbf { W }$ are quantized to integer multiple of $\sigma$ and scaled by $\eta$ , we adopt pure mini-batch SGD without any form of momentum or adaptive learning rate to show the potential of reducing storage demands.
|
| 155 |
+
|
| 156 |
+
Although L2 regularization works quite well for many large-scale DNNs where overfitting occurs commonly, WAGE removes small values in Equation 3 and introduces randomness in Equation 11, acting as certain types of regularization and can get comparable accuracy in later experiments. Thus, we remain L2 weight decay and dropout as supplementary regularization methods.
|
| 157 |
+
|
| 158 |
+
The Softmax layer and cross-entropy criterion are widely adopted in classification tasks but the calculation of $e ^ { x }$ can hardly be applied in low-bitwidth linear mapping occasions. For tasks with small number of categories, we avoid Softmax layer and apply mean-square-error criterion but omit mean operation to form a sum-square-error (SSE) criterion since shifted errors will get the same values in Equation 9.
|
| 159 |
+
|
| 160 |
+
# 4 EXPERIMENTS
|
| 161 |
+
|
| 162 |
+
In this section, we set W-A-G-E bits to 2-8-8-8 as default for all layers in a CNN or MLP. The bitwidth $k _ { W }$ is 2 for ternary weights, which implies that there are no multiplications during inference. Constant parameter $\beta$ is 1.5 to make equal probabilities for ternary weights when initialized randomly. Activations and errors should be of the same bitwidth since computation graph of backpropagation is similar to inference and might be applied in the same partition of hardware or memristor array (Sheridan et al., 2017). Although XNOR-Net achieves 1-bit activations, reducing errors to 4 or less bits dramatically degenerates accuracies in our tests, so the bitwidth $k _ { A }$ and $k _ { E }$ are increased to 8 simultaneously. Weights are stored with 8-bit integers during training and ternarized by two constant symmetrical thresholds during inference. We first build the computation graph for a vanilla network, then insert quantization nodes in forward propagation and override gradients in backward propagation for each layer on Tensorflow (Abadi et al., 2016). Our method is evaluated on MNIST, SVHN, CIFAR10 and ILSVRC12 (Russakovsky et al., 2015) and Table 1 shows the comparison results.
|
| 163 |
+
|
| 164 |
+
# 4.1 IMPLEMENT DETAILS
|
| 165 |
+
|
| 166 |
+
MNIST: A variation of LeNet-5 (LeCun et al., 1998) with 32C5-MP2-64C5-MP2-512FC-10SSE is adopted. The input grayscale images are regarded as activations and quantized by Equation 8 where $\alpha$ equals to 1. The learning rate $\eta$ in WAGE remains as 1 for the whole 100 epochs. We report average accuracy of 10 runs on the test set.
|
| 167 |
+
|
| 168 |
+
SVHN & CIFAR10: We use a VGG-like network (Simonyan & Zisserman, 2014) with $2 \times ( 1 2 8 { \bf C } 3 )$ - $\mathbf { M P } 2 . 2 \times ( 2 5 6 \mathbf { C } 3 ) \mathbf { - M P } 2 . 2 \times ( 5 1 2 \mathbf { C } 3 ) .$ -MP2-1024FC-10SSE. For CIFAR10 dataset, we follow the data augmentation in Lee et al. (2015) for training: 4 pixels are padded on each side, and a $3 2 \times 3 2$ patch is randomly cropped from the padded image or its horizontal flip. For testing, only single view of the original $3 2 \times 3 2$ image is evaluated. The model is trained with mini-batch size of 128 and totally 300 epochs. Learning rate $\eta$ is set to 8 and divided by 8 at epoch 200 and epoch 250. The original images are scaled and biased to the range of $[ - 1 , + 1 ]$ for 8-bit integer activation representation. As for SVHN dataset, we leave out randomly flip augmentation and reduce training epochs to 40 since it is a rather big dataset. The error rate is evaluated in the same way as MNIST.
|
| 169 |
+
|
| 170 |
+
ImageNet: WAGE framework is evaluated on ILSVRC12 dataset with AlexNet (Krizhevsky et al., 2012) model but removes dropout and local response normalization layers. Images are firstly resized to $2 5 6 \times 2 5 6$ then randomly cropped to $2 2 4 \times 2 2 4$ and horizontally flipped, followed by bias subtraction as CIFAR10. For testing, the single center crop in validation set is evaluated. Since ImageNet task is much difficult than CIFAR10 and has 1000 categories, it is hard to converge when applying SSE or hinge loss criterion in WAGE, so we add Softmax and remove quantizations in the last layer for fear of severe accuracy drop (Tang et al., 2017). The model is trained with mini-batch size of 256 and totally 70 epochs. Learning rate $\eta$ is set to 4 and divided by 8 at epoch 60 and epoch 65.
|
| 171 |
+
|
| 172 |
+
Table 1: Test or validation error rates $( \% )$ in previous works and WAGE on multiple datasets. Opt denotes gradient descent optimizer and withM means SGD with momentum, BN represents for batch normalization and 32 bits refers to float32, ImageNet top- $\mathbf { \nabla } \cdot \mathbf { k }$ format: top1/top5.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Method</td><td>kw</td><td>kA</td><td>kG</td><td>kE</td><td>Opt</td><td>BN</td><td>MNIST</td><td>SVHN</td><td>CIFAR10</td><td>ImageNet</td></tr><tr><td>BC</td><td>1</td><td>32</td><td>32</td><td>32</td><td>Adam</td><td>V</td><td>1.29</td><td>2.30</td><td>9.90</td><td>1</td></tr><tr><td>BNN</td><td>1</td><td>1</td><td>32</td><td>32</td><td>Adam</td><td>√</td><td>0.96</td><td>2.53</td><td>10.15</td><td>1</td></tr><tr><td>BWN1</td><td>1</td><td>32</td><td>32</td><td>32</td><td>withM</td><td>√</td><td>1</td><td>1</td><td>1</td><td>43.2/20.6</td></tr><tr><td>XNOR</td><td>1</td><td>1</td><td>32</td><td>32</td><td>Adam</td><td>√</td><td>-</td><td>1</td><td>1</td><td>55.8/30.8</td></tr><tr><td>TWN</td><td>2</td><td>32</td><td>32</td><td>32</td><td>withM</td><td>√</td><td>0.65</td><td>-</td><td>7.44</td><td>34.7/13.8</td></tr><tr><td>TTQ</td><td>2</td><td>32</td><td>32</td><td>32</td><td>Adam</td><td>√</td><td>-</td><td>1</td><td>6.44</td><td>42.5/20.3</td></tr><tr><td>DoReFa²</td><td>8</td><td>8</td><td>32</td><td>8</td><td>Adam</td><td>√</td><td>1</td><td>2.30</td><td>-</td><td>47.0/-</td></tr><tr><td>TernGrad3</td><td>32</td><td>32</td><td>2</td><td>32</td><td>Adam</td><td>√</td><td>1</td><td>1</td><td>14.36</td><td>42.4/19.5</td></tr><tr><td>WAGE</td><td>2</td><td>8</td><td>8</td><td>8</td><td>SGD</td><td>×</td><td>0.40</td><td>1.92</td><td>6.78</td><td>51.6/27.8</td></tr></table>
|
| 175 |
+
|
| 176 |
+
# 4.2 TRAINING CURVES AND REGULARIZATION
|
| 177 |
+
|
| 178 |
+
We further compare WAGE variations and a vanilla CNN on CIFAR10. The vanilla CNN has the same VGG-like architecture described above except that none quantization of any operand or operation is applied. We add batch normalization in each layer and Softmax for the last layer, replace SSE with cross-entropy criterion, and then use a L2 weight decay of 1e-4 and momentum of 0.9 for training. The learning rate is set to 0.1 and divided by 10 at epoch 200 and epoch 250. For variations of WAGE, pattern 28ff has no quantization nodes in backpropagation. Although the 28ff pattern has the same optimizer and learning rate annealing method as the vanilla pattern, we find that weight updates are decreased by the rescale factor $\alpha$ in Equation 7. Therefore, the learning rate for $2 8 \mathrm { f f }$ is amplified and tuned, which reduces the error rate by $3 \%$ . Figure 3 shows the training curves of three counterparts. It can be seen that the 2888 pattern has comparable convergence rate to the vanilla CNN, better accuracy than those who only discretize weights and activations in inference time, though slightly more volatile. The discretization of backpropagation somehow acts as another type of regularization and have significant error rate drop when decreasing learning rate $\eta$ .
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 3: Training curves of WAGE variations and a vanilla CNN on CIFAR10.
|
| 182 |
+
|
| 183 |
+
# 4.3 BITWIDTH OF ERRORS
|
| 184 |
+
|
| 185 |
+
The bitwidth $k _ { E }$ is set to 8 as default in previous experiments. To further explore a proper bitwidth and its truncated boundary, we firstly export errors from vanilla CNN for CIFAR10 after 100 training epochs. The histogram of errors in the last convolution layer among 128 mini-batch data is shown in Figure 4. It is obvious that errors approximately obey logarithmic normal distribution where values are relatively small and have significantly large range. When quantized with $k _ { E }$ -bit integers, a proper window function should be chosen to truncate the distribution while retaining the approximate orientations for backpropagation. For more details about the layerwise histograms of all W, A, G, E operands, see Figure 5.
|
| 186 |
+
|
| 187 |
+
Firstly, the upper (right) boundary is immobilized to the maximum absolute value among all elements in errors as described in Equation 9. Then the left boundary will be based on the bitwidth $k _ { E }$ . We conduct a series of experiments for $k _ { E }$ ranging from 4 to 15. The boxplot in Figure 4 indicates that 4-8 bits of errors represented by integers are enough for CIFAR10 classification task. Bitwidth 8 is chosen as default to match the 8-bit image color levels and most operands in the micro control unit (MCU). The histogram of errors in the same layer of WAGE-2888 shows that after being shifted and quantized layer by layer, the distribution of errors reshapes and mostly aggregates into truncated window. Thus, most information for orientations is retained. Besides, the smaller values in errors have negligible effects on previous orientations though accumulated layer by layer, which are partially discarded in quantization.
|
| 188 |
+
|
| 189 |
+
Since the width of the window has been optimized, we left-shift the window with factor $\gamma$ to explore its horizontal position. The right boundary can be formulated as $m a x \{ | e | \} / \gamma$ . Table 2 shows the effect of shifting errors: although large values are in the minority, they play critical roles for backpropagation training while the majority with small values actually act as noises.
|
| 190 |
+
|
| 191 |
+
Table 2: Test error rates $( \% )$ on CIFAR10 when left-shift upper boundary with factor $\gamma$
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>8</td></tr><tr><td rowspan=1 colspan=1>error</td><td rowspan=1 colspan=1>6.78</td><td rowspan=1 colspan=1>7.31</td><td rowspan=1 colspan=1>8.08</td><td rowspan=1 colspan=1>16.92</td></tr></table>
|
| 194 |
+
|
| 195 |
+
# 4.4 BITWIDTH OF GRADIENTS
|
| 196 |
+
|
| 197 |
+
The bitwidth $k _ { G }$ is set to 8 as default in previous experiments. Although weights are propagated with ternary values in inference and achieve $1 6 \times$ compression rate than float32 weights, they are saved and accumulated in a relatively higher bitwidth (8 bits) for backpropagation training. Therefore, the overall compression rate is only $4 \times$ . The inconsistent bitwidth between weight updates $k _ { G }$ and their effects in inference $k _ { W }$ provides indispensable buffer space. Otherwise, there might be too many weights changing their ternary values in each iteration, making training very slow and unstable. To further explore a proper bitwidth for gradients, we use WAGE 2-8-8-8 in CIFAR10 as baseline and range $k _ { G }$ from 2 to 12, the learning rate $\eta$ is divided by 2 every time the $k _ { G }$ decreases 1 bit to keep approximately equal weights accumulation in large number of iterations. Results from Table 3 show the effect of $k _ { G }$ and indicate the similar bitwidth requirement as previous experiments for $k _ { E }$ .
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 4: Left are histograms of errors $e$ for same layer in vanilla network and WAGE-2888 network. Upper boundaries are the $m a x \{ | e | \}$ while lower boundaries are determined by the bitwidth $k _ { E }$ . The 10 run accuracies of different $k _ { E }$ are shown on the right.
|
| 201 |
+
|
| 202 |
+
Table 3: Test error rates $( \% )$ on CIFAR10 with different $k _ { G }$
|
| 203 |
+
|
| 204 |
+
<table><tr><td rowspan=1 colspan=1>kG</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>5</td><td rowspan=1 colspan=1>6</td><td rowspan=1 colspan=1>7</td><td rowspan=1 colspan=1>8</td><td rowspan=1 colspan=1>9</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>12</td></tr><tr><td rowspan=1 colspan=1>error</td><td rowspan=1 colspan=1>54.22</td><td rowspan=1 colspan=1>51.57</td><td rowspan=1 colspan=1>28.22</td><td rowspan=1 colspan=1>18.01</td><td rowspan=1 colspan=1>11.48</td><td rowspan=1 colspan=1>7.61</td><td rowspan=1 colspan=1>6.78</td><td rowspan=1 colspan=1>6.63</td><td rowspan=1 colspan=1>6.43</td><td rowspan=1 colspan=1>6.55</td><td rowspan=1 colspan=1>6.57</td></tr></table>
|
| 205 |
+
|
| 206 |
+
For ImageNet implementation, we conduct six patterns to show bitwidth requirements: 2888 from Table 1, 288C for more accurate errors (12 bits), 28C8 for larger buffer space, 28f8 for none quantization of gradients, 28ff for errors and gradients in float32 as unlimited case and its BN counterpart. The accuracy of original AlexNet reproduction is reported as baseline. Learning rate $\eta$ is set to 64 and divided by 8 in 28C8 pattern, 0.01 and divided by 10 in 28f8, 28ff counterparts and vanilla AlexNet. We observe overfitting when increasing $k _ { G }$ thus add L2 weight decay of 1e-4, 1e-4 and 5e-4 for 28f8, 28ff and 28ff-BN patterns, respectively. In table 4, the comparison between pattern 28C8 and 288C reveals that it might be more important to make more buffer space $k _ { G }$ for gradient accumulation than to keep high-resolution orientation $k _ { E }$ . Besides, when it comes to ImageNet dataset, the gradient accumulation, i.e., the bit width of gradients $( k _ { G } )$ and batch normalization become more important (Li et al., 2017) since samples in training set are so variant.
|
| 207 |
+
|
| 208 |
+
To avoid external memory consumption of full-precision weights during training, Deng et al. (2018) achieved 1-bit weights representation in both training and inference. They use a much larger minibatch size of 1000 and float32 backpropagation dataflow to accumulate more precise weight updates, equally compensating the buffer space in WAGE provided by external bits of $k _ { G }$ . However, large batch size will dramatically increase total training time, counteracting the speed benefits brought by integer arithmetic units. Besides, intermediate variables like feature maps often consume much more memory than weights and linearly correlated with mini-batch size. Therefore, we apply bigger $k _ { G }$ for better convergence rate, accuracy and lower memory usage.
|
| 209 |
+
|
| 210 |
+
Table 4: Top-5 error rates $( \% )$ on ImageNet with different $k _ { G }$ and $k _ { E }$
|
| 211 |
+
|
| 212 |
+
<table><tr><td rowspan=1 colspan=1>Pattern</td><td rowspan=1 colspan=1>Vanilla</td><td rowspan=1 colspan=1>28ff-BN</td><td rowspan=1 colspan=1>28ff</td><td rowspan=1 colspan=1>28f8</td><td rowspan=1 colspan=1>28C8</td><td rowspan=1 colspan=1>288C</td><td rowspan=1 colspan=1>2888</td></tr><tr><td rowspan=1 colspan=1>error</td><td rowspan=1 colspan=1>19.29</td><td rowspan=1 colspan=1>20.67</td><td rowspan=1 colspan=1>24.14</td><td rowspan=1 colspan=1>23.92</td><td rowspan=1 colspan=1>26.88</td><td rowspan=1 colspan=1>28.06</td><td rowspan=1 colspan=1>27.82</td></tr></table>
|
| 213 |
+
|
| 214 |
+
# 5 DISCUSSION AND FUTURE WORK
|
| 215 |
+
|
| 216 |
+
The goal of this work is to demonstrate potentials of applying training and inference with lowbitwidth integers in DNNs. Compared with FP16, 8-bit integer operations will not only reduce the energy and area costs for IC design (about $5 \times$ , see Table 5), but also halve the memory accesses costs and memory size requirements during training, which will greatly benefit mobile devices with on-site learning capability. There are some points not involved in this work but yet to be improved or solved in future algorithm developments and hardware deployment.
|
| 217 |
+
|
| 218 |
+
MAC Operation: WAGE framework is mainly tested with 2-8-8-8 bitwidth configuration, which means that though there are no multiplications during inference with ternary weights, MACs are still needed to calculate $\textbf { { g } }$ in training. Possible solution is 2-2-8-8 pattern if we do not consider the matching of bitwidths between $\textbf { \em a }$ and $e$ . However, ternary $\textbf { \em a }$ will dramatically slow down convergence and hurt accuracy since $Q ( x , 2 )$ has two relatively high thresholds and clear most outputs of each layer at the beginning of training, this phenomenon is also observed in our BNN replication.
|
| 219 |
+
|
| 220 |
+
Non-linear quantization: The linear mapping with uniform distance is adopted in WAGE for its simplicity. However, non-linear quantization method like logarithmic representation (Miyashita et al., 2016; Zhou et al., 2017) might be more efficient because the weights and activations in a trained network naturally have logarithmic normal distributions as shown in Figure 4. Besides, values in logarithmic representation have much larger range with fewer bits than fixed-point representation and are naturally encoded in digital hardware. It is promising to training DNNs with integers encoded with logarithmic representation.
|
| 221 |
+
|
| 222 |
+
Normalization: Normalization layers like Softmax and batch normalization are avoided or removed in some WAGE demonstrations. We think normalizations are essential for end-to-end multi-channel perception where sensors with different modalities have different input distributions, as well as cross-model features encoding and cognition where information from different branches gather to form higher-level representations. Therefore, a better way to quantize normalization is of great interest in further studies.
|
| 223 |
+
|
| 224 |
+
Table 5: Rough relative costs in $4 5 \mathrm { n m } 0 . 9 \mathrm { V }$ from Sze et al. (2017).
|
| 225 |
+
|
| 226 |
+
<table><tr><td rowspan=2 colspan=1>Operation</td><td rowspan=1 colspan=1>Energy(pJ)</td><td rowspan=1 colspan=1>Area(um2)</td></tr><tr><td rowspan=1 colspan=1>MUL ADD</td><td rowspan=1 colspan=1>MUL ADD</td></tr><tr><td rowspan=1 colspan=1>8-bit INT</td><td rowspan=1 colspan=1>0.2 pJ 0.03 pJ</td><td rowspan=1 colspan=1>282 36</td></tr><tr><td rowspan=1 colspan=1>16-bit FP</td><td rowspan=1 colspan=1>1.1 pJ 0.40 pJ</td><td rowspan=1 colspan=1>1640 1360</td></tr><tr><td rowspan=1 colspan=1>32-bit FP</td><td rowspan=1 colspan=1>3.7 pJ 0.90 pJ</td><td rowspan=1 colspan=1>7700 4184</td></tr></table>
|
| 227 |
+
|
| 228 |
+
# 6 CONCLUSION
|
| 229 |
+
|
| 230 |
+
WAGE empowers pure low-bitwidth integer dataflow in DNNs for both training and inference. We introduce a new initialization method and a layer-wise constant scaling factor to replace batch normalization, which is a pain spot for network quantization. Many other components for training are also considered or simplified by alternative solutions. In addition, the bitwidth requirements for error computation and gradient accumulation are explored. Experiments reveal that we can quantize relative values of gradients, as well as discard the majority of small values and their orders of magnitude in backpropagation. Although the accumulation for weights updates are indispensable for stable convergence and final accuracy, there still remain works for compression and memory consumption can be further reduced in training. WAGE achieves state-of-art accuracies on multiple datasets with 2-8-8-8 bitwidth configuration. It is promising for incremental works via fine-tuning, more efficient mapping, quantization of batch normalization, etc. Overall, we introduce a framework without floating-point representation and demonstrate the potential to implement both discrete training and inference on integer-based lightweight ASIC or FPGA with on-site learning capability.
|
| 231 |
+
|
| 232 |
+
# ACKNOWLEDGMENTS
|
| 233 |
+
|
| 234 |
+
This work is partially supported by the Project of NSFC (61327902), the SuZhou-Tsinghua innovation leading program (2016SZ0102), the National Natural Science Foundation of China (61603209) and the Independent Research Plan of Tsinghua University (20151080467). We discuss a lot with Peng Jiao and Lei Deng, gratefully acknowledge for their thoughtful comments.
|
| 235 |
+
|
| 236 |
+
# REFERENCES
|
| 237 |
+
|
| 238 |
+
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 largescale machine learning. In OSDI, volume 16, pp. 265–283, 2016.
|
| 239 |
+
|
| 240 |
+
Yu-Hsin Chen, Tushar Krishna, Joel S Emer, and Vivienne Sze. Eyeriss: An energy-efficient reconfigurable accelerator for deep convolutional neural networks. IEEE Journal of Solid-State Circuits, 52(1):127–138, 2017.
|
| 241 |
+
|
| 242 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in Neural Information Processing Systems, pp. 3123–3131, 2015.
|
| 243 |
+
|
| 244 |
+
Lei Deng, Peng Jiao, Jing Pei, Zhenzhi Wu, and Guoqi Li. Gxnor-net: Training deep neural networks with ternary weights and activations without full-precision memory under a unified discretization framework. Neural Networks, 2018.
|
| 245 |
+
|
| 246 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 247 |
+
|
| 248 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pp. 1026–1034, 2015.
|
| 249 |
+
|
| 250 |
+
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.
|
| 251 |
+
|
| 252 |
+
Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 253 |
+
|
| 254 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Advances in Neural Information Processing Systems, pp. 4107–4115, 2016.
|
| 255 |
+
|
| 256 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 257 |
+
|
| 258 |
+
Norman P Jouppi, Cliff Young, Nishant Patil, David Patterson, Gaurav Agrawal, Raminder Bajwa, Sarah Bates, Suresh Bhatia, Nan Boden, Al Borchers, et al. In-datacenter performance analysis of a tensor processing unit. In Proceedings of the 44th Annual International Symposium on Computer Architecture, pp. 1–12. ACM, 2017.
|
| 259 |
+
|
| 260 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 261 |
+
|
| 262 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 263 |
+
|
| 264 |
+
Chen-Yu Lee, Saining Xie, Patrick Gallagher, Zhengyou Zhang, and Zhuowen Tu. Deeplysupervised nets. In Artificial Intelligence and Statistics, pp. 562–570, 2015.
|
| 265 |
+
|
| 266 |
+
Fengfu Li, Bo Zhang, and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
|
| 267 |
+
|
| 268 |
+
Hao Li, Soham De, Zheng Xu, Christoph Studer, Hanan Samet, and Tom Goldstein. Training quantized nets: A deeper understanding. In Advances in Neural Information Processing Systems, pp. 5813–5823, 2017.
|
| 269 |
+
|
| 270 |
+
Daisuke Miyashita, Edward H Lee, and Boris Murmann. Convolutional neural networks using logarithmic data representation. arXiv preprint arXiv:1603.01025, 2016.
|
| 271 |
+
|
| 272 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016.
|
| 273 |
+
|
| 274 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015.
|
| 275 |
+
|
| 276 |
+
Patrick M Sheridan, Fuxi Cai, Chao Du, Wen Ma, Zhengya Zhang, and Wei D Lu. Sparse coding with memristor networks. Nature nanotechnology, 12(8):784, 2017.
|
| 277 |
+
|
| 278 |
+
Luping Shi, Jing Pei, Ning Deng, Dong Wang, Lei Deng, Yu Wang, Youhui Zhang, Feng Chen, Mingguo Zhao, Sen Song, et al. Development of a neuromorphic computing system. In Electron Devices Meeting (IEDM), 2015 IEEE International, pp. 4–3. IEEE, 2015.
|
| 279 |
+
|
| 280 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
|
| 281 |
+
|
| 282 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 283 |
+
|
| 284 |
+
Vivienne Sze, Yu-Hsin Chen, Tien-Ju Yang, and Joel S Emer. Efficient processing of deep neural networks: A tutorial and survey. Proceedings of the IEEE, 105(12):2295–2329, 2017.
|
| 285 |
+
|
| 286 |
+
Wei Tang, Gang Hua, and Liang Wang. How to train a compact binary neural network with high accuracy? In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 287 |
+
|
| 288 |
+
Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in Neural Information Processing Systems, pp. 1508–1518, 2017.
|
| 289 |
+
|
| 290 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 291 |
+
|
| 292 |
+
Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017.
|
| 293 |
+
|
| 294 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 295 |
+
|
| 296 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
|
| 297 |
+
|
| 298 |
+
# A ALGORITHM
|
| 299 |
+
|
| 300 |
+
We assume that network structures are defined and initialized with Equation 5. The annotations after pseudo code are potential corresponding operations for implementation in a fixed-point dataflow.
|
| 301 |
+
|
| 302 |
+
Algorithm 1 Training an $I$ -layer net with WAGE method on floating-point-based or integer-based device. Weights, activations, gradients and errors are quantized according to Equations 6 - 12.
|
| 303 |
+
|
| 304 |
+
Require: a mini-batch of inputs and targets $( \pmb { a } _ { q } ^ { 0 } , \pmb { a } ^ { * } )$ which are quantized to $k _ { A }$ -bit integers, shiftbased $\alpha$ for each layer, learning rate scheduler $\eta$ , previous weight $W$ saved in $k _ { G }$ bits.
|
| 305 |
+
|
| 306 |
+
Ensure: updated weights $W _ { t + 1 }$
|
| 307 |
+
|
| 308 |
+
1. Forward propagation:
|
| 309 |
+
1: for $i = 1$ to $I$ do
|
| 310 |
+
2: $W _ { q } ^ { i } Q _ { W } ( W ^ { i } )$
|
| 311 |
+
3: $\pmb { a } ^ { i } \gets R e L U ( \pmb { a } _ { q } ^ { i - 1 } \pmb { W } _ { q } ^ { i } )$
|
| 312 |
+
4: $\pmb { a } _ { q } ^ { i } Q _ { A } ( \pmb { a } ^ { i } )$
|
| 313 |
+
|
| 314 |
+
5: end for 2. Back propagation: Compute $\mathbf { \Psi } _ { e ^ { I } } \mathbf { \bar { \Psi } } _ { } \mathbf { \frac { \partial \mathcal { L } } { \partial \mathbf { a } ^ { I } } }$ knowing $\pmb { a } ^ { I }$ and $\mathbf { \delta } \mathbf { \textit { a } } ^ { * }$
|
| 315 |
+
|
| 316 |
+
6: for $i = I$ to 1 do
|
| 317 |
+
7: 0 $e _ { q } ^ { i } Q _ { E } ( e ^ { i } )$
|
| 318 |
+
8: $e ^ { i - 1 } e _ { q } ^ { i } W _ { q } ^ { i }$
|
| 319 |
+
9: g i ← e iq T a i − 1q
|
| 320 |
+
10: $\Delta W ^ { i } Q _ { G } ( \pmb { g } ^ { i } )$
|
| 321 |
+
11: Update and Clip $\dot { W } ^ { i }$ according to Equation 12
|
| 322 |
+
12: end for
|
| 323 |
+
|
| 324 |
+
# B LAYERWISE HISTOGRAM
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure 5: Layerwise histograms of a trained VGG-like network with bitwidth configuration: 2-8- 8-8 and learning rate $\eta$ equals to 8. The Y-axis represents for probability in W-plots and G-plots, and logarithmic probability in A-plots and E-plots, respectively. In A-plots histograms are one-layer ahead so the first figure shows the quantized input data.
|
md/train/HbZTcIuiMAG/HbZTcIuiMAG.md
ADDED
|
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FUSION 360 GALLERY: A DATASET AND ENVIRONMENT FOR PROGRAMMATIC CAD RECONSTRUCTION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Parametric computer-aided design (CAD) is a standard paradigm used for the design of manufactured objects. CAD designers perform modeling operations, such as sketch and extrude, to form a construction sequence that makes up a final design. Despite the pervasiveness of parametric CAD and growing interest from the research community, a dataset of human designed 3D CAD construction sequences has not been available to-date. In this paper we present the Fusion 360 Gallery reconstruction dataset and environment for learning CAD reconstruction. We provide a dataset of 8,625 designs, comprising sequential sketch and extrude modeling operations, together with a complementary environment called the $F u$ - sion $3 6 0 G y m$ , to assist with performing CAD reconstruction. We outline a standard CAD reconstruction task, together with evaluation metrics, and present results from a novel method using neurally guided search to recover a construction sequence from a target geometry.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The manufactured objects that surround us in everyday life are created in computer-aided design (CAD) software using common modeling operations such as sketch and extrude. With just these two modeling operations, a highly expressive range of 3D designs can be created (Figure 1). Parametric CAD files contain construction sequence information that is critical for documenting design intent, maintaining editablity, and downstream simulation and manufacturing. Despite the value of this information, it is often lost due to data translation or error and must be reverse engineered from geometry or even raw 3D scan data. The task of reconstructing CAD operations from geometry has been pursued for over 40 years (Shah et al., 2001) and is available in commercial CAD software using heuristic approaches (Autodesk, 2012; Dassault, 2019). Recent advances in neural networks for 3D shape generation has spurred new interest in CAD reconstruction, due to the potential to generalize better and further automate this challenging problem. However, learning-based approaches to CAD reconstruction have not yet had access to a human-designed dataset of 3D CAD construction sequences, instead relying on synthetic data for both training and testing purposes, e.g. Li et al. (2020). The absence of real world data has limited work on CAD reconstruction using common sketch and extrude modeling operations. Instead a focus has been on reconstruction from simple geometric primitives (Sharma et al., 2017; Tian et al., 2019; Ellis et al., 2019) that lack the rich parametric sketches commonly used in mechanical CAD (e.g. Figure 2). As there is no existing learning-based approach to reconstruct sketch and extrude sequences, we take a first step towards this goal by introducing data, a supporting software environment, and a novel action representation for reconstructing sketch and extrude designs.
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Figure 1: Top: A subset of designs containing 3D CAD construction sequences from the Fusion $3 6 0$ Gallery reconstruction dataset. Bottom: An example construction sequence using sketch and extrude modeling operations.
|
| 15 |
+
|
| 16 |
+
In this paper we present the Fusion 360 Gallery reconstruction dataset and environment for learning CAD reconstruction. The dataset contains 8,625 designs created by users of Autodesk Fusion 360 using a simple subset of CAD modeling operations: sketch and extrude. To the best of our knowledge this dataset is the first to provide human designed 3D CAD construction sequence data for use with machine learning. To support research with the dataset we provide an environment called the Fusion 360 Gym for working with CAD reconstruction. A key motivation of this work is to provide insights into the process of how people design objects. Furthermore, our goal is to provide a universal benchmark for research and evaluation of learning-based CAD reconstruction algorithms, bridging the gap between the computer graphics and machine learning community. To this end we describe a standard CAD reconstruction task and associated evaluation metrics with respect to the ground truth construction sequence. We also introduce a novel action representation for CAD reconstruction of sketch and extrude designs using neurally guided search. This search employs a policy, trained using imitation learning, consisting of a graph neural network encoding of CAD geometry.
|
| 17 |
+
|
| 18 |
+
This paper makes the following contributions:
|
| 19 |
+
|
| 20 |
+
• We present the Fusion 360 Gallery reconstruction dataset containing construction sequence information for 8,625 human-designed sketch and extrude CAD models.
|
| 21 |
+
• We introduce an environment called the Fusion 360 Gym, standardizing the CAD reconstruction task in a Markov Decision Process formulation.
|
| 22 |
+
• We introduce a novel action representation to enable neurally guided CAD reconstruction trained on real world construction sequences for the first time.
|
| 23 |
+
|
| 24 |
+
# 2 RELATED WORK
|
| 25 |
+
|
| 26 |
+
CAD Datasets Existing 3D CAD datasets have largely focused on providing mesh geometry (Chang et al., 2015; Wu et al., 2015; Zhou & Jacobson, 2016; Mo et al., 2019b; Kim et al., 2020). However, the de facto standard for parametric CAD is the boundary representation (B-Rep) format, containing valuable analytic representations of surfaces and curves suitable for high level control of 3D shapes. B-Reps are collections of trimmed parametric surfaces along with topological information which describes adjacency relationships and the ordering of elements such as faces, loops, edges, and vertices (Weiler, 1986). B-Rep datasets have recently been made available with both human-designed (Koch et al., 2019) and synthetic data (Zhang et al., 2018; Jayaraman et al., 2020; Starly, 2020). Missing from these datasets is construction sequence information. We believe it is critical to understand not only what is designed, but how that design came about.
|
| 27 |
+
|
| 28 |
+
Parametric CAD files contain valuable information on the construction history of a design. Schulz et al. (2014) provide a standard collection of human designs with full parametric history, albeit a limited set of 67 designs in a proprietary format. SketchGraphs (Seff et al., 2020) constrains the broad area of parametric CAD by focusing on the underlying 2D engineering sketches, including sketch construction sequences. In the absence of 3D human design data, learning-based approaches have instead leveraged synthetic CAD construction sequences (Sharma et al., 2017; Li et al., 2020). The dataset presented in this paper is, to the best of our knowledge, the first to provide humandesigned 3D CAD construction sequence information suitable for use with machine learning.
|
| 29 |
+
|
| 30 |
+
CAD Reconstruction The task of CAD reconstruction involves recovering the sequence of modeling operations used to construct a CAD model from geometry input, such as B-reps, triangle meshes, or point clouds. Despite extensive prior work (Shah et al., 2001), CAD reconstruction remains a challenging problem as it requires deductions on both continuous parameters (e.g., extracting the dimensions of primitives) and discrete operations (e.g., choosing a proper operation for the next step), leading to a mixed combinatorial search space. To recover the sequence of operations, traditional methods typically run global search methods (e.g., evolutionary algorithms as in Hamza & Saitou (2004), Weiss (2009), Friedrich et al. (2019), and Fayolle & Pasko (2016)) with heuristic rules to prune the search space (Shapiro & Vossler, 1993; Buchele, 2000; Buchele & Roles, 2001; Buchele & Crawford, 2003). Heuristic approaches are also available in a number of commercial software tools, often as a user-guided semi-automatic system (Autodesk, 2012; Dassault, 2019) to aid with file conversion between CAD systems. These traditional algorithms operate by removing faces from the B-rep body and reapplying them as parametric modeling operations. This strategy can recover the later modeling operations, but fail to completely rebuild the construction sequence from the first step. We instead tackle the task of recovering the entire construction sequence from the first extrusion. Another approach is using program synthesis (Du et al., 2018; Nandi et al., 2017; 2018; 2020) to infer CAD programs written in domain specific languages from given shapes. CAD reconstruction is also related to the inverse procedural modeling problem (Talton et al., 2011; Stava et al., 2014; Vanegas et al., 2012), which attempts to reverse-engineer procedures that can faithfully match a given target. Inverse procedural modeling methods typically work with synthetic data, while our paper tackles tasks on real CAD models and modeling operations.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: An example design sequence from the Fusion 360 Gallery reconstruction dataset. Sketch profiles are sequentially extruded to join (Extrude 1, Extrude 2) or cut (Extrude 3) geometry using Boolean operations. The colored areas show the sketch profiles that partake in each extrusion.
|
| 34 |
+
|
| 35 |
+
Compared to the rule-based or grammar-based methods above, learning-based approaches can potentially learn the types of rules that are typically hard-coded, automate scenarios that require userinput, and generalize when confronted with unfamiliar geometry. One of the earliest such works is CSGNet (Sharma et al., 2017), which trains a neural network to infer the sequence of Constructive Solid Geometry (CSG) operations based on visual inputs. More recent works along this line of research include Ellis et al. (2019), Tian et al. (2019), and Kania et al. (2020). Typically associated with these methods are a customized, domain specific language (e.g., CSG) that parameterizes the space of geometry, some heuristic rules that limit the search space, and a neural network generative model (Zou et al., 2017; Mo et al., $2 0 1 9 \mathrm { a }$ ; Chen et al., 2020; Jones et al., 2020). Lin et al. (2020) reconstruct input shapes with a dual action representation that first positions cuboids and then edits edge-loops for refinement. Although editing edge-loops of cuboids may be a suitable modeling operation in artistic design, it is not as expressive or precise as the sketch and extrude operations used in real mechanical components. Additionally, Lin et al. (2020) chooses to train and evaluate their network on synthetic data due to the lack of a benchmark dataset of CAD construction sequences, a space that our work aims to fill. Our approach is, to the best of our knowledge, the first to apply a learning-based method to reconstruction using common sketch and extrude CAD modeling operations from real human designs.
|
| 36 |
+
|
| 37 |
+
# 3 FUSION 360 GALLERY RECONSTRUCTION DATASET
|
| 38 |
+
|
| 39 |
+
The Fusion 360 Gallery reconstruction dataset1 is produced from designs submitted by users of the CAD software Autodesk Fusion 360. The dataset contains CAD construction sequence information from a subset of sketch and extrude designs. We intentionally limit the data to the sketch and extrude modeling operations to reduce the complexity of the CAD reconstruction task. Figure 1 shows a random sampling of the designs in the dataset. Each design is provided in three different representations: B-Rep, mesh, and construction sequence JSON text format. An official 80:20 traintest split is provided with 6,900 and 1,725 designs respectively. We now briefly outline the sketch and extrude modeling operations and provide additional details in Section A.1 of the appendix.
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 3: The Fusion 360 Gym interacts with an agent in a sequential decision making scenario (left) with the state containing geometries represented as face adjacency graphs (right).
|
| 43 |
+
|
| 44 |
+
Sketch Unlike free-form sketches, sketches in CAD are composed of 2D geometric primitives (lines, circles, splines etc.), associated dimensions (distance, diameter, angle etc.) and constraints (symmetry, tangent, parallel etc.). Sketch geometry is represented by points, that create curves, that in turn form loops within profiles. The intersection of curves, as the user draws, automatically creates closed loops and profiles that are serialized as both raw curves and trimmed profiles. Sketch profiles form the basis for 3D extrusion as shown in (Figure 2).
|
| 45 |
+
|
| 46 |
+
Extrude An extrude operation takes one or more sketch profiles and extrudes them from 2D into a 3D B-Rep body. A distance parameter defines how far the profile is extruded. A notable feature of extrude operations in Fusion 360 is the ability to perform Boolean operations in the same step. As a user extrudes a sketch profile, they choose to create a new body, join, cut, or intersect with other bodies in the design (Figure 2). Additional extrude options are available such as two-sided extrude, symmetrical extrude, and tapered extrude. The combination of expressive sketches and extrude operations with built in Boolean capability enables a wide variety of designs to be constructed.
|
| 47 |
+
|
| 48 |
+
# 4 FUSION 360 GYM
|
| 49 |
+
|
| 50 |
+
Together with the dataset we provide an open source environment, called the Fusion 360 Gym, for standardizing the CAD reconstruction task. The Fusion 360 Gym wraps the underlying Fusion 360 Python API (Autodesk, 2014) and serves as the environment that interacts with an intelligent agent for the task of CAD reconstruction (Figure 3). Specifically, the Fusion 360 Gym formalizes the following Markov Decision Process:
|
| 51 |
+
|
| 52 |
+
• state: Contains the current geometry, and optionally, the target geometry to be reconstructed. We use a B-Rep face-adjacency graph as our state representation.
|
| 53 |
+
• action: A modeling operation that allows the agent to modify the current geometry. We consider two action representations: sketch extrusion and face extrusion.
|
| 54 |
+
• transition: Fusion 360 Gym implements the transition function that applies the modeling operation to the current geometry.
|
| 55 |
+
reward: The user can define custom reward functions depending on the task. We provide intersection over union (IoU) as one measure to compare the current and target geometry.
|
| 56 |
+
|
| 57 |
+
# 4.1 STATE REPRESENTATION
|
| 58 |
+
|
| 59 |
+
In order for an agent to successfully reconstruct the target geometry, it is important that we have a suitable state representation. In Fusion 360 Gym, we use a similar encoding scheme to Jayaraman et al. (2020) and represent the current and target geometry with a B-Rep face-adjacency graph (Ansaldi et al., 1985), illustrated in Figure 3, right. Crucial to this encoding are the geometric features of the elements, such as point-locations, and topological features specifying how these elements are connected to each other. Specifically, the vertices of the face-adjacency graph represent B-Rep faces (trimmed parametric surfaces) in the design, with graph vertex features representing the size, orientation, and curvature of the faces. The edges of the face-adjacency graph represents B-Rep edges in the design, that connect the adjacent B-Rep faces to each other.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
Figure 4: Action representations supported by the Fusion 360 Gym include low-level sketch extrusion (top) and simplified face extrusion (bottom).
|
| 63 |
+
|
| 64 |
+
# 4.2 ACTION REPRESENTATION
|
| 65 |
+
|
| 66 |
+
In the Fusion 360 Gym we support two action representations encompassing different modeling operations: sketch extrusion and face extrusion.
|
| 67 |
+
|
| 68 |
+
Sketch Extrusion In sketch extrusion, the agent must first select a sketch plane, draw on this plane using a sequence of curve primitives, such as lines and arcs, to form closed loop profiles. The agent then selects a profile to extrude a given distance and direction (Figure 4, top). Using this representation it is possible to construct novel geometries by generating the underlying sketch primitives and extruding them by an arbitrary amount. Although all designs in the Fusion 360 Gallery reconstruction dataset can be constructed using sketch extrusion, in practice this is challenging. Benko et al. (2002) show that to generate sketches suitable for mechanical engineering parts, the curve primitives often need to be constructed alongside a set of constraints which enforce regularities and symmetries in the design. Although the construction of the constraint graphs is feasible using techniques like the one shown by Liao et al. (2019), enforcing the constraints requires a complex interaction between the machine learning algorithm and a suitable geometric constraint solver, greatly increasing the algorithm complexity. We alleviate this problem by introducing a simplified action representation, called face extrusion, that is well suited to learning-based approaches.
|
| 69 |
+
|
| 70 |
+
Face Extrusion In face extrusion, a face from the target design is used as the extrusion profile rather than a sketch profile (Figure 4, bottom). This is possible because the target design is known in advance during reconstruction. An action $a$ in this scheme is a triple $\{ \mathrm { f a c e } _ { s t a r t } , \mathrm { f a c e } _ { e n d } , \mathrm { o p } \}$ where the start and end faces are parallel faces referenced from the target geometry, and the operation type is one of the following: new body, join, cut, intersect. Target constrained reconstruction using face extrusion has the benefit of narrowly scoping the prediction problem with shorter action sequences and simpler actions. Conversely, not all geometries can be reconstructed with this simplified strategy due to insufficient information in the target, e.g., Extrude 3 in Figure 2 cuts across the entire design without leaving a start or end face. Of the design sequences in the reconstruction dataset, $5 9 . 2 \%$ can be directly converted to a face extrusion sequence. We estimate that approximately $80 \%$ of designs in our dataset can be reconstructed by finding alternative construction sequences.
|
| 71 |
+
|
| 72 |
+
# 4.3 SYNTHETIC DATA GENERATION
|
| 73 |
+
|
| 74 |
+
The Fusion 360 Gym supports generation of semi-synthetic data by taking existing designs and modifying or recombining them. For instance, we can randomly perturb the sketches and the extrusion distances, and even ‘graft’ sketches from one design onto another. We also support distribution matching of parameters, such as the number of faces, to ensure that synthetic designs match a human-designed dataset distribution. Learning-based systems can leverage semi-synthetic data to expand the number of samples in the Fusion 360 Gallery reconstruction dataset. We provide examples of synthetic data and commands for the Fusion 360 Gym in Section A.2 of the appendix.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 5: Given a state comprising the target geometry $G _ { t }$ and current geometry $G _ { c }$ , the agent uses a message passing network (MPN) to predict an action as a face extrusion modeling operation.
|
| 78 |
+
|
| 79 |
+
# 5 CAD RECONSTRUCTION
|
| 80 |
+
|
| 81 |
+
# 5.1 TASK
|
| 82 |
+
|
| 83 |
+
The goal of CAD reconstruction is to recover the sequence of modeling operations used to construct a CAD model with only the geometry as input. This task can be specified using different input geometry representations, including B-Rep, mesh, or point cloud, with progressively lower fidelity. Each representation presents a realistic scenario where parametric CAD information is absent and needs to be recovered. Given a target geometry $G _ { t }$ , we wish to find a sequence of CAD modeling operations (actions) $\mathcal { A } = \{ a _ { 0 } , a _ { 1 } , \cdot \cdot \cdot \}$ that generates an output geometry $G$ , such that every point in space is in its interior, if and only if, it is also in the interior of $G _ { t }$ .
|
| 84 |
+
|
| 85 |
+
Evaluation Metrics We prescribe three evaluation metrics, IoU, exact reconstruction, and conciseness. IoU measures the intersection over union of $G$ and $G _ { t }$ : $\mathsf { i o u } ( G , G _ { t } ) = | G \cap G _ { t } | / | G \cup G _ { t } |$ . Exact reconstruction measures whether $\mathsf { i o u } ( G , G _ { t } ) = 1$ . As multiple correct sequences of CAD modeling operations exist, a proposed reconstruction sequence $\mathcal { A }$ need not match the ground truth sequence $\hat { \mathcal { A } } _ { t }$ provided an exact reconstruction is found. To measure the quality of exact reconstructions we consider the conciseness of the construction sequence. Let conciseness $( \boldsymbol { \mathcal { A } } , \hat { \boldsymbol { \mathcal { A } } } _ { t } ) =$ $| \mathcal { A } | / | \hat { \mathcal { A } } _ { t } |$ , where a score $\leq 1$ indicates the agent found an exact reconstruction with equal or fewer steps than the ground truth, and a score $> 1$ indicates more inefficient exact reconstructions.
|
| 86 |
+
|
| 87 |
+
# 5.2 METHOD
|
| 88 |
+
|
| 89 |
+
We now present a method for CAD reconstruction using neurally-guided search (Ellis et al., 2019; Kalyan et al., 2018; Tang et al., 2019; Devlin et al., 2017) from $B$ -Rep input using face extrusion modeling operations. Rather than discovering a sequence of construction by exploration, the agent is trained to match known reconstruction sequences present in the training set using imitation learning. We leverage search at inference time to recover the given target geometry.
|
| 90 |
+
|
| 91 |
+
Imitation Learning To perform imitation learning, we leverage the fact that we have the ground truth sequence of modeling operations (actions) $\hat { \mathcal { A } } _ { t } = \{ \hat { a } _ { t , 0 } \cdot \cdot \cdot \hat { a } _ { t , n - 1 } \}$ for each design $G _ { t }$ in the dataset. We feed the ground truth action sequence $\hat { A } _ { t }$ into the Fusion 360 Gym, starting from the empty geometry $G _ { 0 }$ , and output a sequence of partial constructions $G _ { t , 1 } \cdots G _ { t , n }$ where $G _ { t , n } = G _ { t }$ . We then collect the supervised dataset ${ \mathcal { D } } = \{ ( G _ { 0 } , G _ { t } ) \to { \hat { a } } _ { t , 0 } , ( G _ { t , 1 } , G _ { t } ) \to { \hat { a } } _ { t , 1 } \cdot \cdot \cdot \}$ and train a supervised agent $\pi _ { \theta }$ that takes the pair of current-target constructions $\left( G _ { c } , G _ { t } \right)$ to a modeling operation action $a _ { c }$ , which would transform the current geometry closer to the target. Formally, we optimize the expected log-likelihood of correct actions under the data distribution:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r } { E _ { ( G _ { c } , G _ { t } ) \sim \mathcal { D } } \biggl [ \log \pi _ { \theta } \Bigl ( \hat { a } _ { c } | \bigl ( G _ { c } , G _ { t } \bigr ) \Bigr ) \biggr ] } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Agent The agent takes a pair of geometries $\left( G _ { c } , G _ { t } \right)$ as state, and outputs the corresponding faceextrusion action $a = \{ \mathrm { f a c e } _ { s t a r t } , \mathrm { f a c e } _ { e n d } , \mathrm { o p } \}$ (Figure 5). The two geometries $G _ { c } , G _ { t }$ are given using a face-adjacency graph similar to Jayaraman et al. (2020), where the graph vertexes represent the faces of the geometry, with vertex features calculated from each face: $1 0 \times 1 0$ grid of 3D points, normals, and trimming mask, in addition to the face surface type. The edges define connectivity of adjacent faces. Inputs are encoded using two separate message passing networks (MPN) aggregating messages along the edges of the graph. The encoded vectors representing the current geometry are summed together ( $h _ { c }$ in Figure 5), and concatenated with the encoded vertexes of the target geometry $( h _ { t } ^ { 0 } \cdots h _ { t } ^ { 5 } )$ . The concatenated vectors are used to output the action using a multi-layer perceptron (MLP), with the end face conditioned on the vertex embedding of the predicted start face.
|
| 98 |
+
|
| 99 |
+
Search Given a neural agent $\pi _ { \boldsymbol { \theta } } ( \boldsymbol { a } | ( G _ { c } , G _ { t } ) )$ capable of furthering a current geometry toward the target geometry, we can amplify its performance at test time using search. Here we report the result of the most basic of search strategies, random rollout, and provide results from additional search strategies in Section A.3 of the appendix. We let the agent interact with the environment by sampling a sequence of actions according to $\pi _ { \theta }$ up to a fixed rollout length of $\begin{array} { r } { \operatorname* { m a x } ( \frac { f _ { p } } { 2 } , 2 ) } \end{array}$ , where $f _ { p }$ is the number of planar faces in $G _ { t }$ . If the agent is successful at reconstructing the target, we stop. Otherwise, we repeat the process until we exhaust a global search budget.
|
| 100 |
+
|
| 101 |
+
# 5.3 RESULTS
|
| 102 |
+
|
| 103 |
+
We now present results on CAD reconstruction using the test set of the Fusion 360 Gallery reconstruction dataset. We seek to understand 1) how state-of-the-art baseline networks perform on the CAD reconstruction task, 2) how synthetic data performs compared to human designs. In each experiment we use different agents to reconstruct a target design, while holding the search strategy constant. For a target design $G _ { t }$ , each agent uses the random rollout search algorithm and attempts reconstruction over multiple rollouts. Each time the agent takes an action during search (a search step), we track the best IoU the agent has discovered so far, and whether exact reconstruction is achieved. We cap the total search budget to 100 steps.
|
| 104 |
+
|
| 105 |
+
Baseline Comparison We evaluate five different agents to understand how state-of-the-art baseline networks perform on the CAD reconstruction task. The rand agent uniformly samples from the available actions to serve as a naive baseline without any learning. mlp is a simple MLP agent that does not take advantage of shape topology. gcn, gin, and gat are MPN agents that use a Graph Convolution Network (Kipf & Welling, 2016), Graph Isomorphism Network (Xu et al., 2018), and Graph Attention Network (Velickovi ˇ c et al., 2017) respectively. We use two MPN layers for all ´ comparisons, with standard layer settings as described in the appendix. We report the evaluation metrics of each agent as a function of the number of steps in Figure 6. We detail the exact results at step 20 and 100 in Table 1. Step 20 represents the point where it is possible to perform exact reconstructions for all designs in the test set. We also detail the conciseness of the recovered sequence for exact reconstructions. We note that all neurally guided agents outperform the random agent baseline. The topology information available with a MPN is found to improve reconstruction performance. The gat and gcn agents show the best performance but fall well short of exact reconstruction on all designs in the test set, demonstrating that the CAD reconstruction task is non-trivial and an open problem for future research.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 6: Reconstruction results over 100 search steps using random rollouts with different agents. For exact reconstructions, 0.8 is the estimated upper limit of the face extrusion action representation.
|
| 109 |
+
|
| 110 |
+
Table 1: Reconstruction results for IoU and exact reconstruction at 20 and 100 search steps using random rollouts with different agents. Lower values are better for conciseness.
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Agent</td><td colspan="2">IoU</td><td colspan="2">Exact Reconstruction %</td><td>Conciseness</td><td> # Parameters</td></tr><tr><td></td><td>20 Steps</td><td>100 Steps</td><td>20 Steps</td><td>100 Steps</td><td></td><td></td></tr><tr><td>gat</td><td>0.8742</td><td>0.9128</td><td>0.6191</td><td>0.6742</td><td>1.0206</td><td>3.03M</td></tr><tr><td>gcn</td><td>0.8644</td><td>0.9042</td><td>0.6232</td><td>0.6754</td><td>1.0168</td><td>3.02M</td></tr><tr><td>gin</td><td>0.8346</td><td>0.8761</td><td>0.5901</td><td>0.6301</td><td>1.0042</td><td>3.62M</td></tr><tr><td>mlp</td><td>0.8274</td><td>0.8596</td><td>0.5658</td><td>0.5965</td><td>0.9763</td><td>2.24M</td></tr><tr><td>rand</td><td>0.6840</td><td>0.8386</td><td>0.4157</td><td>0.5380</td><td>1.2824</td><td>:</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Synthetic Data Performance We evaluate four gcn agents trained on different data sources to understand how synthetic data performs compared to human design data. real is trained on the human design training set. syn is trained on synthetic data from procedurally generated sketches of rectangles and circles extruded randomly (Figure 8, left). semi-syn is trained on semi-synthetic designs that use existing sketches in the training set with two or more extrude operations to match the distribution of the number of faces in the training set (Figure 8, right). aug is trained on the human design training set mixed with additional semi-synthetic data. We hold the training data quantity constant across agents, with the exception of the aug agent that contains a larger quantity from two sources. All agents are evaluated on the human design test set.
|
| 115 |
+
|
| 116 |
+
Figure 7 shows that training on human design data offers a significant advantage over synthetic and semi-synthetic data. For the aug agent reconstruction performance is aided early on by data augmentation. This is likely due to semi-synthetic designs with 1 or 2 extrusions appearing similar to human designs. Conversely, semi-synthetic designs with multiple randomly applied extrusions appear less and less similar to human design. This difference in distribution between human and synthetic designs becomes more prevalent as search progresses and adversely affects performance.
|
| 117 |
+
|
| 118 |
+
Qualitative Results Figure 9 shows ground truth construction sequences compared with other agents using random search. The rollout with the highest IoU is shown with the IoU score and total search steps taken. Steps that don’t change the geometry or occur after the highest IoU are omitted from the visualization.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 7: Reconstruction results over 100 search steps using random rollouts and gcn agents trained on human-designed data (real), a mixture of human-designed and semi-synthetic data (aug), semisynthetic data (semi-syn), and synthetic data (syn).
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 8: Example synthetic (left) and semi-synthetic data (right).
|
| 125 |
+
|
| 126 |
+
Discussion For practical application of CAD reconstruction it is necessary to have an exact reconstruction where all details of a design are reconstructed in a concise way. It is notable that incorrect reconstructions can score well with the IoU metric, but omit important design details. We therefore suggest IoU should be a secondary metric, with future work focusing on improving exact reconstruction performance with concise construction sequences. Conciseness should always be considered alongside exact reconstruction performance as naive approaches that only reconstruct short sequences can achieve good conciseness scores.
|
| 127 |
+
|
| 128 |
+
# 6 CONCLUSION AND FUTURE DIRECTIONS
|
| 129 |
+
|
| 130 |
+
In this paper we presented the Fusion 360 Gallery reconstruction dataset and environment for learning CAD reconstruction from sequential 3D CAD data. We outlined a standard CAD reconstruction task, together with evaluation metrics, and presented results from a neurally guided search approach. We envision a number of future directions that could leverage the reconstruction dataset: new representations for sequential geometry capable of performing CAD reconstruction and generation from B-Rep, mesh, point cloud, or image data; reinforcement learning approaches that mimic and improvise sequential modeling operations; and sketch and constraint synthesis from 3D geometry or images. Finally, beyond the simplified design space of sketch and extrude lies the full breadth of rich sequential CAD modeling operations.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 9: Qualitative construction sequence results comparing the ground truth (gt) to reconstructions using different agents with random search.
|
| 134 |
+
|
| 135 |
+
# REFERENCES
|
| 136 |
+
|
| 137 |
+
Silvia Ansaldi, Leila De Floriani, and Bianca Falcidieno. Geometric modeling of solid objects by using a face adjacency graph representation. ACM SIGGRAPH Computer Graphics, 19(3):131– 139, 1985.
|
| 138 |
+
|
| 139 |
+
Autodesk. Inventor Feature Recognition, 2012. URL https://apps.autodesk.com/ INVNTOR/en/Detail/Index?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 9172877436288348979.
|
| 140 |
+
|
| 141 |
+
Autodesk. Fusion 360 API, 2014. URL http://help.autodesk.com/view/fusion360/ ENU/?guid $\underline { { \underline { { \mathbf { \Pi } } } } } =$ GUID-7B5A90C8-E94C-48DA-B16B-430729B734DC.
|
| 142 |
+
|
| 143 |
+
Pal Benko, Geza Kos, Pál Benko, Laszlo Andor, Géza Kós, Tamas Varady, László Andor, and Ralph ˝ Martin. Constrained fitting in reverse engineering, 2002.
|
| 144 |
+
|
| 145 |
+
Suzanne F Buchele and Richard H Crawford. Three-dimensional halfspace constructive solid geometry tree construction from implicit boundary representations. In Proceedings of the eighth ACM symposium on Solid modeling and applications, pp. 135–144, 2003.
|
| 146 |
+
|
| 147 |
+
Suzanne F Buchele and Angela C Roles. Binary space partitioning tree and constructive solid geometry representations for objects bounded by curved surfaces. In CCCG, pp. 49–52. Citeseer, 2001.
|
| 148 |
+
|
| 149 |
+
Suzanne Fox Buchele. Three-dimensional binary space partitioning tree and constructive solid geometry tree construction from algebraic boundary representations. 2000.
|
| 150 |
+
|
| 151 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 152 |
+
|
| 153 |
+
Zhiqin Chen, Andrea Tagliasacchi, and Hao Zhang. Bsp-net: Generating compact meshes via binary space partitioning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 45–54, 2020.
|
| 154 |
+
|
| 155 |
+
Dassault. Solidworks FeatureWorks, 2019. URL https://help.solidworks.com/2019/ english/SolidWorks/fworks/c_Overview_of_FeatureWorks.htm.
|
| 156 |
+
|
| 157 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. arXiv preprint arXiv:1703.07469, 2017.
|
| 158 |
+
|
| 159 |
+
Tao Du, Jeevana Priya Inala, Yewen Pu, Andrew Spielberg, Adriana Schulz, Daniela Rus, Armando Solar-Lezama, and Wojciech Matusik. Inversecsg: Automatic conversion of 3d models to csg trees. ACM Transactions on Graphics (TOG), 37(6):1–16, 2018.
|
| 160 |
+
|
| 161 |
+
Kevin Ellis, Maxwell Nye, Yewen Pu, Felix Sosa, Josh Tenenbaum, and Armando Solar-Lezama. Write, execute, assess: Program synthesis with a repl. In Advances in Neural Information Processing Systems, pp. 9169–9178, 2019.
|
| 162 |
+
|
| 163 |
+
Pierre-Alain Fayolle and Alexander Pasko. An evolutionary approach to the extraction of object construction trees from 3d point clouds. Computer-Aided Design, 74:1–17, 2016.
|
| 164 |
+
|
| 165 |
+
Markus Friedrich, Pierre-Alain Fayolle, Thomas Gabor, and Claudia Linnhoff-Popien. Optimizing evolutionary csg tree extraction. In Proceedings of the Genetic and Evolutionary Computation Conference, pp. 1183–1191, 2019.
|
| 166 |
+
|
| 167 |
+
Karim Hamza and Kazuhiro Saitou. Optimization of constructive solid geometry via a tree-based multi-objective genetic algorithm. In Genetic and Evolutionary Computation Conference, pp. 981–992. Springer, 2004.
|
| 168 |
+
|
| 169 |
+
Pradeep Kumar Jayaraman, Aditya Sanghi, Joseph Lambourne, Thomas Davies, Hooman Shayani, and Nigel Morris. Uv-net: Learning from curve-networks and solids. arXiv preprint arXiv:2006.10211, 2020.
|
| 170 |
+
|
| 171 |
+
R. Kenny Jones, Theresa Barton, Xianghao Xu, Kai Wang, Ellen Jiang, Paul Guerrero, Niloy Mitra, and Daniel Ritchie. Shapeassembly: Learning to generate programs for 3d shape structure synthesis. ACM Transactions on Graphics (TOG), Siggraph Asia 2020, 39(6):Article 234, 2020.
|
| 172 |
+
|
| 173 |
+
Ashwin Kalyan, Abhishek Mohta, Oleksandr Polozov, Dhruv Batra, Prateek Jain, and Sumit Gulwani. Neural-guided deductive search for real-time program synthesis from examples. arXiv preprint arXiv:1804.01186, 2018.
|
| 174 |
+
|
| 175 |
+
Kacper Kania, Maciej Zi˛eba, and Tomasz Kajdanowicz. Ucsg-net–unsupervised discovering of constructive solid geometry tree. arXiv preprint arXiv:2006.09102, 2020.
|
| 176 |
+
|
| 177 |
+
Sangpil Kim, Hyung-gun Chi, Xiao Hu, Qixing Huang, and Karthik Ramani. A large-scale annotated mechanical components benchmark for classification and retrieval tasks with deep neural networks. In Proceedings of 16th European Conference on Computer Vision (ECCV), 2020.
|
| 178 |
+
|
| 179 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 180 |
+
|
| 181 |
+
Sebastian Koch, Albert Matveev, Zhongshi Jiang, Francis Williams, Alexey Artemov, Evgeny Burnaev, Marc Alexa, Denis Zorin, and Daniele Panozzo. Abc: A big cad model dataset for geometric deep learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9601–9611, 2019.
|
| 182 |
+
|
| 183 |
+
Changjian Li, Hao Pan, Adrien Bousseau, and Niloy J. Mitra. Sketch2cad: Sequential cad modeling by sketching in context. ACM Trans. Graph. (Proceedings of SIGGRAPH Asia 2020), 39(6): 164:1–164:14, 2020. doi: https://doi.org/10.1145/3414685.3417807.
|
| 184 |
+
|
| 185 |
+
Renjie Liao, Yujia Li, Yang Song, Shenlong Wang, Will Hamilton, David K Duvenaud, Raquel Urtasun, and Richard Zemel. Efficient graph generation with graph recurrent attention networks. In Advances in Neural Information Processing Systems, pp. 4255–4265, 2019.
|
| 186 |
+
|
| 187 |
+
Cheng Lin, Tingxiang Fan, Wenping Wang, and Matthias Nießner. Modeling 3d shapes by reinforcement learning. ECCV, 2020.
|
| 188 |
+
|
| 189 |
+
Kaichun Mo, Paul Guerrero, Li Yi, Hao Su, Peter Wonka, Niloy J. Mitra, and Leonidas J. Guibas. Structurenet: Hierarchical graph networks for 3d shape generation. ACM Trans. Graph., 38(6), November 2019a. ISSN 0730-0301. doi: 10.1145/3355089.3356527.
|
| 190 |
+
|
| 191 |
+
Kaichun Mo, Shilin Zhu, Angel X Chang, Li Yi, Subarna Tripathi, Leonidas J Guibas, and Hao Su. Partnet: A large-scale benchmark for fine-grained and hierarchical part-level 3d object understanding. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 909–918, 2019b.
|
| 192 |
+
|
| 193 |
+
Chandrakana Nandi, Anat Caspi, Dan Grossman, and Zachary Tatlock. Programming language tools and techniques for 3d printing. In 2nd Summit on Advances in Programming Languages (SNAPL 2017). Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik, 2017.
|
| 194 |
+
|
| 195 |
+
Chandrakana Nandi, James R Wilcox, Pavel Panchekha, Taylor Blau, Dan Grossman, and Zachary Tatlock. Functional programming for compiling and decompiling computer-aided design. Proceedings of the ACM on Programming Languages, 2(ICFP):1–31, 2018.
|
| 196 |
+
|
| 197 |
+
Chandrakana Nandi, Max Willsey, Adam Anderson, James R. Wilcox, Eva Darulova, Dan Grossman, and Zachary Tatlock. Synthesizing structured cad models with equality saturation and inverse transformations. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 31–44, 2020.
|
| 198 |
+
|
| 199 |
+
Adriana Schulz, Ariel Shamir, David I. W. Levin, Pitchaya Sitthi-Amorn, and Wojciech Matusik. Design and fabrication by example. ACM Transactions on Graphics (Proceedings SIGGRAPH 2014), 33(4), 2014.
|
| 200 |
+
|
| 201 |
+
Ari Seff, Yaniv Ovadia, Wenda Zhou, and Ryan P. Adams. Sketchgraphs: A large-scale dataset for modeling relational geometry in computer-aided design. In ICML 2020 Workshop on ObjectOriented Learning. 2020.
|
| 202 |
+
|
| 203 |
+
Jami J Shah, David Anderson, Yong Se Kim, and Sanjay Joshi. A discourse on geometric feature recognition from cad models. J. Comput. Inf. Sci. Eng., 1(1):41–51, 2001.
|
| 204 |
+
|
| 205 |
+
Vadim Shapiro and Donald L Vossler. Separation for boundary to csg conversion. ACM Transactions on Graphics (TOG), 12(1):35–55, 1993.
|
| 206 |
+
|
| 207 |
+
Gopal Sharma, Rishabh Goyal, Difan Liu, Evangelos Kalogerakis, and Subhransu Maji. Csgnet: Neural shape parser for constructive solid geometry. corr abs/1712.08290 (2017). arXiv preprint arXiv:1712.08290, 2017.
|
| 208 |
+
|
| 209 |
+
Binil Starly. FabWave - 3D Part Repository, 2020. URL https://www.dimelab.org/ fabwave.
|
| 210 |
+
|
| 211 |
+
O. Stava, S. Pirk, J. Kratt, B. Chen, R. Mundefinedch, O. Deussen, and B. Benes. Inverse procedural modelling of trees. Comput. Graph. Forum, 33(6):118–131, September 2014. ISSN 0167-7055. doi: 10.1111/cgf.12282. URL https://doi.org/10.1111/cgf.12282.
|
| 212 |
+
|
| 213 |
+
Jerry O. Talton, Yu Lou, Steve Lesser, Jared Duke, Radomír Mech, and Vladlen Koltun. Metropolis ˇ procedural modeling. ACM Trans. Graph., 30(2), April 2011. ISSN 0730-0301. doi: 10.1145/ 1944846.1944851. URL https://doi.org/10.1145/1944846.1944851.
|
| 214 |
+
|
| 215 |
+
Yunhao Tang, Shipra Agrawal, and Yuri Faenza. Reinforcement learning for integer programming: Learning to cut. arXiv preprint arXiv:1906.04859, 2019.
|
| 216 |
+
|
| 217 |
+
Yonglong Tian, Andrew Luo, Xingyuan Sun, Kevin Ellis, William T. Freeman, Joshua B. Tenenbaum, and Jiajun Wu. Learning to infer and execute 3d shape programs. In International Conference on Learning Representations, 2019.
|
| 218 |
+
|
| 219 |
+
Carlos A. Vanegas, Ignacio Garcia-Dorado, Daniel G. Aliaga, Bedrich Benes, and Paul Waddell. Inverse design of urban procedural models. ACM Trans. Graph., 31(6), November 2012. ISSN 0730-0301. doi: 10.1145/2366145.2366187. URL https://doi.org/10.1145/ 2366145.2366187.
|
| 220 |
+
|
| 221 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 222 |
+
|
| 223 |
+
K.J. Weiler. Topological structures for geometric modeling. Technical report RPI, Center for Interactive Computer Graphics. University Microfilms, 1986.
|
| 224 |
+
|
| 225 |
+
Daniel Weiss. Geometry-based structural optimization on CAD specification trees. PhD thesis, ETH Zurich, 2009.
|
| 226 |
+
|
| 227 |
+
Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1912–1920, 2015.
|
| 228 |
+
|
| 229 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 230 |
+
|
| 231 |
+
Zhibo Zhang, Prakhar Jaiswal, and Rahul Rai. Featurenet: machining feature recognition based on 3d convolution neural network. Computer-Aided Design, 101:12–22, 2018.
|
| 232 |
+
|
| 233 |
+
Qingnan Zhou and Alec Jacobson. Thingi10k: A dataset of 10,000 3d-printing models. arXiv preprint arXiv:1605.04797, 2016.
|
| 234 |
+
|
| 235 |
+
Chuhang Zou, Ersin Yumer, Jimei Yang, Duygu Ceylan, and Derek Hoiem. 3d-prnn: Generating shape primitives with recurrent neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 900–909, 2017.
|
| 236 |
+
|
| 237 |
+
# A APPENDIX
|
| 238 |
+
|
| 239 |
+
# A.1 FUSION 360 GALLERY RECONSTRUCTION DATASET
|
| 240 |
+
|
| 241 |
+
In this section we provide additional details on the Fusion 360 Gallery reconstruction dataset.
|
| 242 |
+
|
| 243 |
+
# A.1.1 DATA PROCESSING
|
| 244 |
+
|
| 245 |
+
We acquire the Fusion 360 designs from the Autodesk Online Gallery2. From the approximately 20,000 designs available we derive several datasets focused on specific areas of research. This paper introduces the reconstruction dataset as a new baseline dataset for CAD reconstruction. We use the Fusion 360 Python API to parse the native .f3d files. We divide multi-component assemblies into separate designs and suppress modeling operations other than sketch and extrude to expand the data quantity. Figure 10 shows an example assembly that is split up to produce multiple designs with independent construction sequences. The rounded edges are removed by suppressing fillets in the parametric CAD file.
|
| 246 |
+
|
| 247 |
+
After each construction sequence has been extracted we perform reconstruction and compare the reconstructed design to the original to ensure data validity. Failure cases and any duplicate designs, are not included in the dataset. We consider a design a duplicate when there is an exact match in all of the following: body count, face count, surface area to one decimal point, volume to one decimal point, and for each extrude in the construction sequence: extrude profile count, extrude body count, extrude face count, extrude side face count, extrude end face count, and extrude start face count. This process allows us to match designs that have been translated or rotated, while considering designs unique if they have matching geometry but different construction sequences. Deduplication removes approximately 5,000 designs. Figure 11 shows a random sampling of designs from the reconstruction dataset.
|
| 248 |
+
|
| 249 |
+
# A.1.2 GEOMETRY DATA FORMAT
|
| 250 |
+
|
| 251 |
+
We provide geometry in several data formats that we discuss in this section. Geometry is provided for the final design and after each extrude operation.
|
| 252 |
+
|
| 253 |
+
Boundary Representation A B-Rep consists of faces, edges, loops, coedges and vertices (Weiler, 1986). A face is a connected region of the model’s surface. An edge defines the curve where two faces meet and a vertex defines the point where edges meet. Faces have an underlying parametric surface which is divided into visible and hidden regions by a series of boundary loops. A set of connected faces forms a body. Designs in the dataset may contain multiple bodies.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 10: An example multi-component assembly that is broken up into separate designs (highlighted with color), each with an independent construction sequence.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 11: A random sampling of designs from the Fusion 360 Gallery reconstruction dataset.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 12: Left: The number of bodies per design shown as a distribution. Right: The number of B-Rep faces per design shown as a distribution.
|
| 263 |
+
|
| 264 |
+
B-Rep data is provided as .smt files representing the ground truth geometry and .step as an alternate neutral B-Rep file format. The .smt file format is the native format used by Autodesk Shape Manager, the CAD kernel within Fusion 360, and has the advantage of minimizing conversion errors. Additionally the B-Rep entities, such as bodies and faces, can referenced from the construction sequence back to entities in the .smt file.
|
| 265 |
+
|
| 266 |
+
Mesh Mesh data is provided in .obj format representing a triangulated version of the B-Rep. Each B-Rep face is triangulated separately and labeled as a group of triangles in the .obj file with the B-Rep face id as the group name. This approach allows the triangles to be traced back to the B-Rep face and associated extrude operation. Note that the .obj meshes provided are not manifold.
|
| 267 |
+
|
| 268 |
+
Other representations, such as point clouds or voxels, can be generated using existing data conversion routines and are not included in the dataset. For convenience we include a thumbnail .png image file together with each geometry.
|
| 269 |
+
|
| 270 |
+
Files are provided in a single directory, with a naming convention as follows: XXXXX_YYYYYYYY_ZZZZ[_1234].ext. Here XXXXX represents the project, YYYYYYYY the file, ZZZZ the component, and _1234 the extrude index. If _1234 is absent the file represents the final design.
|
| 271 |
+
|
| 272 |
+
# A.1.3 DESIGN COMPLEXITY
|
| 273 |
+
|
| 274 |
+
A key goal of the reconstruction dataset is to provide a suitably scoped baseline for learning-based approaches to CAD reconstruction. Restricting the modeling operations to sketch and extrude vastly narrows the design space and enables simpler shape grammars for reconstruction. Each design represents a component in Fusion 360 that can have multiple geometric bodies. Figure 12 (left) illustrates that the vast majority of designs have a single body. The number of B-Rep faces in each design gives a good indication of the complexity of the dataset. Figure 12 (right) shows the number of faces per design as a distribution, with the peak being between 5-10 faces per design. As we do not filter any of the designs based on complexity, this distribution reflects real designs where simple washers and flat plates are common components in mechanical assemblies.
|
| 275 |
+
|
| 276 |
+
# A.1.4 CONSTRUCTION SEQUENCE
|
| 277 |
+
|
| 278 |
+
The construction sequence is the series of sketch and extrude operations that are executed to produce the final geometry. We provide the construction sequence in a JSON format text file. Each step in the construction sequence has associated parameters that are stored in that entity. For example, sketch entities will store the curves that make up the sketch. Each construction sequence must have at least one sketch and one extrude step, for a minimum of two steps. The average number of steps is 4.74, the median 4, the mode 2, and the maximum 61. Figure 13 illustrates the distribution of construction sequence length and the most frequent construction sequence combinations.
|
| 279 |
+
|
| 280 |
+
With access to the full parametric history, it is possible to extract numerous relationships from the dataset that can be used for learning. Starting at a high level, we know the order of modeling operations in the construction sequence. The sketch geometry, B-Rep faces, and triangles derived from them, can be traced back to a position in the construction sequence. The type of geometry created by each modeling operation is also known. For example, sketches create trimmed profiles where the curves intersect to form closed loops; extrude operations produce B-Rep faces with information such as which faces were on the side or ends of an extrusion. In addition, the sequence of B-Rep models themselves contain valuable topology information that can be leveraged, such as the connectivity of B-Rep faces and edges. Finally geometric information like points and normal vectors can be sampled from the parametric surfaces. Feature diversity enables many different learning representations and architectures to be leveraged and compared.
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 13: Left: The distribution of construction sequence length. Right: The distribution of common construction sequences. S indicates a Sketch and E indicates an Extrude operation.
|
| 284 |
+
|
| 285 |
+
# A.1.5 SKETCH
|
| 286 |
+
|
| 287 |
+
In this section we describe the sketch data in further detail and present statistics illustrating the data distribution. Figure 14 illustrates the geometric 2D primitives, described in section 3, that make up a sketch. Sketches are represented as a series of points (pt1...pt6), that create curves (c1...c5), that in turn create profiles (pr1...pr3), illustrated with separate colors. Profiles can have inner loops to create holes, $c 1$ is the inner loop of $p r 2$ and the outer loop of $p r 3$ . Profiles also have a trimmed representation that contains only closed loops without open curves. The trimmed representation is shown in the lower right of Figure 14 where the $c 5$ is trimmed and incorporated into pr1 and pr2.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 14: Sketch primitives.
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 15: Left: The number of curves in each design, shown as a distribution. Right: Common curve combinations in each design, shown as a distribution. Each curve type is abbreviated as follows: C - SketchCircle, A - SketchArc, L - SketchLine, S - SketchFittedSpline.
|
| 294 |
+
|
| 295 |
+
All sketch geometry is provided in a solved state, meaning a sketch constraint solver is not required for standard reconstruction. The as-designed ordering of sketch operations is not stored in the native design files, however a consistent ordering can be derived by traversing the sketch profiles in sequence.
|
| 296 |
+
|
| 297 |
+
Points Each point is provided with a universally unique identifier (UUID) key and a Point3D data structure with $x , y$ , and $z$ . Sketch primitives are drawn in a local 2D coordinate system and later transformed into world coordinates. As such all sketch points have a $z$ value of 0.
|
| 298 |
+
|
| 299 |
+
Curves Each curve has a UUID key and a SketchCurve that can represent the curve types listed below. The parameters for each curve type can be referenced via the Fusion 360 API documentation linked below.
|
| 300 |
+
|
| 301 |
+
• SketchArc
|
| 302 |
+
• SketchCircle
|
| 303 |
+
• SketchConicCurve
|
| 304 |
+
• SketchEllipse
|
| 305 |
+
• SketchEllipticalArc
|
| 306 |
+
• SketchFittedSpline
|
| 307 |
+
• SketchFixedSpline
|
| 308 |
+
• SketchLine
|
| 309 |
+
|
| 310 |
+
Figure 15 illustrates the distribution of curve count per design and the frequency that different curve combinations are used together in a design. It is notable that mechanical CAD sketches rely heavily on lines, circles, and arcs rather than spline curves.
|
| 311 |
+
|
| 312 |
+
Profiles Profiles represent a collection of curves that join together to make a closed loop. In Fusion 360 profiles are automatically generated from arbitrary curves that don’t necessarily connect at the end points. In Figure 14 two profiles (pr1 and pr2) are generated when the line crosses the triangle. We provide both the original curves (Figure 14, top right) used to generate the profiles (Figure 14, bottom left) and the trimmed profile information containing just the closed profile loop (Figure 14, bottom right). Loops within profiles have a flag that can be set to specify holes.
|
| 313 |
+
|
| 314 |
+
Dimensions User specified sketch dimensions are used to define set angles, diameters, distances etc. between sketch geometry to constraint the sketch as it is edited. Each dimension has a UUID key and a SketchDimension that can represent the dimension types listed below. Each dimension references one or more curves by UUID. The parameters for each dimension type can be referenced via the Fusion 360 API documentation linked below.
|
| 315 |
+
|
| 316 |
+
• SketchAngularDimension • SketchConcentricCircleDimension • SketchDiameterDimension • SketchEllipseMajorRadiusDimension • SketchEllipseMinorRadiusDimension • SketchLinearDimension • SketchOffsetCurvesDimension • SketchOffsetDimension • SketchRadialDimension
|
| 317 |
+
|
| 318 |
+
Constraints Constraints define geometric relationships between sketch geometry. For example, a symmetry constraint enables the user to have geometry mirrored, or a parallel constraint ensures two lines are always parallel. Each constraint has a UUID key and a GeometricConstraint that can represent the constraint types listed below. Each constraint references one or more curves by UUID. The parameters for each constraint type can be referenced via the Fusion 360 API documentation linked below.
|
| 319 |
+
|
| 320 |
+
• CircularPatternConstraint
|
| 321 |
+
• CoincidentConstraint
|
| 322 |
+
• CollinearConstraint
|
| 323 |
+
• ConcentricConstraint EqualConstraint HorizontalConstraint
|
| 324 |
+
• HorizontalPointsConstraint MidPointConstraint OffsetConstraint ParallelConstraint
|
| 325 |
+
• PerpendicularConstraint PolygonConstraint
|
| 326 |
+
• RectangularPatternConstraint SmoothConstraint
|
| 327 |
+
• SymmetryConstraint
|
| 328 |
+
• TangentConstraint
|
| 329 |
+
• VerticalConstraint
|
| 330 |
+
• VerticalPointsConstraint
|
| 331 |
+
|
| 332 |
+
# A.1.6 EXTRUDE
|
| 333 |
+
|
| 334 |
+
In this section we describe the extrude data in further detail and present statistics illustrating the data distribution. Extrude operations have a number of parameters that are set by the user while designing. Figure 17 shows how a sketch (left) can be extruded a set distance on one side, symmetrically on two sides, with different distances on each side, as well as tapered. Once a single body has been created by an extrude operation, subsequent extrudes can interact with that body via Boolean operations. Figure 18 shows a starting body and sketch (left) that can be extruded to form two separate bodies, a single joined body, a cut through the starting body, or a body at the intersection. The first extrude operation of a construction sequence is always a new body, with any operation possible for subsequent operations.
|
| 335 |
+
|
| 336 |
+

|
| 337 |
+
Figure 16 illustrates the distribution of dimension and constraint types in the dataset.
|
| 338 |
+
Figure 16: The distribution of constraint (left) and dimension (right) types.
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 17: An extrude can be expressed in several different ways: perpendicular from a sketch for a set distance along one side, a symmetrical distance along both sides, or separate distances along two sides. Additionally the extrude can be tapered at an angle.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 18: Extrude operations include the ability to Boolean with other geometry. From the starting body shown on the left, a sketch is extruded to form a new body overlapping the starting body, joined with the starting body, cut out of the starting body, or intersected with the starting body.
|
| 345 |
+
|
| 346 |
+
Figure 19 outlines the distribution of different extrude types and operations. Note that tapers can be applied in addition to any extrude type, so the overall frequency of each is shown rather than a relative percentage.
|
| 347 |
+
|
| 348 |
+
# A.2 FUSION 360 GYM
|
| 349 |
+
|
| 350 |
+
In this section we provide additional information about the functionality available in the Fusion 360 Gym. The Fusion 360 Gym requires the Autodesk Fusion 360 desktop CAD application, available on both macOS and Windows for free to the academic community. Although Fusion 360 is a cloud connected desktop application, the Fusion 360 Gym does all processing locally. The Fusion 360 Gym consists of a server that runs inside of Fusion 360 and receives commands from a client running externally. Multiple instances of the Fusion 360 Gym server can be run in parallel. The remainder of this section introduces the available commands from the client.
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 19: The distribution of extrude types (left) and operations (right).
|
| 354 |
+
|
| 355 |
+
# A.2.1 RECONSTRUCTION COMMANDS
|
| 356 |
+
|
| 357 |
+
Reconstruction commands can reconstruct the existing designs at different granularity levels from json files provided with the Fusion 360 Gallery reconstruction dataset.
|
| 358 |
+
|
| 359 |
+
• reconstruct(file): reconstruct an entire design from the provided json file.
|
| 360 |
+
• reconstruct_sketch(json_data, sketch_name, sketch_plane, scale, translate, rotate): reconstruct a sketch from the provided json data and a sketch name. A sketch_plane can be either: (1) a string value representing a construction plane: XY, XZ, or YZ; (2) a B-Rep planar face id; or (3) a point3d on a planar face of a B-Rep. reconstruct_profile(json_data, sketch_name, profile_id, scale, translate, rotate): reconstruct a profile from the provide json data, a sketch name, and a profile id. reconstruct_curve(json_data, sketch_name, curve_id, scale, translate, rotate): reconstruct a curve from the provide json data, a sketch name, and a curve id.
|
| 361 |
+
• set_target(file): set the target to be reconstructed with a .step or .smt file. The call returns a face adjacency graph representing the B-Rep geometry/topology and a bounding_box of the target that can be used for normalization.
|
| 362 |
+
• revert_to_target(): revert to the target design, removing all reconstruction geometry.
|
| 363 |
+
|
| 364 |
+
# A.2.2 SKETCH EXTRUSION COMMANDS
|
| 365 |
+
|
| 366 |
+
Sketch extrusion commands allows users to incrementally create new designs by generating the underlying sketch primitives and extruding them by an arbitrary amount.
|
| 367 |
+
|
| 368 |
+
• add_sketch(sketch_plane): add a sketch to the design. A sketch_plane can be either: (1) a string value representing a construction plane: XY, XZ, or YZ; (2) a B-Rep planar face id; or (3) a point3d on a planar face of a B-Rep.
|
| 369 |
+
• add_point(sketch_name, p1, transform): add a point to create a new sequential line in the given sketch. p1 is either a point in the 2D sketch space or a point in the 3D world coordinate space if transform $\underline { { \underline { { \mathbf { \Pi } } } } } =$ "world" is specified.
|
| 370 |
+
• add_line(sketch_name, p1, p2, transform): add a line to the given sketch. p1 and p2 are the same as defined in add_point().
|
| 371 |
+
• add_curve(sketch_name, curve_data, transform): add a curve to the given sketch. curve_data follows the format supplied to reconstruct_curve(). close_profile(sketch_name): close the current set of lines to create one or more profiles by joining the first point to the last point.
|
| 372 |
+
• add_extrude(sketch_name, profile_id, distance, operation, export_type, is_IoU): add an extrude to the design. Four operations are supported: JoinFeatureOperation, CutFeatureOperation, IntersectFeatureOperation, or NewBodyFeatureOperation. Two export formats are provided: (1) BRep to represent B-Rep vertices of the resulting body and B-Rep face information; (2) Graph to represent a face adjacency graph representing the B-Rep geometry/topology. An intersection over union (IoU) value between the target and the reconstruction is calculated and returned if is_IoU $\mathop { \bf { \bar { \mathbf { \Lambda } } } }$ "True" is specified.
|
| 373 |
+
|
| 374 |
+
# A.2.3 FACE EXTRUSION COMMANDS
|
| 375 |
+
|
| 376 |
+
Face extrusion commands enable a target design to be reconstructed using extrude operations from face to face.
|
| 377 |
+
|
| 378 |
+
• add_extrude_by_target_face(start_face, end_face, operation): add an extrude between two faces of the target. Four operations are supported: JoinFeatureOperation, CutFeatureOperation, IntersectFeatureOperation, or NewBodyFeatureOperation.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 20: Example designs created using randomized reconstruction commands.
|
| 382 |
+
|
| 383 |
+
• add_extrudes_by_target_face(actions, revert): execute multiple extrude operations, between two faces of the target, in sequence.
|
| 384 |
+
|
| 385 |
+
# A.2.4 RANDOMIZED RECONSTRUCTION COMMANDS
|
| 386 |
+
|
| 387 |
+
Randomized reonstruction commands allow users to sample designs, sketches, and profiles from existing designs in the Fusion 360 Gallery and support distribution matching of parameters, in support of generations of semi-synthetic data. Figure 20 shows example designs created using randomized reconstruction commands.
|
| 388 |
+
|
| 389 |
+
• get_distributions(data_dir, filter): get a list of distributions from the provided dataset. The command currently supports the following distributions: the starting sketch place, the number of faces, the number of extrusions, the length of sequences, the number of curves, the number of bodies, the sketch areas, and the profile areas.
|
| 390 |
+
|
| 391 |
+
• distribution_sampling(distributions, parameters): sample distribution matching parameters for one design from the distributions.
|
| 392 |
+
• sample_design(data_dir): randomly sample a json file from the given dataset.
|
| 393 |
+
• sample_sketch(json_file, sampling_type, area_distribution): sample one sketch from the provided design. Three sampling types are provided: (1) random, return a sketch randomly sampled from the provided design; (2) deterministic, return the largest sketch in the design; and (3) distributive, return a sketch that its area is in the distribution of the provided dataset.
|
| 394 |
+
• sample_profiles(sketch_name, max_number_profiles, sampling_type, area_distribution): sample profiles from the provided sketch. Three sampling types are provided: (1) random, return profiles randomly sampled from the provided sketch; (2) deterministic, return profiles that are larger than the average area of the profiles in the sketch; and (3) distributive, return profiles that the areas are in the distribution of the provided dataset.
|
| 395 |
+
|
| 396 |
+
# A.2.5 EXPORT COMMANDS
|
| 397 |
+
|
| 398 |
+
Export commands enable the existing designs to be exported in the following formats:
|
| 399 |
+
|
| 400 |
+
• mesh(file): retrieve a mesh in .obj or .stl format and write it to the local file provided.
|
| 401 |
+
• brep(file): retrieve a brep in .step, .smt, or .f3d format and write it to a local file provided.
|
| 402 |
+
• sketches(dir, format): retrieve each sketch in .png or .dxf format and write them to a local directory provided. screenshot(file, width, height): retrieve a screenshot of the current design as a png image and write it to a local file provided.
|
| 403 |
+
graph(file, dir, format): retrieve a face adjacency graph in a given format and write it in a local directory provided.
|
| 404 |
+
|
| 405 |
+
# A.3 CAD RECONSTRUCTION
|
| 406 |
+
|
| 407 |
+
In this section we provide additional details of the experiments performed on the CAD reconstruction task described in Section 5.
|
| 408 |
+
|
| 409 |
+
# A.3.1 DATA PREPARATION
|
| 410 |
+
|
| 411 |
+
The agents are trained on a subset of the reconstruction dataset that has been converted into a face extrusion sequence. Due to the simplified face extrusion representation, not all designs from the dataset can be converted to a face extrusion sequence. Figure 21 shows several common conversion limitations where necessary face information (highlighted in red) is not present in the target geometry. The intermediate top face in Figure $2 1 \ \mathbf { B }$ disappears when merged with the top face of Extrude 2. In Figure $2 1 ~ \mathrm { { C } }$ a hole cut through the geometry means the intermediate top face of Extrude 1 is absent and there is no start or end face in the target geometry to perform the cut operation used in Extrude 2. Although it is possible to find alternate face extrusion sequences with heuristic rules, we instead try to maintain the user designed sequence with the exception of reversing the direction of the extrusion in some scenarios, e.g. the end face becomes the start face.
|
| 412 |
+
|
| 413 |
+
# A.3.2 AGENT
|
| 414 |
+
|
| 415 |
+
All MPN agents employ a network architecture able to exploit the graph structure of the data, consisting of two layers passing messages along the edges of the graph. The vertex features in the face-adjacency graph are as follows:
|
| 416 |
+
|
| 417 |
+
• Points: A $1 0 \times 1 0$ grid of 3D points sampled from the UV coordinate space of the B-Rep face and normalized to the bounding box of the target geometry.
|
| 418 |
+
• Normals: A $1 0 \times 1 0$ grid of 3D normal vectors sampled from the UV coordinate space of the B-Rep face.
|
| 419 |
+
• Trimming Mask: A $1 0 \times 1 0$ grid of binary values representing samples that are inside/outside the B-Rep face trimming boundary.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 21: Different construction sequences (A-C) for the same geometry. During conversion to a face extrusion sequence, the necessary face information (highlighted in red) does not exist in the target, meaning B and C can not be converted. Green arrows indicate new body/join extrude operations, while red arrows indicate cut extrude operations.
|
| 423 |
+
|
| 424 |
+
• Surface Type: A one-hot encoded flag indicating the type of surface represented by the BRep face: Cone, Cylinder, Elliptical, EllipticalCylinder, Nurbs, Plane, Sphere, Torus.
|
| 425 |
+
|
| 426 |
+
We denote the learned vertex embedding vectors produced by the two MPN branches as $\{ \mathbf h _ { c } ^ { i } \}$ and $\{ \mathbf { h } _ { t } ^ { j } \}$ for the current output and target graphs, respectively. We estimate the probability of the $k$ -th operation type, and the $j$ -th face being the start face or end face as:
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\begin{array} { c } { { \displaystyle P _ { o p } ^ { k } = F _ { o p } \big ( { \bf h } _ { c } \big ) , ~ { \bf h } _ { c } = \sum _ { i } { \bf h } _ { c } ^ { i } } } \\ { { \displaystyle P _ { s t a r t } ^ { j } = \mathrm { s o f t r a x } \Big ( F _ { s t a r t } \big ( { \bf h } _ { t } ^ { j } , { \bf h } _ { c } \big ) \Big ) } } \end{array}
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
P _ { e n d } ^ { j } = \operatorname { s o f } _ { j } \tan \alpha \Big ( F _ { e n d } \big ( \mathbf { h } _ { t } ^ { j } , \mathbf { h } _ { t } ^ { \widetilde { j } } , \mathbf { h } _ { c } \big ) \Big ) , s . t . \widetilde { j } = \arg \operatorname* { m a x } _ { j } P _ { s t a r t } ^ { j }
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
where $F _ { o p }$ , $F _ { s t a r t }$ , and $F _ { e n d }$ denote linear layers that take the concatenated vectors as input.
|
| 437 |
+
|
| 438 |
+
Using the face extrusion sequence data, we train the agents in an offline manner without interacting with the Fusion 360 Gym. The mlp and gcn agents have a hidden dimension of 256 across all layers. The gin agent has two 256-dimensional linear layers within its graph convolution layer. The gat has 8 heads of 64 hidden dimensions each. The agents are trained with a dropout rate of 0.1 and a learning rate of 0.0001 for 100 epochs with the model saved at the lowest training loss. The learning rate is decreased by a factor of 0.1 upon plateau within 10 most recent epochs. Training is performed on an NVIDIA Tesla V100 with an Adam optimizer and takes approximately 6-8 hours.
|
| 439 |
+
|
| 440 |
+
# A.3.3 SEARCH
|
| 441 |
+
|
| 442 |
+
In addition to the random rollout search (rand) described in Section 5.2 we implement beam search (beam) and best first search (best). Beam search explores multiple candidates in parallel, filtering the top- $\mathbf { \nabla } \cdot \mathbf { k }$ candidates, ranked by the generation probability, until a certain length. Best search explores the search space by expanding the most-likely sequence, also ranked by the generation probability.
|
| 443 |
+
|
| 444 |
+
In all search algorithms we mask out the following invalid actions so they are never taken:
|
| 445 |
+
|
| 446 |
+

|
| 447 |
+
Figure 22: Average reconstruction time per design for combinations of agents and search strategies.
|
| 448 |
+
|
| 449 |
+
• Start faces surface types that are non-planar
|
| 450 |
+
• End faces surface types that are non-planar
|
| 451 |
+
• Operation types other than new body when the current geometry is empty
|
| 452 |
+
|
| 453 |
+
Other invalid actions that require geometric checks, such as specifying a start face and end face that are co-planar, are returned as invalid from the Fusion 360 Gym and count against the search budget.
|
| 454 |
+
|
| 455 |
+
# A.3.4 EVALUATION
|
| 456 |
+
|
| 457 |
+
We perform evaluation using the official test set containing 1725 designs. Evaluation is performed in an online manner using the Fusion 360 Gym. Figure 22 shows the average reconstruction time for each design with combinations of agents and search strategies. Time differences are due in part to the number of invalid actions chosen by an agent that can be quickly checked in the Fusion $3 6 0 G y m$ without geometry processing. The large majority of evaluation time is spent inside the Fusion 360 Gym executing modeling operations, graph generation, and IoU calculation. We set a hard time limit of 10 minutes per design, after which we halt search, affecting between 0-14 designs depending on the agent and search strategy. Between 0-15 designs cause software crashes. 17 designs in the test set cannot be represented as graphs due to our data pipeline not supporting edges with more than two adjacent faces. In all failure cases we use the best seen IoU, or 0 if no IoU score is available, and consider the design to fail at exact reconstruction.
|
| 458 |
+
|
| 459 |
+
# A.3.5 RESULTS
|
| 460 |
+
|
| 461 |
+
Table 2 details the full set of results for all agents and search strategies in the extendedbaseline comparison experiment from Section 5.3. Table 3 provides additional details of the synthetic data performance experiment from Section 5.3. Figure 23 visually compares three different search strategies side by side using the gcn agent. We observe that all search strategies perform similarly for reconstruction IoU, while random rollout search has a notable advantage in exact reconstructions. This advantage is due to the limited search budget we enforce to reflect a real-world scenario. We expect both best and beam search to improve with larger search budgets.
|
| 462 |
+
|
| 463 |
+
# A.4 TASKS
|
| 464 |
+
|
| 465 |
+
In addition to CAD reconstruction the Fusion 360 Gallery reconstruction dataset and Fusion 360 Gym can be used for a range tasks such as program synthesis, sequence modeling, generative models, and geometric deep learning. Other tasks include:
|
| 466 |
+
|
| 467 |
+
• Modeling operation order prediction to recover the correct order of construction from raw geometry.
|
| 468 |
+
• Sketch synthesis to recover the original sketch, including constraints and dimensions, from the 3D geometry.
|
| 469 |
+
• Predicting next action in the design sequence for ‘CAD autocomplete’.
|
| 470 |
+
• Generative models that are aware of the design sequence and constraints.
|
| 471 |
+
|
| 472 |
+
Table 2: Reconstruction results for multiple agent and search combinations. IoU and exact reconstruction are shown at 20 and 100 search steps. Lower values are better for conciseness.
|
| 473 |
+
|
| 474 |
+
<table><tr><td rowspan="2">Agent</td><td rowspan="2">Search</td><td colspan="2">IoU</td><td colspan="2">Exact Reconstruction.%</td><td rowspan="2">Conciseness</td><td rowspan="2">#Parameters.</td></tr><tr><td>20 Steps</td><td>100 Steps</td><td>20 Steps</td><td>100 Steps</td></tr><tr><td></td><td>rand</td><td>0.8644</td><td>0.9042</td><td>0.6232</td><td>0.6754</td><td>1.0168</td><td>3.02M</td></tr><tr><td>gcn gcn</td><td>beam</td><td>0.8640</td><td>0.8982</td><td>0.5739</td><td>0.6122</td><td>0.9275</td><td>3.02M</td></tr><tr><td>gcn</td><td>best</td><td>0.8831</td><td>0.9186</td><td>0.5971</td><td>0.6348</td><td>0.9215</td><td>3.02M</td></tr><tr><td>mlp</td><td>rand</td><td>0.8274</td><td>0.8596</td><td>0.5658</td><td>0.5965</td><td>0.9763</td><td>2.24M</td></tr><tr><td>mlp</td><td>beam</td><td>0.8619</td><td>0.8995</td><td>0.5525</td><td>0.5884</td><td>0.9271</td><td>2.24M</td></tr><tr><td>mlp</td><td>best</td><td>0.8712</td><td>0.8991</td><td>0.5675</td><td>0.5977</td><td>0.9305</td><td>2.24M</td></tr><tr><td>gat</td><td>rand</td><td>0.8742</td><td>0.9128</td><td>0.6191</td><td>0.6742</td><td>1.0206</td><td>3.03M</td></tr><tr><td>gat</td><td>beam</td><td>0.8691</td><td>0.9016</td><td>0.5791</td><td>0.6133</td><td>0.9261</td><td>3.03M</td></tr><tr><td>gat</td><td>best</td><td>0.8895</td><td>0.9139</td><td>0.5994</td><td>0.6354</td><td>0.9290</td><td>3.03M</td></tr><tr><td>gin</td><td>rand</td><td>0.8346</td><td>0.8761</td><td>0.5901</td><td>0.6301</td><td>1.0042</td><td>3.62M</td></tr><tr><td>gin</td><td>beam</td><td>0.8500</td><td>0.8913</td><td>0.5594</td><td>0.5983</td><td>0.9299</td><td>3.62M</td></tr><tr><td>gin</td><td>best</td><td>0.8693</td><td>0.9007</td><td>0.5803</td><td>0.6122</td><td>0.9340</td><td>3.62M</td></tr><tr><td>rand</td><td>rand</td><td>0.6840</td><td>0.8386</td><td>0.4157</td><td>0.5380</td><td>1.2824</td><td>=</td></tr><tr><td>rand</td><td>beam</td><td>0.4785</td><td>0.6277</td><td>0.2812</td><td>0.3896</td><td>0.9118</td><td>=</td></tr><tr><td>rand</td><td>best</td><td>0.6334</td><td>0.7994</td><td>0.3693</td><td>0.4887</td><td>0.8979</td><td>=</td></tr></table>
|
| 475 |
+
|
| 476 |
+
Table 3: Reconstruction results using random rollouts and gcn agents trained on human-designed data (real), a mixture of human-designed and semi-synthetic data (aug), semi-synthetic data (semisyn), and synthetic data (syn).
|
| 477 |
+
|
| 478 |
+
<table><tr><td>Agent</td><td colspan="2">IoU</td><td colspan="2">Exact Reconstruction %</td><td rowspan="2">Conciseness 100 Steps</td><td rowspan="2"># Parameters</td></tr><tr><td></td><td></td><td>20 Steps</td><td>100 Steps</td><td>20 Steps</td></tr><tr><td>real</td><td>0.8644</td><td>0.9042</td><td>0.6232</td><td>0.6754</td><td>1.0168</td><td>3.02M</td></tr><tr><td>aug</td><td>0.8707</td><td>0.8928</td><td>0.6452</td><td>0.6701</td><td>0.9706</td><td>3.02M</td></tr><tr><td>semi-syn</td><td>0.8154</td><td>0.8473</td><td>0.5780</td><td>0.6104</td><td>1.0070</td><td>3.02M</td></tr><tr><td>syn</td><td>0.6646</td><td>0.7211</td><td>0.4383</td><td>0.4835</td><td>1.0519</td><td>3.02M</td></tr></table>
|
| 479 |
+
|
| 480 |
+

|
| 481 |
+
Figure 23: Reconstruction results over 100 search steps using the gcn agent with best first search (best), random rollout search (rand) and beam search (beam).
|
md/train/HkePNpVKPB/HkePNpVKPB.md
ADDED
|
@@ -0,0 +1,431 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COMPOSITIONAL LANGUAGES EMERGE IN A NEURAL ITERATED LEARNING MODEL
|
| 2 |
+
|
| 3 |
+
Yi Ren,1 Shangmin Guo,2 Matthieu Labeau,3 Shay B. Cohen,1 Simon Kirby1
|
| 4 |
+
|
| 5 |
+
1 University of Edinburgh, United Kingdom, 2 University of Cambridge, United Kingdom
|
| 6 |
+
3 LTCI, Tel´ ecom Paris, Institut Polytechnique de Paris, France ´
|
| 7 |
+
1 renyi.joshua@gmail.com, scohen@inf.ed.ac.uk, simon.kirby@ed.ac.uk
|
| 8 |
+
2 sg955@cam.ac.uk, 3 matthieu.labeau@telecom-paris.fr
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
The principle of compositionality, which enables natural language to represent complex concepts via a structured combination of simpler ones, allows us to convey an open-ended set of messages using a limited vocabulary. If compositionality is indeed a natural property of language, we may expect it to appear in communication protocols that are created by neural agents in language games. In this paper, we propose an effective neural iterated learning (NIL) algorithm that, when applied to interacting neural agents, facilitates the emergence of a more structured type of language. Indeed, these languages provide learning speed advantages to neural agents during training, which can be incrementally amplified via NIL. We provide a probabilistic model of NIL and an explanation of why the advantage of compositional language exist. Our experiments confirm our analysis, and also demonstrate that the emerged languages largely improve the generalizing power of the neural agent communication.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Natural language understanding (NLU), which is exemplified by challenging problems such as machine reading comprehension, question answering and machine translation, plays a crucial role in artificial intelligence systems. So far, most of the existing methods focus on building statistical associations between textual inputs and semantic representations, e.g. using first-order logic (Manning et al., 1999) or other types of representations such as abstract meaning representation (Banarescu et al., 2013). Recently, grounded language learning has gradually attracted attention in various domains, inspired by the hypothesis that early language learning was focused on problemsolving (Kirby & Hurford, 2002). While related to NLU, it focuses on the pragmatics (Clark, 1996) of learning natural language, as it implies learning language from scratch, grounded in experience. This research is often practiced through the development of neural agents which are made to communicate with each other to accomplish specific tasks (for example, playing a game). During this process, the agents build mappings between the concepts they wish to communicate about and the symbols used to represent them. These mappings are usually referred to as ‘emergent language’.
|
| 17 |
+
|
| 18 |
+
So far, an array of recent work (Havrylov & Titov, 2017; Mordatch & Abbeel, 2018; Kottur et al., 2017; Foerster et al., 2016) has shown that in many game settings, the neural agents can use their emergent language to exchange useful coordinating information. While the best way to design games to favour language emergence is still open to debate, there is a consensus on the fact that we should gear these emergent languages towards sharing similarities with natural language. Among the properties of natural language, compositionality is considered to be critical, because it enables representation of complex concepts through the combinination of several simple ones. While work on incorporating compositionality into emergent languages is still in its early stage, several experiments have already demonstrated that by properly choosing the maximum message length and vocabulary size, the agents can be brought together to develop a compositional language that shares similarities with natural language (Li & Bowling, 2019; Lazaridou et al., 2018; Cogswell et al., 2019).
|
| 19 |
+
|
| 20 |
+
In a different body of language research literature, evolutionary linguists have already studied the origins of compositionality for decades (Kirby & Hurford, 2002; Kirby et al., 2014; 2015). They proposed a cultural evolutionary account of the origins of compositionality and designed a framework called iterated learning to simulate the language evolution process, based on the idea that the simulated language must be learned by new speakers at each generation, while also being used for communication. Their experiments show that highly compositional languages may indeed emerge through iterated learning. However, the models they introduced were mainly studied by means of experiments with human participants, in which the compositional languages is favored by the participants because human brain favors structure. Hence, directly applying this framework to ground language learning is not straightforward: we should first verify the existence of the preference of compositional language at the neural agent, and then design an effective training procedure for the neural agent to amplify such an advantage.
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 1: Referential communication game and architectures of the agents.
|
| 24 |
+
|
| 25 |
+
In this project, we analyze whether and how the learning speed advantage of the highly compositional languages exists in the context of communication between neural agents playing a game. Then we propose a three-phase neural iterated learning algorithm (NIL) and a probabilistic explanation of it. The experimental results demonstrate that our algorithm can significantly enhance the topological similarity (Brighton & Kirby, 2006) between the emergent language and the original meaning space in a simple referential game (Lewis, 1969). Such highly compositional languages also generalize better, because they perform well on a held-out validation set. We highlight our contribution as:
|
| 26 |
+
|
| 27 |
+
• We discover the learning speed advantages of languages with high topological similarity for neural agents communicating in order to play a referential game. • We propose the NIL based on those advantages, which is quite robust compared to most of the related works. • We propose a probabilistic framework to explain the mechanisms of NIL.
|
| 28 |
+
|
| 29 |
+
# 2 BACKGROUND
|
| 30 |
+
|
| 31 |
+
# 2.1 REFERENTIAL GAME
|
| 32 |
+
|
| 33 |
+
We analyze a typical and straightforward object selection game, in which a speaking agent (Alice, or speaker) and a listening agent (Bob, or listener) must cooperate to accomplish a task. In each round of the game, we show Alice a target object $x$ selected from an object space $\mathcal { X }$ and let her send a discrete-sequence message $\mathbf { m }$ to Bob. We then show Bob $c$ different objects ( $x$ must be one of them) and use $c _ { 1 } , . . . , c _ { c } \in \mathcal { X }$ to represent these candidates. Bob must use the message received from Alice to select the object that Alice refers among the $c$ candidates. If Bob’s selection $\bar { c }$ is correct, both Alice and Bob are rewarded. The objects are shuffled and candidates are randomly selected in each round to avoid the agents recognizing the objects using their order of presentation.
|
| 34 |
+
|
| 35 |
+
In our game, each object in $\mathcal { X }$ has $N _ { a }$ attributes (color and shape are often used in the literature), and each attribute has $N _ { v }$ possible values. To represent objects, similarly to the settings chosen in (Kottur et al., 2017), we encode each attribute as a one-hot vector and concatenate the $N _ { a }$ one-hot vectors to represent one object. The message delivered by Alice is a fixed-length discrete sequence $\mathbf { m } = ( m _ { 1 } , . . . , m _ { { N _ { L } } } )$ , in which each $m _ { i }$ is selected from a fixed size meaningless vocabulary $V$ .
|
| 36 |
+
|
| 37 |
+
# 2.2 NEURAL AGENT STRUCTURES
|
| 38 |
+
|
| 39 |
+
Neural agents usually have separate modules for speaking and listening, which we name Alice and Bob. Their architectures, shown in Figure 1, are similar to those studied in (Havrylov & Titov, 2017) and (Lazaridou et al., 2018). Alice first applies a multi-layer perceptron (MLP) to encode $x$ into an embedding, then feeds it to an encoding LSTM (Hochreiter & Schmidhuber, 1997). Its output will go through a softmax layer, which we use to generate the message $m _ { 1 } , m _ { 2 } , \cdots$ . Bob uses a decoding LSTM to read the message and uses a MLP to encode $c _ { 1 } , . . . , c _ { c }$ into embeddings. Bob then takes the dot product between the hidden states of the decoding LSTM and the embeddings to generate scores $s _ { c }$ for each object. These scores are then used to calculate the cross-entropy loss when training Bob. When Alice and Bob are trained using reinforcement learning, we can use $p _ { A } ( \mathbf { m } | x ; \theta _ { A } )$ and $p _ { B } ( \bar { c } | \mathbf { m } , c _ { 1 } , . . . , c _ { c } ; \theta _ { B } )$ to represent their respective policies, where $\theta _ { A }$ and $\theta _ { B }$ contain the parameters of each of the neural agents. When the agents are trained to play the game together, we use the REINFORCE algorithm (Williams, 1992) to maximize the expected reward under their policies, and add the entropy regularization term to encourage exploration during training, as explained in (Mnih et al., 2016). The gradients of the objective function $J ( \theta _ { A } , \theta _ { B } )$ are:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\begin{array} { r l } & { \nabla _ { \theta _ { A } } J = \mathbb { E } \left[ R ( \bar { c } , x ) \nabla \log p _ { A } ( \mathbf { m } | x ) \right] + \lambda _ { A } \nabla H [ p _ { A } ( \mathbf { m } | x ) ] } \\ & { \nabla _ { \theta _ { B } } J = \mathbb { E } \left[ R ( \bar { c } , x ) \nabla \log p _ { B } ( \bar { c } | \mathbf { m } , c _ { 1 } , . . . , c _ { c } ) \right] + \lambda _ { B } \nabla H [ p _ { B } ( \bar { c } | \mathbf { m } , c _ { 1 } , . . . , c _ { c } ) ] , } \end{array}
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $R ( \bar { c } , x ) = \mathbb { 1 } ( \bar { c } , x )$ is the reward function, $H$ is the standard entropy function, and $\lambda _ { A } , \lambda _ { B } > 0$ are hyperparameters. A formal definition of the agents can be found in Appendix $\textrm { C }$ .
|
| 46 |
+
|
| 47 |
+
# 2.3 MEASURING COMPOSITIONALITY
|
| 48 |
+
|
| 49 |
+
Compositionality is a crucial feature of natural languages, allowing us to use small building blocks (e.g., words, phrases) to generate more complex structures (e.g., sentences), with the meaning of the larger structure being determined by the meaning of its parts (Clark, 1996). However, there is no consensus on how to quantitatively assess it. Besides a subjective human evaluation, topological similarity has been proposed as a possible quantitative measure (Brighton & Kirby, 2006).
|
| 50 |
+
|
| 51 |
+
To define topological similarity, we first define the language studied in this work as $\mathcal { L } ( \cdot ) : \mathcal { X } \mapsto \mathcal { M }$ . Then we need to measure the distances between pairs of objects: $\Delta _ { \chi } ^ { i j } = d _ { \chi } ( x _ { i } , x _ { j } )$ , where $d _ { X } ( \cdot )$ is a distance in $\mathcal { X }$ . Similarly, we compute the corresponding quantity for the associated messages $m _ { i } = \mathcal { L } ( x _ { i } )$ in the message space $\mathcal { M }$ with $\Delta _ { \mathcal { M } } ^ { i j } = \bar { d _ { \mathcal { M } } } \bar { ( m _ { i } , m _ { j } ) }$ , where $d _ { \mathcal { M } } ( \cdot )$ is a distance in $\mathcal { M }$ . Then the topological similarity (i.e., $\rho \mathrm { , }$ M) is defined as the correlation between these quantities across $\mathcal { X }$ . Following the setup of (Lazaridou et al., 2018) and (Li & Bowling, 2019), we use the negative cosine similarity in the object space and Levenshtein distances (Levenshtein, 1966) in the message space. We provide an example in Appendix B to give a better intuition about this metric.
|
| 52 |
+
|
| 53 |
+
# 3 NEURAL ITERATED LEARNING MODEL
|
| 54 |
+
|
| 55 |
+
The idea of iterated learning requires the agent in current generation be partially exposed to the language used in the previous generation. Even this idea is proven to be effective when experimenting with human participants, directly applying it to games played by neural agents is not trivial: for example, we are not sure where to find the preference for high- $\boldsymbol { \rho }$ languages for the neural agents. Besides, we must carefully design an algorithm that can simulate the “partially exposed” procedure, which is essential for the success of iterated learning.
|
| 56 |
+
|
| 57 |
+
# 3.1 LEARNING SPEED ADVANTAGE FOR THE NEURAL AGENTS
|
| 58 |
+
|
| 59 |
+
As mentioned before, the preference of high- $\rho$ language by the learning agents is essential for the success of iterated learning. In language evolution, highly compositional languages are favored because they are structurally simple and hence are easier to learn (Carr et al., 2017). We believe that a similar phenomenon applies to communication between neural agents:
|
| 60 |
+
|
| 61 |
+
Hypothesis 1: High topological similarity improves the learning speed of the speaking neural agent.
|
| 62 |
+
|
| 63 |
+
We speculate that high- $\boldsymbol { \rho }$ languages are easier to emulate for a neural agent than low- $\rho$ languages. Concretely, that means that Alice, when pre-trained with object-message pairs describing a high$\rho$ language at a given generation, will be faster to successfully output the right message for each object. Intuitively, this is because the structured mapping described by a language with high $\rho$ is smoother, and hence has a lower sample complexity, which makes resulting examples easier to learn for the speaker agent (Vapnik, 2013).
|
| 64 |
+
|
| 65 |
+
Hypothesis 2: High topological similarity allows the listening agent to successfully recognize more concepts, using less samples.
|
| 66 |
+
|
| 67 |
+
We speculate that high- $\rho$ languages are easier for a neural agent to recognize. That means that Bob, when pre-trained with message-object pairs corresponding to a high- $\rho$ language, will be faster to successfully choose the right object. Intuitively, the lower topological similarity is, the more difficult it will be to infer unseen object-message pairs from seen examples. The more complex mapping of a low- $\boldsymbol { \rho }$ language implies that more object-message pairs need to be provided to describe it. This translates as an inability for the listening agent to generalize the information it obtained from one object-message associated to a low- $\boldsymbol { \rho }$ language to other examples. Thus, the general performance of Bob on any example will improve much faster when trained with pairs corresponding to a high- $\rho$ language than with a low- $\boldsymbol { \rho }$ language. We provide experimental results in section 4.1 to verify our hypotheses. We also provide a detailed example in Appendix D to illustrate our reasoning.
|
| 68 |
+
|
| 69 |
+
# 3.2 NEURAL ITERATED LEARNING AND PROBABILISTIC ANALYSIS
|
| 70 |
+
|
| 71 |
+
We design the NIL algorithm to exploit these advantages in a robust manner, as detailed in Algorithm 1. The algorithm runs for $I$ generations: at the beginning of each generation $i$ , both the agents are reinitialized. As Alice and Bob have different structures, they are then pre-trained differently (see line 5-7 for Alice and line 8-12 for Bob): this is the learning phase. Alice is pre-trained via categorical cross-entropy, using the data generated at the previous generation, which we denote $D _ { i }$ . Bob is pretrained with REINFORCE, learning from the pre-trained Alice. We note $I _ { a }$ and $I _ { b }$ their respective number of pre-training iterations. With hypothesis 1, the expected $\rho$ of the language spoken by Alice should be higher than that of $D _ { i }$ . Meanwhile, Bob shold be more “familiar with” the language with a higher $\rho$ than $D _ { i }$ , as stated by hypothesis 2. Alice and Bob then play the game together for $I _ { g }$ rounds in the interacting phase, in which both agents are updated via REINFORCE. In this phase, the languages used by them are filtered to be more unambiguous — their language must deliver information accurately to accomplish the task. Finally, in the transmitting phase, we feed all objects to Alice and let it output the corresponding messages to be stored in $D _ { i + 1 }$ for the learning phase of the next generation.
|
| 72 |
+
|
| 73 |
+
To better understand how NIL enhances the expected $\rho$ of the languages generation by generation, we propose a probabilistic model for NIL in Appendix C, as well as a probabilistic analysis of the role played by Alice and Bob in every phase. Intuitively, at the beginning of each generation, the expected $\rho$ of language used by Alice (denoted by $\mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ] )$ is quite low because of the random initialization. Then during the learning phase, Alice learns from $D _ { i }$ and expected to have the same $\mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ]$ with $D _ { i }$ if it perfectly learns that data set. However, as the high- $\rho$ language is favored by neural agent during training, the $\mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ]$ of the weakly pre-trained Alice should be higher than that of $D _ { i }$ . A similar thing may happen when pre-training Bob. Then in the interacting phase, as the game performance has no preference for language with different $\rho$ $, \mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ]$ will not change in this phase.1 Finally, in the transmitting phase, $D _ { i + 1 }$ is sampled based on the language with current $\mathbb { E } _ { \mathcal { L } } [ \bar { \rho } ( \mathcal { L } ) ]$ , which is expected to be higher than that of $D _ { i }$ . In other words, $\mathbb { E } _ { \mathcal { L } } [ \boldsymbol { \rho } ( \bar { \mathcal { L } } ) ]$ would increase generation by generation (the details for derivations are provided in Appendix C):
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { \mathbb { E } _ { \mathcal { L } \sim D _ { i + 1 } } [ \rho ( \mathcal { L } ) ] \ge \mathbb { E } _ { \mathcal { L } \sim D _ { i } } [ \rho ( \mathcal { L } ) ] . } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
# 4 EXPERIMENTS AND DISCUSSIONS
|
| 80 |
+
|
| 81 |
+
In this section, we first verify hypotheses 1 and 2 by directly feeding languages with different $\rho$ to Alice and Bob. Then we examine the behavior and performance of the neural agents, as well as the expected $\rho$ of languages, at each generation. We conduct an ablation study, to examine the effect of pre-training Alice and Bob separately. We then investigate more thoroughly the advantages brought by high- $\rho$ languages, and highlight the ‘interval of advantage’ in pre-training rounds, which could help in selecting reasonable $I _ { a }$ and $I _ { b }$ . Finally, we conduct a series of experiments on a held-out validation set to highlight the positive effect of high- $\boldsymbol { \rho }$ languages on the neural agents generalization ability — which shows the potential of iterated learning for NLU tasks. Details about our experimental setup and our choice of hyper-parameters can be found in Appendix A. More experiments about the robustness of NIL are presented in Appendix E.
|
| 82 |
+
|
| 83 |
+
<table><tr><td>Randomly initialize D1</td></tr><tr><td>for i= 1,2,...,I do</td></tr><tr><td>Re-initialize Alice and Bob, get Alicei and Bobi</td></tr><tr><td>//======= Learning Phase =: for i=1,2,..,Ia do</td></tr><tr><td>Randomly sample an example pair from Di and use it to update Alicei with cross-entropy</td></tr><tr><td>training end for</td></tr><tr><td>for ib = 1,2,...,Ib do</td></tr><tr><td>Alicei generates message based on input objects</td></tr><tr><td>Bobi receives message and selects the target</td></tr><tr><td>Bobi updates its parameters if rewarded</td></tr><tr><td>end for //======= Interacting Phase ===:</td></tr><tr><td>for ig= 1,2,.., Ig do</td></tr><tr><td>Alicei generates message based on input objects</td></tr><tr><td>Bobi receives message and selects the target</td></tr><tr><td>BOTH Alicei and Bobi update parameters if rewarded</td></tr><tr><td>end for</td></tr><tr><td>//======= Transmitting Phase ==:</td></tr><tr><td>for isg = 1,2,...,Is do</td></tr><tr><td>Generate object-message pairs by feeding objects to Alice; and save them to data set D+1</td></tr><tr><td>end for end for</td></tr></table>
|
| 84 |
+
|
| 85 |
+
Algorithm 1: The NIL algorithm. $I _ { a } , I _ { b }$ and $I _ { g }$ are the number of iterations used to pre-train Alice, Bob, and to play the game at each generation.
|
| 86 |
+
|
| 87 |
+
# 4.1 LEARNING SPEED ADVANTAGES
|
| 88 |
+
|
| 89 |
+
We first use the experimental results in Figure 2 to verify hypotheses 1 and 2. In these experiments, we randomly initialize one Alice and feed languages with different expected $\rho$ for it to learn (and repeat the same procedure for Bob). We generate a perfect high- $\rho$ language $( \rho = 1 )$ ) using the method proposed in (Kirby et al., 2015), and randomly permute the messages to generate a low- $\rho$ language with $\rho = 0 . 2 1$ . The other languages are intermediate languages generated during NIL. Note that there is no interacting nor transmitting phase in the experiment in this subsection: we only test the learning behavior of a randomly initialized Alice (or Bob) separately.
|
| 90 |
+
|
| 91 |
+
From the result in Figure 2-(a) and (b), we see that the high- $\rho$ languages indeed has the learning speed advantage at both the speaker and the listener side. One important finding is in Figure 2-(c), which record the expected $\rho _ { \cdot }$ , i.e., $\mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ]$ , during Alice’s learning. From this figure, we find that when learning a language with low expected $\rho$ , the value of $\mathbb { E } _ { \mathcal { L } } [ \rho ( \bar { \mathcal { L } } ) ]$ will first increase, and finally converge to the $\rho$ of $D$ . This phenomenon, caused by the learning speed advantage, makes the weak pre-train the essential design for the success of NIL: if $I _ { a }$ is correctly chosen, we may expect a higher $\mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ]$ than that of the data set it learns from.
|
| 92 |
+
|
| 93 |
+
# 4.2 PERFORMANCE OF NIL
|
| 94 |
+
|
| 95 |
+
In this part, we record the game performance (i.e., the rate of successful object selections) and mean $\rho$ of the object-message pairs exchanged by the neural agents every 20 rounds. We run the simulation 10 times, with a different random number seed each time. Although the results are different, they all follow the same trend. In this first series of experiments, we compare the following 4 different methods:
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 2: Illustration of the learning speed of Alice and performance improving speed of Bob when pre-training is done with various languages of different topological similarities.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 3: Game performance and average topological similarity for the possible resetting strategies of our proposed iterated learning procedure of 80 generations. In these experiments, $I { = } 8 0$ and $I _ { g } { = } 4 0 0 0$ , with all other hyper-parameters following Table 3.
|
| 102 |
+
|
| 103 |
+
• Iterated learning, with resetting both Alice and Bob at the beginning of each generation.
|
| 104 |
+
• Iterated learning, only resetting Alice at the beginning of each generation;
|
| 105 |
+
• Iterated learning, only resetting Bob at the beginning of each generation;
|
| 106 |
+
• No iterated learning: neither Alice nor Bob are reset during training.
|
| 107 |
+
|
| 108 |
+
From Figure 3-(a), we can see that for the 3 displayed variants of the procedure, neural agents can play the game almost perfectly after a few generations. The curve of the no-reset method will directly converge while the curves of the other two iterated learning procedures will show a loss of accuracy at the beginning of each generation. That is because one or both agents are reset, and are not able to completely re-learn from the data kept from the previous generation during the pre-training phase. However, at the end of each generation, all these algorithms can ensure a perfect game performance.
|
| 109 |
+
|
| 110 |
+
While the use of NIL has little effect on the game performance, given a sufficient number of rounds, these procedures have a clear positive effect on topological similarity. In Figure 3-(b), we can see that the no-reset case has the lowest average $\rho$ while the iterated learning cases all have higher means (and increasing). We provide extra experiments in Appendix E, which demonstrate the robustness of NIL under different scenarios. The discussion on the specific impact of each agent and why the reset-Alice and reset-Bob behave differently is in Section 5.
|
| 111 |
+
|
| 112 |
+
# 4.3 HIGH TOPOLOGICAL SIMILARITY AND INTERVAL OF ADVANTAGE
|
| 113 |
+
|
| 114 |
+
In this section, we explore further the phenomenon caused by the learning speed advantage on NIL. From the discussion in section 3.1 and the experimental results in section 4.1, we know that $I _ { a }$ and $I _ { b }$ play an important role in NIL: they should not be too large nor too small. Intuitively, if $I _ { a }$ is too small, Alice will learn nothing from the previous generation, hence the NIL amounts to playing only one interacting phase. If $I _ { a }$ is too large, from the trend in Figure 2-(c), we may expect that the increase of expected $\rho$ should be small in each generation, because Alice will perfectly learn $D _ { i }$ , and hence have a $\rho$ similar to its predecessor. Hence we speculate that the value of $I _ { a }$ should have a “bottleneck” effect, i.e., a too large one or a too small one will both harm the performance of NIL. A similar argument can also applied in the selection of $I _ { b }$ .
|
| 115 |
+
|
| 116 |
+
<table><tr><td>Ia</td><td>100</td><td>200</td><td>400</td><td>800</td><td>1200</td><td>1500</td><td>2000</td><td>3000</td><td>5000</td><td>8000</td></tr><tr><td>E[r71:80]</td><td>0.293</td><td>0.828</td><td>0.928</td><td>0.951</td><td>0.958</td><td>0.961</td><td>0.952</td><td>0.956</td><td>0.955</td><td>0.949</td></tr><tr><td>E[p1:10]</td><td>0.225</td><td>0.429</td><td>0.452</td><td>0.483</td><td>0.556</td><td>0.575</td><td>0.566</td><td>0.494</td><td>0.481</td><td>0.443</td></tr><tr><td>E[p71:80]</td><td>0.203</td><td>0.706</td><td>0.836</td><td>0.886</td><td>0.899</td><td>0.935</td><td>0.936</td><td>0.929</td><td>0.889</td><td>0.837</td></tr><tr><td>1b</td><td>10</td><td>20</td><td>40</td><td>80</td><td>120</td><td>160</td><td>200</td><td>300</td><td>400</td><td>800</td></tr><tr><td>E[r71:80]</td><td>0.954</td><td>0.946</td><td>0.961</td><td>0.954</td><td>0.962</td><td>0.959</td><td>0.962</td><td>0.957</td><td>0.961</td><td>0.944</td></tr><tr><td>E[p1:10]</td><td>0.415</td><td>0.381</td><td>0.488</td><td>0.496</td><td>0.591</td><td>0.535</td><td>0.557</td><td>0.498</td><td>0.488</td><td>0.448</td></tr><tr><td>E[p71:80]</td><td>0.927</td><td>0.937</td><td>0.929</td><td>0.928</td><td>0.936</td><td>0.891</td><td>0.888</td><td>0.897</td><td>0.891</td><td>0.880</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 1: Values of 3 metrics when varying $I _ { a }$ or $I _ { b }$ , highlighting an interval where the topological similarity grows high.
|
| 119 |
+
|
| 120 |
+
To verify our argument, we run NIL with different values of $I _ { a }$ and $I _ { b }$ , examining the behavior of the following 3 different quantitive metrics:
|
| 121 |
+
|
| 122 |
+
• $\mathbb { E } [ r _ { 7 1 : 8 0 } ]$ : The average reward of the last ten generations (game performance);
|
| 123 |
+
• $\mathbb { E } [ \rho _ { 1 : 1 0 } ]$ : The average value of $\rho$ for the first ten generations (converging speed);
|
| 124 |
+
• $\mathbb { E } [ \rho _ { 7 1 : 8 0 } ]$ : The average value of $\rho$ for the last ten generations (converged $\rho$ ).
|
| 125 |
+
|
| 126 |
+
From the results presented in Table 1, we can see the importance of the number of pre-training rounds not being too large nor too small. The suitable $I _ { a }$ and $I _ { b }$ are shown in bold. Furthermore, combining Figure 2 and Table 1, the interval of suitable $I _ { a }$ lies between 1000 to 2000 while it lies between 100 to 200 for $I _ { b }$ , which provides us an effective way to choosing hyper-parameters.
|
| 127 |
+
|
| 128 |
+
# 4.4 TOPOLOGICAL SIMILARITY AND VALIDATION PERFORMANCE
|
| 129 |
+
|
| 130 |
+
In this last series of experiments, we aim to explore the relationship between topological similarity and the generalisation ability of our neural agents, which can also indirectly reflect the expressivity of a language. We measure this ability by looking at their validation game performance: we restrict the training examples to a limited numbers of objects (i.e., the training set), and look at how good are the agents at playing the game on the others (i.e., the validation set). Figure 4-(a) demonstrates the strength of the iterated learning procedure in a validation setting. To illustrate the relationship between $\rho$ and validation performance, we randomly choose ${ { I _ { a } } } \in \left[ 6 0 , 4 0 0 0 \right]$ and $I _ { b } \in [ 5 , 2 0 0 ]$ and conduct a series of experiments. Those for which $I _ { a }$ and $I _ { b }$ are not in their optimal range will yield a worse performance on both validation test and topological similarity. In Figure 4-(b), we record the results from different experimental settings and draw the zero-shot performance given the topological similarity of the emergent language. This shows the linear correlation between these two metrics, and a significance test confirms it: the correlation coefficient is 0.928, and the associated $p$ -value is $3 . 8 * 1 \bar { 0 } ^ { - 1 0 4 }$ . Hence, under various experimental settings, the validation performance and the topological similarity are strongly correlated. Table 2 shows that when the size of validation set increases, using iterated learning can always improve the validation performance: in all the cases, both-reset algorithm always yields the best performance. The fact that the Alice-reset setting performs better than the Bob-reset setting also matches our analysis well.
|
| 131 |
+
|
| 132 |
+
# 5 DISCUSSION: A PARALLEL WITH LANGUAGE EVOLUTION
|
| 133 |
+
|
| 134 |
+
We can observe an interesting phenomenon in Figure 3-(b):2 the topological similarity of the emergent language always increases at first, whether we use iterated learning or not. This is akin to the effect apparent for $\rho$ in Figure 2-(c): continuing training will imply fine-tuning to examples that are not necessarily of good quality. However, through the generational resets and limited number of pre-training examples, iterated learning allows small generational improvements: this is because constraining the agent to learn with smaller amounts of data at each generation — through a ‘bottleneck’ (Kirby & Hurford, 2002) — forces the emergence of a more structured language. This limitation on the amounts of data available corresponds in our algorithm to limiting the number of pre-training rounds of the agents, to a number in what we denoted as the ‘interval of advantage’. In NIL, we use the weak pre-training to simulate this bottleneck, and achieve a good result: the values of $I _ { a }$ and $I _ { b }$ have an effect similar to the bottleneck studied in (Kirby et al., 2015) (more details are provided in Appendix D). Extending this parallel with the evolution of natural language, we can relate the learning speed advantage provided by high- $\cdot \rho$ languages to the speaking agent to the compressibility pressure (Kirby et al., 2015), and the better ability to generalize provided by high- $\rho$ languages to the listening agent to the expressivity pressure (Kirby et al., 2015).
|
| 135 |
+
|
| 136 |
+
Table 2: Validation performance under different validation set sizes.
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Valid set size</td><td colspan="2">0</td><td colspan="2">8</td><td colspan="2">16</td><td colspan="2">32</td></tr><tr><td></td><td>Train</td><td>Valid</td><td>Train</td><td>Valid</td><td>Train</td><td>Valid</td><td>Train</td><td>Valid</td></tr><tr><td>No-reset</td><td>0.985</td><td>-</td><td>0.986</td><td>0.136</td><td>0.990</td><td>0.132</td><td>0.995</td><td>0.102</td></tr><tr><td>Bob-reset</td><td>0.967</td><td>1</td><td>0.943</td><td>0.094</td><td>0.962</td><td>0.152</td><td>0.947</td><td>0.116</td></tr><tr><td>Alice-reset</td><td>0.981</td><td></td><td>0.976</td><td>0.598</td><td>0.979</td><td>0.280</td><td>0.947</td><td>0.210</td></tr><tr><td>Both-reset</td><td>0.988</td><td>1</td><td>0.986</td><td>0.847</td><td>0.984</td><td>0.755</td><td>0.973</td><td>0.558</td></tr></table>
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 4: Validation performance and topological similarity with validation size equals eight. NIL leads to the evolution of languages which allow agents to perform well on unseen items.
|
| 142 |
+
|
| 143 |
+
This comparison allows us to address one important difference between our neural iterated learning algorithm and the original version: our speaking and listening agents are not identical. Actually, the speaking module and listening module of human are also not identical, but the works on traditional iterated learning do not pay much attention to such differences. From Figure 3-(b) and Figure 4-(a), it is clear that Alice and Bob are affected differently by the generational resets, and thus do not offer the same contribution to the final performance.3 From this parallel, we retain that iterated learning is also linked to the emergence of a certain form of compositionality when applied to neural agents. Besides, we believe that the correlation between topological similarity and validation performance that we highlight in Section 4.4 is another argument in favor of a relationship between compositionality and generalization, which has recently been explored (Kottur et al., 2017; Choi et al., 2018; Andreas, 2019).
|
| 144 |
+
|
| 145 |
+
# 6 CONCLUSION
|
| 146 |
+
|
| 147 |
+
In this paper, we find and articulate the existence of the learning speed advantages offered by high topological similarity, with which, we propose the NIL algorithm to encourage the dominance of high compositional language in a multi-agent communication game. We show that our procedure, consisting in resetting neural agents playing a referential game and pre-training them on data generated by their predecessors, can incrementally advantage emergent languages with high topological similarity. We demonstrate its interest by obtaining large performance improvements in a validation setting, linking compositionality and ability to generalize to new examples. The robustness of the algorithm is also verified in various experimental settings. Finally, we hope the proposed probabilistic model of NIL could inspire the application of NIL in more complex neural-agents-based systems.
|
| 148 |
+
|
| 149 |
+
# ACKNOWLEDGEMENT
|
| 150 |
+
|
| 151 |
+
We show our sincere gratitude to Kenny Smith, Ivan Titov, Stella Frank and Serhii Havrylov for their helpful discussion and comments that greatly improved the manuscript.
|
| 152 |
+
|
| 153 |
+
We would also like to thank the members from Prof. Jun Zhao’s team at Institute of Automation, Chinese Academy of Sciences, e.g. Dr. Kang Liu, Xiang Zhang and Xinyu Zuo, for sharing computing resources to run some experiments as well as sharing their pearls of wisdom with us during the course of this research, and we thank 3 anonymous reviewers for their insights and comments.
|
| 154 |
+
|
| 155 |
+
# REFERENCES
|
| 156 |
+
|
| 157 |
+
Jacob Andreas. Measuring compositionality in representation learning. arXiv preprint arXiv:1902.07181, 2019.
|
| 158 |
+
|
| 159 |
+
Laura Banarescu, Claire Bonial, Shu Cai, Madalina Georgescu, Kira Griffitt, Ulf Hermjakob, Kevin Knight, Philipp Koehn, Martha Palmer, and Nathan Schneider. Abstract meaning representation for sembanking. In Proceedings of the 7th Linguistic Annotation Workshop and Interoperability with Discourse, pp. 178–186, 2013.
|
| 160 |
+
|
| 161 |
+
Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 162 |
+
|
| 163 |
+
Henry Brighton. Compositional syntax from cultural transmission. Artificial life, 8(1):25–54, 2002.
|
| 164 |
+
|
| 165 |
+
Henry Brighton and Simon Kirby. Understanding linguistic evolution by visualizing the emergence of topographic mappings. Artificial life, 12(2):229–242, 2006.
|
| 166 |
+
|
| 167 |
+
Jon W Carr, Kenny Smith, Hannah Cornish, and Simon Kirby. The cultural evolution of structured languages in an open-ended, continuous world. Cognitive science, 41(4):892–923, 2017.
|
| 168 |
+
|
| 169 |
+
Edward Choi, Angeliki Lazaridou, and Nando de Freitas. Compositional obverter communication learning from raw visual input. In International Conference on Learning Representations, 2018.
|
| 170 |
+
|
| 171 |
+
Herbert H Clark. Using language. Cambridge university press, 1996.
|
| 172 |
+
|
| 173 |
+
Michael Cogswell, Jiasen Lu, Stefan Lee, Devi Parikh, and Dhruv Batra. Emergence of compositional language with deep generational transmission. arXiv preprint arXiv:1904.09067, 2019.
|
| 174 |
+
|
| 175 |
+
Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2137–2145, 2016.
|
| 176 |
+
|
| 177 |
+
Serhii Havrylov and Ivan Titov. Emergence of language with multi-agent games: Learning to communicate with sequences of symbols. In Advances in Neural Information Processing Systems, 2017.
|
| 178 |
+
|
| 179 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 180 |
+
|
| 181 |
+
Simon Kirby and James R Hurford. The emergence of linguistic structure: An overview of the iterated learning model. In Simulating the evolution of language, pp. 121–147. Springer, 2002.
|
| 182 |
+
|
| 183 |
+
Simon Kirby, Tom Griffiths, and Kenny Smith. Iterated learning and the evolution of language. Current opinion in neurobiology, 28:108–114, 2014.
|
| 184 |
+
|
| 185 |
+
Simon Kirby, Monica Tamariz, Hannah Cornish, and Kenny Smith. Compression and communication in the cultural evolution of linguistic structure. Cognition, 141:87–102, 2015.
|
| 186 |
+
|
| 187 |
+
Satwik Kottur, Jose Moura, Stefan Lee, and Dhruv Batra. Natural language does not emerge natural- ´ lyin multi-agent dialog. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2962–2967, 2017.
|
| 188 |
+
|
| 189 |
+
Angeliki Lazaridou, Karl Moritz Hermann, Karl Tuyls, and Stephen Clark. Emergence of linguistic communication from referential games with symbolic and pixel input. In International Conference on Learning Representations, 2018.
|
| 190 |
+
|
| 191 |
+
Vladimir I Levenshtein. Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, volume 10, pp. 707–710, 1966.
|
| 192 |
+
|
| 193 |
+
David Lewis. Convention: A philosophical study. John Wiley & Sons, 1969.
|
| 194 |
+
|
| 195 |
+
Fushan Li and Michael Bowling. Ease-of-teaching and language structure from emergent commu nication. arXiv preprint arXiv:1906.02403, 2019.
|
| 196 |
+
|
| 197 |
+
Christopher D Manning, Christopher D Manning, and Hinrich Schutze. ¨ Foundations of statistical natural language processing. MIT press, 1999.
|
| 198 |
+
|
| 199 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International Conference on Machine Learning, pp. 1928–1937, 2016.
|
| 200 |
+
|
| 201 |
+
Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multi-agent populations. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 202 |
+
|
| 203 |
+
Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 2013.
|
| 204 |
+
|
| 205 |
+
Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229–256, 1992.
|
| 206 |
+
|
| 207 |
+
# APPENDIX A: PARAMETER SETTINGS
|
| 208 |
+
|
| 209 |
+
Unless specifically stated, the experiments mentioned in this paper use the hyper-parameters given in Table 3. The code is available at https://github.com/Joshua-Ren/Neural_ Iterated_Learning.
|
| 210 |
+
|
| 211 |
+
Table 3: Value of hyper-parameters.
|
| 212 |
+
|
| 213 |
+
<table><tr><td>Notation</td><td>Value</td><td>Description</td></tr><tr><td>Na</td><td>2</td><td>Number of all attributes</td></tr><tr><td>Nu</td><td>8</td><td>Number of possible values for each attribute</td></tr><tr><td>NL</td><td>2,3</td><td>Message length</td></tr><tr><td>|V|</td><td>8+[0,4,8,16,32,64]</td><td>Vocabulary size.</td></tr><tr><td>I</td><td>80,100</td><td>Maximum number of generations</td></tr><tr><td>Ia</td><td>≥ 100,≤8000</td><td>Maximum pre-train rounds for Alice</td></tr><tr><td>Ib</td><td>≥10,≤800</td><td>Maximum pre-train batches for Bob</td></tr><tr><td>1</td><td>≥ 100,≤ 8000</td><td>Maximum interacting rounds</td></tr><tr><td></td><td>10,100,1000</td><td>Maximum rounds for transmitting phase</td></tr><tr><td>Nh</td><td>128</td><td>Hidden layer size</td></tr><tr><td>Nb</td><td>64</td><td>Batch size</td></tr><tr><td>C</td><td>2,5,15,30</td><td>Number of candidates (including the target)</td></tr><tr><td>lr</td><td>≥ 10-5,≤10-3</td><td>Learning rate</td></tr></table>
|
| 214 |
+
|
| 215 |
+
APPENDIX B: DIFFERENT TYPES OF LANGUAGES: A TOY EXAMPLE
|
| 216 |
+
Table 4: Different groups of language and their topological similarity.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>Group</td><td>Compsitional (8)</td><td>Holistic (16)</td><td>Other (232)</td></tr><tr><td>Language Examples</td><td>bluebox=aa red box=ba blue circle = ab</td><td>bluebox=ba red box = aa bluecircle= ab</td><td>bluebox=aa red box=bb blue circle = aa</td></tr><tr><td>p</td><td>red circle = bb 1</td><td>red circle = bb 0.5</td><td>red circle = bb 0.1~ 0.7</td></tr></table>
|
| 219 |
+
|
| 220 |
+

|
| 221 |
+
Figure 5: A simple representation of two languages corresponding to topological similarities of $\rho = 1$ (top) and $\rho = 0 . 5$ (bottom).
|
| 222 |
+
|
| 223 |
+
To better understand how topological similarity can measure the compositionality of one language, and to give some intuitions on how languages having different $\rho$ would like, we provide and illustrate a toy example in this appendix. In this example, the object space is $\scriptscriptstyle \textit { \textbf { X } } =$ {blue box, blue circle, red box, red circle $\}$ and the message space is $\mathcal { M } = \{ \bar { a } a , a b , \bar { b } a , b b \}$ . Any set of mappings from four distinct objects to four messages (not necessarily distinct, i.e. same message could correspond to different objects) forms a language. Hence, there exist $4 ^ { 4 } = 2 5 6$ possible languages in this toy example. Following the principles provided in (Kirby et al., 2015), we define the following concepts for describing a language:
|
| 224 |
+
|
| 225 |
+
• Unambiguous language. A type of language that can unambiguously describe all objects in $\mathcal { X }$ . In other words, the mappings between $\mathcal { X }$ and $\mathcal { M }$ are bijectional. In this example, there exist $4 \times 3 \times 2 \times 1 = 2 4$ such languages. Compositional language. A type of unambiguous language that exhibits systematic compositional structure when forming messages. Such languages can use different symbols to represent different attributes of meaning and combine these symbols in a systematic way to form a message such that the meaning of the whole message is formed from a simple combination of the meaning of its parts. For example, following the rules of $S \to X Y$ , and $X : b l u e b ; X : r e d : b ; Y : b o x a ; X : c i r c l e : b$ , we can derive a compositional language like the example in Table 4. In this example, we have $4 + 4 = 8$ such languages. Holistic language. A type of unambiguous language but does not exhibits full systematic structures. In other words, holistic languages are those unambiguous language who are not compositional languages. In this example, we have $2 4 - 8 = 1 6$ such languages.
|
| 226 |
+
• Degenerate language. A type of ambiguous language that maps all objects to the same message. In this example, we have 4 such languages. Degenerate component. Any ambiguous language having degenerate component, i.e., there may be more than one objects mapping to the same message. The existence of degenerate component makes the language ambiguous.
|
| 227 |
+
|
| 228 |
+
Note that the number of unambiguous languages is usually much smaller than that of ambiguous languages, and the number of compositional languages is usually smaller than that of holistic languages. Using permutation and combination, we can calculate the numbers of all possible languages, unambiguous language, compositional language and holistic language as:
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
\begin{array} { l } { { \displaystyle \# \mathrm { ~ a l l ~ p o s s i b l e ~ l a n g u a g e s } = \left( | V | ^ { N _ { L } } \right) ^ { ( N _ { v } ^ { N _ { a } } ) } } } \\ { { \displaystyle \# \mathrm { ~ u n a m b i g u o u s ~ l a n g u a g e s } = \frac { \left( | V | ^ { N _ { L } } \right) ! } { \left( | V | ^ { N _ { L } } - N _ { v } ^ { N _ { a } } \right) ! } } } \\ { { \displaystyle \# \mathrm { ~ c o m p o s i t i o n a l ~ l a n g u a g e s } = \frac { N _ { L } ! } { \left( N _ { L } - N _ { a } \right) ! } \cdot \left( \frac { | V | ! } { \left( | V | - N _ { v } \right) ! } \right) ^ { N _ { a } } } } \end{array}
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
# holistic languages $= \#$ unambiguous languages − # compositional languages
|
| 235 |
+
|
| 236 |
+
From the above equation, it is easy to see that the gap between the number of compositional languages and holistic languages would become larger when $N _ { v }$ ${ _ { v } } , N _ { a } , N _ { L }$ and $| V |$ increase. Further, this means that it becomes even harder to pick a compositional language when randomly sample a language. That could explain why the expected topological similarity of the emergent language may increase when smaller $N _ { L }$ and $| V |$ are applied, as illustrated in (Lazaridou et al., 2018; Cogswell et al., 2019).
|
| 237 |
+
|
| 238 |
+
Besides the numbers of different languages, another key difference among these languages is the topological similarity (i.e., $\rho )$ , as illustrated in section 2.3. As the language studied in this paper is defined as a mapping function from a meaning (i.e., an object) to a message, a compositional language must ensure that the meaning of a symbol is a function of the meaning of its parts. In other words, compositional languages are neighborhood related: nearby meanings tend to be mapped to nearby signals. Or to say, nearby meanings that share similar attributes are likely to share similar message symbols (Brighton & Kirby, 2006). Thus, as the difference between messages are measured by edit distance, the compositional languages will have a higher $\rho$ than the holistic ones. However, the existence of degenerate component also change the value of $\rho$ : the $\rho$ of a degenerate language might be higher than that of a holistic language.
|
| 239 |
+
|
| 240 |
+
From the above discussions, we find that making the highly compositional languages dominate is a challenging task: it occupies a really small portion among all possible languages, and only using topological similarity also cannot tell them apart from those who are highly degenerate. However, the proposed algorithm can solve this problem almost perfectly: it uses the learning speed advantage caused by high topological similarity to increase the posterior probability of high- $\rho$ languages, and uses the interacting phase to rule out the degenerate components. The details of how the probability of languages changes in different phase of our algorithm are illustrated in Appendix C.
|
| 241 |
+
|
| 242 |
+
# APPENDIX C: PROBABILISTIC MODEL OF THE SYSTEM
|
| 243 |
+
|
| 244 |
+
# Probabilistic Model of Emergent Languages:
|
| 245 |
+
|
| 246 |
+
In section 2.3, we define a language as a mapping function from object space $\mathcal { X }$ to the message space $\mathcal { M }$ , i.e., $\mathcal { L } ( \cdot ) : \mathcal { X } \mapsto \mathcal { M }$ . Here we discuss how to describe the probability of a specific language, i.e., $P ( \mathcal { L } )$ .
|
| 247 |
+
|
| 248 |
+
Suppose that we have $N$ possible different objects $( x _ { 1 } , x _ { 2 } , . . . , x _ { N } )$ , where $ { N _ { \mathrm { ~ \scriptsize ~ = ~ } } } N _ { v } ^ { N _ { a } }$ , and the messages are conditionally independent given an object $x _ { n }$ (where $n \in [ 1 , 2 , \ldots , N ] )$ , i.e.:
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
P ( \mathcal { L } ) = P ( \mathbf { m _ { 1 } } , . . . , \mathbf { m _ { N } } | x _ { 1 } , . . . , x _ { N } ) = \prod _ { n = 1 } ^ { N } P ( \mathbf { m _ { n } } | x _ { 1 } , . . . , x _ { N } ) = \prod _ { n = 1 } ^ { N } P ( \mathbf { m _ { n } } | x _ { n } ) .
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
Assume that messages are uniformly sampled from $\mathcal { M }$ whose size is $M = | V | ^ { N _ { L } }$ , we could have $\begin{array} { r } { P ( \mathbf { m _ { n } } | x _ { n } ) = \frac { 1 } { M } , \breve { \forall } n \in \{ 1 , 2 , . . . , \bar { N } \} } \end{array}$ . Hence the initial probability (or prior probability) of any possible language is $\left( { \frac { 1 } { M } } \right) ^ { N }$ . We define the posterior distribution of languages as the distribution after our neural iterated learning algorithm (NIL), i.e. $P ( \mathcal { L } | \mathrm { N I L } )$ .
|
| 255 |
+
|
| 256 |
+
Then, our goal is to enhance the posterior probability of the high- $\rho$ languages, which is equivelant to enhance the expectation of $\rho$ , i.e.:
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ] = \sum _ { i } \rho ( \mathcal { L } _ { i } ) P ( \mathcal { L } _ { i } | \mathrm { N I L } ) .
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
It is obvious that $\mathbb { E } _ { \mathcal { L } } [ \rho ( \mathcal { L } ) ]$ , the expected topological similarity of languages following the prior probability, is quite low, as the high- $\boldsymbol { \rho }$ languages only occupy an extremely small fraction.
|
| 263 |
+
|
| 264 |
+
# Definition of the Agents:
|
| 265 |
+
|
| 266 |
+
Following the structure provided in Figure 1, we define the speaking agent (Alice) and listening agent (Bob) formally here.
|
| 267 |
+
|
| 268 |
+
Alice is a bunch of neural networks that can map any input object $x$ to a discrete message m. So we define it as $\mathbf { m } = h ( x ) , h : \mathcal { X } \mapsto \mathcal { M }$ . As Alice generate discrete messages with softmax layers, the probabilistic distribution of different words in ${ \bf m } _ { n }$ can be obtained. In the example provided in Figure 1, we can have $P ( m _ { 1 } | x )$ and $P ( m _ { 2 } | x , m _ { 1 } )$ by reading the distribution from softmax layers. In more general cases, we could obtain $P ( m _ { l } | x , m _ { l - 1 } , m _ { l - 2 } , . . . )$ following the same method. Thus, we can directly calculate the probability of specific $\mathbf { m }$ given $x$ for Alice as follow:
|
| 269 |
+
|
| 270 |
+
$$
|
| 271 |
+
P ( \mathbf { m } | x ) = P ( m _ { 1 } | x ) \prod _ { l = 2 } ^ { N _ { L } } P ( m _ { l } | x , m _ { l - 1 } , m _ { l - 2 } , \dots ) .
|
| 272 |
+
$$
|
| 273 |
+
|
| 274 |
+
If we feed all possible $x$ to Alice and calculate the corresponding $P ( { \bf m } | x )$ , we then could calculate the probability distribution of all languages after training Alice, following equation (8) and (9). Then, we can state our goal as to obtain a high $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ by using NIL to update the parameters of the neural network.
|
| 275 |
+
|
| 276 |
+
In our setting, the posterior probability of languages is decided by Alice with its softmax layers. Bob plays a role of assistant to ensure the robustness of NIL, which will be further illustrated in Appendix D and E. From Figure 1, we could see that the inputs of Bob are a discrete message m and $c$ different objects. As Bob will calculate a score $s _ { c }$ for each object $c _ { c }$ , we can denote its function as $s = f ( \mathbf { m } , x ) , \overset { \cdot } { f } : \mathcal { M } \times \mathcal { X } \mapsto \mathbb { R } ^ { 1 }$ .
|
| 277 |
+
|
| 278 |
+
# Probabilistic Description of Language Evolution in NIL:
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 6: Probabilitic explanation of different phases in NIL.
|
| 282 |
+
|
| 283 |
+
To avoid confusion, we specify all the probabilities involved in NIL in the left corner of Figure 6. In the figure, the shadow regions with different colors represent the three phases of NIL in ONE generation. Thus, one generation of NIL could be described as:
|
| 284 |
+
|
| 285 |
+
1. Initialization: At the beginning of generation $t$ , the initial probability of Alice[i] is $P _ { 0 } ( \mathcal { L } )$ , which is same as the prior probability of $P ( \mathcal { L } )$ mentioned before, as Alice[i] is always randomly initialized. The initial function of Bob[i] is represented as $f _ { 0 } ( \mathbf { m } , x )$ .
|
| 286 |
+
2. Learning Phase: Then following Algorithm 1, Alice[i] will be pre-trained using the data sampled from the previous generation, i.e. $D _ { i }$ . The pre-trained probability of languages is defined as $P _ { i } ( \mathcal { L } | D _ { i } )$ . Bob[i] will then be pre-trained using the sample generated by $P _ { i } ( \mathcal { L } | D _ { i } )$ , using REINFORCE procedure, after which, its function becomes $\bar { f } _ { i } ( \mathbf { m } , x )$ .
|
| 287 |
+
3. Interacting Phase: The pre-trained Alice[i] and Bob[i] then interact and update their parameters together following the REINFORCE procedure described in section 3.2. In each round of the game, Alice[i] would first use argmax to select m with the highest probability given a randomly selected object $x$ , both agents would then update their parameters if $R = 1$ , i.e. the data pair $\langle \mathbf { m } , x \rangle$ could assist them to accomplish the referential game successfully. We argure that this process has the same effect as the following procedure: we first sample a data set $D _ { * } \sim P _ { i } ( \mathcal { L } | D _ { i } )$ , and then delete the data pairs that cannot unambiguously deliver information to form a refined data set $R _ { i }$ . Then, the interacted probability of Alice[i] can be represented by $P _ { i } ( \mathcal { L } | D _ { i } , R _ { i } )$ . As Bob also update its parameters in this phase, we define its interacted function as $f _ { i * } ( \mathbf { m } , x )$ .
|
| 288 |
+
4. Transmitting Phase: Finally, in the transmitting phase, we sample $D _ { i + 1 } \sim P _ { i } ( \mathcal { L } | D _ { i } , R _ { i } )$ by: i)randomly feeding $x _ { n }$ to Alice[i]; ii) sample a message ${ \bf m } _ { n } \sim P _ { i } ( { \bf m } | x _ { n } , D _ { i } , R _ { i } )$ . Note that Bob[i] is not involved in this phase.
|
| 289 |
+
|
| 290 |
+
From all sections above, we argue that Alice plays an important role in all the phases in NIL while Bob only helps to make the languages effective during interaction phases. As we will discuss the role of Alice and Bob in further details in Appendix $\mathrm { E }$ , we only provide an intuition of how the language changes in NIL in the following paragraphs.
|
| 291 |
+
|
| 292 |
+
Overall, the objective of our NIL design is to ensure the expected topological similarity of emergent languages would increase over generations, as expressed by equation (3). As the languages with higher $\rho$ would be learned faster, which is stated as Hypothesis 1, we can expect those high- $\rho$ languages to have a higher pre-trained probability in $P ( \vec { \mathcal { L } } | \bar { D } _ { i } )$ than in $D _ { i }$ , i.e.:4
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r } { \mathbb E _ { \mathcal L \sim P ( \mathcal L | D _ { i } ) } [ \rho ( \mathcal L ) ] \ge \mathbb E _ { \mathcal L \sim D _ { i } } [ \rho ( \mathcal L ) ] . } \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Note that this inequality is not a strict corollary, but it is very likely to hold as long as we have an appropriate $I _ { a }$ . In the worst case, we can chose an extremely large $I _ { a }$ to make Alice learn $D _ { i }$ perfectly. However, we could verify it by the experimental results as well as the explanation in Appendix $\mathbf { D }$ that the weak pre-training can indeed help us to achieve a higher expected $\rho$ . Then, in the interacting phase, we may expect:
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\begin{array} { r } { \mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | D _ { i } , R _ { i } ) } [ \rho ( \mathcal { L } ) ] = \mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | D _ { i } ) } [ \rho ( \mathcal { L } ) ] , } \end{array}
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
as the compositional languages and holistic languages are both unambiguous and the game performance cannot tell them apart. Finally, during the transmitting phase, we have $D _ { i + 1 } \sim \bar { P _ { i } } ( \mathcal { L } | \bar { D _ { i } } , R _ { i } )$ . Assuming that we sampled enough $D _ { i + 1 }$ to ensure it has a very similar distribution to $P _ { i } ( \mathcal { L } | D _ { i } , R _ { i } )$ , it is reasonable to have:
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\mathbb { E } _ { \mathcal { L } \sim D _ { i + 1 } } [ \rho ( \mathcal { L } ) ] = \mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | D _ { i } , R _ { i } ) } [ \rho ( \mathcal { L } ) ] .
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
Sum up from the above, equation (3) can be obtained by combining equation (11-13).
|
| 311 |
+
|
| 312 |
+
# APPENDIX D: MORE ON THE LEARNING SPEED ADVANTAGE
|
| 313 |
+
|
| 314 |
+
Amplifying mechanism and learning speed advantage are the two main elements for the success of NIL. The former on is elaborated in section 3.2 and Appendix C, under the assumption that the learning speed advantage of high- $\cdot \rho$ language indeed exist. In this section, we will explain why such an advantage exist by experimental results and a toy example.
|
| 315 |
+
|
| 316 |
+

|
| 317 |
+
Figure 7: Illustration of learning a high- $\rho$ language and low- $\rho$ language.
|
| 318 |
+
|
| 319 |
+
# Example for Supporting Hypothesis 1:
|
| 320 |
+
|
| 321 |
+
This hypothesis claims that a high- $\boldsymbol { \cdot } \rho$ language would be leared faster than a low- $\boldsymbol { \cdot } \rho$ one on the speaker side. As we can directly represent the posterior probability of any language from Alice’s perspective, the assertion of “learned faster” can be converted to “the posterior probability increases faster”. We use a toy example, i.e. two languages in Table 4, to demonstrate how such an advantage emerges and how it works. To make the notation concise, we use “BB, RB, BC, RC” to represent “blue box, red box, blue circle, red circle” respectively. The probability of the compositional language and the holistic language in Table 4 can be represented as:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { r l r } & { } & { P ( \mathcal { L } _ { \mathrm { c m p } } ) = P ( m _ { 1 } = a | B B ) \cdot P ( m _ { 2 } = a | B B , m _ { 1 } = a ) \cdot P ( m _ { 1 } = b | R B ) \cdot P ( m _ { 2 } = a | R B , m _ { 1 } = b ) \cdot C } \\ & { } & { P ( \mathcal { L } _ { \mathrm { b o l } } ) = \underbrace { P ( m _ { 1 } = b | B B ) } _ { \mathrm { ( ~ \overline { { \Omega } } ) } } \cdot \underbrace { P ( m _ { 2 } = a | B B , m _ { 1 } = b ) } _ { \mathrm { ( 2 ) } } \cdot \underbrace { P ( m _ { 1 } = a | R B ) } _ { \mathrm { ( 3 ) } } \cdot \underbrace { P ( m _ { 2 } = a | R B , m _ { 1 } = a ) } _ { \mathrm { ( 4 ) } } \cdot C } \\ & { } & { C = \underbrace { P ( m _ { 1 } = a | B C ) } _ { \mathrm { ( 5 ) } } \cdot \underbrace { P ( m _ { 2 } = b | B C , m _ { 1 } = a ) } _ { \mathrm { ( 6 ) } } \cdot \underbrace { P ( m _ { 1 } = b | R C ) } _ { \mathrm { ( 7 ) } } \cdot \underbrace { P ( m _ { 2 } = b | R C , m _ { 1 } = b ) } _ { \mathrm { ( 8 ) } } } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
where $C$ is the common part for both languages.
|
| 328 |
+
|
| 329 |
+
As we are using stochastic gradient descent algorithm to update the parameters of Alice, it straightforward to see that the update of gradient from one point will ’pull up’ the neighbourhood region of function $h$ , which is shown in the left panel of Figure 7. Then, we can speculate that if one data sample belonging to both the two language comes, e.g. $\langle a b , B C \rangle$ , the following probabilities would increase at the same time:
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
P ( m _ { 1 } = a | B C ) ; \quad P ( m _ { 1 } = a | B B ) ; \quad P ( m _ { 1 } = a | R C ) ,
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
as the input of them are similar with $B C$ (only one attribute changes). As the conditional probabilities must sum to 1, the following probabilities would decrease:
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
P ( m _ { 1 } = b | B C ) ; \quad P ( m _ { 1 } = b | B B ) ; \quad P ( m _ { 1 } = b | R C ) .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Thus, when Alice learns the data sample $\langle a b , B C \rangle$ , $P ( \mathcal { L } _ { \mathrm { c m p } } )$ may have two terms increased, i.e., terms $\textcircled{5}$ and $\textcircled{1}$ . For $P ( \mathcal { L } _ { \mathrm { h o l } } )$ , however, the decrease of term $\textcircled{1}$ will harm the increase of term $\textcircled{5}$ , hence $P ( \mathcal { L } _ { \mathrm { h o l } } )$ increases slower than $P ( \mathcal { L } _ { \mathrm { c m p } } )$ (The fact that term $\textcircled{7}$ decreases on both sides would not change our deduction).
|
| 342 |
+
|
| 343 |
+
# Example for Supporting Hypothesis 2:
|
| 344 |
+
|
| 345 |
+
We can use a similar explanation for the advantage at Bob. Recall that Bob is defined as a mapping function $f$ from ${ \mathcal { M } } \times { \mathcal { X } }$ to $\mathbb { R } ^ { 1 }$ . Following the principle mentioned above, if Bob learns $\langle a b , B B \rangle$ , a bunch of function values would increase, i.e. $\bar { f } ( a b , \bar { B } B ) , f ( a a , B B ) , f ( b b , B B ) , f ( a b , \bar { B } C ) ,$ and $f ( a b , C B )$ , as they are all close to each other in the input space. Then it is easy to find that two terms in the compositional language in Table 4 are increased while only one term increases in the holistic language. That is, the score of high- $\boldsymbol { \rho }$ language would increases faster.
|
| 346 |
+
|
| 347 |
+
We can also think hypothesis 2 in the following way. With the intuition that a language with higher $\rho$ tends to be smoother and to have fewer inflection points than one with lower $\rho$ , the learning speed advantage given by highly compositional languages can be illustrated by the example provided in Figure 7. In the example, language is considered to be a one-dimensional mapping function, which is represented by the dotted lines in Figure 7. The object-message pairs, which are represented by the cross marks, are the points that satisfy the mapping function. The solid line represents the mapping function of the learning agent. Suppose the target output (i.e. the third cross mark in each figure) is larger than the predicting output (i.e. the circle mark), the optimizer will update the parameters of the neural network following the direction of the gradient, as illustrated by the bold arrows in the figure. Such an update will also pull the neighbouring parts of the function up, as illustrated by the smaller arrows on the solid curve.
|
| 348 |
+
|
| 349 |
+
The smoothness of high- $\boldsymbol { \rho }$ languages implies that the MSE of neighbouring positions will also be reduced by this update, while the MSE of neighbors would be increased in the case of a low- $\rho$ language. Such a trend is represented by the blue arrows and red crossed-arrows in Figure 7: the blue one means a decrease of the MSE at the specific position while the red one means increases of MSE. In other words, for a high- $\cdot \rho$ languages, an update corresponding to one data sample is likely to have a larger positive effect on other data samples, and hence ensure a higher learning speed. Meanwhile, for a low- $\rho$ language, one data sample would have both positive and negative effects on its neighbors and thus lead to a lower learning speed.
|
| 350 |
+
|
| 351 |
+
# APPENDIX E: ROBUSTNESS OF NIL
|
| 352 |
+
|
| 353 |
+
In this section, we will provide experimental results to demonstrate the robustness of the proposed method. The influence of hyperparameters (e.g. vocabulary size, message length) as well as the role played by Alice and Bob are both elaborated.
|
| 354 |
+
|
| 355 |
+
# Robustness for Hyperparameters on Message Space:
|
| 356 |
+
|
| 357 |
+
The message space are decided by the vocabulary size $| V |$ and the message length $N _ { L }$ . Thus, we first make experiments to see the effects of different $| V |$ and $N _ { L }$ on $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ .
|
| 358 |
+
|
| 359 |
+
From the discussion in Appendix B, we know that when $| V |$ and $N _ { L }$ are large, making high- $\rho$ language dominate in the posterior probability is very hard, as the compositional languages only occupy an extremely small portion. Such a trend could also be found in Table 5, as the finally converged expectation of topological similarity becomes lower with larger $| V |$ or $N _ { L }$ .
|
| 360 |
+
|
| 361 |
+
Our algorithm, however, is very robust to different values of $| V |$ and $N _ { L }$ . By comparing different columns in Table 5, $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ decreases very slow with the increasement of $| V |$ and $N _ { L }$ . An extreme example is that, the converged $\rho$ can still be roughly 0.8 with $| V | = 7 2$ . The performance of validation accuracy seems more robust when $| V |$ and $N _ { L }$ changes: the NIL can always obtain more than $80 \%$ accuracy compared to the none reset case (roughly $1 5 \%$ ).
|
| 362 |
+
|
| 363 |
+
Furthermore, compared with $| V | , N _ { L }$ has a stronger impact on the performance in terms of all metrics but the validation performance, as it is shown in Table 5 that the performance with $N _ { L } = 3$ is significantly lower than its counterpart when $N _ { L } ~ = ~ 2$ . One possible explanation is that the increasing of $N _ { L }$ brings an exponential change to the message space. However, no matter how $| V |$ and $N _ { L }$ change, $\bar { \mathbb { E } } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } \big [ \rho ( \mathcal { L } ) \big ]$ is always significantly higher that the compositionality of emergent languages given by baseline model, i.e. 0.3.
|
| 364 |
+
|
| 365 |
+
<table><tr><td></td><td>NL</td><td>V|= 8</td><td>V|=12</td><td>V|=16</td><td>V|=24</td><td>V|=40</td><td>V|=72</td></tr><tr><td rowspan="2">E[p71:80]</td><td>2</td><td>0.986±0.01</td><td>0.937±0.02</td><td>0.933±0.01</td><td>0.854±0.02</td><td>0.830±0.02</td><td>0.793±0.02</td></tr><tr><td>3</td><td>0.712±0.01</td><td>0.833±0.01</td><td>0.798±0.02</td><td>0.777±0.01</td><td>0.793±0.02</td><td>0.780±0.03</td></tr><tr><td rowspan="2">E[p1:10]</td><td>2</td><td>0.767±0.18</td><td>0.690±0.18</td><td>0.684±0.20</td><td>0.630±0.17</td><td>0.668±0.19</td><td>0.572±0.14</td></tr><tr><td>3</td><td>0.528±0.11</td><td>0.647±0.15</td><td>0.640±0.17</td><td>0.664±0.14</td><td>0.637±0.16</td><td>0.628±0.21</td></tr><tr><td rowspan="2">G0.85</td><td>2</td><td>9</td><td>16</td><td>10</td><td>37</td><td>68</td><td>-</td></tr><tr><td>3</td><td>-</td><td>-</td><td>39</td><td>1</td><td>-</td><td>59</td></tr><tr><td rowspan="2">Valid Acc.</td><td>2</td><td>0.868±0.14</td><td>0.914±0.06</td><td>0.833±0.11</td><td>0.866±0.11</td><td>0.801±0.10</td><td>0.828±0.14</td></tr><tr><td>3</td><td>0.804±0.13</td><td>0.677±0.16</td><td>0.773±0.15</td><td>0.858±0.10</td><td>0.867±0.01</td><td>0.900±0.07</td></tr></table>
|
| 366 |
+
|
| 367 |
+
Table 5: Values of 4 metrics when $| V |$ and $N _ { L }$ changes. Metric $G _ { 0 . 8 5 }$ means the first generation that the average $\rho$ of the previous three generations exceed 0.85. The notation “-” means the agents never satisfy the requirement.
|
| 368 |
+
|
| 369 |
+
# Robustness on Degenerate Components:
|
| 370 |
+
|
| 371 |
+
From the discussions in Appendix B, we know that the $\rho$ of a language who has many degenerate components will also be high, and hence can be learned faster by Alice in the learning phase. Thus, it is necessary to check whether our algorithm can avoid the mode collapse caused by the degenerate components. Intuitively, the degenerate components can be filtered out during the interacting phase, as the REINFORCE algorithm ensure that the parameters of the agent will only be updated with respect to $R = 1$ , i.e. the language is effective and thus unambiguous.
|
| 372 |
+
|
| 373 |
+
To verify our hypothesis, we first observe how the number of message types, i.e. the number of different messages used to describe all 64 objects, changes during NIL. It is straightforward to see that a language without any degenerate component would have 64 different message types. As shown in Figure 8, all methods could achieve high numbers if message types, which indicates that the REINFORCE algorithm could always filter out the degenerate components efficiently.
|
| 374 |
+
|
| 375 |
+
Furthermore, we design two challenging tasks for NIL:
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 8: Numbers of message types from different settings.
|
| 379 |
+
|
| 380 |
+
1. Degenerate initialized: We let Alice learn from a pure degenerate language at the beginning of each generation, before it learns from $D _ { i }$ .
|
| 381 |
+
|
| 382 |
+
2. Degenerate mixed: We mix the data pair generated by a pure degenerate language to $D _ { i }$ and ensures the proportion of the degenerate pairs is more than $5 0 \%$ , which makes Alice easier to collapse to a degenerate language during learning phase.
|
| 383 |
+
|
| 384 |
+
We then compare the performance, i.e. the expected $\rho$ and validation accuracy, of agents in different tasks. The results shown in Figure 9 demonstrate that our NIL is very robust to the influence of degenerate component, as both $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ and the validation score are much higher than the none reset baseline’s performance.
|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
Figure 9: Two corner case test. NIL with degenerate initialized means Alice is initialized with a degenerate language at the beginning of each generation. NIL with degenerate mixed means Alice is initialized with a degenerate language, AND the $D _ { i }$ is mixed with $I _ { s }$ degenerate language pairs.
|
| 388 |
+
|
| 389 |
+
# The Role of Bob’s Pre-training
|
| 390 |
+
|
| 391 |
+
From the discussions above, it is easy to understand why $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ would gradually increase in NIL and how the REINFORCE applied in interacting phase can filter the degenerate component. However, the role played by Bob, especially in the learning phase where Bob only update its own parameters, is not straightforward. In short, the pre-training of Bob makes the algorithm more robust, especially at the beginning of the interacting phase. We record the value of $\bar { \mathbb { E } } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ every 20 iterations among learning phase and interacting phase, and plot the results of two generations in Figure 10.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 10: The change of $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ in generation 3 and 6.
|
| 395 |
+
|
| 396 |
+
In this figure, the $\mathbf { X }$ -axis is the index of iterations. With $I _ { a } { = } 1 0 0 0$ , $I _ { b } { = } 4 0 0$ , and $I _ { g } { = } 1 6 0 0$ , we split (by dotted lines) each generation to three parts: Alice pre-training, Bob pre-training, and interacting phase. The blue lines are generated by NIL with the pre-training of Bob while the red lines are generated when Bob is not pre-trained (here $I _ { g } { = } 2 0 0 0$ to make a fair comparison). For the blue lines, $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ will not change when Bob is pre-training (begins at the 1000th iteration), because Alice do not update parameters at that time. However, for the red lines, $\mathbb { E } _ { \mathcal { L } \sim P ( \mathcal { L } | \mathrm { N I L } ) } [ \rho ( \mathcal { L } ) ]$ begin to decrease at the $1 0 0 0 \mathrm { { t h } }$ iteration. That is because when Bob is not pre-trained, the language learned by Alice may be impacted by playing with a fresh new Bob at the beginning of interacting phase! That is why the pre-training of Bob can make the NIL more efficient and robust. If Bob are pre-trained by the data generated by Alice in the current generation, Bob would be more “familiar” with Alice’s language, and hence ensures a more stable interacting phase.
|
| 397 |
+
|
| 398 |
+
# Looking at the Emergent Languages
|
| 399 |
+
|
| 400 |
+
From the discussions above, we know that NIL can ensure a high expected $\rho$ of the emergent language, and a high validation performance. Here we show the evolution of the distributions of emergent languages to provide a better intuition on how NIL works.
|
| 401 |
+
|
| 402 |
+
We first provide two examples of converged language (i.e., the language generated by Alice in the last generation) using the none-reset method and the resetting-both method in Table 6 and 7, respectively. In these examples, both languages can almost unambiguously represent all 64 different types of objects in $\mathcal { X }$ , and hence they can help Alice and Bob to play the game successfully. However, the language generated using iterated learning has a clear compositional structure: the first position of the message represents different colors, and the second position represents the shape. Such a structure is quite similar to what humans do, e.g., combine an adjective and a noun to represent a complex concept.
|
| 403 |
+
|
| 404 |
+
To better illustrate the posterior probability of emergent languages as a function of the corresponding value of $\rho$ and the generation, we provide the 3D views of $\bar { P } ( \rho ( \mathcal { L } ) | D _ { i } , R _ { i } )$ in 80 generations in Figure 12 and 13. The heat-map provided in Figure 11 can be considered as the top views of these 3D illustrations. In these two figures, the $\mathbf { X }$ -axis and y-axis represent the index of generation and the topological similarity, and the z-axis represents the probability of languages with a specific value of $\rho$ , in a specific generation. To make the figures easier to read, we smooth the distribution of $\rho$ in each generation using linear interpolation (Boyd & Vandenberghe, 2004).
|
| 405 |
+
|
| 406 |
+
Figure 14-(a) and (b) compare the posterior distributions at some typical generations, which can also be considered as the side views of the 3D illustration from the direction of $\mathbf { X }$ -axis. In these figures, we find that the initial distribution of $\rho$ is not flat. That is because even the prior probability for each language is uniform, the amounts of languages with extremely high $\rho$ and low $\rho$ only occupy a small portion among all possible languages, as stated in (Brighton, 2002). Hence the initial probability of $\rho ( \mathcal { L } )$ is no longer uniform and has a bell shape which is similar to the Gaussian distribution. One new trend provided by these figures is that, in the none-reset case, the width of the curves in different generations do not change much, while in the resetting-both case, the width of the curves will gradually decrease (i.e., becomes more peaky). Such a trends means when iterated learning is applied, language tend to converge to some high- $\cdot \rho$ types.
|
| 407 |
+
|
| 408 |
+
Figure 15-(a) and (b) track the ratio of languages with different values of $\rho$ , which can also be considered as the side views of the 3D illustration from the direction of $_ \textrm { y }$ -axis. In these figures, we divide all possible languages into five groups based on their topological similarity, i.e., languages with $\rho \le 0 . 2 , 0 . 2 < \rho \le 0 . 4 , 0 . 4 < \rho \le 0 . 6 , 0 . 6 < \rho \le 0 . 8$ , and $0 . 8 < \rho$ . We plot the ratio of these five different groups of languages at the end of each generation. From Figure 15-(a), we can see that the high- $\rho$ language, which is represented by the bold curve, always occupy a small portion. The topological similarity of the dominant languages are $\rho < 0 . 4$ . However, in the resetting-both case, as illustrated in Figure 15-(b), the portion of high- $\rho$ language will increase significantly, which further verifies that the iterated learning can gradually make the high- $\boldsymbol { \rho }$ language dominate in posterior.
|
| 409 |
+
|
| 410 |
+
Table 6: Example of the converged language in none-reset case $\rho = 0 . 2 3$
|
| 411 |
+
|
| 412 |
+
<table><tr><td></td><td>blue</td><td>green</td><td>cyan</td><td>brown</td><td>red</td><td>black</td><td>yellow</td><td>white</td></tr><tr><td>box</td><td>aa</td><td>fh</td><td>af</td><td>hh</td><td>cg</td><td>fc</td><td>ha</td><td>hf</td></tr><tr><td>circle</td><td>da</td><td>df</td><td>hb</td><td>db</td><td>fa</td><td>da</td><td>dh</td><td>fb</td></tr><tr><td>triangle</td><td>gc</td><td>ff</td><td>ge</td><td>gf</td><td>gg</td><td>fg</td><td>ge</td><td>he</td></tr><tr><td>square</td><td>ae</td><td>fb</td><td>be</td><td>bb</td><td>bg</td><td>fb</td><td>gb</td><td>ba</td></tr><tr><td>star</td><td>ad</td><td>fd</td><td>de</td><td>db</td><td>dg</td><td>fd</td><td>ce</td><td>hc</td></tr><tr><td>diamond</td><td>ac</td><td>dd</td><td>dc</td><td>db</td><td>dg</td><td>fd</td><td>dc</td><td>dd</td></tr><tr><td>pentagon</td><td>ad</td><td>fe</td><td>ef</td><td>bd</td><td>eg</td><td>fc</td><td>ee</td><td>ed</td></tr><tr><td>capsule</td><td>aa</td><td>dd</td><td>de</td><td>db</td><td>dg</td><td>gd</td><td>de</td><td>fh</td></tr></table>
|
| 413 |
+
|
| 414 |
+
Table 7: Example of the converged language in resetting-both case $\rho = 0 . 9 3$
|
| 415 |
+
|
| 416 |
+
<table><tr><td></td><td>blue</td><td>green</td><td>cyan</td><td>brown</td><td>red</td><td>black</td><td>yellow</td><td>white</td></tr><tr><td>box</td><td>aa</td><td>ea</td><td>ba</td><td>ga</td><td>da</td><td>ca</td><td>ha</td><td>fa</td></tr><tr><td>circle</td><td>ab</td><td>eb</td><td>bb</td><td>gb</td><td>db</td><td>cb</td><td>hb</td><td>fb</td></tr><tr><td>triangle</td><td>ae</td><td>eb</td><td>be</td><td>ge</td><td>de</td><td>ce</td><td>he</td><td>fe</td></tr><tr><td>square</td><td>af</td><td>ef</td><td>bf</td><td>gf</td><td>df</td><td>cf</td><td>hf</td><td>ff</td></tr><tr><td>star</td><td>ac</td><td>ec</td><td>bc</td><td>gc</td><td>dc</td><td>Cc</td><td>dh</td><td>fc</td></tr><tr><td>diamond</td><td>ad</td><td>ed</td><td>bd</td><td>gd</td><td>dd</td><td>cd</td><td>hd</td><td>fd</td></tr><tr><td>pentagon</td><td>ag</td><td>eg</td><td>bg</td><td>gg</td><td>dg</td><td>cg</td><td>hg</td><td>fg</td></tr><tr><td>capsule</td><td>ah</td><td>eh</td><td>bh</td><td>gh</td><td>hc</td><td>ch</td><td>hh</td><td>fh</td></tr></table>
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 11: Distribution of $P ( \rho ( \mathcal { L } ) | D _ { i } , R _ { i } )$ through 80 generations. Values of $\rho$ are divided into ten groups. The distribution of $\rho$ in each generation is smoothed using linear interpolation.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 12: Language evolution of none-reset case in a 3D illustration.
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 13: Language evolution of resetting-both case in a 3D illustration.
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
Figure 14: Distribution of $\rho ( \mathcal { L } )$ at different generations.
|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
Figure 15: Evolution of language with different values of $\rho$ .
|
md/train/HkgxasA5Ym/HkgxasA5Ym.md
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RELIABLE UNCERTAINTY ESTIMATES IN NEURAL NETWORKS USING NOISE CONTRASTIVE PRIORS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Obtaining reliable uncertainty estimates of neural network predictions is a long standing challenge. Bayesian neural networks have been proposed as a solution, but it remains open how to specify their prior. In particular, the common practice of a standard normal prior in weight space imposes only weak regularities, causing the function posterior to possibly generalize in unforeseen ways on inputs outside of the training distribution. We propose noise contrastive priors (NCPs) to obtain reliable uncertainty estimates. The key idea is to train the model to output high uncertainty for data points outside of the training distribution. NCPs do so using an input prior, which adds noise to the inputs of the current mini batch, and an output prior, which is a wide distribution given these inputs. NCPs are compatible with any model that can output uncertainty estimates, are easy to scale, and yield reliable uncertainty estimates throughout training. Empirically, we show that NCPs prevent overfitting outside of the training distribution and result in uncertainty estimates that are useful for active learning. We demonstrate the scalability of our method on the flight delays data set, where we significantly improve upon previously published results.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many successful applications of neural networks (Krizhevsky et al., 2012; Sutskever et al., 2014; van den Oord et al., 2016) are in restricted settings where predictions are only made for inputs similar to the training distribution. In real-world scenarios, neural networks can face truly novel data points during inference, and in these settings it can be valuable to have good estimates of the model’s uncertainty. For example, in healthcare, reliable uncertainty estimates can prevent overconfident decisions for rare or novel patient conditions (Schulam and Saria, 2015). Similarly, autonomous agents that actively explore their environment can use uncertainty estimates to decide what data points will be most informative.
|
| 12 |
+
|
| 13 |
+
Epistemic uncertainty describes the amount of missing knowledge about the data generating function. Uncertainty can in principle be completely reduced by observing more data points at the right locations and training on them. In contrast, the data generating function may also have inherent randomness, which we call aleatoric noise. This noise can be captured by models outputting a distribution rather than a point prediction. Obtaining more data points allows the noise estimate to move closer to the true value, which is usually different from zero. For active learning, it is crucial to separate the two types of randomness: we want to acquire labels in regions of high uncertainty but low noise (MacKay, 1992a).
|
| 14 |
+
|
| 15 |
+
Bayesian analysis provides a principled approach to modeling uncertainty in neural networks (Denker et al., 1987; MacKay, 1992b). Namely, one places a prior over the network’s weights and biases. This effectively places a distribution over the functions that the network represents, capturing uncertainty about which function best fits the data. Specifying this prior remains an open challenge. Common practice is to use a standard normal prior in weight space, which imposes weak shrinkage regularities analogous to weight decay. It is neither informative about the induced function class nor the data (e.g., it is sensitive to parameterization).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Predictive distributions on a low-dimensional active learning task. The predictive distributions are visualized as mean and two standard deviations shaded. They decompose into epistemic uncertainty $\mid$ and aleatoric noise . Data points are only available within two bands, and are selected using the expected information gain . (a) A deterministic network conflates uncertainty as part of the noise and is overconfident outside of the data distribution. (b) A variational Bayesian neural network with standard normal prior represents uncertainty and noise separately but is overconfident outside of the training distribution. (c) On the OOD classifier model, NCP prevents overconfidence. (d) On the Bayesian neural network, NCP produces smooth uncertainty estimates that generalize well to unseen data points. Models trained with NCP also separate uncertainty and noise well. The experimental setup is described in Section 5.1.
|
| 19 |
+
|
| 20 |
+
This can cause the induced function posterior to generalize in unforeseen ways on out-of-distribution (OOD) inputs, which are inputs outside of the distribution that generated the training data.
|
| 21 |
+
|
| 22 |
+
Motivated by these challenges, we introduce noise contrastive priors (NCPs), which encourage uncertainty outside of the training distribution through a loss in data space. NCPs are compatible with any model that represents functional uncertainty as a random variable, are easy to scale, and yield reliable uncertainty estimates that show significantly improved active learning performance.
|
| 23 |
+
|
| 24 |
+
# 2 NOISE CONTRASTIVE PRIORS
|
| 25 |
+
|
| 26 |
+
Specifying priors is intuitive for small probabilistic models, where each variable typically has a clear interpretation (Blei, 2014). It is less intuitive for neural networks, where the parameters serve more as adaptive basis coefficients in a nonparametric function. For example, neural network models are nonidentifiable due to weight symmetries that yield the same function (Müller and Insua, 1998). This makes it difficult to express informative priors on the weights, such as expressing high uncertainty on unfamiliar examples.
|
| 27 |
+
|
| 28 |
+
Data priors Unlike a prior in weight space, a data prior lets one easily express informative assumptions about input-output relationships. Here, we use the example of a prior over a labeled data set $\{ x , y \}$ , although the prior can also be on $x$ and another variable in the model that represents uncertainty and has a clear interpretation. The prior takes the form $p _ { \mathrm { p r i o r } } ( x , y ) = p _ { \mathrm { p r i o r } } ( x ) \ p _ { \mathrm { p r i o r } } ( y \mid x )$ , where $p _ { \mathrm { p r i o r } } ( x )$ denotes the input prior and $p _ { \mathrm { p r i o r } } ( y \mid x )$ denotes the output prior.
|
| 29 |
+
|
| 30 |
+
To prevent overconfident predictions, a good input prior $p _ { \mathrm { p r i o r } } ( x )$ should include OOD examples so that it acts beyond the training distribution. A good output prior $p _ { \mathrm { p r i o r } } ( y \mid x )$ should be a high-entropy distribution, representing high uncertainty about the model output given OOD inputs.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Graphical representations of the two uncertainty-aware models we consider. Circles denote random variables, squares denote deterministic variables, shading denotes observations during training. (a) The Bayesian neural network captures a belief over parameters for the predictive mean, while the predictive variance is a deterministic function of the input. In practice, we only use weight uncertainty for the mean’s output layer and share earlier layers between the mean and variance. (b) The out-of-distribution classifier model uses a binary auxiliary variable $o$ to determine if a given input is out-of-distribution; given its value, the output is drawn from either a neural network prediction or a wide output prior.
|
| 34 |
+
|
| 35 |
+
Generating OOD inputs Exactly generating OOD data is difficult. A priori, we must uniformly represent the input domain. A posteriori, we must represent the complement of the training distribution. Both distributions are typically uniform over infinite support, making them ill-defined. To estimate OOD inputs, we develop an algorithm inspired by noise contrastive estimation (Gutmann and Hyvärinen, 2010a; Mnih and Kavukcuoglu, 2013), where a complement distribution is approximated using random noise.
|
| 36 |
+
|
| 37 |
+
A hypothesis of our work is that in practice it is enough to encourage high uncertainty output near the boundary of the training distribution, and that this effect will propagate to the entire OOD space. This hypothesis is backed up by previous work (Lee et al., 2017) as well as our experiments (see Figure 1). This means we no longer need to sample arbitrary OOD inputs. It is enough to sample OOD points that lie close to the boundary of the training distribution, and to apply our desired prior at those points.
|
| 38 |
+
|
| 39 |
+
Loss function Noise contrastive priors are data priors that are enforced on both training inputs $x$ and inputs $\tilde { x }$ perturbed by noise. For example, in binary and categorical input domains, we approximate OOD inputs by randomly flipping the features to different classes with a certain probability. For continuous valued inputs $x$ we can use additive Gaussian noise to obtain noised up inputs $\tilde { x } = x + \epsilon$ . This expresses the noise contrastive prior where inputs are distributed according to the convolved distribution,
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
p _ { \mathrm { p r i o r } } ( \tilde { x } ) = \int _ { x } p _ { \mathrm { t r a i n } } ( x ) \mathrm { N o r m a l } ( \tilde { x } - x \mid \mu _ { x } , \sigma _ { x } ^ { 2 } ) d x \qquad p _ { \mathrm { p r i o r } } ( \tilde { y } \mid \tilde { x } ) = \mathrm { N o r m a l } ( \mu _ { y } , \sigma _ { y } ^ { 2 } ) .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
The variances $\sigma _ { x } ^ { 2 }$ and $\sigma _ { y } ^ { 2 }$ are hyperparameters that tune how far from the boundary we sample, and how large we want the output uncertainty to be. We choose $\mu _ { x } = 0$ to apply the prior equally in all directions from the data manifold. The output mean $\mu _ { y }$ determines the default prediction of the model outside of the training distribution, for example $\mu _ { y } = 0$ . We set $\mu _ { y } = y$ which corresponds to data augmentation (Matsuoka, 1992; An, 1996), where a model is trained to recover the true labels from perturbed inputs. This way, NCP makes the model uncertain while still trying to generalize to OOD inputs.
|
| 46 |
+
|
| 47 |
+
For training, we minimize the loss function
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r l } & { \mathcal { L } ( \theta ) = \mathrm { \mathrm { ~ E } } _ { p _ { \mathrm { t r a i n } } ( x ) } \left[ D _ { \mathrm { K L } } \big [ p _ { \mathrm { t r a i n } } ( y \mid x ) \ \lVert \ p _ { \mathrm { m o d e l } } ( y \mid x , \theta ) \big ] \right] } \\ & { \quad \quad \quad + \gamma \mathrm { \mathrm { E } } _ { p _ { \mathrm { p r i o r } } ( \tilde { x } ) } \left[ D _ { \mathrm { K L } } \big [ p _ { \mathrm { p r i o r } } ( \tilde { y } \mid \tilde { x } ) \ \lVert \ p _ { \mathrm { m o d e l } } ( \tilde { y } \mid \tilde { x } , \theta ) \big ] \right] . } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
The first term represents typical maximum likelihood, in which one minimizes the KL divergence to the empirical training distribution $p _ { \mathrm { t r a i n } } ( y \mid x )$ over training inputs. The second term is added by our method: it represents the analogous term on a data prior. The hyperparameter $\gamma$ sets the relative trade-off between them.
|
| 54 |
+
|
| 55 |
+
Interpretation as function prior The noise contrastive prior can be interpreted as inducing a function prior. This is formalized through the prior predictive distribution,
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
p ( \boldsymbol { y } \mid \boldsymbol { x } ) = \int p _ { \mathrm { m o d e l } } ( \boldsymbol { y } \mid \boldsymbol { x } , \boldsymbol { \theta } ) p _ { \mathrm { m o d e l } } ( \boldsymbol { \theta } \mid \tilde { \boldsymbol { x } } , \tilde { \boldsymbol { y } } ) p _ { \mathrm { p r i o r } } ( \tilde { \boldsymbol { x } } , \tilde { \boldsymbol { y } } ) d \boldsymbol { \theta } d \tilde { \boldsymbol { x } } d \tilde { \boldsymbol { y } } .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
The distribution marginalizes over network parameters $\theta$ as well as data fantasized from the data prior. The distribution $p ( \theta \mid \tilde { x } , \tilde { y } )$ represents the distribution of model parameters after fitting the prior data. That is, the belief over weights is shaped to make $p ( y \mid x )$ highly variable. This parameter belief causes uncertain predictions outside of the training distribution, which we could not specify in weight space directly.
|
| 62 |
+
|
| 63 |
+
Because network weights are constrained to fit the data prior, the prior acts as “pseudo-data.” This is similar to classical work on conjugate priors: a $\mathrm { B e t a } ( \alpha , \beta )$ prior on the probability of a Bernoulli likelihood implies a Beta posterior, and if the posterior mode is chosen as an optimal parameter setting, then the prior translates to $\alpha - 1$ successes and $\beta - 1$ failures. It is also similar to pseudo-data in sparse Gaussian processes (Quiñonero-Candela and Rasmussen, 2005).
|
| 64 |
+
|
| 65 |
+
Data priors encourage learning parameters that not only capture the training data well but also the prior data. In practice, we can combine NCP with other priors, for example the typical standard normal prior in weight space for Bayesian neural networks, although we did not find this necessary in our experiments.
|
| 66 |
+
|
| 67 |
+
# 3 BAYESIAN NEURAL NETWORKS WITH NCP
|
| 68 |
+
|
| 69 |
+
Noise contrastive priors are applicable to any model that represents uncertainty in a random variable. The NCP can then be added to that random variable to make the model uncertain on OOD inputs. In this section, we apply NCP to a Bayesian neural network (BNN) trained via variational inference. Blundell et al. (2015) introduce such a model under the name Bayes by Backprop (BBB) that uses a standard normal prior in weight space. We extend this model with a NCP on the mean predicted by the neural network.
|
| 70 |
+
|
| 71 |
+
Consider a regression task with data $\{ x , y \}$ that we model as $p ( y \mid x , \theta ) = { \mathrm { N o r m a l } } ( \mu ( x ) , \sigma ^ { 2 } ( x ) )$ with mean and variance predicted by a neural network from the inputs. This model is heteroskedastic, meaning that it can predict a different aleatoric noise amount for every point in the input space. We use a weight prior for only the output layer (Lázaro-Gredilla and Figueiras-Vidal, 2010; Calandra et al., 2014) that predicts the mean, resulting in the model
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\theta \sim \operatorname { N o r m a l } ( 0 , 0 . 1 ) \qquad y \sim \operatorname { N o r m a l } ( \mu ( x , \theta ) , \sigma ^ { 2 } ( x ) ) .
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
We do not model uncertainty about the noise estimate, as this is not required for the approximation for the Gaussian expected information gain (MacKay, 1992a) that we use to acquire labels. Therefore, the distribution of the mean induced by the weight prior, $\begin{array} { r } { \dot { q } ( \mu ( x ) ) = \int \mu ( x , \theta ) q _ { \phi } ( \theta ) \dot { d } \theta } \end{array}$ , represents the model’s epistemic uncertainty. Note that this is different from the predictive distribution, which combines both uncertainty and noise. We place an NCP on the distribution of the mean, resulting in the loss function
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } ( \phi ) = - \mathbb { E } _ { q _ { \phi } ( \theta ) } [ \ln p ( y \mid x , \theta ) ] + \beta D _ { \mathrm { K L } } [ q _ { \phi } ( \theta ) \parallel p ( \theta ) ] + \underbrace { \gamma D _ { \mathrm { K L } } [ \mathrm { N o r m a l } ( \mu _ { \mu } , \sigma _ { \mu } ^ { 2 } ) \parallel q ( \mu ( \tilde { x } ) ) ] } _ { \mathrm { N C P l o s s } } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Here, $\tilde { x }$ are the perturbed inputs and $q _ { \phi } ( \theta )$ forms an approximate posterior over weights.1 Because we only use the weight belief for the linear output layer, we can compute the KL-divergence of the NCP loss analytically. In other models, it could be estimated using samples.
|
| 84 |
+
|
| 85 |
+
The loss function applies weight regularization in order for network weights to regress to a standard normal prior; like other regularization techniques, this assists in improving the network’s generalization in-distribution.
|
| 86 |
+
|
| 87 |
+
The NCP loss encourages the network’s generalization OOD by matching the mean distribution to the output prior. Minimizing the KL divergence to a wide output prior results in high uncertainty on OOD inputs, so the model will explore these data points during active learning.
|
| 88 |
+
|
| 89 |
+
In practice, we find that NCP is sufficient as a prior for the BNN and set $\beta = 0$ . The appendix (Appendix B includes an alternative interpretation explaining why NCP might be sufficient, which represents the weight space KL-divergence in data space after a change of variables.
|
| 90 |
+
|
| 91 |
+
# 4 RELATED WORK
|
| 92 |
+
|
| 93 |
+
Priors for neural networks Classic work has investigated entropic priors (Buntine and Weigend, 1991) and hierarchical priors (MacKay, 1992b; Neal, 2012; Lampinen and Vehtari, 2001). More recently, Depeweg et al. (2018) introduce networks with latent variables in order to disentangle forms of uncertainty, and FlamShepherd et al. (2017) propose general-purpose weight priors based on approximating Gaussian processes. Other works have analyzed priors for compression and model selection (Ghosh and Doshi-Velez, 2017; Louizos et al., 2017). Instead of a prior in weight space (or latent inputs as in Depeweg et al. (2018)), NCPs take the functional view by imposing explicit regularities in terms of the network’s inputs and outputs. Malinin and Gales (2018) propose prior networks to avoid an explicit belief over parameters for classification tasks.
|
| 94 |
+
|
| 95 |
+
Input and output regularization There is classic work on adding noise to inputs for improved generalization (Matsuoka, 1992; An, 1996; Bishop, 1995). For example, denoising autoencoders (Vincent et al., 2008) encourage reconstructions given noisy encodings. Output regularization is also a classic idea from the maximum entropy principle (Jaynes, 1957), where it has motivated label smoothing (Szegedy et al., 2016) and entropy penalties (Pereyra et al., 2017). Also related is virtual adversarial training (Miyato et al., 2015), which includes examples that are close to the current input but cause a maximal change in the model output, and mixup (Zhang et al., 2018), which includes examples under the vicinity of training data. These methods are orthogonal to NCPs: they aim to improve generalization from finite data within the training distribution (interpolation), while we aim to improve uncertainty estimates outside of the training distribution (extrapolation).
|
| 96 |
+
|
| 97 |
+
Classifying out-of-distribution inputs A simple approach for neural network uncertainty is to classify whether data points belong to the data distribution, or are OOD (Hendrycks and Gimpel, 2017). This is core to noise contrastive estimation (Gutmann and Hyvärinen, 2010b), a training method for intractable probabilistic models. More recently, Lee et al. (2017) introduce a GAN to generate OOD samples, and Liang et al. (2018) add perturbations to the input, applying an “OOD detector” to improve softmax scores on OOD samples by scaling the temperature. Extending these directions of research, we connect to Bayesian principles and focus on uncertainty estimates that are useful for active data acquisition.
|
| 98 |
+
|
| 99 |
+
# 5 EXPERIMENTS
|
| 100 |
+
|
| 101 |
+
To demonstrate their usefulness, we evaluate NCPs on various tasks where uncertainty estimates are desired. Our focus is on active learning for regression tasks, where only few targets are visible in the beginning, and additional targets are selected regularly based on an acquisition function. We use two data sets: a toy example and a large flights data set. We also evaluate how sensitive our method is to the choice of input noise. Finally, we show that NCP scales to large data sets by training on the full flights data set in a passive learning setting. Our implementation uses TensorFlow Probability (Dillon et al., 2017; Tran et al., 2016) and is open-sourced at https://<hidden-for-review>.
|
| 102 |
+
|
| 103 |
+
We compare four neural network models, all using leaky ReLU activations (Maas et al., 2013) and trained using Adam (Kingma and Ba, 2014). The four models are:
|
| 104 |
+
|
| 105 |
+

|
| 106 |
+
Figure 3: Active learning on the 1-dimensional regression problem, mean and standard deviation over 20 seeds. The test root mean squared error (RMSE) and negative log predictive density (NLPD) of the models trained with NCP decreases during the active learning run, while the baseline models select less informative data and overfit. The deterministic network is barely visible in the plots as it overfits quickly. Figure 1 shows the predictive distributions of the models.
|
| 107 |
+
|
| 108 |
+
• Deterministic neural network (Det) A neural network that predicts the mean and variance of a normal distribution. The name stands for deterministic, as there is no weight uncertainty.
|
| 109 |
+
• Bayes by Backprop (BBB) A Bayesian neural network trained via gradient-based variational inference with a standard normal prior in weight space (Blundell et al., 2015; Kucukelbir et al., 2017). We use the same model as in Section 3 but without the NCP loss term.
|
| 110 |
+
• Bayes by Backprop with noise contrastive prior $\mathbf { ( B B B + N C P ) }$ ) Bayes by Backprop with NCP on the predicted mean distribution as described in Section 3.
|
| 111 |
+
• Out-of-distribution classifier with noise contrastive prior $\mathbf { ( O C D + N C P ) }$ ) An uncertainty classifier model described in Appendix A. It is a deterministic neural network combined with NCP which we use as a baseline alternative to Bayes by Backprop with NCP.
|
| 112 |
+
|
| 113 |
+
For active learning, we select new data points $\{ x , y \}$ for which $x$ maximizes the expected information gain $\operatorname { E } _ { q ( y | x ) } [ D _ { \mathrm { K L } } [ q ( \theta \mid x , y ) \parallel _ { . } q ( \theta ) ] ]$ under the model ${ \\begin{array} { r } { { \dot { q } } ( y \mid x ) = \int p ( y \mid x , \theta ) q ( \theta ) d \theta } \end{array} }$ . Intuitively, this objective function is higher where the model has high epistemic uncertainty and predicts low aleatoric noise.
|
| 114 |
+
|
| 115 |
+
We use an approximation from MacKay (1992a) for Gaussian posterior predictive distributions. Moreover, we place a softmax distribution on the information gain for all available data points and acquire labels by sampling with a temperature of $\tau = 0 . 5$ to get diversity when selecting batches of labels,
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\{ x _ { \mathrm { n e w } } \} \sim p _ { \mathrm { n e w } } ( x ) = \frac { 1 } { Z } \exp \Big ( \frac { 1 } { 2 \tau } \ln \big ( 1 + \mathrm { V a r } [ q ( \mu ( x ) ) ] / \sigma ^ { 2 } ( x ) \big ) \Big ) = \frac { 1 } { Z } \big ( 1 + \mathrm { V a r } [ q ( \mu ( x ) ) ] / \sigma ^ { 2 } ( x ) \big ) ,
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
where $\sigma ^ { 2 } ( x )$ is the estimated aleatoric noise and $q ( \mu ( x ) )$ is the epistemic uncertainty projected into output space. Since our Bayesian neural networks only use a weight belief for the output layer, $\operatorname { V a r } [ q ( \mu ( x ) ) ]$ is Gaussian and can be computed in closed form. In general, it the epistemic part of the predictive variance would be estimated by sampling. In the classifier model, we use the OOD probability $p ( o = 1 | x )$ for this. For the deterministic neural network, we use $\mathrm { V a r } [ p ( y \mid x ) ]$ as proxy since it does not output an estimate of epistemic uncertainty.
|
| 122 |
+
|
| 123 |
+
# 5.1 LOW-DIMENSIONAL ACTIVE LEARNING
|
| 124 |
+
|
| 125 |
+
For visualization purposes, we start with experiments on a 1-dimensional regression task that consists of a sine function with a small slope and increasing variance for higher inputs. Training data can be acquired within two bands, and the model is evaluated on all data points that are not visible to the model. This structured split between training and testing data causes a distributional shift at test time, requiring successful models to have reliable uncertainty estimates to avoid mispredictions for OOD inputs.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 4: Active learning on the flights data set. The models trained with NCP achieve significantly lower negative log predictive density (NLPD) on the test set, and Bayes by Backprop with NCP achieves the lowest root mean squared error (RMSE). The test NLPD for the baseline models diverges as they overfit to the visible data points. Plots show mean and std over 10 runs.
|
| 129 |
+
|
| 130 |
+
For this experiment, we use two layers of 200 hidden units, a batch size of 10, and a learning rate of $3 \times 1 0 ^ { - 4 }$ for all models. NCP models use noise $\epsilon \sim \mathrm { N o r m a l } ( 0 , 0 . 5 )$ . We start with 10 randomly selected initial targets, and select 1 additional target every 1000 epochs. Figure 3 shows the root mean squared error (RMSE) and negative log predictive density (NLPD) throughout learning. The two baseline models severely overfit to the training distribution early on when only few data points are visible. Models with NCP outperform BBB, which in turn outperforms Det. Figure 1 visualizes the models’ predictive distributions at the end of training, showing that NCP prevents overconfident generalization.
|
| 131 |
+
|
| 132 |
+
# 5.2 ACTIVE LEARNING ON FLIGHT DELAYS
|
| 133 |
+
|
| 134 |
+
We consider the flight delay data set (Hensman et al., 2013; Deisenroth and Ng, 2015; Lakshminarayanan et al., 2016), a large scale regression benchmark with several published results. The data set has 8 input variables describing a flight, and the target is the delay of the flight in minutes. There are 700K training examples and 100K test examples. The test set has a subtle distributional shift, since the 100K data points temporally follow after the training data.
|
| 135 |
+
|
| 136 |
+
We use two layers with 50 units each, a batch size of 10, and a learning rate of $1 0 ^ { - 4 }$ . For NCP models, $\epsilon \sim \mathrm { N o r m a l } ( 0 , 0 . 1 )$ . Starting from 10 labels, the models select a batch of 10 additional labels every 50 epochs. The 700K data points of the training data set are available for acquisition, and we evaluate performance on the typical test split. Figure 4 shows the performance for the visible data points and the test set respectively. We note that BBB and $\mathrm { B B B + N C P }$ show similar NLPD on the visible data points, but the NCP models generalize better to unseen data. Moreover, the Bayesian neural network with NCP achieves lower RMSE than the one without and the classifier based model achieves lower RMSE than the deterministic neural network. All uncertainty-based models outperform the deterministic neural network.
|
| 137 |
+
|
| 138 |
+
# 5.3 ROBUSTNESS TO NOISE PATTERNS
|
| 139 |
+
|
| 140 |
+
The choice of input noise might seem like a critical hyper parameter for NCP. In this experiment, we find that our method is robust to the choice of input noise. The experimental setup is the same as for the active learning experiment described in Section 5.2, but with uniform or normal input noise with different variance $( \sigma _ { x } ^ { 2 } \in \bar { \{ 0 . 1 , 0 . 2 , \cdot \cdot \cdot , 1 . 0 \} } )$ . For uniform input noise, this means noise is drawn from the interval $[ - 2 \sigma _ { x } , 2 \sigma _ { x } ]$ We observe that $\mathbf { B B B + N C P }$ is robust to the size of the input noise. NCP consistently improves RMSE for the tested noise sizes and yields the best NLPD for all noise sizes below 0.6. For our ODC baseline, we observe an intuitive trade-off: smaller input noise increases the regularization strength, leading to better NLPD but reduced RMSE. Robustness to the choice of input noise is further supported by the analogous experiment on toy data set, where above a small threshold $( \mathbf { \bar { B } B B + N C P } \ \sigma _ { x } ^ { 2 } \geq 0 . 3 $ and ${ \mathrm { O D C + N C P } }$ $\sigma _ { x } ^ { 2 } \ge \bar { 0 . 1 } \bar { , }$ ), NCP consistently performs well (Figure 6).
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 5: Robustness to different noise patterns. Plots show the final test performance on the flights active learning task (mean and stddev over 5 seeds). Lower is better. NCP is robust to the choice of input noise and improves over the baselines in all settings (compare Figure 4).
|
| 144 |
+
|
| 145 |
+
# 5.4 LARGE SCALE REGRESSION OF FLIGHT DELAYS
|
| 146 |
+
|
| 147 |
+
In addition to the active learning experiments, we perform a passive learning run on all 700K data points of the flights data set to explore the scalability of NCP. We use networks of 3 layers with 1000 units and a learning rate of $1 0 ^ { - 4 }$ . Table 1 compares the performance of our models to previously published results. We significantly improve state of the art performance on this data set.
|
| 148 |
+
|
| 149 |
+
# 6 DISCUSSION
|
| 150 |
+
|
| 151 |
+
We develop noise contrastive priors (NCPs), a prior for neural networks in data space. NCPs encourage network weights that not only explain the training data but also capture high uncertainty on OOD inputs. We show that NCPs offer strong improvements over baselines and scale to large regression tasks.
|
| 152 |
+
|
| 153 |
+
We focused on active learning for regression tasks, where uncertainty is crucial for determining which data points to select next. In future work it would be interesting to apply NCPs to alternative settings where uncertainty is important, such as image classification and learning with sparse or missing data. In addition, NCPs are only one form of a data prior, designed to encourage uncertainty on OOD inputs. Priors in data space can easily capture other properties such as periodicity or spatial invariance, and they may provide a scalable alternative to Gaussian process priors.
|
| 154 |
+
|
| 155 |
+
Table 1: Performance on all 700K data points of the flights data set. While uncertainty estimates are not necessary when a large data set that is similar to the test data set is available, it shows that our method scales easily to large data sets.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Model</td><td>NLPD</td><td>RMSE</td></tr><tr><td>gPoE (Deisenroth & Ng 2015)</td><td>8.1</td><td></td></tr><tr><td>SAVIGP (Bonilla et al. 2016)</td><td>5.02</td><td></td></tr><tr><td>SVI GP (Hensman et al. 2013)</td><td>一</td><td>32.60</td></tr><tr><td>HGP (Ng & Deisenroth 2014)</td><td>一</td><td>27.45</td></tr><tr><td>MF F (Lakshminarayanan et al. 2016)</td><td>4.89</td><td>26.57</td></tr><tr><td>BBB</td><td>4.38</td><td>24.59</td></tr><tr><td>BBB+NCP</td><td>4.38</td><td>24.71</td></tr><tr><td>ODC+NCP</td><td>4.38</td><td>24.68</td></tr></table>
|
| 158 |
+
|
| 159 |
+
# REFERENCES
|
| 160 |
+
|
| 161 |
+
G. An. The effects of adding noise during backpropagation training on a generalization performance. Neural computation, 8(3):643–674, 1996.
|
| 162 |
+
C. M. Bishop. Training with noise is equivalent to tikhonov regularization. Neural computation, 7(1):108–116, 1995.
|
| 163 |
+
D. M. Blei. Build, compute, critique, repeat: Data analysis with latent variable models. Annual Review of Statistics and Its Application, 1:203–232, 2014.
|
| 164 |
+
C. Blundell, J. Cornebise, K. Kavukcuoglu, and D. Wierstra. Weight uncertainty in neural networks. arXiv preprint arXiv:1505.05424, 2015.
|
| 165 |
+
W. L. Buntine and A. S. Weigend. Bayesian back-propagation. Complex Systems, 5(6):603–643, 1991.
|
| 166 |
+
R. Calandra, J. Peters, C. E. Rasmussen, and M. P. Deisenroth. Manifold gaussian processes for regression. arXiv preprint arXiv:1402.5876, 2014.
|
| 167 |
+
S. Dasgupta. Analysis of a greedy active learning strategy. In Neural Information Processing Systems (NIPS), 2004.
|
| 168 |
+
M. P. Deisenroth and J. W. Ng. Distributed gaussian processes. arXiv preprint arXiv:1502.02843, 2015.
|
| 169 |
+
J. Denker, D. Schwartz, B. Wittner, S. Solla, R. Howard, L. Jackel, and J. Hopfield. Large automatic learning, rule extraction, and generalization. Complex Systems, 1(5):877–922, 1987.
|
| 170 |
+
S. Depeweg, J. M. Hernández-Lobato, F. Doshi-Velez, and S. Udluft. Uncertainty decomposition in bayesian neural networks with latent variables. In International Conference on Machine Learning, 2018.
|
| 171 |
+
J. V. Dillon, I. Langmore, D. Tran, E. Brevdo, S. Vasudevan, D. Moore, B. Patton, A. Alemi, M. Hoffman, and R. A. Saurous. Tensorflow distributions. arXiv preprint arXiv:1711.10604, 2017.
|
| 172 |
+
D. Flam-Shepherd, J. Requeima, and D. Duvenaud. Mapping gaussian process priors to bayesian neural networks. In NIPS Workshop, 2017.
|
| 173 |
+
Y. Freund, H. S. Seung, E. Shamir, and N. Tishby. Selective sampling using the query by committee algorithm. Machine learning, 28(2-3):133–168, 1997.
|
| 174 |
+
Y. Gal, R. Islam, and Z. Ghahramani. Deep bayesian active learning with image data. arXiv preprint arXiv:1703.02910, 2017.
|
| 175 |
+
S. Ghosh and F. Doshi-Velez. Model selection in bayesian neural networks via horseshoe priors. arXiv preprint arXiv:1705.10388, 2017.
|
| 176 |
+
M. Gutmann and A. Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 297–304, 2010a.
|
| 177 |
+
M. Gutmann and A. Hyvärinen. Noise-contrastive estimation: A new estimation principle for unnormalized statistical models. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 297–304, 2010b.
|
| 178 |
+
D. Hendrycks and K. Gimpel. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In International Conference on Learning Representations, 2017.
|
| 179 |
+
J. Hensman, N. Fusi, and N. D. Lawrence. Gaussian processes for big data. arXiv preprint arXiv:1309.6835, 2013.
|
| 180 |
+
I. Higgins, L. Matthey, A. Pal, C. Burgess, X. Glorot, M. Botvinick, S. Mohamed, and A. Lerchner. beta-vae: Learning basic visual concepts with a constrained variational framework. International Conference on Learning Representations, 2016.
|
| 181 |
+
N. Houlsby, F. Huszár, Z. Ghahramani, and M. Lengyel. Bayesian active learning for classification and preference learning. arXiv preprint arXiv:1112.5745, 2011.
|
| 182 |
+
E. T. Jaynes. Information theory and statistical mechanics. Physical review, 106(4):620, 1957.
|
| 183 |
+
A. J. Joshi, F. Porikli, and N. Papanikolopoulos. Multi-class active learning for image classification. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pages 2372–2379. IEEE, 2009.
|
| 184 |
+
A. Kapoor, K. Grauman, R. Urtasun, and T. Darrell. Active learning with gaussian processes for object categorization. In Computer Vision, 2007. ICCV 2007. IEEE 11th International Conference on, pages 1–8. IEEE, 2007.
|
| 185 |
+
D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 186 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Neural Information Processing Systems, pages 1097–1105, 2012.
|
| 187 |
+
A. Kucukelbir, D. Tran, R. Ranganath, A. Gelman, and D. M. Blei. Automatic differentiation variational inference. The Journal of Machine Learning Research, 18(1):430–474, 2017.
|
| 188 |
+
B. Lakshminarayanan, D. M. Roy, and Y. W. Teh. Mondrian forests for large-scale regression when uncertainty matters. In Artificial Intelligence and Statistics, pages 1478–1487, 2016.
|
| 189 |
+
J. Lampinen and A. Vehtari. Bayesian approach for neural networks—review and case studies. Neural networks, 14(3):257–274, 2001.
|
| 190 |
+
M. Lázaro-Gredilla and A. R. Figueiras-Vidal. Marginalized neural network mixtures for large-scale regression. IEEE transactions on neural networks, 21(8):1345–1351, 2010.
|
| 191 |
+
K. Lee, H. Lee, K. Lee, and J. Shin. Training confidence-calibrated classifiers for detecting out-of-distribution samples. arXiv preprint arXiv:1711.09325, 2017.
|
| 192 |
+
D. D. Lewis and W. A. Gale. A sequential algorithm for training text classifiers. In Proceedings of the 17th annual international ACM SIGIR conference on Research and development in information retrieval, pages 3–12. Springer-Verlag New York, Inc., 1994.
|
| 193 |
+
X. Li and Y. Guo. Adaptive active learning for image classification. In Computer Vision and Pattern Recognition (CVPR), 2013 IEEE Conference on, pages 859–866. IEEE, 2013.
|
| 194 |
+
S. Liang, Y. Li, and R. Srikant. Principled detection of out-of-distribution examples in neural networks. In International Conference on Learning Representations, 2018.
|
| 195 |
+
C. Louizos, K. Ullrich, and M. Welling. Bayesian compression for deep learning. In Neural Information Processing Systems, pages 3290–3300, 2017.
|
| 196 |
+
A. L. Maas, A. Y. Hannun, and A. Y. Ng. Rectifier nonlinearities improve neural network acoustic models. In International Conference on Machine Learning (ICML), 2013.
|
| 197 |
+
D. J. MacKay. Information-based objective functions for active data selection. Neural computation, 4(4): 590–604, 1992a.
|
| 198 |
+
D. J. MacKay. A practical bayesian framework for backpropagation networks. Neural computation, 4(3): 448–472, 1992b.
|
| 199 |
+
A. Malinin and M. Gales. Predictive uncertainty estimation via prior networks. arXiv preprint arXiv:1802.10501, 2018.
|
| 200 |
+
K. Matsuoka. Noise injection into inputs in back-propagation learning. IEEE Transactions on Systems, Man, and Cybernetics, 22(3):436–440, 1992.
|
| 201 |
+
A. K. McCallumzy and K. Nigamy. Employing em and pool-based active learning for text classification. In Proc. International Conference on Machine Learning (ICML), pages 359–367. Citeseer, 1998.
|
| 202 |
+
T. Miyato, S. Maeda, M. Koyama, K. Nakae, and S. Ishii. Distributional smoothing with virtual adversarial training. arXiv preprint arXiv:1507.00677, 2015.
|
| 203 |
+
A. Mnih and K. Kavukcuoglu. Learning word embeddings efficiently with noise-contrastive estimation. In Advances in neural information processing systems, pages 2265–2273, 2013.
|
| 204 |
+
P. Müller and D. R. Insua. Issues in bayesian analysis of neural network models. Neural Computation, 10(3): 749–770, 1998.
|
| 205 |
+
R. M. Neal. Bayesian learning for neural networks, volume 118. Springer Science & Business Media, 2012.
|
| 206 |
+
G. Pereyra, G. Tucker, J. Chorowski, Ł. Kaiser, and G. Hinton. Regularizing neural networks by penalizing confident output distributions. arXiv preprint arXiv:1701.06548, 2017.
|
| 207 |
+
J. Quiñonero-Candela and C. E. Rasmussen. A unifying view of sparse approximate gaussian process regression. Journal of Machine Learning Research, 6(Dec):1939–1959, 2005.
|
| 208 |
+
H. A. Rowley, S. Baluja, and T. Kanade. Neural network-based face detection. IIEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 1998.
|
| 209 |
+
N. Roy and A. McCallum. Toward optimal active learning through monte carlo estimation of error reduction. ICML, Williamstown, pages 441–448, 2001.
|
| 210 |
+
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, pages 748–756, 2015.
|
| 211 |
+
B. Settles. Active learning literature survey. Computer Sciences Technical Report 1648, University of Wisconsin–Madison, 2009.
|
| 212 |
+
H. S. Seung, M. Opper, and H. Sompolinsky. Query by committee. In Proceedings of the fifth annual workshop on Computational learning theory, pages 287–294. ACM, 1992.
|
| 213 |
+
K.-K. Sung. Learning and example selection for object and pattern detection. MIT A.I. Memo No. 1521, 1994.
|
| 214 |
+
I. Sutskever, O. Vinyals, and Q. V. Le. Sequence to sequence learning with neural networks. In Neural Information Processing Systems, 2014.
|
| 215 |
+
C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2818–2826, 2016.
|
| 216 |
+
S. Tong and D. Koller. Support vector machine active learning with applications to text classification. Journal of machine learning research, 2(Nov):45–66, 2001.
|
| 217 |
+
D. Tran, A. Kucukelbir, A. B. Dieng, M. Rudolph, D. Liang, and D. M. Blei. Edward: A library for probabilistic modeling, inference, and criticism. arXiv preprint arXiv:1610.09787, 2016.
|
| 218 |
+
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. arXiv preprint arXiv:1609.03499, 2016.
|
| 219 |
+
P. Vincent, H. Larochelle, Y. Bengio, and P.-A. Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pages 1096–1103. ACM, 2008.
|
| 220 |
+
K. Wang, D. Zhang, Y. Li, R. Zhang, and L. Lin. Cost-effective active learning for deep image classification. IEEE Transactions on Circuits and Systems for Video Technology, 27(12):2591–2600, 2017.
|
| 221 |
+
H. Zhang, M. Cisse, Y. N. Dauphin, and D. Lopez-Paz. mixup: Beyond empirical risk minimization. In International Conference on Learning Representations, 2018.
|
| 222 |
+
|
| 223 |
+
We showed how to apply NCP to a Bayesian neural network model that captures function uncertainty in a belief over parameters. An alternative approach to capture uncertainty is to make explicit predictions about whether an input is OOD. There is no belief over weights in this model. Figure 2b shows such a mixture model via a binary variable $o$ ,
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
\begin{array} { r l } & { o \sim \mathrm { B e r n o u l l i } ( \pi ( x , \theta ) ) } \\ & { y \sim \left\{ \begin{array} { l l } { \mathrm { N o r m a l } ( \mu ( x , \theta ) , \sigma ^ { 2 } ( x , \theta ) ) } & { \mathrm { i f } o = 0 } \\ { \mathrm { N o r m a l } ( \mu _ { y } , \sigma _ { y } ^ { 2 } ) } & { \mathrm { i f } o = 1 , } \end{array} \right. } \end{array}
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
where $p ( o = 1 \mid x )$ is the OOD probability of $x$ . If $o = 0$ (“in distribution”), the model outputs the neural network prediction. Otherwise, if $o = 1$ (“out of distribution”), the model uses a fixed output prior. The neural network weights $\theta$ are estimated using a point estimate, so we do not maintain a belief distribution over them.
|
| 230 |
+
|
| 231 |
+
The classifier prediction $p ( o \mid x , \theta )$ captures uncertainty in this model. We apply the NCP $p ( o \mid \tilde { x } , \theta ) =$ $\delta ( o = 1 | \tilde { x } , \theta )$ to this variable, which assumes noised-up inputs to be OOD. During training on the data set, $\{ x , y \}$ and $o = 0$ are observed, as training data are in-distribution by definition. Following Equation 2, the loss function is
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\begin{array} { r l } & { \mathcal { L } ( \theta ) = D _ { \mathrm { K L } } [ p _ { \mathrm { f r a i n } } ( y \mid x ) \mid | p _ { \mathrm { m o d e l } } ( y \mid x , o = 0 , \theta ) ] + D _ { \mathrm { K L } } [ p _ { \mathrm { p r i o r } } ( \tilde { o } \mid \tilde { x } ) \mid | p _ { \mathrm { m o d e l } } ( \tilde { o } \mid \tilde { x } , \theta ) ] } \\ & { \quad \quad = - \ln p ( y , o = 0 \mid x , \theta ) - \ln p ( y , o = 1 \mid \tilde { x } , \theta ) } \\ & { \quad \quad = - \ln \mathrm { N o r m a l } ( y \mid \mu ( x , \theta ) , \sigma ^ { 2 } ( x , \theta ) ) - \ln \mathrm { B e r n o u l i } ( 0 \mid \pi ( x , \theta ) ) \frac { - \ln \mathrm { B e r n o u l i } ( 1 \mid \pi ( \tilde { x } , \theta ) ) } { \mathrm { N C P l o s s } } . } \end{array}
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
Analogously to the Bayesian neural network model in Section 3, we can either set $\mu _ { y } , \sigma _ { y } ^ { 2 }$ manually or use the neural network prediction for potentially improved generalization. In our experiments, we implement the OOD classifier model using a single neural network with two output layers that parameterize the Gaussian distribution and the binary distribution.
|
| 238 |
+
|
| 239 |
+
# B BNN WITH NCP USING REVERSE KL
|
| 240 |
+
|
| 241 |
+
In Section 3, we derived the Bayes by Backprop model with NCP by adding a forward KL-divergence from the mean prior to the model mean to the loss. An alternative derivation uses the fact that the KL-divergence is invariant to parameterization to replace the reverse KL-divergence in weight space by a KL-divergence in output space,
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\begin{array} { r l } & { \mathrm { E } _ { p ( x , y ) } \big [ \ln p ( y \mid x ) \big ] = \mathrm { E } _ { p ( x , y ) } \Big [ \ln \displaystyle \int p ( y \mid x , \theta ) p ( \theta ) \frac { q ( \theta ) } { q ( \theta ) } d \theta \Big ] } \\ & { \qquad \quad \ge \mathrm { E } _ { p ( x , y ) } \Big [ \int q ( \theta ) \ln p ( y \mid x , \theta ) \frac { p ( \theta ) } { q ( \theta ) } d \theta \Big ] } \\ & { \qquad = \mathrm { E } _ { p ( x , y ) } \big [ \mathrm { E } _ { q ( \theta ) } [ \ln p ( y \mid x , \theta ) ] - D _ { \mathrm { K L } } [ q ( \theta ) \mid p ( \theta ) ] \big ] } \\ & { \qquad = \mathrm { E } _ { p ( x , y ) } \big [ \mathrm { E } _ { q ( \theta ) } [ \ln p ( y \mid x , \theta ) ] - \mathrm { E } _ { p ( \tilde { x } \mid x ) } [ D _ { \mathrm { K L } } [ q ( \theta ) \mid \mid p ( \theta ) ] ] \big ] } \\ & { \qquad \approx \mathrm { E } _ { p ( x , y ) } \big [ \mathrm { E } _ { q ( \theta ) } [ \ln p ( y \mid x , \theta ) ] - \mathrm { E } _ { p ( \tilde { x } \mid x ) } [ D _ { \mathrm { K L } } [ q ( \mu ( \tilde { x } ) ) \mid \mid p ( \mu ( \tilde { x } ) \mid x ) ] ] \big ] , } \end{array}
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
where $\begin{array} { r } { p ( \mu ( \tilde { x } ) ) = \int \mu ( \tilde { x } , \theta ) p ( \theta ) d \theta } \end{array}$ and $\begin{array} { r } { q ( \mu ( \tilde { x } ) ) = \int \mu ( \tilde { x } , \theta ) q ( \theta ) d \theta } \end{array}$ are the distributions of the predicted mean induces by the weight beliefs. As a result, instead of specifying a prior in weight space, we can specify a prior in output space.
|
| 248 |
+
|
| 249 |
+
Above, we reparameteterized the $\mathrm { K L }$ in weight space as a KL in output space; by the change of variables, this is equivalent if the mapping $\mu ( \cdot , \theta )$ is continuous and 1-1 with respect to $\theta$ . This assumption does not hold for neural nets as multiple parameter vectors can lead to the same predictive distribution, thus the approximation above. A compact reparameterization of the neural network (equivalence class of parameteters) would make this an equality.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
C ROBUSTNESS EXPERIMENT ON TOY DATASET
|
| 253 |
+
Figure 6: Robustness to different noise patterns. Plots show the final test performance on the low-dimensional active learning task (mean and stddev over 5 seeds). Lower is better. The baseline performances are RMSE: BBB $( 0 . 7 5 \pm 0 . 3 1 )$ , Det $( 1 . 4 6 \pm 0 . 6 4 )$ and NLPD: BBB $( 1 0 . 2 9 \pm 8 . 0 5 )$ , Det $( 1 . 3 \times 1 0 ^ { 8 } \pm 1 . 7 \times 1 0 ^ { 8 } )$ ). NCP works with both Gaussian and uniform input noise $\epsilon$ and is robust to $\sigma _ { x } ^ { 2 }$ .
|
| 254 |
+
|
| 255 |
+
# D RELATED ACTIVE LEARNING WORK
|
| 256 |
+
|
| 257 |
+
Active learning is often employed in domains where data is cheap but labeling is expensive, and is motivated by the idea that not all data points are equally valuable when it comes to learning (Settles, 2009; Dasgupta, 2004). Active learning techniques can be coarsely grouped into three categories. Ensemble methods (Seung et al., 1992; McCallumzy and Nigamy, 1998; Freund et al., 1997) generate queries that have the greatest disagreement between a set of classifiers. Error reduction approaches incorporate the select data based on the predicted reduction in classifier error based on information (MacKay, 1992a), Monte Carlo estimation (Roy and McCallum, 2001), or hard-negative example mining (Sung, 1994; Rowley et al., 1998).
|
| 258 |
+
|
| 259 |
+
Uncertainty-based techniques select samples for which the classifier is most uncertain. Approaches include maximum entropy (Joshi et al., 2009), distance from the decision boundary (Tong and Koller, 2001), pseudo labelling high confidence examples (Wang et al., 2017), and mixtures of information density and uncertainty measures (Li and Guo, 2013). Within this category, the area most related to our work are Bayesian methods. Kapoor et al. (2007) estimate expected improvement using a Gaussian process. Other approaches use classifier confidence (Lewis and Gale, 1994), predicted expected error (Roy and McCallum, 2001), or model disagreement (Houlsby et al., 2011). Recently, Gal et al. (2017) applied a convolutional neural network with dropout uncertainty to images.
|
md/train/Jnspzp-oIZE/Jnspzp-oIZE.md
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GAUGE EQUIVARIANT MESH CNNS ANISOTROPIC CONVOLUTIONS ON GEOMETRIC GRAPHS
|
| 2 |
+
|
| 3 |
+
Pim de Haan∗ Qualcomm AI Research† University of Amsterdam
|
| 4 |
+
|
| 5 |
+
Taco Cohen Qualcomm AI Research
|
| 6 |
+
|
| 7 |
+
Maurice Weiler∗ QUVA Lab University of Amsterdam
|
| 8 |
+
|
| 9 |
+
Max Welling Qualcomm AI Research University of Amsterdam
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
A common approach to define convolutions on meshes is to interpret them as a graph and apply graph convolutional networks (GCNs). Such GCNs utilize isotropic kernels and are therefore insensitive to the relative orientation of vertices and thus to the geometry of the mesh as a whole. We propose Gauge Equivariant Mesh CNNs which generalize GCNs to apply anisotropic gauge equivariant kernels. Since the resulting features carry orientation information, we introduce a geometric message passing scheme defined by parallel transporting features over mesh edges. Our experiments validate the significantly improved expressivity of the proposed model over conventional GCNs and other methods.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Convolutional neural networks (CNNs) have been established as the default method for many machine learning tasks like speech recognition or planar and volumetric image classification and segmentation. Most CNNs are restricted to flat or spherical geometries, where convolutions are easily defined and optimized implementations are available. The empirical success of CNNs on such spaces has generated interest to generalize convolutions to more general spaces like graphs or Riemannian manifolds, creating a field now known as geometric deep learning (Bronstein et al., 2017).
|
| 18 |
+
|
| 19 |
+
A case of specific interest is convolution on meshes, the discrete analog of 2-dimensional embedded Riemannian manifolds. Mesh CNNs can be applied to tasks such as detecting shapes, registering different poses of the same shape and shape segmentation. If we forget the positions of vertices, and which vertices form faces, a mesh $M$ can be represented by a graph $\mathcal { G }$ . This allows for the application of graph convolutional networks (GCNs) to processing signals on meshes.
|
| 20 |
+
|
| 21 |
+
Figure 1: Two local neighbourhoods around vertices $p$ and their representations in the tangent planes $T _ { p } M$ . The distinct geometry of the neighbourhoods is reflected in the different angles $\theta _ { p q _ { i } }$ of incident edges from neighbours $q _ { i }$ . Graph convolutional networks apply isotropic kernels and can therefore not distinguish both neighbourhoods. Gauge Equivariant Mesh CNNs apply anisotropic kernels and are therefore sensitive to orientations. The arbitrariness of reference orientations, determined by a choice of neighbour $q _ { 0 }$ , is accounted for by the gauge equivariance of the model.
|
| 22 |
+
|
| 23 |
+
However, when representing a mesh by a graph, we lose important geometrical information. In particular, in a graph there is no notion of angle between or ordering of two of a node’s incident edges (see figure 1). Hence, a GCNs output at a node $p$ is designed to be independent of relative angles and invariant to any permutation of its neighbours $q _ { i } \in \bar { \mathcal { N } } ( p )$ . A graph convolution on a mesh graph therefore corresponds to applying an isotropic convolution kernel. Isotropic filters are insensitive to the orientation of input patterns, so their features are strictly less expressive than those of orientation aware anisotropic filters.
|
| 24 |
+
|
| 25 |
+
To address this limitation of graph networks we propose Gauge Equivariant Mesh CNNs (GEM-CNN), which minimally modify GCNs such that they are able to use anisotropic filters while sharing weights across different positions and respecting the local geometry. One obstacle in sharing anisotropic kernels, which are functions of the angle $\theta _ { p q }$ of neighbour $q$ with respect to vertex $p$ , over multiple vertices of a mesh is that there is no unique way of selecting a reference neighbour $q _ { 0 }$ , which has the direction $\theta _ { p q _ { 0 } } = 0$ . The reference neighbour, and hence the orientation of the neighbours, needs to be chosen arbitrarily. In order to guarantee the equivalence of the features resulting from different choices of orientations, we adapt Gauge Equivariant CNNs (Cohen et al., 2019b) to general meshes. The kernels of our model are thus designed to be equivariant under gauge transformations, that is, to guarantee that the responses for different kernel orientations are related by a prespecified transformation law. Such features are identified as geometric objects like scalars, vectors, tensors, etc., depending on the specific choice of transformation law. In order to compare such geometric features at neighbouring vertices, they need to be parallel transported along the connecting edge.
|
| 26 |
+
|
| 27 |
+
In our implementation we first specify the transformation laws of the feature spaces and compute a space of gauge equivariant kernels. Then we pick arbitrary reference orientations at each node, relative to which we compute neighbour orientations and compute the corresponding edge transporters. Given these quantities, we define the forward pass as a message passing step via edge transporters followed by a contraction with the equivariant kernels evaluated at the neighbour orientations. Algorithmically, Gauge Equivariant Mesh CNNs are therefore just GCNs with anisotropic, gauge equivariant kernels and message passing via parallel transporters. Conventional GCNs are covered in this framework for the specific choice of isotropic kernels and trivial edge transporters, given by identity maps.
|
| 28 |
+
|
| 29 |
+
In Sec. 2, we will give an outline of our method, deferring details to Secs. 3 and 4. In Sec. 3.2, we describe how to compute general geometric quantities, not specific to our method, used for the computation of the convolution. In our experiments in Sec. 6.1, we find that the enhanced expressiveness of Gauge Equivariant Mesh CNNs enables them to outperform conventional GCNs and other prior work in a shape correspondence task.
|
| 30 |
+
|
| 31 |
+
# 2 CONVOLUTIONS ON GRAPHS WITH GEOMETRY
|
| 32 |
+
|
| 33 |
+
We consider the problem of processing signals on discrete 2-dimensional manifolds, or meshes $M$ . Such meshes are described by a set $\nu$ of vertices in $\mathbb { R } ^ { 3 }$ together with a set $\mathcal { F }$ of tuples, each consisting of the vertices at the corners of a face. For a mesh to describe a proper manifold, each edge needs to be connected to two faces, and the neighbourhood of each vertex needs to be homeomorphic to a disk. Mesh $M$ induces a graph $\mathcal { G }$ by forgetting the coordinates of the vertices while preserving the edges.
|
| 34 |
+
|
| 35 |
+
A conventional graph convolution between kernel $K$ and signal $f$ , evaluated at a vertex $p$ , can be defined by
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
( K \star f ) _ { p } = K _ { \mathrm { s e l f } } f _ { p } + \sum _ { q \in { \mathcal N } _ { p } } K _ { \mathrm { n e i g h } } f _ { q } ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\mathcal { N } _ { p }$ is the set of neighbours of $p$ in $\mathcal { G }$ , and $K _ { \mathrm { s e l f } } \in \mathbb { R } ^ { C _ { \mathrm { i n } } \times C _ { \mathrm { o u t } } }$ and $K _ { \mathrm { n e i g h } } \in \mathbb { R } ^ { C _ { \mathrm { i n } } \times C _ { \mathrm { o u t } } }$ are two linear maps which model a self interaction and the neighbour contribution, respectively. Importantly, graph convolution does not distinguish different neighbours, because each feature vector $f _ { q }$ is multiplied by the same matrix $K _ { \mathrm { n e i g h } }$ and then summed. For this reason we say the kernel is isotropic.
|
| 42 |
+
|
| 43 |
+
Consider the example in figure 1, where on the left and right, the neighbourhood of one vertex $p$ containing neighbours $q \in \mathcal { N } _ { p }$ , is visualized. An isotropic kernel would propagate the signal from the neighbours to $p$ in exactly the same way in both neighbourhoods, even though the neighbourhoods are geometrically distinct. For this reason, our method uses direction sensitive (anisotropic) kernels instead of isotropic kernels. Anisotropic kernels are inherently more expressive than isotropic ones which is why they are used universally in conventional planar CNNs.
|
| 44 |
+
|
| 45 |
+
# Algorithm 1 Gauge Equivariant Mesh CNN layer
|
| 46 |
+
|
| 47 |
+
<table><tr><td>Input: mesh M,input/output feature types pin, pout,reference neighbours (q ∈ Np)p∈M.</td><td> Sec.3</td></tr><tr><td>Compute basis kernels K'ef, Kneigh (0) Initialise weights wself and wneigh·</td><td></td></tr><tr><td>For each neighbour pair,p ∈ M,q ∈Np:</td><td> App. A.</td></tr><tr><td>compute neighbor angles θpq relative to reference neighbor</td><td></td></tr><tr><td>compute parallel transporters gq→p</td><td></td></tr><tr><td>Forward(input features (fp)p∈M, weights wself,wneigh):</td><td></td></tr><tr><td>f←∑iwselfKselffp+∑i,q∈NpwneighKneigh(0pq)Pin(gq→p)fq</td><td></td></tr></table>
|
| 48 |
+
|
| 49 |
+
We propose the Gauge Equivariant Mesh Convolution, a minimal modification of graph convolution that allows for anisotropic kernels $K ( \theta )$ whose value depends on an orientation $\theta \in [ 0 , 2 \pi )$ . 1 To define the orientations $\theta _ { p q }$ of neighbouring vertices $q \in \mathcal { N } _ { p }$ of $p$ , we first map them to the tangent plane $T _ { p } M$ at $p$ , as visualized in figure 1. We then pick an arbitrary reference neighbour $q _ { 0 } ^ { \bar { p } }$ to determine a reference orientation2 $\theta _ { p q _ { 0 } ^ { p } } : = 0$ , marked orange in figure 1. This induces a basis on the tangent plane, which, when expressed in polar coordinates, defines the angles $\theta _ { p q }$ of the other neighbours.
|
| 50 |
+
|
| 51 |
+
As we will motivate in the next section, features in a Gauge Equivariant CNN are coefficients of geometric quantities. For example, a tangent vector at vertex $p$ can be described either geometrically by a 3 dimensional vector orthogonal to the normal at $p$ or by two coefficients in the basis on the tangent plane. In order to perform convolution, geometric features at different vertices need to be linearly combined, for which it is required to first “parallel transport” the features to the same vertex. This is done by applying a matrix $\rho ( \mathsf { \bar { g } } _ { q \to p } ) \in \mathbb { R } ^ { C _ { \mathrm { i n } } \times C _ { \mathrm { i n } } }$ to the coefficients of the feature at $q$ , in order to obtain the coefficients of the feature vector transported to $p$ , which can be used for the convolution at $p$ . The transporter depends on the geometric type (group representation) of the feature, denoted by $\rho$ and described in more detail below. Details of how the tangent space is defined, how to compute the map to the tangent space, angles $\theta _ { p q }$ , and the parallel transporter are given in Appendix A.
|
| 52 |
+
|
| 53 |
+
In combination, this leads to the GEM-CNN convolution
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
( K \star f ) _ { p } ~ = ~ K _ { \mathrm { s e l f } } f _ { p } + \sum _ { q \in { \cal N } _ { p } } K _ { \mathrm { n e i g h } } ( \theta _ { p q } ) \rho ( g _ { q \to p } ) f _ { q }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
which differs from the conventional graph convolution, defined in Eq. 1 only by the use of an anisotropic kernel and the parallel transport message passing.
|
| 60 |
+
|
| 61 |
+
We require the outcome of the convolution to be equivalent for any choice of reference orientation. This is not the case for any anisotropic kernel but only for those which are equivariant under changes of reference orientations (gauge transformations). Equivariance imposes a linear constraint on the kernels. We therefore solve for complete sets of “basis-kernels” $\dot { K } _ { \mathrm { s e l f } } ^ { i }$ and $K _ { \mathrm { n e i g h } } ^ { i }$ satisfying this constraint and linearly combine them with parameters $w _ { \mathrm { s e l f } } ^ { i }$ and $w _ { \mathrm { n e i g h } } ^ { i }$ such that $\begin{array} { r } { K _ { \mathrm { s e l f } } = \sum _ { i } w _ { \mathrm { s e l f } } ^ { i } K _ { \mathrm { s e l f } } ^ { i } } \end{array}$ and $\begin{array} { r } { K _ { \mathrm { n e i g h } } = \sum _ { i } w _ { \mathrm { n e i g h } } ^ { i } K _ { \mathrm { n e i g h } } ^ { i } } \end{array}$ . Details on the computation of basis kernels are given in section 3. The full algorithm for initialisation and forward pass, which is of time and space complexity linear in the number of vertices, for a GEM-CNN layer are listed in algorithm 1. Gradients can be computed by automatic differentiation.
|
| 62 |
+
|
| 63 |
+
The GEM-CNN is gauge equivariant, but furthermore satisfies two important properties. Firstly, it depends only on the intrinsic shape of the 2D mesh, not on the embedding of the mesh in $\mathbb { R } ^ { \bar { 3 } }$ . Secondly, whenever a map from the mesh to itself exists that preserves distances and orientation, the convolution is equivariant to moving the signal along such transformations. These properties are proven in Appendix D and empirically shown in Appendix F.2.
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 2: Visualization of the Gauge Equivariant Mesh Convolution in two configurations, scalar to scalar and scalar to vector. The convolution operates in a gauge, so that vectors are expressed in coefficients in a basis and neighbours have polar coordinates, but can also be seen as a geometric convolution, a gauge-independent map from an input signal on the mesh to a output signal on the mesh. The convolution is equivariant if this geometric convolution does not depend on the intermediate chosen gauge, so if the diagram commutes.
|
| 67 |
+
|
| 68 |
+
# 3 GAUGE EQUIVARIANCE & GEOMETRIC FEATURES
|
| 69 |
+
|
| 70 |
+
On a general mesh, the choice of the reference neighbour, or gauge, which defines the orientation of the kernel, can only be made arbitrarily. However, this choice should not arbitrarily affect the outcome of the convolution, as this would impede the generalization between different locations and different meshes. Instead, Gauge Equivariant Mesh CNNs have the property that their output transforms according to a known rule as the gauge changes.
|
| 71 |
+
|
| 72 |
+
Consider the left hand side of figure 2(a). Given a neighbourhood of vertex $p$ , we want to express each neighbour $q$ in terms of its polar coordinates $( r _ { q } , \theta _ { q } )$ on the tangent plane, so that the kernel value at that neighbour $K _ { \mathrm { n e i g h } } ( \bar { \theta _ { q } } )$ is well defined. This requires choosing a basis on the tangent plane, determined by picking a neighbour as reference neighbour (denoted $q _ { 0 . }$ ), which has the zero angle $\theta _ { q _ { 0 } } = 0$ . In the top path, we pick $q _ { A }$ as reference neighbour. Let us call this gauge A, in which neighbours have angles $\theta _ { q } ^ { A }$ . In the bottom path, we instead pick neighbour $q _ { B }$ as reference point and are in gauge B. We get a different basis for the tangent plane and different angles $\underset { . } { \theta _ { q } ^ { B } }$ for each neighbour. Comparing the two gauges, we see that they are related by a rotation, so that $\theta _ { q } ^ { B } = \theta _ { q } ^ { A } - \mathsf { \bar { \theta } } _ { q B } ^ { A }$ . This change of gauge is called a gauge transformation of angle $g : = \theta _ { q _ { B } } ^ { A }$ .
|
| 73 |
+
|
| 74 |
+
In figure 2(a), we illustrate a gauge equivariant convolution that takes input and output features such as gray scale image values on the mesh, which are called scalar features. The top path represents the convolution in gauge A, the bottom path in gauge B. In either case, the convolution can be interpreted as consisting of three steps. First, for each vertex $p$ , the value of the scalar features on the mesh at each neighbouring vertex $q$ , represented by colors, is mapped to the tangent plane at $p$ at angle $\theta _ { q }$ defined by the gauge. Subsequently, the convolutional kernel sums for each neighbour $q$ , the product of the feature at $q$ and kernel $K ( \theta _ { q } )$ . Finally the output is mapped back to the mesh. These three steps can be composed into a single step, which we could call a geometric convolution, mapping from input features on the mesh to output features on the mesh. The convolution is gauge equivariant if this geometric convolution does not depend on the gauge we pick in the interim, so in figure 2(a), if the convolution in the top path in gauge A has same result the convolution in the bottom path in gauge B, making the diagram commute. In this case, however, we see that the convolution output needs to be the same in both gauges, for the convolution to be equivariant. Hence, we must have that $K ( \theta _ { q } ) = K ( \theta _ { q } - g )$ , as the orientations of the neighbours differ by some angle $g$ , and the kernel must be isotropic.
|
| 75 |
+
|
| 76 |
+
As we aim to design an anisotropic convolution, the output feature of the convolution at $p$ can, instead of a scalar, be two numbers $v \in \mathbb { R } ^ { 2 }$ , which can be interpreted as coefficients of a tangent feature vector in the tangent space at $p$ , visualized in figure 2(b). As shown on the right hand side, different gauges induce a different basis of the tangent plane, so that the same tangent vector (shown on the middle right on the mesh), is represented by different coefficients in the gauge (shown on the top and bottom on the right). This gauge equivariant convolution must be anisotropic: going from the top row to the bottom row, if we change orientations of the neighbours by $- g$ , the coefficients of the output vector $v \in \mathbb { R } ^ { 2 }$ of the kernel must be also rotated by $- g$ . This is written as $R ( - g ) v$ , where $R ( - g ) \in \mathbb { R } ^ { 2 \times 2 }$ is the matrix that rotates by angle $- g$ .
|
| 77 |
+
|
| 78 |
+
Vectors and scalars are not the only type of geometric features that can be inputs and outputs of a GEM-CNN layer. In general, the coefficients of a geometric feature of $C$ dimensions changes by an invertible linear transformation $\rho ( - g ) \in \mathbb { R } ^ { C \times C }$ if the gauge is rotated by angle $g$ . The map $\begin{array} { r } { \dot { \rho ^ { \smash { \sum } } } : [ 0 , 2 \pi ) \to \mathbb { R } ^ { C \times C } } \end{array}$ is called the type of the geometric quantity and is formally known as a group representation of the planar rotation group SO(2). Group representations have the property that $\bar { \rho ( g + h ) } = \rho ( g ) \rho ( h )$ (they are group homomorphisms), which implies in particular that $\dot { \rho } ( 0 ) = \mathbb { 1 }$ and $\rho ( - g ) = \rho ( g ) ^ { - 1 }$ . For more background on group representation theory, we refer the reader to (Serre, 1977) and, specifically in the context of equivariant deep learning, to (Lang & Weiler, 2020). From the theory of group representations, we know that any feature type can be composed from “irreducible representations” (irreps). For SO(2), these are the one dimensional invariant scalar representation $\rho _ { 0 }$ and for all $n \in { \mathbb { N } } _ { > 0 }$ , a two dimensional representation $\rho _ { n }$ ,
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\rho _ { 0 } ( g ) = 1 , \quad \rho _ { n } ( g ) = \binom { \cos n g } { \sin n g } \quad \sp { - \sin n g } \nonumber \cos n g \biggr ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where we write, for example, $\rho = \rho _ { 0 } \oplus \rho _ { 1 } \oplus \rho _ { 1 }$ to denote that representation $\rho ( g )$ is the direct sum (i.e. block-diagonal stacking) of the matrices $\dot { \rho } _ { 0 } ( g ) , \rho _ { 1 } ( g ) , \rho _ { 1 } ( g )$ . Scalars and tangent vector features correspond to $\rho _ { 0 }$ and $\rho _ { 1 }$ respectively and we have $R ( g ) = \rho _ { 1 } ( g )$ .
|
| 85 |
+
|
| 86 |
+
The type of the feature at each layer in the network can thus be fully specified (up to a change of basis) by the number of copies of each irrep. Similar to the dimensionality in a conventional CNN, the choice of type is a hyperparameter that can be freely chosen to optimize performance.
|
| 87 |
+
|
| 88 |
+
# 3.1 KERNEL CONSTRAINT
|
| 89 |
+
|
| 90 |
+
Given an input type $\rho _ { \mathrm { i n } }$ and output type $\rho _ { \mathrm { o u t } }$ of dimensions $C _ { \mathrm { i n } }$ and $C _ { \mathrm { { o u t } } }$ , the kernels are $K _ { \mathrm { s e l f } } ~ \in$ $\mathbb { R } ^ { C _ { \mathrm { o u t } } \times C _ { \mathrm { i n } } }$ and $K _ { \mathrm { n e i g h } } : [ 0 , 2 \pi ) ] \mathbb { R } ^ { C _ { \mathrm { o u t } } \times C _ { \mathrm { i n } } }$ . However, not all such kernels are equivariant. Consider again examples figure 2(a) and figure 2(b). If we map from a scalar to a scalar, we get that $K _ { \mathrm { n e i g h } } ( \theta -$ $\bar { g ) } = K _ { \mathrm { n e i g h } } \bar { ( \theta ) }$ for all angles $\theta , g$ and the convolution is isotropic. If we map from a scalar to a vector, we get that rotating the angles $\theta _ { q }$ results in the same tangent vector as rotating the output vector coefficients, so that $K _ { \mathrm { n e i g h } } ( \theta - g ) { \dot { = } } R ( - g ) K _ { \mathrm { n e i g h } } ( \theta )$ .
|
| 91 |
+
|
| 92 |
+
In general, as derived by Cohen et al. (2019b) and in appendix B, the kernels must satisfy for any gauge transformation $g \in [ 0 , 2 \pi )$ and angle $\theta \in [ 0 , 2 \pi )$ , that
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { K _ { \mathrm { n e i g h } } ( \theta - g ) = \rho _ { \mathrm { o u t } } ( - g ) K _ { \mathrm { n e i g h } } ( \theta ) \rho _ { \mathrm { i n } } ( g ) , } \\ { K _ { \mathrm { s e l f } } = \rho _ { \mathrm { o u t } } ( - g ) \ K _ { \mathrm { s e l f } } \ \rho _ { \mathrm { i n } } ( g ) . \qquad } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
The kernel can be seen as consisting of multiple blocks, where each block takes as input one irrep and outputs one irrep. For example if $\rho _ { \mathrm { i n } }$ would be of type $\rho _ { 0 } \oplus \rho _ { 1 } \oplus \rho _ { 1 }$ and $\rho _ { \mathrm { o u t } }$ of type $\rho _ { 1 } \oplus \rho _ { 3 }$ , we have $4 \times 5$ matrix
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
K _ { \mathrm { n e i g h } } ( \theta ) = { \binom { K _ { 1 0 } ( \theta ) } { K _ { 3 0 } ( \theta ) } } K _ { 1 1 } ( \theta ) K _ { 1 1 } ( \theta ) \Big )
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Table 1: Solutions to the angular kernel constraint for kernels that map from $\rho _ { n }$ to $\rho _ { m }$ . We denote $c _ { \pm } = \cos ( ( m \pm n ) \theta )$ and $s _ { \pm } = \sin ( ( m \pm n ) \theta )$ .
|
| 105 |
+
|
| 106 |
+
<table><tr><td>pin→pout</td><td>linearly independent solutions for Kneigh (0)</td></tr><tr><td>p→po</td><td>(1)</td></tr><tr><td>pn→po</td><td>(cos nθ sin nθ),(sin nθ -cos n0)</td></tr><tr><td>po→pm</td><td>(cos mθ) sin m) (sinmθ) , (-cosm0)</td></tr><tr><td>pn→pm</td><td>(c- -s_ S_ C_ (C+ S+ -S+ C+ s_ c_ -c S- S+ -C+) , c+s+)</td></tr><tr><td>pin→pout</td><td>linearly independent solutions for Kself</td></tr><tr><td>p→po</td><td>(1)</td></tr><tr><td>pn→pn</td><td>(61). (-1)</td></tr></table>
|
| 107 |
+
|
| 108 |
+
where e.g. $K _ { 3 1 } ( \theta ) \in \mathbb { R } ^ { 2 \times 2 }$ is a kernel that takes as input irrep $\rho _ { 1 }$ and as output irrep $\rho _ { 3 }$ and needs to satisfy Eq. 3. As derived by Weiler & Cesa (2019) and in Appendix C, the kernels $K _ { \mathrm { n e i g h } } ( \theta )$ and $K _ { \mathrm { s e l f } }$ mapping from irrep $\rho _ { n }$ to irrep $\rho _ { m }$ can be written as a linear combination of the basis kernels listed in Table 1. The table shows that equivariance requires the self-interaction to only map from one irrep to the same irrep. Hence, we have $K _ { \mathrm { s e l f } } = \left( \begin{array} { c c c } { 0 } & { K _ { 1 1 } } & { K _ { 1 1 } } \\ { 0 } & { 0 } & { 0 } \end{array} \right) \in \mathbb { R } ^ { 4 \times 3 } .$
|
| 109 |
+
|
| 110 |
+
All basis-kernels of all pairs of input irreps and output irreps can be linearly combined to form an arbitrary equivariant kernel from feature of type $\rho _ { \mathrm { i n } }$ to $\rho _ { \mathrm { o u t } }$ . In the above example, we have $2 \times 2 + 4 \times 4 = 2 0$ basis kernels for $K _ { \mathrm { n e i g h } }$ and 4 basis kernels for $K _ { \mathrm { s e l f } }$ . The layer thus has 24 parameters. As proven in (Weiler & Cesa, 2019) and (Lang & Weiler, 2020), this parameterization of the equivariant kernel space is complete, that is, more general equivariant kernels do not exist.
|
| 111 |
+
|
| 112 |
+
# 3.2 GEOMETRY AND PARALLEL TRANSPORT
|
| 113 |
+
|
| 114 |
+
In order to implement gauge equivariant mesh CNNs, we need to make the abstract notion of tangent spaces, gauges and transporters concrete.
|
| 115 |
+
|
| 116 |
+
As the mesh is embedded in $\mathbb { R } ^ { 3 }$ , a natural definition of the tangent spaces $T _ { p } M$ is as two dimensional subspaces that are orthogonal to the normal vector at $p$ . We follow the common definition of normal vectors at mesh vertices as the area weighted average of the adjacent faces’ normals. The Riemannian logarithm map $\log _ { p } : \mathcal { N } _ { p } \to T _ { p } M$ represents the one-ring neighborhood of each point $p$ on their tangent spaces as visualized in figure 1. Specifically, neighbors $q \in \mathcal { N } _ { p }$ are mapped to $\bar { \log _ { p } ( q ) } \in T _ { p } \bar { M }$ by first projecting them to $T _ { p } M$ and then rescaling the projection such that the norm is preserved, i.e. $| \log _ { p } ( q ) | = | q - p |$ ; see Eq. 6. A choice of reference neighbor $q _ { p } \in \mathcal { N }$ uniquely determines a right handed, orthonormal reference frame $( e _ { p , 1 } , e _ { p , 2 } )$ of $T _ { p } M$ by setting $e _ { p , 1 } : = \log _ { p } ( q _ { 0 } ) / | \log _ { p } ( q _ { 0 } ) |$ and $e _ { p , 2 } : = n \times e _ { p , 1 }$ . The polar angle $\theta _ { p q }$ of any neighbor $q \in \mathcal N$ relative to the first frame axis is then given by $\theta _ { p q } : = \mathrm { a t a n 2 } \left( e _ { p , 2 } ^ { \top } \log _ { p } ( q ) , e _ { p , 1 } ^ { \top } \log _ { p } ( q ) \right) )$ .
|
| 117 |
+
|
| 118 |
+
Given the reference frame $( e _ { p , 1 } , e _ { p , 2 } )$ , a 2-tuple of coefficients $( v _ { 1 } , v _ { 2 } ) \in \mathbb { R } ^ { 2 }$ specifies an (embedded) tangent vector $v _ { 1 } e _ { p , 1 } + v _ { 2 } e _ { p , 2 } \in T _ { p } M \subset \mathbb { R } ^ { 3 }$ . This assignment is formally given by the gauge map $E _ { p } : \mathbb { R } ^ { 2 } \to T _ { p } M \overset { \cdot } { \subset } \mathbb { R } ^ { 3 }$ which is a vector space isomorphism. In our case, it can be identified with the matrix
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r } { \boldsymbol { E _ { p } } = \left[ \begin{array} { c c } { \boldsymbol { \vert } } & { \boldsymbol { \vert } } \\ { \boldsymbol { e _ { p , 1 } } } & { \boldsymbol { e _ { p , 2 } } } \\ { \boldsymbol { \vert } } & { \boldsymbol { \vert } } \end{array} \right] \in \mathbb { R } ^ { 3 \times 2 } . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Feature vectors $f _ { p }$ and $f _ { q }$ at neighboring (or any other) vertices $p \in M$ and $q \in \mathcal { N } _ { p } \subseteq M$ live in different vector spaces and are expressed relative to independent gauges, which makes it invalid to sum them directly. Instead, they have to be parallel transported along the mesh edge that connects the two vertices. As explained above, this transport is given by group elements $\mathsf { \bar { g } } _ { q \to p } \in [ 0 , 2 \pi )$ , which determine the transformation of tangent vector coefficients as $v _ { q } \mapsto R ( g _ { q p } ) v _ { q } \in \mathbb { R } ^ { 2 }$ and, analogously, for feature vector coefficients as $f _ { q } \mapsto \rho ( g _ { q p } ) f _ { q }$ . Figure 4 in the appendix visualizes the definition of edge transporters for flat spaces and meshes. On a flat space, tangent vectors are transported by keeping them parallel in the usual sense on Euclidean spaces. However, if the source and target frame orientations disagree, the vector coefficients relative to the source frame need to be transformed to the target frame. This coordinate transformation from polar angles $\varphi _ { q }$ of $v$ to $\varphi _ { p }$ of $R ( g _ { q p } ) v$ defines the transporter $g _ { q p } = \varphi _ { p } - \varphi _ { q }$ . On meshes, the source and target tangent spaces $T _ { q } M$ and $T _ { p } M$ are not longer parallel. It is therefore additionally necessary to rotate the source tangent space and its vectors parallel to the target space, before transforming between the frames. Since transporters effectively make up for differences in the source and target frames, the parallel transporters transform under gauge transformations $g _ { p }$ and $g _ { q }$ according to $g _ { q \to p } \mapsto g _ { p } + g _ { q \to p } - g _ { q }$ . Note that this transformation law cancels with the transformation law of the coefficients at $q$ and lets the transported coefficients transform according to gauge transformations at $p$ . It is therefore valid to sum vectors and features that are parallel transported into the same gauge at $p$ .
|
| 125 |
+
|
| 126 |
+
A more detailed discussion of the concepts presented in this section can be found in Appendix A.
|
| 127 |
+
|
| 128 |
+
# 4 NON-LINEARITY
|
| 129 |
+
|
| 130 |
+
Besides convolutional layers, the GEM-CNN contains non-linear layers, which also need to be gauge equivariant, for the entire network to be gauge equivariant. The coefficients of features built out of irreducible representaions, as described in section 3, do not commute with point-wise nonlinearities (Worrall et al., 2017; Thomas et al., 2018; Weiler et al., 2018a; Kondor et al., 2018). Norm non-linearities and gated non-linearities (Weiler & Cesa, 2019) can be used with such features, but generally perform worse in practice compared to point-wise non-linearities (Weiler & Cesa,
|
| 131 |
+
|
| 132 |
+
2019). Hence, we propose the RegularNonlinearity, which uses point-wise non-linearities and is approximately gauge equivariant.
|
| 133 |
+
|
| 134 |
+
This non-linearity is built on Fourier transformations. Consider a continuous periodic signal, on which we perform a band-limited Fourier transform with band limit $b$ , obtaining $2 b + 1$ Fourier coefficients. If this continuous signal is shifted by an arbitrary angle $g$ , then the corresponding Fourier components transform with linear transformation $\rho _ { 0 : b } ( - g )$ , for $2 b + 1$ dimensional representation $\rho _ { 0 : b } : = \rho _ { 0 } \oplus \rho _ { 1 } \oplus \ldots \oplus \rho _ { b }$ .
|
| 135 |
+
|
| 136 |
+
It would be exactly equivariant to take a feature of type $\rho _ { 0 : b }$ , take a continuous inverse Fourier transform to a continuous periodic signal, then apply a point-wise non-linearity to that signal, and take the continuous Fourier transform, to recover a feature of type $\rho _ { 0 : b }$ . However, for implementation, we use $N$ intermediate samples and the discrete Fourier transform. This is exactly gauge equivariant for gauge transformation of angles multiple of $2 \pi / N$ , but only approximately equivariant for other angles. In App. G we prove that as $N \to \infty$ , the non-linearity is exactly gauge equivariant.
|
| 137 |
+
|
| 138 |
+
The run-time cost per vertex of the (inverse) Fourier transform implemented as a simple linear transformation is $\mathcal { O } ( b N )$ , which is what we use in our experiments. The pointwise non-linearity scales linearly with $N$ , so the complexity of the RegularNonLineariy is also $\mathcal { O } ( b N )$ . However, one can also use a fast Fourier transform, achieving a complexity of $\mathcal { O } ( N \log N )$ . Concrete memory and run-time cost of varying $N$ are shown in appendix F.1.
|
| 139 |
+
|
| 140 |
+
# 5 RELATED WORK
|
| 141 |
+
|
| 142 |
+
The irregular structure of meshes leads to a variety of approaches to define convolutions. Closely related to our method are graph based methods which are often based on variations of graph convolutional networks (Kipf & Welling, 2017; Defferrard et al., 2016). GCNs have been applied on spherical meshes (Perraudin et al., 2019) and cortical surfaces (Cucurull et al., 2018; Zhao et al., 2019a). Verma et al. (2018) augment GCNs with anisotropic kernels which are dynamically computed via an attention mechanism over graph neighbours.
|
| 143 |
+
|
| 144 |
+
Instead of operating on the graph underlying a mesh, several approaches leverage its geometry by treating it as a discrete manifold. Convolution kernels can then be defined in geodesic polar coordinates which corresponds to a projection of kernels from the tangent space to the mesh via the exponential map. This allows for kernels that are larger than the immediate graph neighbourhood and message passing over faces but does not resolve the issue of ambiguous kernel orientation. Masci et al. (2015); Monti et al. (2016) and Sun et al. (2018) address this issue by restricting the network to orientation invariant features which are computed by applying anisotropic kernels in several orientations and pooling over the resulting responses. The models proposed in (Boscaini et al., 2016) and (Schonsheck et al., 2018) are explicitly gauge dependent with preferred orientations chosen via the principal curvature direction and the parallel transport of kernels, respectively. Poulenard & Ovsjanikov (2018) proposed a non-trivially gauge equivariant network based on geodesic convolutions, however, the model parallel transports only partial information of the feature vectors, corresponding to certain kernel orientations. In concurrent work, Wiersma et al. (2020) also define convolutions on surfaces equivariantly to the orientation of the kernel, but differ in that they use norm non-linearities instead of regular ones and that they apply the convolution along longer geodesics, which adds complexity to the geometric pre-computation - as partial differential equations need to be solved, but may result in less susceptibility to the particular discretisation of the manifold.
|
| 145 |
+
|
| 146 |
+
Another class of approaches defines spectral convolutions on meshes. However, as argued in (Bronstein et al., 2017), the Fourier spectrum of a mesh depends heavily on its geometry, which makes such methods instable under deformations and impedes the generalization between different meshes. Spectral convolutions further correspond to isotropic kernels. Kostrikov et al. (2018) overcomes isotropy of the Laplacian by decomposing it into two applications of the first-order Dirac operator.
|
| 147 |
+
|
| 148 |
+
A construction based on toric covering maps of topologically spherical meshes was presented in (Maron et al., 2017). An entirely different approach to mesh convolutions is to apply a linear map to a spiral of neighbours (Bouritsas et al., 2019; Gong et al., 2019), which works well only for meshes with a similar graph structure.
|
| 149 |
+
|
| 150 |
+
The above-mentioned methods operate on the intrinsic, 2-dimensional geometry of the mesh. A popular alternative for embedded meshes is to define convolutions in the embedding space $\mathbb { R } ^ { 3 }$ . This can for instance be done by voxelizing space and representing the mesh in terms of an occupancy grid (Wu et al., 2015; Tchapmi et al., 2017; Hanocka et al., 2018). A downside of this approach are the high memory and compute requirements of voxel representations. If the grid occupancy is low, this can partly be addressed by resorting to an inhomogeneous grid density (Riegler et al., 2017). Instead of voxelizing space, one may interpret the set of mesh vertices as a point cloud and run a convolution on those (Qi et al., 2017a;b). Point cloud based methods can be made equivariant w.r.t. the isometries of $\mathbb { R } ^ { 3 }$ (Zhao et al., 2019b; Thomas et al., 2018), which implies in particular the isometry equivariance on the embedded mesh. In general, geodesic distances within the manifold differ usually substantially from the distances in the embedding space. Which approach is more suitable depends on the particular application.
|
| 151 |
+
|
| 152 |
+
On flat Euclidean spaces our method corresponds to Steerable CNNs (Cohen & Welling, 2017; Weiler et al., 2018a; Weiler & Cesa, 2019; Cohen et al., 2019a; Lang & Weiler, 2020). As our model, these networks process geometric feature fields of types $\rho$ and are equivariant under gauge transformations, however, due to the flat geometry, the parallel transporters become trivial. Regular nonlinearities are on flat spaces used in group convolutional networks (Cohen & Welling, 2016; Weiler et al., 2018b; Hoogeboom et al., 2018; Bekkers et al., 2018; Winkels & Cohen, 2018; Worrall & Brostow, 2018; Worrall & Welling, 2019; Sosnovik et al., 2020).
|
| 153 |
+
|
| 154 |
+
# 6 EXPERIMENTS
|
| 155 |
+
|
| 156 |
+
# 6.1 EMBEDDED MNIST
|
| 157 |
+
|
| 158 |
+
We first investigate how Gauge Equivariant Mesh CNNs perform on, and generalize between, different mesh geometries. For this purpose we conduct simple MNIST digit classification experiments on embedded rectangular meshes of $2 8 \times 2 8$ vertices. As a baseline geometry we consider a flat mesh as visualized in figure 5(a). A second type of geometry is defined as different isometric embeddings of the flat mesh, see figure 5(b). Note that this implies that the intrinsic geometry of these isometrically embedded meshes is indistinguishable from that of the flat mesh. To generate geometries which are intrinsically curved, we add random normal displacements to the flat mesh. We control the amount of curvature by smoothing the resulting displacement fields with Gaussian kernels of different widths $\sigma$ and define the roughness of the resulting mesh as $3 - \sigma$ . Figures 5(c)-5(h) show the results for roughnesses of 0.5, 1, 1.5, 2, 2.25 and 2.5. For each of the considered settings we generate 32 different train and 32 test geometries.
|
| 159 |
+
|
| 160 |
+
To test the performance on, and generalization between, different geometries, we train equivalent GEM-CNN models on a flat mesh and meshes with a roughness of 1, 1.5, 2, 2.25 and 2.5. Each model is tested individually on each of the considered test geometries, which are the flat mesh, isometric embeddings and curved embeddings with a roughness of 0.5, 1, 1.25, 1.5, 1.75, 2, 2.25 and 2.5. Figure 3 shows the test errors of the GEM-CNNs on the different train geometries (different curves) for all test geometries (shown on the x-axis). Since our model is purely defined in terms of the intrinsic geometry of a mesh, it is expected to be insensitive to isometric changes in the embeddings. This is empirically confirmed by the fact that the test performances on flat and isometric embeddings are exactly equal. As expected, the test error increases for most models with the surface roughness. Models trained on more rough surfaces are hereby more robust to deformations. The models generalize well from a rough training to smooth test geometry up to a training roughness of 1.5. Beyond that point, the test performances on smooth meshes degrades up to the point of random guessing at a training roughness of 2.5.
|
| 161 |
+
|
| 162 |
+
As a baseline, we build an isotropic graph CNN with the same network topology and number of parameters $( \approx 1 6 3 k )$ ). This model is insensitive to the mesh geometry and therefore performs exactly equal on all surfaces. While this enhances its robustness on very rough meshes, its test error of $1 9 . 8 0 \pm 3 . 4 3 \%$ is an extremely bad result on MNIST. In contrast, the use of anisotropic filters of GEM-CNN allows it to reach a test error of only $0 . 6 0 \pm 0 . 0 5 \%$ on the flat geometry. It is therefore competitive with conventional CNNs on pixel grids, which apply anisotropic kernels as well. More details on the datasets, models and further experimental setup are given in appendix E.1.
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 3: Test errors for MNIST digit classification on embedded meshes. Different lines denote train geometries, $\mathbf { X }$ -axis shows test geometries. Regions are standard errors of the means over 6 runs.
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Model</td><td>Features</td><td>Accuracy (%)</td></tr><tr><td>ACNN (Boscaini et al.,2016)</td><td>SHOT</td><td>62.4</td></tr><tr><td>Geodesic CNN (Masci et al.,2015)</td><td>SHOT</td><td>65.4</td></tr><tr><td>MoNet (Monti et al.,2016)</td><td>SHOT</td><td>73.8</td></tr><tr><td>FeaStNet (Verma et al.,2018)</td><td>XYZ</td><td>98.7</td></tr><tr><td>ZerNet (Sun et al.,2018)</td><td>XYZ</td><td>96.9</td></tr><tr><td>SpiralNet++ (Gong et al.,2019)</td><td>XYZ</td><td>99.8</td></tr><tr><td>Graph CNN</td><td>XYZ</td><td>1.40±0.5</td></tr><tr><td>Graph CNN</td><td>SHOT</td><td>23.80±8</td></tr><tr><td>Non-equiv. CNN (SHOT frames)</td><td>XYZ</td><td>73.00±4.0</td></tr><tr><td>Non-equiv. CNN (SHOT frames)</td><td>SHOT</td><td>75.11±2.4</td></tr><tr><td>GEM-CNN</td><td>XYZ</td><td>99.73±0.04</td></tr><tr><td>GEM-CNN (broken symmetry)</td><td>XYZ</td><td>99.89±0.02</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 2: Results of FAUST shape correspondence. Statistics are means and standard errors of the mean of over three runs. All cited results are from their respective papers.
|
| 170 |
+
|
| 171 |
+
# 6.2 SHAPE CORRESPONDENCE
|
| 172 |
+
|
| 173 |
+
As a second experiment, we perform non-rigid shape correspondence on the FAUST dataset (Bogo et al., 2014), following Masci et al. (2015) 3 . The data consists of 100 meshes of human bodies in various positions, split into 80 train and 20 test meshes. The vertices are registered, such that vertices on the same position on the body, such as the tip of the left thumb, have the same identifier on all meshes. All meshes have 6890 vertices, making this a 6890-class segmentation problem.
|
| 174 |
+
|
| 175 |
+
The architecture transforms the vertices’ $X Y Z$ coordinates (of type $3 \rho _ { 0 }$ ), via 6 convolutional layers to features $6 4 \rho _ { 0 }$ , with intermediate features $1 6 ( \rho _ { 0 } \oplus \rho _ { 1 } \oplus \rho _ { 2 } )$ , with residual connections and the RegularNonlinearity with $N = 5$ samples. Afterwards, we use two $1 \times 1$ convolutions with ReLU to map first to 256 and then 6980 channels, after which a softmax predicts the registration probabilities. The $1 \times 1$ convolutions use a dropout of $50 \%$ and 1E-4 weight decay. The network is trained with a cross entropy loss with an initial learning rate of 0.01, which is halved when training loss reaches a plateau.
|
| 176 |
+
|
| 177 |
+
As all meshes in the FAUST dataset share the same topology, breaking the gauge equivariance in higher layers can actually be beneficial. As shown in (Weiler & Cesa, 2019), symmetry can be broken by treating non-invariant features as invariant features as input to the final $1 \times 1$ convolution.
|
| 178 |
+
|
| 179 |
+
As baselines, we compare to various models, some of which use more complicated pipelines, such as (1) the computation of geodesics over the mesh, which requires solving partial differential equations, (2) pooling, which requires finding a uniform sub-selection of vertices, (3) the pre-computation of SHOT features which locally describe the geometry (Tombari et al., 2010), or (4) post-processing refinement of the predictions. The GEM-CNN requires none of these additional steps. In addition, we compare to SpiralNet $^ { - + }$ (Gong et al., 2019), which requires all inputs to be similarly meshed. Finally, we compare to an isotropic version of the GEM-CNN, which reduces to a conventional graph CNN, as well as a non-gauge-equivariant CNN based on SHOT frames. The results in table 2 show that the GEM-CNN outperforms prior works and a non-gauge-equivariant CNN, that isotropic graph CNNs are unable to solve the task and that for this data set breaking gauge symmetry in the final layers of the network is beneficial. More experimental details are given in appendix E.2.
|
| 180 |
+
|
| 181 |
+
# 7 CONCLUSIONS
|
| 182 |
+
|
| 183 |
+
Convolutions on meshes are commonly performed as a convolution on their underlying graph, by forgetting geometry, such as orientation of neighbouring vertices. In this paper we propose Gauge Equivariant Mesh CNNs, which endow Graph Convolutional Networks on meshes with anisotropic kernels and parallel transport. Hence, they are sensitive to the mesh geometry, and result in equivalent outputs regardless of the arbitrary choice of kernel orientation.
|
| 184 |
+
|
| 185 |
+
We demonstrate that the inference of GEM-CNNs is invariant under isometric deformations of meshes and generalizes well over a range of non-isometric deformations. On the FAUST shape correspondence task, we show that Gauge equivariance, combined with symmetry breaking in the final layer, leads to state of the art performance.
|
| 186 |
+
|
| 187 |
+
# REFERENCES
|
| 188 |
+
|
| 189 |
+
Bekkers, E. J., Lafarge, M. W., Veta, M., Eppenhof, K. A., Pluim, J. P., and Duits, R. Roto-translation covariant convolutional networks for medical image analysis. In International Conference on Medical Image Computing and Computer-Assisted Intervention (MICCAI), 2018.
|
| 190 |
+
|
| 191 |
+
Bogo, F., Romero, J., Loper, M., and Black, M. J. Faust: Dataset and evaluation for 3d mesh registration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3794–3801, 2014.
|
| 192 |
+
|
| 193 |
+
Boscaini, D., Masci, J., Rodola, E., and Bronstein, M. M. Learning shape correspondence with \` anisotropic convolutional neural networks. In NIPS, 2016.
|
| 194 |
+
|
| 195 |
+
Bouritsas, G., Bokhnyak, S., Ploumpis, S., Bronstein, M., and Zafeiriou, S. Neural 3d morphable models: Spiral convolutional networks for 3d shape representation learning and generation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 7213–7222, 2019.
|
| 196 |
+
|
| 197 |
+
Bronstein, M. M., Bruna, J., LeCun, Y., Szlam, A., and Vandergheynst, P. Geometric deep learning: Going beyond Euclidean data. IEEE Signal Processing Magazine, 2017.
|
| 198 |
+
|
| 199 |
+
Cohen, T. and Welling, M. Group equivariant convolutional networks. In ICML, 2016.
|
| 200 |
+
|
| 201 |
+
Cohen, T. S. and Welling, M. Steerable CNNs. In ICLR, 2017.
|
| 202 |
+
|
| 203 |
+
Cohen, T. S., Geiger, M., and Weiler, M. A general theory of equivariant CNNs on homogeneous spaces. In Conference on Neural Information Processing Systems (NeurIPS), 2019a.
|
| 204 |
+
|
| 205 |
+
Cohen, T. S., Weiler, M., Kicanaoglu, B., and Welling, M. Gauge equivariant convolutional networks and the Icosahedral CNN. 2019b.
|
| 206 |
+
|
| 207 |
+
Crane, K., Desbrun, M., and Schroder, P. Trivial connections on discrete surfaces. ¨ Computer Graphics Forum (SGP), 29(5):1525–1533, 2010.
|
| 208 |
+
|
| 209 |
+
Crane, K., de Goes, F., Desbrun, M., and Schroder, P. Digital geometry processing with discrete ¨ exterior calculus. In ACM SIGGRAPH 2013 courses, SIGGRAPH ’13, New York, NY, USA, 2013. ACM.
|
| 210 |
+
|
| 211 |
+
Cucurull, G., Wagstyl, K., Casanova, A., Velickovi ˇ c, P., Jakobsen, E., Drozdzal, M., Romero, A., ´ Evans, A., and Bengio, Y. Convolutional neural networks for mesh-based parcellation of the cerebral cortex. 2018.
|
| 212 |
+
|
| 213 |
+
Defferrard, M., Bresson, X., and Vandergheynst, P. Convolutional neural networks on graphs with fast localized spectral filtering. In Advances in neural information processing systems, pp. 3844–3852, 2016.
|
| 214 |
+
|
| 215 |
+
Gallier, J. and Quaintance, J. Differential Geometry and Lie Groups: A Computational Perspective, volume 12. Springer Nature, 2020.
|
| 216 |
+
|
| 217 |
+
Gong, S., Chen, L., Bronstein, M., and Zafeiriou, S. Spiralnet++: A fast and highly efficient mesh convolution operator. In Proceedings of the IEEE International Conference on Computer Vision Workshops, pp. 0–0, 2019.
|
| 218 |
+
|
| 219 |
+
Hanocka, R., Fish, N., Wang, Z., Giryes, R., Fleishman, S., and Cohen-Or, D. Alignet: Partial-shape agnostic alignment via unsupervised learning. ACM Transactions on Graphics (TOG), 38(1):1–14, 2018.
|
| 220 |
+
|
| 221 |
+
Hoogeboom, E., Peters, J. W. T., Cohen, T. S., and Welling, M. HexaConv. In International Conference on Learning Representations (ICLR), 2018.
|
| 222 |
+
|
| 223 |
+
Kipf, T. N. and Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. In ICLR, 2017.
|
| 224 |
+
|
| 225 |
+
Kondor, R., Lin, Z., and Trivedi, S. Clebsch-gordan nets: a fully fourier space spherical convolutional neural network. In NIPS, 2018.
|
| 226 |
+
|
| 227 |
+
Kostrikov, I., Jiang, Z., Panozzo, D., Zorin, D., and Bruna, J. Surface networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2540–2548, 2018.
|
| 228 |
+
|
| 229 |
+
Lai, Y.-K., Jin, M., Xie, X., He, Y., Palacios, J., Zhang, E., Hu, S.-M., and Gu, X. Metric-driven rosy field design and remeshing. IEEE Transactions on Visualization and Computer Graphics, 16(1): 95–108, 2009.
|
| 230 |
+
|
| 231 |
+
Lang, L. and Weiler, M. A Wigner-Eckart Theorem for Group Equivariant Convolution Kernels. arXiv preprint arXiv:2010.10952, 2020.
|
| 232 |
+
|
| 233 |
+
Maron, H., Galun, M., Aigerman, N., Trope, M., Dym, N., Yumer, E., Kim, V. G., and Lipman, Y. Convolutional neural networks on surfaces via seamless toric covers. ACM Trans. Graph., 36(4): 71–1, 2017.
|
| 234 |
+
|
| 235 |
+
Masci, J., Boscaini, D., Bronstein, M. M., and Vandergheynst, P. Geodesic convolutional neural networks on riemannian manifolds. ICCVW, 2015.
|
| 236 |
+
|
| 237 |
+
Monti, F., Boscaini, D., Masci, J., Rodola, E., Svoboda, J., and Bronstein, M. M. Geometric deep \` learning on graphs and manifolds using mixture model cnns. CoRR, abs/1611.08402, 2016. URL http://arxiv.org/abs/1611.08402.
|
| 238 |
+
|
| 239 |
+
Perraudin, N., Defferrard, M., Kacprzak, T., and Sgier, R. Deepsphere: Efficient spherical convolutional neural network with healpix sampling for cosmological applications. Astronomy and Computing, 27:130–146, 2019.
|
| 240 |
+
|
| 241 |
+
Poulenard, A. and Ovsjanikov, M. Multi-directional geodesic neural networks via equivariant convolution. ACM Transactions on Graphics, 2018.
|
| 242 |
+
|
| 243 |
+
Qi, C. R., Su, H., Mo, K., and Guibas, L. J. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652–660, 2017a.
|
| 244 |
+
|
| 245 |
+
Qi, C. R., Yi, L., Su, H., and Guibas, L. J. Pointne $^ { + + }$ : Deep hierarchical feature learning on point sets in a metric space. In Advances in neural information processing systems, pp. 5099–5108, 2017b.
|
| 246 |
+
|
| 247 |
+
Riegler, G., Osman Ulusoy, A., and Geiger, A. Octnet: Learning deep 3d representations at high resolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3577–3586, 2017.
|
| 248 |
+
|
| 249 |
+
Schonsheck, S. C., Dong, B., and Lai, R. Parallel Transport Convolution: A New Tool for Convolutional Neural Networks on Manifolds. arXiv:1805.07857 [cs, math, stat], May 2018.
|
| 250 |
+
|
| 251 |
+
Serre, J.-P. Linear representations of finite groups. 1977.
|
| 252 |
+
|
| 253 |
+
Sosnovik, I., Szmaja, M., and Smeulders, A. Scale-equivariant steerable networks. In International Conference on Learning Representations (ICLR), 2020.
|
| 254 |
+
|
| 255 |
+
Sun, Z., Rooke, E., Charton, J., He, Y., Lu, J., and Baek, S. Zernet: Convolutional neural networks on arbitrary surfaces via zernike local tangent space estimation. arXiv preprint arXiv:1812.01082, 2018.
|
| 256 |
+
|
| 257 |
+
Tchapmi, L., Choy, C., Armeni, I., Gwak, J., and Savarese, S. Segcloud: Semantic segmentation of 3d point clouds. In 2017 international conference on 3D vision (3DV), pp. 537–547. IEEE, 2017.
|
| 258 |
+
|
| 259 |
+
Thomas, N., Smidt, T., Kearnes, S., Yang, L., Li, L., Kohlhoff, K., and Riley, P. Tensor Field Networks: Rotation- and Translation-Equivariant Neural Networks for 3D Point Clouds. 2018.
|
| 260 |
+
|
| 261 |
+
Tombari, F., Salti, S., and Di Stefano, L. Unique signatures of histograms for local surface description. In European conference on computer vision, pp. 356–369. Springer, 2010.
|
| 262 |
+
|
| 263 |
+
Tu, L. W. Differential geometry: connections, curvature, and characteristic classes, volume 275. Springer, 2017.
|
| 264 |
+
|
| 265 |
+
Verma, N., Boyer, E., and Verbeek, J. Feastnet: Feature-steered graph convolutions for 3d shape analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2598–2606, 2018.
|
| 266 |
+
Weiler, M. and Cesa, G. General E(2)-equivariant steerable CNNs. In Conference on Neural Information Processing Systems (NeurIPS), 2019. URL https://arxiv.org/abs/1911. 08251.
|
| 267 |
+
Weiler, M., Geiger, M., Welling, M., Boomsma, W., and Cohen, T. 3D Steerable CNNs: Learning Rotationally Equivariant Features in Volumetric Data. In NeurIPS, 2018a.
|
| 268 |
+
Weiler, M., Hamprecht, F. A., and Storath, M. Learning steerable filters for rotation equivariant CNNs. In Conference on Computer Vision and Pattern Recognition (CVPR), 2018b.
|
| 269 |
+
Wiersma, R., Eisemann, E., and Hildebrandt, K. CNNs on Surfaces using Rotation-Equivariant Features. Transactions on Graphics, 39(4), July 2020. doi: 10.1145/3386569.3392437.
|
| 270 |
+
Winkels, M. and Cohen, T. S. 3D G-CNNs for pulmonary nodule detection. In Conference on Medical Imaging with Deep Learning (MIDL), 2018.
|
| 271 |
+
Worrall, D. and Welling, M. Deep scale-spaces: Equivariance over scale. In Conference on Neural Information Processing Systems (NeurIPS), 2019.
|
| 272 |
+
Worrall, D. E. and Brostow, G. J. Cubenet: Equivariance to 3D rotation and translation. In European Conference on Computer Vision (ECCV), 2018.
|
| 273 |
+
Worrall, D. E., Garbin, S. J., Turmukhambetov, D., and Brostow, G. J. Harmonic Networks: Deep Translation and Rotation Equivariance. In CVPR, 2017.
|
| 274 |
+
Wu, Z., Song, S., Khosla, A., Yu, F., Zhang, L., Tang, X., and Xiao, J. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1912–1920, 2015.
|
| 275 |
+
Zhao, F., Xia, S., Wu, Z., Duan, D., Wang, L., Lin, W., Gilmore, J. H., Shen, D., and Li, G. Spherical u-net on cortical surfaces: Methods and applications. CoRR, abs/1904.00906, 2019a. URL http://arxiv.org/abs/1904.00906.
|
| 276 |
+
Zhao, Y., Birdal, T., Lenssen, J. E., Menegatti, E., Guibas, L., and Tombari, F. Quaternion equivariant capsule networks for 3d point clouds. arXiv preprint arXiv:1912.12098, 2019b.
|
md/train/K6y77KRUowQ/K6y77KRUowQ.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Towards Multi-Grained Explainability for Graph Neural Networks
|
| 2 |
+
|
| 3 |
+
Xiang Wang§†‡, Ying-Xin Wu§, An Zhang†, Xiangnan $\mathbf { H e } ^ { \ S } ;$ ∗, Tat-Seng Chua†
|
| 4 |
+
|
| 5 |
+
‡Sea-NExT Joint Lab †National University of Singapore §University of Science and Technology of China xiangwang@u.nus.edu, wuyxin@mail.ustc.edu.cn, an_zhang@nus.edu.sg xiangnanhe@gmail.com, dcscts@nus.edu.sg
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
When a graph neural network (GNN) made a prediction, one raises question about explainability: “Which fraction of the input graph is most influential to the model’s decision?” Producing an answer requires understanding the model’s inner workings in general and emphasizing the insights on the decision for the instance at hand. Nonetheless, most of current approaches focus only on one aspect: (1) local explainability, which explains each instance independently, thus hardly exhibits the class-wise patterns; and (2) global explainability, which systematizes the globally important patterns, but might be trivial in the local context. This dichotomy limits the flexibility and effectiveness of explainers greatly. A performant paradigm towards multi-grained explainability is until-now lacking and thus a focus of our work. In this work, we exploit the pre-training and fine-tuning idea to develop our explainer and generate multi-grained explanations. Specifically, the pre-training phase accounts for the contrastivity among different classes, so as to highlight the class-wise characteristics from a global view; afterwards, the fine-tuning phase adapts the explanations in the local context. Experiments on both synthetic and real-world datasets show the superiority of our explainer, in terms of AUC on explaining graph classification over the leading baselines. Our codes and datasets are available at https://github.com/Wuyxin/ReFine.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
While graph neural networks (GNNs) [1, 2] have achieved great success in a variety of applications, they usually come as black-box models. The general problem about GNN explainability [3] is to answer “What knowledge does the model use to arrive at the conclusions in general and the specific decision at hand?”. Thoroughly answering this question requires the global understanding of the model’s inner workings and the local insights on a specific instance. Take a GNN model for molecular property prediction as an example. The global understanding exhibits the knowledge encoded in the model, such as the distribution of the chemical groups; meanwhile, the local insight identifies certain chemical groups responsible for a given molecule’s property. Such multi-grained explainability flexibly and reliably inspects the decision-making process of the GNN [4, 5], which is critical to the applications on safety, fairness, and privacy [6, 7].
|
| 14 |
+
|
| 15 |
+
In the field of GNN explainability [8], explainer models broadly attribute model prediction to the input graph, then sample a salient subgraph as the explanation for the model prediction. However, most of current explainers focus on either on local [9, 10, 6, 11, 12] or global explainability [13, 7], thereby suffer from inherent limitations correspondingly:
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Explanations on Visual Genome dataset generated from ReFine, including the pre-training and fine-tuning phases. Right indicates the changes before and after the fine-tuning.
|
| 19 |
+
|
| 20 |
+
• Local explainability aims to customize the explanatory subgraph for each instance individually. However, such local explanations fall short in systematizing the prototypical patterns shared within a class or group of instances. Thus, they lack the global understanding of the model’s workings [7, 13], which is vital to generalize to other instances being explained. • Global explainability targets at the globally important patterns across multiple instances, which could violate the local fidelity [14] — the globally important substructure may not be important or even appear in the local context, thus might fail to explain a specific instance reliably.
|
| 21 |
+
|
| 22 |
+
Briefly put, these approaches overlook the multi-granularity nature of explainability, while we argue that the local and global explainability should be exhibited simultaneously to obtain faithful explanations. Taking Figure 1 as an example, the global explainability differentiates the explanations for various classes, such as livestock-background subgraphs for the farm class, human-sports subgraphs for the stadium class. When zooming in a specific scene graph, the local explainability refines on the farm-wise patterns and specifies (sheep, on, meadow) as the final explanation. A paradigm towards such multi-grained explainability is until-now lacking, to the best of our knowledge.
|
| 23 |
+
|
| 24 |
+
Towards multi-grained explainability, we propose a novel explainer, ReFine, with pre-training and fine-tuning [15, 16] techniques for explaining GNN models. Specifically, pre-training aims to answer “What class-wise knowledge does the GNN leverage to make predictions in general?”. We combine the contrastive learning [17, 18] into class-wise generative probabilistic models [7], thereby approach coarser-grained explanations (i.e. saliency maps of all edges). Going beyond the global view, fine-tuning is to answer “Why the GNN model made the certain prediction for the instance at hand?”, where we upgrade the coarser-grained explanations to the finer-grained explanations (i.e. explanatory subgraphs of salient edges). Through this way, ReFine can faithfully generate multigrained explanations, and we empirically show its effectiveness as compared to some state-of-the-art explainers [9, 6, 7, 19]. It is also worth mentioning that, although the general understanding of GNN predictions has been considered in a recent work PGExplainer [7], it is only exploited to train a generative probabilistic model shared across all the explained instances, rather than dissecting and modeling the class-wise knowledge explicitly. Overall, our contributions are summarized as:
|
| 25 |
+
|
| 26 |
+
• We investigate the local explainability and global explainability for explaining GNNs and put forward the concept of multi-grained explainability. • We propose a pre-training and fine-tuning framework to generate multi-grained explanations, which has both global understanding of model workings and local insights on specific instances. • We achieve state-of-the-art performance on various datasets w.r.t. predictive accuracy on explaining GNNs. Quantitative and qualitative results verify multi-granularity explainability of ReFine.
|
| 27 |
+
|
| 28 |
+
# 2 Background & Task Formulation
|
| 29 |
+
|
| 30 |
+
In this section, we begin with the backgrounds on GNNs and frame the task of generating multigrained explainability for GNN models.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Model construction of proposed ReFine. Left represents the pre-training phase for a graph example, which is labeled and predicted as “Cycle”, from the BA-3motif dataset. Right demonstrates the fine-tuning process where the saliency map is fine-tuned on the instance to achieve local fidelity.
|
| 34 |
+
|
| 35 |
+
Graph Neural Networks. We denote the graph data as $\mathcal { G } = ( \nu , \mathcal { E } )$ with the node set $\nu$ and the edge set $\mathcal { E }$ . The structural feature of a graph can be represented by an adjacency matrix $\mathbf { A } \in \{ 0 , 1 \} ^ { | \mathcal { V } | \times | \mathcal { V } | }$ where $A _ { i j } = 1$ indicates an edge starting from node $i$ to node $j$ , and $A _ { i j } = 0$ otherwise. The node feature matrix is represented as $\mathbf { X } \in \mathbb { R } ^ { | \nu | \times d }$ .
|
| 36 |
+
|
| 37 |
+
Graph neural networks (GNNs) [1, 2] aim to generate powerful representation on graphs in an end-to-end fashion. Such representation facilitates the downstream tasks, such as node classification [20, 21], link prediction [22, 23, 24, 25], and graph classification [26]. Without loss of generality, we consider a graph classifier $f : \mathbb { G } \to \mathbb { R } ^ { \bar { C } }$ , which classifies an input graph $\mathcal { G } \in \mathbb { G }$ in $C$ categories and outputs prediction by $c = \arg \operatorname* { m a x } _ { i } f ( \mathcal { G } ) _ { i }$ . Typically, $f$ consists of three components: (1) learning of node representations, which distills vectorized information from neighboring nodes and updates node representations recursively; (2) learning of graph representation, which aggregates the node representations to establish the representation for the holistic graph; (3) graph classification, which maps the graph representation into the probability distribution of different categories.
|
| 38 |
+
|
| 39 |
+
Explaining Graph Neural Networks. The explainer model (aka. the explanation method) usually performs two consecutive operations: (1) feature attribution [27, 28], which associates each feature of an input $\mathcal { G } \in \mathbb { G }$ with the relevance score for the classifier’s prediction; (2) feature selection [29, 6], which extracts salient features based on the relevance scores to construct an explanatory subgraph. The subgraph is regarded as the evidence for the GNN to make the prediction.
|
| 40 |
+
|
| 41 |
+
We follow previous works [6, 7, 10, 19] and focus on the contributions of the structural features (i.e. edges). Our explainer consists of two components: an attribution module $\tau$ for edge attribution and a selection module $\mathcal { H }$ for edge selection. Specifically, $\tau$ assigns the adjacency matrix $\mathbf { A }$ with a saliency map, i.e.
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\mathbf { M } = { \mathcal { T } } ( { \mathcal { G } } , f , c ) ,
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\mathbf { M } \in \mathbb { R } ^ { | \mathcal { V } | \times | \mathcal { V } | }$ , each element of which is the importance score of the edge to the prediction class $c$ . Such saliency map can further result in an attentive graph $\mathcal { G } _ { a t t } = \mathbf { A } \odot \mathbf { M }$ . Then, the selection module $\mathcal { H }$ identifies the edges of explanatory subgraph based on the attentive graph:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { S } = \mathcal { H } ( \mathcal { G } _ { a t t } , f , c , \rho ) ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\mathbf { S } \in \mathbb { R } ^ { | \mathcal { V } | \times | \mathcal { V } | }$ constructs the explanatory subgraph $\mathcal { G } _ { e x p } = \mathbf { A } \odot \mathbf { S }$ , and $\rho$ is the explanation budget [27] that equals to the number of nonzero elements in $\mathbf { s }$ .
|
| 54 |
+
|
| 55 |
+
# 3 Methodology
|
| 56 |
+
|
| 57 |
+
Here we present our explainer that purses multi-grained explainability by pre-training and fine-tuning, as Figure 2 shows. In the pre-training phase, the attribution module distills the class-wise knowledge, which contrasts the salient structures based on the prediction, answering the question “Why did the GNN model assign a group of graphs with the same prediction?”. In the next phase, the selection module goes beyond the class-wise knowledge and fine-tunes the saliency maps on a specific instance for answering “Why the GNN model made the certain prediction for the specific graph?”.
|
| 58 |
+
|
| 59 |
+
# 3.1 Pre-training Towards Global Explainability
|
| 60 |
+
|
| 61 |
+
Class-aware Attribution Module. Towards the global explainability of GNN, it is important to specify the class-wise knowledge across the instances with the same prediction. Inspired by the success of generative models [7, 30, 31] in capturing the succinct structures from the graphs, we hire multiple generative probabilistic models [7] as our attribution models (short for attributor), i.e. $\mathcal { T } _ { \theta } = \{ \mathcal { T } ^ { ( c ) } | c = 1 , \cdots , C \}$ which is parameterized by $\theta$ . The attributor $\mathcal { T } ^ { \left( c \right) }$ is responsible for uncovering the hidden patterns from some graph instances $O ^ { ( c ) } = \{ \mathcal { G } | c = \arg \operatorname* { m a x } _ { i } f ( \mathcal { G } ) _ { i } \}$ with the same prediction class $c$ .
|
| 62 |
+
|
| 63 |
+
Formally, each attributor $\mathcal { T } ^ { \left( c \right) }$ is composed of a GNN encoder $\mathrm { G N N } ^ { ( c ) }$ and a MLP decoder $\mathbf { M L P } ^ { ( c ) }$ , whose parameters are shared when explaining graphs in $\mathcal { O } ^ { ( c ) }$ , so as to systematize the class-wise patterns. Next we introduce the construction of each class-wise attributor, while we omit the superscript for conciseness. Specifically, the encoder GNN embeds each node $i$ in $\mathcal { G }$ with representation $\mathbf { z } _ { i }$ and summarize the representations of all nodes as:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathbf { Z } = \mathbf { G N N } ( { \mathcal { G } } , \mathbf { X } ) ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\mathbf { Z } \in \mathbb { R } ^ { | \nu | \times d ^ { \prime } }$ encodes the structural feature $\mathbf { A }$ and node feature $\mathbf { X }$ . On the top of the node representations, we model the graph structure as edge distributions and frame the generation of explanatory subgraphs by sampling from the edge distributions:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
P ( \mathbf { M } | \mathbf { Z } ) = \prod _ { ( i , j ) \in \mathcal { E } } P ( M _ { i j } | \mathbf { z } _ { i } , \mathbf { z } _ { j } ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $M _ { i j }$ indicates the importance of edge $( i , j )$ . Then the MLP encoder takes the concatenation of node representations $\mathbf { z } _ { i }$ and $\mathbf { z } _ { j }$ as the inputs and outputs the importance score. To approximate the importance score to the discrete distribution and optimize the generator via gradient propagation, we adopt the reparameterization trick [7], where an independent random variable $\epsilon \sim \mathrm { U n i f o r m } ( 0 , 1 )$ is introduced. As such, the edge probability is formulated as:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
P ( M _ { i j } | \mathbf { z } _ { i } , \mathbf { z } _ { j } ) = \sigma ( ( \log \frac { \epsilon } { 1 - \epsilon } + \alpha _ { i j } ) / \beta ) , \quad \mathrm { w i t h } \quad \alpha _ { i j } = \mathbf { M L P } ( [ \mathbf { z } _ { i } , \mathbf { z } _ { j } ] ) ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $\sigma$ is the sigmoid function, and $\beta$ denotes the temperature hyperparameter. It is worth emphasizing that our attributors is different from PGExplainer [7], where only one generative probabilistic model is involved. Thus, their attribution results are limited in differentiating the patterns of different classes and systematizing the class-wise knowledge.
|
| 82 |
+
|
| 83 |
+
Pre-training Class-wise Attribution Module. We devise the following objective function for training the class-wise attributors.
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\operatorname* { m i n } _ { \theta } \mathcal { L } _ { 1 } + \gamma \mathcal { L } _ { c t s } ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where $\gamma$ is the trade-off hyperparameter. We start from maximizing the mutual information between the attentive graphs and the target prediction of the graph, which is a widely-used learning paradigm in the literature [32, 6, 7]. It guides us to find the prediction-relevant explanatory subgraph, which equals to minimizing the following loss:
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal { L } _ { 1 } = - \mathbb { E } _ { \mathcal { G } } \mathbb { E } _ { \epsilon } \mathbb { E } _ { c ^ { \prime } } [ P ( Y = c ^ { \prime } | G = \mathcal { G } ) \log P ( Y = c ^ { \prime } | G = \mathcal { G } _ { a t t } ^ { ( c ) } ) ] ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $G$ and $Y$ are the graph and prediction variables, respectively; $\mathcal { G }$ is the full graph instance to explain; by sampling $\epsilon \in { \mathrm { U n i f o r m } } ( 0 , 1 )$ and $c ^ { \prime } \in \{ 1 , \cdots , C \}$ , the class-wise saliency map $\mathbf { M } ^ { ( c ) }$ can be generated from Equation (4); $P ( Y = c ^ { \prime } | G = \mathcal { G } ) = f ( \mathcal { G } ) _ { c ^ { \prime } }$ is the output probabilities of the prediction being $c ^ { \prime }$ when feeding $\mathcal { G }$ to the GNN model $f$ ; analogously, $P ( Y = c ^ { \prime } | G = \mathcal { G } _ { a t t } ^ { ( c ) } ) =$ $f ( \mathcal { G } _ { a t t } ^ { ( c ) } ) _ { c ^ { \prime } }$ audits the output probability when feeding $\mathcal { G } _ { a t t } ^ { ( c ) } = \mathbf { A } \odot \mathbf { M } ^ { ( c ) }$ .
|
| 96 |
+
|
| 97 |
+
Moreover, we introduce a contrastive learning [33, 34, 18, 35, 36, 37] loss to emphasize differences among the class-wise patterns — the substructure of the full graph that is distant to that of the graphs with a different prediction but close to that of the graphs with the same prediction. It makes each attributor focus on the unique and discriminative information within the class. Specifically, for the saliency maps $\mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) }$ of $\mathcal { G } _ { 1 }$ and $\mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) }$ of $\mathcal { G } _ { 2 }$ , it encourages the agreements between $\mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) }$ and $\mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) }$ when , compared to that when $c _ { 1 } \neq c _ { 2 }$ :
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { c t s } = \mathbb { E } _ { \mathcal { G } , \mathcal { G } ^ { \prime } } \mathbb { E } _ { \epsilon , \epsilon ^ { \prime } } [ ( - 1 ) ^ { \mathbb { I } ( c _ { 1 } = c _ { 2 } ) } \times \mu ( \ell ( \mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) } , \mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) } ) ) ] ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where as the $\mu$ is the softplus function [3presentation similarity — $\ell$ arity bewhere een two subgraphs, which is setis the graph representations by $\ell ( \mathcal { G } _ { a t t 1 } ^ { ( c _ { 1 } ) } , \mathcal { G } _ { a t t 2 } ^ { ( c _ { 2 } ) } ) = \mathbf { h } _ { 1 } ^ { \top } \mathbf { h } _ { 2 }$ $\mathbf { h } _ { 1 }$
|
| 104 |
+
feeding G(c1)att1 into the encoder $\mathrm { G N N } ^ { ( c _ { 1 } ) }$ and aggregating the node representations. Similar for $\mathbf { h } _ { 2 }$ . In addition, following [6], we adopt the element-wise entropy and $L _ { 1 }$ norm on the edge probability. By jointly optimizing these two losses in Equation (6), the class-wise attribution module learns to stratify the discriminative information for different classes and generate the saliency maps with a global view of the target GNN. Taking an information-theoretical look at Equation (8), minimizing contrastive learning loss is maximizing a lower bound of the mutual information between the latent graph representations of two graphs within the same class.
|
| 105 |
+
|
| 106 |
+
# 3.2 Fine-tuning Towards Local Explainability
|
| 107 |
+
|
| 108 |
+
Having established the saliency map that exhibits the importance of each edge, the standard way is to rank all edges based on their importance scores and simply select the top edges as the explanatory subgraphs. However, we argue that such a coarser-grained selection fails to consider the dependencies of these selected edges explicitly. Within a high-quality explanatory subgraph, edges are supposed to cooperate with each other, form the coalition, and approach the target prediction better than individuals [38, 39]. Without considering such coalition effect, the quality of the explanatory subgraph is greatly limited.For example, when explaining why the molecule graph is classified as mutagenic [13], two connected nitrogen-oxygen (N-O) bonds form a chemical group $\mathrm { N O _ { 2 } }$ and present more discriminative information about the mutagenic property [13]; whereas, two salient but disconnected N-O bonds from different chemical groups are less informative to interpret the mutagenic property.
|
| 109 |
+
|
| 110 |
+
Clearly, the coarser-grained saliency maps are insufficient to exhibit the coalition effect of edges, thus might be redundant and suboptimal explanations. Hence, we move forward to learn a finer-grained explanatory subgraph. Technically, on the top of the well-trained class-wise attribution module, we add the selection module:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathbf { S } ^ { ( c ) } = \mathcal { H } ( \mathcal { G } _ { a t t } ^ { ( c ) } , f , c , \rho ) ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\rho$ is the number of edges selected in the explanatory subgraph; $\mathcal { H }$ is a sampling (selection) function; $\mathbf { S } ^ { ( c ) }$ preserves the elements selected by the selection function and sets the other elements as 0. Instead of the hard selection that picks up the edges with the highest probability, $\mathcal { H }$ samples edges according to their probabilities. Allowing edges with low probabilities to be sampled can prevent the explainer from collapsing to suboptimal solutions with limited coalition effect.
|
| 117 |
+
|
| 118 |
+
With the new stochastic adjacency matrix $\mathbf { S } ^ { ( c ) }$ , we are able to extract the subgraph $\mathcal { G } _ { e x p } ^ { ( c ) }$ . To fine-tune the attribution and selection modules, we resort to maximize the mutual information between the explanation candidate $\mathcal { G } _ { e x p } ^ { ( c ) }$ and the target prediction of the full graph:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathcal { L } _ { 2 } = - \mathbb { E } _ { \mathcal { G } } \mathbb { E } _ { \epsilon } \mathbb { E } _ { c ^ { \prime } } [ P ( Y = c ^ { \prime } | G = \mathcal { G } ) \log P ( Y = c ^ { \prime } | G = \mathcal { G } _ { e x p } ^ { ( c ) } ) ] .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
By optimizing the loss above, the selection module accounts for the edge coalition within $\mathbf { S } ^ { ( c ) }$ , so as to achieve higher local fidelity. Moreover, as the selection module discards some elements in the stochastic adjacency matrix, it blocks parts of gradient backpropagation and possibly acts as a dropout function to avoid the overfitting on the instance-level explanations.
|
| 125 |
+
|
| 126 |
+
# 4 Experiments
|
| 127 |
+
|
| 128 |
+
We mainly aim to investigate the following questions:
|
| 129 |
+
|
| 130 |
+
• RQ1: How effective is the pre-training phase of ReFine, as compared to that of existing methods? • RQ2: How effective is the fine-tuning phase of ReFine, as compared to that of the pre-training phase?
|
| 131 |
+
|
| 132 |
+
# 4.1 Experimental Settings
|
| 133 |
+
|
| 134 |
+
Datasets and Target GNNs. We consider four datasets with various target GNNs:
|
| 135 |
+
|
| 136 |
+
• Molecule graph classification. We use the Mutagenicity dataset [40, 41], where 4, 337 molecule graphs are classified into two classes based on their mutagenic effect on a bacterium. The welltrained Graph Isomorphism Network (GIN) [26, 42] has achieved a $100 \%$ testing accuracy.
|
| 137 |
+
|
| 138 |
+
• Scene graph classification. Following the previous work [10], we select 4, 443 (images, scene graphs) pairs from Visual Genome [43] to construct the VG-5 dataset. Wherein, the graphs are labeled with five classes: stadium, street, farm, surfing, forest. Each graph contains regions of the objects as the nodes, while edges indicates the relationships between object nodes. The target GNN is an APPNP [44] which achieves $6 4 . 3 \%$ testing accuracy.
|
| 139 |
+
|
| 140 |
+
• Handwriting graph classification. We use the MNIST superpixel dataset [45], which converts 70,000 images into the graphs of superpixel adjacency. Every graph is labeled as one of ten digit classes. We trained a Spline-based GNN [46] which gains $9 7 . 9 \%$ accuracy in the testing dataset.
|
| 141 |
+
|
| 142 |
+
• Motif graph classification. We follow prior studies [6, 7] to create a synthetic dataset, BA-3motif, which contains 3,000 graphs. Specifically, we adopt the Barabasi-Albert (BA) graphs as the base, and attach each base with one of three motifs: house, cycle, grid. The trained GNN model, ASAP [47], classifies them according to the type of attached motifs and achieved $100 \%$ testing accuracy.
|
| 143 |
+
|
| 144 |
+
Baselines. We compare our ReFine with the state-of-the-art explanation methods:
|
| 145 |
+
|
| 146 |
+
• SA [9] directly uses the gradients of the model prediction w.r.t. the adjacency matrix of the input graph as the importance of edges.
|
| 147 |
+
• GNNExplainer [6] applies the soft masks on the messages carried by edges, where each mask indicates an edge’s importance. Note that the masks of graph instances are trained individually.
|
| 148 |
+
• PGExplainer [7] hires a neural network to learn to generate the masks for the input edges. The generative model is trained over multiple explained instances.
|
| 149 |
+
• PGM-Explainer [19] collects the prediction change on the random node perturbations, and then learns a Bayesian network from these perturbation-prediction observations, so as to capture the dependencies among the nodes and the prediction. Here we transfer it to model the edge importance.
|
| 150 |
+
|
| 151 |
+
Optimization. For the parametric explanation methods (GNNExplainer, PGExplainer, PGMExplainer), we apply a grid search to tune their own hyperparameters. For our ReFine framework, we use the Adam optimizer and set the learning rate of pre-training and fine-tuning as 1e-3 and 1e-4, respectively. All experiments are done on a single Tesla V100 SXM2 GPU (32 GB).
|
| 152 |
+
|
| 153 |
+
Evaluation Metrics. It is challenging to quantitatively evaluate the quality of explanations, since the ground-truth explanations are usually unavailable. In the literature, there are three widely-used evaluation metrics:
|
| 154 |
+
|
| 155 |
+
• Predictive Accuracy $( \mathbf { A C C } @ \rho )$ [32, 48, 27]. It measures the fidelity of the explanatory subgraphs by feeding it solely into the target model and auditing how well it recovers the target prediction. We report the average $\operatorname { A C C } @ \rho$ over all graphs in the testing sets, and further denote ACC-AUC as the area under the ACC curve over different selection ratios $\rho \in \{ 0 . 1 , 0 . 2 , \cdot \cdot \cdot , 0 . 9 , 1 . 0 \}$ . $\operatorname { A C C } @ \rho$ and ACC-AUC are suitable for all the datasets.
|
| 156 |
+
|
| 157 |
+
• Recall $@ N$ . As suggested in prior studies [6, 7, 32], we can create the “ground-truth explanations” for the synthetic dataset. Specifically, for BA-3motif, the motif of each graph can be viewed as the discriminative information coherent in the model knowledge. As such, we can frame the evaluation problem as the task of top edge ranking. To be more specific, for an explanatory subgraph, the edges within the motif are positive, while the others are negative. To this end, recall can be adopted as the evaluation protocols. More formally, Recall $\ @ N = \mathbb { E } _ { \boldsymbol { \mathcal { G } } } [ | \mathcal { G } _ { s } \cap \mathcal { G } _ { s } ^ { * } | / | \mathcal { G } _ { s } ^ { * } | ]$ where $\mathcal { G } _ { s }$ is composed of the top- $N$ edges and $\mathcal { G } _ { s } ^ { * }$ is the ground-truth explanatory subgraph.
|
| 158 |
+
|
| 159 |
+
# 4.2 Quantitative Evaluations
|
| 160 |
+
|
| 161 |
+
Influence of Pre-training (RQ1). To investigate the effectiveness of pre-training, we first compare the performance of the attribution module with the state-of-the-art explainers. We denote this variant by ReFine-FT, which disables the fine-tuning phase and simply constructs the explanatory subgraphs based on the saliency scores. Moreover, we build another variant ReFine-CT, which removes the contrastive loss (Equation (8)) from the pre-training phase, to study the effect of the contrastive loss on the class-wise knowledge modeling. To be more clear, we present the difference of PGExplainer [7], ReFine and its ablation models in Table 4.2. Table 2 presents the performance comparisons, from which we have several findings:
|
| 162 |
+
|
| 163 |
+
Table 1: Structure/Training Difference of PGExplainer, ReFine and its ablation models.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Pre-training</td><td rowspan="2">Fine-tuning</td></tr><tr><td>Class-wise Attributors</td><td>Contrastive Learning</td></tr><tr><td>PG-Explainer</td><td></td><td></td><td></td></tr><tr><td>Refine-CT</td><td></td><td></td><td></td></tr><tr><td>Refine-FT</td><td></td><td></td><td></td></tr><tr><td>Refine</td><td></td><td></td><td></td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 2: Comparison of our ReFine and other baseline explainers
|
| 168 |
+
|
| 169 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Mutagenicity ACC-AUC</td><td rowspan="2">VG-5 ACC-AUC</td><td rowspan="2">MNIST ACC-AUC</td><td colspan="2">BA-3motif</td></tr><tr><td>ACC-AUC</td><td>Recall@5</td></tr><tr><td>SA</td><td>0.769</td><td>0.769</td><td>0.559</td><td>0.518</td><td>0.243</td></tr><tr><td>GNNExplainer</td><td>0.895±0.010</td><td>0.895±0.003</td><td>0.535±0.013</td><td>0.528±0.005</td><td>0.157±0.002</td></tr><tr><td>PG-Explainer</td><td>0.631±0.008</td><td>0.790±0.004</td><td>0.504±0.010</td><td>0.586±0.004</td><td>0.293±0.001</td></tr><tr><td>PGM-Explainer</td><td>0.714±0.007</td><td>0.792±0.001</td><td>0.615±0.003</td><td>0.575±0.002</td><td>0.250±0.000</td></tr><tr><td>ReFine-CT</td><td>0.888±0.008</td><td>0.891±0.002</td><td>0.526±0.007</td><td>0.610±0.004</td><td>0.248±0.001</td></tr><tr><td>ReFine-FT</td><td>0.945±0.011</td><td>0.906±0.002</td><td>0.587±0.008</td><td>0.616±0.003</td><td>0.299±0.002</td></tr><tr><td>ReFine</td><td>0.955±0.005</td><td>0.914±0.001</td><td>0.636±0.003</td><td>0.630±0.006</td><td>0.304±0.000</td></tr><tr><td>Relative Impro.</td><td>6.7%</td><td>2.1%</td><td>3.4%</td><td>7.5%</td><td>3.8%</td></tr></table>
|
| 170 |
+
|
| 171 |
+
• ReFine-FT outperforms the baseline explainers in most cases. To be more specific, it achieves significant relative improvements over the strongest baselines w.r.t. ACC-AUC by $5 . 6 \%$ and $5 . 1 \%$ in Mutagenicity and BA-3motif, respectively. This demonstrates the rationality and effectiveness of the attribution module. We attribute these improvements to the class-wise knowledge modeling: (1) By specifying the attributor models for each class, ReFine-FT is able to capture the underlying patterns shared across the instances within the same class; and (2) Conducting the contrastive learning between different class-aware attributors makes ReFine-FT better stratify the discriminative information for different classes. The class-wise knowledge endows ReFine-FT with the global view of the target model’s workings.
|
| 172 |
+
• Although PGExplainer is also equipped with the global view of the target model, its performance is worse than that of ReFine-FT. We ascribe this to the limitations of PGExplainer’s global view, which is founded upon all the explained instances, but fails to differentiate the class-wise patterns. This again verifies the rationality and effectiveness of our attribution module.
|
| 173 |
+
• ReFine-FT outperforms ReFine-CT by a large margin, indicating that the contrastive learning plays a critical role in exhibiting the class-wise knowledge. Specifically, it summarizes the patterns across similar instances and focuses on the information pertinent to specific classes, while filtering the irrelevant and redundant information out.
|
| 174 |
+
• Interestingly, in MNIST, the result of ReFine-FT is worse than that of PGM-Explainer. One possible reason is that the random perturbations in PGM-Explainer create a collection of broken graphs and offer a more comprehensive observation of the graphs. We leave the exploration of subgraph-prediction relations as future work.
|
| 175 |
+
|
| 176 |
+
Influence of Fine-tuning (RQ2). To justify the effectiveness of the fine-tuning phase, we report the performance of ReFine with our selection module in Tables 2 and 3, as compared to the performance before fine-tuning. We have the following observations:
|
| 177 |
+
|
| 178 |
+
Table 3: Performance under different selection ratios before and after fine-tuning.
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2">ACC@p</td><td colspan="2">Mutagenicity</td><td colspan="2">VG-5</td><td colspan="2">MNIST</td><td colspan="2">BA-3motif</td></tr><tr><td>0.4</td><td>0.6</td><td>0.4</td><td>0.6</td><td>0.4</td><td>0.6</td><td>0.4</td><td>0.6</td></tr><tr><td>ReFine-FT</td><td>96.8%</td><td>94.0%</td><td>91.3%</td><td>91.4%</td><td>41.4%</td><td>61.4%</td><td>36.0%</td><td>65.7%</td></tr><tr><td>ReFine</td><td>97.8%</td><td>96.2%</td><td>92.2%</td><td>93.4%</td><td>71.4%</td><td>82.0%</td><td>39.0%</td><td>72.8%</td></tr><tr><td>Improvement</td><td>+1.0%</td><td>+2.2%</td><td>+0.9%</td><td>+2.0%</td><td>+30.0%</td><td>+20.6%</td><td>+3.0%</td><td>+7.1%</td></tr></table>
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 3: Qualitative Results in MNIST Superpixels dataset. Handwriting graphs are in black, which respectively represent number $\mathbf { \bar { \theta } } ^ { 6 6 } 0 ^ { 9 }$ , $^ { \cdot 6 } 2 ^ { \cdot }$ , “8” within each block from left to right. Explanatory graphs are in red, where the top $10 \%$ edges are highlighted.
|
| 184 |
+
|
| 185 |
+
• Fine-tuning with the selection module can improves the explanation performance sustainably, which indicates the effectiveness of our pre-training and fine-tuning paradigm. Specifically, in MNIST, the predictive accuracy of the explanations after fine-tuning improves from $4 1 . 4 \%$ to $7 1 . 4 \%$ when the selection rato is 0.4. We attribute these improvements to the local insights on specific instances: (1) Benefiting from the saliency map obtained in the pre-training phase, the selection module is able to filter noisy edges out and narrow down to where the target model looks to make decisions; (2) Fine-tuning the explanatory subgraphs considers the coalition effect of edges, thus approaches more information to recover the target prediction.
|
| 186 |
+
|
| 187 |
+
• Jointly analyzing Tables 2 and 3, ReFine consistently outperforms all baselines across the four datasets. Advantageous to the local or global explanations, our multi-grained explanations not only have the global understanding of model workings (i.e. the class-wise knowledge), but also account for the local insights on specific instances (i.e. the coalition effect of edges in the local context). It illustrates the superiority of our ReFine paradigm.
|
| 188 |
+
|
| 189 |
+
Overall, the empirical supports justify the significance of fine-tuning well. The contributions of fine-tuning w.r.t. the overall improvements over PG-Explainer are $3 7 . 1 \%$ and $3 1 . 8 \%$ in MNIST and BA-3motif datasets, respectively. One possible reason that fine-tuning contributes only $3 . 1 \%$ and $6 . 4 \%$ portion of overall improvements in Mutagenicity and VG-5 as compared to PG-Explainer is the existance of rich node features in these two datasets. With the assistance of node features, the global patterns might be well-captured durining pre-training, thus leaving little space for the local patterns to improve.
|
| 190 |
+
|
| 191 |
+
# 4.3 Qualitative Analysis
|
| 192 |
+
|
| 193 |
+
We present the qualitative results on MNIST superpixel in Figure 3, where the pre-trained and fine-tuned explanations are the explanatory subgraphs before fine-tuning (i.e. extracted based on the saliency map) and after fine-tuning (i.e. derived from the selection module), respectively.
|
| 194 |
+
|
| 195 |
+
Influence of Pre-training (RQ1). The pre-trained results (first row) well demonstrate the global patterns, where the explanatory subgraphs for interpreting the digit $\mathbf { \bar { \theta } } ^ { 6 } 0 ^ { 9 }$ focus more on the edges between hollows in the middle and the fringe of the number. While interpreting the prediction $\mathbf { \Delta } ^ { 6 6 } 5 ^ { 9 }$ , the explanations identify the edges spread on the bend of the number as the most important features. Also, we observe an interesting pattern in the results for explaining the prediction $\mathbf { \vec { \nu } } ^ { 6 } \mathbf { \vec { 8 } } ^ { 5 }$ , where the background edges draw more attention, rather than edges relevant to the digits, revealing the evidence for the target GNN to classify. It also shows the supporting evidence of the difference between the model explanation and the human explanation which focuses more on the digit graphs other than the background graphs. Through the pre-trained examples, the global patterns offer vital model understanding and inspections for the model’s decision-making process.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 4: Qualitative Results in Mutagenicity dataset. The prediction of the molecule in the first row is mutagenic, while the molecule in the second row is predicted as non-mutagenic. The selection ratios range from $10 \%$ to $50 \%$ . Note that some opposite edges are visually coincident.
|
| 199 |
+
|
| 200 |
+
Table 4: Time costs (in second) of GNNExplainer, PG-Explainer and the fine-tuning phase of Refine.
|
| 201 |
+
|
| 202 |
+
<table><tr><td></td><td>Mutagenicity</td><td>VG-5</td><td>MNIST</td><td>BA-3motif</td></tr><tr><td>GNNExplainer</td><td>2.03</td><td>1.88</td><td>0.637</td><td>1.11</td></tr><tr><td>PG-Explainer</td><td>0.030</td><td>0.035</td><td>0.040</td><td>0.032</td></tr><tr><td>Refine(Fine-tuning)</td><td>0.821</td><td>0.583</td><td>0.535</td><td>0.423</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Influence of Fine-tuning (RQ2). We now compare the pre-trained and fine-tuned explanations. Clearly, the fine-tuned explanatory graphs make clearer boundaries on the instances. The explanation adapted with the user-defined ratio pays greater attention to details that are only applicable to the specific instances. For example, one can take a closer look at the explanations in the 4-th column. Without the fine-tuning phase, the explanation may distracted by the edges across the digit and the background, such that these transition edges might be deemed as the most important features while achieve suboptimal predictive accuracies. In contrast, the fine-tuned explanation dispels such misunderstanding, with a higher local accuracy. Similar patterns can be found in other examples.
|
| 205 |
+
|
| 206 |
+
The qualitative results on Mutagenicity are presented in Figure 4, where each explanation has been fine-tuned on the corresponding ratio. We can see the flexibility on ReFine, which enables the fine-tuning on a specific user-defined ratio. With the selection ratio increases, the class probability output by the target GNN is generally stable or further improved. Moreover, the fine-tuning phase focuses more on the combination of features, with the constraint of selection ratio, to purse the higher accuracy rather than intercepting on a ranking based on the static edge importance, which is only valid under the addictive feature assumption [32].
|
| 207 |
+
|
| 208 |
+
# 4.4 Discussions
|
| 209 |
+
|
| 210 |
+
Efficiency for Generating Explanations. The inference time [7] to explain a new instance by the pre-trained ReFine is the same as PGExplainer under the same attributor construction. Different from GNNExplainer which has to retrain the model for each graph, ReFine only needs a few finetuning steps on the pre-trained model (20 steps on average). Thus, ReFine can gain a boosting performance for explaining graphs while remaining efficient in terms of time complexity. Specifically, we summarize the time costs in the Table 4. Clearly, our ReFine is more efficient than GNNExplainer and is computationally comparable to PG-Explainer.
|
| 211 |
+
|
| 212 |
+
Limitations. Although ReFine can well-encode the class-wise knowledge by learning the parameters of multiple attributors, it can hardly map such knowledge to the structure representation as XGNN [13]. This limits the human understanding on the core of input data via a conciseness substructure.
|
| 213 |
+
|
| 214 |
+
# 5 Related Work
|
| 215 |
+
|
| 216 |
+
We consider two classes of related work for GNNs explainability: studies on local explainability, which independently explain for each input graph without referring to other knowledge, e.g., training data; studies on global explainability, which provide explanations for multiple instances with the guide of the model-level or class-level knowledge. See [49, 8, 50] for more overviews.
|
| 217 |
+
|
| 218 |
+
• Local Explainability. In general, there are two research lines. (1) Non-parametric explanation methods [10, 9, 11] use some heuristics as the feature contributions of a specific instance, without involving additional trainable models. Gradient-like scores [10, 9, 11] are wisely-used heuristics, which is obtained by backpropagating the model prediction or loss to the input features, such as adjacency matrix [10], along with the model architecture. (2) Parametric explanation methods [6, 19, 51, 52] additionally train a parametrized explainer model to generate the saliency maps or explanatory subgraphs for individual instances. The explainer model is typically optimized towards local fidelity [32, 48, 27], which uses the explanations to recover the target predictions. For example, GNNExplainer [6] learns soft masks for an instance and applies them on the adjacency matrix. PGM-Explainer [19] trains an Bayesian network upon the pairs of graph perturbations and prediction changes. However, these methods fall short in capturing the prototypical patterns shared within the same groups or classes.
|
| 219 |
+
|
| 220 |
+
• Global Explainability. This direction is less explored compared to the local explainability of GNNs [8]. To provide a global understanding of the model prediction, PGExplainer [7] formulates the generation of multiple explanations based on its collective and inductive property, and designs the attributor as a deep neural network whose parameters are shared across the explained instances. XGNN [13] explains GNNs by training a graph generator, which outputs class-wise graph patterns to explain this class. As it is designed to explain the holistic class, making it hardly applicable on an specific instance, e.g., the graph patterns may not even exit on the instance.
|
| 221 |
+
|
| 222 |
+
# 6 Conclusion and Future Work
|
| 223 |
+
|
| 224 |
+
Multi-grained explainability promises to offer a flexible and all-round inspection of deep models’ decision-making, which has been less explored in the literature. Motivated by this, we proposed a novel generative probabilistic model, ReFine, to approach the multi-granularity explainability via pre-training and fine-tuning. To exhibit global explanations with the prototypical patterns, the pre-training phase is founded upon the class-aware attribution modules and distills the class-level knowledge by contrastive learning. When given a specific instance, the fine-tuning phase further adapts the global explanations in the local context with high fidelity. In the fashion of pre-training and fine-tuning, we can generate explanations with both global patterns and local features. Extensive results in four datasets show that our method indeed improves the quality of explanatory subgraphs.
|
| 225 |
+
|
| 226 |
+
As future direction, we consider the extension of ReFine to fulfill the counterfactual explanation [53], which answers ‘Why the target GNN model made a certain prediction, rather than another prediction?”, to enrich the multi-granularity explainability. Further, multi-grained explainability can be exhibited to explore the model robustness and heuristically guide the model construction.
|
| 227 |
+
|
| 228 |
+
# Acknowledgments and Disclosure of Funding
|
| 229 |
+
|
| 230 |
+
Funding in direct support of this work: the Sea-NExT Joint Lab, Singapore MOE AcRF T2; the National Natural Science Foundation of China (U19A2079, 62121002); the National Key Research and Development Program of China (2020YFB1406703).
|
| 231 |
+
|
| 232 |
+
# References
|
| 233 |
+
|
| 234 |
+
[1] Vijay Prakash Dwivedi, Chaitanya K. Joshi, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. CoRR, abs/2003.00982, 2020.
|
| 235 |
+
|
| 236 |
+
[2] Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and Philip S. Yu. A comprehensive survey on graph neural networks. TNNLS, 32(1):4–24, 2021.
|
| 237 |
+
[3] Shruthi Chari, Daniel M. Gruen, Oshani Seneviratne, and Deborah L. McGuinness. Directions for explainable knowledge-enabled systems. In Knowledge Graphs for eXplainable Artificial Intelligence: Foundations, Applications and Challenges, pages 245–261. 2020.
|
| 238 |
+
[4] Christopher J. Anders, Plamen Pasliev, Ann-Kathrin Dombrowski, Klaus-Robert Müller, and Pan Kessel. Fairwashing explanations with off-manifold detergent. In ICML, pages 314–323, 2020.
|
| 239 |
+
[5] Sebastian Lapuschkin, Stephan Wäldchen, Alexander Binder, Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Unmasking clever hans predictors and assessing what machines really learn. Nature communications, 10(1):1–8, 2019.
|
| 240 |
+
[6] Zhitao Ying, Dylan Bourgeois, Jiaxuan You, Marinka Zitnik, and Jure Leskovec. Gnnexplainer: Generating explanations for graph neural networks. In NeurIPS, pages 9240–9251, 2019.
|
| 241 |
+
[7] Dongsheng Luo, Wei Cheng, Dongkuan Xu, Wenchao Yu, Bo Zong, Haifeng Chen, and Xiang Zhang. Parameterized explainer for graph neural network. In NeurIPS, 2020.
|
| 242 |
+
[8] Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. CoRR, abs/2012.15445, 2020.
|
| 243 |
+
[9] Federico Baldassarre and Hossein Azizpour. Explainability techniques for graph convolutional networks. CoRR, abs/1905.13686, 2019.
|
| 244 |
+
[10] Phillip E. Pope, Soheil Kolouri, Mohammad Rostami, Charles E. Martin, and Heiko Hoffmann. Explainability methods for graph convolutional neural networks. In CVPR, pages 10772–10781, 2019.
|
| 245 |
+
[11] Thomas Schnake, Oliver Eberle, Jonas Lederer, Shinichi Nakajima, K. T. Schutt, Klaus-Robert Muller, and Grégoire Montavon. Higher-order explanations of graph neural networks via relevant walks. arXiv, 2020.
|
| 246 |
+
[12] Michael Sejr Schlichtkrull, Nicola De Cao, and Ivan Titov. Interpreting graph neural networks for NLP with differentiable edge masking. CoRR, abs/2010.00577, 2020.
|
| 247 |
+
[13] Hao Yuan, Jiliang Tang, Xia Hu, and Shuiwang Ji. XGNN: towards model-level explanations of graph neural networks. In Rajesh Gupta, Yan Liu, Jiliang Tang, and B. Aditya Prakash, editors, KDD, pages 430–438, 2020.
|
| 248 |
+
[14] Marco Túlio Ribeiro, Sameer Singh, and Carlos Guestrin. "why should I trust you?": Explaining the predictions of any classifier. In KDD, pages 1135–1144, 2016.
|
| 249 |
+
[15] Jeremy Howard and Sebastian Ruder. Universal language model fine-tuning for text classification. In ACL, pages 328–339, 2018.
|
| 250 |
+
[16] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 251 |
+
[17] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, volume 119, pages 1597–1607, 2020.
|
| 252 |
+
[18] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, pages 9726–9735, 2020.
|
| 253 |
+
[19] Minh N. Vu and My T. Thai. Pgm-explainer: Probabilistic graphical model explanations for graph neural networks. In NeurIPS, 2020.
|
| 254 |
+
[20] Hongyang Gao and Shuiwang Ji. Graph u-nets. In ICML, volume 97, pages 2083–2092, 2019.
|
| 255 |
+
|
| 256 |
+
[21] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. ICLR, 2018.
|
| 257 |
+
[22] William L. Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In NeurIPS, pages 1024–1034, 2017.
|
| 258 |
+
[23] Xiang Wang, Xiangnan He, Meng Wang, Fuli Feng, and Tat-Seng Chua. Neural graph collaborative filtering. In SIGIR, pages 165–174, 2019.
|
| 259 |
+
[24] Xiang Wang, Xiangnan He, Yixin Cao, Meng Liu, and Tat-Seng Chua. KGAT: knowledge graph attention network for recommendation. In KDD, pages 950–958, 2019.
|
| 260 |
+
[25] Xiangnan He, Kuan Deng, Xiang Wang, Yan Li, Yong-Dong Zhang, and Meng Wang. Lightgcn: Simplifying and powering graph convolution network for recommendation. In SIGIR, pages 639–648, 2020.
|
| 261 |
+
[26] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In ICLR, 2019.
|
| 262 |
+
[27] Ian Covert, Scott Lundberg, and Su-In Lee. Feature removal is a unifying principle for model explanation methods. In NeurIPS, 2020.
|
| 263 |
+
[28] Marco Ancona, Enea Ceolini, Cengiz Öztireli, and Markus Gross. Towards better understanding of gradient-based attribution methods for deep neural networks. In ICLR, 2018.
|
| 264 |
+
[29] Constantin F Aliferis, Alexander Statnikov, Ioannis Tsamardinos, Subramani Mani, and Xenofon D Koutsoukos. Local causal and markov blanket induction for causal discovery and feature selection for classification part i: Algorithms and empirical evaluation. JMLR, 11(1), 2010.
|
| 265 |
+
[30] Peter D Hoff, Adrian E Raftery, and Mark S Handcock. Latent space approaches to social network analysis. Journal of the american Statistical association, 97(460):1090–1098, 2002.
|
| 266 |
+
[31] Max Welling Thomas N. Kipf. Variational graph auto-encoders. In NeurIPS Workshops, 2016.
|
| 267 |
+
[32] Jianbo Chen, Le Song, Martin J. Wainwright, and Michael I. Jordan. Learning to explain: An information-theoretic perspective on model interpretation. In ICML, pages 882–891, 2018.
|
| 268 |
+
[33] Lukas Faber, Amin K Moghaddam, and Roger Wattenhofer. Contrastive graph neural network explanation. 2021.
|
| 269 |
+
[34] R. Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Philip Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. In ICLR, 2019.
|
| 270 |
+
[35] Fan-Yun Sun, Jordan Hoffmann, Vikas Verma, and Jian Tang. Infograph: Unsupervised and semi-supervised graph-level representation learning via mutual information maximization. In ICLR, 2020.
|
| 271 |
+
[36] Yuning You, Tianlong Chen, Yongduo Sui, Ting Chen, Zhangyang Wang, and Yang Shen. Graph contrastive learning with augmentations. In NeurIPS, 2020.
|
| 272 |
+
[37] Jiancan Wu, Xiang Wang, Fuli Feng, Xiangnan He, Liang Chen, Jianxun Lian, and Xing Xie. Self-supervised graph learning for recommendation. In SIGIR, pages 726–735, 2021.
|
| 273 |
+
[38] Christopher Frye, Damien de Mijolla, Laurence Cowton, Megan Stanley, and Ilya Feige. Shapley-based explainability on the data manifold. In ICLR, 2021.
|
| 274 |
+
[39] H. W. Kuhn and A. W. Tucker. Contributions to the theory of games, volume 2. Princeton University Press, 1953.
|
| 275 |
+
[40] Jeroen Kazius, Ross McGuire, and Roberta Bursi. Derivation and validation of toxicophores for mutagenicity prediction. Journal of medicinal chemistry, 48(1):312–320, 2005.
|
| 276 |
+
[41] Kaspar Riesen and Horst Bunke. Iam graph database repository for graph based pattern recognition and machine learning. In SPR and SSPR, pages 287–297, 2008.
|
| 277 |
+
[42] Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay S. Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In ICLR, 2020.
|
| 278 |
+
[43] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A. Shamma, Michael S. Bernstein, and Li Fei-Fei. Visual genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 123(1):32–73, 2017.
|
| 279 |
+
[44] Johannes Klicpera, Aleksandar Bojchevski, and Stephan Günnemann. Predict then propagate: Graph neural networks meet personalized pagerank. In ICLR, 2019.
|
| 280 |
+
[45] Federico Monti, Davide Boscaini, Jonathan Masci, Emanuele Rodolà, Jan Svoboda, and Michael M. Bronstein. Geometric deep learning on graphs and manifolds using mixture model cnns. In CVPR, pages 5425–5434, 2017.
|
| 281 |
+
[46] Matthias Fey, Jan Eric Lenssen, Frank Weichert, and Heinrich Müller. Splinecnn: Fast geometric deep learning with continuous b-spline kernels. In CVPR, pages 869–877, 2018.
|
| 282 |
+
[47] Ekagra Ranjan, Soumya Sanyal, and Partha P. Talukdar. ASAP: adaptive structure aware pooling for learning hierarchical graph representations. In AAAI, pages 5470–5477, 2020.
|
| 283 |
+
[48] Jian Liang, Bing Bai, Yuren Cao, Kun Bai, and Fei Wang. Adversarial infidelity learning for model interpretation. In KDD, pages 286–296, 2020.
|
| 284 |
+
[49] Hao Yuan, Haiyang Yu, Shurui Gui, and Shuiwang Ji. Explainability in graph neural networks: A taxonomic survey. CoRR, 2020.
|
| 285 |
+
[50] Thomas Schnake, Oliver Eberle, Jonas Lederer, Shinichi Nakajima, Kristof T. Schütt, KlausRobert Müller, and Grégoire Montavon. XAI for graphs: Explaining graph neural network predictions by identifying relevant walks. CoRR, abs/2006.03589, 2020.
|
| 286 |
+
[51] Hao Yuan, Haiyang Yu, Jie Wang, Kang Li, and Shuiwang Ji. On explainability of graph neural networks via subgraph explorations. ArXiv, 2021.
|
| 287 |
+
[52] Patrick Schwab and Walter Karlen. Cxplain: Causal explanations for model interpretation under uncertainty. In NeurIPS, pages 10220–10230, 2019.
|
| 288 |
+
[53] Raha Moraffah, Mansooreh Karami, Ruocheng Guo, Adrienne Raglin, and Huan Liu. Causal interpretability for machine learning-problems, methods and evaluation. SIGKDD Explorations, 22(1):18–33, 2020.
|
md/train/KJ5h-yfUHa/KJ5h-yfUHa.md
ADDED
|
@@ -0,0 +1,272 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Attention Bottlenecks for Multimodal Fusion
|
| 2 |
+
|
| 3 |
+
Arsha Nagrani Shan Yang Anurag Arnab Aren Jansen Cordelia Schmid Chen Sun
|
| 4 |
+
|
| 5 |
+
{anagrani, shanyang, aarnab, arenjansen, cordelias, chensun}@google.com
|
| 6 |
+
|
| 7 |
+
Google Research
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
Humans perceive the world by concurrently processing and fusing highdimensional inputs from multiple modalities such as vision and audio. Machine perception models, in stark contrast, are typically modality-specific and optimised for unimodal benchmarks, and hence late-stage fusion of final representations or predictions from each modality (‘late-fusion’) is still a dominant paradigm for multimodal video classification. Instead, we introduce a novel transformer based architecture that uses ‘fusion bottlenecks’ for modality fusion at multiple layers. Compared to traditional pairwise self-attention, our model forces information between different modalities to pass through a small number of bottleneck latents, requiring the model to collate and condense relevant information in each modality and share what is necessary. We find that such a strategy improves fusion performance, at the same time reducing computational cost. We conduct thorough ablation studies, and achieve state-of-the-art results on multiple audio-visual classification benchmarks including Audioset, Epic-Kitchens and VGGSound. All code and models will be released.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Simultaneous multimodal sensations are a crucial enabler of human perceptual learning [50]. For artificial learning systems, however, designing a unified model for modality fusion is challenging due to a number of factors: (i) variations in learning dynamics between modalities [56], (ii) different noise topologies, with some modality streams containing more information for the task at hand than others, as well as (iii) specialised input representations. The difference in input representations between audio and vision is particularly stark – many state of the art audio classification methods rely on short term Fourier analysis to produce log-mel spectrograms, often using them as inputs to CNN architectures designed for images [26, 48]. These time-frequency representations have different distributions to images – multiple acoustic objects can have energy at the same frequency, and the translation invariances of CNNs may no longer be a desired property (while an acoustic object can be shifted in time, a shift in frequency could alter the meaning entirely). In contrast, the visual stream in a video is three-dimensional (two spatial and one temporal), and while different spatial regions of the image correspond to different objects, there is the unique challenge of high redundancy across multiple frames. Hence input representations, and consequently neural network architectures and benchmarks tend to vary wildly for different modalities. For simplicity, the dominant paradigm for multimodal fusion therefore often consists of an ad-hoc scheme that involves integrating separate audio and visual networks via their output representations or scores i.e. ‘late-fusion’ [22, 44].
|
| 16 |
+
|
| 17 |
+
In this work, we present a new transformer based model for audiovisual fusion in video. Despite originally being proposed for NLP tasks, there has been recent interest in transformers [54] as universal perceptual models [29], due to their ability to model dense correlations between tokens, at the same time making few assumptions about their inputs (and because continuous perceptual inputs can be tokenised). By dividing dense continuous signals into patches and rasterising them to 1D tokens, transformers have been shown to perform competitively for image (ViT [16]) and video classification (ViViT [6]), and more recently, audio classification (AST [23]). Because these models are able to elegantly handle variable length sequences, a natural first extension would be to feed in a sequence of both visual and auditory patches to a transformer, with minimal changes to the architecture. This ‘early fusion’ model allows free attention flow between different spatial and temporal regions in the image, as well as across frequency and time in the audio spectrogram. While theoretically appealing, we hypothesise that full pairwise attention at all layers of the model is not necessary because audio and visual inputs contain dense, fine-grained information, much of which is redundant. This is particularly the case for video, as shown by the performance of ‘factorised’ versions of [6]. Such a model would also not scale well to longer videos due to the quadratic complexity of pairwise attention with token sequence length. To mitigate this, we propose two methods to restrict the flow of attention in our model. The first follows from a common paradigm in multimodal learning, which is to restrict cross-modal flow to later layers of the network, allowing early layers to specialise in learning and extracting unimodal patterns. Henceforth this is is referred to as ‘mid fusion’ (Fig. 1, middle left), where the layer at which cross-modal interactions are introduced is called the ‘fusion layer’. The two extreme versions of this are ‘early fusion’ (all layers are cross-modal) and ‘late fusion’ (all are unimodal) which we compare to as a baselines. Our second idea (and main contribution), is to restrict cross-modal attention flow between tokens within a layer. We do this by allowing free attention flow within a modality, but force our model to collate and ‘condense’ information from each modality before sharing it with the other. The core idea is to introduce a small set of latent fusion units that form an ‘attention bottleneck’, through which cross-modal interactions within a layer must pass. We demonstrate that this ‘bottlenecked’ version, which we name Multimodal Bottleneck Transformer (MBT), outperforms or matches its unrestricted counterpart, but with lower computational cost.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Cross-modal Fusion. Unlike late fusion (left), where no cross-modal information is exchanged in the model until after the classifier, we investigate two pathways for the exchange of cross-modal information. The first is via standard pairwise self attention across all hidden units in a layer, but applied only to later layers in the model – mid fusion (middle, left). We also propose the use of ‘fusion bottlenecks’ (middle, right) that restrict attention flow within a layer through tight latent units. Both forms of restriction can be applied in conjunction (Bottleneck Mid Fusion) for optimal performance (right). We show $B = 2$ bottleneck units and 3 hidden units per modality. Grey boxes indicate tokens that receive attention flow from both audio and video tokens.
|
| 21 |
+
|
| 22 |
+
Concretely, we make the following contributions: (i) We propose a new architecture (MBT) for audiovisual fusion. Our model restricts the flow of cross-modal information between latent units through tight fusion ‘bottlenecks’, that force the model to collect and ‘condense’ the most relevant inputs in each modality (and therefore share only that which is necessary with the other modality). This avoids the quadratic scaling cost of full pairwise attention, and leads to performance gains with less compute; (ii) We apply MBT to image and spectogram patches (Fig. 2), and explore a number of ablations related to the fusion layer, the sampling of inputs and data size; and finally (iii) We set the new state-of-the-art for video classification across a number of popular audio-visual benchmarks, including AudioSet [21], Epic-Kitchens100 [12] and VGGSound [10]. On the Audioset dataset, we outperform the current state of the art by $5 . 9 \mathrm { m A P }$ ( $12 . 7 \%$ relative improvement).
|
| 23 |
+
|
| 24 |
+
# 2 Related work
|
| 25 |
+
|
| 26 |
+
Audiovisual learning: Audiovisual multimodal learning has a rich history, both before and during the deep learning era [47]. Given the limited available data and computational resources, early work focused on relatively simple early-stage (e.g. stacking hand-designed features) and late-stage (e.g. score fusion) techniques [11]. Deep learning has allowed more sophisticated strategies in which modality-specific or joint latents are implicitly learned to mediate the fusion. The result has enabled major advances in a range of downstream supervised audiovisual tasks [43, 34, 17]. In the supervised setting, multiple modality-specific convolution networks can be jointly trained, whose intermediate activations are then combined by summation [32] or via ‘lateral connections’ [57]. In the unsupervised setting, audiovisual learning is commonly used to learn good unimodal representations, with a popular pretraining task being to synchronise signals from different modalities via a contrastive loss [4, 5, 7, 44, 30, 2, 3], however each modality is usually encoded separately under this setup.
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 2: A Multimodal Fusion Transformer applied to audiovisual inputs. The input sequence consists of image and spectrogram patches. These are then projected into tokens and appended to special CLS (classification) and FSN (fusion bottleneck) tokens. Our transformer encoder then uses self attention to model unimodal information, and restricts cross-modal information flow via cross attention with the bottleneck tokens at multiple layers of the network.
|
| 30 |
+
|
| 31 |
+
Multimodal transformers: The self attention operation of transformers provides a natural mechanism to connect multimodal signals. Multimodal transformers have been applied to various tasks including audio enhancement [17, 53], speech recognition [24], image segmentation [58, 53], crossmodal sequence generation [39, 37, 49], image and video retrieval [25, 20, 8], visual navigation [46] and image/video captioning/classification [41, 52, 51, 36, 28]. For many works, the inputs to transformers are the output representations of single modality CNNs [35, 20] – unlike these works we use transformer blocks throughout, using only a single convolutional layer to rasterise 2D patches. The tokens from different modalities are usually combined directly as inputs to the transformers [38], for example, the recently released Perceiver model [29] introduces an iterative attention mechanism which takes concatenated raw multimodal signals as inputs, which corresponds to our ‘early fusion’ baseline. In contrast, we carefully examine the impact of different modality fusion strategies, including limiting cross-modal attention flow to later layers of our model, and ‘channeling’ cross-modal connections through bottlenecks in our proposed Multimodal Bottleneck Transformer (MBT).
|
| 32 |
+
|
| 33 |
+
# 3 Multimodal fusion transformers
|
| 34 |
+
|
| 35 |
+
In this section we describe our proposed Multimodal Bottleneck Transformer (MBT). We begin by summarising the recently proposed Vision Transformer (ViT) [16] and Audio Spectrogram Transformer (AST) [23], developed for image and audio classification respectively, in Sec. 3.1. We then describe our extension to the audio-visual fusion case. We discuss three different token fusion strategies (Sec. 3.2), and finally discuss the fusion pathway in the entire model (Sec. 3.3), which involves restricting multimodal fusion to certain layers of the model.
|
| 36 |
+
|
| 37 |
+
# 3.1 The ViT and AST architectures
|
| 38 |
+
|
| 39 |
+
Vision Transformer (ViT) [16] (and a recent extension to audio – Audio Spectrogram Transformer (AST) [23]) adapts the Transformer architecture [54], originally designed for natural language processing, to process 2D inputs with minimal changes. The key insight is to extract $N$ nonoverlapping patches from the RGB image (or the audio spectrogram), $x _ { i } \in \mathbb { R } ^ { h \times w }$ , and convert them into a series of 1D tokens $z _ { i } \in \mathbb { R } ^ { d }$ , as follows:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathbf { z } = g ( \mathbf { x } ; \mathbf { E } , z _ { \mathrm { c l s } } ) = \left[ z _ { \mathrm { c l s } } , \mathbf { E } x _ { 1 } , \mathbf { E } x _ { 2 } , . . . , \mathbf { E } x _ { N } \right] + \mathbf { p } .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Here, $\mathbf { E }$ is a linear projection mapping each token to $\mathbb { R } ^ { d }$ , $z _ { \mathrm { c l s } }$ is a special token prepended to this sequence so that its representation at the final layer can be passed to a classifier for classification tasks [15], and $\mathbf { p } \in \bar { \mathbb { R } } ^ { ( N + 1 ) \times d }$ is a learned positional embedding added to the tokens to retain positional information (as all subsequent self-attention operations are permutation invariant).
|
| 46 |
+
|
| 47 |
+
The tokens are then passed through an encoder consisting of a sequence of $L$ transformer layers. Each transformer layer consists of Multi-Headed Self-Attention (MSA), Layer Normalisation (LN) and Multilayer Perceptron (MLP) blocks applied using residual connections. We denote a transformer layer, $\mathbf { z } ^ { \bar { l } + 1 } = \mathrm { T r a n s f o r m e r } ( \mathbf { z } ^ { l } )$ as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\begin{array} { r } { \mathbf { y } ^ { l } = \mathrm { M S A } ( \mathrm { L N } ( \mathbf { z } ^ { l } ) ) + \mathbf { z } ^ { l } } \\ { \mathbf { z } ^ { l + 1 } = \mathrm { M L P } ( \mathrm { L N } ( \mathbf { y } ^ { l } ) ) + \mathbf { y } ^ { l } . } \end{array}
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Here, the MSA operation [54] computes dot-product attention [54] where the queries, keys and values are all linear projections of the same tensor, $\operatorname { M S A } ( \mathbf { X } ) = \operatorname { A t t e n t i o n } ( \mathbf { W } ^ { Q } \mathbf { X } , \mathbf { W } ^ { K } \mathbf { X } , { \dot { \mathbf { W } } } ^ { V } \mathbf { X } )$ . We further define Multi-Headed Cross Attention (MCA) between two tensors, $\mathbf { X }$ and $\mathbf { Y }$ , where $\mathbf { X }$ forms the query and $\mathbf { Y }$ forms the keys and values which are used to reweight the query as $\operatorname { M C A } ( \mathbf { X } , \mathbf { Y } ) = \operatorname { A t t e n t i o n } ( \mathbf { W } ^ { Q } \mathbf { X } , \mathbf { W } ^ { K } \mathbf { Y } , \mathbf { W } ^ { V } \mathbf { Y } )$ . This will be used in our multimodal case, as described next.
|
| 54 |
+
|
| 55 |
+
# 3.2 Multimodal transformer
|
| 56 |
+
|
| 57 |
+
We now describe our extension to the multimodal case. We begin by discussing three different token fusion strategies.
|
| 58 |
+
|
| 59 |
+
# 3.2.1 Fusion via vanilla self-attention
|
| 60 |
+
|
| 61 |
+
We begin by describing a ‘vanilla’ fusion model, which simply consists of the regular transformer applied to multimodal inputs. Our method of tokenising video is straightforward – given a video clip of length $t$ seconds, we uniformly sample $F$ RGB frames and convert the audio waveform into a single spectrogram. We then embed each frame and the spectrogram independently following the encoding proposed in ViT [16], and concatenate all tokens together into a single sequence.
|
| 62 |
+
|
| 63 |
+
Formally, if we have extracted a total of $N _ { v }$ RGB patches from all $F$ sampled frames, $\mathbf { x } _ { \mathrm { r g b } } \in \mathbb { R } ^ { N _ { v } \times d }$ and $N _ { a }$ spectrogram patches, $\mathbf { x } _ { \mathrm { s p e c } } \in \mathbb { R } ^ { N _ { a } \times d }$ , our sequence of tokens is
|
| 64 |
+
|
| 65 |
+
$\mathbf { z } = [ \mathbf { z } _ { \mathrm { r g b } } | | \mathbf { z } _ { \mathrm { s p e c } } ]$ where ${ \bf z } _ { \mathrm { r g b } } = g ( { \bf x } _ { \mathrm { r g b } } ; { \bf E } _ { \mathrm { r g b } } , z _ { \mathrm { c l s - r g b } } )$ and $\begin{array} { r } { \mathbf { z } _ { \mathrm { s p e c } } = g ( \mathbf { x } _ { \mathrm { s p e c } } ; \mathbf { E } _ { \mathrm { s p e c } } , z _ { \mathrm { c l s - s p e c } } ) . } \end{array}$ (4) Here, $\left[ \mathbf { z } _ { \mathrm { r g b } } | | \mathbf { z } _ { \mathrm { s p e c } } \right]$ denotes the concatenation of the tokens for each modality. We use different projections $\mathbf { E } _ { \mathrm { r g b } }$ and $\mathbf { E } _ { \mathrm { s p e c } }$ for RGB and spectrogram patches respectively, and prepend a separate classification token for each modality.
|
| 66 |
+
|
| 67 |
+
Our multimodal encoder then applies a series of transformer layers in the same manner as above. Attention is allowed to flow freely through the network, i.e. each RGB token can attend to all other RGB and spectrogram tokens as follows: $\mathbf { \bar { z } } ^ { l + 1 } = \mathrm { T r a n s f o r m e r } ( \mathbf { z } ^ { l } ; \theta )$ with model parameters $\theta$ . Here Transformer refers to a standard transformer layer with vanilla self-attention blocks.
|
| 68 |
+
|
| 69 |
+
# 3.2.2 Fusion with modality-specific parameters
|
| 70 |
+
|
| 71 |
+
We can generalise this model by allowing each modality to have its own dedicated parameters $\theta _ { \mathrm { r g b } }$ and $\theta _ { \mathrm { s p e c } }$ , but still exchange information via the attention mechanism. For this purpose, we define a Cross-Transformer layer:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r l } & { \mathbf { z } _ { \mathrm { r g b } } ^ { l + 1 } = \mathrm { C r o s s - T r a n s f o r m e r } ( \mathbf { z } _ { \mathrm { r g b } } ^ { l } , \mathbf { z } ^ { l } ; \theta _ { \mathrm { r g b } } ) } \\ & { \mathbf { z } _ { \mathrm { s p e c } } ^ { l + 1 } = \mathrm { C r o s s - T r a n s f o r m e r } ( \mathbf { z } _ { \mathrm { s p e c } } ^ { l } , \mathbf { z } ^ { l } ; \theta _ { \mathrm { s p e c } } ) , } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where the Cross-Transformer employs the generalised cross-attention operation that takes two sets of inputs $\mathbf { z } _ { 1 }$ and $\mathbf { z } _ { 2 }$ that are not necessarily overlapping. This layer follows the original transformer layer with the difference being that Eq. 2 becomes
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathbf { y } ^ { l } = \mathrm { M C A } ( \mathrm { L N } ( \mathbf { z } _ { 1 } ^ { l } ) , \mathrm { L N } ( \mathbf { z } _ { 2 } ^ { l } ) ) + \mathbf { z } _ { 1 } ^ { l } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Finally, note that we have explicitly defined the parameters, $\theta _ { \mathrm { r g b } }$ and $\theta _ { \mathrm { s p e c } }$ of the cross-transformer layers in Eq. 5 as they are different for each modality. However, when $\theta _ { \mathrm { r g b } }$ and $\theta _ { \mathrm { s p e c } }$ are equal, $\theta _ { \mathrm { r g b } } = \theta _ { \mathrm { s p e c } } = \theta ,$ ), the computation defined in Eq. 5 is equivalent to Sec. 3.2.1.
|
| 84 |
+
|
| 85 |
+
# 3.2.3 Fusion via attention bottlenecks
|
| 86 |
+
|
| 87 |
+
In order to tame the quadratic complexity of pairwise attention, we next introduce a small set of $B$ fusion bottleneck tokens $\mathbf { z } _ { \mathrm { f s n } } = [ \dot { z } _ { \mathrm { f s n } } ^ { 1 } , z _ { \mathrm { f s n } } ^ { \dot { 2 } } , \dots , z _ { \mathrm { f s n } } ^ { B } ]$ to our input sequence (see Fig. 2). The input sequence is now
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathbf { z } = [ \mathbf { z } _ { \mathrm { r g b } } | | \mathbf { z } _ { \mathrm { f s n } } | | \mathbf { z } _ { \mathrm { s p e c } } ] .
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
We then restrict all cross-modal attention flow in our model to be via these bottleneck tokens. More formally for layer $l$ , we compute token representations as follows:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { [ \mathbf { z } _ { \mathrm { i } } ^ { l + 1 } | | \hat { \mathbf { z } } _ { \mathrm { f s n } _ { i } } ^ { l + 1 } ] = \mathrm { T r a n s f o r m e r } ( [ \mathbf { z } _ { \mathrm { i } } ^ { l } | | \mathbf { z } _ { \mathrm { f s n } } ^ { l } ] ; \theta _ { \mathrm { i } } ) } \\ & { \qquad \mathbf { z } _ { \mathrm { f s n } } ^ { l + 1 } = \mathrm { A v g _ { i } } ( \hat { \mathbf { z } } _ { \mathrm { f s n } _ { i } } ^ { l + 1 } ) } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
Here $i$ indexes each modality, in this case RGB and Spec, and $\mathbf { z } _ { \mathrm { r g b } }$ and $\mathbf { z } _ { \mathrm { s p e c } }$ can only exchange information via the bottleneck $\mathbf { z } _ { \mathrm { f s n } }$ within a transformer layer. We first create modality specific temporary bottleneck fusion tokens $\hat { \mathbf { z } } _ { \mathrm { f s n } _ { i } }$ , which are updated separately and simultaneously with audio and visual information (Equation 8). The final fusion tokens from each cross-modal update are then averaged in Equation 9. We also experiment with asymmetric updates for the bottleneck tokens (see appendix) and found performance was robust to this choice. We keep the number of bottleneck tokens in the network to be much smaller than the total number of latent units per modality $B \ll N _ { v }$ and $B \ll N _ a , $ ). Because all cross-modal attention flow must pass through these units, these tight ‘fusion’ bottlenecks force the model to condense information from each modality and share that which is necessary. As we show in the experiments, this increases or maintains performance for multimodal fusion, at the same time reducing computational complexity. We also note that our formulation is generic to the type and the number of modalities.
|
| 100 |
+
|
| 101 |
+
# 3.3 Where to fuse: early, mid and late
|
| 102 |
+
|
| 103 |
+
The above strategies discuss fusion within a layer, and in most transformer architectures (such as ViT), every layer consists of an identical set of operations. A common paradigm in multimodal learning, however, is to restrict early layers of a network to focus on unimodal processing, and only introduce cross-modal connections at later layers. This is conceptually intuitive if we believe lower layers are involved in processing low level features, while higher layers are focused on learning semantic concepts – low-level visual features such as edges and corners in images might not have a particular sound signature, and therefore might not benefit from early fusion with audio [57].
|
| 104 |
+
|
| 105 |
+
This can be implemented with our model as follows: We initially perform vanilla self-attention among tokens from a single modality for $L _ { f }$ layers. Thereafter, we concatenate all latent tokens together, $\mathbf { z } ^ { L _ { f } } = [ \mathbf { z } _ { \mathrm { r g b } } ^ { L _ { f } } | | \mathbf { z } _ { \mathrm { s p e c } } ^ { L _ { f } } ]$ and pass them through the remaining $L - L _ { f }$ layers where the tokens are fused according to Sec. 3.2. Here, $L _ { f } = 0$ corresponds to an ‘early-fusion’ model, $L _ { f } = L$ a ‘late-fusion’ model, and $0 < L _ { f } < L$ a ‘mid-fusion’ one. More formally, this can be denoted as
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r l } & { \mathbf { z } _ { \mathrm { r g b } } ^ { l + 1 } = \mathrm { T r a n s f o r m e r } ( \mathbf { z } _ { \mathrm { r g b } } ^ { l } ; \theta _ { \mathrm { r g b } } ) , \mathbf { z } _ { \mathrm { s p e c } } ^ { l + 1 } = \mathrm { T r a n s f o r m e r } ( \mathbf { z } _ { \mathrm { s p e c } } ^ { l } ; \theta _ { \mathrm { s p e c } } ) } & { \mathrm { i f ~ } l < L _ { f } } \\ & { \mathbf { z } ^ { l } = [ \mathbf { z } _ { \mathrm { r g b } } ^ { l } | | \mathbf { z } _ { \mathrm { s p e c } } ^ { l } ] , \mathbf { z } ^ { l + 1 } = \mathrm { M u l t i m o d a l - T r a n s f o r m e r } ( \mathbf { z } ^ { l } ; \theta _ { \mathrm { s p e c } } , \theta _ { \mathrm { r g b } } ) } & { \mathrm { o t h e r w i s e } } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where Multimodal-Transformer $( \cdot )$ can refer to either of the 3 fusion strategies described in Sec 3.2.
|
| 112 |
+
|
| 113 |
+
# 3.4 Classification
|
| 114 |
+
|
| 115 |
+
For all model variants described above, we pass output representations of the CLS tokens $z _ { \mathrm { c l s - r g b } } ^ { L }$ and $z _ { \mathrm { c l s - s p e c } } ^ { L }$ to the same linear classifier and average the pre-softmax logits.
|
| 116 |
+
|
| 117 |
+
# 4 Experiments
|
| 118 |
+
|
| 119 |
+
We apply MBT to the task of video classification. In this section we first describe the datasets used to train and test multimodal fusion and their respective evaluation protocols (Sec. 4.1), then discuss implementation details (Sec. 4.2). We then ablate the key design choices in our model (Sec. 4.3), before finally comparing our model to the state of the art (Sec. 4.4).
|
| 120 |
+
|
| 121 |
+
# 4.1 Datasets and evaluation protocol
|
| 122 |
+
|
| 123 |
+
We experiment with three video classification datasets – AudioSet [21], Epic-Kitchens-100 [12] and VGGSound [10], described in more detail below. Results on two additional datasets Moments in Time [42] and Kinetics [31] are provided in the appendix.
|
| 124 |
+
|
| 125 |
+
AudioSet [21] consists of almost 2 million 10-second video clips from YouTube, annotated with 527 classes. Like other YouTube datasets, this is a dynamic dataset (we only use the clips still available online). This gives us 20,361 clips for the balanced train set (henceforth referred to as mini-AudioSet or miniAS) and 18,589 clips for the test set. This test set is exactly the same as recent works we compare to, including Perceiver [29]. Instead of using the 2M unbalanced training set, we train on a (slightly more) balanced subset consisting of 500K samples (AS-500K). Details are provided in the appendix. Because each sample has multiple labels, we train with a binary cross-entropy (BCE) loss and report mean average precision (mAP) over all classes, following standard practice.
|
| 126 |
+
|
| 127 |
+
Epic-Kitchens 100 [12] consists of egocentric videos capturing daily kitchen activities. The dataset consists of 90,000 variable length clips spanning 100 hours. We report results for action recognition following standard protocol [12] - each action label is a combination of a verb and noun, and we predict both using a single network with two ‘heads’, both trained with a cross-entropy loss. The top scoring verb and action pair predicted by the network are used, and Top-1 action accuracy is the primary metric. Actions are mainly short-term (average length is 2.6s with minimum length 0.25s).
|
| 128 |
+
|
| 129 |
+
VGGSound [10] contains almost 200K video clips of length 10s, annotated with 309 sound classes consisting of human actions, sound-emitting objects and human-object interactions. Unlike AudioSet, the sound source for each clip is ‘visually present’ in the video. This was ensured during dataset creation through the use of image classifiers. After filtering clips that are no longer available on YouTube, we end up with 172,427 training and 14,448 test clips. We train with a standard crossentropy loss for classification and report Top-1 and Top-5 classification accuracy.
|
| 130 |
+
|
| 131 |
+
# 4.2 Implementation details
|
| 132 |
+
|
| 133 |
+
Our backbone architecture follows that of ViT [16] identically, specifically we use ViT-Base (ViT-B, $L = 1 2$ , $N _ { H } = 1 2$ , $d = 3 0 7 2 )$ initialised from ImageNet-21K [14], however we note that our method is agnostic to transformer backbone. Unless otherwise specialised, we use $B = 4$ bottleneck tokens for all experiments with bottleneck fusion. Bottleneck tokens are initialized using a Gaussian with mean of 0 and standard deviation of 0.02, similar to the positional embeddings in the public ViT [16] code. We randomly sample clips of $t$ seconds for training. RGB frames for all datasets are extracted at 25 fps. For AudioSet and VGGSound we sample 8 RGB frames over the sampling window of length $t$ with a uniform stride of length $( t \times 2 5 ) / \bar { 8 }$ . We extract $1 6 \times 1 6$ patches from each frame of size $2 2 4 \times 2 2 4$ , giving us a total of $8 \times 1 4 \times 1 4 = 1 5 6 8$ patches per video. For Epic-Kitchens (because the segments are shorter), we sample 32 frames with stride 1. Audio for all datasets is sampled at $1 6 \mathrm { k H z }$ and converted to mono channel. Similar to [23], we extract log mel spectrograms with a frequency dimension of 128 computed using a $2 5 \mathrm { m s }$ Hamming window with hop length $1 0 \mathrm { m s }$ . This gives us an input of size $1 2 8 \times 1 0 0 t$ for $t$ seconds of audio. Spectrogram patches are extracted with size $1 6 \times 1 6$ , giving us $5 0 \times 8 = 4 0 0$ patches for 8 seconds of audio. For images we apply the standard data augmentations used in [6] (random crop, flip, colour jitter), and for spectrograms we use SpecAugment [45] with a max time mask length of 192 frames and max frequency mask length of 48 bins following AST [23]. We set the base learning rate to 0.5 and train for 50 epochs, using Mixup [59] with $\alpha = 0 . 3$ and stochastic depth regularisation [27] with probability $p = 0 . 3$ . All models (across datasets) are trained with a batch size of 64, synchronous SGD with momentum of 0.9, and a cosine learning rate schedule with warmup of 2.5 epochs on TPU accelerators using the Scenic library [13].
|
| 134 |
+
|
| 135 |
+
Inference: Following standard practice, we uniformly sample multiple temporal crops from the clip and average per-view logits to obtain the final result. The number of test crops is set to 4.
|
| 136 |
+
|
| 137 |
+
# 4.3 Ablation analysis
|
| 138 |
+
|
| 139 |
+
In this section we investigate the impact of the different architectural choices in MBT. Unless otherwise specified, we use the mini-AudioSet split for training and report results on the AudioSet eval split. More ablations on backbone size and pretraining initalisation can be found in the appendix.
|
| 140 |
+
|
| 141 |
+
# 4.3.1 Fusion strategies
|
| 142 |
+
|
| 143 |
+
We implement all the three fusion strategies described in Sec. 3.2:
|
| 144 |
+
|
| 145 |
+
(i) Vanilla self-attention – Unrestricted pairwise attention between all latent units within a layer; (ii) Vanilla cross-attention with separate weights: Same as above, but we now have separate weights for each modality. The latent units are updated via pairwise attention with all other latent units from both modalities; and finally
|
| 146 |
+
|
| 147 |
+
(iii) Bottleneck fusion: Here all cross-modal attention must pass through bottleneck fusion latents. Note that these three fusion strategies only describe attention flow between tokens within a layer. For strategies (ii) and (iii), we also conduct experiments showing the impact of restricting cross-modal attention to layers after a fixed fusion layer $L _ { f }$ . We investigate models with different fusion layers, $L _ { f } = 0 , 2 , 4 , 6 , 8 , 1 0 , 1 2$ , and present the results in Fig. 3.2
|
| 148 |
+
|
| 149 |
+
Sharing weights for both modalities: We first investigate the impact of sharing the encoder weights for both modalities (strategy (i) vs (ii)). The results can be found in Fig. 1 in the appendix. When modalities are fused at earlier layers, using separate encoders improves performance. For models with later fusion layers, performance is similar for both models. We hence use separate modality weights for further experiments.
|
| 150 |
+
|
| 151 |
+
Fusion layer: We then investigate the impact of varying the fusion layer $L _ { f }$ , for the latter two strategies: (ii) Vanilla Cross-Attention and (iii) Bottleneck Fusion. We conduct experiments with $L _ { f } = \stackrel { \_ } { 0 } , 2 , 4 , 6 , 8 , 1 0 , 1 2$ . We fix the input span $t$ to 4s and the number of bottleneck tokens $B$ to 4. We conduct 3 runs for each experiment and report mean and std deviation. As can be seen from Fig. 3 (left), ‘mid fusion’ outperforms both early $( L _ { f } = 0 )$ ) and late fusion $( L _ { f } = 1 2 )$ ), with optimal performance obtained by using fusion layer $L _ { f } = 1 0$ for vanilla cross-attention and $L _ { f } = 8$ for bottleneck attention. This suggests that the model benefits from restricting cross-modal connections to later layers, allowing earlier layers to specialise to learning unimodal features, however still benefits from multiple layers of cross-modal information flow. In appendix $\mathbf { D }$ , we confirm that mid fusion outperforms late fusion across a number of different datasets.
|
| 152 |
+
|
| 153 |
+
Attention bottlenecks: In Fig. 3, we also examine the effect of bottleneck attention vs vanilla cross-attention for multimodal fusion. We find that for all values of $L _ { f }$ restricting flow to bottlenecks improves or maintains performance, with improvements more prominent at lower values of $L _ { f }$ . At $L _ { f } = 1 0$ , both perform similarly, note that at this stage we only have 3 fusion layers in the model. Our best performing model uses attention bottlenecks with $L _ { f } = 8$ , and we fix this for all further experiments. We also compare the amount of computation, measured in GFLOPs, for both fusion strategies (Fig. 3, right). Using a small number of bottleneck tokens (in our experiments $B = 4$ ) adds negligible extra computation over a late fusion model, with computation remaining largely constant with varying fusion layer $L _ { f }$ . This is in contrast to vanilla cross-fusion, which has a non-negligible computational cost for every layer it is applied to. We note that for early fusion $\begin{array} { r } { { \cal L } _ { f } = 0 } \end{array}$ ), bottleneck fusion outperforms vanilla cross-attention by over $2 \mathrm { m A P } ,$ , with less than half the computational cost.
|
| 154 |
+
|
| 155 |
+
Number of bottleneck tokens $B$ : We experiment with $B = 4$ , 36, 64, 256 and 1024, and find that performance is relatively consistent (all within $0 . 5 \mathrm { \ m A P }$ ). We hence fix the number of tokens to $B = 4$ for all experiments. It is interesting that with such a small number of cross-modal connections through only 4 hidden units $B = 4$ ) at each cross-modal layer, we get large performance gains over late fusion (Fig. 3), highlighting the importance of allowing cross-modal information to flow at multiple layers of the model.
|
| 156 |
+
|
| 157 |
+
# 4.3.2 Input sampling and dataset size
|
| 158 |
+
|
| 159 |
+
In this section we investigate the impact of different modality sampling strategies. We also compare to single modality baselines – the visual-only and audio-only baselines consist of a vanilla transformer model applied to only the RGB or spectrogram patches respectively.
|
| 160 |
+
|
| 161 |
+
Sampling window size $t$ : An advantage of our transformer based model is that we can easily input variable length token sequences. We experiment with varying the sampling window $t$ with the following values $t = 2 , 4 , 6$ and 8 seconds (note that all videos in AudioSet are 10s), and show results in Fig. $\bar { 4 ^ { 3 } }$ . At inference, we uniformly sample multiple windows covering the entire video. While the number of spectrogram patches $N _ { a }$ changes with $t$ , we keep the number of RGB patches $N _ { v }$ fixed by changing the stride of frames (to avoid running out of memory). Our results indicate that the performance of both the audio and audio-visual fusion model increases with input span, however the performance of the visual-only model slightly decreases (we hypothesize that this is due to the increased fixed stride, meaning fewer frames are randomly sampled during training). We fix $t = 8 s$ in all further experiments.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 3: The impact of using attention bottlenecks for fusion on performance (left) and compute (right) at different fusion layers $L _ { f }$ on AudioSet, using clip span $t = 4$ and $B = 4$ bottleneck tokens. Attention bottlenecks improve performance at lower computational cost.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: The effect of varying input clip span $t$ on the AudioSet test set.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 5: The effect of training data size on the AudioSet test set.
|
| 171 |
+
|
| 172 |
+
Synchronous vs asynchronous sampling: Given that auditory and visual events may not always be perfected aligned in videos [32], we also investigate asynchronous sampling of different modalities. Here input windows are sampled independently from the entire video clip for each modality. Results are provided in Fig. 2 in the appendix. We find performance to be largely robust to either case, and so for simplicity we use synchronised sampling for all further experiments.
|
| 173 |
+
|
| 174 |
+
Modality MixUp: While applying Mixup regularization [59] to training, we note that there are two different ways to apply it for multimodal inputs – the standard approach is to sample one set of mixup weights from a Beta distribution using the parameter $\alpha$ , and use it to generate all virtual modality-label pairs [59]. We also explore a modified version which we call modality mixup, which samples an independent weight for each modality. Modality mixup imposes stronger augmentation than standard mixup, leading to a slight improvement $( 4 2 . 6 \ : \mathrm { m A P }$ to $4 3 . 9 \mathrm { m A P }$ ) on AudioSet.
|
| 175 |
+
|
| 176 |
+
Impact of dataset size: We show the impact of varying the number of training samples in Fig. 5, and find a monotonic increase with dataset size (more steeply for audio-only than visual-only).
|
| 177 |
+
|
| 178 |
+
# 4.4 Results
|
| 179 |
+
|
| 180 |
+
Comparison to single modality performance: We compare MBT to visual-only and audio-only baselines on AudioSet (Table 1), Epic-Kitchens (Table 2) and VGGSound (Table 3). Note we use the best parameters obtained via the ablations above, i.e. bottleneck fusion with $t = 8$ , $B = 4$ , $F _ { l } = 8$ and modality mixup. For all datasets, multimodal fusion outperforms the higher-performing single modality baseline, demonstrating the value of complementary information. The relative importance of modalities for the classification labels varies (audio-only has higher relative performance for AudioSet and lower for Epic-Kitchens, while both audio and visual baselines are equally strong for VGGSound). This is (unsurprisingly) largely a function of the dataset annotation procedure and positions VGGSound as a uniquely suitable dataset for fusion. We also show that audio-visual fusion provides slight performance gains for traditionally video only datasets such as Kinetics and Moments in Time (details provided in Appendix C ). We also examine per-class performance on the Audioset dataset (Figures 3 and 4 in the Appendix), and find that for the top 60 classes (ranked by overall performance), audio-visual fusion improves performance over audio only or visual only for almost all (57 out of 60) classes, except for ‘bagpiping’, ‘emergency vehicle’ and ‘didgeridoo’ which have strong audio signatures. For classes such as ‘bicycle’ and ‘shuffling cards’ where audio signals are weaker, fusion improves over the audio-only baseline by over $60 \%$ in absolute AP.
|
| 181 |
+
|
| 182 |
+
Table 1: Comparison to SOTA on AudioSet [21]. We report mean average precision (mAP). We outperform works that train on the full Audioset (2M samples), while we train on only $5 0 0 \mathrm { K }$ samples.
|
| 183 |
+
|
| 184 |
+
<table><tr><td>Model</td><td>Training Set</td><td>tAonly</td><td>V only</td><td>AVFusion</td></tr><tr><td>GBlend [56]</td><td>MiniAS</td><td>29.1</td><td>22.1</td><td>37.8</td></tr><tr><td>GBlend [56]</td><td>FullAS-2M</td><td>32.4</td><td>18.8</td><td>41.8</td></tr><tr><td>Attn Audio-Visual[18]</td><td>FullAS-2M</td><td>38.4</td><td>25.7</td><td>46.2</td></tr><tr><td>Perceiver [29]</td><td>FullAS-2M</td><td>38.4</td><td>25.8</td><td>44.2</td></tr><tr><td>MBT</td><td>MiniAS</td><td>31.3</td><td>27.7</td><td>43.9</td></tr><tr><td>MBT</td><td>AS-500K</td><td>44.3</td><td>32.3</td><td>52.1</td></tr></table>
|
| 185 |
+
|
| 186 |
+
Table 2: Comparison to SOTA on EpicKitchens-100 [12]. Modalities are A: Audio, V: Visual, F: Optical flow. †Uses pretraining on VGGSound.
|
| 187 |
+
|
| 188 |
+
<table><tr><td>Model</td><td>Modalities</td><td>Verb</td><td>Noun</td><td>Action</td></tr><tr><td>Damen et al. [12]</td><td>A</td><td>42.1</td><td>21.5</td><td>14.8</td></tr><tr><td>AudioSlowFast [33]t</td><td>A</td><td>46.5</td><td>22.78</td><td>15.4</td></tr><tr><td>TSN [55]</td><td>V,F</td><td>60.2</td><td>46.0</td><td>33.2</td></tr><tr><td>TRN [60]</td><td>V,F</td><td>65.9</td><td>45.4</td><td>35.3</td></tr><tr><td>TBN [32]</td><td>A,V,F</td><td>66.0</td><td>47.2</td><td>36.7</td></tr><tr><td>TSM[40]</td><td>V,F</td><td>67.9</td><td>49.0</td><td>38.3</td></tr><tr><td>SlowFast [19]</td><td>V</td><td>65.6</td><td>50.0</td><td>38.5</td></tr><tr><td>MBT</td><td>A</td><td>44.3</td><td>22.4</td><td>13.0</td></tr><tr><td>MBT</td><td>V</td><td>62.0</td><td>56.4</td><td>40.7</td></tr><tr><td>MBT</td><td>A,V</td><td>64.8</td><td>58.0</td><td>43.4</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Comparison to state of the art: We compare MBT to previous fusion methods on AudioSet in Table 1. We outperform all previous works on fusion (even though we only train on a quarter of the training set – 500K samples), including the recently introduced Perceiver [29] which uses early fusion followed by multiple self attention layers, and Attn Audio-Visual [18] which uses self-attention fusion on top of individual modality CNNs. We compare to previous video classification methods on Epic-Kitchens in Table 2, and note that our model outperforms all previous works that use vision only, as well as TBN [32] which uses three modalities - RGB, audio and optical flow. Given VGGSound is a relatively new dataset, we compare to two existing audio-only works4 (Table 3), and set the first audiovisual benchmark (that we are aware of) on this dataset.
|
| 191 |
+
|
| 192 |
+
Table 3: Comparison to the state of the art on VGGSound [10]. Modalities are A: Audio, V: Visual, F: Optical flow. $\ddagger$ We calculate metrics on our test set for a fair comparison using the scores provided by the authors.
|
| 193 |
+
|
| 194 |
+
<table><tr><td>Model</td><td>Modalities</td><td>Top-1 Acc</td><td>Top-5 Acc</td></tr><tr><td>Chen et al‡ [10]</td><td>A</td><td>48.8</td><td>76.5</td></tr><tr><td>AudioSlowFastt [33]</td><td>A</td><td>50.1</td><td>77.9</td></tr><tr><td>MBT</td><td>A</td><td>52.3</td><td>78.1</td></tr><tr><td>MBT</td><td>V</td><td>51.2</td><td>72.6</td></tr><tr><td>MBT</td><td>A,V</td><td>64.1</td><td>85.6</td></tr></table>
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 6: Attention Maps. We compute maps of the attention from the output CLS tokens to the RGB image input space for a vanilla self-attention model and MBT on the Audioset test set. For each video clip, we show the original middle frame on the left with the ground truth labels overlayed at the bottom. The attention is particularly focused on sound source regions in the video that contain motion, eg. the fingertips on the piano, the hands on the string instrument, faces of humans. The bottlenecks in MBT further force the attention to be localised to smaller regions of the images (i.e the mouth of the baby on the top left and the mouth of the woman singing on the bottom right).
|
| 198 |
+
|
| 199 |
+
Visualisation of attention maps Finally, we compute maps of the attention from the output CLS tokens to the RGB image input space using Attention Rollout [1]. Results on test images for both a vanilla fusion model and MBT trained on Audioset-mini (fusion layer $L _ { f } = 8$ ) are shown in Figure 6. We show the attention maps summed over all the frames in the video clip. We note that first, the model focuses on semantically salient regions in the video for audio classification, particularly regions where there is motion that creates or modifies sound, i.e. the mouth of humans making sounds, fingertips on a piano, hands and instruments. This is unlike state of the art sound source localisation techniques trained with images [9], which tend to highlight the entire object. We further note that the attention maps for MBT are more localised to these regions, showing that the tight bottlenecks do force the model to focus only on the image patches that are actually relevant for the audio classification task and which benefit from early fusion with audio.
|
| 200 |
+
|
| 201 |
+
# 5 Conclusion
|
| 202 |
+
|
| 203 |
+
We propose a new transformer architecture (MBT) for audiovisual fusion, and explore a number of different fusion strategies using cross-attention between latent tokens. We propose a novel strategy to restrict cross-modal attention via a small set of fusion ‘bottlenecks’, and demonstrate that this improves performance over vanilla cross-attention at lower computational cost, achieving state of the art results on a number of benchmarks. Future work will involve extending MBT to other modalities such as text and optical flow.
|
| 204 |
+
|
| 205 |
+
Limitations: The fusion layer is a hyperparameter and may need to be tuned specifically for different tasks and datasets. We also only explore fully supervised fusion, and future work will tackle extensions to a self-supervised learning framework.
|
| 206 |
+
|
| 207 |
+
Broader impact: Multimodal fusion strategies are important for machine learning, as fusing complementary information from different modalities can increase robustness when applied to real world applications. We also note that transformers are in general compute-heavy, which can have adverse environmental effects. We propose a token fusion method via bottlenecks that helps reduce computational complexity when applying transformers for multimodal fusion. Finally, we observe that training datasets contain biases that may render models trained on them unsuitable for certain applications. It is thus possible that people use classification models (intentionally or not) to make decisions that impact different groups in society differently, and it is important to keep this in mind when deploying, analysing and building upon these models.
|
| 208 |
+
|
| 209 |
+
Acknowledgements: We would like to thank Joao Carreira for helpful discussions on the Perceiver [29].
|
| 210 |
+
|
| 211 |
+
# References
|
| 212 |
+
|
| 213 |
+
[1] Samira Abnar and Willem Zuidema. Quantifying attention flow in transformers. arXiv preprint arXiv:2005.00928, 2020.
|
| 214 |
+
[2] Hassan Akbari, Linagzhe Yuan, Rui Qian, Wei-Hong Chuang, Shih-Fu Chang, Yin Cui, and Boqing Gong. Vatt: Transformers for multimodal self-supervised learning from raw video, audio and text. NeurIPS, 2021.
|
| 215 |
+
[3] Jean-Baptiste Alayrac, Adrià Recasens, Rosalia Schneider, Relja Arandjelovic, Jason Ramapu- ´ ram, Jeffrey De Fauw, Lucas Smaira, Sander Dieleman, and Andrew Zisserman. Self-supervised multimodal versatile networks. In NeurIPS, 2020.
|
| 216 |
+
[4] Relja Arandjelovic and Andrew Zisserman. Look, listen and learn. In ICCV, 2017.
|
| 217 |
+
[5] Relja Arandjelovic and Andrew Zisserman. Objects that sound. In ECCV, 2018.
|
| 218 |
+
[6] Anurag Arnab, Mostafa Dehghani, Georg Heigold, Chen Sun, Mario Luciˇ c, and Cordelia ´ Schmid. Vivit: A video vision transformer. ICCV, 2021.
|
| 219 |
+
[7] Yusuf Aytar, Carl Vondrick, and Antonio Torralba. Soundnet: Learning sound representations from unlabeled video. In NeurIPS, 2016.
|
| 220 |
+
[8] Max Bain, Arsha Nagrani, Gül Varol, and Andrew Zisserman. Frozen in time: A joint video and image encoder for end-to-end retrieval. ICCV, 2021.
|
| 221 |
+
[9] Honglie Chen, Weidi Xie, Triantafyllos Afouras, Arsha Nagrani, Andrea Vedaldi, and Andrew Zisserman. Localizing visual sounds the hard way. In CVPR, 2021.
|
| 222 |
+
[10] Honglie Chen, Weidi Xie, Andrea Vedaldi, and Andrew Zisserman. VGGSound: A large-scale audio-visual dataset. In ICASSP, 2020.
|
| 223 |
+
[11] Tsuhan Chen and Ram R Rao. Audio-visual integration in multimodal communication. Proceedings of the IEEE, 86(5):837–852, 1998.
|
| 224 |
+
[12] Dima Damen, Hazel Doughty, Giovanni Maria Farinella, Antonino Furnari, Evangelos Kazakos, Jian Ma, Davide Moltisanti, Jonathan Munro, Toby Perrett, Will Price, et al. Rescaling egocentric vision. arXiv preprint arXiv:2006.13256, 2020.
|
| 225 |
+
[13] Mostafa Dehghani, Alexey Gritsenko, Anurag Arnab, Matthias Minderer, and Yi Tay. Scenic: A JAX library for computer vision research and beyond. arXiv preprint arXiv:2110.11403, 2021.
|
| 226 |
+
[14] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248–255. Ieee, 2009.
|
| 227 |
+
[15] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
|
| 228 |
+
[16] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 229 |
+
[17] Ariel Ephrat, Inbar Mosseri, Oran Lang, Tali Dekel, Kevin Wilson, Avinatan Hassidim, William T Freeman, and Michael Rubinstein. Looking to listen at the cocktail party: a speaker-independent audio-visual model for speech separation. ACM Transactions on Graphics (TOG), 37(4):1–11, 2018.
|
| 230 |
+
[18] Haytham M Fayek and Anurag Kumar. Large scale audiovisual learning of sounds with weakly labeled data. arXiv preprint arXiv:2006.01595, 2020.
|
| 231 |
+
[19] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In ICCV, pages 6202–6211, 2019.
|
| 232 |
+
[20] Valentin Gabeur, Chen Sun, Karteek Alahari, and Cordelia Schmid. Multi-modal transformer for video retrieval. In ECCV, volume 5. Springer, 2020.
|
| 233 |
+
[21] Jort F Gemmeke, Daniel PW Ellis, Dylan Freedman, Aren Jansen, Wade Lawrence, R Channing Moore, Manoj Plakal, and Marvin Ritter. Audio set: An ontology and human-labeled dataset for audio events. In ICASSP, pages 776–780. IEEE, 2017.
|
| 234 |
+
[22] Bernard Ghanem, Juan Carlos Niebles, Cees Snoek, Fabian Caba Heilbron, Humam Alwassel, Victor Escorcia, Ranjay Krishna, Shyamal Buch, and Cuong Duc Dao. The activitynet largescale activity recognition challenge 2018 summary. arXiv preprint arXiv:1808.03766, 2018.
|
| 235 |
+
[23] Yuan Gong, Yu-An Chung, and James Glass. AST: audio spectrogram transformer. arXiv preprint arXiv:2104.01778, 2021.
|
| 236 |
+
[24] David Harwath, Antonio Torralba, and James R Glass. Unsupervised learning of spoken language with visual context. NeurIPS, 2017.
|
| 237 |
+
[25] Lisa Anne Hendricks, John Mellor, Rosalia Schneider, Jean-Baptiste Alayrac, and Aida Nematzadeh. Decoupling the role of data, attention, and losses in multimodal transformers. arXiv preprint arXiv:2102.00529, 2021.
|
| 238 |
+
[26] Shawn Hershey, Sourish Chaudhuri, Daniel PW Ellis, Jort F Gemmeke, Aren Jansen, R Channing Moore, Manoj Plakal, Devin Platt, Rif A Saurous, Bryan Seybold, et al. CNN architectures for large-scale audio classification. In ICASSP, pages 131–135. IEEE, 2017.
|
| 239 |
+
[27] Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
|
| 240 |
+
[28] Vladimir Iashin and Esa Rahtu. Multi-modal dense video captioning. In CVPR Workshops, pages 958–959, 2020.
|
| 241 |
+
[29] Andrew Jaegle, Felix Gimeno, Andrew Brock, Andrew Zisserman, Oriol Vinyals, and Joao Carreira. Perceiver: General perception with iterative attention. arXiv preprint arXiv:2103.03206, 2021.
|
| 242 |
+
[30] Aren Jansen, Daniel PW Ellis, Shawn Hershey, R Channing Moore, Manoj Plakal, Ashok C Popat, and Rif A Saurous. Coincidence, categorization, and consolidation: Learning to recognize sounds with minimal supervision. In ICASSP, 2020.
|
| 243 |
+
[31] Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
|
| 244 |
+
[32] Evangelos Kazakos, Arsha Nagrani, Andrew Zisserman, and Dima Damen. Epic-fusion: Audiovisual temporal binding for egocentric action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 5492–5501, 2019.
|
| 245 |
+
[33] Evangelos Kazakos, Arsha Nagrani, Andrew Zisserman, and Dima Damen. Slow-fast auditory streams for audio recognition. In ICASSP, pages 855–859. IEEE, 2021.
|
| 246 |
+
[34] Yelin Kim, Honglak Lee, and Emily Mower Provost. Deep learning for robust feature generation in audiovisual emotion recognition. In ICASSP. IEEE, 2013.
|
| 247 |
+
[35] Sangho Lee, Youngjae Yu, Gunhee Kim, Thomas Breuel, Jan Kautz, and Yale Song. Parameter efficient multimodal transformers for video representation learning. arXiv preprint arXiv:2012.04124, 2020.
|
| 248 |
+
[36] Guang Li, Linchao Zhu, Ping Liu, and Yi Yang. Entangled transformer for image captioning. In ICCV, pages 8928–8937, 2019.
|
| 249 |
+
[37] Jiaman Li, Yihang Yin, Hang Chu, Yi Zhou, Tingwu Wang, Sanja Fidler, and Hao Li. Learning to generate diverse dance motions with transformer. arXiv preprint arXiv:2008.08171, 2020.
|
| 250 |
+
[38] Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. Visualbert: A simple and performant baseline for vision and language. arXiv preprint arXiv:1908.03557, 2019.
|
| 251 |
+
[39] Ruilong Li, Shan Yang, David A Ross, and Angjoo Kanazawa. Learn to dance with aist++: Music conditioned 3d dance generation. arXiv preprint arXiv:2101.08779, 2021.
|
| 252 |
+
[40] Ji Lin, Chuang Gan, and Song Han. Temporal shift module for efficient video understanding. 2019 ieee. In ICCV, pages 7082–7092, 2019.
|
| 253 |
+
[41] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In NeurIPS, 2019.
|
| 254 |
+
[42] Mathew Monfort, Alex Andonian, Bolei Zhou, Kandan Ramakrishnan, Sarah Adel Bargal, Tom Yan, Lisa Brown, Quanfu Fan, Dan Gutfreund, Carl Vondrick, et al. Moments in time dataset: one million videos for event understanding. IEEE transactions on pattern analysis and machine intelligence, 42(2):502–508, 2019.
|
| 255 |
+
[43] Jiquan Ngiam, Aditya Khosla, Mingyu Kim, Juhan Nam, Honglak Lee, and Andrew $\mathrm { ~ Y ~ N ~ g ~ }$ . Multimodal deep learning. In ICML, 2011.
|
| 256 |
+
[44] Andrew Owens and Alexei A Efros. Audio-visual scene analysis with self-supervised multisensory features. In ECCV, 2018.
|
| 257 |
+
[45] Daniel S Park, William Chan, Yu Zhang, Chung-Cheng Chiu, Barret Zoph, Ekin D Cubuk, and Quoc V Le. Specaugment: A simple data augmentation method for automatic speech recognition. arXiv preprint arXiv:1904.08779, 2019.
|
| 258 |
+
[46] Alexander Pashevich, Cordelia Schmid, and Chen Sun. Episodic transformer for vision-andlanguage navigation. In ICCV, 2021.
|
| 259 |
+
[47] Dhanesh Ramachandram and Graham W Taylor. Deep multimodal learning: A survey on recent advances and trends. IEEE Signal Processing Magazine, 34(6):96–108, 2017.
|
| 260 |
+
[48] Justin Salamon and Juan Pablo Bello. Deep convolutional neural networks and data augmentation for environmental sound classification. IEEE Signal Processing Letters, 24(3):279–283, 2017.
|
| 261 |
+
[49] Paul Hongsuck Seo, Arsha Nagrani, and Cordelia Schmid. Look before you speak: Visually contextualized utterances. In CVPR, 2021.
|
| 262 |
+
[50] Linda Smith and Michael Gasser. The development of embodied cognition: Six lessons from babies. Artificial life, 11(1-2):13–29, 2005.
|
| 263 |
+
[51] Chen Sun, Fabien Baradel, Kevin Murphy, and Cordelia Schmid. Learning video representations using contrastive bidirectional transformer. arXiv preprint arXiv:1906.05743, 2019.
|
| 264 |
+
[52] Chen Sun, Austin Myers, Carl Vondrick, Kevin Murphy, and Cordelia Schmid. Videobert: A joint model for video and language representation learning. In ICCV, 2019.
|
| 265 |
+
[53] Efthymios Tzinis, Scott Wisdom, Aren Jansen, Shawn Hershey, Tal Remez, Daniel PW Ellis, and John R Hershey. Into the wild with audioscope: Unsupervised audio-visual separation of on-screen sounds. arXiv preprint arXiv:2011.01143, 2020.
|
| 266 |
+
[54] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 267 |
+
[55] Limin Wang, Yuanjun Xiong, Zhe Wang, Yu Qiao, Dahua Lin, Xiaoou Tang, and Luc Van Gool. Temporal segment networks: Towards good practices for deep action recognition. In ECCV. Springer, 2016.
|
| 268 |
+
[56] Weiyao Wang, Du Tran, and Matt Feiszli. What makes training multi-modal classification networks hard? In CVPR, pages 12695–12705, 2020.
|
| 269 |
+
[57] Fanyi Xiao, Yong Jae Lee, Kristen Grauman, Jitendra Malik, and Christoph Feichtenhofer. Audiovisual slowfast networks for video recognition. arXiv preprint arXiv:2001.08740, 2020.
|
| 270 |
+
[58] Linwei Ye, Mrigank Rochan, Zhi Liu, and Yang Wang. Cross-modal self-attention network for referring image segmentation. In CVPR, 2019.
|
| 271 |
+
[59] Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 272 |
+
[60] Bolei Zhou, Alex Andonian, Aude Oliva, and Antonio Torralba. Temporal relational reasoning in videos. In ECCV, pages 803–818, 2018.
|
md/train/KbV-UZRKb3g/KbV-UZRKb3g.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Understanding and Improving Early Stopping for Learning with Noisy Labels
|
| 2 |
+
|
| 3 |
+
Yingbin Bai1∗ Erkun Yang2∗ Bo Han3 Yanhua Yang2 Jiatong Li4 Yinian Mao4 Gang Niu5 Tongliang Liu1†
|
| 4 |
+
|
| 5 |
+
1TML Lab, University of Sydney; 2Xidian University; 3Hong Kong Baptist University; 4Meituan-Dianping Group; 5RIKEN AIP
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
The memorization effect of deep neural network (DNN) plays a pivotal role in many state-of-the-art label-noise learning methods. To exploit this property, the early stopping trick, which stops the optimization at the early stage of training, is usually adopted. Current methods generally decide the early stopping point by considering a DNN as a whole. However, a DNN can be considered as a composition of a series of layers, and we find that the latter layers in a DNN are much more sensitive to label noise, while their former counterparts are quite robust. Therefore, selecting a stopping point for the whole network may make different DNN layers antagonistically affect each other, thus degrading the final performance. In this paper, we propose to separate a DNN into different parts and progressively train them to address this problem. Instead of the early stopping which trains a whole DNN all at once, we initially train former DNN layers by optimizing the DNN with a relatively large number of epochs. During training, we progressively train the latter DNN layers by using a smaller number of epochs with the preceding layers fixed to counteract the impact of noisy labels. We term the proposed method as progressive early stopping (PES). Despite its simplicity, compared with the traditional early stopping, PES can help to obtain more promising and stable results. Furthermore, by combining PES with existing approaches on noisy label training, we achieve state-of-the-art performance on image classification benchmarks. The code is made public at https://github.com/tmllab/PES.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Deep networks have revolutionized a wide variety of tasks, such as image processing, speech recognition, and language modeling [7], However, this highly relies on the availability of large annotated data, which may not be feasible in practice. Instead, many large datasets with lower quality annotations are collected from online queries [5] or social-network tagging [18]. Such annotations inevitably contain mistakes or label noise. As deep networks have large model capacities, they can easily memorize and eventually overfit the noisy labels, leading to poor generalization performance [36]. Therefore, it is of great importance to develop a methodology that is robust to noisy annotations.
|
| 14 |
+
|
| 15 |
+
Existing methods on learning with noisy labels (LNL) can be mainly categorized into two groups: model-based and model-free algorithms. Methods in the first category mainly model noisy labels with the noise transition matrix [24, 34, 33, 30]. With perfectly estimated noise transition matrix, models trained with corrected losses can approximate to the models trained with clean labels. However, current methods are usually fragile to estimate the noise transition matrix for heavy noisy data and are also hard to handle a large number of classes [9]. The second type explores the dynamic process of optimization policies, which relates to the memorization effect−deep neural networks tend to first memorize and fit majority (clean) patterns and then overfit minority (noisy) patterns [2]. Recently, based on this phenomenon, many methods [9, 26, 15, 16, 29] have been proposed and achieved promising performance.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: We train a ResNet-18 model on CIFAR-10 with three types of noisy labels and evaluate the impact of noisy labels on the representations from the 9-th layer, the 17-th layer, and the final layer. The X-axis is the number of epochs for the first block of the network. The curves present the mean of five runs and the best performances are indicated with dotted vertical lines.
|
| 19 |
+
|
| 20 |
+
To exploit the memorization effect, when the double descent phenomenon [3, 22, 11] cannot be guaranteed to occur, a core issue is to study when to stop the optimization of the network. While stopping the training for too few epochs can avoid overfitting to noisy labels, it can also make the network underfit to clean labels. Current methods [25, 23] usually adopt an early stopping strategy, which decides the stopping point by considering the network as a whole. However, since DNNs are usually optimized with stochastic gradient descent (SGD) with backpropagation, supervisory signals will gradually propagate through the whole network from latter layers (i.e., layers that are closer to output layers) to former layers (i.e., layers that are closer to input layers). Noting that the output layer is followed by the empirical risk in the optimization procedure. We hypothesize that noisy labels may have more severe impacts for the latter layers, which is different from current methods [9, 15] that usually stop the training of the whole network at once.
|
| 21 |
+
|
| 22 |
+
To empirically verify the above hypothesis, we analyze the impact of noisy labels on representations from different layers with different training epochs. To quantitatively measure the impact of noisy labels from intermediate layers, we first train the whole network on noisy data with different training epochs and fix the parameters for the selected layer and its previous layers. We then reinitialize and optimize the rest layers with clean data, and the final classification performance is adopted to evaluate the impact of noisy labels. For the final layer, we directly report the overall classification performance. As illustrated in Figure 1, we can see that latter layers always achieve the best performance at relatively smaller epoch numbers and then exhibit stronger performance drops with additional training epochs, which verifies the hypothesis that noisy data may have more severe impacts for latter layers. With this understanding, we can infer that the early stopping, which optimizes the network all at once, may fail to fully exploit the memorization effect and induce sub-optimal performance.
|
| 23 |
+
|
| 24 |
+
To address the above problem, we propose to optimize a DNN by considering it as a composition of several DNN parts and present a novel progressive early stopping (PES) method. Specifically, we initially train former DNN layers by optimizing them with a relatively large number of epochs. Then, to alleviate the impact of noisy labels for latter layers, we reinitialize and progressively train latter DNN layers by using smaller numbers of epochs with preceding DNN layers fixed. Since different layers are progressively trained with different early stopping epochs, we term the proposed method as progressive early stopping (PES). Despite its simplicity, compared with normal early stopping trick, PES can help to better exploit the memorization effect and obtain more promising and stable results. Moreover, since the model size and training epochs are gradually reduced during the optimization procedure, the training time of PES is only slightly greater than that of the normal early stopping. Finally, by combining PES with existing approaches on noisy label training tasks, we establish new state-of-the-art (SOTA) results on CIFAR-10 and CIFAR-100 with synthetic noise. We also achieve competitive results on one dataset with real-world noise: Clothing-1M [32].
|
| 25 |
+
|
| 26 |
+
The rest of the paper is organized as follows. In Section 2, we first introduce the proposed progressive early stopping and then present the details of the proposed algorithm by combining our method with existing approaches on noisy label training tasks. Section 3 shows the experimental results of our proposed method. Related works are briefly reviewed in Section 4. Finally, concluding remarks are given in Section 5.
|
| 27 |
+
|
| 28 |
+
# 2 Proposed Method
|
| 29 |
+
|
| 30 |
+
Let $D$ be the distribution of a pair of random variables $( X , Y ) \in \mathcal { X } \times \{ 1 , . . . K \}$ , where $\boldsymbol { X }$ indicates the variable of instances, $\mathbf { Y }$ is the variable of labels, $\mathcal { X }$ denotes the feature space, and $K$ is the number of classes. In many real-world problems, examples independently drawn from the distribution $D$ are unavailable. Before being observed, the clean labels are usually randomly corrupted into noisy labels. Let $\tilde { D }$ be the distribution of the noisy example $( X , { \tilde { Y } } )$ , where $\tilde { Y }$ indicates the variable of noisy labels. For label-noise learning, we can only access a sample set $\{ \pmb { x } _ { i } , \tilde { y } _ { i } ) \} _ { i = 1 } ^ { n }$ independently drawn from $\tilde { D }$ . The aim is to learn a robust classifier from the noisy sample set that can classify test instances accurately.
|
| 31 |
+
|
| 32 |
+
In the following, we first elaborate on the proposed progressive early stopping (PES). Then, based on PES, we provide a learning algorithm that learns with confident examples and semi-supervised learning techniques.
|
| 33 |
+
|
| 34 |
+
# 2.1 Progressive Early Stopping
|
| 35 |
+
|
| 36 |
+
When trained with noisy labels, if clean labels are of majority within each noisy class, deep networks tend to first fit clean labels during an early learning stage before eventually memorizing the wrong labels, which can be explained by the memorization effect. Many current methods utilize this property to counteract the influence of noisy labels by stopping the optimization at an early learning phase. Specifically, a deep classifier can be obtained by optimizing the following objective function with a relatively small epoch number $T$ :
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\operatorname* { m i n } _ { \Theta } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathcal { L } ( f ( x _ { i } ; \Theta ) , \tilde { y } _ { i } ) ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $f ( \cdot ; \Theta )$ is a deep classifier with model parameters $\Theta$ and $\mathcal { L }$ is the cross-entropy loss. When trained with noisy data, early learning regularization (ELR) [16] reveals that, for the most commonly used cross-entropy loss, the gradient is well correlated with the correct direction at the early learning phase. Therefore, with a properly defined small epoch number $T$ , the classifier can have higher accuracy than at initialization. While, if we continue to optimize the deep model after $T$ epochs, the classifier will be able to memorize more noise labels. Therefore, it is critical to select a proper epoch number $T$ to utilize the memorization effect and alleviate the influence of noisy labels.
|
| 43 |
+
|
| 44 |
+
Current methods typically select the epoch number $T$ by considering the network as a whole. However, as Figure 1 makes clear, the impact of noisy labels on different DNN layers are different, which implies that the traditional early stopping trick, which optimizes the whole network all at once, may make different DNN layers to be antagonistically affected by each other, thus degrading the final model performance. To this end, we propose to separate a DNN into different parts and progressively train layers in different parts with different training epochs. Specifically, assume that the whole network $f ( \cdot ; \Theta )$ can be constituted with $L$ DNN parts
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { l } { z _ { 1 } = f _ { 1 } ( \pmb { x } ; \Theta _ { 1 } ) , } \\ { z _ { l } = f _ { l } ( z _ { l - 1 } ; \Theta _ { l } ) , \quad l = 2 , \ldots , L } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $f _ { l } ( \cdot ; \Theta _ { l } )$ is the $l$ -th DNN part and $z _ { l }$ is the corresponding output. The output of the last part $z _ { L }$ is the prediction. The network $f ( \cdot ; \Theta )$ can also be represented as $f ( \cdot ; \Theta _ { 1 } , . . . \Theta _ { L } )$ . To counteract the impact of noisy labels, We initially optimize the parameter $\Theta _ { 1 }$ for the first part by training the whole network for $T _ { 1 }$ epochs with the following objective
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\operatorname* { m i n } _ { \Theta _ { 1 } \ldots \Theta _ { k } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathcal { L } ( f ( \pmb { x } _ { i } ; \Theta _ { 1 } , \ldots , \Theta _ { L } ) , \tilde { y } _ { i } ) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Performance of the traditional early stopping trick and the proposed PES on CIFAR-10 with different types of label noise. The lines present the mean of five runs.
|
| 58 |
+
|
| 59 |
+
Then, we keep the obtained parameter $\Theta _ { 1 } ^ { * }$ fixed, reinitialize and progressively learn the $l$ -th $( l =$ $2 , \ldots , L )$ DNN part with the parameters for preceding DNN parts fixed. The training procedure is conducted with $T _ { l }$ epochs by optimizing the following objective
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\operatorname* { m i n } _ { \Theta _ { l } \ldots \Theta _ { k } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \mathcal { L } ( f ( x _ { i } ; \Theta _ { 1 } ^ { * } , \ldots , \Theta _ { l - 1 } ^ { * } , \Theta _ { l } , \ldots , \Theta _ { L } ) , \tilde { y } _ { i } ) , \quad l = 2 \ldots L
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
We gradually optimize the $( l + 1 )$ -th DNN part with the obtained parameter $\Theta _ { l } ^ { * }$ fixed, the optimization is continued until all the parameters have been optimized. As elaborated above, latter DNN parts are more sensitive to noisy labels than their former counterparts. Therefore, for the above initializing optimization in Eq. (3) and the following $L - 1$ steps of optimization in Eq. (4), we gradually reduce the training epochs (i.e. $T _ { 1 } \geq T _ { 2 } \geq \cdot \cdot \cdot \geq T _ { L } )$ to better exploit the memorization effect. After optimization, we can obtain the final network as $f ( \cdot , \Theta ) = \bar { f } ( \cdot ; \Theta _ { 1 } ^ { * } , \ldots , \Theta _ { L } ^ { * } )$ . Since this model is obtained by progressively exploiting the early stopping strategies for different DNN parts, we term the proposed method as progressive early stopping (PES).
|
| 66 |
+
|
| 67 |
+
To explicitly verify the effectiveness of the proposed PES method, we conduct several pilot experiments, which compare the traditional early stopping and PES with label noise from different types and different levels. The results are illustrated in Figure 2, from which we can see that, compared with models trained with traditional early stopping, models trained with PES can achieve superior classification accuracy with smaller variations in all the cases. Current state-of-the-art methods [15] usually adopt models with the traditional early stopping as base models to distill confident examples and then utilize semi-supervised learning techniques by considering confident examples as labeled data and other noisy examples as unlabeled data to further improve the results. The final performance still heavily relies on the base model trained with noisy labels. By improving the performance of the base model, our method combined with semi-supervised learning techniques is able to establish new state-of-the-art results. In the following subsections, we will elaborate on how to utilize PES to distill confident examples and further combine it with semi-supervised learning techniques.
|
| 68 |
+
|
| 69 |
+
# 2.2 Learning with Confident Examples
|
| 70 |
+
|
| 71 |
+
Based on the deep network optimized with progressive early stopping, we can select confident examples to facilitate the model training. Here, confident examples refer to examples that have high probabilities with clean labels. In this paper, we treat examples whose predictions are consistent with given labels as confident examples. In addition, to make the results more robust, we generate two different augmentations for any given input and use the average prediction to decide its predicted label. Formally, we can obtain the confident example set $\mathcal { D } _ { l }$ as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { c } { \mathcal { D } _ { l } = \{ ( \pmb { x } _ { i } , \tilde { y } _ { i } ) | \tilde { y } _ { i } = \hat { y } _ { i } , i = 1 , \ldots , n \} , } \\ { \hat { y } _ { i } = \underset { k \in \{ 1 , \ldots , K \} } { \arg \operatorname* { m a x } } \ \frac { 1 } { 2 } [ f ^ { k } ( \mathrm { A u g m e n t } ( \pmb { x } _ { i } ) ; \Theta ) + f ^ { k } ( \mathrm { A u g m e n t } ( \pmb { x } _ { i } ) ; \Theta ) ] , } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where Augment $( \cdot )$ indicates normal data augmentation operation including horizontal random flip and random crops, and $f ^ { k } ( x ; \Theta )$ is the predicted probability of $_ { \textbf { \em x } }$ belonging to class $k$ . Note that Augment $\left( \cdot \right)$ is a stochastic transformation, so the two terms in Eq (5) are not identical. The average
|
| 78 |
+
|
| 79 |
+
Input: Neural network with trainable parameters $\boldsymbol { \Theta } = \{ \Theta _ { 1 } , \dots , \Theta _ { L } \}$ , Noisy training dataset
|
| 80 |
+
$\{ \bar { \pmb { x } _ { i } } , \tilde { y } _ { i } ) \} _ { i = 1 } ^ { n }$ , Number of training epochs for different part: $T _ { 1 } , \dots , T _ { L }$ , and training epochs $T _ { c }$
|
| 81 |
+
for refining with confident examples.
|
| 82 |
+
for $i = 1 , \dots , T _ { 1 }$ do
|
| 83 |
+
Optimize network parameter $\Theta$ with Eq. (3);
|
| 84 |
+
for $l = 2$ , . . . , $L$ do Froze $\left\{ \Theta _ { 1 } , \ldots , \Theta _ { l - 1 } \right\}$ and re-initialize $\big \{ \Theta _ { l } , \dots , \Theta _ { L } \big \}$ ; for $i = 1 , \dots , T _ { l }$ do Optimize network parameter $\big \{ \Theta _ { l } , \dots , \Theta _ { L } \big \}$ with Eq. (4);
|
| 85 |
+
Unfroze $\Theta$ ;
|
| 86 |
+
for $i = 1 , \dots , T _ { c }$ do Extract confident example set $\mathcal { D } _ { l }$ and unlabeled set $\mathcal { D } _ { u }$ with classifier $f ( \cdot , \Theta )$ by Eq. (7); Training the classifier $f ( \cdot , \Theta )$ with MixMatch loss on $\mathcal { D } _ { l }$ and $\mathcal { D } _ { u }$ ;
|
| 87 |
+
Evaluate the obtained classifier $f ( \cdot , \Theta )$ .
|
| 88 |
+
|
| 89 |
+
prediction of augmented examples provides a more stable prediction and is found empirically to improve performance. After obtaining the confident example set, one can easily train a classifier by considering confident examples as clean data. However, since the number of confident examples for different classes can vary greatly, directly training the model with the obtained confident example set may introduce a severe class imbalance problem. To this end, we adopt a weighted classification loss
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathcal { L } _ { c } = \sum _ { i = 1 } ^ { N } w _ { y _ { i } } \mathcal { L } _ { p } ( \tilde { y } _ { i } , f ( \pmb { x } _ { i } ; \Theta ) ) ,
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $w _ { i }$ is the corresponding class weight. Assuming that $\sigma _ { k } = | \{ ( \pmb { x } _ { i } , \tilde { y } _ { i } ) | \tilde { y } _ { i } = k , ( \pmb { x } _ { i } , \tilde { y } _ { i } ) \in \mathcal { D } _ { l } \} |$ denotes the cardinality of the confident example set belonging to the $k$ -th class. Then, we can set $w _ { i } = \sigma _ { i } / ( \sum _ { j = 1 } ^ { K } \sigma _ { j } )$ to indicate the corresponding class importance.
|
| 96 |
+
|
| 97 |
+
# 2.3 Combining with Semi-Supervised Learning
|
| 98 |
+
|
| 99 |
+
Training with only confident examples neglects the rest data and may suffer from insufficient training examples. To tackle this problem, we further resort to semi-supervised learning techniques by considering confident examples as labeled data and other noisy examples as unlabeled data. Specifically, the labeled data set and unlabeled data set can be obtained as
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { c } { { \displaystyle { \int } { \mathcal D } _ { l } = \{ ( \boldsymbol x _ { i } , \tilde { y } _ { i } ) | \tilde { y } _ { i } = \hat { y } _ { i } , i = 1 , . . . n \} } } \\ { { \displaystyle { \mathcal D } _ { u } = \{ \boldsymbol x _ { i } | \tilde { y } _ { i } \neq \hat { y } _ { i } , i = 1 , . . . n \} } } \\ { { \displaystyle { \hat { y } _ { i } = \arg \operatorname* { m a x } _ { k \in \{ 1 , . . . K \} } \frac { 1 } { 2 } [ f ^ { k } ( \mathrm { A u g m e n t } ( \boldsymbol x _ { i } ) ; \Theta ) + f ^ { k } ( \mathrm { A u g m e n t } ( \boldsymbol x _ { i } ) ; \Theta ) ] } , } } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where the labeled data set $\mathcal { D } _ { l }$ is the same as that in Eq (6), and $\mathcal { D } _ { u }$ is the rest unlabeled data set. Similar to [15], we adopt MixMatch [4] as the semi-supervised learning framework to train the final classification models. For more details about semi-supervised learning, we refer to [4]. The whole learning algorithm is summarized in Algorithm 1.
|
| 106 |
+
|
| 107 |
+
# 3 Experiments
|
| 108 |
+
|
| 109 |
+
# 3.1 Datasets and Implementation Details
|
| 110 |
+
|
| 111 |
+
Datasets: We evaluate our method on two synthetic datasets, CIFAR-10 and CIFAR-100 [12] with different levels of symmetric, pairflip, and instance-dependent label noise (abbreviated as instance label noise) and a real-world dataset Clothing-1M [32]. Both CIFAR-10 and CIFAR-100 contain $5 0 \mathrm { k }$ training images and $1 0 \mathrm { k }$ test images of size $3 2 \times 3 2$ . Following previous works [9, 31, 16, 29], symmetric noise is generated by uniformly flipping labels for a percentage of the training dataset to all possible labels. Pairflip noise flips noisy labels into their adjacent class. And, instance noise is generated by image features. More details about the synthetic label noise are given in the supplementary material. For the flipping rate, it can include [9, 31] or ex-include [15, 16] true labels. We use the flipping rate including correct labels in Table 3 to compare with results in [15], and use without correct labels in the rest of the experiments. Clothing-1M [32] is a large-scale dataset with real-world noisy labels, whose images are clawed from the online shopping websites, and labels are generated based on surrounding texts. It contains 1 million training images, and $1 5 \mathrm { k }$ validation images, and 10k test images with clean labels.
|
| 112 |
+
|
| 113 |
+
Table 1: Preliminary analysis of the performance and the quality of extracted confident examples on CIFAR-10. The mean and standard deviation are computed over five runs.
|
| 114 |
+
|
| 115 |
+
<table><tr><td rowspan=1 colspan=1>Metrics</td><td rowspan=1 colspan=1>Methods</td><td rowspan=1 colspan=1>Sym-20%</td><td rowspan=1 colspan=1>Sym-50%</td><td rowspan=1 colspan=1>Pair-45%</td><td rowspan=1 colspan=1>Inst-20%</td><td rowspan=1 colspan=1>Inst-40%</td></tr><tr><td rowspan=1 colspan=1>Test Accuracy</td><td rowspan=1 colspan=1>Early StoppingPES</td><td rowspan=1 colspan=1>82.55±2.4685.87±1.59</td><td rowspan=1 colspan=1>70.76±1.2475.87±1.33</td><td rowspan=1 colspan=1>60.62±5.5962.40±2.34</td><td rowspan=1 colspan=1>84.41±0.9086.58±0.45</td><td rowspan=1 colspan=1>74.73±2.6577.07±1.18</td></tr><tr><td rowspan=1 colspan=1>Label Precision</td><td rowspan=1 colspan=1>Early StoppingPES</td><td rowspan=1 colspan=1>98.81±0.1598.96±0.09</td><td rowspan=1 colspan=1>94.65±0.1995.46±0.14</td><td rowspan=1 colspan=1>72.53±5.2672.99±2.27</td><td rowspan=1 colspan=1>98.70±0.4398.52±0.19</td><td rowspan=1 colspan=1>90.77±1.8790.63±0.92</td></tr><tr><td rowspan=1 colspan=1>Label Recall</td><td rowspan=1 colspan=1>Early StoppingPES</td><td rowspan=1 colspan=1>88.51±2.2692.67±1.43</td><td rowspan=1 colspan=1>75.18±1.0081.03±1.83</td><td rowspan=1 colspan=1>67.84±5.0671.06±2.27</td><td rowspan=1 colspan=1>90.37±1.0193.24±0.60</td><td rowspan=1 colspan=1>82.15±3.1785.91±0.68</td></tr></table>
|
| 116 |
+
|
| 117 |
+
Baselines: Semi-supervised learning may strongly boost the performance, we separately compare our method with approaches with or without semi-supervised learning. For the comparison with baselines with semi-supervised learning, we combine our proposed method with MixMatch used in [15] as indicated in Subsection 2.3. (1) Approaches without semi-supervised learning: Co-teaching [9], Forward [24], Joint Optim [25], T-revision [31], DMI [34], and CDR [29]. (2) Methods with semi-supervised learning: M-correction [1], DivideMix [15], and $\mathrm { E L R + }$ [16]. We also adopt standard training with cross-entropy (CE) and MixUp [37] as baselines to show improvements.
|
| 118 |
+
|
| 119 |
+
Network structure and optimization: Our method is implemented by PyTorch v1.6. Baseline methods are implemented based on public codes with hyper-parameters set according to the original papers. For DivideMix and $\mathrm { E L R + }$ , we evaluate the test accuracy with the first network. To better demonstrate the robustness of our algorithm, we keep the hyper-parameters fixed for different types of label noise. More technique details are given in the supplementary material.
|
| 120 |
+
|
| 121 |
+
For experiments without semi-supervised learning, we follow [31], and use ResNet-18 [10] for CIFAR-10 and ResNet-34 for CIFAR-100. We split networks into three parts, the layers above block 4 as part 1, block 4 of ResNet as part 2, and the final layer as part 3. $T _ { 1 }$ is defined as 25 for CIFAR-10 and 30 for CIFAR-100, $T _ { 2 }$ as 7, and $T _ { 3 }$ as 5. The network is trained for 200 epochs and SGD with 0.9 momentum is used. The initial learning rate is set to 0.1 and decayed with a factor of 10 at the 100th and 150th epoch respectively, and a weight decay is set to $1 0 ^ { - 4 }$ . For $T _ { 2 }$ and $T _ { 3 }$ , we employ an Adam optimizer with a learning rate of $1 0 ^ { - 4 }$ .
|
| 122 |
+
|
| 123 |
+
For experiments with semi-supervised learning, we follow the setting of [15] with PreAct Resnet-18. We set the final layer as part 2, the rest as part 1. $T _ { 1 }$ is defined as 20 for CIFAR-10 and 35 for CIFAR-100, and $T _ { 2 }$ as 5. The network is trained for 300 epochs. For optimization, we use a single cycle of cosine annealing [19], and the learning rate begins from $2 \times \mathrm { \bar { 1 0 ^ { - 2 } } }$ and ends at $2 \times 1 0 ^ { - 4 }$ , with a weight decay of $5 \times 1 0 ^ { - 4 }$ . An Adam optimizer is adopted with a learning rate of $1 0 ^ { - 4 }$ for $T _ { 2 }$ . For hyper-parameters from MixMatch, we set them according to the original paper [4].
|
| 124 |
+
|
| 125 |
+
For Clothing-1M [32], we follow the previous work [25], and employ a ResNet-50 [10] pre-trained on ImageNet [13]. We set the final layer as part 2, the rest as part 1. $T _ { 1 }$ and $T _ { 2 }$ are defined as 20 and 7 respectively. The network is trained with CE loss for 50 epochs and SGD is used with 0.9 momentum and a weight decay of $1 0 ^ { - 3 }$ . The learning rate is $5 \times 1 0 ^ { - 3 }$ and decayed by a factor of 10 at the 20th and 30th epoch respectively. We employ an Adam optimizer with a learning rate of $5 \times 1 0 ^ { - 6 }$ for $T _ { 2 }$
|
| 126 |
+
|
| 127 |
+
# 3.2 Preliminary Experiments
|
| 128 |
+
|
| 129 |
+
In Figure 2, we can observe that with the PES trick, the performance of classifiers is generally improved compared with that the traditional early stopping trick. In this section, we further carefully analyze the quality of extracted labels by examining them from three aspects, i.e., test accuracy, label precision, and label recall. Here, label precision indicates the ratio of the number of extracted confident examples with correct labels in the total confident example set, and label recall represents the ratio of the number of confident examples with correct labels among the total correctly labeled examples. Specifically, we train a neural network on CIFAR-10 with different kinds and levels of label noise for 25 epochs respectively and report the performance for each case before and after the proposed PES is applied.
|
| 130 |
+
|
| 131 |
+
Table 2: Comparison with state-of-the-art methods without semi-supervised learning on CIFAR-10 and CIFAR-100. The mean and standard deviation computed over five runs are presented.
|
| 132 |
+
|
| 133 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Method</td><td colspan="2">Symmetric</td><td>Pairflip</td><td colspan="2">Instance</td></tr><tr><td>20%</td><td>50%</td><td>45%</td><td>20%</td><td>40%</td></tr><tr><td rowspan="8">CIFAR10</td><td>CE</td><td>84.00±0.66</td><td>75.51±1.24</td><td>63.34±6.03</td><td>85.10±0.68</td><td>77.00±2.17</td></tr><tr><td>Co-teaching</td><td>87.16±0.11</td><td>72.80±0.45</td><td>70.11±1.16</td><td>86.54±0.11</td><td>80.98±0.39</td></tr><tr><td>Forward</td><td>85.63±0.52</td><td>77.92±0.66</td><td>60.15±1.97</td><td>85.29±0.38</td><td>74.72±3.24</td></tr><tr><td> Joint Optim</td><td>89.70±0.11</td><td>85.00±0.17</td><td>82.63±1.38</td><td>89.69±0.42</td><td>82.62±0.57</td></tr><tr><td>T-revision</td><td>89.63±0.13</td><td>83.40±0.65</td><td>77.06±6.47</td><td>90.46±0.13</td><td>85.37±3.36</td></tr><tr><td>DMI</td><td>88.18±0.36</td><td>78.28±0.48</td><td>57.60±14.56</td><td>89.14±0.36</td><td>84.78±1.97</td></tr><tr><td>CDR</td><td>89.72±0.38</td><td>82.64±0.89</td><td>73.67±0.54</td><td>90.41±0.34</td><td>83.07±1.33</td></tr><tr><td>Ours</td><td>92.38±0.40</td><td>87.45±0.35</td><td>88.43±1.08</td><td>92.69±0.44</td><td>89.73±0.51</td></tr><tr><td rowspan="8">CIFAR100</td><td>CE</td><td>51.43±0.58</td><td>37.69±3.45</td><td>34.10±2.04</td><td>52.19±1.42</td><td>42.26±1.29</td></tr><tr><td>Co-teaching</td><td>59.28±0.47</td><td>41.37±0.08</td><td>33.22±0.48</td><td>57.24±0.69</td><td>45.69±0.99</td></tr><tr><td>Forward</td><td>57.75±0.37</td><td>44.66±1.01</td><td>27.88±0.80</td><td>58.76±0.66</td><td>44.50±0.72</td></tr><tr><td> Joint Optim</td><td>64.55±0.38</td><td>50.22±0.41</td><td>42.61±0.61</td><td>65.15±0.31</td><td>55.57±0.41</td></tr><tr><td>T-revision</td><td>65.40±1.07</td><td>50.24±1.45</td><td>41.10±1.95</td><td>60.71±0.73</td><td>51.54±0.91</td></tr><tr><td>DMI</td><td>58.73±0.70</td><td>44.25±1.14</td><td>26.90±0.45</td><td>58.05±0.20</td><td>47.36±0.68</td></tr><tr><td>CDR</td><td>66.52±0.24</td><td>55.30±0.96</td><td>43.87±1.35</td><td>67.33±0.67</td><td>55.94±0.56</td></tr><tr><td>Ours</td><td>68.89±0.45</td><td>58.90±2.72</td><td>57.18±1.44</td><td>70.49±0.79</td><td>65.68±1.41</td></tr></table>
|
| 134 |
+
|
| 135 |
+
Table 3: Comparison with state-of-the-art methods with semi-supervised learning on CIFAR-10 and CIFAR-100 with symmetric label noise from different levels. Results with \* are token from [15]. The mean and standard deviation are computed over three runs.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td></tr><tr><td>Methods /Noise</td><td>Sym-20%</td><td>Sym-50%</td><td>Sym-80%</td><td>Sym-20%</td><td>Sym-50%</td><td>Sym-80%</td></tr><tr><td>CE</td><td>86.5±0.6</td><td>80.6±0.2</td><td>63.7±0.8</td><td>57.9±0.4</td><td>47.3±0.2</td><td>22.3±1.2</td></tr><tr><td>MixUp</td><td>93.2±0.3</td><td>88.2±0.3</td><td>73.3±0.3</td><td>69.5±0.2</td><td>57.1±0.6</td><td>34.1±0.6</td></tr><tr><td>M-correction*</td><td>94.0</td><td>92.0</td><td>86.8</td><td>73.9</td><td>66.1</td><td>48.2</td></tr><tr><td>DivideMix*</td><td>95.2</td><td>94.2</td><td>93.0</td><td>75.2</td><td>72.8</td><td>58.3</td></tr><tr><td>DivideMix</td><td>95.6±0.1</td><td>94.6±0.1</td><td>92.9±0.3</td><td>75.3±0.1</td><td>72.7±0.6</td><td>56.4±0.3</td></tr><tr><td>ELR+</td><td>94.9±0.2</td><td>93.6±0.1</td><td>90.4±0.2</td><td>75.5±0.2</td><td>71.0±0.2</td><td>50.4±0.8</td></tr><tr><td>Ours (Semi)</td><td>95.9±0.1</td><td>95.1±0.2</td><td>93.1±0.2</td><td>77.4±0.3</td><td>74.3±0.6</td><td>61.6±0.6</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Results in Table 1 clearly show that, compared with the traditional early stopping, PES can help to obtain higher accuracies, precisions, and recalls for most cases. For instance-dependent label noise, PES can achieve higher recall values with comparable label precision values. Note that models with high recall values can help to collect more confident examples, which is critical for learning with confident examples and semi-supervised learning. Therefore, by enhancing the performance of the initial model, PES can help to improve the final classification performance in all cases, which is also verified by the experiments in Section 3.3.
|
| 140 |
+
|
| 141 |
+
# 3.3 Classification Accuracy Evaluation
|
| 142 |
+
|
| 143 |
+
Synthetic datasets. We first verify the effectiveness of our proposed method without semi-supervised learning techniques on two synthetic datasets: CIFAR-10 and CIFAR-100. For both of these two datasets, we leave $10 \%$ of data with noisy labels as noisy validation set. Results are presented in Table 2, which shows that our proposed method can consistently outperform all other baselines across various settings by a large margin.
|
| 144 |
+
|
| 145 |
+
Table 4: Comparison with state-of-the-art methods with semi-supervised learning on CIFAR-10 and CIFAR-100 with instance-dependent and pairflip label noise from different levels. The mean and standard deviation are computed over three runs.
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=3>CIFAR-10</td><td rowspan=1 colspan=3>CIFAR-100</td></tr><tr><td rowspan=1 colspan=1>Methods/Noise</td><td rowspan=1 colspan=1>Inst-20%</td><td rowspan=1 colspan=1>Inst-40%</td><td rowspan=1 colspan=1>Pair-45%</td><td rowspan=1 colspan=1>Inst-20%</td><td rowspan=1 colspan=1>Inst-40%</td><td rowspan=1 colspan=1>Pair-45%</td></tr><tr><td rowspan=4 colspan=1>CEMixUpDivideMixELR+</td><td rowspan=1 colspan=1>87.5±0.5</td><td rowspan=1 colspan=1>78.9±0.7</td><td rowspan=1 colspan=1>74.9±1.7</td><td rowspan=1 colspan=1>56.8±0.4</td><td rowspan=1 colspan=1>48.2±0.5</td><td rowspan=1 colspan=1>38.5±0.6</td></tr><tr><td rowspan=2 colspan=1>93.3±0.295.5±0.1</td><td rowspan=2 colspan=1>87.6±0.594.5±0.2</td><td rowspan=2 colspan=1>82.4±1.085.6±1.7</td><td rowspan=1 colspan=1>67.1±0.1</td><td rowspan=2 colspan=1>55.0±0.170.9±0.1</td><td rowspan=2 colspan=1>44.2±0.548.2±1.0</td></tr><tr><td rowspan=1 colspan=1>75.2±0.2</td><td rowspan=1 colspan=1>70.9±0.1</td></tr><tr><td rowspan=1 colspan=1>94.9±0.1</td><td rowspan=1 colspan=1>94.3±0.2</td><td rowspan=1 colspan=1>86.1±1.2</td><td rowspan=1 colspan=1>75.8±0.1</td><td rowspan=1 colspan=1>74.3±0.3</td><td rowspan=1 colspan=1>65.3±1.3</td></tr><tr><td rowspan=1 colspan=1>Ours (Semi)</td><td rowspan=1 colspan=1>95.9±0.1</td><td rowspan=1 colspan=1>95.3±0.1</td><td rowspan=1 colspan=1>94.5±0.3</td><td rowspan=1 colspan=1>77.6±0.3</td><td rowspan=1 colspan=1>76.1±0.4</td><td rowspan=1 colspan=1>73.6±1.7</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Table 5: Compassion with state-of-the-art methods on Clothing-1M. Results of baseline methods are taken from the original papers. ours represent the results obtained by PES with a single network and ours\* indicate the results obtained by PES with an ensemble model.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan=1 colspan=1>CE</td><td rowspan=1 colspan=1>Forward</td><td rowspan=1 colspan=1>Joint-Optim</td><td rowspan=1 colspan=1>DMI</td><td rowspan=1 colspan=1>T-revision</td><td rowspan=1 colspan=1>DivideMix*</td><td rowspan=1 colspan=1>ELR+*</td><td rowspan=1 colspan=1>Ours</td><td rowspan=1 colspan=1>Ours*</td></tr><tr><td rowspan=1 colspan=1>69.21</td><td rowspan=1 colspan=1>69.84</td><td rowspan=1 colspan=1>72.16</td><td rowspan=1 colspan=1>72.46</td><td rowspan=1 colspan=1>74.18</td><td rowspan=1 colspan=1>74.76</td><td rowspan=1 colspan=1>74.81</td><td rowspan=1 colspan=1>74.64</td><td rowspan=1 colspan=1>74.99</td></tr></table>
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Sensitivity analysis for different training iteration numbers: $T _ { 2 }$ and $T _ { 3 }$
|
| 155 |
+
|
| 156 |
+
Table 3 and Table 4 present the mean accuracy and standard deviation for our method and all baselines on CIFAR-10 and CIFAR-100, respectively. From the results, we can get that the proposed method can outperform all baselines in all cases. For pairflip label noise, the advantages of our proposed method become more apparent, and it significantly outperforms state-of-the-art methods by over $8 \%$ on both CIFAR-10 and CIFAR-100. These empirical results support our proposal that PES can improve the quality of selected confident examples, which helps improve performance and reduce the variance of the final classifier.
|
| 157 |
+
|
| 158 |
+
Real-world dataset. We evaluate the performance of the proposed method on a real-world dataset with Clothing-1M [32] and select methods such as CE, Forward, Joint-Optim, DMI, and T-revision, which use a single network, and also methods such as DivideMix and $\mathrm { E L R + }$ , which adopt an ensemble model with two different networks, as baselines. We also report the results for the proposed PES with a single network as ours and the results for PES, which ensembles two networks, as ours\*. The overall results are reported in Table 5, from which we can observe that the proposed PES with a single network can outperform all baselines using a single network. And with an ensemble model, which contains two different networks, our method can outperform all the adopted baselines. These results clearly demonstrate that, by improving the performance of the initial classification network, our method is more flexible to handle such real-world noise problems.
|
| 159 |
+
|
| 160 |
+
# 3.4 Sensitivity Analysis
|
| 161 |
+
|
| 162 |
+
In this section, we investigate the hyper-parameter sensitivity for the training iteration number $T _ { 2 }$ and $T _ { 3 }$ , respectively. We firstly analyze the training epoch number for the second DNN part by varying $T _ { 2 }$ from the range of [0, 10]. The results are illustrated in Figure 3a, from which can find that, with the increasing of $T _ { 2 }$ , the performance of PES first increase and then decrease in all the cases except for $45 \%$ Pairflip noise on the CIFAR-10 dataset. While the model achieves the best performance with $T _ { 2 }$ as 7 for all types of noisy labels. Then we fix $T _ { 2 }$ as 7, and analyze the impact of the third DNN part by varying $T _ { 3 }$ from the range of [0, 10]. The results are shown in Figure 3b. Although the performance variance for different $T _ { 3 }$ is smaller than that for $T _ { 2 }$ , we can still observe that the best performance can be obtained when $T _ { 3 }$ is set as 5. More importantly, from these two figures, we can get that both $T _ { 2 }$ and $T _ { 3 }$ are robust to the different types of noisy labels.
|
| 163 |
+
|
| 164 |
+
Table 6: Training time comparison for baselines on CIFAR-10 with $50 \%$ Symmetric label noise.
|
| 165 |
+
|
| 166 |
+
<table><tr><td rowspan=1 colspan=1>CE</td><td rowspan=1 colspan=1>Co-teaching</td><td rowspan=1 colspan=1>CDR</td><td rowspan=1 colspan=1>T-revision</td><td rowspan=1 colspan=1>ELR+</td><td rowspan=1 colspan=1>DivideMix</td><td rowspan=1 colspan=1>Ours</td><td rowspan=1 colspan=1>Ours (Semi)</td></tr><tr><td rowspan=1 colspan=1>0.9h</td><td rowspan=1 colspan=1>1.5h</td><td rowspan=1 colspan=1>3.0h</td><td rowspan=1 colspan=1>3.5h</td><td rowspan=1 colspan=1>2.2h</td><td rowspan=1 colspan=1>5.5h</td><td rowspan=1 colspan=1>1.0h</td><td rowspan=1 colspan=1>3.1h</td></tr></table>
|
| 167 |
+
|
| 168 |
+
# 3.5 Training Time Comparison
|
| 169 |
+
|
| 170 |
+
In this section, we compare the training time of our method and other state-of-the-art baselines. All the experiments are conducted on a server with a single Nvidia V100 GPU. The training times for all the methods are reported in Table 6, from which we can get that our algorithm with cross-entropy loss achieves the fastest speed across all baselines, only about 1 hour. Our method combining with MixMatch [4] is also fast, only a little more than half of the training time of DivideMix. The time of $\mathrm { E L R + }$ [16] shows superior, but $\mathrm { E L R + }$ trains the network with fewer epochs, with 200 epochs compared with ours for 300 epochs.
|
| 171 |
+
|
| 172 |
+
# 4 Related work
|
| 173 |
+
|
| 174 |
+
Learning with noisy data has been well studied [17, 6, 21, 27, 20]. Current works can be mainly categorized into two groups: model-based and model-free methods. In this section, we briefly review some closely related works.
|
| 175 |
+
|
| 176 |
+
The first type models the relationship between clean labels and noisy labels by estimating the noise transition matrix and build a loss function to correct the loss [24, 30, 35, 28]. [24] first combines algorithms for estimating the noise rates and loss correction techniques together and introduces two alternative procedures for loss correction. It also proves that both of the two procedures enjoy formal robustness guarantees w.r.t. the clean data distribution. DMI [34] proposes an information-theoretic loss function, which utilizes Shannon’s mutual information and is robustness to different kinds of label noise. T-revision [31] estimates the noise transition matrix without anchor points by adding a fine-tuned slack variables. Although these methods have made certain progress, they are usually fragile to estimate the noise transition matrix for heavy noisy data and are also hard to handle a large number of classes. Therefore, in this paper, we mainly focus on the model-free methods.
|
| 177 |
+
|
| 178 |
+
The second strand mainly counteracts noisy labels by exploiting the memorization effect that deep networks tend to first memorize and fit majority (clean) patterns and then overfit minority (noisy) patterns [2]. To exploit this property, Co-teaching [9] employs two networks with different initialization and uses small loss to select confident examples. M-correction [1] uses two Gaussian Mixture Models to identify confident examples, instead of using networks themselves. DivideMix [15] extends Co-teaching [9] and employs two Beta Mixture Model to select confident examples. MixMatch [4] is then adopted to leverage unconfident examples with a semi-supervised learning framework. All the above methods exploit the memorization effect by considering the adopted network as a whole. Recently, [14] shows that networks training with noisy labels can produce good representations, if the structure of networks suits the targeted tasks. Our method further explains that noisy labels have different impacts for different layers in a DNN. And latter layers will receive earlier and more severe impact than their former counterparts. Therefore, by considering a DNN as a composition of several layers and training different layers with different epochs, our method is able to better exploit the memorization effect and achieve superior performance.
|
| 179 |
+
|
| 180 |
+
# 5 Conclusion
|
| 181 |
+
|
| 182 |
+
In this work, we provide a progressive early stopping (PES) method to better exploit the memorization effect of deep neural networks (DNN) for noisy-label learning. We first find that the impact of noisy labels for former layers in a DNN is much less and later than that for latter DNN layers, and then build upon this insight to propose the PES method, which separates a DNN into different parts and progressively train each part to counteract the different impacts of noisy labels for different DNN layers. To show that PES can boost the performance of state-of-the-art methods, we conduct extensive experiments across multiple synthetic and real-world noisy datasets and demonstrate that the proposed PES can help to obtain substantial performance improvements compared to current state-of-the-art baselines. The main limitation of our method lies in that, by splitting a DNN into different parts, PES introduces several additional hyper-parameters that need to be tuned carefully. In the future, we will extend the work in the following aspects. First, we will study other mechanisms that distinguishing desired and undesired memorization rather than early stopping, e.g., the gradient ascent trick [8]. Second, we are interested in combining PES with interesting ideas from semi-supervised learning and unsupervised learning.
|
| 183 |
+
|
| 184 |
+
# Acknowledgments and Disclosure of Funding
|
| 185 |
+
|
| 186 |
+
YB was partially supported by Agriculture Consultant and Smart Management. BH was supported by the RGC Early Career Scheme No. 22200720, NSFC Young Scientists Fund No. 62006202 and HKBU CSD Departmental Incentive Grant. YY was partially supported by Key Research and Development Program of Shaanxi (ProgramNo. 2021ZDLGY01-03). GN was supported by JST AIP Acceleration Research Grant Number JPMJCR20U3, Japan. TL was partially supported by Australian Research Council Projects DE-190101473 and IC-190100031.
|
| 187 |
+
|
| 188 |
+
References
|
| 189 |
+
[1] Eric Arazo, Diego Ortego, Paul Albert, Noel E. O’Connor, and Kevin McGuinness. Unsupervised label noise modeling and loss correction. In ICML, pages 312–321, 2019.
|
| 190 |
+
[2] Devansh Arpit, Stanislaw Jastrzebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S. Kanwal, Tegan Maharaj, Asja Fischer, Aaron C. Courville, Yoshua Bengio, and Simon Lacoste-Julien. A closer look at memorization in deep networks. In ICML, pages 233–242, 2017.
|
| 191 |
+
[3] Mikhail Belkin, Daniel Hsu, Siyuan Ma, and Soumik Mandal. Reconciling modern machine-learning practice and the classical bias–variance trade-off. Proceedings of the National Academy of Sciences, 116(32):15849–15854, 2019.
|
| 192 |
+
[4] David Berthelot, Nicholas Carlini, Ian J. Goodfellow, Nicolas Papernot, Avital Oliver, and Colin Raffel. Mixmatch: A holistic approach to semi-supervised learning. In NeurIPS, pages 5050–5060, 2019.
|
| 193 |
+
[5] Youngchul Cha and Junghoo Cho. Social-network analysis using topic models. In SIGIR, pages 565–574, 2012.
|
| 194 |
+
[6] Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. In ICLR, 2017.
|
| 195 |
+
[7] Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning. The MIT Press, 2016.
|
| 196 |
+
[8] Bo Han, Gang Niu, Xingrui Yu, Quanming Yao, Miao Xu, Ivor W. Tsang, and Masashi Sugiyama. SIGUA: forgetting may make learning with noisy labels more robust. In ICML, pages 4006–4016, 2020.
|
| 197 |
+
[9] Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In NeurIPS, pages 8527–8537, 2018.
|
| 198 |
+
[10] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, pages 770–778, 2016.
|
| 199 |
+
[11] Takashi Ishida, Ikko Yamane, Tomoya Sakai, Gang Niu, and Masashi Sugiyama. Do we need zero training loss after achieving zero training error? In ICML, pages 4604–4614, 2020.
|
| 200 |
+
[12] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 201 |
+
[13] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, pages 1097–1105, 2012.
|
| 202 |
+
[14] Jingling Li, Mozhi Zhang, Keyulu Xu, John P. Dickerson, and Jimmy Ba. Noisy labels can induce good representations. arXiv preprint arXiv:2012.12896, 2020.
|
| 203 |
+
[15] Junnan Li, Richard Socher, and Steven C. H. Hoi. Dividemix: Learning with noisy labels as semi-supervised learning. In ICLR, 2020.
|
| 204 |
+
[16] Sheng Liu, Jonathan Niles-Weed, Narges Razavian, and Carlos Fernandez-Granda. Early-learning regularization prevents memorization of noisy labels. In NeurIPS, pages 20331–20342, 2020.
|
| 205 |
+
[17] Tongliang Liu and Dacheng Tao. Classification with noisy labels by importance reweighting. IEEE Transactions on pattern analysis and machine intelligence, 38(3):447–461, 2016.
|
| 206 |
+
[18] Wei Liu, Yu-Gang Jiang, Jiebo Luo, and Shih-Fu Chang. Noise resistant graph ranking for improved web image search. In CVPR, pages 849–856, 2011.
|
| 207 |
+
[19] Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In ICLR, 2017.
|
| 208 |
+
[20] Xingjun Ma, Hanxun Huang, Yisen Wang, Simone Romano, Sarah M. Erfani, and James Bailey. Normalized loss functions for deep learning with noisy labels. In ICML, pages 6543–6553, 2020.
|
| 209 |
+
[21] Xingjun Ma, Yisen Wang, Michael E. Houle, Shuo Zhou, Sarah M. Erfani, Shu-Tao Xia, Sudanthi N. R. Wijewickrema, and James Bailey. Dimensionality-driven learning with noisy labels. In ICML, pages 3361–3370, 2018.
|
| 210 |
+
[22] Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. In ICLR, 2020.
|
| 211 |
+
[23] Duc Tam Nguyen, Chaithanya Kumar Mummadi, Thi-Phuong-Nhung Ngo, Thi Hoai Phuong Nguyen, Laura Beggel, and Thomas Brox. SELF: learning to filter noisy labels with self-ensembling. In ICLR, 2020.
|
| 212 |
+
[24] Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In CVPR, pages 2233–2241, 2017.
|
| 213 |
+
[25] Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In CVPR, pages 5552–5560, 2018.
|
| 214 |
+
[26] Yisen Wang, Weiyang Liu, Xingjun Ma, James Bailey, Hongyuan Zha, Le Song, and Shu-Tao Xia. Iterative learning with open-set noisy labels. In CVPR, pages 8688–8696, 2018.
|
| 215 |
+
[27] Yisen Wang, Xingjun Ma, Zaiyi Chen, Yuan Luo, Jinfeng Yi, and James Bailey. Symmetric cross entropy for robust learning with noisy labels. In ICCV, pages 322–330, 2019.
|
| 216 |
+
[28] Songhua Wu, Xiaobo Xia, Tongliang Liu, Bo Han, Mingming Gong, Nannan Wang, Haifeng Liu, and Gang Niu. Class2simi: A noise reduction perspective on learning with noisy labels. In ICML, pages 11285–11295, 2021.
|
| 217 |
+
[29] Xiaobo Xia, Tongliang Liu, Bo Han, Chen Gong, Nannan Wang, Zongyuan Ge, and Yi Chang. Robust early-learning: Hindering the memorization of noisy labels. In ICLR, 2021.
|
| 218 |
+
[30] Xiaobo Xia, Tongliang Liu, Bo Han, Nannan Wang, Mingming Gong, Haifeng Liu, Gang Niu, Dacheng Tao, and Masashi Sugiyama. Part-dependent label noise: Towards instance-dependent label noise. In NeurIPS, pages 7597–7610, 2020.
|
| 219 |
+
[31] Xiaobo Xia, Tongliang Liu, Nannan Wang, Bo Han, Chen Gong, Gang Niu, and Masashi Sugiyama. Are anchor points really indispensable in label-noise learning? In NeurIPS, pages 6835–6846, 2019.
|
| 220 |
+
[32] Tong Xiao, Tian Xia, Yi Yang, Chang Huang, and Xiaogang Wang. Learning from massive noisy labeled data for image classification. In CVPR, pages 2691–2699, 2015.
|
| 221 |
+
[33] Qizhe Xie, Zihang Dai, Eduard H. Hovy, Thang Luong, and Quoc Le. Unsupervised data augmentation for consistency training. In NeurIPS, pages 6256–6268, 2020.
|
| 222 |
+
[34] Yilun Xu, Peng Cao, Yuqing Kong, and Yizhou Wang. L_dmi: A novel information-theoretic loss function for training deep nets robust to label noise. In NeurIPS, pages 6222–6233, 2019.
|
| 223 |
+
[35] Yu Yao, Tongliang Liu, Bo Han, Mingming Gong, Jiankang Deng, Gang Niu, and Masashi Sugiyama. Dual T: reducing estimation error for transition matrix in label-noise learning. In NeurIPS, pages 7260–7271, 2020.
|
| 224 |
+
[36] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2016.
|
| 225 |
+
[37] Hongyi Zhang, Moustapha Cissé, Yann N. Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. In ICLR, 2018.
|
md/train/QkVi6KogNbu/QkVi6KogNbu.md
ADDED
|
@@ -0,0 +1,536 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Stochastic Approximation of Gaussian Free Energy for Risk-Sensitive Reinforcement Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 We introduce a stochastic approximation rule for estimating the free energy from
|
| 11 |
+
2 i.i.d. samples generated by a Gaussian distribution with unknown mean and vari
|
| 12 |
+
3 ance. The rule is a simple modification of the Rescorla-Wagner rule, where the
|
| 13 |
+
4 (sigmoidal) stimulus is taken to be either the event of over- or underestimating a
|
| 14 |
+
5 target value. Since the Gaussian free energy is known to be a certainty-equivalent
|
| 15 |
+
6 sensitive to the mean and the variance, the learning rule has applications in risk
|
| 16 |
+
7 sensitive decision-making. In particular, we show how to use the rule in combina
|
| 17 |
+
8 tion with the temporal-difference error in order to obtain risk-sensitive, model-free
|
| 18 |
+
9 reinforcement learning algorithms.
|
| 19 |
+
|
| 20 |
+
# 10 1 Introduction
|
| 21 |
+
|
| 22 |
+
11 Main contribution. Let $\begin{array} { r } { N ( x ; \mu , \rho ) = \sqrt { \frac { \rho } { 2 \pi } } \exp \{ - \frac { \rho } { 2 } ( x - \mu ) ^ { 2 } \} } \end{array}$ be the Gaussian pdf with mean $\mu$
|
| 23 |
+
12 and precision $\rho$ . Given a sequence $x _ { 1 } , x _ { 2 } , \dotsc$ of i.i.d. samples drawn from $N ( x ; \mu , \rho )$ with unknown
|
| 24 |
+
13 $\mu$ and $\rho$ , consider the problem of estimating the free energy $\mathbf { F } _ { \beta }$ for a given inverse temperature $\beta \in \mathbb { R }$ ,
|
| 25 |
+
14 that is
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\mathbf { F } _ { \beta } = { \frac { 1 } { \beta } } \log \int _ { \mathbb { R } } N ( x ; \mu , \rho ) \exp \{ \beta x \} d x = \mu + { \frac { \beta } { 2 \rho } } .
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
15 This paper shows that (1) can be estimated using a surprisingly simple stochastic approximation rule.
|
| 32 |
+
16 If $v \in \mathbb { R }$ is the current estimate and a new sample $x$ arrives, update $v$ according to
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
v v + 2 \alpha \cdot \sigma _ { \beta } ( x - v ) \cdot ( x - v ) ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
17 where $\alpha > 0$ is a learning rate and $\sigma _ { \beta } ( z )$ is the scaled logistic sigmoid
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\sigma _ { \beta } ( z ) = \frac { 1 } { 1 + \exp \{ - \beta z \} } .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
18 The unique and stable fixed point of the learning rule (2) is equal to the desired free energy value
|
| 45 |
+
19 $\begin{array} { r } { v ^ { * } = \mu + \frac { \beta } { 2 \rho } } \end{array}$ .
|
| 46 |
+
20 Motivation. Risk-sensitivity, the susceptibility to the higher-order moments of the return, is neces
|
| 47 |
+
21 sary for the real-world deployment of AI agents. Wrong assumptions, lack of data, misspecification,
|
| 48 |
+
22 limited computation, and adversarial attacks are just a handful of the countless sources of unforeseen
|
| 49 |
+
23 perturbations that could be present at deployment time. Such perturbations can easily destabilize
|
| 50 |
+
24 risk-neutral policies, because they only focus on maximizing expected return while entirely neglecting
|
| 51 |
+
25 the variance. This poses serious safety concerns (Russell et al., 2015; Amodei et al., 2016; Leike
|
| 52 |
+
26 et al., 2017).
|
| 53 |
+
|
| 54 |
+
Submitted to 35th Conference on Neural Information Processing Systems (NeurIPS 2021). Do not distribute.
|
| 55 |
+
|
| 56 |
+
27 Risk-sensitive control has a long history in control theory (Coraluppi, 1997) and is an active area
|
| 57 |
+
28 of research within reinforcement learning (RL). There are multiple different approaches to risk
|
| 58 |
+
29 sensitivity in RL: for instance in Minimax RL, inspired by classical robust control theory, one derives
|
| 59 |
+
30 a conservative worst-case policy over MDP parameter intervals (Nilim and El Ghaoui, 2005; Tamar
|
| 60 |
+
31 et al., 2014); and the more recent CVaR approach relies on using the conditional-value-at-risk as a
|
| 61 |
+
32 robust performance measure (Galichet et al., 2013; Cassel et al., 2018). We refer the reader to García
|
| 62 |
+
33 and Fernández (2015) for a comprehensive overview. Here we focus on one of the earliest and most
|
| 63 |
+
34 popular approaches (see references), consisting of the use of exponentially-transformed values, or
|
| 64 |
+
35 equivalently, the free energy as the risk-sensitive certainty-equivalent (Bellman, 1957; Howard and
|
| 65 |
+
36 Matheson, 1972).
|
| 66 |
+
37 The certainty-equivalent of a stochastic value $X \in \mathbb { R }$ is defined as the representative deterministic
|
| 67 |
+
38 value $v \in \mathbb { R }$ that a decision-maker uses as a summary of $X$ for valuation purposes. To illustrate,
|
| 68 |
+
39 consider a first-order Markov chain over discrete states $s$ with transition kernel $P ( s ^ { \prime } | s )$ , state-emitted
|
| 69 |
+
40 rewards $R ( s ) \in \mathbb { R } .$ , and discount factor $\gamma \in [ 0 , 1 )$ . Typically RL methods use the expectation as the
|
| 70 |
+
41 certainty-equivalent of stochastic transitions (Bertsekas and Tsitsiklis, 1995; Sutton and Barto, 2018).
|
| 71 |
+
42 Therefore they compute the value $V ( s )$ of the current state $s \in S$ by (recursively) aggregating the
|
| 72 |
+
43 future values through their expectation, e.g.
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
V ( s ) = \int P ( s ^ { \prime } | s ) \{ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) \} d s ^ { \prime } .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
44 Instead, Howard and Matheson (1972) proposed using the free energy as the certainty-equivalent,
|
| 79 |
+
45 that is,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
V ( s ) = F _ { \beta } ( s ) = \frac { 1 } { \beta } \log \int P ( s ^ { \prime } | s ) \exp \bigl \{ \beta [ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) ] \bigr \} d s ^ { \prime } ,
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
46 where $\beta \in \mathbb { R }$ is the inverse temperature parameter which determines whether the aggregation is
|
| 86 |
+
47 risk-averse $( \beta < 0 )$ ), risk-seeking $( \beta > 0 )$ ), or even risk-neutral as a special case $\beta = 0$ ). Indeed, if
|
| 87 |
+
48 the future values are bounded, then $F _ { \beta } ( s )$ is sigmoidal in shape as a function of $\beta$ , with three special
|
| 88 |
+
49 values given by
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\operatorname* { l i m } _ { \beta } F _ { \beta } ( s ) = \left\{ \begin{array} { l l } { \operatorname* { m i n } _ { s ^ { \prime } } \{ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) \} } & { \mathrm { i f ~ } \beta \to - \infty ; } \\ { \mathbf E [ R ( S ^ { \prime } ) + \gamma V ( S ^ { \prime } ) | S = s ] } & { \mathrm { i f ~ } \beta \to ~ 0 ; } \\ { \operatorname* { m a x } _ { s ^ { \prime } } \{ R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) \} } & { \mathrm { i f ~ } \beta \to + \infty . } \end{array} \right.
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
50 These limit values highlight the sensitivity to the higher-order moments of the return. Because of this
|
| 95 |
+
51 property, the free energy has been used as the certainty-equivalent for assessing the value of both
|
| 96 |
+
52 actions and observations under limited control and model uncertainty respectively, each effect having
|
| 97 |
+
53 their own inverse temperature. The work by Grau-Moya et al. (2016) is a demonstration of how to
|
| 98 |
+
54 incorporate multiple types of effects in MDPs.
|
| 99 |
+
55 The present work addresses a longstanding problem pointed out by Mihatsch and Neuneier (2002).
|
| 100 |
+
56 An advantage of using expectations is that certainty-equivalents such as (4) are easily estimated
|
| 101 |
+
57 using stochastic approximation schemes. For instance, consider the classical Robbins-Monro update
|
| 102 |
+
58 (Robbins and Monro, 1951)
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
v v + \alpha \cdot ( x - v )
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
59 where $x \sim P ( x )$ is a stochastic target value, $\alpha$ is a learning rate, and $v$ is the estimate of $\mathbf { E } [ X ]$ .
|
| 109 |
+
60 Substituting $x = \ ' { R } ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } )$ and $v = V ( s )$ leads to the popular TD(0) update (Sutton and Barto,
|
| 110 |
+
61 1990):
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
V ( s ) V ( s ) + \alpha ( R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) - V ( s ) ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
62 However, there is no model-free counterpart for estimating free energies (5) under general unknown
|
| 117 |
+
63 distributions. The difficulty lies in that model-free updates rely on single (Monte-Carlo) unbiased
|
| 118 |
+
64 samples, but these are not available in the case of the free energy due to the log-term on the r.h.s.
|
| 119 |
+
65 of (5). This shortcoming led Mihatsch and Neuneier (2002) to propose the alternative risk-sensitive
|
| 120 |
+
66 learning rule
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
v v + \alpha \cdot u \cdot ( x - v ) , \qquad { \mathrm { w h e r e ~ } } u = { \{ \begin{array} { l l } { ( 1 - \kappa ) } & { { \mathrm { i f ~ } } ( x - v ) \geq 0 } \\ { ( 1 + \kappa ) } & { { \mathrm { i f ~ } } ( x - v ) < 0 } \end{array} }
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
67 and where $\kappa \in [ - 1 ; 1 ]$ is a risk-sensitivity parameter. While the heuristic (9) does produce risk
|
| 127 |
+
68 sensitive policies, these have no formal correspondence to free energies.
|
| 128 |
+
69 As anticipated, our work contributes a simple model-free rule for estimating the free energy in the
|
| 129 |
+
70 special case of Gaussian distributions. Starting from the Rescorla-Wagner rule
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 1: Update rule and its error function. a) shows the update $f ( x )$ to the estimate $v$ caused by the arrival of a sample $x$ , weighted by its probability density. The expected update is determined by comparing the integrals of the positive and negative lobes. b) Illustration of weighted update functions $f ( x )$ for different values of the current estimate $v$ . The positive lobes are either larger, equal, or smaller than the negative lobes for a $v$ that is either smaller, equal, or larger than the free energy respectively. c) Error function implied by the update rule. For a risk-neutral $\beta = 0$ ) estimator the error function is equal to the quadratic error $\begin{array} { r } { e ( \delta , \dot { 0 } ) = \frac { 1 } { 2 } \delta ^ { 2 } } \end{array}$ . For a risk-averse estimator $\beta < 0 )$ ), the error function is lopsided, penalizing under-estimates stronger than over-estimates. Furthermore, $e ( \delta , \beta )$ is an even function in $\beta$ .
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
v v + \alpha \cdot u \cdot ( x - v ) ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
71 where $u \in \{ 0 , 1 \}$ is an indicator function marking the presence of a stimulus (Rescorla, 1972), we
|
| 139 |
+
72 substitute $u$ by twice the soft-indicator function $\sigma _ { \beta } ( x - v )$ of (3), which activates whenever $v$ either
|
| 140 |
+
73 over- or underestimates the target value $x$ , depending on the sign of the risk-sensitivity parameter $\beta$ .
|
| 141 |
+
74 Using the substitutions appropriate for RL, we obtain the risk-sensitive $\mathrm { T D } ( 0 )$ -rule
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
V ( s ) V ( s ) + 2 \alpha \cdot \sigma _ { \beta } ( \delta ) \cdot \delta ,
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
75 where $\delta = R ( s ^ { \prime } ) + \gamma V ( s ^ { \prime } ) - V ( s )$ is the standard temporal-difference error. The learning rule is
|
| 148 |
+
76 trivial to implement, works as stated for tabular RL, and is easily adapted to the objective functions
|
| 149 |
+
77 of deep RL methods (Mnih et al., 2015). Finally, the learning rule is also consistent with findings in
|
| 150 |
+
78 computational neuroscience (Niv et al., 2012), e.g. predicting asymmetric updates that are stronger
|
| 151 |
+
79 for negative prediction errors in the risk-averse case (Gershman, 2015).
|
| 152 |
+
|
| 153 |
+
# 80 2 Analysis of the Learning Rule
|
| 154 |
+
|
| 155 |
+
Our central result is the following lemma, which implies that the unique and stable fixed point of the expected learning dynamics of (2) is given by the desired free energy.
|
| 156 |
+
|
| 157 |
+
83 Lemma 1. If $x _ { 1 } , x _ { 2 } , \dotsc$ are i.i.d. samples from $P ( X ) = N ( x ; \mu , \rho )$ , then the expected update $J ( v )$
|
| 158 |
+
84 of the learning rule (2) is twice differentiable and such that
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
J ( v ) = 2 \mathbf { E } \big [ \sigma _ { \beta } ( X - v ) \cdot ( X - v ) \big ] \left\{ { \begin{array} { l l } { < 0 , } & { i f v > \mathbf { F } _ { \beta } ; } \\ { = 0 , } & { i f v = \mathbf { F } _ { \beta } ; } \\ { > 0 , } & { i f v < \mathbf { F } _ { \beta } . } \end{array} } \right.
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
85 Proof. The expected update of $v$ is
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
J ( v ) : = 2 \int N ( x ; \mu , \rho ) \sigma ( x - v ) ( x - v ) d x ,
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
86 where we have dropped the subscript $\beta$ from $\sigma _ { \beta }$ for simplicity. Using the Leibnitz integral rule it
|
| 171 |
+
87 is easily seen that this function is twice differentiable w.r.t. $v$ , because the integrand is a product of
|
| 172 |
+
88 twice differentiable functions.
|
| 173 |
+
89 The resulting update direction will be positive if the integral over the positive contributions outweight
|
| 174 |
+
90 the negative contributions and vice versa. The integrand of (12) has a symmetry property: splitting
|
| 175 |
+
91 the domain of integration $\mathbb { R }$ into $\left( - \infty ; v \right]$ and $( v ; + \infty )$ , using the change of variable $\delta = x - v$ , and
|
| 176 |
+
92 recombining the two integrals into one gives
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
J ( v ) : = 2 \int _ { 0 } ^ { \infty } \Bigl \{ N ( v + \delta ; \mu , \rho ) \sigma ( \delta ) - N ( v - \delta ; \mu , \rho ) \sigma ( - \delta ) \Bigr \} \delta d \delta .
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
93 We will show that the integrand of (13) is either negative, zero, or positive, depending on the value
|
| 183 |
+
94 of $v$ . Define the weighted update $f ( x )$ as
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
f ( x ) = f ( v + \delta ) : = N ( v + \delta ; \mu , \rho ) \sigma ( \delta ) \delta .
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
95 This function is illustrated in Figure 1a. We are interested in the ratio
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\frac { f ( v + \delta ) } { f ( v - \delta ) } = \frac { N ( v + \delta ; \mu , \rho ) } { N ( v - \delta ; \mu , \rho ) } \frac { \sigma ( \delta ) } { \sigma ( - \delta ) } ,
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
96 which compares the positive against the negative contributions to the integrand in (13). The first
|
| 196 |
+
97 fraction of the r.h.s. of (14) is equal to
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\frac { N ( v + \delta ; \mu , \delta ) } { N ( v - \delta ; \mu , \rho ) } = \exp \Bigl \{ - \frac { \rho } { 2 } ( v + \delta - \mu ) ^ { 2 } + \frac { \rho } { 2 } ( v - \delta - \mu ) ^ { 2 } \Bigr \} = \exp \{ - 2 \rho \delta ( v - \mu ) \} .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
98 Using the symmetry property $\sigma ( \delta ) = 1 - \sigma ( - \delta )$ of the logistic sigmoid function, the second fraction
|
| 203 |
+
99 can be shown to be equal to
|
| 204 |
+
|
| 205 |
+
$$
|
| 206 |
+
{ \frac { \sigma ( \delta ) } { \sigma ( - \delta ) } } = { \frac { \sigma ( \delta ) } { 1 - \sigma ( \delta ) } } = \exp \{ \beta \delta \} .
|
| 207 |
+
$$
|
| 208 |
+
|
| 209 |
+
100 Substituting the above back into (14) results in
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\frac { f ( v + \delta ) } { f ( v - \delta ) } = \exp \{ - 2 \rho \delta ( v - \mu ) + \beta \delta \} \left\{ \begin{array} { l l } { > 1 } & { \mathrm { f o r } v < \mu + \frac { \beta } { 2 \rho } , } \\ { = 1 } & { \mathrm { f o r } v = \mu + \frac { \beta } { 2 \rho } , } \\ { < 1 } & { \mathrm { f o r } v > \mu + \frac { \beta } { 2 \rho } , } \end{array} \right.
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
also illustrated in Figure 1b. Therefore, the integrand in (13) is either positive101 $\begin{array} { r } { ( v < \mu + \frac { 2 } { 2 \rho } ) } \end{array}$ , zero 102 $\begin{array} { r } { ( v = \mu + \frac { \beta } { 2 \rho } ) } \end{array}$ , or negative $\begin{array} { r } { ( v > \mu + \frac { \beta } { 2 \rho } ) } \end{array}$ , allowing to conclude the claim of the lemma. □
|
| 216 |
+
|
| 217 |
+
# 3 Additional Properties
|
| 218 |
+
|
| 219 |
+
We discuss additional properties in order to strengthen the intuition and to clarify the significance of the learning rule; some practical implementation advice is given at the end.
|
| 220 |
+
|
| 221 |
+
106 Associated free energy functional. The Gaussian free energy $\mathbf { F } _ { \beta }$ in (1) is formally related to the
|
| 222 |
+
107 valuation of risk-sensitive portfolios used in finance (Markowitz, 1952). It is well-known that the free
|
| 223 |
+
108 energy is the extremum of the free energy functional, defined as the Kullback-Leibler-regularized
|
| 224 |
+
109 expectation of $X$ :
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
F _ { \beta } \big [ p ( x ) \big ] : = \mathbf { E } _ { p } [ X ] - \frac { 1 } { \beta } \mathbf { K L } \big ( p ( x ) \big | \big | N ( x ; \mu , \rho ) \big ) .
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
110 This functional is convex in $p$ for $\beta < 0$ and concave for $\beta > 0$ . Taking either the minimum (for
|
| 231 |
+
111 $\beta < 0$ ) or maximum (for $\beta > 0$ ) w.r.t. $p ( x )$ yields
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\mathbf { F } _ { \beta } = \operatorname { e x t r } F _ { \beta } \left[ p ( x ) \right] = \left[ \mu + { \frac { \beta } { \rho } } \right] - { \frac { 1 } { \beta } } \left[ { \frac { \beta ^ { 2 } } { 2 \rho } } \right] = \mu + { \frac { \beta } { 2 \rho } } = \mathbf { E } [ X ] + { \frac { \beta } { 2 } } \mathbf { V a r } [ X ] ,
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
112 that is, the Gaussian free energy is a linear function of $\beta$ , where the intercept and the slope are equal to the expectation and half of the variance of 113 $X$ respectively. The extremizer $p ^ { * } ( x )$ is the Gaussian
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\begin{array} { r } { p ^ { * } ( x ) = \arg \underset { p ( x ) } { \mathrm { e x t r } } F _ { \beta } \big [ p ( x ) \big ] = N ( x ; \mu + \frac { \beta } { \rho } , \rho ) . } \end{array}
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
114 The above gives a precise meaning to the free energy as a certainty-equivalent. The choice of a
|
| 244 |
+
115 non-zero inverse temperature $\beta$ reflects a distrust in the reference probability density $N ( x ; \mu , \rho )$ as a
|
| 245 |
+
116 reliable model for $X$ . Specifically, the magnitude of $\beta$ quantifies the degree of distrust and the sign of
|
| 246 |
+
117 $\beta$ indicates whether it is an under- or overestimation. This distrust results in using the extremizer (17)
|
| 247 |
+
118 as a robust substitute for the original reference model for $X$ .
|
| 248 |
+
119 Game-theoretic interpretation. In addition to the above, previous work (Ortega and Lee, 2014;
|
| 249 |
+
120 Eysenbach and Levine, 2019; Husain et al., 2021) has shown that the free energy functional has an
|
| 250 |
+
121 interpretation as a two-player game which characterizes its robustness properties. Following Ortega
|
| 251 |
+
122 and Lee (2014), computing the Legendre-Fenchel dual of the KL regularizer yields an equivalent
|
| 252 |
+
123 adversarial re-statement of the free energy functional (15), which for $\beta > 0$ is given by
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
\operatorname* { m a x } _ { p ( x ) } \operatorname* { m i n } _ { c ( x ) } \Bigl \{ \int p ( x ) [ x - c ( x ) ] d x + \int N ( x ; \mu , \rho ) \exp \{ \beta c ( x ) \} d x , \Bigr \} ,
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
124 where the perturbations $c ( x ) \in \mathbb { R }$ are chosen by an adversary (Note: for the case $\beta < 0$ one obtains a
|
| 259 |
+
125 Minimax problem over $p ( x )$ and $c ( x )$ rather than a Maximin). From this dual interpretation, one sees
|
| 260 |
+
126 that the distribution $p ( x )$ is chosen as if it were maximizing the expected value of $x ^ { \prime } = x - c ( x )$ ,
|
| 261 |
+
127 the adversarially perturbed version of $x$ . In turn, the adversary attempts to minimize $x ^ { \prime }$ , but at the
|
| 262 |
+
128 cost of an exponential penalty for $c ( x )$ . More precisely, given the distribution $p ( x )$ , the adversarial
|
| 263 |
+
129 best-response (ignoring constants) is
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
c ^ { * } ( x ) \overset { ( \cong ) } { = } \frac { 1 } { \beta } \log \frac { p ( x ) } { N ( x ; \mu , \rho ) } \overset { ( \ u ) } { = } \frac { 1 } { 2 \beta } \bigg \{ \rho ( x - \mu ) ^ { 2 } - \bar { \rho } ( x - \bar { \mu } ) ^ { 2 } + \log \frac { \bar { \rho } } { \rho } \bigg \} \overset { ( \circ ) } { = } x - \mathbf { F } _ { \beta } ,
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
130 where the equality (a) is true for any choice of $p ( x )$ ; (b) holds if $p ( x ) = N ( x ; \bar { \mu } , \bar { \rho } )$ for some mean $\bar { \mu }$
|
| 270 |
+
131 and precision $\bar { \rho }$ ; and where (c) holds if $p ( x )$ is the extremizer (17). Here we see that the adversarial
|
| 271 |
+
132 perturbations can be arbitrarily bad if $p ( x )$ is not chosen cautiously: for instance, for the (Gaussian)
|
| 272 |
+
133 Dirac delta
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
p ( x ) = N ( x ; \mu , { \bar { \rho } } ) { \xrightarrow { \bar { \rho } \to \infty } } \delta ( x = \mu ) \quad { \mathrm { w e ~ g e t } } \quad c ^ { * } ( x ) = { \mathcal { O } } \left( \log { \frac { \bar { \rho } } { \rho } } \right) { \xrightarrow { \bar { \rho } \to \infty } } + \infty .
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
134 Error function. Let $\delta = x - v$ be the instantaneous difference between the sample and the estimate.
|
| 279 |
+
135 If the update rule (2) corresponds to a stochastic gradient descent step, then what is the error function?
|
| 280 |
+
136 That is, if
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
v v - \alpha \cdot \nabla _ { \delta } e ( \delta , \beta ) = v + 2 \alpha \cdot \sigma _ { \beta } ( \delta ) \cdot \delta ,
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
137 then what is $e ( \delta , \beta ) ?$ Integrating the gradient $\nabla _ { \delta } e ( \delta , \beta )$ with respect to $\delta$ gives
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
e ( \delta , \beta ) = 2 \int \sigma ( \delta ) \delta d \delta = \frac { 2 \delta } { \beta } \log ( 1 + \exp \{ \beta \delta \} ) + \frac { 2 } { \beta ^ { 2 } } \mathrm { l i } _ { 2 } ( - \exp \{ \beta \delta \} ) + \frac { \pi ^ { 2 } } { 6 \beta ^ { 2 } } ,
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
138 where $\log ( 1 + \exp ( z ) )$ is the softplus function (Dugas et al., 2001) and $\operatorname { l i } _ { 2 } ( z )$ is Spence’s function
|
| 293 |
+
139 (or dilogarithm) defined as
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\operatorname { l i } _ { 2 } ( z ) = - \int _ { 0 } ^ { z } { \frac { \log ( 1 - z ) } { z } } d z ,
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
and where the constant of integration 140 $\frac { \pi ^ { 2 } } { 6 \beta ^ { 2 } }$ was chosen so that $\begin{array} { r } { \operatorname* { l i m } _ { \delta \to 0 } e ( \delta , \beta ) = 0 } \end{array}$ for all $\beta \in \mathbb { R }$ . This 141 error function is illustrated in Figure 1c for a handful of values of $\beta$ . In the limit $\beta 0$ , the error 142 function becomes:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\operatorname* { l i m } _ { \beta \to 0 } e ( \delta , \beta ) = \frac { 1 } { 2 } \delta ^ { 2 } ,
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
thus establishing a connection between the quadratic error and the proposed learning rule.
|
| 306 |
+
|
| 307 |
+
144 Practical considerations. The free energy learning rule (2) can be implemented as stated, for 145 instance either using constant learning rate $\alpha > 0$ or using an adaptive learning rate $\alpha _ { t } > 0$ fulfilling the Robbins-Monro conditions 146 $\textstyle \sum _ { t } \alpha _ { t } > 0$ and $\textstyle \sum _ { t } \alpha _ { t } ^ { 2 } < \infty$ .
|
| 308 |
+
|
| 309 |
+
147 A problem arises when most of the data falls within the near-zero saturated region of the sigmoid,
|
| 310 |
+
148 which can occur due to an unfortunate initialization of the estimate $v$ . Since then $\sigma _ { \beta } ( x - v ) \approx 0$ for
|
| 311 |
+
149 most $x$ , learning can be very slow. This problem can be mitigated using an affine transformation of
|
| 312 |
+
150 the sigmoid that gaurantees a minimal rate $\eta > 0$ , such as
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
\tilde { \sigma } _ { \beta } ( z ) = \eta + ( 1 - 2 \eta ) \sigma _ { \beta } ( z ) ,
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
1 which re-scales the sigmoid within the interval $[ \eta , 1 - \eta ]$ . We have found this adjustment to work
|
| 319 |
+
52 well for $| \beta | \approx 0$ , especially when it is only used during the first few iterations.
|
| 320 |
+
153 If one wishes to use the learning rule in combination with gradient-based optimization (as is typical
|
| 321 |
+
154 in a deep learning architecture), we do not recommend using the error function (21) directly. Rather,
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 2: Estimation of the free energy from Gaussian (left panel) and uniform samples (right panel). Each plot shows 10 estimation processes (9 in pink, 1 in red) per choice of the inverse temperature, where $\beta \in \{ - 4 , - 2 , 0 , 2 , 4 \}$ . The true free energies are shown in black. The estimation of the free energy is accurate for Gaussian data but biased for uniform data.
|
| 325 |
+
|
| 326 |
+
155 we suggest absorbing the factor $2 \tilde { \sigma } _ { \beta } ( \delta )$ directly into the learning rate (where as before, $\delta = x - v )$
|
| 327 |
+
|
| 328 |
+
56 A simple way to achieve this consists in scaling the estimation error $E ( \delta )$ by said factor using a
|
| 329 |
+
57 stop-gradient, that is,
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\tilde { E } ( \delta ) : = \mathrm { S t o p G r a d } ( 2 \tilde { \sigma } _ { \beta } ( \delta ) ) \cdot E ( \delta ) ,
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
158 since then the error gradient with respect to the model parameters $\theta$ will be
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\nabla _ { \boldsymbol { \theta } } \tilde { E } ( \boldsymbol { \delta } ) = - 2 \tilde { \sigma } _ { \beta } ( \boldsymbol { \delta } ) \cdot \frac { \partial E } { \partial \boldsymbol { \delta } } \frac { \partial v } { \partial \boldsymbol { \theta } } .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
159 Finally, a large $| \beta |$ chooses a target free energy within a tail of the distribution, leading to slower
|
| 342 |
+
160 convergence. If one wishes to approximate a free energy that sits at $n$ standard deviations from the
|
| 343 |
+
161 mean, then $\beta$ should be chosen as
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\beta ( n ) = 2 n \sqrt { \rho } .
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
2 However, since $\beta ( n )$ is not scale invariant and the scale $\rho$ is unknown, a good choice of $\beta$ must be
|
| 350 |
+
3 determined empirically.
|
| 351 |
+
|
| 352 |
+
# 164 4 Experiments
|
| 353 |
+
|
| 354 |
+
165 Estimation. Our first experiment is a simple sanity check. We estimated the free energy in an
|
| 355 |
+
166 online manner using the learning rule (2) from data generated by two i.i.d. sources: a standard
|
| 356 |
+
167 Gaussian, and uniform distribution over the interval $[ - 2 , 2 ]$ . Five different inverse temperatures
|
| 357 |
+
168 were used $( \beta \in \{ - 4 , - 2 , 0 , 2 , 4 \} )$ . For each condition, we ran ten estimation processes from 4000
|
| 358 |
+
169 random samples using the same starting point $\mathit { v } = 1 . 5$ ). The learning rate was constant and equal to
|
| 359 |
+
170 $\alpha = 0 . 0 2$ .
|
| 360 |
+
171 The results are shown in figure 2. In the Gaussian case, the estimation processes successfully stabilize
|
| 361 |
+
172 around the true free energies, with processes having larger $| \beta |$ converging slower, but fluctuating
|
| 362 |
+
173 less. In the uniform case, the estimation processes do not settle around the correct free energy values
|
| 363 |
+
174 for $\beta \neq 0$ ; however, the found solutions increase monotonically with $\beta$ . These results validate the
|
| 364 |
+
175 estimation method only for Gaussian data, as expected.
|
| 365 |
+
176 Reinforcement learning. Next we applied the risk-sensitive learning rule to RL in a simple grid
|
| 366 |
+
177 world. The goal was to qualitatively investigate the types of policies that result from different
|
| 367 |
+
178 risk-sensitivities. Shown in Figure 3a, the objective of the agent is to navigate to a terminal state
|
| 368 |
+
179 containing a reward pill within no more than 25 time steps while avoiding the water. The reward pill
|
| 369 |
+
180 delivers one reward point upon collection, whereas standing in the water penalizes the agent with
|
| 370 |
+
181 minus one reward point per time step. In addition, there is a very strong wind: with $50 \%$ chance in
|
| 371 |
+
182 each step, the wind pushes the agent one block in a randomly chosen cardinal direction.
|
| 372 |
+
183 We trained R2D2 (Kapturowski et al., 2018) agents with the risk-sensitive cost function (23) using
|
| 373 |
+
184 five uniformly spaced inverse temperatures $\beta$ ranging from $- 0 . 8$ to 0.8. The architecture of our
|
| 374 |
+
185 agents consisted of a first convolutional layer with 3-by-3-kernels and 128 channels, a dense layer
|
| 375 |
+
186 with 128 units, and a logit layer for the four possible actions (i.e. walking directions). The discount
|
| 376 |
+
187 factor was set to $\gamma = 0 . 9 5$ . Each agent was trained for 500K iterations with a batch size of 64, using
|
| 377 |
+
188 the Adam optimizer with learning rate $1 0 ^ { - 4 }$ (Kingma and Ba, 2014). The target network was updated
|
| 378 |
+
189 every 400 steps. The inputs to the network were observation tensors of binary features representing
|
| 379 |
+
190 the 2D board. Note these agents didn’t use any recurrent cells and therefore no backpropagation
|
| 380 |
+
191 through time was used. To train all the agents in this experiment we used 154 CPU core hours at 2.4
|
| 381 |
+
192 GHz and 22.5 GPU hours.
|
| 382 |
+
193 To analyze the resulting policies, we computed the episodic returns and the percentage of time the
|
| 383 |
+
194 agents spent in the water (i.e. the “violations”) from 1000 roll-outs. The results, shown in Figure 3b,
|
| 384 |
+
195 reveal that the risk-neutral policy $\beta = 0$ ) has the highest average return. However, the percentage of
|
| 385 |
+
196 violations increases monotonically with $\beta$ . Figure 3c shows the state-visitation probabilities estimated
|
| 386 |
+
197 from the same roll-outs. There are essentially three types of policies: risk-averse, taking the longest
|
| 387 |
+
198 path away from the water; risk-neutral, taking middle path; and risk-seeking, taking the shortest
|
| 388 |
+
199 route right next to the water. These are even more crisply revealed when the wind is de-activated.
|
| 389 |
+
200 Interestingly, the risk-averse policy $\beta = - 0 . 8 )$ does not always reach the goal, which explains why
|
| 390 |
+
201 its return is slightly lower in spite of committing fewer violations.
|
| 391 |
+
202 Bandits. In the last experiment we wanted to observe the premiums that risk-sensitive agents are
|
| 392 |
+
203 willing to pay when confronted with a choice between a certain and a risky option. To do so, we
|
| 393 |
+
204 used a two-arm bandit setup, where one arm (“certain”) delivered a fixed reward and the other arm
|
| 394 |
+
205 (“risky”) a stochastic one—more precisely, drawn from a Gaussian distribution with mean $\mu$ and
|
| 395 |
+
206 precision $\rho = 2$ . Both the fixed payoff and the mean $\mu$ of the risky arm were drawn from a standard
|
| 396 |
+
207 Gaussian distribution at the beginning of an episode, which lasted twenty rounds. To build agents
|
| 397 |
+
208 that can trade off exploration versus exploitation, we used memory-based meta-learning (Wang et al.,
|
| 398 |
+
209 2016; Santoro et al., 2016), which is known to produce near-optimal bandit players (Ortega et al.,
|
| 399 |
+
210 2019; Mikulik et al., 2020).
|
| 400 |
+
211 We meta-trained five R2D2 agents using risk-sensitives $\beta \in \{ - 1 . 0 , - 0 . 5 , 0 , 0 . 5 , 1 . 0 \}$ on the two
|
| 401 |
+
212 armed bandit task distribution (also randomizing the certain/risky arm positions) with discount factor
|
| 402 |
+
213 $\gamma = 0 . 9 5$ . The network architecture and training parameters were as in the previous RL experiment,
|
| 403 |
+
214 with the difference that the initial convolutional layer was replaced with a dense layer and an LSTM
|
| 404 |
+
215 layer having 128 memory cells (Hochreiter and Schmidhuber, 1997). We used backpropagation
|
| 405 |
+
216 through time for computing the episode gradients. The input to the network consisted of the action
|
| 406 |
+
217 taken and reward obtained in the previous step. This setup allows agents to adapt their choices to past
|
| 407 |
+
218 interactions throughout an episode. To train all the agents in this experiment we used 88 CPU core
|
| 408 |
+
219 hours at $2 . 4 \ : \mathrm { G H z }$ and 10 GPU hours.
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
Figure 3: Comparison of risk-sensitive RL agents. a) The task consists in picking up a reward located at the terminal state while avoiding stepping into water. A strong wind pushes the agent into a random direction $50 \%$ of the time. b) Bar plots showing the average return (blue) and the percentage of violations (red) for each policy, ordered from lowest to highest $\beta$ . c) State visitation frequencies for each policy, plus the optimal (deterministic) policy when there is no wind (black paths).
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 4: Two-armed bandit policy profiles with different risk-sensitivities $\beta$ . The certain arm 1 pays a deterministic reward, while the risky arm 2 pays a stochastic reward drawn from $N ( r ; \mu , \rho )$ with precision $\rho = 2$ . The agents were meta-trained on bandits where the payoffs (i.e. arm 1’s payoff and arm 2’s mean) were drawn from a standard Gaussian distribution. The plots show the marginal probability of choosing the certain arm (blue) over the risky arm (red) after twenty interactions for every payoff combination. Each point in the uniform grid was estimated from 30 seeds. Note the deviations from the true risk-neutral indifference curve (black diagonal).
|
| 415 |
+
|
| 416 |
+
Figure 4 shows the agents’ choice profile in the last $( \mathrm { 2 0 ^ { t h } } )$ time step. A true risk-neutral agent does not distinguish between a certain and risky option that have the same expected payoff (black diagonal). The main finding is that the indifference region (i.e. close to a $50 \%$ choice in white color) evolves significantly with increasing $\beta$ , implying that the agents with different risk attitudes are indeed willing to pay different risk premia (measured as the vertical distance of the indifference region from the diagonal). We observe two effects. The most salient effect is that the indifference region mostly 6 moves from being beneath (risk-averse) to above (risk-seeking) the true risk-neutral indifference curve as $\beta$ increases. The second effect is that risk-averse policies $\beta = - 1$ and $- 0 . 5 )$ contain a 8 large region of a stochastic choice profile that appears to depend only on the risky arm’s parameter. 9 We do not have a clear explanation for this effect. Our hypothesis is that risk-averse policies assume adversarial environments, which require playing mixed strategies with precise probabilities. Finally, the risk-neutral agent $\beta = 0$ ) appears to be slightly risk-averse. We believe that this effect arises due 2 to the noisy exploration policy employed during training.
|
| 417 |
+
|
| 418 |
+
# 233 5 Discussion
|
| 419 |
+
|
| 420 |
+
Summary of contributions. In this work we have introduced a learning rule for the online estimation of the Gaussian free energy with unknown mean and precision/variance. The learning rule (2) is obtained by reinterpreting the stimulus-presence indicator component of the Rescorla-Wagner rule (Rescorla, 1972) as a (soft) indicator function for the event of either over- or underestimating the target value. In Lemma 1 we have shown that the free energy is the unique and stable fixed point of the expected learning dynamics. This is the main contribution.
|
| 421 |
+
|
| 422 |
+
240 Furthermore, we have shown how to use the learning rule for risk-sensitive RL. Since the free
|
| 423 |
+
241 energy implements certainty-equivalents that range from risk-averse to risk-seeking, we were able
|
| 424 |
+
242 to formulate a risk-sensitive, model-free update in the spirit of TD(0) (Sutton and Barto, 1990),
|
| 425 |
+
243 thereby addressing a longstanding problem (Mihatsch and Neuneier, 2002) for the special case of
|
| 426 |
+
244 the Gaussian distribution. Due to its simplicity, the rule is easy to incorporate into existing deep RL
|
| 427 |
+
245 algorithms, for instance by modifying the error using a stop-gradient as shown in (23). In Section 3
|
| 428 |
+
246 we also elaborated on the role of the free energy within decision-making, pointing out its robustness
|
| 429 |
+
247 properties and adversarial interpretation.
|
| 430 |
+
248 We also demonstrated the learning rule in experiments. Firstly, we empirically confirmed that
|
| 431 |
+
249 the online estimates stabilize around the correct Gaussian free energies (Section 4–Estimation).
|
| 432 |
+
250 Secondly, we showed how incorporating risk-attitudes into deep RL can lead to agents implementing
|
| 433 |
+
251 qualitatively different policies which intuitively make sense (Section 4–RL). Lastly, we inspected the
|
| 434 |
+
252 premia risk-sensitive agents are willing to pay for choosing a risky over a certain option, finding that
|
| 435 |
+
253 agents have choice patterns that are more complex than we had anticipated (Section 4–Bandits).
|
| 436 |
+
|
| 437 |
+
Limitations. As shown empirically in Section 4–Estimation, an important limitation of the learning rule is that its fixed point is only equal to the free energy when the samples are Gaussian (or approximately Gaussian, as justified by the CLT). Nevertheless, agents using the risk-sensitive TD(0) update (11) still display risk attitudes monotonic in $\beta$ , with $\beta = 0$ reducing to the familiar risk-neutral case.
|
| 438 |
+
|
| 439 |
+
59 While Lemma 1 establishes the stable equilibrium of the expected update, it only guarantees convergence in continuous-time updates. To show convergence using discrete-time point samples, a stronger result is required. In particular, we conjecture that
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\left| J ( v ) \right| = 2 \Biggr | \int N ( x ; \mu , \rho ) \sigma _ { \beta } ( x - v ) ( x - v ) d x \Biggr | \leq 2 \bigl | { \bf F } _ { \beta } - v \bigr |
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
If (26) is true, meaning that $J ( v )$ is 2-Lipschitz, then this could be combined with a result in stochastic approximation theory akin to Theorem 1 in Jaakkola et al. (1994) to prove convergence.
|
| 446 |
+
|
| 447 |
+
A shortcoming of our experiments using R2D2 agents is that they deterministically pick actions that maximize the Q-value. However, risk-averse agents see their environments as being adversarial, and these in turn require stochastic policies in order to achieve optimal performance.
|
| 448 |
+
|
| 449 |
+
Conclusions. Because it is impossible to anticipate the many ways in which a dynamically-changing environment will violate prior assumptions, requiring the robustness of ML algorithms is of vital importance for their deployment in real-world applications. Unforeseen events can render their decisions unreliable—and in some cases even unsafe.
|
| 450 |
+
|
| 451 |
+
Our work makes a small but nonetheless significant contribution to risk-sensitivity in ML. In essence, it suggests a minor modification to existing algorithms, biasing valuation estimates in a risk-sensitive manner. In particular, we expect the risk-sensitive TD(0)-learning rule to become an integral part of future deep RL algorithms.
|
| 452 |
+
|
| 453 |
+
# References
|
| 454 |
+
|
| 455 |
+
Amodei, D., Olah, C., Steinhardt, J., Christiano, P., Schulman, J., and Mané, D. (2016). Concrete problems in AI safety. arXiv preprint arXiv:1606.06565.
|
| 456 |
+
|
| 457 |
+
Bellman, R. (1957). Dynamic Programming. Princeton University Press.
|
| 458 |
+
|
| 459 |
+
Bertsekas, D. P. and Tsitsiklis, J. N. (1995). Neuro-dynamic programming: an overview. In Proceedings of 1995 34th IEEE conference on decision and control, volume 1, pages 560–564. IEEE.
|
| 460 |
+
|
| 461 |
+
Cassel, A., Mannor, S., and Zeevi, A. (2018). A general approach to multi-armed bandits under risk criteria. In Conference On Learning Theory, pages 1295–1306. PMLR.
|
| 462 |
+
|
| 463 |
+
Coraluppi, S. P. (1997). Optimal control of Markov decision processes for performance and robustness. University of Maryland, College Park.
|
| 464 |
+
|
| 465 |
+
Dugas, C., Bengio, Y., Bélisle, F., Nadeau, C., and Garcia, R. (2001). Incorporating second-order functional knowledge for better option pricing. In Advances in Neural Information Processing Systems, volume 13. MIT Press.
|
| 466 |
+
|
| 467 |
+
Eysenbach, B. and Levine, S. (2019). If MaxEnt RL is the answer, what is the question?
|
| 468 |
+
|
| 469 |
+
Galichet, N., Sebag, M., and Teytaud, O. (2013). Exploration vs exploitation vs safety: Risk-aware multi-armed bandits. In Asian Conference on Machine Learning, pages 245–260. PMLR.
|
| 470 |
+
|
| 471 |
+
García, J. and Fernández, F. (2015). A comprehensive survey on safe reinforcement learning. Journal of Machine Learning Research, 16(1):1437–1480.
|
| 472 |
+
|
| 473 |
+
Gershman, S. J. (2015). Do learning rates adapt to the distribution of rewards? Psychonomic Bulletin & Review, 22(5):1320–1327.
|
| 474 |
+
|
| 475 |
+
Grau-Moya, J., Leibfried, F., Genewein, T., and Braun, D. A. (2016). Planning with informationprocessing constraints and model uncertainty in Markov decision processes. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 475–491. Springer.
|
| 476 |
+
|
| 477 |
+
299 Hochreiter, S. and Schmidhuber, J. (1997). Long short-term memory. Neural computation, 9(8):1735– 1780.
|
| 478 |
+
301 Howard, R. A. and Matheson, J. E. (1972). Risk-sensitive Markov decision processes. Management science, 18(7):356–369.
|
| 479 |
+
303 Husain, H., Ciosek, K., and Tomioka, R. (2021). Regularized policies are reward robust. In International Conference on Artificial Intelligence and Statistics, pages 64–72. PMLR.
|
| 480 |
+
305 Jaakkola, T., Jordan, M. I., and Singh, S. P. (1994). On the convergence of stochastic iterative dynamic programming algorithms. Neural computation, 6(6):1185–1201.
|
| 481 |
+
307 Kappen, H. J. (2005). Path integrals and symmetry breaking for optimal control theory. Journal of statistical mechanics: theory and experiment, 2005(11):P11011. Kappen, H. J., Gómez, V., and Opper, M. (2012). Optimal control as a graphical model inference problem. Machine learning, 87(2):159–182. Kapturowski, S., Ostrovski, G., Quan, J., Munos, R., and Dabney, W. (2018). Recurrent experience replay in distributed reinforcement learning. In International conference on learning representations.
|
| 482 |
+
314 Kingma, D. P. and Ba, J. (2014). Adam: A method for stochastic optimization. arXiv e-prints, pages arXiv–1412.
|
| 483 |
+
316 Leike, J., Martic, M., Krakovna, V., Ortega, P. A., Everitt, T., Lefrancq, A., Orseau, L., and Legg, S. (2017). AI safety gridworlds. arXiv preprint arXiv:1711.09883.
|
| 484 |
+
318 Markowitz, H. (1952). Portfolio selection. Journal of Finance, 1(7).
|
| 485 |
+
319 Mihatsch, O. and Neuneier, R. (2002). Risk-sensitive reinforcement learning. Machine learning, 49(2):267–290.
|
| 486 |
+
321 Mikulik, V., Delétang, G., McGrath, T., Genewein, T., Martic, M., Legg, S., and Ortega, P. A. (2020). Meta-trained agents implement bayes-optimal agents. arXiv preprint arXiv:2010.11223.
|
| 487 |
+
323 Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A. A., Veness, J., Bellemare, M. G., Graves, A., Riedmiller, M., Fidjeland, A. K., Ostrovski, G., et al. (2015). Human-level control through deep reinforcement learning. nature, 518(7540):529–533.
|
| 488 |
+
326 Nilim, A. and El Ghaoui, L. (2005). Robust control of Markov decision processes with uncertain transition matrices. Operations Research, 53(5):780–798. Niv, Y., Edlund, J. A., Dayan, P., and O’Doherty, J. P. (2012). Neural prediction errors reveal a risk-sensitive reinforcement-learning process in the human brain. Journal of Neuroscience, 32(2):551–562. Ortega, D. A. and Braun, P. A. (2011). Information, utility and bounded rationality. In International Conference on Artificial General Intelligence, pages 269–274. Springer. Ortega, P. A. and Braun, D. A. (2013). Thermodynamics as a theory of decision-making with information-processing costs. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 469(2153):20120683.
|
| 489 |
+
336 Ortega, P. A. and Lee, D. (2014). An adversarial interpretation of information-theoretic bounded rationality. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28.
|
| 490 |
+
338 Ortega, P. A., Wang, J. X., Rowland, M., Genewein, T., Kurth-Nelson, Z., Pascanu, R., Heess, N., Veness, J., Pritzel, A., Sprechmann, P., et al. (2019). Meta-learning of sequential strategies. arXiv preprint arXiv:1905.03030.
|
| 491 |
+
341 Rescorla, R. A. (1972). A theory of Pavlovian conditioning: Variations in the effectiveness of reinforcement and nonreinforcement. Current research and theory, pages 64–99.
|
| 492 |
+
Robbins, H. and Monro, S. (1951). A stochastic approximation method. The annals of mathematical statistics, pages 400–407.
|
| 493 |
+
Russell, S., Dewey, D., and Tegmark, M. (2015). Research priorities for robust and beneficial artificial intelligence. Ai Magazine, 36(4):105–114.
|
| 494 |
+
Santoro, A., Bartunov, S., Botvinick, M., Wierstra, D., and Lillicrap, T. (2016). Meta-learning with memory-augmented neural networks. In International conference on machine learning, pages 1842–1850. PMLR.
|
| 495 |
+
Sutton, R. S. and Barto, A. G. (1990). Time-derivative models of Pavlovian reinforcement. In Learning and Computational Neuroscience: Foundations of Adaptive Networks, pages 497–537. MIT Press.
|
| 496 |
+
Sutton, R. S. and Barto, A. G. (2018). Reinforcement learning: An introduction. MIT Press.
|
| 497 |
+
Tamar, A., Mannor, S., and Xu, H. (2014). Scaling up robust MDPs using function approximation. In International Conference on Machine Learning, pages 181–189. PMLR.
|
| 498 |
+
Theodorou, E., Buchli, J., and Schaal, S. (2010). A generalized path integral control approach to reinforcement learning. The Journal of Machine Learning Research, 11:3137–3181.
|
| 499 |
+
Tishby, N. and Polani, D. (2011). Information theory of decisions and actions. In Perception-action cycle, pages 601–636. Springer.
|
| 500 |
+
Todorov, E. (2007). Linearly-solvable Markov decision problems. In Advances in neural information processing systems, pages 1369–1376.
|
| 501 |
+
Toussaint, M. (2009). Robot trajectory optimization using approximate inference. In Proceedings of the 26th annual international conference on machine learning, pages 1049–1056.
|
| 502 |
+
Wang, J. X., Kurth-Nelson, Z., Tirumala, D., Soyer, H., Leibo, J. Z., Munos, R., Blundell, C., Kumaran, D., and Botvinick, M. (2016). Learning to reinforcement learn. arXiv preprint arXiv:1611.05763.
|
| 503 |
+
Ziebart, B. D., Maas, A. L., Bagnell, J. A., and Dey, A. K. (2008). Maximum entropy inverse reinforcement learning. In AAAI.
|
| 504 |
+
|
| 505 |
+
1. For all authors...
|
| 506 |
+
|
| 507 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 508 |
+
(b) Did you describe the limitations of your work? [Yes] see Section 5
|
| 509 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] see Section 5
|
| 510 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 511 |
+
|
| 512 |
+
2. If you are including theoretical results...
|
| 513 |
+
|
| 514 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] in Section 2.
|
| 515 |
+
(b) Did you include complete proofs of all theoretical results? [Yes] in Section 2.
|
| 516 |
+
|
| 517 |
+
3. If you ran experiments...
|
| 518 |
+
|
| 519 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] The code is proprietary.
|
| 520 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] see Section 4.
|
| 521 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] see Section 4.
|
| 522 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] see Section 4.
|
| 523 |
+
|
| 524 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 525 |
+
|
| 526 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 527 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 528 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 529 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 530 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 531 |
+
|
| 532 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 533 |
+
|
| 534 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 535 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 536 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/S1g2JnRcFX/S1g2JnRcFX.md
ADDED
|
@@ -0,0 +1,553 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LOCAL SGD CONVERGES FAST AND COMMUNICATES LITTLE
|
| 2 |
+
|
| 3 |
+
Sebastian U. Stich
|
| 4 |
+
EPFL, Switzerland
|
| 5 |
+
sebastian.stich@epfl.ch
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Mini-batch stochastic gradient descent (SGD) is state of the art in large scale distributed training. The scheme can reach a linear speedup with respect to the number of workers, but this is rarely seen in practice as the scheme often suffers from large network delays and bandwidth limits. To overcome this communication bottleneck recent works propose to reduce the communication frequency. An algorithm of this type is local SGD that runs SGD independently in parallel on different workers and averages the sequences only once in a while. This scheme shows promising results in practice, but eluded thorough theoretical analysis.
|
| 10 |
+
|
| 11 |
+
We prove concise convergence rates for local SGD on convex problems and show that it converges at the same rate as mini-batch SGD in terms of number of evaluated gradients, that is, the scheme achieves linear speedup in the number of workers and mini-batch size. The number of communication rounds can be reduced up to a factor of $T ^ { 1 / 2 }$ —where $T$ denotes the number of total steps—compared to mini-batch SGD. This also holds for asynchronous implementations.
|
| 12 |
+
|
| 13 |
+
Local SGD can also be used for large scale training of deep learning models. The results shown here aim serving as a guideline to further explore the theoretical and practical aspects of local SGD in these applications.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Stochastic Gradient Descent (SGD) (Robbins & Monro, 1951) consists of iterations of the form
|
| 18 |
+
|
| 19 |
+
$$
|
| 20 |
+
\mathbf { x } _ { t + 1 } : = \mathbf { x } _ { t } - \eta _ { t } \mathbf { g } _ { t } ,
|
| 21 |
+
$$
|
| 22 |
+
|
| 23 |
+
for iterates (weights) $\mathbf { x } _ { t } , \mathbf { x } _ { t + 1 } \in \mathbb { R } ^ { d }$ , stepsize (learning rate) $\eta _ { t } > 0$ , and stochastic gradient $\mathbf { g } _ { t } \in \mathbb { R } ^ { d }$ with the property $\mathbb { E } { \bf g } _ { t } = \nabla f ( { \bf x } _ { t } )$ , for a loss function $f \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ . This scheme can easily be parallelized by replacing $\mathbf { g } _ { t }$ in (1) by an average of stochastic gradients that are independently computed in parallel on separate workers (parallel $S G D _ { \ell }$ ). This simple scheme has a major drawback: in each iteration the results of the computations on the workers have to be shared with the other workers to compute the next iterate $\mathbf { x } _ { t + 1 }$ . Communication has been reported to be a major bottleneck for many large scale deep learning applications, see e.g. (Seide et al., 2014; Alistarh et al., 2017; Zhang et al., 2017; Lin et al., 2018b). Mini-batch parallel SGD addresses this issue by increasing the compute to communication ratio. Each worker computes a mini-batch of size $b \geq 1$ before communication. This scheme is implemented in state-of-the-art distributed deep learning frameworks (Abadi et al., 2016; Paszke et al., 2017; Seide & Agarwal, 2016). Recent work in (You et al., 2017; Goyal et al., 2017) explores various limitations of this approach, as in general it is reported that performance degrades for too large mini-batch sizes (Keskar et al., 2016; Ma et al., 2018; Yin et al., 2018).
|
| 24 |
+
|
| 25 |
+
In this work we follow an orthogonal approach, still with the goal to increase the compute to communication ratio: Instead of increasing the mini-batch size, we reduce the communication frequency. Rather than keeping the sequences on different machines in sync, we allow them to evolve locally on each machine, independent from each other, and only average the sequences once in a while (local SGD). Such strategies have been explored widely in the literature, under various names.
|
| 26 |
+
|
| 27 |
+
An extreme instance of this concept is one-shot SGD (McDonald et al., 2009; Zinkevich et al., 2010) where the local sequences are only exchanged once, after the local runs have converged. Zhang et al. (2013) show statistical convergence (see also (Shamir & Srebro, 2014; Godichon-Baggioni & Saadane, 2017; Jain et al., 2018)), but the analysis restricts the algorithm to at most one pass over the data, which is in general not enough for the training error to converge. More practical are schemes that perform more frequent averaging of the parallel sequences, as e.g. (McDonald et al., 2010) for perceptron training (iterative parameter mixing), see also (Coppola, 2015), (Zhang et al., 2014; Bijral et al., 2016; Zhang et al., 2016) for the training of deep neural networks (model averaging) or in federated learning (McMahan et al., 2017).
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1: Illustration of the speedup (3) for time-to-accuracy when either increasing mini-batch size $b$ ( $\hphantom { 0 } \mathrm { ~ 1 ~ 2 ~ }$ ) or communication inverval $H$ ( $1 2$ ), for compute to communication ratio $\rho = 2 5$ .
|
| 31 |
+
|
| 32 |
+
The question of how often communication rounds need to be initiated has eluded a concise theoretical answer so far. Whilst there is practical evidence, the theory does not even resolve the question whether averaging helps when optimizing convex functions. Concretely, whether running local SGD on $K$ workers is $K$ times faster than running just a single instance of SGD on one worker.1
|
| 33 |
+
|
| 34 |
+
We fill this gap in the literature and provide a concise convergence analysis of local SGD. We show that averaging helps. Frequent synchronization of $K$ local sequences increases the convergence rate by a factor of $K$ , i.e. a linear speedup can be attained. Thus, local SGD is as efficient as parallel mini-batch SGD in terms of computation, but the communication cost can be drastically reduced.
|
| 35 |
+
|
| 36 |
+
# 1.1 CONTRIBUTIONS
|
| 37 |
+
|
| 38 |
+
We consider finite-sum convex optimization problems $f \colon { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ of the form
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
f ( \mathbf { x } ) = { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } f _ { i } ( \mathbf { x } ) , \qquad \mathbf { x } ^ { * } : = \arg \operatorname* { m i n } _ { \mathbf { x } \in \mathbb { R } ^ { d } } f ( \mathbf { x } ) , \qquad f ^ { \star } : = f ( \mathbf { x } ^ { \star } ) ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $f$ is $L$ -smooth2 and $\mu$ -strongly convex3. We consider $K$ parallel mini-batch SGD sequences with mini-batch size $b$ that are synchronized (by averaging) after at most every $H$ iterations. For appropriate chosen stepsizes and an averaged iterate $\hat { \mathbf { x } } _ { T }$ after $T$ steps (for $T$ sufficiently large, see Section 3 below for the precise statement of the convergence result with bias and variance terms) and synchronization delay $H = O ( \sqrt { T / ( K b ) } )$ we show convergence
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\mathbb { E } f ( \hat { \mathbf { x } } _ { T } ) - f ^ { \star } = O \left( \frac { G ^ { 2 } } { \mu b K T } \right) ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
with second moment bound $G ^ { 2 } \geq \mathbb { E } \left\| \nabla f _ { i } ( \mathbf { x } ) \right\| ^ { 2 }$ . Thus, we see that compared to parallel minibatch SGD the communication rounds can be reduced by a factor $H = O ( \sqrt { T / ( K b ) } )$ without hampering the asymptotic convergence. Equation (3) shows perfect linear speedup in terms of computation, but with much less communication that mini-batch SGD. The resulting speedup when taking communication cost into account is illustrated in Figure 1 (see also Section D below). Under the assumption that (3) is tight, one has thus now two strategies to improve the compute to communication ratio (denoted by $\rho \mathrm { \Sigma }$ ): (i) either to increase the mini-batch size $b$ or (ii) to increase the communication interval $H$ . Both strategies give the same improvement when $b$ and $H$ are small (linear speedup). Like mini-batch SGD that faces some limitations for $b \gg 1$ (as discussed in e.g. (Dekel et al., 2012; Ma et al., 2018; Yin et al., 2018)), the parameter $H$ cannot be chosen too large in local SGD. We give some pratical guidelines in Section 4.
|
| 51 |
+
|
| 52 |
+
Our proof is simple and straightforward, and we imagine that—with slight modifications of the proof—the technique can also be used to analyze other variants of SGD that evolve sequences on different worker that are not perfectly synchronized. Although we do not yet provide convergence guarantees for the non-convex setting, we feel that the positive results presented here will spark further investigation of local SGD for this important application (see e.g. (Yu et al., 2018)).
|
| 53 |
+
|
| 54 |
+
# 1.2 RELATED WORK
|
| 55 |
+
|
| 56 |
+
A parallel line of work reduces the communication cost by compressing the stochastic gradients before communication. For instance, by limiting the number of bits in the floating point representation (Gupta et al., 2015; Na et al., 2017; Sa et al., 2015), or random quantization (Alistarh et al., 2017; Wen et al., 2017). The ZipML framework applies this technique also to the data (Zhang et al., 2017). Sparsification methods reduce the number of non-zero entries in the stochastic gradient (Alistarh et al., 2017; Wangni et al., 2017). A very aggressive—and promising—sparsification method is to keep only very few coordinates of the stochastic gradient by considering only the coordinates with the largest magnitudes (Seide et al., 2014; Strom, 2015; Dryden et al., 2016; Aji & Heafield, 2017; Sun et al., 2017; Lin et al., 2018b; Stich et al., 2018).
|
| 57 |
+
|
| 58 |
+
Allowing asynchronous updates provides an alternative solution to disguise the communication overhead to a certain amount (Niu et al., 2011; Sa et al., 2015; Lian et al., 2015), though alternative strategies might be better when high accuracy is desired (Chen et al., 2016). The analysis of Agarwal & Duchi (2011) shows that asynchronous SGD on convex functions can tolerated delays up to $O ( { \sqrt { T / K } } )$ , which is identical to the maximal length of the local sequences in local SGD. Asynchronous SGD converges also for larger delays (see also (Zhou et al., 2018)) but without linear speedup, a similar statement holds for local SGD (see discussion in Section 3). The current frameworks for the analysis of asynchronous SGD do not cover local SGD. A fundamental difference is that asynchronous SGD maintains a (almost) synchronized sequence and gradients are computed with respect this unique sequence (but just applied with delays), whereas each worker in local SGD evolves a different sequence and computes gradient with respect those iterates.
|
| 59 |
+
|
| 60 |
+
For the training of deep neural networks, Bijral et al. (2016) discuss a stochastic averaging schedule whereas Zhang et al. (2016) study local SGD with more frequent communication at the beginning of the optimization process. The elastic averaging technique (Zhang et al., 2015) is different to local SGD, as it uses the average of the iterates only to guide the local sequences but does not perform a hard reset after averaging. Among the first theoretical studies of local SGD in the non-convex setting are (Coppola, 2015; Zhou & Cong, 2018) that did not establish a speedup, in contrast to two more recent analyses (Yu et al., 2018; Wang & Joshi, 2018). Yu et al. (2018) show linear speedup of local SGD on non-convex functions for $H \stackrel { \cdot } { = } O ( T ^ { 1 / 4 } K ^ { - 3 / 4 } )$ , which is more restrictive than the constraint on $H$ in the convex setting. Lin et al. (2018a) study empirically hierarchical variants of local SGD.
|
| 61 |
+
|
| 62 |
+
Local SGD with averaging in every step, i.e. $H = 1$ , is identical to mini-batch SGD. Dekel et al. (2012) show that batch sizes $b = T ^ { \bar { \delta } }$ , for $\delta \in ( 0 , \frac { 1 } { 2 } )$ are asymptotically optimal for mini-batch SGD, however they also note that this asymptotic bound might be crude for practical purposes. Similar considerations might also apply to the asymptotic upper bounds on the communication frequency $H$ derived here. Local SGD with averaging only at the end, i.e. $H = T$ , is identical to one-shot SGD. Jain et al. (2018) give concise speedup results in terms of bias and variance for one-shot SGD with constant stepsizes for the optimization of quadratic least squares problems. In contrast, our upper bounds become loose when $H T$ and our results do not cover one-shot SGD.
|
| 63 |
+
|
| 64 |
+
Recently, Woodworth et al. (2018) provided a lower bound for parallel stochastic optimization (in the convex setting, and not for strongly convex functions as considered here). The bound is not known to be tight for local SGD.
|
| 65 |
+
|
| 66 |
+
# 1.3 OUTLINE
|
| 67 |
+
|
| 68 |
+
We formally introduce local SGD in Section 2 and sketch the convergence proof in Section 3. In Section 4 show numerical results to illustrate the result. We analyze asynchronous local SGD in Section 5. The proof of the technical results, further discussion about the experimental setup and implementation guidelines are deferred to the appendix.
|
| 69 |
+
|
| 70 |
+
# Algorithm 1 LOCAL SGD
|
| 71 |
+
|
| 72 |
+
1: Initialize variables $\mathbf { x } _ { 0 } ^ { k } = \mathbf { x } _ { 0 }$ for workers $k \in [ K ]$
|
| 73 |
+
2: for $t$ in $0 \dots T - 1$ do
|
| 74 |
+
3: parallel for $k \in [ K ]$ do
|
| 75 |
+
4: Sample $i _ { t } ^ { k }$ uniformly in $[ n ]$
|
| 76 |
+
5: 6: if $t + 1 \in \mathcal { I } _ { T }$ $\begin{array} { r } { \mathbf { x } _ { t + 1 } ^ { k } \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \bigl ( \mathbf { x } _ { t } ^ { k } - \eta _ { t } \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } ) \bigr ) } \end{array}$
|
| 77 |
+
7: else
|
| 78 |
+
8: $\mathbf { x } _ { t + 1 } ^ { k } \mathbf { x } _ { t } ^ { k } - \eta _ { t } \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } )$
|
| 79 |
+
9: end if
|
| 80 |
+
10: end parallel for
|
| 81 |
+
11: end for
|
| 82 |
+
|
| 83 |
+
. local update
|
| 84 |
+
|
| 85 |
+
# 2 LOCAL SGD
|
| 86 |
+
|
| 87 |
+
The algorithm local SGD (depicted in Algorithm 1) generates in parallel $K$ sequences $\{ \mathbf { x } _ { t } ^ { k } \} _ { t = 0 } ^ { T }$ of iterates, $k \in [ K ]$ . Here $K$ denotes the level of parallelization, i.e. the number of distinct parallel sequences and $T$ the number of steps (i.e. the total number of stochastic gradient evaluations is $T K$ ). Let $\mathcal { T } _ { T } \subseteq [ T ]$ with $T \in { \mathcal { T } } _ { T }$ denote a set of synchronization indices. Then local SGD evolves the sequences $\bar { \{ \mathbf { x } _ { t } ^ { k } \} } _ { t = 0 } ^ { T }$ in the following way:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \mathbf { x } _ { t + 1 } ^ { k } : = \left\{ \begin{array} { l l } { \mathbf { x } _ { t } ^ { k } - \eta _ { t } \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } ) , } & { \mathrm { i f ~ } t + 1 \not \in \mathbb { Z } _ { T } } \\ { \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \bigl ( \mathbf { x } _ { t } ^ { k } - \eta _ { t } \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } ) \bigr ) } & { \mathrm { i f ~ } t + 1 \in \mathbb { Z } _ { T } } \end{array} \right. } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where indices $i _ { t } ^ { k } \sim _ { \mathrm { u . a . r } }$ . $[ n ]$ and $\{ \eta _ { t } \} _ { t \ge 0 }$ denotes a sequence of stepsizes. If $\mathcal { T } _ { T } = [ T ]$ then the synchronization of the sequences is performed every iteration. In this case, (4) amounts to parallel or mini-batch SGD with mini-batch size $K$ .4 On the other extreme, if ${ \mathcal { T } } _ { T } = \{ T \}$ , the synchronization only happens at the end, which is known as one-shot averaging.
|
| 94 |
+
|
| 95 |
+
In order to measure the longest interval between subsequent synchronization steps, we introduce the ${ g a p }$ of a set of integers.
|
| 96 |
+
|
| 97 |
+
Definition 2.1 (gap). The gap of a set $\mathcal { P } : = \{ p _ { 0 } , . . . , p _ { t } \}$ of $t + 1$ integers, $p _ { i } \ \leq \ p _ { i + 1 }$ for $i =$ $0 , \ldots , t - 1$ , is defined as $\begin{array} { r } { \operatorname { g a p } ( \mathcal { P } ) : = \operatorname* { m a x } _ { i = 1 , \dots , t } ( p _ { i } - p _ { i - 1 } ) } \end{array}$ .
|
| 98 |
+
|
| 99 |
+
# 2.1 VARIANCE REDUCTION IN LOCAL SGD
|
| 100 |
+
|
| 101 |
+
Before jumping to the convergence result, we first discuss an important observation.
|
| 102 |
+
|
| 103 |
+
Parallel (mini-batch) SGD. For carefully chosen stepsizes $\eta _ { t }$ , SGD converges at rate $\textstyle { \mathcal { O } } { \bigl ( } { \frac { \sigma ^ { 2 } } { T } } { \bigr ) } ^ { 5 }$ on strongly convex and smooth functions $f$ , where $\sigma ^ { 2 } \geq \mathbb { E } \| \nabla f _ { i _ { t } ^ { k } } ( { \mathbf x } _ { t } ^ { k } ) - \nabla f ( { \mathbf x } _ { t } ^ { k } ) \| ^ { 2 }$ for $t > 0 , k \in [ K ]$ is an upper bound on the variance, see for instance (Zhao & Zhang, 2015). By averaging $K$ stochastic gradients—such as in parallel SGD—the variance decreases by a factor of $K$ , and we conclude that parallel SGD converges at a rate $\textstyle { \mathcal { O } } { \bigl ( } { \frac { \sigma ^ { 2 } } { T K } } { \bigr ) }$ , i.e. achieves a linear speedup.
|
| 104 |
+
|
| 105 |
+
Towards local SGD. For local SGD such a simple argument is elusive. For instance, just capitalizing the convexity of the objective function $f$ is not enough: this will show that the averaged iterate of $K$ independent SGD sequences converges at rate $\textstyle { \mathcal { O } } { \bigl ( } { \frac { \sigma ^ { 2 } } { T } } { \bigr ) }$ , i.e. no speedup can be shown in this way.
|
| 106 |
+
|
| 107 |
+
This indicates that one has to show that local SGD decreases the variance $\sigma ^ { 2 }$ instead, similar as in parallel SGD. Suppose the different sequences $\mathbf { x } _ { t } ^ { k }$ evolve close to each other. Then it is reasonable to assume that averaging the stochastic gradients $\dot { \nabla } f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } )$ for all $k \in [ K ]$ can still yield a reduction in the variance by a factor of $K$ —similar as in parallel SGD. Indeed, we will make this statement precise in the proof below.
|
| 108 |
+
|
| 109 |
+
# 2.2 CONVERGENCE RESULT AND DISCUSSION
|
| 110 |
+
|
| 111 |
+
Theorem 2.2. Let $f$ be $L$ -smooth and $\mu$ -strongly convex, $\mathbb { E } _ { i } \left\| \nabla f _ { i } ( \mathbf { x } _ { t } ^ { k } ) - \nabla f ( \mathbf { x } _ { t } ^ { k } ) \right\| ^ { 2 } \ \leq \ \sigma ^ { 2 }$ , $\mathbb { E } _ { i } \left\| \nabla f _ { i } ( \mathbf { x } _ { t } ^ { k } ) \right\| ^ { 2 } \leq G ^ { 2 }$ , for $t = 0 , \dots , T - 1$ , where $\{ \mathbf { x } _ { t } ^ { k } \} _ { t = 0 } ^ { T }$ for $k \in [ K ]$ are generated according to (4) with $\mathrm { g a p } ( \mathcal { T } _ { T } ) \leq H$ and for stepsizes $\begin{array} { r } { \eta _ { t } = \frac { 4 } { \mu ( a + t ) } } \end{array}$ with shift parameter $a > \operatorname* { m a x } \{ 1 6 \kappa , H \} ,$ , for $\begin{array} { r } { \kappa = \frac { L } { \mu } } \end{array}$ . Then
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathbb { E } f ( \hat { { \bf x } } _ { T } ) - f ^ { \star } \le \frac { \mu a ^ { 3 } } { 2 S _ { T } } \left. { \bf x } _ { 0 } - { \bf x } ^ { \star } \right. ^ { 2 } + \frac { 4 T ( T + 2 a ) } { \mu K S _ { T } } \sigma ^ { 2 } + \frac { 2 5 6 T } { \mu ^ { 2 } S _ { T } } G ^ { 2 } H ^ { 2 } L ,
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $\begin{array} { r } { \hat { \mathbf { x } } _ { T } = \frac { 1 } { K S _ { T } } \sum _ { k = 1 } ^ { K } \sum _ { t = 0 } ^ { T - 1 } w _ { t } \mathbf { x } _ { t } ^ { k } , } \end{array}$ , for $w _ { t } = ( a + t ) ^ { 2 }$ and $\begin{array} { r } { S _ { T } = \sum _ { t = 0 } ^ { T - 1 } w _ { t } \geq \frac { 1 } { 3 } T ^ { 3 } } \end{array}$
|
| 118 |
+
|
| 119 |
+
We were not especially careful to optimize the constants (and the lower order terms) in (5), so we now state the asymptotic result.
|
| 120 |
+
|
| 121 |
+
Corollary 2.3. Let $\hat { \mathbf { x } } _ { T }$ be as defined as in Theorem 2.2, for parameter $a = \mathrm { m a x } \{ 1 6 \kappa , H \}$ . Then
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\mathbb { E } f \big ( \hat { \mathbf { x } } _ { T } \big ) - f ^ { \star } = O \left( \frac { 1 } { \mu K T } + \frac { \kappa + H } { \mu K T ^ { 2 } } \right) \sigma ^ { 2 } + O \left( \frac { \kappa H ^ { 2 } } { \mu T ^ { 2 } } + \frac { \kappa ^ { 3 } + H ^ { 3 } } { \mu T ^ { 3 } } \right) G ^ { 2 } .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
For the last estimate we used $\mathbb { E } \mu \left\| \mathbf { x } _ { 0 } - \mathbf { x } ^ { \star } \right\| \leq 2 G$ for $\mu$ -strongly convex $f$ , as derived in (Rakhlin et al., 2012, Lemma 2).
|
| 128 |
+
|
| 129 |
+
Remark 2.4 (Mini-batch local SGD). So far, we assumed that each worker only computes a single stochastic gradient. In mini-batch local SGD, each worker computes a mini-batch of size b in each iteration. This reduces the variance by a factor of $b _ { : }$ , and thus Theorem (2.2) gives the convergence rate of mini-batch local SGD when $\sigma ^ { 2 }$ is replaced by $\frac { \sigma ^ { 2 } } { b }$ .
|
| 130 |
+
|
| 131 |
+
We now state some consequences of equation (6). For the ease of the exposition we omit the dependency on $L , \mu , \sigma ^ { 2 }$ and $G ^ { 2 }$ below, but depict the dependency on the local mini-batch size $b$ .
|
| 132 |
+
|
| 133 |
+
Convergence rate. For $T$ large enough and assuming $\sigma > 0$ , the very first term is dominating in (6) and local SGD converges at rate $O ( 1 / ( K T b ) )$ . That is, local SGD achieves a linear speedup in both, the number of workers $K$ and the mini-batch size $b$ .
|
| 134 |
+
|
| 135 |
+
Global synchronization steps. It needs to hold $H = O ( \sqrt { T / ( K b ) } )$ to get the linear speedup. This yields a reduction of the number of communication rounds by a factor $O ( { \sqrt { T / ( K b ) } } )$ compared to parallel mini-batch SGD without hurting the convergence rate.
|
| 136 |
+
|
| 137 |
+
Extreme Cases. We have not optimized the result for extreme settings of $H , K , L$ or $\sigma$ . For instance, we do not recover convergence for the one-shot averaging, i.e. the setting $H = T$ (though convergence for $H = o ( T )$ , but at a lower rate).
|
| 138 |
+
|
| 139 |
+
Unknown Time Horizon/Adaptive Communication Frequency Zhang et al. (2016) empirically observe that more frequent communication at the beginning of the optimization can help to get faster time-to-accuracy (see also Lin et al. (2018a)). Indeed, when the number of total iterations $T$ is not known beforehand (as it e.g. depends on the target accuracy, cf. (6) and also Section 4 below), then increasing the communication frequency seems to be a good strategy to keep the communication low, why still respecting the constraint $H = O ( \sqrt { T / ( K b ) } )$ for all $T$ .
|
| 140 |
+
|
| 141 |
+
# 3 PROOF OUTLINE
|
| 142 |
+
|
| 143 |
+
We now give the outline of the proof. The proofs of the lemmas are given in Appendix A.
|
| 144 |
+
|
| 145 |
+
Perturbed iterate analysis. Inspired by the perturbed iterate framework of (Mania et al., 2017) we first define a virtual sequence $\{ \bar { \bf x } _ { t } \} _ { t \ge 0 }$ in the following way:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\bar { \mathbf { x } } _ { 0 } = \mathbf { x } _ { 0 } , \qquad \bar { \mathbf { x } } _ { t } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbf { x } _ { t } ^ { k } ,
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where the sequences $\{ \mathbf { x } _ { t } ^ { k } \} _ { t \geq 0 }$ for $k \in [ K ]$ are the same as in (4). Notice that this sequence never has to be computed explicitly, it is just a tool that we use in the analysis. Further notice that $\bar { \mathbf { x } } _ { t } = \mathbf { x } _ { t } ^ { k }$ for
|
| 152 |
+
|
| 153 |
+
$k \in [ K ]$ whenever $t \in \mathcal { I } _ { T }$ . Especially, when $\mathcal { T } _ { T } = [ T ]$ , then $\bar { \mathbf { x } } _ { t } \equiv \mathbf { x } _ { t } ^ { k }$ for every $k \in [ K ] , t \in [ T ]$ . It will be useful to define
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
\mathbf { g } _ { t } : = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \nabla f _ { i _ { t } ^ { k } } \big ( \mathbf { x } _ { t } ^ { k } \big ) , \qquad \bar { \mathbf { g } } _ { t } : = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \nabla f \big ( \mathbf { x } _ { t } ^ { k } \big ) .
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
Observe $\bar { \mathbf { x } } _ { t + 1 } = \bar { \mathbf { x } } _ { t } - \eta _ { t } \mathbf { g } _ { t }$ and $\mathbb { E } { \bf g } _ { t } = \bar { \bf g } _ { t }$ .
|
| 160 |
+
|
| 161 |
+
Now the proof proceeds as follows: we show (i) that the virtual sequence $\{ \bar { \bf x } _ { t } \} _ { t \ge 0 }$ almost behaves like mini-batch SGD with batch size $K$ (Lemma 3.1 and 3.2), and (ii) the true iterates $\{ \mathbf { x } _ { t } ^ { k } \} _ { t \ge 0 , k \in [ K ] }$ do not deviate much from the virtual sequence (Lemma 3.3). These are the main ingredients in the proof. To obtain the rate we exploit a technical lemma from (Stich et al., 2018).
|
| 162 |
+
|
| 163 |
+
Lemma 3.1. Let $\{ { \bf x } _ { t } \} _ { t \ge 0 }$ and $\{ \bar { \bf x } _ { t } \} _ { t \ge 0 }$ for $k \in [ K ]$ be defined as in (4) and (7) and let $f$ be $L$ -smooth and $\mu$ -strongly convex and $\begin{array} { r } { \eta _ { t } \leq \frac { 1 } { 4 L } } \end{array}$ . Then
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\begin{array} { r l r } { { \mathbb { E } \| \bar { \mathbf { x } } _ { t + 1 } - \mathbf { x } ^ { \star } \| ^ { 2 } \leq ( 1 - \mu \eta _ { t } ) \mathbb { E } \| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } \| ^ { 2 } + \eta _ { t } ^ { 2 } \mathbb { E } \| \mathbf { g } _ { t } - \bar { \mathbf { g } } _ { t } \| ^ { 2 } } } \\ & { } & { \quad - \displaystyle \frac { 1 } { 2 } \eta _ { t } \mathbb { E } ( f ( \bar { \mathbf { x } } _ { t } ) - f ^ { \star } ) + 2 \eta _ { t } \frac { L } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \| ^ { 2 } . } \end{array}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
Bounding the variance. From equation (9) it becomes clear that we should derive an upper bound on $\mathbb { E } \left\| \mathbf { g } _ { t } - \bar { \mathbf { g } } _ { t } \right\| ^ { 2 }$ . We will relate this to the variance $\sigma ^ { 2 }$ .
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\begin{array} { r } { t \sigma ^ { 2 } \geq \mathbb { E } _ { i } \| \nabla f _ { i } ( \mathbf { x } _ { t } ^ { k } ) - \nabla f ( \mathbf { x } _ { t } ^ { k } ) \| ^ { 2 } f o r k \in [ K ] , t \in [ T ] . T h e n \mathbb { E } \left\| \mathbf { g } _ { t } - \bar { \mathbf { g } } _ { t } \right\| ^ { 2 } \leq \frac { \sigma ^ { 2 } } { K } . } \end{array}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
Bounding the viation. Further, we need to bound $\begin{array} { r } { \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \right\| ^ { 2 } } \end{array}$ . For this we impose $\mathcal { I } _ { T }$ and an additional condition on the stepsize $\eta _ { t }$ .
|
| 176 |
+
|
| 177 |
+
Lemma 3.3. If $\mathrm { g a p } ( { \mathcal { I } } _ { T } ) \leq H$ and sequence of decreasing positive stepsizes $\{ \eta _ { t } \} _ { t \ge 0 }$ satisfying $\eta _ { t } \leq 2 \eta _ { t + H }$ for all $t \geq 0$ , then
|
| 178 |
+
|
| 179 |
+
$$
|
| 180 |
+
\frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \right\| ^ { 2 } \leq 4 \eta _ { t } ^ { 2 } G ^ { 2 } H ^ { 2 } ,
|
| 181 |
+
$$
|
| 182 |
+
|
| 183 |
+
where $G ^ { 2 }$ is a constant such that $\mathbb { E } _ { i } \| \nabla f _ { i } ( \mathbf { x } _ { t } ^ { k } ) \| ^ { 2 } \leq G ^ { 2 }$ for $k \in [ K ] , t \in [ T ]$ .
|
| 184 |
+
|
| 185 |
+
Optimal Averaging. Similar as in (Lacoste-Julien et al., 2012; Shamir & Zhang, 2013; Rakhlin et al., 2012) we define a suitable averaging scheme for the iterates $\{ \bar { \bf x } _ { t } \} _ { t \ge 0 }$ to get the optimal convergence rate. In contrast to (Lacoste-Julien et al., 2012) that use linearly increasing weights, we use quadratically increasing weights, as for instance (Shamir & Zhang, 2013; Stich et al., 2018).
|
| 186 |
+
|
| 187 |
+
Lemma 3.4 ((Stich et al., 2018)). Let $\{ a _ { t } \} _ { t \ge 0 } , a _ { t } \ge 0 , \{ e _ { t } \} _ { t \ge 0 } , e _ { t } \ge 0$ be sequences satisfying
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
a _ { t + 1 } \leq \left( 1 - \mu \eta _ { t } \right) a _ { t } - \eta _ { t } e _ { t } A + \eta _ { t } ^ { 2 } B + \eta _ { t } ^ { 3 } C ,
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
for $\begin{array} { r } { \eta _ { t } = \frac { 4 } { \mu ( a + t ) } } \end{array}$ and constants $A > 0 , B , C \ge 0 , \mu > 0 , a > 1$ . Then
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\frac { A } { S _ { T } } \sum _ { t = 0 } ^ { T - 1 } w _ { t } e _ { t } \le \frac { \mu a ^ { 3 } } { 4 S _ { T } } a _ { 0 } + \frac { 2 T ( T + 2 a ) } { \mu S _ { T } } B + \frac { 1 6 T } { \mu ^ { 2 } S _ { T } } C ,
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
$w _ { t } = ( a + t ) ^ { 2 }$ an $\begin{array} { r } { S _ { T } : = \sum _ { t = 0 } ^ { T - 1 } w _ { t } = \frac { T } { 6 } \left( 2 T ^ { 2 } + 6 a T - 3 T + 6 a ^ { 2 } - 6 a + 1 \right) \ge \frac { 1 } { 3 } T ^ { 3 } . } \end{array}$
|
| 200 |
+
|
| 201 |
+
Proof. This is a reformulation of Lemma 3.3 in (Stich et al., 2018).
|
| 202 |
+
|
| 203 |
+
Proof of Theorem 2.2. By convexity of $f$ we have $\begin{array} { r } { \mathbb { E } f ( \hat { \mathbf { x } } _ { T } ) - f ^ { \star } \le \frac { 1 } { S _ { T } } \sum _ { t = 0 } ^ { T - 1 } w _ { t } \mathbb { E } \big ( f ( \bar { \mathbf { x } } _ { t } ) - f ^ { \star } \big ) } \end{array}$ . The proof of the theorem thus follows immediately from the four lemmas that we have presented, i.e. by Lemma 3.4 with $e _ { t } : = \mathbb { E } ( f ( { \bar { \mathbf { x } } } _ { t } ) - f ^ { \star } )$ and constants $\begin{array} { r } { A = { \frac { 1 } { 2 } } } \end{array}$ , (Lemma 3.1), $\textstyle B = { \frac { \sigma ^ { 2 } } { K } }$ , (Lemma 3.2) and ${ \cal C } = 8 G ^ { 2 } H ^ { 2 } L$ , (Lemma 3.3). Observe that the stepsizes $\begin{array} { r } { \bar { \eta } _ { t } = \frac { 4 } { \mu ( a + t ) } } \end{array}$ satisfy both the conditions of Lemma 3.1 $\begin{array} { r } { ( \eta _ { 0 } = \frac { 4 } { \mu a } \le \frac { 1 } { 4 L } } \end{array}$ , as $a \geq 1 6 \kappa$ ) and of Lemma 3.3 $\begin{array} { r } { \frac { \eta _ { t } } { \eta _ { t + H } } = \frac { a + t + H } { a + t } \leq 2 } \end{array}$ , as $a \geq H$ .
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 2: Theoretical speedup of local SGD for different numbers of workers $K$ and $H$ .
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 3: Measured speedup of local SGD with mini-batch $b = 4$ for different numbers of workers $K$ and parameters $H$ .
|
| 210 |
+
|
| 211 |
+
# 4 NUMERICAL ILLUSTRATION
|
| 212 |
+
|
| 213 |
+
In this section we show some numerical experiments to illustrate the results of Theorem 2.2.
|
| 214 |
+
|
| 215 |
+
Speedup. When Algorithm 1 is implemented in a distributed setting, there are two components that determine the wall-clock time: (i) the total number of gradient computations, $T K$ , and (ii) the total time spend for communication. In each communication round $2 ( K - 1 )$ vectors need to be exchanged, and there will be $T / H$ communication rounds. Typically, the communication is more expensive than a single gradient computation. We will denote this ratio by a factor $\rho \geq 1$ (in practice, $\rho$ can be 10–100, or even larger on slow networks). The parameter $T$ depends on the desired accuracy > 0, and according to (6) we roughly have T (, H, K) ≈ 1K $\begin{array} { r } { T ( \epsilon , H , K ) \approx \frac { 1 } { K \epsilon } \left( \frac { 1 } { 2 } + \frac { 1 } { 2 } \sqrt { 1 + \epsilon ( 1 + H + H ^ { 2 } K ) } \right) } \end{array}$ . Thus, the theoretical speedup $S ( K )$ of local SGD on $K$ machines compared to SGD on one machine $H = 1$ , $K = 1$ ) is
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
S ( K ) = \frac { K } { \left( \frac { 1 } { 2 } + \frac { 1 } { 2 } \sqrt { 1 + \epsilon ( 1 + H + H ^ { 2 } K ) } \right) \left( 1 + 2 \rho \frac { ( K - 1 ) } { H } \right) } .
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
Theoretical. Examining (13), we see that (i) increasing $H$ can reduce negative scaling effects due to parallelization (second bracket in the denominator of (13)), and (ii) local SGD only shows linear scaling for $\epsilon \ll 1$ (i.e. $T$ large enough, in agreement with the theory). In Figure 2 we depict $S ( K )$ , once for $\epsilon = 0$ in Figure 2b, and for positive $\epsilon > 0$ in Figure 2a under the assumption $\rho = 2 5$ . We see that for $\epsilon = 0$ the largest values of $H$ give the best speedup, however, when only a few epochs need to be performed, then the optimal values of $H$ change with the number of workers $K$ . We also see that for a small number of workers $H = 1$ is never optimal. If $T$ is unknown, then these observations seem to indicate that the technique from (Zhang et al., 2016), i.e. adaptively increasing $H$ over time seems to be a good strategy to get the best choice of $H$ when the time horizon is unknown.
|
| 222 |
+
|
| 223 |
+
Experimental. We examine the practical speedup on a logistic regression problem, $f ( \mathbf { x } ) \ =$ $\begin{array} { r } { \frac { 1 } { n _ { . } } \sum _ { i = 1 } ^ { n } \log ( 1 + \exp ( - b _ { i } \mathbf { a } _ { i } ^ { \top } \mathbf { x } ) ) + \frac { \lambda } { 2 } \| \mathbf { x } \| ^ { 2 } } \end{array}$ , where $\mathbf { a } _ { i } \in \mathbb { R } ^ { d }$ and $b _ { i } \in \{ - 1 , + 1 \}$ are the data samples. The regularization parameter is set to $\lambda = 1 / n$ . We consider the $\mathtt { w } 8 \mathtt { a }$ dataset (Platt, 1999) $( d = 3 0 0 , n = 4 9 7 4 9 )$ . We initialize all runs with $\mathbf { x } _ { 0 } = \mathbf { 0 } _ { d }$ and measure the number of iterations to reach the target accuracy $\epsilon$ . We consider the target accuracy reached, when either the last iterate, the uniform average, the average with linear weights, or the average with quadratic weights (such as in Theorem 2.2) reaches the target accuracy. By extensive grid search we determine for each configuration $( H , K , B )$ the best stepsize from the set $\{ \operatorname* { m i n } ( 3 \bar { 2 } , \frac { c n } { t + 1 } ) , 3 2 c \}$ , where $c$ can take the values $c = 2 ^ { i }$ for $i \in \mathbb { Z }$ . For more details on the experimental setup refer Section $\mathbf { D }$ in the appendix. We depict the results in Figure 3, again under the assumption $\rho = 2 5$ .
|
| 224 |
+
|
| 225 |
+
1: Initialize variables $\mathbf { x } _ { 0 } ^ { k } = \mathbf { x } _ { 0 }$ , $r ^ { k } = 0$ for $k \in [ K ]$ , aggregate $\bar { \bar { \mathbf { x } } } = \mathbf { x } _ { 0 }$ .
|
| 226 |
+
2: parallel for $k \in [ K ]$ do
|
| 227 |
+
3: for $t$ in $0 \dots T - 1$ do
|
| 228 |
+
4: Sample $i _ { t } ^ { k }$ uniformly in $[ n ]$
|
| 229 |
+
5: ${ \bf x } _ { t + 1 } ^ { k } \dot { } - \dot { } { \bf x } _ { t } ^ { k } - \eta _ { t } \nabla \dot { f } _ { i _ { t } ^ { k } } ( \dot { } { \bf x } _ { t } ^ { k } )$ . local update
|
| 230 |
+
6: if $t + 1 \in \mathcal { I } _ { T } ^ { k }$ then
|
| 231 |
+
7: $\bar { \bar { \mathbf { x } } } \mathrm { a d } \bar { \mathrm { d } } ( \bar { \bar { \mathbf { x } } } , \frac { 1 } { K } ( \mathbf { x } _ { t + 1 } ^ { k } - \mathbf { x } _ { r ^ { k } } ^ { k } ) )$ . atomic aggregation of the updates
|
| 232 |
+
8: $\mathbf { x } _ { t + 1 } ^ { k } \mathrm { r e a d } ( \bar { \bar { \mathbf { x } } } )$ ;
|
| 233 |
+
9: r k ← t + 1 . iteration/time of last read
|
| 234 |
+
10: end if
|
| 235 |
+
11: end for
|
| 236 |
+
12: end parallel for
|
| 237 |
+
|
| 238 |
+
Conclusion. The restriction on $H$ imposed by theory is not severe for $T \to \infty$ . Thus, for training that either requires many passes over the data or that is performed only on a small cluster, large values√ of $H$ are advisable. However, for smaller $T$ (few passes over the data), the $O ( 1 / { \sqrt { K } } )$ dependency shows significantly in the experiment. This has to be taken into account when deploying the algorithm on a massively parallel system, for instance through the technique mentioned in (Zhang et al., 2016).
|
| 239 |
+
|
| 240 |
+
# 5 ASYNCHRONOUS LOCAL SGD
|
| 241 |
+
|
| 242 |
+
In this section we present asynchronous local SGD that does not require that the local sequences are synchronized. This does not only reduce communication bottlenecks, but by using load-balancing techniques the algorithm can optimally be tuned to heterogeneous settings (slower workers do less computation between synchronization, and faster workers do more). We will discuss this in more detail in Section C.
|
| 243 |
+
|
| 244 |
+
Asynchronous local SGD generates in parallel $K$ sequences $\{ \mathbf { x } _ { t } ^ { k } \} _ { t = 0 } ^ { T }$ of iterates, $k \in [ K ]$ . Similar as in Section 2 we introduce sets of synchronization indices, $\mathcal { T } _ { t } ^ { k } \subseteq [ T ]$ with $T \in \mathcal { I } _ { T } ^ { k }$ for $k \in [ K ]$ . Note that the sets do not have to be equal for different workers. Each worker $k$ evolves locally a sequence $\mathbf { x } _ { t } ^ { k }$ in the following way:
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\begin{array} { r } { \mathbf { x } _ { t + 1 } ^ { k } = \left\{ \mathbf { x } _ { t } ^ { k } - \gamma _ { t } \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } ) \quad \mathrm { i f ~ } t + 1 \not \in \mathcal { I } _ { T } ^ { k } \right. } \\ { \bar { \mathbf { x } } _ { t + 1 } ^ { k } \qquad \quad \mathrm { i f ~ } t + 1 \in \mathcal { I } _ { T } ^ { k } } \end{array}
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
where $\hat { \hat { \mathbf { x } } } _ { t + 1 } ^ { k }$ denotes the state of the aggregated variable at the time when worker $k$ reads the aggregated variable. To be precise, we use the notation
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\bar { \bar { \mathbf { x } } } _ { t } ^ { k } = \mathbf { x } _ { 0 } - \frac { 1 } { K } \sum _ { h = 1 } ^ { K } \sum _ { j = 0 } ^ { t - 1 } \mathbb { 1 } _ { j \in \mathcal { W } _ { t } ^ { k , h } } \bigl ( \gamma _ { j } \nabla f _ { i _ { j } ^ { k } } ( \mathbf { x } _ { j } ^ { k } ) \bigr ) ,
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
where $\mathcal { W } _ { t } ^ { k , h } \subseteq [ T ]$ denotes all updates that have been written at the time the read takes place. The sets $\mathcal { W } _ { t } ^ { k , h }$ are indexed by iteration $t$ , worker $k$ that initiates the read and $h \in [ K ]$ . Thus $\mathcal { W } _ { t } ^ { k , h }$ denotes all updates of the local sequence $\{ \mathbf { x } _ { t } ^ { h } \} _ { t \geq 0 }$ , that have been reported back to the server at the time worker $k$ reads (in iteration $t$ ). This notation is necessary, as we don’t necessarily have $\mathcal { W } _ { t } ^ { k , h } = \mathcal { W } _ { t } ^ { k ^ { \prime } , h }$ for $k \neq k ^ { \prime }$ . We have $\mathcal { W } _ { t } ^ { k , h } \subseteq \mathcal { W } _ { t ^ { \prime } } ^ { k , h }$ for $t ^ { \prime } \geq t$ , as updates are not overwritten. When we cast synchronized local SGD in this notation, then it holds $\mathcal { W } _ { t } ^ { k , h } = \mathcal { W } _ { t } ^ { k ^ { \prime } , h ^ { \prime } }$ for all $k , h , k ^ { \prime } , h ^ { \prime }$ , as all the writes and reads are synchronized.
|
| 257 |
+
|
| 258 |
+
Theorem 5.1. Let $f$ , $\sigma$ , $G$ and $\kappa$ be as in Theorem 5.1 and sequences $\{ \mathbf { x } _ { t } ^ { k } \} _ { t = 0 } ^ { T } f o r k \in [ K ]$ generated according to (14) with $\mathrm { g a p } ( \mathcal { T } _ { T } ^ { k } ) \leq H$ for $k \in K$ and for stepsizes $\begin{array} { r } { \eta _ { t } = \frac { 4 } { \mu ( a + t ) } } \end{array}$ with shift parameter $a > \operatorname* { m a x } \{ 1 6 \kappa , H + \tau \}$ for delay $\tau > 0$ . If $\mathcal { W } _ { t } ^ { k , h } \supseteq [ t - \tau ]$ for all $k , h \in [ K ] _ { : }$ , $t \in [ T ]$ , then
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\mathbb { E } f ( \hat { { \bf x } } _ { T } ) - f ^ { \star } \le \frac { \mu a ^ { 3 } } { 2 S _ { T } } \left. { \bf x } _ { 0 } - { \bf x } ^ { \star } \right. ^ { 2 } + \frac { 4 T ( T + 2 a ) } { \mu K S _ { T } } \sigma ^ { 2 } + \frac { 7 6 8 T } { \mu ^ { 2 } S _ { T } } G ^ { 2 } ( H + \sigma ) ^ { 2 } L ,
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
where $\begin{array} { r } { \hat { \mathbf { x } } _ { T } = \frac { 1 } { K S _ { T } } \sum _ { k = 1 } ^ { K } \sum _ { t = 0 } ^ { T - 1 } w _ { t } \mathbf { x } _ { t } ^ { k } , } \end{array}$ , for $w _ { t } = ( a + t ) ^ { 2 }$ and $\begin{array} { r } { S _ { T } = \sum _ { t = 0 } ^ { T - 1 } w _ { t } \geq \frac { 1 } { 3 } T ^ { 3 } } \end{array}$
|
| 265 |
+
|
| 266 |
+
Hence, for $T$ large enough and $( H + \tau ) = O ( \sqrt { T / K } )$ , asynchronous local SGD converges with rate $\begin{array} { r } { O \big ( \frac { G ^ { 2 } } { K T } \big ) } \end{array}$ , the same rate as synchronous local SGD.
|
| 267 |
+
|
| 268 |
+
# 6 CONCLUSION
|
| 269 |
+
|
| 270 |
+
We prove convergence of synchronous and asynchronous local SGD and are the first to show that local SGD (for nontrivial values of $H$ ) attains theoretically linear speedup on strongly convex functions when parallelized among $K$ workers. We show that local SGD saves up to a factor of $O ( T ^ { 1 / 2 } )$ in global communication rounds compared to mini-batch SGD, while still converging at the same rate in terms of total stochastic gradient computations.
|
| 271 |
+
|
| 272 |
+
Deriving more concise convergence rates for local SGD could be an interesting future direction that could deepen our understanding of the scheme. For instance one could aim for a more fine grained analysis in terms of bias and variance terms (similar as e.g. in Dekel et al. (2012); Jain et al. (2018)), relaxing the assumptions (here we relied on the bounded gradient assumption), or investigating the data dependence (e.g. by considering data-depentent measures like e.g. gradient diversity Yin et al. (2018)). There are also no apparent reasons that would limit the extension of the theory to non-convex objective functions; Lemma 3.3 does neither use the smoothness nor the strong convexity assumption, so this can be applied in the non-convex setting as well. We feel that the positive results shown here can motivate and spark further research on non-convex problems. Indeed, very recent work (Zhou & Cong, 2018; Yu et al., 2018) analyzes local SGD for non-convex optimization problems and shows convergence of SGD to a stationary point, though the restrictions on $H$ are stronger than here.
|
| 273 |
+
|
| 274 |
+
# ACKNOWLEDGMENTS
|
| 275 |
+
|
| 276 |
+
The author thanks Jean-Baptiste Cordonnier, Tao Lin and Kumar Kshitij Patel for spotting various typos in the first versions of this manuscript, as well as Martin Jaggi for his support.
|
| 277 |
+
|
| 278 |
+
# REFERENCES
|
| 279 |
+
|
| 280 |
+
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.
|
| 281 |
+
Alekh Agarwal and John C Duchi. Distributed delayed stochastic optimization. In J. Shawe-Taylor, R. S. Zemel, P. L. Bartlett, F. Pereira, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 24, pp. 873–881. Curran Associates, Inc., 2011. URL http://papers.nips.cc/paper/ 4247-distributed-delayed-stochastic-optimization.pdf.
|
| 282 |
+
Alham Fikri Aji and Kenneth Heafield. Sparse communication for distributed gradient descent. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 440–445. Association for Computational Linguistics, 2017. URL http://aclweb.org/anthology/D17-1045.
|
| 283 |
+
Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. QSGD: Communication-efficient SGD via gradient quantization and encoding. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 1709–1720. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/6768-qsgdcommunication-efficient-sgd-via-gradient-quantization-and-encoding.pdf.
|
| 284 |
+
Avleen S Bijral, Anand D Sarwate, and Nathan Srebro. On data dependence in distributed stochastic optimization. arXiv.org, 2016.
|
| 285 |
+
Jianmin Chen, Rajat Monga, Samy Bengio, and Rafal Józefowicz. Revisiting distributed synchronous SGD. CoRR, abs/1604.00981, 2016. URL http://arxiv.org/abs/1604.00981.
|
| 286 |
+
Greg Coppola. Iterative parameter mixing for distributed large-margin training of structured predictors for natural language processing. PhD thesis, The University of Edinburgh, 2015.
|
| 287 |
+
Ofer Dekel, Ran Gilad-Bachrach, Ohad Shamir, and Lin Xiao. Optimal distributed online prediction using mini-batches. J. Mach. Learn. Res., 13(1):165–202, January 2012. ISSN 1532-4435. URL http:// dl.acm.org/citation.cfm?id=2503308.2188391.
|
| 288 |
+
|
| 289 |
+
N. Dryden, T. Moon, S. A. Jacobs, and B. V. Essen. Communication quantization for data-parallel training of deep neural networks. In 2016 2nd Workshop on Machine Learning in HPC Environments (MLHPC), pp. 1–8, Nov 2016. doi: 10.1109/MLHPC.2016.004.
|
| 290 |
+
|
| 291 |
+
Antoine Godichon-Baggioni and Sofiane Saadane. On the rates of convergence of parallelized averaged stochastic gradient algorithms. arXiv preprint arXiv:1710.07926, 2017.
|
| 292 |
+
|
| 293 |
+
Priya Goyal, Piotr Dollár, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: training ImageNet in 1 hour. CoRR, abs/1706.02677, 2017. URL http://arxiv.org/abs/1706.02677.
|
| 294 |
+
|
| 295 |
+
Suyog Gupta, Ankur Agrawal, Kailash Gopalakrishnan, and Pritish Narayanan. Deep learning with limited numerical precision. In Proceedings of the 32Nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pp. 1737–1746. JMLR.org, 2015. URL http://dl.acm.org/ citation.cfm?id=3045118.3045303.
|
| 296 |
+
|
| 297 |
+
Prateek Jain, Sham M. Kakade, Rahul Kidambi, Praneeth Netrapalli, and Aaron Sidford. Parallelizing stochastic gradient descent for least squares regression: Mini-batching, averaging, and model misspecification. Journal of Machine Learning Research, 18(223):1–42, 2018. URL http://jmlr.org/papers/v18/16- 595.html.
|
| 298 |
+
|
| 299 |
+
Nitish Shirish Keskar, Dheevatsa Mudigere, Jorge Nocedal, Mikhail Smelyanskiy, and Ping Tak Peter Tang. On large-batch training for deep learning: Generalization gap and sharp minima. arXiv preprint arXiv:1609.04836, 2016.
|
| 300 |
+
|
| 301 |
+
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. CoRR, abs/1212.2002, 2012.
|
| 302 |
+
|
| 303 |
+
Xiangru Lian, Yijun Huang, Yuncheng Li, and Ji Liu. Asynchronous parallel stochastic gradient for nonconvex optimization. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pp. 2737–2745, Cambridge, MA, USA, 2015. MIT Press. URL http: //dl.acm.org/citation.cfm?id $\equiv$ 2969442.2969545.
|
| 304 |
+
|
| 305 |
+
Tao Lin, Sebastian U. Stich, and Martin Jaggi. Don’t use large mini-batches, use local SGD. CoRR, abs/1808.07217, 2018a. URL https://arxiv.org/abs/1808.07217.
|
| 306 |
+
|
| 307 |
+
Yujun Lin, Song Han, Huizi Mao, Yu Wang, and Bill Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. In ICLR 2018 - International Conference on Learning Representations, 2018b. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ SkhQHMW0W.
|
| 308 |
+
|
| 309 |
+
Siyuan Ma, Raef Bassily, and Mikhail Belkin. The power of interpolation: Understanding the effectiveness of SGD in modern over-parametrized learning. In ICML, 2018.
|
| 310 |
+
|
| 311 |
+
Horia Mania, Xinghao Pan, Dimitris Papailiopoulos, Benjamin Recht, Kannan Ramchandran, and Michael I. Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. SIAM Journal on Optimization, 27(4):2202–2229, 2017. doi: 10.1137/16M1057000.
|
| 312 |
+
|
| 313 |
+
Ryan McDonald, Mehryar Mohri, Nathan Silberman, Dan Walker, and Gideon S. Mann. Efficient large-scale distributed training of conditional maximum entropy models. In Y. Bengio, D. Schuurmans, J. D. Lafferty, C. K. I. Williams, and A. Culotta (eds.), Advances in Neural Information Processing Systems 22, pp. 1231–1239. Curran Associates, Inc., 2009. URL http://papers.nips.cc/paper/3881-efficient-largescale-distributed-training-of-conditional-maximum-entropy-models.pdf.
|
| 314 |
+
|
| 315 |
+
Ryan McDonald, Keith Hall, and Gideon Mann. Distributed training strategies for the structured perceptron. In Human Language Technologies: The 2010 Annual Conference of the North American Chapter of the Association for Computational Linguistics, HLT ’10, pp. 456–464, Stroudsburg, PA, USA, 2010. Association for Computational Linguistics. ISBN 1-932432-65-5. URL http://dl.acm.org/citation.cfm?id= 1857999.1858068.
|
| 316 |
+
|
| 317 |
+
Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communicationefficient learning of deep networks from decentralized data. In Aarti Singh and Jerry Zhu (eds.), Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pp. 1273–1282, Fort Lauderdale, FL, USA, 20–22 Apr 2017. PMLR. URL http://proceedings.mlr.press/v54/mcmahan17a.html.
|
| 318 |
+
|
| 319 |
+
T. Na, J. H. Ko, J. Kung, and S. Mukhopadhyay. On-chip training of recurrent neural networks with limited numerical precision. In 2017 International Joint Conference on Neural Networks (IJCNN), pp. 3716–3723, May 2017. doi: 10.1109/IJCNN.2017.7966324.
|
| 320 |
+
|
| 321 |
+
Feng Niu, Benjamin Recht, Christopher Re, and Stephen J. Wright. Hogwild!: A lock-free approach to parallelizing stochastic gradient descent. In Proceedings of the 24th International Conference on Neural Information Processing Systems, NIPS’11, pp. 693–701, USA, 2011. Curran Associates Inc. ISBN 978-1- 61839-599-3. URL http://dl.acm.org/citation.cfm?id=2986459.2986537.
|
| 322 |
+
|
| 323 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
|
| 324 |
+
|
| 325 |
+
John C. Platt. Advances in kernel methods. chapter Fast Training of Support Vector Machines Using Sequential Minimal Optimization, pp. 185–208. MIT Press, Cambridge, MA, USA, 1999. ISBN 0-262-19416-3. URL http://dl.acm.org/citation.cfm?id $\boldsymbol { \mathbf { \rho } } = \boldsymbol { \mathbf { \rho } } .$ 299094.299105.
|
| 326 |
+
|
| 327 |
+
Alexander Rakhlin, Ohad Shamir, and Karthik Sridharan. Making gradient descent optimal for strongly convex stochastic optimization. In Proceedings of the 29th International Coference on International Conference on Machine Learning, ICML’12, pp. 1571–1578, USA, 2012. Omnipress. ISBN 978-1-4503-1285-1. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 3042573.3042774.
|
| 328 |
+
|
| 329 |
+
Herbert Robbins and Sutton Monro. A Stochastic Approximation Method. The Annals of Mathematical Statistics, 22(3):400–407, September 1951.
|
| 330 |
+
|
| 331 |
+
Christopher De Sa, Ce Zhang, Kunle Olukotun, and Christopher Ré. Taming the wild: A unified analysis of HOG WILD!-style algorithms. In Proceedings of the 28th International Conference on Neural Information Processing Systems - Volume 2, NIPS’15, pp. 2674–2682, Cambridge, MA, USA, 2015. MIT Press. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 2969442.2969538.
|
| 332 |
+
|
| 333 |
+
Frank Seide and Amit Agarwal. CNTK: Microsoft’s open-source deep-learning toolkit. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pp. 2135–2135. ACM, 2016.
|
| 334 |
+
|
| 335 |
+
Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu. 1-bit stochastic gradient descent and its application to data-parallel distributed training of speech DNNs. In Haizhou Li, Helen M. Meng, Bin Ma, Engsiong Chng, and Lei Xie (eds.), INTERSPEECH, pp. 1058–1062. ISCA, 2014. URL http://dblp.uni-trier.de/ db/conf/interspeech/interspeech2014.html#SeideFDLY14.
|
| 336 |
+
|
| 337 |
+
O. Shamir and N. Srebro. Distributed stochastic optimization and learning. In 2014 52nd Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 850–857, Sep. 2014. doi: 10.1109/ ALLERTON.2014.7028543.
|
| 338 |
+
|
| 339 |
+
Ohad Shamir and Tong Zhang. Stochastic gradient descent for non-smooth optimization: Convergence results and optimal averaging schemes. In Sanjoy Dasgupta and David McAllester (eds.), Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pp. 71–79, Atlanta, Georgia, USA, 17–19 Jun 2013. PMLR. URL http://proceedings.mlr.press/ v28/shamir13.html.
|
| 340 |
+
|
| 341 |
+
Sebastian U Stich, Jean-Baptiste Cordonnier, and Martin Jaggi. Sparsified SGD with memory. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 4452–4463. Curran Associates, Inc., 2018. URL http: //papers.nips.cc/paper/7697-sparsified-sgd-with-memory.pdf.
|
| 342 |
+
|
| 343 |
+
Nikko Strom. Scalable distributed DNN training using commodity GPU cloud computing. In INTERSPEECH, pp. 1488–1492. ISCA, 2015. URL http://dblp.uni-trier.de/db/conf/interspeech/ interspeech2015.html#Strom15.
|
| 344 |
+
|
| 345 |
+
Xu Sun, Xuancheng Ren, Shuming Ma, and Houfeng Wang. meProp: Sparsified back propagation for accelerated deep learning with reduced overfitting. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 3299–3308, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/sun17c.html.
|
| 346 |
+
|
| 347 |
+
Jianyu Wang and Gauri Joshi. Cooperative SGD: A unified framework for the design and analysis of communication-efficient SGD algorithms. CoRR, abs/1808.07576, 2018.
|
| 348 |
+
|
| 349 |
+
Jianqiao Wangni, Jialei Wang, Ji Liu, and Tong Zhang. Gradient sparsification for communication-efficient distributed optimization. CoRR, abs/1710.09854, 2017. URL http://arxiv.org/abs/1710.09854.
|
| 350 |
+
|
| 351 |
+
Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems 30, pp. 1509–1519. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/6749-terngrad-ternary-gradients-toreduce-communication-in-distributed-deep-learning.pdf.
|
| 352 |
+
|
| 353 |
+
Blake E Woodworth, Jialei Wang, Adam Smith, Brendan McMahan, and Nati Srebro. Graph oracle models, lower bounds, and gaps for parallel stochastic optimization. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems 31, pp. 8505–8515. Curran Associates, Inc., 2018. URL http://papers.nips.cc/paper/8069-graph-oracle-models-lower-bounds-andgaps-for-parallel-stochastic-optimization.pdf.
|
| 354 |
+
|
| 355 |
+
Dong Yin, Ashwin Pananjady, Max Lam, Dimitris Papailiopoulos, Kannan Ramchandran, and Peter Bartlett. Gradient diversity: a key ingredient for scalable distributed learning. In Amos Storkey and Fernando PerezCruz (eds.), Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, volume 84 of Proceedings of Machine Learning Research, pp. 1998–2007, Playa Blanca, Lanzarote, Canary Islands, 09–11 Apr 2018. PMLR. URL http://proceedings.mlr.press/v84/yin18a.html.
|
| 356 |
+
|
| 357 |
+
Yang You, Igor Gitman, and Boris Ginsburg. Scaling SGD batch size to 32k for ImageNet training. CoRR, abs/1708.03888, 2017.
|
| 358 |
+
|
| 359 |
+
Hao Yu, Sen Yang, and Shenghuo Zhu. Parallel restarted SGD for non-convex optimization with faster convergence and less communication. CoRR, abs/1807.06629, 2018.
|
| 360 |
+
|
| 361 |
+
Hantian Zhang, Jerry Li, Kaan Kara, Dan Alistarh, Ji Liu, and Ce Zhang. ZipML: Training linear models with end-to-end low precision, and a little bit of deep learning. In Doina Precup and Yee Whye Teh (eds.), Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 4035–4043, International Convention Centre, Sydney, Australia, 06–11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/zhang17e.html.
|
| 362 |
+
|
| 363 |
+
Jian Zhang, Christopher De Sa, Ioannis Mitliagkas, and Christopher Ré. Parallel SGD: When does averaging help? arXiv, 2016.
|
| 364 |
+
|
| 365 |
+
Sixin Zhang, Anna E Choromanska, and Yann LeCun. Deep learning with elastic averaging SGD. In C. Cortes, N. D. Lawrence, D. D. Lee, M. Sugiyama, and R. Garnett (eds.), Advances in Neural Information Processing Systems 28, pp. 685–693. Curran Associates, Inc., 2015. URL http://papers.nips.cc/paper/ 5761-deep-learning-with-elastic-averaging-sgd.pdf.
|
| 366 |
+
|
| 367 |
+
X. Zhang, J. Trmal, D. Povey, and S. Khudanpur. Improving deep neural network acoustic models using generalized maxout networks. In 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 215–219, May 2014. doi: 10.1109/ICASSP.2014.6853589.
|
| 368 |
+
|
| 369 |
+
Yuchen Zhang, John C. Duchi, and Martin J. Wainwright. Communication-efficient algorithms for statistical optimization. Journal of Machine Learning Research, 14:3321–3363, 2013. URL http://jmlr.org/ papers/v14/zhang13b.html.
|
| 370 |
+
|
| 371 |
+
Peilin Zhao and Tong Zhang. Stochastic optimization with importance sampling for regularized loss minimization. In Francis Bach and David Blei (eds.), Proceedings of the 32nd International Conference on Machine Learning, volume 37 of Proceedings of Machine Learning Research, pp. 1–9, Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr.press/v37/zhaoa15.html.
|
| 372 |
+
|
| 373 |
+
Fan Zhou and Guojing Cong. On the convergence properties of a k-step averaging stochastic gradient descent algorithm for nonconvex optimization. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pp. 3219–3227. International Joint Conferences on Artificial Intelligence Organization, 7 2018. doi: 10.24963/ijcai.2018/447. URL https://doi.org/10.24963/ijcai.2018/ 447.
|
| 374 |
+
|
| 375 |
+
Zhengyuan Zhou, Panayotis Mertikopoulos, Nicholas Bambos, Peter Glynn, Yinyu Ye, Li-Jia Li, and Li Fei-Fei. Distributed asynchronous optimization with unbounded delays: How slow can you go? In Jennifer Dy and Andreas Krause (eds.), Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pp. 5970–5979, Stockholmsmässan, Stockholm Sweden, 10–15 Jul 2018. PMLR. URL http://proceedings.mlr.press/v80/zhou18b.html.
|
| 376 |
+
|
| 377 |
+
Martin Zinkevich, Markus Weimer, Lihong Li, and Alex J. Smola. Parallelized stochastic gradient descent. In J. D. Lafferty, C. K. I. Williams, J. Shawe-Taylor, R. S. Zemel, and A. Culotta (eds.), Advances in Neural Information Processing Systems 23, pp. 2595–2603. Curran Associates, Inc., 2010. URL http: //papers.nips.cc/paper/4006-parallelized-stochastic-gradient-descent.pdf.
|
| 378 |
+
|
| 379 |
+
# A MISSING PROOFS FOR SYNCHRONIZED LOCAL SGD
|
| 380 |
+
|
| 381 |
+
In this section we provide the proofs for the three lemmas that were introduced in Section 3.
|
| 382 |
+
|
| 383 |
+
Proof of Lemma 3.1. Using the update equation (7) we have
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } & { \left\| \bar { \mathbf { x } } _ { t + 1 } - \mathbf { x } ^ { \star } \right\| ^ { 2 } = \left\| \bar { \mathbf { x } } _ { t } - \eta _ { t } \mathbf { g } _ { t } - \mathbf { x } ^ { \star } \right\| ^ { 2 } = \left\| \bar { \mathbf { x } } _ { t } - \eta _ { t } \mathbf { g } _ { t } - \mathbf { x } ^ { \star } - \eta _ { t } \bar { \mathbf { g } } _ { t } + \eta _ { t } \bar { \mathbf { g } } _ { t } \right\| ^ { 2 } } \\ & { \qquad = \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } - \eta _ { t } \bar { \mathbf { g } } _ { t } \right\| ^ { 2 } + \eta _ { t } ^ { 2 } \left\| \mathbf { g } _ { t } - \bar { \mathbf { g } } _ { t } \right\| ^ { 2 } + 2 \eta _ { t } \left. \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } - \eta _ { t } \bar { \mathbf { g } } _ { t } , \bar { \mathbf { g } } _ { t } - \mathbf { g } _ { t } \right. . } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
Observe that
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\begin{array} { r l } { | { \bf x } _ { k } - { \bf x } ^ { \prime } - \eta _ { k } \mathbf { g } | ^ { 2 } = \| { \bf x } _ { k } - { \bf x } ^ { \prime } \| ^ { 2 } + \eta _ { k } ^ { 2 } \| { \bf g } _ { k } \| ^ { 2 } - 2 \eta _ { k } { \bf x } _ { k } - { \bf x } ^ { \prime } , { \bf g } _ { k } } & { \qquad \mathrm { ( f ~ } { \bf x } _ { k } < { \bf x } ^ { \prime } , { \bf g } _ { k } ^ { \prime } \mathrm { ) } } \\ & { = \| { \bf x } _ { k } - { \bf x } ^ { \prime } \| ^ { 2 } + \eta _ { k } ^ { 2 } \| { \bf g } _ { k } \| ^ { 2 } - 2 \eta _ { k } { 1 } { K _ { k } - 1 } { \bf x } _ { k } - { \bf x } ^ { \prime } , \nabla f ( { \bf x } _ { k } ^ { \prime } ) } & { \qquad \mathrm { ( f ~ } { \bf x } _ { k } < { \bf x } ^ { \prime } , \nabla f ( { \bf x } _ { k } ^ { \prime } ) } \\ & { \leq \| { \bf x } _ { k } - { \bf x } ^ { \prime } \| ^ { 2 } + \eta _ { k } ^ { 2 } \frac { 1 } { K _ { k } - 1 } \nabla f ( { \bf x } _ { k } ^ { \prime } ) + \eta _ { k } ^ { 2 } } \\ & { \qquad - 2 \eta _ { k } \frac { 1 } { K _ { k } - 1 } \frac { K _ { k } ^ { 2 } } { K _ { k } - 1 } { \bf x } _ { k } - { \bf x } _ { k } ^ { \prime } + { \bf x } _ { k } ^ { \prime } - { \bf x } ^ { \prime } , \nabla f ( { \bf x } _ { k } ^ { \prime } ) } \\ & { = \| { \bf x } _ { k } - { \bf x } ^ { \prime } \| ^ { 2 } + \eta _ { k } ^ { 2 } \frac { 1 } { K _ { k } - 1 } \| \nabla f ( { \bf x } _ { k } ^ { \prime } ) - \nabla f ( { \bf x } ^ { \prime } ) \| ^ { 2 } } \\ & \qquad - 2 \eta _ { k } ^ { 2 } \frac { 1 } { K _ { k } - 1 } { \bf x } _ { k } ^ { \prime } - \end{array}
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
where we used the inequality $\begin{array} { r } { \| \sum _ { i = 1 } ^ { K } \mathbf { a } _ { i } \| ^ { 2 } \leq K \sum _ { i = 1 } ^ { K } \| \mathbf { a } _ { i } \| ^ { 2 } } \end{array}$ in (21). By $L$ -smoothness,
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\left\| \nabla f ( \mathbf { x } _ { t } ^ { k } ) - \nabla f ( \mathbf { x } ^ { \star } ) \right\| ^ { 2 } \leq 2 L ( f ( \mathbf { x } _ { t } ^ { k } ) - f ^ { \star } ) ,
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
and by $\mu$ -strong convexity
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
- \left. \mathbf { x } _ { t } ^ { k } - \mathbf { x } ^ { \star } , \nabla f ( \mathbf { x } _ { t } ^ { k } ) \right. \leq - ( f ( \mathbf { x } _ { t } ^ { k } ) - f ^ { \star } ) - \frac { \mu } { 2 } \left\| \mathbf { x } _ { t } ^ { k } - \mathbf { x } ^ { \star } \right\| ^ { 2 } .
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
To estimate the last term in (22) we use $2 \left. \mathbf { a } , \mathbf { b } \right. \leq \gamma \left\| \mathbf { a } \right\| ^ { 2 } + \gamma ^ { - 1 } \left\| \mathbf { b } \right\| ^ { 2 }$ , for $\gamma > 0$ . This gives
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\begin{array} { l } { \displaystyle - 2 \left. \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { k } ^ { t } , \nabla f ( { \mathbf { x } } _ { t } ^ { k } ) \right. \leq 2 L \left. \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { k } ^ { t } \right. ^ { 2 } + \displaystyle \frac { 1 } { 2 L } \left. \nabla f ( \mathbf { x } _ { t } ^ { k } ) \right. ^ { 2 } } \\ { \displaystyle \qquad = 2 L \left. \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { k } ^ { t } \right. ^ { 2 } + \displaystyle \frac { 1 } { 2 L } \left. \nabla f ( \mathbf { x } _ { t } ^ { k } ) - \nabla f ( \mathbf { x } ^ { \star } ) \right. ^ { 2 } } \\ { \displaystyle \qquad \leq 2 L \left. \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { k } ^ { t } \right. ^ { 2 } + \left( f ( \mathbf { x } _ { t } ^ { k } ) - f ^ { \star } \right) , } \end{array}
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
where we have again used (23) in the last inequality. By applying these three estimates to (22) we get
|
| 414 |
+
|
| 415 |
+
$$
|
| 416 |
+
\begin{array} { l } { { \displaystyle \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } - \eta _ { t } \bar { \mathbf { g } } _ { t } \right\| ^ { 2 } \leq \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } \right\| ^ { 2 } + 2 \eta _ { t } \displaystyle \frac { L } { K } \sum _ { k = 1 } ^ { K } \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { k } ^ { t } \right\| ^ { 2 } } } \\ { { \displaystyle \qquad + 2 \eta _ { t } \displaystyle \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \left( \left( \eta _ { t } L - \displaystyle \frac { 1 } { 2 } \right) \left( f ( \mathbf { x } _ { t } ^ { k } ) - f ^ { \star } \right) - \displaystyle \frac { \mu } { 2 } \left\| \mathbf { x } _ { t } ^ { k } - \mathbf { x } ^ { \star } \right\| ^ { 2 } \right) . } } \end{array}
|
| 417 |
+
$$
|
| 418 |
+
|
| 419 |
+
For $\begin{array} { r } { \eta _ { t } \le \frac { 1 } { 4 L } } \end{array}$ it holds $\begin{array} { r } { \left( \eta _ { t } L - \frac { 1 } { 2 } \right) \le - \frac { 1 } { 4 } } \end{array}$ . By convexity of $a \left( f ( \mathbf { x } ) - f ^ { \star } \right) + b \left\| \mathbf { x } - \mathbf { x } ^ { \star } \right\| ^ { 2 }$ for $a , b \geq 0$ :
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
- \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \Big ( a \big ( f ( \mathbf { x } _ { t } ^ { k } ) - f ^ { \star } \big ) + b \big \| \mathbf { x } _ { t } ^ { k } - \mathbf { x } ^ { \star } \big \| ^ { 2 } \Big ) \leq - \Big ( a \big ( f ( \bar { \mathbf { x } } _ { t } ) - f ^ { \star } \big ) + b \big \| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } \big \| ^ { 2 } \Big ) \ ,
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
hence we can continue in (28) and obtain
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } - \eta _ { t } \bar { \mathbf { g } } _ { t } \right\| ^ { 2 } \leq \left( 1 - \mu \eta _ { t } \right) \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } \right\| ^ { 2 } - \frac { 1 } { 2 } \eta _ { t } \big ( f ( \bar { \mathbf { x } } _ { t } ) - f ^ { \star } \big ) + 2 \eta _ { t } \frac { L } { K } \sum _ { k = 1 } ^ { K } \left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \right\| ^ { 2 } .
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
Finally, we can plug (30) back into (18). By taking expectation we get
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\begin{array} { r l r } { { \mathbb { E } \| \bar { \mathbf { x } } _ { t + 1 } - \mathbf { x } ^ { \star } \| ^ { 2 } \leq ( 1 - \mu \eta _ { t } ) \mathbb { E } \| \bar { \mathbf { x } } _ { t } - \mathbf { x } ^ { \star } \| ^ { 2 } + \eta _ { t } ^ { 2 } \mathbb { E } \| \mathbf { g } _ { t } - \bar { \mathbf { g } } _ { t } \| ^ { 2 } } } \\ & { } & { \quad - \displaystyle \frac { 1 } { 2 } \eta _ { t } \mathbb { E } ( f ( \bar { \mathbf { x } } _ { t } ) - f ^ { \star } ) + 2 \eta _ { t } \frac { L } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \| ^ { 2 } . } \end{array}
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
Proof of Lemma 3.2. By definition of $\mathbf { g } _ { t }$ and $\bar { \bf g } _ { t }$ we have
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\mathbb { \Psi } \left. \mathbf { g } _ { t } - \bar { \mathbf { g } } _ { t } \right. ^ { 2 } = \mathbb { E } \left. \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \left( \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } ) - \nabla f ( \mathbf { x } _ { t } ^ { k } ) \right) \right. ^ { 2 } = \frac { 1 } { K ^ { 2 } } \sum _ { k = 1 } ^ { K } \mathbb { E } \left. \nabla f _ { i _ { t } ^ { k } } ( \mathbf { x } _ { t } ^ { k } ) - \nabla f ( \mathbf { x } _ { t } ^ { k } ) \right. ^ { 2 } \leq \frac { \sigma ^ { 2 } } { K } ,
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
where we used $\begin{array} { r } { \operatorname { V a r } ( \sum _ { k = 1 } ^ { K } X _ { k } ) = \sum _ { k = 1 } ^ { K } \operatorname { V a r } ( X _ { k } ) } \end{array}$ for independent random variables.
|
| 444 |
+
|
| 445 |
+
Proof of Lemma 3.3. As the $\mathrm { g a p } ( \mathcal { T } _ { T } ) \leq H$ , there is an index $t _ { 0 } , t - t _ { 0 } \leq H$ such that $\bar { \mathbf { x } } _ { t _ { 0 } } = \mathbf { x } _ { t _ { 0 } } ^ { k }$ for $k \in [ K ]$ . Observe, using $\operatorname { \mathbb { E } } \left\| X - \operatorname { \mathbb { E } } X \right\| ^ { 2 } = \operatorname { \mathbb { E } } \left\| X \right\| ^ { 2 } - \left\| \operatorname { \mathbb { E } } X \right\| ^ { 2 }$ and $\begin{array} { r } { \| \sum _ { i = 1 } ^ { H } \mathbf { a } _ { i } \| ^ { 2 } \leq H \sum _ { i = 1 } ^ { H } \| \mathbf { a } _ { i } \| ^ { 2 } } \end{array}$ ,
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\begin{array} { l } { \displaystyle \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \bar { \mathbf { x } } _ { t } - { \mathbf { x } } _ { t } ^ { k } \right\| ^ { 2 } = \frac { 1 } { K } \displaystyle \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| { \mathbf { x } } _ { t } ^ { k } - { \mathbf { x } } _ { t _ { 0 } } - \left( \bar { \mathbf { x } } _ { t } - { \mathbf { x } } _ { t _ { 0 } } \right) \right\| ^ { 2 } } \\ { \displaystyle \qquad \leq \frac { 1 } { K } \displaystyle \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| { \mathbf { x } } _ { t } ^ { k } - { \mathbf { x } } _ { t _ { 0 } } \right\| ^ { 2 } } \\ { \displaystyle \qquad \leq \frac { 1 } { K } \displaystyle \sum _ { k = 1 } ^ { K } H \eta _ { t _ { 0 } } ^ { 2 } \displaystyle \sum _ { h = t _ { 0 } } ^ { t - 1 } \mathbb { E } \left\| \nabla f _ { \bar { \mathbf { x } } _ { h } } ( x _ { h } ^ { k } ) \right\| ^ { 2 } } \\ { \displaystyle \qquad \leq \frac { 1 } { K } \displaystyle \sum _ { k = 1 } ^ { K } H ^ { 2 } \eta _ { t _ { 0 } } ^ { 2 } G ^ { 2 } , } \end{array}
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
where we used $\eta _ { t } \leq \eta _ { t _ { 0 } }$ for $t \geq t _ { 0 }$ and the assumption $\mathbb { E } \| \nabla f _ { i _ { h } ^ { k } } ( \mathbf { x } _ { h } ^ { k } ) \| ^ { 2 } \leq G ^ { 2 }$ . Finally, the claim follows by the assumption on the stepsizes, $\frac { \eta _ { t _ { 0 } } } { \eta _ { t } } \leq 2$ . □
|
| 452 |
+
|
| 453 |
+
# B MISSING PROOF FOR ASYNCHRONOUS LOCAL SGD
|
| 454 |
+
|
| 455 |
+
In this Section we prove Theorem 5.1. The proof follows closely the proof presented in Section 3. We again introduce the virtual sequence
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\bar { \mathbf { x } } _ { t } = \mathbf { x } _ { 0 } - \frac { 1 } { K } \sum _ { h = 1 } ^ { K } \sum _ { j = 0 } ^ { t - 1 } \eta _ { j } \nabla f _ { i _ { j } ^ { k } } \bigl ( \mathbf { x } _ { j } ^ { k } \bigr ) ,
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
as before. By the property $T \in \mathcal { T } _ { T } ^ { k }$ for $k \in K$ we know that all workers will have written their updates when the algorithm terminates. This assumption is not very critical and could be relaxed, but it facilitates the (already quite heavy) notation in the proof.
|
| 462 |
+
|
| 463 |
+
Observe, that Lemmas 3.1 and 3.2 hold for the virtual sequence $\{ \bar { \mathbf { x } } _ { t } \} _ { t = 0 } ^ { T }$ . Hence, all we need is a refined version of Lemma 3.3 that bounds how far the local sequences can deviate from the virtual average.
|
| 464 |
+
|
| 465 |
+
Lemma B.1. ${ \cal { I } } f \mathrm { g a p } ( { \cal { I } } _ { T } ^ { k } ) \le { \cal { H } }$ and $\exists \tau > 0 .$ , s.t. $\mathcal { W } _ { t } ^ { k , h } \supseteq [ t - \tau ]$ for all $k , h \in [ K ]$ , $t \in [ T ]$ , and sequence of decreasing positive stepsizes $\{ \eta _ { t } \} _ { t \ge 0 }$ satisfying $\eta _ { t } \leq 2 \eta _ { t + H + \tau }$ for all $t \geq 0$ , then
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbb { E } \left\| \bar { \mathbf { x } } _ { t } - { \mathbf { x } } _ { t } ^ { k } \right\| ^ { 2 } \leq 1 2 \eta _ { t } ^ { 2 } G ^ { 2 } ( H + \tau ) ^ { 2 } ,
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
where $G ^ { 2 }$ is a constant such that $\mathbb { E } _ { i } \| \nabla f _ { i } ( \mathbf { x } _ { t } ^ { k } ) \| ^ { 2 } \leq G ^ { 2 }$ for $k \in [ K ] , t \in [ T ]$ .
|
| 472 |
+
|
| 473 |
+
Here we use the notation $[ s ] = \{ \}$ for $s < 0$ , such that $[ t - \tau ]$ is also defined for $t < \tau$
|
| 474 |
+
|
| 475 |
+
Proof. As $\mathrm { g a p } ( \mathcal { T } _ { T } ^ { k } ) \leq H$ there exists for every $k \in K$ a $t _ { k }$ , $t - t _ { k } \le H$ , such that $\mathbf { x } _ { t _ { k } } ^ { k } = \bar { \bar { x } } _ { t _ { k } } ^ { k }$ . Let $t _ { 0 } : = \operatorname* { m i n } \{ t _ { 1 } , \dots , t _ { K } \}$ and observe $t _ { 0 } \geq t - H$ . Let $t _ { 0 } ^ { \prime } = \operatorname* { m a x } \{ t _ { 0 } - \tau , 0 \}$ . As $\mathcal { W } _ { t } ^ { k , h } \supseteq [ t - \tau ]$ for all $k , h \in [ K ]$ , $t \in [ T ]$ , it holds
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\bar { \bar { \mathbf { x } } } _ { t _ { k } } ^ { k } = \bar { \mathbf { x } } _ { t _ { 0 } ^ { \prime } } - \frac { 1 } { K } \sum _ { h = 1 } ^ { K } \sum _ { j = t _ { 0 } ^ { \prime } } ^ { t _ { k } - 1 } \mathbb { 1 } _ { j \in \mathcal { W } _ { t _ { k } } ^ { k , h } } \bigl ( \eta _ { j } \nabla f _ { i _ { j } ^ { k } } ( \mathbf { x } _ { j } ^ { k } ) \bigr ) ,
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
for each $k \in [ K ]$ . In other words, all updates up to iteration $t _ { 0 } ^ { \prime }$ have been written to the aggregated sequence.
|
| 482 |
+
|
| 483 |
+
We decompose the error term as
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \right\| ^ { 2 } \leq 3 \left( \left\| \mathbf { x } _ { t } ^ { k } - \mathbf { x } _ { t _ { k } } ^ { k } \right\| ^ { 2 } + \left\| \mathbf { x } _ { t _ { k } } ^ { k } - \bar { \mathbf { x } } _ { t _ { 0 } ^ { \prime } } \right\| ^ { 2 } + \left\| \bar { \mathbf { x } } _ { t _ { 0 } ^ { \prime } } - \bar { \mathbf { x } } _ { t } \right\| ^ { 2 } \right) .
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
Now, using $\eta _ { t } \geq \eta _ { t + 1 }$ , and $t - t _ { k } \le H$ , we conclude (as in (35))
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
\left\| \mathbf { x } _ { t } ^ { k } - \mathbf { x } _ { t _ { k } } ^ { k } \right\| ^ { 2 } \leq \eta _ { t _ { k } } ^ { 2 } H ^ { 2 } G ^ { 2 } \leq \eta _ { t _ { 0 } ^ { \prime } } ^ { 2 } H ^ { 2 } G ^ { 2 } .
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
As $t _ { k } - t _ { 0 } ^ { \prime } \leq \tau$ ,
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
\begin{array} { r } { \left\| \mathbf { x } _ { t _ { k } } ^ { k } - \bar { \mathbf { x } } _ { t _ { 0 } ^ { \prime } } \right\| ^ { 2 } \leq \eta _ { t _ { 0 } ^ { \prime } } ^ { 2 } \tau ^ { 2 } G ^ { 2 } , } \end{array}
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
and similarly, as $t - t _ { 0 } ^ { \prime } \leq H + \tau$ ,
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\begin{array} { r } { \left\| \tilde { \mathbf { x } } _ { t _ { 0 } ^ { \prime } } - \tilde { \mathbf { x } } _ { t } \right\| ^ { 2 } \leq \eta _ { t _ { 0 } ^ { \prime } } ^ { 2 } ( H + \tau ) ^ { 2 } G ^ { 2 } . } \end{array}
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
Finally, as $\frac { \eta _ { t _ { 0 } ^ { \prime } } } { \eta _ { t } } \leq 2$ , we can conclude
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\left\| \bar { \mathbf { x } } _ { t } - \mathbf { x } _ { t } ^ { k } \right\| ^ { 2 } \leq 1 2 \eta _ { t } ^ { 2 } ( H + \tau ) ^ { 2 } G ^ { 2 } .
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
and the lemma follows.
|
| 514 |
+
|
| 515 |
+
Now the proof of Theorem 5.1 follows immediately.
|
| 516 |
+
|
| 517 |
+
Proof of Theorem 5.1. As igence rate. Again, we have $\begin{array} { r } { A = { \frac { 1 } { 2 } } } \end{array}$ r, $\textstyle B = { \frac { \sigma ^ { 2 } } { K } }$ heore, and $C = L G ^ { 2 } ( H + \tau ) ^ { 2 }$ mma 3.4 to derive the conver-(Lemma B.1). It is easy to see that the stepsizes satisfy the condition of Lemma B.1, as clearly $\begin{array} { r } { \frac { \eta _ { t _ { 0 } ^ { \prime } } } { \eta _ { t } } \leq \frac { \eta _ { t _ { 0 } ^ { \prime } } } { \eta _ { t _ { 0 } ^ { \prime } + H + \tau } } = \frac { a + t + H + \tau } { a + t } \leq 2 } \end{array}$ $a \geq H + \tau$ . □
|
| 518 |
+
|
| 519 |
+
# C COMMENTS ON IMPLEMENTATION ISSUES
|
| 520 |
+
|
| 521 |
+
# C.1 SYNCHRONOUS LOCAL SGD
|
| 522 |
+
|
| 523 |
+
In Theorem 5 we do not prove convergence of the sequences $\{ \mathbf { x } _ { t } ^ { k } \} _ { t \geq 0 }$ of the iterates, but only convergence of a weighted average of all iterates. In practice, the last iterate might often be sufficient, but we like to remark that the weighted average of the iterates can easily be tracked on the fly with an auxiliary sequence $\{ \mathbf { y } _ { t } \} _ { t > 0 }$ , $\mathbf { y } _ { 0 } = \mathbf { x } _ { 0 }$ , without storing all intermediate iterates, see Table 1 for some examples.
|
| 524 |
+
|
| 525 |
+
Table 1: Formulas to recursively track weighted averages.
|
| 526 |
+
|
| 527 |
+
<table><tr><td rowspan=1 colspan=1>criteria</td><td rowspan=1 colspan=1>weights</td><td rowspan=1 colspan=1>formula</td><td rowspan=1 colspan=1>recursive update</td></tr><tr><td rowspan=1 colspan=1>last iterate</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>yt=Xt</td><td rowspan=1 colspan=1>yt=Xt</td></tr><tr><td rowspan=1 colspan=1>uniform average</td><td rowspan=1 colspan=1>Wt=1</td><td rowspan=1 colspan=1>y=中∑i=0Xi</td><td rowspan=1 colspan=1>yt=xt+1yt-1t</td></tr><tr><td rowspan=1 colspan=1>linear weights</td><td rowspan=1 colspan=1>Wt=(t+1)</td><td rowspan=1 colspan=1>yt =(+t(2+)∑i-0(i+ 1)xi2</td><td rowspan=1 colspan=1>yt=22txt++2yt-1</td></tr><tr><td rowspan=1 colspan=1>quadratic weights</td><td rowspan=1 colspan=1>Wt =(t+1)²</td><td rowspan=1 colspan=1>yt= 6(t+1)(t+2)(2t+3)∑i=0(i+1)²x</td><td rowspan=1 colspan=1>yt= 6(t+1) t(1+2t)(t+2)(2t+3)Xt+6+7t+2t2Yt-1</td></tr></table>
|
| 528 |
+
|
| 529 |
+
# C.2 ASYNCHRONOUS LOCAL SGD
|
| 530 |
+
|
| 531 |
+
As for synchronous local SGD, the weighted averages of the iterates (if needed), can be tracked on each worker locally by a recursive formula as explained above.
|
| 532 |
+
|
| 533 |
+
A more important aspect that we do not have discussed yet, is that Algorithm 2 allows for an easy procedure to balance the load in heterogeneous settings. In our notation, we have always associated the local sequences $\{ \mathbf { x } _ { t } ^ { k } \}$ with a specific worker $k$ . However, the computation of the sequences does not need to be tied to a specific worker. Thus, a fast worker $k$ that has advanced his local sequence too much already, can start computing updates for another sequence $\boldsymbol { k } ^ { \prime } \neq \boldsymbol { k }$ , if worker $k ^ { \prime }$ is lagged behind. This was not possible in the synchronous model, as there all communications had to happen in sync. We demonstrate this principle in Table 2 below for two workers. Note that also the running averages can still be maintained.
|
| 534 |
+
|
| 535 |
+
<table><tr><td rowspan=1 colspan=8>wall clock time → → → → → →</td></tr><tr><td rowspan=1 colspan=1>worker 1</td><td rowspan=1 colspan=1>xH←U(x)</td><td rowspan=1 colspan=1>xH←U(x)</td><td rowspan=1 colspan=1>xH←U(x)</td><td rowspan=1 colspan=1>xH,2←U(x)</td><td rowspan=1 colspan=1>xH←U()</td><td rowspan=1 colspan=1>x4H←U(x)</td><td rowspan=1 colspan=1>:</td></tr><tr><td rowspan=1 colspan=1>worker 2</td><td rowspan=1 colspan=3>x←U(x)</td><td rowspan=1 colspan=3>xH←U(x)</td><td rowspan=1 colspan=1>·</td></tr></table>
|
| 536 |
+
|
| 537 |
+
Table 2: Simple load balancing. The faster worker can advance both sequences, even when the slower worker has not yet finished the computation. In the example each worker does $H$ steps of local SGD (denoted by the operator $U \colon { \mathbb { R } ^ { d } } \to \dot { { \mathbb { R } ^ { d } } }$ ) before writing back the updates to the aggregate $\bar { \bar { \bf x } }$ . Due to the load balancing, $\tau \leq 3 H$ .
|
| 538 |
+
|
| 539 |
+
# D DETAILS ON EXPERIMENTS
|
| 540 |
+
|
| 541 |
+
We here state the precise procedure that was used to generate the figures in this report. As briefly stated in Section 4 we examine empirically the speedup on a logistic regression problem, $f ( \mathbf { x } ) =$ $\begin{array} { r } { \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \log ( 1 + \exp ( - b _ { i } \mathbf { a } _ { i } ^ { \top } \mathbf { x } ) ) + \frac { \lambda } { 2 } \| \mathbf { x } \| ^ { 2 } , } \end{array}$ , where $\mathbf { a } _ { i } \in \mathbb { R } ^ { d }$ and $b _ { i } \in \{ - 1 , + 1 \}$ are the data samples. The regularization parameter is set to $\lambda = 1 / n$ . We consider the small scale $\mathtt { w } 8 \mathtt { a }$ dataset (Platt, 1999) $( d = 3 0 0 , n = 4 9 7 4 9 )$ .
|
| 542 |
+
|
| 543 |
+
For each run, we initialize $\mathbf { x } _ { 0 } = \mathbf { 0 } _ { d }$ and measure the number of iterations6 (and number of stochastic gradient evaluations) to reach the target accuracy $\epsilon \in \lbrace 0 . 0 0 5 , 0 . 0 0 0 1 \rbrace$ . As we prove convergence only for a special weighted sum of the iterates in Theorem 2.2 and not for standard criteria (last iterate or uniform average), we evaluate the function value for different weighted averages $\mathbf { y } _ { t } =$ $\textstyle { \frac { 1 } { \sum _ { i = 0 } ^ { t } w _ { i } } } \sum _ { i = 0 } ^ { t } w _ { i } \mathbf { x } _ { t }$ , and consider the accuracy reached when one of the averages satisfies $f ( \mathbf { y } _ { t } ) -$ $f ^ { \star } \leq \epsilon$ , with $f ^ { \star } : = 0 . 1 2 6 4 3 3 1 7 6 2 1 6 5 4 5$ (numerically determined). The precise formulas for the averages that we used are given in Table 1.
|
| 544 |
+
|
| 545 |
+
For each configuration $( K , H , b , \epsilon )$ , we report the best result found with any of the following two stepsizes: $\begin{array} { r } { \eta _ { t } : = \operatorname* { m i n } ( 3 2 , \frac { c n } { t + 1 } ) } \end{array}$ and $\eta _ { t } = 3 2 c$ . Here $c$ is a parameter that can take the values $c = { \bar { 2 } } ^ { i }$ for $i \in \mathbb { Z }$ . For each stepsize we determine the best parameter $c$ by a grid search, and consider parameter $c$ optimal, if parameters $\{ 2 ^ { - 2 } c , 2 ^ { - 1 } c , 2 c , 2 ^ { 2 } c \}$ yield worse results (i.e. more iterations to reach the target accuracy).
|
| 546 |
+
|
| 547 |
+
In Figures 4 and 5 we give additional results for mini-batch sizes $b \in \{ 1 , 1 6 \}$ .
|
| 548 |
+
|
| 549 |
+

|
| 550 |
+
Figure 4: Measured speedup of local SGD with mini-batch $b = 1$ for different numbers of workers $K$ and parameters $H$ .
|
| 551 |
+
|
| 552 |
+

|
| 553 |
+
Figure 5: Measured speedup of local SGD with mini-batch $b = 1 6$ for different numbers of workers $K$ and parameters $H$ .
|
md/train/S1giVsRcYm/S1giVsRcYm.md
ADDED
|
@@ -0,0 +1,326 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COUNT-BASED EXPLORATION WITH THE SUCCESSOR REPRESENTATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The problem of exploration in reinforcement learning is well-understood in the tabular case and many sample-efficient algorithms are known. Nevertheless, it is often unclear how the algorithms in the tabular setting can be extended to tasks with large state-spaces where generalization is required. Recent promising developments generally depend on problem-specific density models or handcrafted features. In this paper we introduce a simple approach for exploration that allows us to develop theoretically justified algorithms in the tabular case but that also give us intuitions for new algorithms applicable to settings where function approximation is required. Our approach and its underlying theory is based on the substochastic successor representation, a concept we develop here. While the traditional successor representation is a representation that defines state generalization by the similarity of successor states, the substochastic successor representation is also able to implicitly count the number of times each state (or feature) has been observed. This extension connects two until now disjoint areas of research. We show in traditional tabular domains (RiverSwim and SixArms) that our algorithm empirically performs as well as other sample-efficient algorithms. We then describe a deep reinforcement learning algorithm inspired by these ideas and show that it matches the performance of recent pseudo-count-based methods in hard exploration Atari 2600 games.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Reinforcement learning (RL) tackles sequential decision making problems by formulating them as tasks where an agent must learn how to act optimally through trial and error interactions with the environment. The goal in these problems is to maximize the sum of the numerical reward signal observed at each time step. Because the actions taken by the agent influence not just the immediate reward but also the states and associated rewards in the future, sequential decision making problems require agents to deal with the trade-off between immediate and delayed rewards. Here we focus on the problem of exploration in RL, which aims to reduce the number of samples (i.e., interactions) an agent needs in order to learn to perform well in these tasks when the environment is initially unknown.
|
| 12 |
+
|
| 13 |
+
The sample efficiency of RL algorithms is largely dependent on how agents select exploratory actions. In order to learn the proper balance between immediate and delayed rewards agents need to navigate through the state space to learn about the outcome of different transitions. The number of samples an agent requires is related to how quickly it is able to explore the state-space. Surprisingly, the most common approach is to select exploratory actions uniformly at random, even in high-profile success stories of RL (e.g., Tesauro, 1995; Mnih et al., 2015). Nevertheless, random exploration often fails in environments with sparse rewards, that is, environments where the agent observes a reward signal of value zero for the majority of states.1
|
| 14 |
+
|
| 15 |
+
In model-based approaches agents explicitly learn a model of the dynamics of the environment which they use to plan future actions. In this setting the problem of exploration is well understood. When all states can be enumerated and uniquely identified (tabular case), we have algorithms with proven sample complexity bounds on the maximum number of suboptimal actions an agent selects before converging to an $\epsilon$ -optimal policy (e.g., Brafman & Tennenholtz, 2002; Kearns & Singh, 2002; Strehl & Littman, 2008). However, these approaches are not easily extended to large environments where it is intractable to enumerate all of the states. When using function approximation, the concept of state visitation is not helpful and learning useful models is by itself quite challenging.
|
| 16 |
+
|
| 17 |
+
Due to the difficulties in learning good models in large domains, model-free methods are much more popular. Instead of building an explicit model of the environment, they estimate state values directly from transition samples (state, action, reward, next state). Unfortunately, this approach makes systematic exploration much more challenging. Nevertheless, because model-free methods make up the majority of approaches scalable to large domains, practitioners often ignore the exploration challenges these methods pose and accept the high sample complexity of random exploration. Reward bonuses that promote exploration are one alternative to random walks (e.g., Bellemare et al., 2016; Martin et al., 2017), but none such proposed solutions are widely adopted in the field.
|
| 18 |
+
|
| 19 |
+
In this paper we introduce an algorithm for exploration based on the successor representation (SR). The SR, originally introduced by Dayan (1993), is a representation that generalizes between states using the similarity between their successors, i.e., the similarity between the states that follow the current state given the environment’s dynamics and the agent’s policy. The SR is defined for any problem, it can be learned through temporal-difference learning (Sutton, 1988) and, as we discuss below, it can also be seen as implicitly estimating the transition dynamics of the environment. Our approach is inspired by the substochastic successor representation (SSR), a concept we introduce here. The SSR is defined so that it implicitly counts state visitation, allowing us to use it to encourage exploration. This idea connects representation learning and exploration, two otherwise disjoint areas of research. The SSR allows us to derive an exploration bonus that when applied to model-based RL generates algorithms that perform as well as theoretically sample-efficient algorithms. Importantly, the intuition developed with the SSR assists us in the design of a model-free deep RL algorithm that achieves performance similar to pseudo-count-based methods in hard exploration Atari 2600 games (Bellemare et al., 2016; Ostrovski et al., 2017).
|
| 20 |
+
|
| 21 |
+
# 2 PRELIMINARIES
|
| 22 |
+
|
| 23 |
+
We consider an agent interacting with its environment in a sequential manner. Starting from a state $S _ { 0 } \in \mathcal { S }$ , at each step the agent takes an action $A _ { t } \in \mathcal A$ , to which the environment responds with a state $S _ { t + 1 } \in \mathcal S$ according to a transition probability function $p ( s ^ { \prime } | s , a ) = \operatorname* { P r } ( S _ { t + 1 } = s ^ { \prime } \bar { | } S _ { t } = s , A _ { t } = a )$ , and with a reward signal $R _ { t + 1 } \in \mathbb { R }$ , where $r ( s , a )$ indicates the expected reward for a transition from state $s$ under action $a$ , that is, $r ( s , a ) \doteq \mathbb { E } [ R _ { t } | S _ { t } = s , A _ { t } = a ]$ .
|
| 24 |
+
|
| 25 |
+
The value of a state $s$ when following a policy $\pi$ , $v _ { \pi } ( s )$ , is defined to be the expected sum of discounted rewards from that state: $\begin{array} { r } { v _ { \pi } ( s ) \doteq \mathbb { E } _ { \pi } \Big [ \sum _ { k = t + 1 } ^ { T } \gamma ^ { k - t - 1 } R _ { k } \Big | S _ { t } = s \Big ] } \end{array}$ , with $\gamma$ being the discount factor. When the transition probability function $p$ and the reward function $r$ are known, we can compute $v _ { \pi } ( s )$ recursively by solving the system of equations below (Bellman, 1957):
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
v _ { \pi } ( s ) = \sum _ { a } \pi ( a | s ) \big [ r ( s , a ) + \gamma \sum _ { s ^ { \prime } } p ( s ^ { \prime } | s , a ) v _ { \pi } ( s ^ { \prime } ) \big ] .
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
This equation can also be written in matrix form with $\mathbf { v } _ { \pi }$ , $\mathbf { r } \in \mathbb { R } ^ { | s | }$ and $P _ { \pi } \in \mathbb { R } ^ { | \mathcal { S } | \times | \mathcal { S } | }$ :
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\mathbf { v } _ { \pi } = \mathbf { r } + \gamma P _ { \pi } \mathbf { v } _ { \pi } = ( I - \gamma P _ { \pi } ) ^ { - 1 } \mathbf { r } ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $P _ { \pi }$ is the state to state transition probability function induced by $\pi$ , that is, $P _ { \pi } ( s , s ^ { \prime } ) =$ $\begin{array} { r } { \sum _ { a } \pi ( a | s ) p ( s ^ { \prime } | s , a ) } \end{array}$ .
|
| 38 |
+
|
| 39 |
+
Traditional model-based algorithms for RL work by learning estimates of the matrix $P _ { \pi }$ and of the vector $\mathbf { r }$ and using them to estimate $v _ { \pi }$ , for example by solving Equation 1. We use $\hat { P } _ { \pi }$ and $\hat { \mathbf { r } }$ to denote empirical estimates of $P _ { \pi }$ and $\mathbf { r }$ . Formally,
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\hat { P _ { \pi } } ( s ^ { \prime } | s ) = \frac { n ( s , s ^ { \prime } ) } { n ( s ) } , \hat { \bf r } ( s ) = \frac { C ( s , s ^ { \prime } ) } { n ( s ) } ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\hat { \mathbf { r } } ( i )$ denotes the $i$ -th entry in the vector $\hat { \mathbf { r } }$ , $n ( s , s ^ { \prime } )$ is the number of times the transition $s s ^ { \prime }$ was observed, $\begin{array} { r } { n ( s ) = \sum _ { s ^ { \prime } \in \mathcal { S } } \bar { n } ( s , s ^ { \prime } ) } \end{array}$ , and $C ( s , s ^ { \prime } )$ is the sum of the rewards associated with the $n ( s , s ^ { \prime } )$ transitions (we drop the action in the discussion to simplify notation).
|
| 46 |
+
|
| 47 |
+
Alternatively, in model-free RL, instead of estimating $P _ { \pi }$ and $\mathbf { r }$ we estimate $v _ { \pi } ( s )$ directly from samples. We often use temporal-difference (TD) learning (Sutton, 1988) to update our estimates of $v _ { \pi } ( \bar { s } ) , \hat { v } ( \cdot )$ , online:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\hat { v } ( S _ { t } ) \gets \hat { v } ( S _ { t } ) + \alpha \big [ R _ { t + 1 } + \gamma \hat { v } ( S _ { t + 1 } ) - \hat { v } ( S _ { t } ) \big ] ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\alpha$ is the step-size parameter. Generalization is required in problems with large state spaces, where it is unfeasible to learn an individual value for each state. We do so by parametrizing ${ \hat { v } } ( s )$ with a set of weights $\theta$ . We write, given the weights $\theta$ , $\hat { v } ( s ; \theta ) \approx v _ { \pi } ( s )$ and $\hat { q } ( \dot { s } , \bar { a } ; \theta ) \approx q _ { \pi } ( \bar { s , a } )$ , where $\begin{array} { r } { q _ { \pi } ( s , a ) = r ( s , a ) + \gamma \sum _ { s ^ { \prime } } p ( s ^ { \prime } | s , a ) v _ { \pi } ( s ^ { \prime } ) } \end{array}$ . Model-free methods have performed well in problems with large state spaces, mainly due to the use of neural networks as function approximators (e.g., Mnih et al., 2015).
|
| 54 |
+
|
| 55 |
+
Our algorithm is based on the successor representation (SR; Dayan, 1993). The successor representation, with respect to a policy $\pi$ , $\Psi _ { \pi }$ , is defined as
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\Psi _ { \pi } ( s , s ^ { \prime } ) = \mathbb { E } _ { \pi , p } \Big [ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \mathbb { I } \{ S _ { t } = s ^ { \prime } \} \Big | S _ { 0 } = s \Big ] ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where we assume the sum is convergent with $\mathbb { I }$ denoting the indicator function. Dayan (1993) has shown that this expectation can be estimated from samples through TD learning. It also corresponds to the Neumann series of $\gamma P$ :
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\Psi _ { \pi } = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( P _ { \pi } ) ^ { t } = ( I - \gamma P _ { \pi } ) ^ { - 1 } .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Notice that the SR is part of the solution when computing a value function: $\mathbf { v } _ { \pi } = \Psi _ { \pi } \mathbf { r }$ (Equation 1).
|
| 68 |
+
We use $\hat { \Psi } _ { \pi }$ to denote the SR computed through $\hat { P } _ { \pi }$ , the approximation of $P _ { \pi }$ .
|
| 69 |
+
|
| 70 |
+
The definition of the SR can also be extended to features. Successor features generalize the SR to the function approximation setting (Barreto et al., 2017). We use the definition for the uncontrolled case in this paper. Importantly, the successor features can also be learned with TD learning.
|
| 71 |
+
|
| 72 |
+
Definition 2.1 (Successor Features). For a given $0 \leq \gamma < 1$ , policy $\pi$ , and for a feature representation $\phi ( s ) \in \mathbb { R } ^ { d }$ , the successor features for a state s are:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\psi _ { \pi } ( s ) = \mathbb { E } _ { \pi , p } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \phi ( S _ { t } ) \Bigg | S _ { 0 } = s \right] .
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Alternatively, in matrix form, $\begin{array} { r } { \Psi _ { \pi } = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } ( P _ { \pi } ) ^ { t } \Phi = ( I - \gamma P _ { \pi } ) ^ { - 1 } \Phi } \end{array}$ . Notice that this definition reduces to the SR in the tabular case, where $\Phi = I$ .
|
| 79 |
+
|
| 80 |
+
# 3 THE SUBSTOCHASTIC SUCCESSOR REPRESENTATION
|
| 81 |
+
|
| 82 |
+
In this section we introduce the concept of the substochastic successor representation (SSR). The SSR is derived from an empirical transition matrix similar to Equation 2, but where each state incorporates a small $( 1 / ( n ( s ) + 1 { \bar { ) } } )$ probability of terminating at that state, rather than transiting to a next state. As we will show, we can recover the visit counts $n ( s )$ through algebraic manipulation on the SSR.
|
| 83 |
+
|
| 84 |
+
While computing the SSR is usually impractical, we use it as inspiration in the design of a new deep reinforcement learning algorithm for exploration (Section 4). In a nutshell, we view the SSR as approximating the process of learning the SR from an uninformative initialization (i.e., the zero vector), and using a stochastic update rule. While this approximation is relatively coarse, we believe it gives qualitative justification to our use of the learned SR to guide exploration. To further this claim, we demonstrate that using the SSR in synthetic, tabular settings yields comparable performance to that of theoretically-derived exploration algorithms.
|
| 85 |
+
|
| 86 |
+
Definition 3.1 (Substochastic Successor Representation). Let $\tilde { P _ { \pi } }$ denote the substochastic matrix induced by the environment’s dynamics and by the policy $\pi$ such that $\begin{array} { r } { \tilde { P } _ { \pi } ( s ^ { \prime } | s ) = \frac { n ( s , s ^ { \prime } ) } { n ( s ) + 1 } } \end{array}$ . For a given $0 \leq \gamma < 1$ , the substochastic successor representation, $\tilde { \Psi } _ { \pi }$ , is defined as:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\tilde { \Psi } _ { \pi } = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \tilde { P _ { \pi } } ^ { t } = ( I - \gamma \tilde { P _ { \pi } } ) ^ { - 1 } .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
The theorem below formalizes the idea that the $\ell _ { 1 }$ norm of the SSR implicitly counts state visitation.
|
| 93 |
+
|
| 94 |
+
Theorem 1. Let $n ( s )$ denote the number of times state s has been visited and let $\chi ( s ) = ( 1 + \gamma ) -$ $| | \tilde { \Psi } _ { \pi } ( s ) | | _ { 1 }$ , where $\tilde { \Psi } _ { \pi }$ is the substochastic $S R$ as in Definition 3.1. For a given $0 \leq \gamma < 1$ ,
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\frac { \gamma } { n ( s ) + 1 } - \frac { \gamma ^ { 2 } } { 1 - \gamma } \leq \chi ( s ) \leq \frac { \gamma } { n ( s ) + 1 }
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Proof of Theorem $^ { l }$ . Let $\hat { P } _ { \pi }$ be the empirical transition matrix. We first rewrite $\tilde { P _ { \pi } }$ in terms of $\hat { P _ { \pi } }$ :
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\tilde { P _ { \pi } } ( s , s ^ { \prime } ) = \frac { n ( s , s ^ { \prime } ) } { n ( s ) + 1 } = \frac { n ( s ) } { n ( s ) + 1 } \frac { n ( s , s ^ { \prime } ) } { n ( s ) } = \frac { n ( s ) } { n ( s ) + 1 } \hat { P _ { \pi } } ( s , s ^ { \prime } ) = \Big ( 1 - \frac { 1 } { n ( s ) + 1 } \Big ) \hat { P _ { \pi } } ( s , s ^ { \prime } ) .
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
The expression above can also be written in matrix form: ${ \tilde { P } } _ { \pi } = ( I - N ) { \hat { P } } _ { \pi }$ , where $N \in \mathbb { R } ^ { | \mathcal { S } | \times | \mathcal { S } | }$ denotes the diagonal matrix of augmented inverse counts. Expanding $\tilde { \Psi } _ { \pi }$ we have:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
\tilde { \Psi } _ { \pi } = \sum _ { t = 0 } ^ { \gamma } ( \gamma \tilde { P _ { \pi } } ) ^ { t } = I + \gamma \tilde { P _ { \pi } } + \sum _ { t = 2 } ^ { \infty } ( \gamma \tilde { P _ { \pi } } ) ^ { t } = I + \gamma \tilde { P _ { \pi } } + \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
The top eigenvector of a stochastic matrix is the all-ones vector, e (Meyn & Tweedie, 2012), and it corresponds to the eigenvalue 1. Using this fact and the definition of $\tilde { P _ { \pi } }$ with respect to $\hat { P } _ { \pi }$ we have:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\begin{array} { r l r } { ( I + \gamma \tilde { P _ { \pi } } ) \mathbf { e } + \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } \mathbf { e } } & { = } & { \bigl ( I + \gamma ( I - N ) \hat { P _ { \pi } } \bigr ) \mathbf { e } + \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } \mathbf { e } } \\ & { = } & { ( I + \gamma ) \mathbf { e } - \gamma N \mathbf { e } + \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } \mathbf { e } . } \end{array}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
We can now bound the term $\gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } \mathbf { e }$ using the fact that $\mathbf { e }$ is also the top eigenvector of the successor representation and has eigenvalue $\frac { 1 ^ { - } } { 1 - \gamma }$ (Machado et al., 2018b):
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
0 \leq \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } { \bf e } \leq \frac { \gamma ^ { 2 } } { 1 - \gamma } { \bf e } .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
Plugging (5) into the definition of $\chi$ we have (notice that $\Psi ( s ) \mathbf { e } = | | \Psi ( s ) | | _ { 1 } )$ :
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\chi ( s ) = ( 1 + \gamma ) \mathbf { e } - ( 1 + \gamma ) \mathbf { e } + \gamma N \mathbf { e } - \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } \mathbf { e } \ = \ \gamma N \mathbf { e } - \gamma ^ { 2 } \tilde { P _ { \pi } } ^ { 2 } \tilde { \Psi } _ { \pi } \mathbf { e } \ \leq \ \gamma N \mathbf { e } .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
When we also use the other bound on the quadratic term we conclude that, for any state $s$ ,
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\frac { \gamma } { n ( s ) + 1 } - \frac { \gamma ^ { 2 } } { 1 - \gamma } \leq \chi ( s ) \leq \frac { \gamma } { n ( s ) + 1 } .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
In other words, the SSR, obtained after a slight change to the SR, can be used to recover state visitation counts. The intuition behind this result is that the phantom transition, represented by the $+ 1$ in the denominator of the SSR, serves as a proxy for the uncertainty about that state by underestimating the SR. This is due to the fact that $\sum _ { s ^ { \prime } } \tilde { P _ { \pi } } ( s , s ^ { \prime } )$ gets closer to 1 each time state $s$ is visited.
|
| 137 |
+
|
| 138 |
+
This result can now be used to convert the SSR into a reward function in the tabular case. We do so by using the SSR to define an exploration bonus, $r _ { \mathrm { i n t } }$ , such that the reward being maximized by the agent becomes $r ( s , a ) + \beta r _ { \mathrm { i n t } } ( s )$ , where $\beta$ is a scaling parameter. Since we want to incentivize agents to visit the least visited states as quickly as possible, we can trivially define $\mathbf { r } _ { \mathrm { i n t } } = - | | \tilde { \Psi } _ { \boldsymbol { \pi } } ( s ) | | _ { 1 }$ , where we penalize the agent by visiting the states that lead to commonly visited states. Notice that the shift $( 1 + \gamma )$ in $\chi ( s )$ has no effect as an exploration bonus because it is the same across all states.
|
| 139 |
+
|
| 140 |
+
Table 1: Comparison between our algorithm, termed ESSR, and R-MAX, $\mathrm { E ^ { 3 } }$ , and MBIE. The numbers reported for R-MAX, $\mathrm { E ^ { 3 } }$ , and MBIE are an estimate obtained from the histograms presented by Strehl & Littman (2008). The performance of our algorithm is the average over 100 runs. A $9 5 \%$ confidence interval is reported between parentheses.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>E</td><td rowspan=1 colspan=1>R-MAX</td><td rowspan=1 colspan=1>MBIE</td><td rowspan=1 colspan=1>ESSR</td></tr><tr><td rowspan=1 colspan=1>RIVERSWIM</td><td rowspan=1 colspan=1>3,000,000</td><td rowspan=1 colspan=1>3,000,000</td><td rowspan=1 colspan=1>3,250,000</td><td rowspan=1 colspan=1>3,088,924 (± 57,584)</td></tr><tr><td rowspan=1 colspan=1>SIXARMS</td><td rowspan=1 colspan=1>1,800,000</td><td rowspan=1 colspan=1>2,800,000</td><td rowspan=1 colspan=1>9,250,000</td><td rowspan=1 colspan=1>7,327,222 (± 1,189,460)</td></tr></table>
|
| 143 |
+
|
| 144 |
+
# EVALUATING $- | | \tilde { \Psi } _ { \pi } ( s ) | | _ { 1 }$ AS AN EXPLORATION BONUS
|
| 145 |
+
|
| 146 |
+
We evaluated the effectiveness of the proposed exploration bonus in a standard model-based algorithm. In our implementation the agent updates its transition probability model and reward model through Equation 2 and its SSR estimate as in Definition 3.1 (the pseudo-code of this algorithm is available in the Appendix), which is then used for the exploration bonus $r _ { \mathrm { i n t } }$ . We used the domains RiverSwim and SixArms (Strehl & Littman, 2008) to assess the performance of this algorithm.2 These are traditional domains in the PAC-MDP literature (Kakade, 2003) and are often used to evaluate provably sampleefficient algorithms. Details about these environments are also available in the Appendix. We used the same protocol used by Strehl & Littman (2008). Our results are available in Table 1. It is interesting to see that our algorithm performs as well as R-MAX (Brafman & Tennenholtz, 2002) and $\mathrm { E ^ { 3 } }$ (Kearns & Singh, 2002) on RiverSwim and it clearly outperforms these algorithms on SixArms.
|
| 147 |
+
|
| 148 |
+
# 4 COUNTING FEATURE ACTIVATIONS WITH THE SR
|
| 149 |
+
|
| 150 |
+
In large environments, where enumerating all states is not an option, directly using the SSR as described in the previous section is not viable. Learning the SSR becomes even more challenging when the representation, $\phi ( \cdot )$ , is also being learned and so is non-stationary. In this section we design an algorithm for the function approximation setting inspired by the results from the previous section.
|
| 151 |
+
|
| 152 |
+
Since explicitly estimating the transition probability function is not an option, we learn the SR directly using TD learning. In order to capture the SSR we rely on TD’s tendency to underestimate values when the estimates are pessimistically initialized, just as the SSR underestimates the true successor representation; with larger underestimates for states (and similarly features) that are rarely observed. This is mainly due to the fact that when the SR is being learned with TD learning, because a reward of 1 is observed at each time step, there is no variance in the target and the predictions slowly approach the true value of the SR. When pessimistically initialized, the predictions approach the target from below. In this sense, what defines how far a prediction is from its final target is indeed how many times it has been updated in a given state. Finally, recent work (Kulkarni et al., 2016; Machado et al., 2018b) have shown successor features can be learned jointly with the feature representation itself. These ideas are combined together to create our algorithm.
|
| 153 |
+
|
| 154 |
+
The neural network we used to learn the agent’s value function while also learning the feature representation and the successor representation is depicted in Figure 1. The layers used to compute the state-action value function, $\hat { q } ( S _ { t } , \cdot )$ , are structured as in DQN (Mnih et al., 2015), but with different numbers of parameters (i..e, filter sizes, stride, and number of nodes). This was done to match Oh et al.’s (2015) architecture, which is known to succeed in the auxiliary task we define below. From here on, we will call the part of our architecture that predicts $\hat { q } ( S _ { t } , \cdot ) \dot { Ḋ \mathbf Ḋ \mathrm Ḋ \mathrm Ḋ \mathrm Ḋ \Gamma Ḍ Ḍ Ḍ } $ . It is trained to minimize
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\mathcal { L } _ { \mathrm { T D } } = \mathbb { E } \Big [ \big ( ( 1 - \tau ) \delta ( s , a ) + \tau \delta _ { \mathrm { M C } } ( s , a ) \big ) ^ { 2 } \Big ] ,
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
|
| 162 |
+
Figure 1: Neural network architecture used by our algorithm when learning to play Atari 2600 games.
|
| 163 |
+
|
| 164 |
+
where $\delta ( s , a )$ and $\delta _ { \mathrm { M C } } ( s , a )$ are defined as
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\begin{array} { r l r } & { } & { \delta ( s , a ) = R _ { t } + \beta r _ { \mathrm { i n t } } ( s ; \theta ^ { - } ) + \gamma \operatorname* { m a x } _ { a ^ { \prime } } q ( s ^ { \prime } , a ^ { \prime } ; \theta ^ { - } ) - q ( s , a ; \theta ) , } \\ & { } & { \delta _ { \mathrm { M C } } ( s , a ) = \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } \Big ( r ( S _ { t } , A _ { t } ) + \beta r _ { \mathrm { i n t } } ( S _ { t } ; \theta ^ { - } ) \Big ) - q ( s , a ; \theta ) . } \end{array}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
This loss is known as the mixed Monte-Carlo return (MMC) and it has been used in the past by the algorithms that achieved succesful exploration in deep reinforcement learning (Bellemare et al., 2016; Ostrovski et al., 2017). The distinction between $\theta$ and $\theta ^ { - }$ is standard in the field, with $\theta ^ { - }$ denoting the parameters of the target network, which is updated less often for stability purposes (Mnih et al., 2015). As before, we use $r _ { \mathrm { i n t } }$ to denote the exploration bonus obtained from the successor features of the internal representation, $\phi ( \cdot )$ , which will be defined below. Moreover, to ensure all features are in the same range, we normalize the feature vector so that $| | \phi ( \cdot ) | | _ { 2 } = 1$ . In Figure 1 we highlight the layer in which we normalize its output with the symbol $\phi$ . Notice that the features are always non-negative due to the use of ReLU gates.
|
| 171 |
+
|
| 172 |
+
The successor features are computed by the two bottom layers of the network, which minimize the loss
|
| 173 |
+
|
| 174 |
+
$$
|
| 175 |
+
\mathcal { L } _ { \mathrm { { S R } } } = \mathbb { E } _ { \pi , p } \Big [ \big ( \phi ( S _ { t } ; \theta ^ { - } ) + \gamma \psi ( S _ { t + 1 } ; \theta ^ { - } ) - \psi ( S _ { t } ; \theta ) \big ) ^ { 2 } \Big ] .
|
| 176 |
+
$$
|
| 177 |
+
|
| 178 |
+
Zero is a fixed point for the SR. This is particularly concerning in settings with sparse rewards. The agent might learn to set $\phi ( \cdot ) = \vec { 0 }$ to achieve zero loss. We address this problem by not propagating $\nabla \mathcal { L } _ { \mathrm { s R } }$ to $\phi ( \cdot )$ (this is depicted in Figure 1 as an open circle stopping the gradient), and by creating an auxiliary task (Jaderberg et al., 2017) to encourage a representation to be learned before a non-zero reward is observed. As Machado et al. (2018b), we use the auxiliary task of predicting the next observation, learned through the architecture proposed by Oh et al. (2015), which is depicted as the top layers in Figure 1. The loss we minimize for this last part of the network is $\mathcal { L } _ { \mathrm { R e c o n s } } = \left( \hat { S } _ { t + 1 } - S _ { t + 1 } \right) ^ { 2 }$
|
| 179 |
+
|
| 180 |
+
The overall loss minimized by the network is $\mathcal { L } = w _ { \mathrm { { T D } } } \mathcal { L } _ { \mathrm { { T D } } } + w _ { \mathrm { { S R } } } \mathcal { L } _ { \mathrm { { S R } } } + w _ { \mathrm { { R e c o n s } } } \mathcal { L } _ { \mathrm { { R e c o n s } } } .$
|
| 181 |
+
|
| 182 |
+
The last step in describing our algorithm is to define $r _ { \mathrm { i n t } } ( S _ { t } ; \theta ^ { - } )$ , the intrinsic reward we use to encourage exploration. We choose the exploration bonus to be the inverse of the $\ell _ { 2 }$ -norm of the vector of successor features of the current state, that is,
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
r _ { \mathrm { i n t } } ( S _ { t } ; \theta ^ { - } ) = \frac { 1 } { | | \psi ( S _ { t } ; \theta ^ { - } ) | | _ { 2 } } ,
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
where $\psi ( S _ { t } ; \theta ^ { - } )$ denotes the successor features of state $S _ { t }$ parametrized by $\theta ^ { - }$ . The exploration bonus comes from the same intuition presented in the previous section, but instead of penalizing the agent with the norm of the SR we make $r _ { \mathrm { i n t } } ( S _ { t } ; \theta ^ { - } )$ into a bonus (we observed in preliminary experiments not discussed here that DQN performs better when dealing with positive rewards). Moreover, instead of using the $\ell _ { 1 }$ -norm we use the $\ell _ { 2 }$ -norm of the SR since our features have unit length in $\ell _ { 2 }$ (whereas the successor probabilities in the tabular-case have unit length in $\ell _ { 1 }$ ).
|
| 189 |
+
|
| 190 |
+
Finally, we initialize our network the same way Oh et al. (2015) does. We use Xavier initialization (Glorot & Bengio, 2010) in all layers except the fully connected layers around the element-wise multiplication denoted by $\otimes$ , which are initialized uniformly with values between $- 0 . 1$ and 0.1.
|
| 191 |
+
|
| 192 |
+
Table 2: Performance of the proposed algorithm, $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ , compared to various agents on the “hard exploration” subset of Atari 2600 games. The DQN results reported are from Machado et al. (2018a) while the $\mathrm { D Q N ^ { M M C } + C T S }$ and DQNMMC $+$ PixelCNN results were extracted from the learning curves available in Ostrovski et al.’s (2017) work. $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ denotes another baseline used in the comparison. When available, standard deviations are reported between parentheses. See text for details.
|
| 193 |
+
|
| 194 |
+
<table><tr><td></td><td>DQN</td><td>DQNMMC+CTS</td><td>DQNMMC+PIXELCNN</td><td>DQNMMC</td><td></td><td>DQNMMC+ e</td><td>+SR</td></tr><tr><td>FREEWAY</td><td>32.4 (0.3)</td><td>29.2</td><td>29.4</td><td>29.5</td><td>(0.1)</td><td>29.5</td><td>(0.1)</td></tr><tr><td>GRAVITAR</td><td>118.5 (22.0)</td><td>199.8</td><td>275.4</td><td>1078.3</td><td>(254.1)</td><td>430.3</td><td>(109.4)</td></tr><tr><td>MONT.REV.</td><td>0.0 (0.0)</td><td>2941.9</td><td>1671.7</td><td>0.0</td><td>(0.0)</td><td>1778.6</td><td>(903.6)</td></tr><tr><td>PRIVATE EYE</td><td>1447.4 (2,567.9)</td><td>32.8</td><td>14386.0</td><td>113.4</td><td>(42.3)</td><td>99.1</td><td>(1.8)</td></tr><tr><td>SOLARIS</td><td>783.4 (55.3)</td><td>1147.1</td><td>2279.4</td><td>2244.6</td><td>(378.8)</td><td>2155.7</td><td>(398.3)</td></tr><tr><td>VENTURE</td><td>4.4 (5.4)</td><td>0.0</td><td>856.2</td><td>1220.1</td><td>(51.0)</td><td>1241.8</td><td>(236.0)</td></tr></table>
|
| 195 |
+
|
| 196 |
+
# 5 EMPIRICAL EVALUATION OF EXPLORATION IN DEEP RL
|
| 197 |
+
|
| 198 |
+
We evaluated our algorithm on the Arcade Learning Environment (Bellemare et al., 2013). Following Bellemare et al.’s (2016) taxonomy, we evaluated our algorithm in the Atari 2600 games with sparse rewards that pose hard exploration problems. They are: FREEWAY, GRAVITAR, MONTEZUMA’S REVENGE, PRIVATE EYE, SOLARIS, and VENTURE.3
|
| 199 |
+
|
| 200 |
+
We followed the evaluation protocol proposed by Machado et al. (2018a). We used MONTEZUMA’S REVENGE to tune our parameters (training set). The reported results are the average over 10 seeds after 100 million frames. We evaluated our agents in the stochastic setting (sticky actions, $\varsigma = 0 . 2 5 )$ ) using a frame skip of 5 with the full action set $| \mathcal { A } | = 1 8 )$ ). The agent learns from raw pixels, that is, it uses the game screen as input.
|
| 201 |
+
|
| 202 |
+
Our results were obtained with the algorithm described in Section 4. We set $\beta = 0 . 0 2 5$ after a rough sweep over values in the game MONTEZUMA’S REVENGE. We annealed $\epsilon$ in DQN’s $\epsilon$ -greedy exploration over the first million steps, starting at 1.0 and stopping at 0.1 as done by Bellemare et al. (2016). We trained the network with RMSprop with a step-size of 0.00025, an $\epsilon$ value of 0.01, and a decay of 0.95, which are the standard parameters for training DQN (Mnih et al., 2015). The discount factor, $\gamma$ , is set to 0.99 and $w _ { \mathrm { T D } } = 1$ , $w _ { \mathrm { S R } } = 1 0 0 0$ , ${ w _ { \mathrm { R e c o n s } } = 0 . 0 0 1 }$ . The weights $w _ { \mathrm { T D } }$ , $w _ { \tt S R }$ , and $w _ { \mathrm { R e c o n s } }$ were set so that the loss functions would be roughly the same scale. All other parameters are the same as those used by Mnih et al. (2015).
|
| 203 |
+
|
| 204 |
+
Table 2 summarizes the results after 100 million frames. The performance of other algorithms is also provided for reference. Notice we are reporting learning performance for all algorithms instead of the maximum scores achieved by the algorithm. We use the superscript MMC to distinguish between the algorithms that use MMC from those that do not. When comparing our algorithm, $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ , to DQN we can see how much our approach improves over the most traditional baseline. By comparing our algorithm’s performance to $\mathrm { \bar { D Q N } ^ { M M C } + \bar { C } T S }$ (Bellemare et al., 2016) and $\mathrm { D Q N ^ { M M C } }$ +PixelCNN (Ostrovski et al., 2017) we compare our algorithm to established baselines for exploration. As highlighted in Section 4, the parameters of the network we used are different from those used in the traditional DQN network, so we also compared the performance of our algorithm to the performance of the same network our algorithm uses but without the additional modules (next state prediction and successor representation) by setting $w _ { \mathrm { S R } } = w _ { \mathrm { R e c o n s } } = 0$ and without the intrinsic reward bonus by setting $\beta = 0 . 0$ . The column labeled $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ contains the results for this baseline. This comparison allows us to explicitly quantify the improvement provided by the proposed exploration bonus. The learning curves of these algorithms, their performance after different amounts of experience, and additional results analyzing, for example, the impact of the introduced auxiliary task, are available in the Appendix.
|
| 205 |
+
|
| 206 |
+
We can clearly see that our algorithm achieves scores much higher than those achieved by DQN, which struggles in games that pose hard exploration problems. Moreover, by comparing $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ to $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ we can see that the provided exploration bonus has a big impact in the game MONTEZUMA’S REVENGE, which is probably known as the hardest game among those we used in our evaluation. Interestingly, the change in architecture and the use of MMC leads to a big improvement in games such as GRAVITAR and VENTURE, which we cannot fully explain. However, notice that the change in architecture does not have any effect in MONTEZUMA’S REVENGE. The proposed exploration bonus seems to be essential in this game. Finally, we also compared our algorithm to $\mathrm { D Q N ^ { \bar { M } M C } + C T S }$ and DQNMMC+PixelCNN. We can observe that, on average, it performs as well as these algorithms, but instead of requiring a density model it requires the SR, which is already defined for every problem since it is a component of the value function estimates, as discussed in Section 2.
|
| 207 |
+
|
| 208 |
+
# 6 RELATED WORK
|
| 209 |
+
|
| 210 |
+
There are multiple algorithms in the tabular, model-based case with guarantees about their performance (e.g., Brafman & Tennenholtz, 2002; Kearns & Singh, 2002; Strehl & Littman, 2008; Osband et al., 2016). RiverSwim and SixArms are domains traditionally used when evaluating these algorithms. In this paper we have given evidence that our algorithm performs as well as some of these algorithms with theoretical guarantees. Among these algorithms, R-MAX seems the closest approach to ours. As with R-MAX, the algorithm we presented in Section 3 augments the state-space with an imaginary state and encourages the agent to visit that state, implicitly reducing the algorithm’s uncertainty in the state-space. However, R-MAX deletes the transition to this imaginary state once a state has been visited a given number of times. Ours lets the probability of visiting this imaginary state vanish with additional visitations. Moreover, notice that it is not clear how to apply these traditional algorithms such as R-MAX and $\mathrm { E ^ { 3 } }$ to large domains where function approximation is required.
|
| 211 |
+
|
| 212 |
+
Conversely, there are not many model-free approaches with proven sample-complexity bounds (e.g., Strehl et al., 2006), but there are multiple model-free algorithms for exploration that actually work in large domains (e.g., Stadie et al., 2015; Bellemare et al., 2016; Ostrovski et al., 2017; Plappert et al., 2018). Among these algorithms, the use of pseudo-counts through density models is the closest to ours (Bellemare et al., 2016; Ostrovski et al., 2017). Inspired by those papers we used the mixed Monte-Carlo return as a target in the update rule. In Section 5 we have shown that our algorithm performs generally as well as these approaches without requiring a density model. Importantly, Martin et al. (2017) had already shown that counting activations of fixed, handcrafted features in Atari 2600 games leads to good exploration behavior. Nevertheless, by using the SSR we are not only counting learned features but we are also implicitly capturing the induced transition dynamics.
|
| 213 |
+
|
| 214 |
+
Finally, the SR has already been used in the context of exploration. However, it was used to help the agent learn how to act in a higher level of abstraction in order to navigate through the state space faster (Machado et al., 2017; 2018b). Such an approach has led to promising results in the tabular case but only anecdotal evidence about its scalability has been provided when the idea was applied to large domains such as Atari 2600 games. Importantly, the work developed by Machado et al. (2018b), Kulkarni et al. (2016) and Oh et al. (2015) are the main motivation for the neural network architecture presented here. Oh et al. (2015) have shown how one can predict the next screen given the current observation and action (our auxiliary task), while Machado et al. (2018b) and Kulkarni et al. (2016) have proposed different architectures for learning the successor representation from raw pixels.
|
| 215 |
+
|
| 216 |
+
# 7 CONCLUSION
|
| 217 |
+
|
| 218 |
+
RL algorithms tend to have high sample complexity, which often prevents them from being used in the real-world. Poor exploration strategies is one of the main reasons for this high sample-complexity. Despite all of its shortcomings, uniform random exploration is, to date, the most commonly used approach for exploration. This is mainly due to the fact that most approaches for tackling the exploration problem still rely on domain-specific knowledge (e.g., density models, handcrafted features), or on having an agent learn a perfect model of the environment. In this paper we introduced a general method for exploration in RL that implicitly counts state (or feature) visitation in order to guide the exploration process. It is compatible to representation learning and the idea can also be adapted to be applied to large domains.
|
| 219 |
+
|
| 220 |
+
This result opens up multiple possibilities for future work. Based on the results presented in Section 3, for example, we conjecture that the substochastic successor representation can be actually used to generate algorithms with PAC-MDP bounds. Investigating to what extent different auxiliary tasks impact the algorithm’s performance, and whether simpler tasks such as predicting feature activations or parts of the input (Jaderberg et al., 2017) are effective is also worth studying. Finally, it might be interesting to further investigate the connection between representation learning and exploration, since it is also known that better representations can lead to faster exploration (Jiang et al., 2017).
|
| 221 |
+
|
| 222 |
+
# REFERENCES
|
| 223 |
+
|
| 224 |
+
Andre Barreto, Will Dabney, R ´ emi Munos, Jonathan Hunt, Tom Schaul, David Silver, and Hado ´ van Hasselt. Successor Features for Transfer in Reinforcement Learning. In Advances in Neural Information Processing Systems (NIPS), pp. 4058–4068, 2017.
|
| 225 |
+
|
| 226 |
+
Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An Evaluation Platform for General Agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 227 |
+
|
| 228 |
+
Marc G. Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi ´ Munos. Unifying Count-Based Exploration and Intrinsic Motivation. In Advances in Neural Information Processing Systems (NIPS), pp. 1471–1479, 2016.
|
| 229 |
+
|
| 230 |
+
Richard E. Bellman. Dynamic Programming. Princeton University Press, Princeton, NJ, 1957.
|
| 231 |
+
|
| 232 |
+
Ronen I. Brafman and Moshe Tennenholtz. R-MAX - A General Polynomial Time Algorithm for Near-Optimal Reinforcement Learning. Journal of Machine Learning Research, 3:213–231, 2002.
|
| 233 |
+
|
| 234 |
+
Peter Dayan. Improving Generalization for Temporal Difference Learning: The Successor Representation. Neural Computation, 5(4):613–624, 1993.
|
| 235 |
+
|
| 236 |
+
Xavier Glorot and Yoshua Bengio. Understanding the Difficulty of Training Deep Feedforward Neural Networks. In Proceedings of the International Conference on Artificial Intelligence and Statistics (AISTATS), pp. 249–256, 2010.
|
| 237 |
+
|
| 238 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z. Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement Learning with Unsupervised Auxiliary Tasks. In Proceedings of the International Conference on Learning Representations (ICLR), 2017.
|
| 239 |
+
|
| 240 |
+
Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E. Schapire. Contextual Decision Processes with Low Bellman Rank are PAC-Learnable. In Proceedings of the International Conference on Machine Learning (ICML), pp. 1704–1713, 2017.
|
| 241 |
+
|
| 242 |
+
Sham Kakade. On the Sample Complexity of Reinforcement Learning. PhD thesis, Gatsby Computational Neuroscience Unit, University College London, 2003.
|
| 243 |
+
|
| 244 |
+
Michael J. Kearns and Satinder P. Singh. Near-Optimal Reinforcement Learning in Polynomial Time. Machine Learning, 49(2-3):209–232, 2002.
|
| 245 |
+
|
| 246 |
+
Tejas D. Kulkarni, Ardavan Saeedi, Simanta Gautam, and Samuel J. Gershman. Deep Successor Reinforcement Learning. CoRR, abs/1606.02396, 2016.
|
| 247 |
+
|
| 248 |
+
Marlos C. Machado, Marc G. Bellemare, and Michael Bowling. A Laplacian Framework for Option Discovery in Reinforcement Learning. In Proceedings of the International Conference on Machine Learning (ICML), pp. 2295–2304, 2017.
|
| 249 |
+
|
| 250 |
+
Marlos C. Machado, Marc G. Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the Arcade Learning Environment: Evaluation Protocols and Open Problems for General Agents. Journal of Artificial Intelligence Research, 61:523–562, 2018a.
|
| 251 |
+
|
| 252 |
+
Marlos C. Machado, Clemens Rosenbaum, Xiaoxiao Guo, Miao Liu, Gerald Tesauro, and Murray Campbell. Eigenoption Discovery through the Deep Successor Representation. In Proceedings of the International Conference on Learning Representations (ICLR), 2018b.
|
| 253 |
+
|
| 254 |
+
Jarryd Martin, Suraj Narayanan Sasikumar, Tom Everitt, and Marcus Hutter. Count-Based Exploration in Feature Space for Reinforcement Learning. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), pp. 2471–2478, 2017.
|
| 255 |
+
|
| 256 |
+
Sean P Meyn and Richard L Tweedie. Markov Chains and Stochastic Stability. 2012.
|
| 257 |
+
|
| 258 |
+
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:529–533, 2015.
|
| 259 |
+
|
| 260 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L. Lewis, and Satinder P. Singh. ActionConditional Video Prediction using Deep Networks in Atari Games. In Advances in Neural Information Processing Systems (NIPS), pp. 2863–2871, 2015.
|
| 261 |
+
|
| 262 |
+
Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and Exploration via Randomized Value Functions. In Proceedings of the International Conference on Machine Learning (ICML), pp. 2377–2386, 2016.
|
| 263 |
+
|
| 264 |
+
Georg Ostrovski, Marc G. Bellemare, Aaron van den Oord, and Remi Munos. Count-Based Explo- ´ ration with Neural Density Models. In Proceedings of the International Conference on Machine Learning (ICML), pp. 2721–2730, 2017.
|
| 265 |
+
|
| 266 |
+
Matthias Plappert, Rein Houthooft, Prafulla Dhariwal, Szymon Sidor, Richard Y. Chen, Xi Chen, Tamim Asfour, Pieter Abbeel, and Marcin Andrychowicz. Parameter Space Noise for Exploration. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 267 |
+
|
| 268 |
+
Bradly C. Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing Exploration in Reinforcement Learning With Deep Predictive Models. CoRR, abs/1507.00814, 2015.
|
| 269 |
+
|
| 270 |
+
Alexander L. Strehl and Michael L. Littman. An Analysis of Model-based Interval Estimation for Markov Decision Processes. Journal of Computer and System Sciences, 74(8):1309–1331, 2008.
|
| 271 |
+
|
| 272 |
+
Alexander L. Strehl, Lihong Li, Eric Wiewiora, John Langford, and Michael L. Littman. PAC Model-Free Reinforcement Learning. In Proceedings of the International Conference on Machine Learning (ICML), pp. 881–888, 2006.
|
| 273 |
+
|
| 274 |
+
Richard S. Sutton. Learning to Predict by the Methods of Temporal Differences. Machine Learning, 3:9–44, 1988.
|
| 275 |
+
|
| 276 |
+
Gerald Tesauro. Temporal Difference Learning and TD-Gammon. Communications of the ACM, 38 (3):58–68, 1995.
|
| 277 |
+
|
| 278 |
+
# Supplemental Material Count-Based Exploration with the Successor Representation
|
| 279 |
+
|
| 280 |
+
This supplementary material contains details omitted from the main text due to space constraints. The list of contents is below:
|
| 281 |
+
|
| 282 |
+
• Pseudo-code of the model-based algorithm discussed in Section 3;
|
| 283 |
+
• Description of RiverSwim and SixArms, the tabular domains we used in our evaluation;
|
| 284 |
+
• Learning curves of $\mathrm { D Q N } _ { e }$ and $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ and their performance after different amounts of experience in the Atari 2600 games used for evaluation; Results of additional experiments designed to evaluate the role of the auxiliary task in the results reported in the paper for ESSR.
|
| 285 |
+
|
| 286 |
+
# EXPLORATION THROUGH THE SUBSTOCHASTIC SUCCESSOR REPRESENTATION
|
| 287 |
+
|
| 288 |
+
In the main paper we described our algorithm as a standard model-based algorithm where the agent updates its transition probability model and reward model through Equation 2 and its SSR estimate as in Definition 3.1. The pseudo-code with details about the implementation is presented in Algorithm 1.
|
| 289 |
+
|
| 290 |
+
<table><tr><td colspan="2">Algorithm1Exploration through the Substochastic Successor Representation (ESSR)</td></tr><tr><td>n(s,s')←0 ∀s,s'∈S</td><td></td></tr><tr><td>t(s,a,s')←1</td><td>∀s,s'∈S,∀a∈A</td></tr><tr><td>r(s,a)←0</td><td>∀s∈S,∀a∈A</td></tr><tr><td>P(s,a)←1/|Sl</td><td>∀s∈S,∀a∈A</td></tr><tr><td>P(s,s')←0</td><td>As,s'∈S</td></tr><tr><td colspan="2">T←random over A</td></tr><tr><td colspan="2">while episode is not over do Observe s E S, take action a E A selected according to π(s),and observe a reward R and a</td></tr><tr><td colspan="2">next state s' ∈ S n(s,s')← n(s,s')+1</td></tr><tr><td colspan="2">t(s,a,s')←t(s,a,s')+1</td></tr><tr><td colspan="2">n(s)←∑x',bt(s,b,x')</td></tr><tr><td colspan="2">n(s,a)←∑x,t(s,a,x')</td></tr><tr><td colspan="2">r(s,a,s') ← (t(s,a,s)-2)xf(s,a,s')+R</td></tr><tr><td colspan="2">t(s,a,s')-1 for each state x' ∈ Sdo</td></tr><tr><td colspan="2">P(s,a,x')← t(s,a,x')</td></tr><tr><td colspan="2">n(s,a) n(s,x')</td></tr><tr><td colspan="2">P(s,x')← n(s)+1</td></tr><tr><td colspan="2">end for √←(I-γP)-1</td></tr><tr><td colspan="2">rint←-e</td></tr><tr><td colspan="2">T ← POLICYITERATION(P,𝑟+ βrint)</td></tr><tr><td colspan="2">end while</td></tr></table>
|
| 291 |
+
|
| 292 |
+
# DESCRIPTION OF RIVERSWIM AND SIXARMS
|
| 293 |
+
|
| 294 |
+
The two domains we used as testbed to evaluate the proposed model-based algorithm with the exploration bonus generated by the substochastic successor representation are shown in Figure 2. These domains are the same used by Strehl & Littman (2008). For SixArms, the agent starts in state 0. For RiverSwim, the agent starts in either state 1 or 2 with equal probability.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 2: Domains used as testbed in the tabular case. The tuples in each transition should be read as haction id, probability, rewardi. See text for details.
|
| 298 |
+
|
| 299 |
+
# EVALUATION THE IMPACT OF THE AUXILIARY TASK IN ESSR
|
| 300 |
+
|
| 301 |
+
The algorithm we introduced in the paper, ESSR, relies on a network that estimates the state-action value function, the successor representation, and the next observation to be seen given the agent’s current observation and action. While the results depicted in Table 2 allow us to clearly see the benefit of using an exploration bonus derived from the successor representation, they do not inform us about the impact of the auxiliary task in the results. The experiments in this section aim at addressing this issue. We focus on Montezumas Revenge because it is the game where the problem of exploration is maximized, with most algorithms not being able to do anything without an exploration bonus.
|
| 302 |
+
|
| 303 |
+
The first question we asked was whether the auxiliary task was necessary in our algorithm. We evaluated this by dropping the reconstruction module from the network to test whether the initial random noise generated by the successor representation is enough to drive representation learning. It is not. When dropping the auxiliary task, the average performance of this baseline over 4 seeds in MONTEZUMA’S REVENGE after 100 million frames was 100.0 points $\textstyle \cdot \sigma ^ { 2 } = 2 0 0 . 0$ ; min: 0.0, max: 400.0). As comparison, our algorithm obtains 1778.6 points $\cdot \sigma ^ { 2 } = 9 0 3 . 6$ , min: 400.0, max: 2500.0). These results suggest that auxiliary tasks seem to be necessary for our method to perform well.
|
| 304 |
+
|
| 305 |
+
We also evaluated whether the auxiliary task was sufficient to generate the results we observed. To do so we dropped the SR module and set $\beta = 0 . 0$ to evaluate whether our exploration bonus was actually improving the agent’s performance or whether the auxiliary task was doing it. The exploration bonus seems to be essential in our algorithm. When dropping the exploration bonus and the successor representation module, the average performance of this baseline over 4 seeds in MONTEZUMA’S REVENGE after 100 million frames was 398.5 points $\sigma ^ { 2 } = 2 3 0 . 1$ ; min: 0.0, max: 400.0). Again, clearly, the auxiliary task is not a sufficient condition for the performance we report.
|
| 306 |
+
|
| 307 |
+
The reported results use the same parameters as those reported in the main paper. Learning curves for each individual run are depicted in Figure 3.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 3: Evaluation of the sufficiency and necessity of the auxiliary task in $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } { + } \mathrm { S R }$ . The learning curves are smoothed with a running average computed using a window of size 100.
|
| 311 |
+
|
| 312 |
+
ADDITIONAL RESULTS FOR $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ AND $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ IN THE ATARI 2600 GAMES
|
| 313 |
+
|
| 314 |
+
As recommended by Machado et al. (2018a), we report the performance of $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ and $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ after different amounts of experience (10, 50, and 100 million frames) in Tables 3 and 4.
|
| 315 |
+
|
| 316 |
+
Finally, Figure 4 depicts the learning curves obtained with the evaluated algorithms in each game. Lighter lines represent individual runs while the solid lines encode the average over the multiple runs.
|
| 317 |
+
Table 3: Results obtained with $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ after different amounts of experience.
|
| 318 |
+
|
| 319 |
+
<table><tr><td>Game</td><td>10Mframes</td><td>50M frames</td><td>100M frames</td></tr><tr><td>FREEWAY</td><td>24.9 (0.5)</td><td>29.5 (0.1)</td><td>29.5 (0.1)</td></tr><tr><td>GRAVITAR</td><td>244.1 (23.8)</td><td>326.4 (53.0)</td><td>430.3 (109.4)</td></tr><tr><td>MONT.REVENGE</td><td>2.6 (7.2)</td><td>563.8 (465.7)</td><td>1778.6 (903.6)</td></tr><tr><td>PRIVATEEYE</td><td>99.2 (1.2)</td><td>98.5 (3.3)</td><td>99.1 (1.8)</td></tr><tr><td>SOLARIS</td><td>1547.5 (410.9)</td><td>2036.3 (339.0)</td><td>2155.7 (398.3)</td></tr><tr><td>VENTURE</td><td>26.2 (22.1)</td><td>942.0 (423.8)</td><td>1241.8 (236.0)</td></tr></table>
|
| 320 |
+
|
| 321 |
+
Table 4: Results obtained with $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ after different amounts of experience.
|
| 322 |
+
|
| 323 |
+
<table><tr><td>Game</td><td>10Mframes</td><td>50Mframes</td><td>100M frames</td><td></td></tr><tr><td>FREEWAY</td><td>25.7 (1.5)</td><td>29.6 (0.1)</td><td>29.5</td><td>(0.1)</td></tr><tr><td>GRAVITAR</td><td>229.9 (31.3)</td><td>559.3 (75.9)</td><td>1078.3</td><td>(254.1)</td></tr><tr><td>MONT.REVENGE</td><td>0.0 (0.0)</td><td>0.0 (0.0)</td><td>0.0</td><td>(0.0)</td></tr><tr><td>PRIVATEEYE</td><td>216.7 (219.5)</td><td>109.1 (44.1)</td><td>113.4</td><td>(42.3)</td></tr><tr><td>SOLARIS</td><td>2230.0 (322.3)</td><td>2181.5 (292.9)</td><td>2244.6</td><td>(378.8)</td></tr><tr><td>VENTURE</td><td>63.8 (31.3)</td><td>794.1</td><td>(151.9) 1220.1</td><td>(51.0)</td></tr></table>
|
| 324 |
+
|
| 325 |
+

|
| 326 |
+
Figure 4: $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } } + \mathrm { S R }$ and $\mathrm { D Q N } _ { e } ^ { \mathrm { M M C } }$ learning curves in the Atari 2600 games used as testbed. The curves are smoothed with a running average computed using a window of size 100.
|
md/train/S1lwRjR9YX/S1lwRjR9YX.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STABILITY OF STOCHASTIC GRADIENT METHOD WITH MOMENTUM FOR STRONGLY CONVEX LOSS FUNCTIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
While momentum-based methods, in conjunction with the stochastic gradient descent, are widely used when training machine learning models, there is little theoretical understanding on the generalization error of such methods. In practice, the momentum parameter is often chosen in a heuristic fashion with little theoretical guidance. In this work we use the framework of algorithmic stability to provide an upper-bound on the generalization error for the class of strongly convex loss functions, under mild technical assumptions. Our bound decays to zero inversely with the size of the training set, and increases as the momentum parameter is increased. We also develop an upper-bound on the expected true risk, in terms of the number of training steps, the size of the training set, and the momentum parameter.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
A fundamental issue for any machine learning algorithm is its ability to generalize from the training dataset to the test data. A classical framework used to study the generalization error in machine learning is PAC learning (Vapnik and Chervonenkis, 1971; Valiant, 1984). However, the associated bounds using this approach can be conservative. Recently, the notion of uniform stability, introduced in the seminal work of Bousquet and Elisseeff (Bousquet and Elisseef, 2002), is leveraged to analyze the generalization error of the stochastic gradient method (SGM) (Hardt et al., 2016). The result in (Hardt et al., 2016) is a substantial step forward, since SGM is widely used in many practical systems. This method is scalable, robust, and widely adopted in a broad range of problems.
|
| 12 |
+
|
| 13 |
+
To accelerate the convergence of SGM, a momentum term is often added in the iterative update of the stochastic gradient (Goodfellow et al., 2016). This approach has a long history, with proven benefits in various settings. The heavy-ball momentum method was first introduced by Polyak (Polyak, 1964), where a weighted version of the previous update is added to the current gradient update. Polyak motivated his method by its resemblance to a heavy ball moving in a potential well defined by the objective function. Momentum methods have been used to accelerate the backpropagation algorithm when training neural networks (Rumelhart et al., 1986). Intuitively, adding momentum accelerates convergence by circumventing sharp curvatures and long ravines of the sublevel sets of the objective function (Wilson et al., 2018). For example, Ochs et al. has presented an illustrative example to show that the momentum can potentially avoid local minima (Ochs et al., 2015). Nesterov has proposed an accelerated gradient method, which converges as $O ( 1 / k ^ { 2 } )$ where $k$ is the number of iterations (Nesterov, 1983). However, the Netstrov momentum does not seem to improve the rate of convergence for stochastic gradient (Goodfellow et al., 2016, Section 8.3.3). In this work, we focus on the heavy-ball momentum.
|
| 14 |
+
|
| 15 |
+
Although momentum methods are well known to improve the convergence in SGM, their effect on the generalization error is not well understood. In this work, we first build upon the framework in (Hardt et al., 2016) to obtain a bound on the generalization error of SGM with momentum (SGMM) for the case of strongly convex loss functions. Our bound is independent of the number of training iterations and decreases inversely with the size of the training set. Secondly, we develop an upper-bound on the optimization error, which quantifies the gap between the empirical risk of SGMM and the global optimum. Our bound can be made arbitrarily small by choosing sufficiently many iterations and a sufficiently small learning rate. Finally, we establish an upper-bound on the expected true risk of SGMM as a function of various problem parameters. We note that the class of strongly convex loss functions appears in several important machine learning problems, including linear and logistic regression with a weight decay regularization term.
|
| 16 |
+
|
| 17 |
+
Other related works: convergence analysis of first order methods with momentum is studied in (Nesterov, 1983; Ochs et al., 2014; Su et al., 2014; Ghadimi et al., 2015; Lessard et al., 2016; Yang et al., 2016; Loizou and Richtarik, 2018; Gadat et al., 2016). Most of these works consider the ´ deterministic setting for gradient update. Only a few works have analyzed the stochastic setting (Yang et al., 2016; Loizou and Richtarik, 2018; Gadat et al., 2016). Our convergence analysis ´ results are not directly comparable with these works due to their different assumptions regarding the properties of loss functions. In particular, we analyze the convergence of SGMM for a smooth and strongly convex loss function as in (Hardt et al., 2016), which is new.
|
| 18 |
+
|
| 19 |
+
First-order methods with noisy gradient are studied in (Kidambi et al., 2018) and references therein. In (Kidambi et al., 2018), the authors show that there exists linear regression problems for which SGM outperforms SGMM in terms of convergence.
|
| 20 |
+
|
| 21 |
+
Our main focus in this work is on the generalization, and hence true risk, of SGMM. We are aware of only one similar work in this regard, which provides stability bounds for quadratic loss functions (Chen et al., 2018). In this paper, we obtain stability bounds for the general case of strongly convex loss functions. In addition, unlike (Chen et al., 2018), our results show that machine learning models can be trained for multiple epochs of SGMM with bounded generalization errors.
|
| 22 |
+
|
| 23 |
+
Notation: We use $\mathbb { E } [ \cdot ]$ to denote the expectation and $\| \cdot \|$ to represent the Euclidean norm of a vector. We use lower-case bold font to denote vectors. We use sans-serif font to denote random quantities. Sets and scalars are represented by calligraphic and standard fonts, respectively.
|
| 24 |
+
|
| 25 |
+
# 2 GENERALIZATION ERROR AND STABILITY
|
| 26 |
+
|
| 27 |
+
We consider a general supervised learning problem, where $\boldsymbol { S } = \{ \mathbf { z } _ { 1 } , \cdots , \mathbf { z } _ { n } \}$ denotes the set of samples of size $n$ drawn i.i.d. from some space $\mathcal { Z }$ with an unknown distribution $D$ . We assume a learning model described by parameter vector w. Let $f ( \mathbf { w } ; \mathbf { z } )$ denote the loss of the model described by parameter w on example $\mathbf { z } \in { \mathcal { Z } }$ . Our ultimate goal is to minimize the true or population risk:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
R ( \mathbf { w } ) \triangleq \mathbb { E } _ { \mathbf { z } \sim D } f ( \mathbf { w } ; \mathbf { z } ) .
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
Since the distribution $D$ is unknown, we replace the objective by the empirical risk, i.e.,
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
R _ { S } ( \mathbf { w } ) \triangleq \frac { 1 } { n } \sum _ { i = 1 } ^ { n } f ( \mathbf { w } ; \mathbf { z } _ { i } ) .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
We assume $\pmb { w } = A ( \mathcal { S } )$ for a potentially randomized algorithm $A ( \cdot )$ . In order to find an upper-bound on the true risk, we consider the generalization error, which is the expected difference of empirical and true risk:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\epsilon _ { g } \triangleq \mathbb { E } _ { S , A } [ R ( A ( S ) ) - R _ { S } ( A ( S ) ) ] .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Finally, to upper bound $\epsilon _ { g }$ , we consider uniform stability:
|
| 46 |
+
|
| 47 |
+
Definition 1 Let $s$ and $S ^ { \prime }$ denote two data sets from space ${ \mathcal { Z } } ^ { n }$ such that $s$ and $S ^ { \prime }$ differ in at most one example. Algorithm $A$ is $\epsilon _ { s }$ -uniformly stable if for all data sets $s , s ^ { \prime }$ , we have
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\operatorname* { s u p } _ { \mathbf { z } } \mathbb { E } _ { A } [ f ( A ( { \cal S } ) ; \mathbf { z } ) - f ( A ( { \cal S } ^ { \prime } ) ; \mathbf { z } ) ] \leq \epsilon _ { s } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
It is shown in (Hardt et al., 2016) that uniform stability implies generalization in expectation:
|
| 54 |
+
|
| 55 |
+
Theorem 1 (Hardt et al., 2016) If $A$ is an $\epsilon _ { s }$ -uniformly stable algorithm, then the generalization error of $A$ is upper-bounded by $\epsilon _ { s }$ .
|
| 56 |
+
|
| 57 |
+
Theorem 1 shows that it is enough to control the uniform stability of an algorithm to upper bound the generalization error.
|
| 58 |
+
|
| 59 |
+
# 2.1 ASSUMPTIONS ON THE LOSS FUNCTION
|
| 60 |
+
|
| 61 |
+
In our analysis, we will assume that the loss function satisfies the following properties.
|
| 62 |
+
|
| 63 |
+
Definition 2 A function $f : \Psi \mathbb { R }$ is $L$ -Lipschitz if for all $\mathbf { u }$ , $\mathbf { v } \in \Psi$ we have $| f ( \mathbf { u } ) - f ( \mathbf { v } ) | \leq$ $L \| \mathbf { u } - \mathbf { v } \|$ .
|
| 64 |
+
|
| 65 |
+
Definition 3 A function $f : \Psi \mathbb { R }$ is $\beta$ -smooth if for all $\mathbf { u }$ , $\mathbf { v } \in \Psi$ we have $\| \nabla f ( \mathbf { u } ) - \nabla f ( \mathbf { v } ) \| \leq$ $\beta \| \mathbf { u } - \mathbf { v } \|$ .
|
| 66 |
+
|
| 67 |
+
Definition 4 A function $f : \Psi \mathbb { R }$ is $\gamma$ -strongly convex if for all $\mathbf { u }$ , $\textbf { v } \in \ \Psi$ we have $f ( \mathbf { u } ) \geq$ $\begin{array} { r } { f ( \mathbf { v } ) + \nabla f ( \mathbf { v } ) ^ { \check { T } } ( \mathbf { u } - \mathbf { v } ) + \frac { \gamma } { 2 } \Vert \mathbf { u } - \mathbf { v } \Vert ^ { 2 } } \end{array}$ .
|
| 68 |
+
|
| 69 |
+
We assume that the parameter space $\Omega$ is a convex set. Furthermore, for the loss function to be $L$ -Lipschitz and and strongly convex, we further assume that $\Omega$ is compact. Since $\Omega$ is compact, the SGMM update requires projection.
|
| 70 |
+
|
| 71 |
+
# 2.2 STOCHASTIC GRADIENT METHOD WITH MOMENTUM
|
| 72 |
+
|
| 73 |
+
The update rule for projected SGMM is given by:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathbf { w } _ { t + 1 } = \mathbf { P } \left( \mathbf { w } _ { t } + \mu ( \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } ) - \alpha \nabla _ { \mathbf { w } } f ( \mathbf { w } _ { t } ; \mathbf { z } _ { \mathrm { i } _ { t } } ) \right)
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\mathbf { P }$ denotes the Euclidean projection onto $\Omega$ , $\alpha > 0$ is the learning rate1, $\mu > 0$ is the momentum parameter, $\mathsf { i } _ { t }$ is a randomly selected index, and $f ( \mathbf { w } _ { t } ; \mathbf { z } _ { \mathrm { i } _ { t } } )$ is the loss evaluated on sample $\mathbf { z } _ { \mathrm { i } _ { t } }$ . In SGMM, we run the update (5) iteratively for $T$ steps and let ${ \pmb w } _ { T }$ denote the final output. Note that there are two typical approaches to select $\mathsf { i } _ { t }$ . The first approach is to select $\mathsf { i } _ { t } \in \{ 1 , \cdots , n \}$ uniformly at random at each iteration. The second approach is to permutate $\{ 1 , \cdots , n \}$ randomly once and then select the examples repeatedly in a cyclic manner. Our results are valid for both approaches. The key quantity of interest in this paper is the generalization error for SGMM given by:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\epsilon _ { g } = \mathbb { E } _ { S , A } [ R ( \mathbf { w } _ { T } ) - R _ { S } ( \mathbf { w } _ { T } ) ] = \mathbb { E } _ { S , \mathrm { i } _ { 0 } , \cdots , \mathrm { i } _ { T - 1 } } [ R ( \mathbf { w } _ { T } ) - R _ { S } ( \mathbf { w } _ { T } ) ]
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
since the randomness in $A$ arises from the choice of $\mathrm { i } _ { 0 } , \cdots , \mathrm { i } _ { T - 1 }$
|
| 86 |
+
|
| 87 |
+
# 3 MAIN RESULTS
|
| 88 |
+
|
| 89 |
+
In the following, we assume that the loss function $f ( \cdot ; \mathbf { z } )$ is $\beta$ -smooth, $L$ -Lipschitz, and $\gamma$ -strongly convex for all $\mathbf { z }$ .
|
| 90 |
+
|
| 91 |
+
Theorem 2 (Stability bound) Suppose that the SGMM update (5) is executed for $T$ steps with constant learning rate $\alpha$ and momentum $\mu$ . Provided that $\begin{array} { r } { \frac { \alpha \beta \gamma } { \beta + \gamma } - \frac { 1 } { 2 } \leq \mu < \frac { \alpha \beta \gamma } { 3 ( \beta + \gamma ) } } \end{array}$ and $\begin{array} { r } { \alpha \le \frac { 2 } { \beta + \gamma } } \end{array}$ , SGMM satisfies $\epsilon _ { s }$ -uniform stability where
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\epsilon _ { s } \leq \frac { 2 \alpha L ^ { 2 } ( \beta + \gamma ) } { n \big ( \alpha \beta \gamma - 3 \mu ( \beta + \gamma ) \big ) } .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
The result in Theorem 2 implies that the stability bound decreases inversely with the size of the training set. It increases as the momentum parameter $\mu$ increases. These properties are also verified in our experimental evaluation.
|
| 98 |
+
|
| 99 |
+
Theorem 3 (Convergence bound) Suppose that the SGMM update (5) is executed for $T$ steps with constant learning rate $\alpha$ and momentum $\mu$ . Then we have
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathbb { E } _ { S , A } [ R _ { S } ( \hat { \mathbf { w } } _ { T } ) - R _ { S } ( \mathbf { w } _ { S } ^ { * } ) ] \leq \frac { \mu W _ { 0 } } { ( 1 - \mu ) T } + \frac { ( 1 - \mu ) W _ { 1 } } { 2 \alpha T } - \frac { \gamma W _ { 2 } } { 2 } - \frac { \mu \gamma W _ { 3 } } { 2 ( 1 - \mu ) } + \frac { \alpha L ^ { 2 } } { 2 ( 1 - \mu ) }
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\hat { \mathbf { w } } _ { T }$ denotes the average of $T$ steps of the algorithm, i.e., $\begin{array} { r } { \hat { \mathbf { w } } _ { T } = \frac { 1 } { T + 1 } \sum _ { t = 0 } ^ { T } \mathbf { w } _ { t } } \end{array}$ , $R _ { S } ( \mathbf { w } ) =$ $\begin{array} { r } { \frac 1 n \sum _ { i = 1 } ^ { n } f ( \mathbf { w } ; \mathbf { z } _ { i } ) , \mathbf { w } _ { S } ^ { * } = \arg \operatorname* { m i n } _ { \mathbf { w } } R _ { S } ( \mathbf { w } ) , } \end{array}$ $W _ { 0 } = \mathbb { E } _ { S , A } [ R _ { S } ( \mathbf { w } _ { 0 } ) - R _ { S } ( \mathbf { w } _ { T } ) ] ,$ , $W _ { 1 } = \mathbb { E } _ { S , A } [ \| \mathbf { w } _ { 0 } -$ $\pmb { w } _ { S } ^ { * } \| ^ { 2 } \|$ , $W _ { 2 } = \mathbb { E } _ { S , A } [ \| \hat { \mathbf { w } } _ { T } - \mathbf { w } _ { S } ^ { * } \| ^ { 2 } ] _ { }$ , and $\begin{array} { r } { W _ { 3 } = \frac { 1 } { T + 1 } \sum _ { t = 0 } ^ { T } \mathbb { E } _ { S , A } [ \| \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } \| ^ { 2 } ] } \end{array}$ .
|
| 106 |
+
|
| 107 |
+
Theorem 3 bounds the optimization error, i.e., the expected difference between the empirical risk achieved by SGMM and the global minimum. Upon setting $\mu = 0$ and $\gamma = 0$ in (7), we can recover the classical bound on optimization error for SGM (Nemirovski and Yudin., 1983), (Hardt et al., 2016, Theorem 5.2). The first two terms in (7) vanish as $T$ increases. The terms with negative sign improve the convergence due to the strongly convexity. The last term depends on the learning rate, $\alpha$ , the momentum parameter $\mu$ , and the Lipschitz constant $L$ . This term can be controlled by selecting $\alpha$ sufficiently small.
|
| 108 |
+
|
| 109 |
+
Proposition 1 (Upper-bound on true risk) Suppose that the SGMM update (5) is executed for $T$ steps with constant learning rate $\alpha$ and momentum $\mu$ , satisfying the conditions in Theorem 2 and $\mu ( \beta + \gamma ) \ll \alpha \beta \gamma .$ . Then, setting $\begin{array} { r } { \alpha = \frac { 1 - \mu } { L } \sqrt { \frac { W _ { 1 } } { T } } } \end{array}$ W1T , we have:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\mathbb { E } _ { S , A } [ R ( \hat { \mathbf { w } } _ { T } ) ] \leq \mathbb { E } _ { S , A } [ R _ { S } ( \mathbf { w } _ { S } ^ { * } ) ] + \frac { \mu W _ { 0 } } { ( 1 - \mu ) T } + L \sqrt { \frac { W _ { 1 } } { T } } - \frac { \gamma W _ { 2 } } { 2 } - \frac { \mu \gamma W _ { 3 } } { 2 ( 1 - \mu ) } + \frac { 2 L ^ { 2 } ( \beta + \gamma ) } { n \beta \gamma C }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where C ∆= 1− 3µL(β+γ) T√ and $\hat { \mathbf { w } } _ { T }$ as well as the constants $W _ { 0 } , \cdots , W _ { 3 }$ are defined in Theorem 3.
|
| 116 |
+
|
| 117 |
+
Proposition 1 provides a bound on the expected true risk of SGMM in terms of the global minimum of the empirical risk. The bound in (8) is obtained by combining Theorem 2 and Theorem 3 and minimizing the expression over $\alpha$ . The choice of $\alpha$ simplifies considerably when $\mu$ is sufficiently small, as stated in Proposition 1. Due to the page constraint, the proof of this result is provided in the supplementary material. Note that the first two terms in (8) vanish as $T$ increases. The last term in (8) vanishes as the number of samples $n$ increases.
|
| 118 |
+
|
| 119 |
+
# 4 PROOF OF THEOREM 2 (STABILITY BOUND)
|
| 120 |
+
|
| 121 |
+
Following (Hardt et al., 2016), we track the divergence of two different iterative sequences of update rules with the same starting point. However, our analysis is more involved as the presence of momentum term requires a more careful bound on the iterative expressions.
|
| 122 |
+
|
| 123 |
+
To keep the notation uncluttered, we first consider SGMM without projection and defer the discussion of projection to the end of this proof. Let $S = \{ \mathbf { z } _ { 1 } , \cdots , \mathbf { z } _ { n } \}$ and $S ^ { \prime } = \{ \mathbf { z } _ { 1 } ^ { \prime } , \cdot \cdot \cdot , \mathbf { z } _ { n } ^ { \prime } \}$ be two samples of size $n$ that differ in at most one example. Let ${ \pmb w } _ { T }$ and ${ \bf w } _ { T } ^ { \prime }$ denote the outputs of SGMM on $s$ and $S ^ { \prime }$ , respectively. We consider the updates $\mathbf { w } _ { t + 1 } = G _ { t } ( \mathbf { w } _ { t } ) + \mu ( \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } )$ and $\boldsymbol { \mathsf { w } } _ { t + 1 } ^ { \prime } =$ $G _ { t } ^ { \prime } ( \mathbf { w } _ { t } ^ { \prime } ) + \mu ( \mathbf { w } _ { t } ^ { \prime } - \mathbf { w } _ { t - 1 } ^ { \prime } )$ with $G _ { t } ( \mathbf { w } _ { t } ) = \mathbf { w } _ { t } - \alpha \nabla _ { \mathbf { w } } f ( \dot { \mathbf { w } } _ { t } ; \mathbf { z } _ { \mathrm { i } _ { t } } )$ and $G _ { t } ^ { \prime } ( \mathbf { w } _ { t } ^ { \prime } ) = \mathbf { w } _ { t } ^ { \prime } - \alpha \nabla _ { \mathbf { w } } f ( \mathbf { w } _ { t } ^ { \prime } ; \mathbf { z } _ { \mathfrak { i } _ { t } } ^ { \prime } )$ , respectively, for $t = 1 , \cdots , T$ . We denote $\delta _ { t } \triangleq \Vert \mathbf { w } _ { t } - \mathbf { w } _ { t } ^ { \prime } \Vert$ . Suppose $\pmb { w } _ { 0 } = \pmb { w } _ { 0 } ^ { \prime }$ , i.e., $\delta _ { 0 } = 0$ . We first establish an upper-bound on $\mathbb { E } _ { A } [ \delta _ { t + 1 } ]$ in terms of $\mathbb { E } _ { A } [ \delta _ { t } ]$ and $\mathbb { E } _ { A } [ \delta _ { t - 1 } ]$ in the following lemma, whose proof is provided in the supplementary document.
|
| 124 |
+
|
| 125 |
+
Lemma 1 Provided that $\begin{array} { r } { \alpha \leq \frac { 2 } { \beta + \gamma } } \end{array}$ , an upper-bound on $\mathbb { E } _ { A } [ \delta _ { t + 1 } ]$ is given by
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathbb { E } _ { A } [ \delta _ { t + 1 } ] \leq \Big ( 1 + \mu - \frac { \alpha \beta \gamma } { \beta + \gamma } \Big ) \mathbb { E } _ { A } [ \delta _ { t } ] + \mu \mathbb { E } _ { A } [ \delta _ { t - 1 } ] + \frac { 2 \alpha L } { n } .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Using the result of Lemma 1, in the following, we develop an upper bound on $\mathbb { E } _ { A } [ \delta _ { T } ]$ . Let us consider the recursion
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathbb { E } _ { A } [ \tilde { \delta } _ { t + 1 } ] = \Big ( 1 + \mu - \frac { \alpha \beta \gamma } { \beta + \gamma } \Big ) \mathbb { E } _ { A } [ \tilde { \delta } _ { t } ] + \mu \mathbb { E } _ { A } [ \tilde { \delta } _ { t - 1 } ] + \frac { 2 \alpha L } { n }
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
with $\tilde { \delta } _ { 0 } = \delta _ { 0 } = 0$ . Upon inspecting (10) it is clear that
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\mathbb { E } _ { A } [ \tilde { \delta } _ { t } ] \geq \big ( 1 + \mu - \frac { \alpha \beta \gamma } { \beta + \gamma } \big ) \mathbb { E } _ { A } [ \tilde { \delta } _ { t - 1 } ] , \qquad \forall t \geq 1 ,
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
as we simply drop the remainder of positive terms. Substituting (11) into (10), we have
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { A } [ \tilde { \delta } _ { t + 1 } ] \leq \Big ( 1 + \mu + \frac { \mu } { 1 + \mu - \frac { \alpha \beta \gamma } { \beta + \gamma } } - \frac { \alpha \beta \gamma } { \beta + \gamma } \Big ) \mathbb { E } _ { A } [ \tilde { \delta } _ { t } ] + \frac { 2 \alpha L } { n } } \\ { \displaystyle \qquad \leq \Big ( 1 + 3 \mu - \frac { \alpha \beta \gamma } { \beta + \gamma } \Big ) \mathbb { E } _ { A } [ \tilde { \delta } _ { t } ] + \frac { 2 \alpha L } { n } } \end{array}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
$\begin{array} { r } { \mu \geq \frac { \alpha \beta \gamma } { \beta + \gamma } - \frac { 1 } { 2 } } \end{array}$
|
| 150 |
+
|
| 151 |
+
Noting that $\mathbb { E } _ { A } [ \tilde { \delta } _ { t } ] \geq \mathbb { E } _ { A } [ \delta _ { t } ]$ for all $t$ including $T$ , we have
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\mathbb { E } _ { A } [ \delta _ { T } ] \le \frac { 2 \alpha L } { n } \sum _ { t = 1 } ^ { T } \Big ( 1 + 3 \mu - \frac { \alpha \beta \gamma } { \beta + \gamma } \Big ) ^ { t } \le \frac { 2 \alpha L ( \beta + \gamma ) } { n \big ( \alpha \beta \gamma - 3 \mu ( \beta + \gamma ) \big ) }
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where the second expression holds since 0 ≤ µ < αβγ3(β+γ) is assumed.
|
| 158 |
+
|
| 159 |
+
Applying the $L$ -Lipschitz property on $f ( \cdot , \mathbf { z } )$ , it follows that
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\mathbb { E } _ { A } [ | f ( \mathbf { w } _ { T } ; \mathbf { z } ) - f ( \mathbf { w } _ { T } ^ { \prime } ; \mathbf { z } ) | ] \leq L \mathbb { E } _ { A } [ \delta _ { T } ] \leq \frac { 2 \alpha L ^ { 2 } ( \beta + \gamma ) } { n \big ( \alpha \beta \gamma - 3 \mu ( \beta + \gamma ) \big ) } .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Since this bound holds for all $s , s ^ { \prime }$ and $\mathbf { z }$ , we obtain an upper-bound on the uniform stability and the proof is complete. Our stability bound in Theorem 2 holds for the projected SGMM update (5) because Euclidean projection does not increase the distance between projected points (the argument is essentially analogous to (Hardt et al., 2016, Lemma 4.6)). In particular, note that Lemma 1 holds for the projected SGMM.
|
| 166 |
+
|
| 167 |
+
# 5 PROOF OF THEOREM 3 (CONVERGENCE BOUND)
|
| 168 |
+
|
| 169 |
+
Again, we first consider SGMM without projection and discuss the extension to projection at the end of this proof. Our proof is inspired by the convergence analysis in (Yang et al., 2016; Ghadimi et al., 2015) for a convex loss function with bounded variance and time-decaying learning rate. Different from these works, we analyze the convergence of SGMM for a smooth and strongly convex loss function with constant learning rate. To facilitate the convergence analysis, we define:
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\mathbf p _ { t } \triangleq \frac { \mu } { 1 - \mu } ( \mathbf w _ { t } - \mathbf w _ { t - 1 } )
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
with $\pmb { \mathrm { p } } _ { 0 } = 0$ . Substituting into the SGMM update, the parameter recursion is given by
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\mathbf { w } _ { t + 1 } + \mathbf { p } _ { t + 1 } = \mathbf { w } _ { t } + \mathbf { p } _ { t } - { \frac { \alpha } { 1 - \mu } } \nabla _ { \mathbf { w } } f ( \mathbf { w } _ { t } ; \mathbf { z } _ { \mathrm { i } _ { t } } )
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
It follows that
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\begin{array} { l } { \displaystyle \| { \bf w } _ { t + 1 } + { \bf p } _ { t + 1 } - { \bf w } \| ^ { 2 } = \| { \bf w } _ { t } + { \bf p } _ { t } - { \bf w } \| ^ { 2 } + \big ( \frac { \alpha } { 1 - \mu } \big ) ^ { 2 } \| \nabla _ { { \bf w } } f ( { \bf w } _ { t } ; { \bf z } _ { \mathrm { i } _ { t } } ) \| ^ { 2 } } \\ { \displaystyle \qquad - \frac { 2 \alpha } { 1 - \mu } ( { \bf w } _ { t } + { \bf p } _ { t } - { \bf w } ) ^ { T } \nabla _ { { \bf w } } f ( { \bf w } _ { t } ; { \bf z } _ { \mathrm { i } _ { t } } ) . } \end{array}
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
Substituting $\mathbf { p } _ { t }$ (15) into (17), the recursion (16) can be written as
|
| 188 |
+
|
| 189 |
+
$$
|
| 190 |
+
\begin{array} { l } { { \displaystyle { \bf w } _ { t + 1 } + { \bf p } _ { t + 1 } - { \bf w } \| ^ { 2 } = \| { \bf w } _ { t } + { \bf p } _ { t } - { \bf w } \| ^ { 2 } + \big ( \frac { \alpha } { 1 - \mu } \big ) ^ { 2 } \| \nabla _ { { \bf w } } f ( { \bf w } _ { t } ; { \bf z } _ { { \bf i } _ { t } } ) \| ^ { 2 } } \ ~ } \\ { { \displaystyle \phantom { \frac { 1 } { 1 + \mu } } - \frac { 2 \alpha \mu } { ( 1 - \mu ) ^ { 2 } } ( { \bf w } _ { t } - { \bf w } _ { t - 1 } ) ^ { T } \nabla _ { { \bf w } } f ( { \bf w } _ { t } ; { \bf z } _ { { \bf i } _ { t } } ) - \frac { 2 \alpha } { 1 - \mu } ( { \bf w } _ { t } - { \bf w } ) ^ { T } \nabla _ { { \bf w } } f ( { \bf w } _ { t } ; { \bf z } _ { { \bf i } _ { t } } ) } . } \end{array}
|
| 191 |
+
$$
|
| 192 |
+
|
| 193 |
+
Upon taking the expectation with respect to $\mathsf { i } _ { t }$ in (18) we have
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\begin{array} { c } { \displaystyle \mathfrak { l } _ { t } \| \mathbf { w } _ { t + 1 } + \mathbf { p } _ { t + 1 } - \mathbf { w } \| ^ { 2 } \leq \| \mathbf { w } _ { t } + \mathbf { p } _ { t } - \mathbf { w } \| ^ { 2 } + \big ( \displaystyle \frac { \alpha } { 1 - \mu } \big ) ^ { 2 } L ^ { 2 } - \displaystyle \frac { 2 \alpha \mu } { ( 1 - \mu ) ^ { 2 } } \big ( \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } \big ) ^ { T } \nabla _ { \mathbf { w } } R _ { S } ( \mathbf { w } _ { t } ) } \\ { \displaystyle - \displaystyle \frac { 2 \alpha } { 1 - \mu } ( \mathbf { w } _ { t } - \mathbf { w } ) ^ { T } \nabla _ { \mathbf { w } } R _ { S } ( \mathbf { w } _ { t } ) } \end{array}
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
where we use the fact that $\left\| \nabla _ { \mathbf { w } } f ( \mathbf { w } _ { t } ; \mathbf { z } _ { \mathsf { i } _ { t } } ) \right\| \leq L$ , due to $L$ -Lipschitz, and that $\mathbb { E } _ { \mathbf { i } _ { t } } [ \nabla _ { \mathbf { w } } f ( \mathbf { w } _ { t } ; \mathbf { z } _ { \mathbf { i } _ { t } } ) ] =$ $\nabla _ { \mathbf { w } } R _ { S } ( \mathbf { w } _ { t } )$ . Furthermore, since $R _ { S } ( \cdot )$ is a $\gamma$ -strongly convex function, for all $\mathbf { w } _ { t }$ and $\mathbf { w } _ { t - 1 }$ , we have
|
| 200 |
+
|
| 201 |
+
$$
|
| 202 |
+
\begin{array} { r l } & { \quad ( \mathbf { w } _ { t } - \mathbf { w } ) ^ { T } \nabla _ { \mathbf { w } } R _ { S } ( \mathbf { w } _ { t } ) \geq R _ { S } ( \mathbf { w } _ { t } ) - R _ { S } ( \mathbf { w } ) + \displaystyle \frac { \gamma } { 2 } \| \mathbf { w } _ { t } - \mathbf { w } \| ^ { 2 } , } \\ & { \quad ( \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } ) ^ { T } \nabla _ { \mathbf { w } } R _ { S } ( \mathbf { w } _ { t } ) \geq R _ { S } ( \mathbf { w } _ { t } ) - R _ { S } ( \mathbf { w } _ { t - 1 } ) + \displaystyle \frac { \gamma } { 2 } \| \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } \| ^ { 2 } . } \end{array}
|
| 203 |
+
$$
|
| 204 |
+
|
| 205 |
+
Substituting (20) in (19), we have
|
| 206 |
+
|
| 207 |
+
$$
|
| 208 |
+
\begin{array} { r } { \displaystyle \mathfrak { L } _ { i _ { t } } \big [ | \mathbf { w } _ { t + 1 } + \mathbf { p } _ { t + 1 } - \mathbf { w } | ^ { 2 } \big ] \leq \| \mathbf { w } _ { t } + \mathbf { p } _ { t } - \mathbf { w } \| ^ { 2 } - \frac { \alpha \gamma } { 1 - \mu } \| \mathbf { w } _ { t } - \mathbf { w } \| ^ { 2 } - \frac { 2 \alpha \mu } { ( 1 - \mu ) ^ { 2 } } \big ( R _ { S } ( \mathbf { w } _ { t } ) - R _ { S } ( \mathbf { w } _ { t - 1 } ) } \\ { \displaystyle - \frac { 2 \alpha } { 1 - \mu } \big ( R _ { S } ( \mathbf { w } _ { t } ) - R _ { S } ( \mathbf { w } ) \big ) + \frac { \alpha ^ { 2 } L ^ { 2 } } { ( 1 - \mu ) ^ { 2 } } - \frac { \alpha \mu \gamma } { ( 1 - \mu ) ^ { 2 } } \| \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } \| ^ { 2 } . } \end{array}
|
| 209 |
+
$$
|
| 210 |
+
|
| 211 |
+
Taking expectation over $\mathrm { i } _ { 0 } , \cdots , \mathrm { i } _ { t }$ for a given $s$ , summing (21) for $t = 0 , \cdots , T$ , and rearranging terms, we have
|
| 212 |
+
|
| 213 |
+
$$
|
| 214 |
+
\begin{array} { r l r } { { \frac { 2 \alpha } { 1 - \mu } \sum _ { t = 0 } ^ { T } \mathbb { E } _ { A } \big [ R _ { S } ( \mathbf { w } _ { t } ) - R _ { S } ( \mathbf { w } ) \big ] \leq \frac { 2 \alpha \mu } { ( 1 - \mu ) ^ { 2 } } \mathbb { E } _ { A } \big [ R _ { S } ( \mathbf { w } _ { 0 } ) - R _ { S } ( \mathbf { w } _ { T } ) \big ] - \frac { \alpha \gamma } { 1 - \mu } \sum _ { t = 0 } ^ { T } \mathbb { E } _ { A } \big [ \| \mathbf { w } _ { t } - \mathbf { w } \| ^ { 2 } \big ] } } \\ & { } & { \qquad - \frac { \alpha \mu \gamma } { ( 1 - \mu ) ^ { 2 } } \sum _ { t = 0 } ^ { T } \mathbb { E } _ { A } \big [ \| \mathbf { w } _ { t } - \mathbf { w } _ { t - 1 } \| ^ { 2 } \big ] + \mathbb { E } _ { A } \big [ \| \mathbf { w } _ { 0 } - \mathbf { w } \| ^ { 2 } \big ] + \frac { \alpha ^ { 2 } L ^ { 2 } ( T + 1 ) } { ( 1 - \mu ) ^ { 2 } } . \qquad ( 2 2 ) } \end{array}
|
| 215 |
+
$$
|
| 216 |
+
|
| 217 |
+
Since $\| \cdot \|$ is a convex function, for all $\mathbf { w } _ { T }$ and w, we have
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
\| \hat { \mathbf { w } } _ { T } - \mathbf { w } \| ^ { 2 } \leq \frac { 1 } { T + 1 } \sum _ { t = 0 } ^ { T } \| \mathbf { w } _ { t } - \mathbf { w } \| ^ { 2 } .
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
Furthermore, due to convexity of $R _ { S } ( \cdot )$ , we have
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
R _ { S } ( \hat { \mathbf { w } } _ { T } ) - R _ { S } ( \mathbf { w } ) \leq \frac { 1 } { T + 1 } \sum _ { t = 0 } ^ { T } \big ( R _ { S } ( \mathbf { w } _ { t } ) - R _ { S } ( \mathbf { w } ) \big ) .
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
Taking expectation over $s$ , applying inequalities (23) and (24) into (22), and substituting $\mathbf { w } = \mathbf { w } _ { S } ^ { * }$ , we obtain (7) and the proof is complete.
|
| 230 |
+
|
| 231 |
+
Our convergence bound in Theorem 3 can be extended to projected SGMM (5). Let use denote 1 ∆= wt + µ(wt − wt−1) − α∇wf (wt; zit ). Then, for any feasible w ∈ Ω, (17) holds for yt+1, i.e.,
|
| 232 |
+
|
| 233 |
+
$$
|
| 234 |
+
\begin{array} { l } { \displaystyle \| { \bf y } _ { t + 1 } + \frac { \mu } { 1 - \mu } ( { \bf y } _ { t + 1 } - { \bf w } _ { t } ) - { \bf w } \| ^ { 2 } = \| { \bf w } _ { t } + { \bf p } _ { t } - { \bf w } \| ^ { 2 } + \big ( \frac { \alpha } { 1 - \mu } \big ) ^ { 2 } \| \nabla _ { \bf w } f ( { \bf w } _ { t } ; { \bf z } _ { \mathrm { i } _ { t } } ) \| ^ { 2 } } \\ { \displaystyle - \frac { 2 \alpha } { 1 - \mu } ( { \bf w } _ { t } + { \bf p } _ { t } - { \bf w } ) ^ { T } \nabla _ { \bf w } f ( { \bf w } _ { t } ; { \bf z } _ { \mathrm { i } _ { t } } ) . } \end{array}
|
| 235 |
+
$$
|
| 236 |
+
|
| 237 |
+
Note that the LHS of (25) can be written as
|
| 238 |
+
|
| 239 |
+
$$
|
| 240 |
+
\| { \bf y } _ { t + 1 } + \frac { \mu } { 1 - \mu } ( { \bf y } _ { t + 1 } - { \bf w } _ { t } ) - { \bf w } \| ^ { 2 } = \frac { 1 } { 1 - \mu } \| { \bf y } _ { t + 1 } - \left( \mu { \bf w } _ { t } + ( 1 - \mu ) { \bf w } \right) \| .
|
| 241 |
+
$$
|
| 242 |
+
|
| 243 |
+
We note that $\mu \mathbf { w } _ { t } + ( 1 - \mu ) \mathbf { w } \in \Omega$ for any $\mathbf { w } \in \Omega$ and $\boldsymbol { \mathsf { w } } _ { t } \in \Omega$ since $\Omega$ is convex.
|
| 244 |
+
|
| 245 |
+
Now in projected SGMM, we have
|
| 246 |
+
|
| 247 |
+
$$
|
| 248 |
+
\begin{array} { r l } & { \| \mathbf { w } _ { t + 1 } - \big ( \mu \mathbf { w } _ { t } + ( 1 - \mu ) \mathbf { w } \big ) \| ^ { 2 } = \| \mathbf { P } ( \mathbf { y } _ { t + 1 } ) - \big ( \mu \mathbf { w } _ { t } + ( 1 - \mu ) \mathbf { w } \big ) \| ^ { 2 } } \\ & { \qquad \leq \| \mathbf { y } _ { t + 1 } - \big ( \mu \mathbf { w } _ { t } + ( 1 - \mu ) \mathbf { w } \big ) \| ^ { 2 } } \end{array}
|
| 249 |
+
$$
|
| 250 |
+
|
| 251 |
+
since projection a point onto $\Omega$ moves it closer to any point in $\Omega$ . This shows inequality (19) holds, and the convergence results do not change.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 1: Generalization performance (cross entropy) of logistic regression for notMNIST dataset with $T = 1 0 0 0$ iterations and minibatch size 10.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure 2: Generalization performance (classification accuracy) of logistic regression for notMNIST dataset with $T = 1 0 0 0$ iterations and minibatch size 10.
|
| 258 |
+
|
| 259 |
+
# 6 EXPERIMENTAL EVALUATION
|
| 260 |
+
|
| 261 |
+
In this section, we validate the insights obtained in our theoretical results in experimental evaluation. Our main goal is to study how adding momentum affects the convergence and generalization of SGM. We study the performance of SGMM when applied to the notMINIST dataset. Please note that similar results are provided for the MNIST dataset in the supplementary document. We train a logistic regression model with the weight decay regularization using SGMM for binary classification on the two-class notMNIST dataset that contains the images from letter classes “C” and “J”, which leads to a smooth and strongly convex loss function. We set the learning rate $\alpha = 0 . 0 1$ . The weight decay coefficient and the minibatch size are set to 0.001 and 10, respectively. We use 100 SGMM realizations to evaluate the average performance. We compare the training and generalization performance of SGM without momentum with that of SGMM under $\mu = 0 . 5$ and $\mu = 0 . 9$ , which are common momentum values used in practice (Goodfellow et al., 2016, Section 8.3.2).
|
| 262 |
+
|
| 263 |
+
The generalization error (with respect to cross entropy) and training error versus the number of training samples, $n$ , under SGMM with fixed $T = 1 0 0 0$ iterations are shown in Figures 1a and 1b, respectively, for $\mu = 0 , 0 . 5 , 0 . 9$ . In Figures 2a and 2b, we plot the generalization error (with respect to classification accuracy) and the training accuracy as a function of the number of training samples for the same dataset. First, we observe that the generalization error (with respect to both cross entropy and classification accuracy) decreases as $n$ increases for all values of $\mu$ , which is suggested by our stability upper-bound in Theorem 2. In addition, for sufficiently large $n$ , we observe that the generalization error increases with $\mu$ , consistent with Theorem 2. On the other hand, the training error increases as $n$ increases, which is expected. We can observe that adding momentum reduces training error as it improves the convergence rate. The training accuracy also improves by adding momentum as illustrated in Fig. 2b.
|
| 264 |
+
|
| 265 |
+

|
| 266 |
+
Figure 3: Training and test error of logistic regression (cross entropy loss) for notMNIST dataset with $n = 5 0 0$ training samples and minibatch size 10.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 4: Training and test accuracy of logistic regression for notMNIST dataset with $n = 5 0 0$ training samples and minibatch size 10.
|
| 270 |
+
|
| 271 |
+
In order to study the optimization error of SGMM, we show the training error and test error versus the number of epochs, under SGMM trained with $n = 5 0 0$ samples in Figures 3a and 3b, respectively. We plot the classification accuracy for training and test datasets in Figures 4a and 4b, respectively. We observe that the training error decreases as the number of epochs increases for all values of $\mu$ , which is consistent with the convergence analysis in Theorem 3. Furthermore, as expected, we see that adding momentum improves the training error and accuracy. However, as the number of epochs increases, we note that the benefit of momentum on the test error and accuracy becomes negligible. This happens because adding momentum also results in a higher generalization error thus penalizing the gain in training error.
|
| 272 |
+
|
| 273 |
+
# 7 CONCLUSIONS
|
| 274 |
+
|
| 275 |
+
We study the generalization error and convergence of SGMM for the class of strongly convex loss functions, under mild technical conditions. We establish an upper-bound on the generalization error, which decreases with the size of the training set, and increases as the momentum parameter is increased. Secondly, we analyze the convergence of SGMM during training, by establishing an upper-bound on the gap between the empirical risk of SGMM and the global minimum. Our proposed bound reduces to a classical bound on the optimization error of SGM (Nemirovski and Yudin., 1983) for convex functions, when the momentum parameter is set to zero. Finally, we establish an upper-bound on the expected difference between the true risk of SGMM and the global minimum of the empirical risk, and illustrate how it scales with the number of training steps and the size of the training set. Although our results are established for the case when the learning rate is constant, they can be easily extended to the case when the learning rate decreases with the number of iterations. We also present experimental evaluations on the notMNIST dataset and show that the numerical plots are consistent with our theoretical bounds on the generalization error and the convergence gap.
|
| 276 |
+
|
| 277 |
+
REFERENCES
|
| 278 |
+
V. N. Vapnik and A. Y. Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probability and Its Applications, 16(2):264–280, 1971.
|
| 279 |
+
L. G. Valiant. A theory of the learnable. Communications of the ACM, 27(11):1134–1142, 1984.
|
| 280 |
+
O. Bousquet and A. Elisseef. Stability and generalization. Journal of Machine Learning Research, 2:499–526, 2002.
|
| 281 |
+
M. Hardt, B. Recht, and Y Singer. Train faster, generalize better: Stability of stochastic gradient descent. Preprint available at arXiv:1509.01240v2, 2016.
|
| 282 |
+
I. Goodfellow, Y. Bengio, and A. Courville. Deep Learning. Cambridge, USA: The MIT Press, 2016.
|
| 283 |
+
B. T. Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964.
|
| 284 |
+
D. E. Rumelhart, G. E. Hinton, and R. J. Williams. Learning representations by backpropagating errors. Nature, 323:533–536, 1986.
|
| 285 |
+
A. C. Wilson, B. Recht, and M. I. Jordan. A lyapunov analysis of momentum methods in optimization. Preprint available at arXiv:1611.02635v4, 2018.
|
| 286 |
+
P. Ochs, T. Brox, and T. Pock. IPIASCO: Inertial proximal algorithm for strongly convex optimization. Journal of Mathematical Imaging and Vision, 53(2):171–181, 2015.
|
| 287 |
+
Y. Nesterov. A method of solving a convex programming problem with convergence $O ( 1 / k ^ { 2 } )$ . Soviet Mathematics Doklady, 27(2):372–376, 1983.
|
| 288 |
+
P. Ochs, Y. Chen, T. Brox, and T. Pock. IPIANO: Inertial proximal algorithm for nonconvex optimization. SIAM Journal on Imaging Sciences, 7(2):1388–1419, 2014.
|
| 289 |
+
W. Su, S. Boyd, and E. Candes. A differential equation for modeling Nesterov’s accelerated gradi- \` ent method: Theory and insights. In Proc. Advances in Neural Information Processing Systems (NIPS), 2014.
|
| 290 |
+
E. Ghadimi, H. R. Feyzmahdavian, and M. Johansson. Global convergence of the heavy-ball method for convex optimization. In Proc. European Control Conference (ECC), Linz, Austria, 2015.
|
| 291 |
+
L. Lessard, B. Recht, and A Packard. Analysis and design of optimization algorithms via integral quadratic constraints. SIAM Journal on Optimization, 26(1):57–95, 2016.
|
| 292 |
+
T. Yang, Q. Lin, and Z Li. Unified convergence analysis of stochastic momentum methods for convex and non-convex optimization. Preprint available at arXiv:1604.03257v2, 2016.
|
| 293 |
+
N. Loizou and P. Richtarik. Momentum and stochastic momentum for stochastic gradient, newton, ´ proximal point and subspace descent methods. Preprint available at arXiv:1712.09677v2, 2018.
|
| 294 |
+
S. Gadat, F. Panloup, and S. Saadane. Stochastic heavy ball. Preprint available at arXiv:1609.04228v2, 2016.
|
| 295 |
+
R. Kidambi, P. Netrapalli, P. Jain, and S. M. Kakade. On the insufficiency of existing momentum schemes for stochastic optimization. In Proc. International Conference on Learning Representations (ICLR), 2018.
|
| 296 |
+
Y. Chen, C. Jin, and B. Yu. Stability and convergence trade-off of iterative optimization algorithms. Preprint available at arXiv:1804.01619, 2018.
|
| 297 |
+
A. Nemirovski and D. B. Yudin. Problem Complexity and Method Efficiency in Optimization. Wiley Interscience, 1983.
|
md/train/SJeFNoRcFQ/SJeFNoRcFQ.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SJg9z6VFDr/SJg9z6VFDr.md
ADDED
|
@@ -0,0 +1,601 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ORDINARY DIFFERENTIAL EQUATIONS ON GRAPH NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recently various neural networks have been proposed for irregularly structured data such as graphs and manifolds. To our knowledge, all existing graph networks have discrete depth. Inspired by neural ordinary differential equation (NODE) for data in the Euclidean domain, we extend the idea of continuous-depth models to graphs, and propose graph ordinary differential equation (GODE). The derivative of hidden node states are parameterized with a graph neural network, and the output states are the solution to this ordinary differential equation. Noticing that NODEs are typically trained with the adjoint method, with the advantages of adaptive evaluation and a free-form continuous invertible model; however, their performance on benchmark image classification tasks is significantly inferior to discrete-layer models. We show the reason is adjoint method generates inaccurate gradient due to numerical error in reverse-mode integration. We then propose a memory-efficient framework for free-form ODEs with accurate gradient estimation, which is fundamental to deep-learning models. Furthermore, when applied to invertible blocks, our method achieves constant memory cost with GODE (NODE). We show our method for free-form ODEs generalizes to various model structures and achieves high accuracy for both NODE and GODE in benchmark tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Convolutional neural networks (CNN) have achieved great success in various tasks, such as image classification (He et al., 2016) and segmentation (Long et al., 2015), video processing (Deng et al., 2014) and machine translation (Sutskever et al., 2014). However, CNNs are limited to data that can be represented by a grid in the Euclidean domain, such as images (2D grid) and text (1D grid), which hinders their application in irregularly structured datasets.
|
| 12 |
+
|
| 13 |
+
A graph data structure represents objects as nodes and relations between objects as edges. Graphs are widely used to model irregularly structured data, such as social networks (Kipf & Welling, 2016), protein interaction networks (Fout et al., 2017), citation and knowledge graphs (Hamaguchi et al., 2017). Early works use traditional methods such as random walk (Lovasz et al., 1993), independent ´ component analysis (ICA) (Hyvarinen & Oja, 2000) and graph embedding (Yan et al., 2006) to ¨ model graphs, however their performance is inferior due to the low expressive capacity.
|
| 14 |
+
|
| 15 |
+
Recently a new class of models called graph neural networks (GNN) (Scarselli et al., 2008) were proposed. Inspired by the success of CNNs, researchers generalize convolution operations to graphs to capture the local information. There are mainly two types of methods to perform convolution on a graph: spectral methods and non-spectral methods. Spectral methods typically first compute the graph Laplacian, then perform filtering in the spectral domain (Bruna et al., 2013). Other methods aim to approximate the filters without computing the graph Laplacian for faster speed (Defferrard et al., 2016). For non-spectral methods, the convolution operation is directly performed in the graph domain, aggregating information only from the neighbors of a node (Duvenaud et al., 2015; Atwood & Towsley, 2016). The recently proposed GraphSAGE (Hamilton et al., 2017) learns a convolution kernel in an inductive manner.
|
| 16 |
+
|
| 17 |
+
To our knowledge, all existing GNN models mentioned above have a structure of discrete layers. The discrete structure makes it hard for the GNN to model continuous diffusion processes (Freidlin & Wentzell, 1993; Kondor & Lafferty, 2002) in graphs. The recently proposed neural ordinary differential equation (NODE) (Chen et al., 2018) views a neural network as an ordinary differential equation (ODE), whose derivative is parameterized by the network, and the output is the solution to this ODE. We extend NODE from the Euclidean domain to graphs and propose graph ordinary differential equations (GODE), where the message propagation on a graph is modeled as an ODE.
|
| 18 |
+
|
| 19 |
+
NODEs are typically trained with adjoint method. NODEs have the advantages of adaptive evaluation, accuracy-speed control by changing error tolerance, and are free-form continuous invertible models (Chen et al., 2018; Grathwohl et al., 2018). However, to our knowledge, in benchmark image classification tasks, NODEs are significantly inferior to state-of-the-art discrete-layer models (error rate: $19 \%$ for NODE vs $7 \%$ for ResNet18 on CIFAR10) (Dupont et al., 2019; Gholami et al., 2019). In this work, we show this is caused by error in gradient estimation during training of NODE, and propose a memory-efficient framework for accurate gradient estimation. We demonstrate our framework for free-form ODEs generalizes to various model structures, and achieves high accuracy for both NODE and GODE in benchmark tasks. Our contribution can be summarized as follows:
|
| 20 |
+
|
| 21 |
+
1. We propose a framework for free-form NODEs to accurately estimate the gradient, which is fundamental to deep-learning models. Our method significantly improves the performance on benchmark classification (reduces test error from $19 \%$ to $5 \%$ on CIFAR10).
|
| 22 |
+
|
| 23 |
+
2. Our framework is memory-efficient for free-form ODEs. When applied to restricted-form invertible blocks, the model achieves constant memory usage.
|
| 24 |
+
|
| 25 |
+
. We generalize ODE to graph data and propose GODE models.
|
| 26 |
+
|
| 27 |
+
4. We demonstrate improved performance on different graph models and various datasets.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORKS
|
| 30 |
+
|
| 31 |
+
# 2.1 NEURAL NETWORKS AND DIFFERENTIAL EQUATIONS
|
| 32 |
+
|
| 33 |
+
There have been efforts to view neural networks as differential equations. Lu (2017) viewed a residual network as a discretization of a differential equation and proposed several new architectures based on numerical methods in ODE solver. Haber & Ruthotto (2017) proposed a stable architecture based on analysis of the ODE. Chen et al. (2018) proposed neural ordinary differential equation (NODE), which treats the neural network as a continuous ODE. NODE was later used in a continuous normalizing flow for generative models (Grathwohl et al., 2018).
|
| 34 |
+
|
| 35 |
+
There have been many studies on the training of NODE. The adjoint method has long been widely used in optimal control (Stapor et al., 2018) and geophysical problems (Plessix, 2006), and recently applied to ODE (Chen et al., 2018). Dupont et al. (2019) proposed augmented neural ODEs to improve the expressive capacity of NODEs. However, to our knowledge, none of the methods above discusses the inaccurate gradient estimation issue; empirical performances of NODE in benchmark classification tasks are significantly inferior to state-of-the-art discrete-layer models.
|
| 36 |
+
|
| 37 |
+
# 2.2 GRAPH NEURAL NETWORKS
|
| 38 |
+
|
| 39 |
+
GNNs can be divided into two categories: spectral methods and non-spectral methods. Spectral GNNs perform filtering in the Fourier domain of a graph, thus need information of the whole graph to determine the graph Laplacian. In contrast, non-spectral GNNs only consider message aggregation around neighbor nodes, therefore are localized and generally require less computation (Zhou et al., 2018).
|
| 40 |
+
|
| 41 |
+
We first briefly introduce several spectral methods. Bruna et al. (2013) first introduced graph convolution in the Fourier domain based on the graph Laplacian, however the computation burden is heavy because of non-localized filters. Henaff et al. (2015) incorporated a graph estimation procedure in spectral networks and parameterized spectral filters into a localized version with smooth coefficients. Defferrard et al. (2016) used Chebyshev expansion to approximate the filters without the need to compute the graph Laplacian and its eigenvectors, therefore significantly accelerated the running speed. Kipf & Welling (2016) proposed to use a localized first-order approximation of graph convolution on graph data and achieved superior performance in semi-supervised tasks for node classification. Defferrard et al. (2016) proposed fast localized spectral filtering on graphs.
|
| 42 |
+
|
| 43 |
+
Non-spectral methods typically define convolution operations on a graph, only considering neighbors of a certain node. MoNet (Monti, 2017) uses a mixture of CNNs to generalize convolution to graphs. GraphSAGE (Hamilton et al., 2017) samples a fixed size of neighbors for each node for fast localized inference. Graph attention networks (Velickovi ˇ c et al., 2017) learn different weights ´ for different neighbors of a node. The graph isomorphism network (GIN) (Xu et al., 2018) has a structure as expressive as the Weisfeiler-Lehman graph isomorphism test.
|
| 44 |
+
|
| 45 |
+
# 2.3 INVERTIBLE BLOCKS
|
| 46 |
+
|
| 47 |
+
Invertible blocks are a family of neural network blocks whose forward function is a bijective mapping. Therefore, the input to a bijective block can be accurately reconstructed from its outputs. Invertible blocks have been used in normalizing flow (Rezende & Mohamed, 2015; Dinh, 2016; Kingma & Dhariwal, 2018; Dinh et al., 2014; Kingma et al., 2016), where the model is required to be invertible in order to calculate the log-density of data distribution. Later on, Jacobsen et al. (2018) used bijective blocks to build invertible networks. Gomez et al. (2017) proposed to use invertible blocks to perform back propagation without storing activation, which achieves a memory-efficient network structure. They were able to discard activation of middle layers, because each layer’s activation can be reconstructed from the next layer with invertible blocks.
|
| 48 |
+
|
| 49 |
+
# 3 ACCURATE GRADIENT ESTIMATION FOR TRAINING OF NODE
|
| 50 |
+
|
| 51 |
+
# 3.1 FROM DISCRETE MODELS TO CONTINUOUS MODELS
|
| 52 |
+
|
| 53 |
+
We first consider discrete-layer models with residual connection (He et al., 2016), which can be represented as:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
x _ { k + 1 } = x _ { k } + f _ { k } ( x _ { k } )
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $x _ { k }$ is the states in the $k$ th layer; $f _ { k } ( \cdot )$ is any differentiable function whose output has the same shape as its input.
|
| 60 |
+
|
| 61 |
+
When we add more layers with shared weights, and let the stepsize in Eq. 1 go to infinitesimal, the difference equation turns into a neural ordinary differential equation (NODE) (Chen et al., 2018):
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\frac { \mathrm { d } \boldsymbol { z } ( t ) } { \mathrm { d } t } = \boldsymbol { f } ( \boldsymbol { z } ( t ) , t )
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
We use $z ( t )$ in the continuous case and $x _ { k }$ in the discrete case to represent hidden states. $f ( \cdot )$ is the derivative parameterized by a network. Note that a key difference between Eq. 1 and 2 is the form of $f$ : in the discrete case, different layers (different $k$ values) have their own function $f _ { k }$ ; while in the continuous case, $f$ is shared across all time $t$ .
|
| 68 |
+
|
| 69 |
+
The forward pass of model with discrete layers can be written as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
x _ { 0 } = i n p u t , x _ { 1 } = x _ { 0 } + f _ { 0 } ( x _ { 0 } ) , . . . , x _ { K } = x _ { K - 1 } + f _ { K - 1 } ( x _ { K - 1 } )
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $K$ is the total number of layers. Then an output layer (e.g. fully-connected layer for classification) is applied on $x _ { K }$ .
|
| 76 |
+
|
| 77 |
+
The forward pass of a NODE is:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
z ( T ) = z ( 0 ) + \int _ { t = 0 } ^ { T } { \frac { \mathrm { d } z ( t ) } { \mathrm { d } t } } \mathrm { d } t = \operatorname* { i n p u t } + \int _ { t = 0 } ^ { T } f ( z ( t ) , t ) \mathrm { d } t
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $z ( 0 ) =$ input and $T$ is the integration time, corresponding to number of layers $K$ in the discrete case. The transformation of states $z$ is modeled as the solution to the NODE. Then an output layer is applied on $z ( T )$ . Integration in the forward pass can be performed with any ODE solver, such as the Euler Method, Runge-Kutta Method, VODE solver and Dopris Solver (Milne & Milne, 1953; Brown et al., 1989; Ascher et al., 1997).
|
| 84 |
+
|
| 85 |
+
# 3.2 BACK-PROP WITH ADJOINT METHOD IS SENSITIVE TO NUMERICAL ERROR
|
| 86 |
+
|
| 87 |
+
The adjoint method is widely used in optimal process control and functional analysis (Stapor et al., 2018; Pontryagin, 2018). We follow the method by (Chen et al., 2018). Denote model parameters as $\theta$ , which is independent of time. Define the adjoint as:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
a ( t ) = { \frac { \partial L } { \partial z ( t ) } }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 1: Comparison of two methods for back-propagation on NODE. As in figure (a), the ODE solver is discretized at points $\left\{ t _ { 0 } , t _ { 1 } , . . . , t _ { N } \right\}$ during forward pass. Black dashed curve shows hidden state solved in forward-time, denoted as $z ( t )$ . Figure (b) shows the adjoint method, red solid line shows the hidden state solved in reverse-time, denoted as $h ( t )$ . Ideally $z ( t ) = h ( t )$ and dashed curve overlaps with solid curve; however, the reverse-time solution could be numerically unstable, and causes $z ( t ) \neq h ( \bar { t } )$ , thus causes error in gradient. Figure (c) shows the direct back-propagation through ODE solver. In direct back-propagation, we save evaluation time points $\left\{ t _ { 0 } , t _ { 1 } , . . . t _ { N } \right\}$ during forward pass; during backward pass, we re-build the computation graph by directly evaluating at the same time points. In this way, $z ( t _ { i } ) = h ( t _ { i } )$ . Since the hidden state can be accurately reconstructed, the gradient can be accurately evaluated.
|
| 95 |
+
|
| 96 |
+
where $L$ is the loss function. Then we have
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\frac { \mathrm { d } a ( t ) } { \mathrm { d } t } = - a ( t ) ^ { T } \frac { \partial f ( z ( t ) , t , \theta ) } { z ( t ) } , \quad \frac { \mathrm { d } L } { \mathrm { d } \theta } = - \int _ { T } ^ { 0 } a ( t ) ^ { T } \frac { \partial f ( z ( t ) , t , \theta ) } { \partial \theta } \mathrm { d } t
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
with detailed proof from optimization perspective in appendix F. Then we can perform gradient descent to optimize $\theta$ to minimize $L$ . Eq. 6 is a reverse-time integration, which can be solved with any ODE solver (Chen et al., 2018). To evaluate $\frac { \partial f ( { \boldsymbol { z } } ( t ) , t , \theta ) } { \partial \theta }$ , we need to determine $z ( t )$ by solving Eq. 2 reverse-time (Directly storing $z ( t )$ during forward pass requires a large memory consumption, because the continuous model is equivalent to an infinite-layer model). To summarize, in the forward pass we solve Eq. 2 forward in time; in the backward pass, we solve Eq. 2 and 6 reverse in time, with initial condition determined from Eq. 5 at time $T$ .
|
| 103 |
+
|
| 104 |
+
We give an intuition why the reverse-time ODE solver causes inaccurate gradient in adjoint methods. The backward pass (Eq. 6) requires determining $f ( z ( t ) , t , \theta )$ and $\frac { \partial \mathbf { \tilde { f } } ( \boldsymbol { z } ( t ) , t , \theta ) } { \partial \theta }$ , which requires determining $z ( t )$ by solving Eq. 2 reverse-time. As shown in Fig. 1 (a,b), the hidden state solved forward-time $( z ( t _ { i } ) )$ and the hidden state solved reverse-time $( h ( t _ { i } ) )$ may not be equal; this could be caused by the instability of reverse-time ODE, and is represented by the mismatch between $z ( t )$ (dashed curve) and $h ( t )$ (solid curve). Error $h ( t ) - z ( t )$ will cause error in gradient $\frac { \mathrm { d } L } { \mathrm { d } \theta }$
|
| 105 |
+
|
| 106 |
+
Proposition 1 For an ODE in the form $\begin{array} { r } { \frac { \mathrm { d } \boldsymbol { z } ( t ) } { \mathrm { d } t } = \boldsymbol { f } ( \boldsymbol { z } ( t ) , t ) , } \end{array}$ , denote the Jacobian of $f$ as $J _ { f }$ . If this ODE is stable both in forward-time and reverse-time, then $\operatorname { R e } ( \lambda _ { i } ( J _ { f } ) ) = 0 ~ \forall i$ , where $\lambda _ { i } ( J _ { f } )$ is the ith eigenvalue of $J _ { f }$ , and $\mathrm { R e } ( \lambda )$ is the real part of $\lambda$ .
|
| 107 |
+
|
| 108 |
+
Detailed proof is in appendix C. Proposition 1 indicates that if the Jacobian of the original system Eq. 2 has eigenvalues whose real-part are not 0, then either the reverse-time or forward-time ODE is unstable. When $| \mathrm { R e } ( \lambda ) |$ is large, either forward-time or reverse-time ODE is sensitive to numerical errors. This phenomenon is also addressed in Chang et al. (2018). This instability affects the accuracy of solution to Eq. 2 and 6, thus affects the accuracy of the computed gradient.
|
| 109 |
+
|
| 110 |
+
# 3.3 MEMORY-EFFICIENT DIRECT BACK-PROPAGATION THROUGH ODE SOLVER
|
| 111 |
+
|
| 112 |
+
The adjoint method might be sensitive to numerical errors when solving the ODE in reverse-time.
|
| 113 |
+
To resolve this, we propose to directly back-propagate through the ODE solver.
|
| 114 |
+
|
| 115 |
+
As in Fig. 1(a), the ODE solver uses discretization for numerical integration, evaluated at time points $\left\{ t _ { 0 } , t _ { 1 } , . . . t _ { N } \right\}$ . Fig. 1(c) demonstrates the direct back-propagation with accurate hidden states $h ( t _ { i } )$ , which can be achieved with two methods: (1) the activation $z ( t _ { i } )$ can be saved in cache for back-prop, but requires huge memory; or (2) we can accurately reconstruct $z ( t _ { i } )$ by re-building the computation graph directly at evaluated time points $\{ t _ { i } \}$ . Since the model is evaluated at the same time points $t _ { i }$ in forward-time, it’s guaranteed that $\dot { z } ( \dot { t } _ { i } ) ~ = ~ h ( t _ { i } )$ . Therefore direct back-prop is accurate, regardless of the stability of Eq. 2.
|
| 116 |
+
|
| 117 |
+
Similar to the continuous case, we can define the adjoint with discrete time. Then we have:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
a _ { i } = \frac { \partial L } { \partial z ( t _ { i } ) } , \quad a _ { i + 1 } = a _ { i } \frac { \partial z ( t _ { i + 1 } ) } { \partial z ( t _ { i } ) } , \quad \frac { \mathrm { d } L } { \mathrm { d } \theta } = \sum _ { i = 1 } ^ { N } a _ { i } \frac { \partial z ( t _ { i } ) } { \partial \theta }
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $a _ { i }$ is the adjoint for the ith step in discrete forward-time ODE solution. Eq. 7 can be viewed as a numerical discretization of Eq. 6. We show Eq. 6 can be derived from an optimization perspective. Detailed derivations of Eq. 6-7 are in appendix E and F.
|
| 124 |
+
|
| 125 |
+
# Algorithm 1: Algorithm for accurate gradient estimation in ODE solver for free-form functions
|
| 126 |
+
|
| 127 |
+
Define model $\begin{array} { r } { \frac { \mathrm { d } \boldsymbol { z } ( t ) } { \mathrm { d } t } = \boldsymbol { f } ( \boldsymbol { z } ( t ) , t ) } \end{array}$ , where $f$ is a free-form function. Denote integration time as $T$
|
| 128 |
+
|
| 129 |
+
Forward $( f , T , z _ { 0 } , t o l e r a n c e ) \colon$ : $t = 0 , z = z _ { 0 }$ $s t a t e _ { 0 } = f . s t a t e \_ d i c t ( )$ , cache.save $\left( s t a t e _ { 0 } \right)$ Select initial step size $h = h _ { 0 }$ (adaptively with adaptive step-size solver). time points $: =$ empty list() While $t < T$ : state = f.state dict(), accept step = F alse While Not accept step: $f$ .load state dict(state) with grad disabled: $z . n e w , e r r o r \_ e s t i m a t e = s t e p ( f , z , t , h )$ If error estimate $<$ tolerance: accept step = T rue $\ z = z . n e w , \ t = t + h , \ t i m e \mathrm { - } p o i n t s . a p p e n d ( t )$ else: reduce stepsize $h$ according to error estimate delete $z$ new, error estimate and related local computation graph cache.save(time points) return $z$ , cache
|
| 130 |
+
Backward $( f , T , z _ { 0 } , t o l e r a n c e , c a c h e )$ : $\left\{ t _ { 0 } , t _ { 1 } , t _ { 2 } , . . . t _ { N - 1 } , t _ { N } \right\} = c a c$ che.time points For $t _ { i }$ in $\left\{ t _ { 0 } , t _ { 1 } , t _ { 2 } , . . . t _ { N - 1 } , t _ { N } \right\}$ : $z ( t _ { i + 1 } ) = s t e p ( f , z ( t _ { i } ) , t _ { i } , s t e p = t _ { i + 1 } - t _ { i } )$ For $t _ { i }$ in $\left\{ t _ { N } , t _ { N - 1 } , . . . , t _ { 1 } , t _ { 0 } \right\}$ : Determine $\begin{array} { r } { a ( t _ { i } ) = \frac { \partial L } { \partial z ( t _ { i } ) } } \end{array}$ and $\frac { \partial z ( t _ { i } ) } { \partial { \theta } }$ dLdθ PNi=1 ai ∂z(ti∂θ return dL dθ
|
| 131 |
+
|
| 132 |
+
Details of our method are summarized in Algorithm 1. We discuss its properties below:
|
| 133 |
+
|
| 134 |
+
Summary of the algorithm (1) During forward pass, the solver performs a numerical integration, with the stepsize adaptively varying with error estimation. (2) During forward pass, the solver outputs the integrated value, and the evaluation time points $\{ t _ { i } \}$ . All middle activations are deleted to save memory. (3) During backward pass, the solver re-builds the computation graph, by directly evaluating at saved time points, without adaptive searching. (4) During backward pass, the solver performs a numerical version (Eq. 7) of reverse-time integration (Eq. 6).
|
| 135 |
+
|
| 136 |
+
Support for free-form continuous dynamics There’s no constraint on the form of $f$ . Therefore, our algorithm is a generic method.
|
| 137 |
+
|
| 138 |
+
Memory consumption analysis (1) Suppose $f$ has $N _ { f }$ layers, the number of forward evaluation step is $N _ { t }$ on average, and the evaluations to adaptively search for an optimal stepsize is $K$ . A naive solver will take ${ \bar { O ( N _ { f } \times N _ { t } \times K ) } }$ , while our method consumes $O ( N _ { f } \times N _ { t } )$ because all middle activations are deleted during forward pass, and we don’t need to search for optimal stepsize in backward pass. (2) If we perform step-wise checkpoint method, where we only store $z ( t _ { i } )$ for all $t _ { i }$ , and compute the gradient $\frac { \partial z ( t _ { i + 1 } ) } { \partial z ( t _ { i } ) }$ for one $t _ { i }$ at a time, then the memory consumption can be reduced to $O ( N _ { f } + N _ { t } )$ . (3) Since the solver can handle free-form functions, it can also handle restricted form invertible block (see below). In this case, we don’t need to store $z ( t _ { i } )$ , and the memory consumption can reduce to $O ( N _ { f } )$ .
|
| 139 |
+
|
| 140 |
+
More memory-efficient solver with invertible blocks Restricting the form of $f$ to invertible blocks (Gomez et al., 2017) allows for $O ( N _ { f } )$ memory consumption. For invertible blocks, input $x$ is split into two parts $( x _ { 1 } , x _ { 2 } )$ of the same size (e.g. $x$ has shape $N \times C$ , where $N$ is batch size, $C$ is channel number; we can split $x$ into $x _ { 1 }$ and $x _ { 2 }$ with shape $N \times { \frac { C } { 2 } } .$ ). The forward and inverse of a bijective block can be denoted as:
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\left\{ \begin{array} { c } { { y _ { 2 } = \psi { \Big ( } x _ { 2 } , F ( x _ { 1 } ) { \Big ) } } } \\ { { y _ { 1 } = \psi { \Big ( } x _ { 1 } , G ( y _ { 2 } ) { \Big ) } } } \end{array} \right. \left\{ \begin{array} { c } { { x _ { 1 } = \psi ^ { - 1 } { \Big ( } y _ { 1 } , G ( y _ { 2 } ) { \Big ) } } } \\ { { x _ { 2 } = \psi ^ { - 1 } { \Big ( } y _ { 2 } , F ( x _ { 1 } ) { \Big ) } } } \end{array} \right.
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
where the output of a bijective block is denoted as $( y _ { 1 } , y _ { 2 } )$ with the same size as $( x _ { 1 } , x _ { 2 } )$ . $F$ and $G$ are any differentiable neural networks, whose output has the same shape as the input. $\psi ( \alpha , \beta )$ is a differentiable bijective function $w . r . t \alpha$ when $\beta$ is given; $\psi ^ { - 1 } ( \alpha , \beta )$ is the inverse function of $\psi$ .
|
| 147 |
+
|
| 148 |
+
Theorem 1 If $\psi ( \alpha , \beta )$ is a bijective function w.r.t $\alpha$ when $\beta$ is given, then the block defined by Eq. 8 is a bijective mapping.
|
| 149 |
+
|
| 150 |
+
Proof of Theorem 1 is given in appendix D. Based on this, we can apply different $\psi$ functions for different tasks. Since $x$ can be accurately reconstructed from $y$ , there’s no need to store activations, hence is memory-efficient. Details for back-prop without storing activation are in appendix $\mathbf { B }$ .
|
| 151 |
+
|
| 152 |
+
# 4 NEURAL ORDINARY DIFFERENTIAL EQUATION ON GRAPH NETWORKS
|
| 153 |
+
|
| 154 |
+
We first introduce graph neural networks with discrete layers, then extend to the continuous case and introduce graph ordinary differential equations (GODE).
|
| 155 |
+
|
| 156 |
+
# 4.1 MESSAGE PASSING IN GNN
|
| 157 |
+
|
| 158 |
+
As shown in Fig. 2, a graph is represented with nodes (marked with circles) and edges (solid lines). We assign a unique color to each node for ease of visualization. Current GNNs can generally be represented in a message passing scheme (Fey & Lenssen, 2019):
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
m e s s a g e _ { ( v , u ) } = \phi ^ { ( k ) } ( x _ { k - 1 } ^ { u } , x _ { k - 1 } ^ { v } , \mathbf { e } _ { u , v } )
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
a g g r e g a t i o n _ { u } = \zeta _ { v \in N ( u ) } ( m e s s a g e _ { ( v , u ) } )
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
x _ { k } ^ { u } = \gamma ^ { ( k ) } ( x _ { k - 1 } ^ { u } , a g g r e g a t i o n _ { u } )
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where $x _ { k } ^ { u }$ represents states of the uth node in the graph at $k$ th layer and $\mathbf { e } _ { u , v }$ represents the edge between nodes $u$ and $v$ . $\mathcal { N } ( u )$ represents the set of neighbor nodes for node $u$ . $\zeta$ represents a differentiable, permutation invariant operation such as mean, max or sum. $\gamma ^ { ( k ) }$ and $\phi ^ { ( k ) }$ are differentiable functions parameterized by neural networks.
|
| 173 |
+
|
| 174 |
+
For a specific node $u$ , a GNN can be viewed as a 3-stage model, corresponding to Eq. 9-11: (1) Message passing, where neighbor nodes $v \in \mathcal { N } ( u )$ send information to node $u$ , denoted by $m e s s a g e _ { ( v , u ) }$ . The message is generated from function $\phi ( \cdot )$ , parameterized by a neural network. (2) Message aggregation, where a node $u$ aggregates all messages from its neighbors $\mathcal { N } ( u )$ , denoted as aggregationu. The aggregation function $\zeta$ is typically permutation invariant operations such as mean and sum, because graphs are invariant to permutation. (3) Update, where the states of a node are updated according to its original states $x _ { k - 1 } ^ { u }$ and aggregation of messages aggregationu, denoted as $\gamma ( \cdot )$ .
|
| 175 |
+
|
| 176 |
+
# 4.2 CONTINUOUS-TIME MODELS ON GRAPHS
|
| 177 |
+
|
| 178 |
+
We can convert a discrete-time GNN to continuous-time GNN by replacing $f$ in Eq. 2 with the message passing process defined in Eq. 9 to 11, which we call graph ordinary differential equation (GODE). A diagram of GODE is shown in Fig. 2. Because GODE is an ODE in nature, it can capture highly non-linear functions, thus has the potential to outperform its discrete-layer counterparts.
|
| 179 |
+
|
| 180 |
+
We demonstrate that the asymptotic stability of GODE could be related to the over-smoothing phenomena (Li et al., 2018). It’s demonstrated that graph convolution is a special case of Laplacian smoothing (Li et al., 2018), which can be written as $\bar { Y } = ( I - \gamma \tilde { D } ^ { - 1 / 2 } \tilde { L } \tilde { D } ^ { - 1 / 2 } ) X$ where $X$ and $Y$ are the input and output of a graph-conv layer respectively, ${ \tilde { A } } = A + I$ where $A$ is the adjacency matrix, and $\tilde { D }$ is the corresponding degree matrix of $\tilde { A }$ , and $\gamma$ is a positive scaling constant.
|
| 181 |
+
|
| 182 |
+
When modified from a discrete model to a continuous model, the continuous smoothing process is:
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
\frac { d X } { d t } = - \gamma \tilde { D } ^ { - 1 / 2 } \tilde { L } \tilde { D } ^ { - 1 / 2 } X
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
Since all eigenvalues of the symmetrically normalized Laplacian are real and non-negative, then all eigenvalues of the above ODE are real and non-positive. Suppose all eigenvalues of the normalized Laplacian are non-zero. In this case, the ODE has only negative eigenvalues, hence the ODE above is asymptotically stable (Lyapunov, 1992). Hence as time $t$ grows sufficiently large, all trajectories are close enough. In the experiments, this suggests if integration time $T$ is large enough, all nodes (from different classes) will have very similar features, thus the classification accuracy will drop.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 2: Diecrete-time and continuous-time models on a graph. Nodes are represented with circles, and each node is represented with a unique color. Edges are represented with solid lines. For discrete-time models in (a), the hidden states of nodes are updated with discrete steps. For continuous-time models in (b), hidden states of each node evolves continuously with time. The dynamics of nodes are represented with dashed lines, with the same color as corresponding nodes.
|
| 192 |
+
|
| 193 |
+
# 5 EXPERIMENTS
|
| 194 |
+
|
| 195 |
+
# 5.1 DATASETS
|
| 196 |
+
|
| 197 |
+
To evaluate our method on general NODE, we conducted experiments with a CNN-NODE on two benchmark image classification tasks (CIFAR10 and CIFAR100) (Krizhevsky et al., 2009).
|
| 198 |
+
|
| 199 |
+
We also evaluated our method on benchmark graph datasets, including 2 bioinformatic graph classification datasets (MUTAG and PROTEINS), 2 social network graph classification datasets (IMDBBINRAY, REDDIT-BINARY) (Yanardag & Vishwanathan, 2015), and 3 citation networks (Cora, CiteSeer and PubMed). For graph classification tasks, different from the experiment settings in $\mathrm { X u }$ et al. (2018), we input the raw dataset into our models without pre-processing. For node classification tasks, we performed transductive inference and strictly followed the train-validation-test split by Kipf & Welling (2016), where less than $6 \%$ nodes are used as training examples. Details of datasets are summarized in appendix A.
|
| 200 |
+
|
| 201 |
+
# 5.2 MODEL STRUCTURES
|
| 202 |
+
|
| 203 |
+
For image classification tasks, we directly modify a ResNet18 into its corresponding NODE model. For each block, the function is $\begin{array} { r } { \frac { d z ( t ) } { d t } \stackrel { \cdot } { = } \stackrel { \cdot } { f } ( z ( t ) ) } \end{array}$ where $f$ is a sequence of $c o n v \mathrm { ~ - ~ } b n \mathrm { ~ - ~ } r e l u \mathrm { ~ - ~ }$ $c o n v - b n - r e l u$ layers. $f$ is the same as residual branch in ResNet, and it can be replaced with any free-form functions.
|
| 204 |
+
|
| 205 |
+
<table><tr><td rowspan="2"></td><td colspan="5">Ours</td><td colspan="4">Literature</td></tr><tr><td></td><td>Adaptive Stepsize Solvers</td><td></td><td>Fixed stepsize solvers</td><td></td><td>adjoint-ODE</td><td>ResNet18</td><td>ResNet50</td><td>ResNet101</td></tr><tr><td>CIFAR10</td><td>Heun-Euler</td><td>RK23</td><td>RK45</td><td>Euler</td><td>RK2 RK4</td><td></td><td></td><td></td><td></td></tr><tr><td>CIFAR100</td><td>4.85 22.66</td><td>4.92 24.13</td><td>5.29 23.56</td><td>5.52 24.44</td><td>5.27 5.24 24.44 24.43</td><td>19.2 37.6</td><td>6.98 27.08</td><td>6.38 25.73</td><td>6.25 24.84</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Table 1: Error rate on test set. “Ours” represent NODE models directly modified from ResNet18, trained with Heun-Euler solver, but tested with different solvers. “Adjoint” is the result when trained and tested with adjoint method, reported by (Gholami et al., 2019). We also report results from standard ResNet.
|
| 208 |
+
|
| 209 |
+
Table 2: Accuracy of adjoint method and direct back-prop, for a GODE model with GCN as the derivative function.
|
| 210 |
+
|
| 211 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>MUTAG</td><td rowspan=1 colspan=1>PROTEINS</td><td rowspan=1 colspan=1>IMDB</td><td rowspan=1 colspan=1>REDDIT</td></tr><tr><td rowspan=1 colspan=1>adjoint</td><td rowspan=1 colspan=1>68.1± 4.6</td><td rowspan=1 colspan=1>67.0±3.7</td><td rowspan=1 colspan=1>72.1±0.4</td><td rowspan=1 colspan=1>69.5±5.9</td></tr><tr><td rowspan=1 colspan=1>ours</td><td rowspan=1 colspan=1>80.8±8.3</td><td rowspan=1 colspan=1>73.9±3.1</td><td rowspan=1 colspan=1>74.6±5.1</td><td rowspan=1 colspan=1>92.4±2.1</td></tr></table>
|
| 212 |
+
|
| 213 |
+
For tasks on graph datasets, GODE can be applied to any graph neural network by simply replacing $f$ in Eq. 2 with corresponding structures (free-form functions), or replacing $F , G$ in Eq. 8 with other structures (invertible blocks). To demonstrate that GODE is easily generalized to existing structures, we used several different GNN architectures, including the graph convolutional network (GCN) (Kipf & Welling, 2016), graph attention network (GAT) (Velickovi ˇ c et al., 2017), graph ´ network approximated with Chebyshev expansion (ChebNet) (Defferrard et al., 2016), and graph isomorphism network (GIN) (Xu et al., 2018). For a fair comparison, we trained GNNs with different depths of layers (1-3 middle layers, besides an initial layer to transform data into specified channels, and a final layer to generate prediction), and reported the best results among all depths for each model structure.
|
| 214 |
+
|
| 215 |
+
On the same task, different models use the same hyper-parameters on model structures, such as channel number. For graph classification tasks, we set the channel number of hidden layers as 32 for all models; for ChebNet, we set the number of hops as 16. For node classification tasks, we set the channel number as 16 for GCN and ChebNet, and set number of hops as 3 for ChebNet; for GAT, we used 8 heads, and set each head as 8 channels.
|
| 216 |
+
|
| 217 |
+
For every GNN structure, we experimented with different number of hidden layers (1,2,3), and calculated the mean and variance of accuracy of 10 runs.
|
| 218 |
+
|
| 219 |
+
# 5.3 COMPARISON OF BACK-PROPAGATION METHODS
|
| 220 |
+
|
| 221 |
+
We compared the adjoint method and direct back-propagation on the same network, and demonstrated direct back-prop generates higher accuracy. For CNN-NODE on classification tasks, we directly modify a ResNet18 into NODE18, and report resuls in Table. 1; for graph networks, we train a GODE model with a GCN to parameterize the derivative, and report results in Table. 2.
|
| 222 |
+
|
| 223 |
+
Empirical performance Direct back-propagation consistently outperformed the adjoint method for both tasks. This result validates our analysis on the instability of the adjoint method, which is intuitively caused by the instability of the reverse-time ODE. On image classification tasks, compared to adjoint method, our training method reduces error rate of NODE18 from $19 \%$ $( 3 7 \% )$ to $5 \% ( 2 3 \% )$ on CIFAR10 (CIFAR100). Furthermore, NODE18 has the same number of parameters as ResNet18, but outperforms deeper networks such as ResNet101 on both datasets. Our method also consistently outperforms the adjoint method on several benchmark graph datasets, as shown in Table. 2.
|
| 224 |
+
|
| 225 |
+
Robustness to ODE solvers We implemented adaptive ODE solvers of different orders, as shown in Table 1. HeunEuler, RK23, RK45 are of order 1, 2, 4 respectively, i.e., for each step forward in time $f$ is evaluated 1, 2, 4 times respectively. During inference, using different solvers is equivalent to changing model depth (without re-training the network): for discrete-layer models, it generally causes huge error; for continuous models, we observe only around $1 \%$ increase in error rate. This suggests our method is robust to different orders of ODE solvers.
|
| 226 |
+
|
| 227 |
+
Support for free-form functions Our method supports NODE and GODE models with free-form functions; for example, $f$ in NODE18 in Table. 1 is a free-form function.
|
| 228 |
+
|
| 229 |
+
<table><tr><td rowspan=1 colspan=3>Model</td><td rowspan=1 colspan=1>MUTAG</td><td rowspan=1 colspan=1>PROTEINS</td><td rowspan=1 colspan=1>IMDB</td><td rowspan=1 colspan=1>REDDIT</td></tr><tr><td rowspan=3 colspan=1>GCN</td><td rowspan=1 colspan=2>DISC</td><td rowspan=1 colspan=1>73.3±5.2</td><td rowspan=1 colspan=1>72.4±3.1</td><td rowspan=1 colspan=1>74.2±3.6</td><td rowspan=1 colspan=1>85.9±1.8</td></tr><tr><td rowspan=2 colspan=1>ODE</td><td rowspan=1 colspan=1>INV</td><td rowspan=1 colspan=1>78.1±6.2**</td><td rowspan=1 colspan=1>74.7±4.3**</td><td rowspan=1 colspan=1>75.3±5.3*</td><td rowspan=1 colspan=1>89.2±3.2**</td></tr><tr><td rowspan=1 colspan=1>free</td><td rowspan=1 colspan=1>75.1±5.3**</td><td rowspan=1 colspan=1>76.6±3.9**</td><td rowspan=1 colspan=1>73.9±4.6</td><td rowspan=1 colspan=1>88.5±3.0**</td></tr><tr><td rowspan=3 colspan=1>Cheb</td><td rowspan=1 colspan=2>DISC</td><td rowspan=1 colspan=1>84.0±6.4</td><td rowspan=1 colspan=1>70.6±3.9</td><td rowspan=1 colspan=1>71.9±3.8</td><td rowspan=1 colspan=1>91.0±1.5</td></tr><tr><td rowspan=2 colspan=1>ODE</td><td></td><td></td><td></td><td></td><td rowspan=1 colspan=1>91.2±1.5</td></tr><tr><td rowspan=1 colspan=1>free</td><td rowspan=1 colspan=1>86.1±6.3*</td><td rowspan=1 colspan=1>72.5±4.7**</td><td rowspan=1 colspan=1>73.6±4.0**</td><td rowspan=1 colspan=1>92.4±1.6**</td></tr><tr><td rowspan=2 colspan=1>GIN</td><td rowspan=1 colspan=2>DISC</td><td rowspan=1 colspan=1>85.0±6.4</td><td rowspan=1 colspan=1>73.0±3.1</td><td rowspan=1 colspan=1>73.3±5.1</td><td rowspan=1 colspan=1>89.2±2.5</td></tr><tr><td rowspan=1 colspan=1>ODE</td><td></td><td></td><td></td><td></td><td rowspan=1 colspan=1>90.5±1.5**</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 3: Results on node classification tasks. We compared various discrete-layer structures (marked with DISC) and their corresponding GODE models (marked with ODE). We tested GODE model with different $\psi$ functions (“l sig” represents linear sigmoid). For each model, we use $^ { \ast } \left( { ^ { \ast \ast \ast } } \right)$ to mark GODE models that outperform corresponding discrete-layer baselines at a $5 \%$ $( 1 \% )$ significance level under paired t-test.
|
| 232 |
+
|
| 233 |
+
<table><tr><td rowspan=1 colspan=2>Model</td><td rowspan=1 colspan=1>4</td><td rowspan=1 colspan=1>Cora</td><td rowspan=1 colspan=1>CiteSeer</td><td rowspan=1 colspan=1>PubMed</td></tr><tr><td rowspan=3 colspan=1>GCN</td><td rowspan=1 colspan=1>DISC</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>81.6±0.5</td><td rowspan=1 colspan=1>71.6±0.3</td><td rowspan=1 colspan=1>79.2±0.1</td></tr><tr><td rowspan=2 colspan=1>ODE</td><td rowspan=1 colspan=1>add</td><td rowspan=1 colspan=1>81.7±0.7</td><td rowspan=1 colspan=1>72.4±0.6**</td><td rowspan=1 colspan=1>80.0±0.2**</td></tr><tr><td rowspan=1 colspan=1>1.sig</td><td rowspan=1 colspan=1>81.8±0.3**</td><td rowspan=1 colspan=1>72.4±0.8**</td><td rowspan=1 colspan=1>80.1±0.3**</td></tr><tr><td rowspan=3 colspan=1>GAT</td><td rowspan=1 colspan=1>DISC</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>82.9±0.3</td><td rowspan=1 colspan=1>71.7±0.8</td><td rowspan=1 colspan=1>78.9±0.3</td></tr><tr><td rowspan=2 colspan=1>ODE</td><td rowspan=1 colspan=1>add</td><td rowspan=1 colspan=1>83.3±0.3**</td><td rowspan=1 colspan=1>72.1±0.6**</td><td rowspan=1 colspan=1>79.1±0.5*</td></tr><tr><td rowspan=1 colspan=1>Lsig</td><td rowspan=1 colspan=1>83.1±0.4*</td><td rowspan=1 colspan=1>72.1±0.3**</td><td rowspan=1 colspan=1>79.0±0.5</td></tr><tr><td rowspan=3 colspan=1>Cheb</td><td rowspan=1 colspan=1>DISC</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>82.1±0.5</td><td rowspan=1 colspan=1>70.8±0.5</td><td rowspan=1 colspan=1>76.6±0.8</td></tr><tr><td rowspan=2 colspan=1>ODE</td><td rowspan=1 colspan=1>add</td><td rowspan=1 colspan=1>82.4±0.5*</td><td rowspan=1 colspan=1>71.1±0.5**</td><td rowspan=1 colspan=1>77.8±1.2**</td></tr><tr><td rowspan=1 colspan=1>L_sig</td><td rowspan=1 colspan=1>82.2±0.4*</td><td rowspan=1 colspan=1>70.8±0.6</td><td rowspan=1 colspan=1>77.0±1.1*</td></tr></table>
|
| 234 |
+
|
| 235 |
+
Table 4: Results on graph-classification tasks. For each base model structure, discerete-layer model is marked with DISC; for corresponding GODE, we tested both free-form functions (“free”), and their invertible block form (“INV”). For each model, we use $^ { \ast } \left( ^ { \ast \ast } \right)$ to mark GODE models that outperform corresponding discrete-layer baselines at a $5 \%$ $( 1 \% )$ significance level under paired t-test.
|
| 236 |
+
|
| 237 |
+
<table><tr><td>Integrationtime</td><td>0.5</td><td>1.0</td><td>1.5</td><td>2.0</td><td>5.0</td><td>10.0</td><td>20.0</td><td>100.0</td></tr><tr><td>Cora</td><td>80.5</td><td>81.6</td><td>80.1</td><td>80.1</td><td>79.3</td><td>77.6</td><td>68.9</td><td>35.1</td></tr><tr><td>CIFAR10</td><td>91.3</td><td>95.2</td><td>94.2</td><td>88.4</td><td>10.0</td><td>10.0</td><td>-</td><td>-</td></tr></table>
|
| 238 |
+
|
| 239 |
+
Table 5: Accuracy of a free-form GCNODE on Cora and NODE18 on CIFAR10, varying with integration time.
|
| 240 |
+
|
| 241 |
+
# 5.4 GENERAL BIJECTIVE BLOCKS
|
| 242 |
+
|
| 243 |
+
We demonstrate that bijective blocks defined as Eq. 8 can be easily generalized: $F$ and $G$ are general neural networks, which can be adapted to different tasks; $\psi ( \alpha , \beta )$ can be any differentiable bijective mapping w.r.t. $\alpha$ when $\beta$ is given. We demonstrate two examples of $\psi$ : (1) additive, forward is $\eta = \psi ( \alpha , \beta ) = \alpha + \beta$ , inverse is $\alpha = \psi ^ { - 1 } ( \eta , \beta ) = \eta - \bar { \beta }$ ; (2) linear sigmoid, forward is $\eta = \psi ( \alpha , \beta ) = \alpha \times \mathrm { s i g m o i d } ( \beta )$ , inverse is $\alpha = \psi ^ { - 1 } ( \eta , \beta ) = \eta / \mathrm { s i g m o i d } ( \beta )$ .
|
| 244 |
+
|
| 245 |
+
Results for different $\psi$ are reported in Table 3. Note that we experimented with different depths and reported the best accuracy for each model, and performed a paired t-test on results from GODE and their discrete-layer counterparts. Most GODE models outperformed their corresponding discretelayer models significantly, validating the effectiveness of GODE; different $\psi$ functions behaved similarly on our node classification tasks, indicating the continuous-time model is more important than coupling function $\psi$ . We also validate the lower memory cost, with details in appendix B.
|
| 246 |
+
|
| 247 |
+
# 5.5 RESULTS ON GRAPH CLASSIFICATION TASK
|
| 248 |
+
|
| 249 |
+
Results for different models on graph classification tasks are summarized in Table 4. We experimented with different structures, including GCN, ChebNet and GIN; for corresponding GODE models (marked with ODE), we tested both free-form (marked with “free”) and invertible block (marked with “INV”). We performed paired t-test comparing GODE and its discrete-layer counterparts. For most experiments, GODE models performed significantly better. This indicates the continuous process model might be important for graph models.
|
| 250 |
+
|
| 251 |
+
# 5.6 IMPACT OF INTEGRATION TIME
|
| 252 |
+
|
| 253 |
+
For a NODE and GODE model, during inference, we test the influence of integration time. Results are summarized in Table. 5. When integration time is short, the network does not gather sufficient information from neighbors; when integration time is too long, the model is sensitive to over-smooth issue, as discussed in Sec. 4.2. We observe accuracy drop in both cases.
|
| 254 |
+
|
| 255 |
+
# 6 CONCLUSIONS
|
| 256 |
+
|
| 257 |
+
We propose GODE, which enables us to model continuous diffusion process on graphs. We propose a memory-efficient direct back-propagation method to accurately determine the gradient for general free-form NODEs, and validate its superior performance on both image classification tasks and graph data. Furthermore, we related the over-smoothing of GNN to asymptotic stability of ODE. Our paper tackles the fundamental problem of gradient estimation for NODE; to our knowledge, it’s the first paper to improve accuracy on benchmark tasks to comparable with state-of-the-art discrete layer models. It’s an important step to apply NODE from theory to practice.
|
| 258 |
+
|
| 259 |
+
# REFERENCES
|
| 260 |
+
|
| 261 |
+
Uri M Ascher, Steven J Ruuth, and Raymond J Spiteri. Implicit-explicit runge-kutta methods for time-dependent partial differential equations. Applied Numerical Mathematics, 25(2-3):151–167, 1997.
|
| 262 |
+
|
| 263 |
+
James Atwood and Don Towsley. Diffusion-convolutional neural networks. In NIPS, 2016.
|
| 264 |
+
|
| 265 |
+
Peter N Brown, George D Byrne, and Alan C Hindmarsh. Vode: A variable-coefficient ode solver. SIAM, 1989.
|
| 266 |
+
|
| 267 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. arXiv preprint arXiv:1312.6203, 2013.
|
| 268 |
+
|
| 269 |
+
Bo Chang, Lili Meng, Eldad Haber, Lars Ruthotto, David Begert, and Elliot Holtham. Reversible architectures for arbitrarily deep residual neural networks. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 270 |
+
|
| 271 |
+
Tian Qi Chen, Yulia Rubanova, Jesse Bettencourt, and David K Duvenaud. Neural ordinary differential equations. In Advances in neural information processing systems, pp. 6571–6583, 2018.
|
| 272 |
+
|
| 273 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In Advances in neural information processing systems, pp. 3844–3852, 2016.
|
| 274 |
+
|
| 275 |
+
Li Deng, Dong Yu, et al. Deep learning: methods and applications. Foundations and Trends $\textsuperscript { \textregistered }$ in Signal Processing, 7(3–4):197–387, 2014.
|
| 276 |
+
|
| 277 |
+
Laurent Dinh, David Krueger, and Yoshua Bengio. Nice: Non-linear independent components estimation. arXiv preprint arXiv:1410.8516, 2014.
|
| 278 |
+
|
| 279 |
+
Laurent et al Dinh. Density estimation using real nvp. arXiv, 2016.
|
| 280 |
+
|
| 281 |
+
Emilien Dupont, Arnaud Doucet, and Yee Whye Teh. Augmented neural odes. arXiv preprint arXiv:1904.01681, 2019.
|
| 282 |
+
|
| 283 |
+
David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alan´ Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pp. 2224–2232, 2015.
|
| 284 |
+
|
| 285 |
+
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 286 |
+
|
| 287 |
+
Alex Fout, Jonathon Byrd, Basir Shariat, and Asa Ben-Hur. Protein interface prediction using graph convolutional networks. In Advances in Neural Information Processing Systems, pp. 6530–6539, 2017.
|
| 288 |
+
|
| 289 |
+
Mark I Freidlin and Alexander D Wentzell. Diffusion processes on graphs and the averaging principle. The Annals of probability, 1993.
|
| 290 |
+
|
| 291 |
+
Amir Gholami, Kurt Keutzer, and George Biros. Anode: Unconditionally accurate memory-efficient gradients for neural odes. arXiv preprint arXiv:1902.10298, 2019.
|
| 292 |
+
|
| 293 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. In Advances in neural information processing systems, pp. 2214–2224, 2017.
|
| 294 |
+
|
| 295 |
+
Will Grathwohl, Ricky TQ Chen, Jesse Betterncourt, Ilya Sutskever, and David Duvenaud. Ffjord: Free-form continuous dynamics for scalable reversible generative models. arXiv preprint arXiv:1810.01367, 2018.
|
| 296 |
+
|
| 297 |
+
Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. Inverse Problems, 2017.
|
| 298 |
+
|
| 299 |
+
Takuo Hamaguchi, Hidekazu Oiwa, Masashi Shimbo, and Yuji Matsumoto. Knowledge transfer for out-of-knowledge-base entities: A graph neural network approach. arXiv preprint arXiv:1706.05674, 2017.
|
| 300 |
+
|
| 301 |
+
Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pp. 1024–1034, 2017.
|
| 302 |
+
|
| 303 |
+
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, pp. 770–778, 2016.
|
| 304 |
+
|
| 305 |
+
Mikael Henaff, Joan Bruna, and Yann LeCun. Deep convolutional networks on graph-structured data. arXiv preprint arXiv:1506.05163, 2015.
|
| 306 |
+
|
| 307 |
+
Aapo Hyvarinen and Erkki Oja. Independent component analysis: algorithms and applications. ¨ Neural networks, 13(4-5):411–430, 2000.
|
| 308 |
+
|
| 309 |
+
Jorn-Henrik Jacobsen, Arnold Smeulders, and Edouard Oyallon. i-revnet: Deep invertible networks. ¨ arXiv preprint arXiv:1802.07088, 2018.
|
| 310 |
+
|
| 311 |
+
Durk P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. In NIPS, 2018.
|
| 312 |
+
|
| 313 |
+
Durk P Kingma, Tim Salimans, Rafal Jozefowicz, Xi Chen, Ilya Sutskever, and Max Welling. Improved variational inference with inverse autoregressive flow. In Advances in neural information processing systems, pp. 4743–4751, 2016.
|
| 314 |
+
|
| 315 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 316 |
+
|
| 317 |
+
Risi Imre Kondor and John Lafferty. Diffusion kernels on graphs and other discrete structures. In ICML, 2002.
|
| 318 |
+
|
| 319 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 320 |
+
|
| 321 |
+
Qimai Li, Zhichao Han, and Xiao-Ming Wu. Deeper insights into graph convolutional networks for semi-supervised learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 322 |
+
|
| 323 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3431–3440, 2015.
|
| 324 |
+
|
| 325 |
+
Laszl ´ o Lov ´ asz et al. Random walks on graphs: A survey. ´ Combinatorics, Paul erdos is eighty, 2(1): 1–46, 1993.
|
| 326 |
+
|
| 327 |
+
Yiping et al Lu. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. arXiv, 2017.
|
| 328 |
+
|
| 329 |
+
Aleksandr Mikhailovich Lyapunov. The general problem of the stability of motion. International journal of control, 55(3):531–534, 1992.
|
| 330 |
+
|
| 331 |
+
William Edmund Milne and WE Milne. Numerical solution of differential equations. 1953.
|
| 332 |
+
|
| 333 |
+
Federico et al Monti. Geometric deep learning on graphs and manifolds using mixture model cnns. In CVPR, 2017.
|
| 334 |
+
|
| 335 |
+
R-E Plessix. A review of the adjoint-state method for computing the gradient of a functional with geophysical applications. Geophysical Journal International, 167(2):495–503, 2006.
|
| 336 |
+
|
| 337 |
+
Lev Semenovich Pontryagin. Mathematical theory of optimal processes. Routledge, 2018.
|
| 338 |
+
|
| 339 |
+
Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. arXiv, 2015.
|
| 340 |
+
|
| 341 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2008.
|
| 342 |
+
Paul Stapor, Fabian Froehlich, and Jan Hasenauer. Optimization and uncertainty analysis of ode models using second order adjoint sensitivity analysis. BioRxiv, pp. 272005, 2018.
|
| 343 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 344 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Lio, and Yoshua ´ Bengio. Graph attention networks. arXiv preprint arXiv:1710.10903, 2017.
|
| 345 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? arXiv preprint arXiv:1810.00826, 2018.
|
| 346 |
+
Shuicheng Yan, Dong Xu, Benyu Zhang, Hong-Jiang Zhang, Qiang Yang, and Stephen Lin. Graph embedding and extensions: A general framework for dimensionality reduction. IEEE transactions on pattern analysis and machine intelligence, 29(1):40–51, 2006.
|
| 347 |
+
Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In ACM KDD, 2015.
|
| 348 |
+
Jie Zhou, Ganqu Cui, Zhengyan Zhang, Cheng Yang, Zhiyuan Liu, and Maosong Sun. Graph neural networks: A review of methods and applications. arXiv preprint arXiv:1812.08434, 2018.
|
| 349 |
+
|
| 350 |
+
# A DATASETS
|
| 351 |
+
|
| 352 |
+
We perform experiments on various datasets, including citation networks (Cora, CiteSeer, PubMed), social networks (COLLAB, IMDB-BINARY, REDDIT-BINARY), and bioinformatics datasets (MUTAG, PROTEINS). Details of each dataset are summarized in Table 1.
|
| 353 |
+
|
| 354 |
+
Table 1: Statistics of datasets
|
| 355 |
+
|
| 356 |
+
<table><tr><td>Dataset</td><td>Graphs</td><td>Nodes</td><td>Edges</td><td>Features</td><td>Classes</td><td>Label rate</td></tr><tr><td>Cora</td><td>1</td><td>2,708</td><td>5,278</td><td>1,433</td><td>7</td><td>0.052</td></tr><tr><td>CiteSeer</td><td>1</td><td>3,327</td><td>4,552</td><td>3,703</td><td>6</td><td>0.036</td></tr><tr><td>PubMEd</td><td>1</td><td>19,717</td><td>44,324</td><td>500</td><td>3</td><td>0.003</td></tr><tr><td>MUTAG</td><td>188</td><td>17.93</td><td>19.79</td><td>7</td><td>2</td><td>0.8</td></tr><tr><td>PROTEINS</td><td>1,113</td><td>39.06</td><td>72.82</td><td>3</td><td>2</td><td>0.8</td></tr><tr><td>IMDB-BINARY</td><td>1,000</td><td>19.77</td><td>96.53</td><td>1</td><td>2</td><td>0.8</td></tr><tr><td>REDDIT-BINARY</td><td>200</td><td>429.63</td><td>497.76</td><td>=</td><td>2</td><td>0.8</td></tr></table>
|
| 357 |
+
|
| 358 |
+
# B DETAILS ABOUT INVERTIBLE BLOCKS
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 1: Structure of bijective blocks. $F$ and $G$ can be any differentiable neural network whose output has the same shape as its input. Blue dot (Orange diamond) represents the forward (inverse) of a bijective function, corresponding to $\psi$ $( \psi ^ { \hat { - } 1 } )$ in Eq. 8 of the main paper. Left (right) figure represents the forward (inverse) as in Eq. 8.
|
| 362 |
+
|
| 363 |
+
We explain the structure and conduct experiments for the invertible block here.
|
| 364 |
+
|
| 365 |
+
Structure of invertible blocks Structure of invertible blocks are shown in Fig. 1. We follow the work of Gomez et al. (2017) with two important modifications: (1) We generalize to a family of bijective blocks with different $\psi$ in Eq. 8 in the main paper, while Gomez et al. (2017) restrict the form of $\psi$ to be sum. (2) We propose a parameter state checkpoint method, which enables bijective blocks to be called more than once, while still generating accurate inversion.
|
| 366 |
+
|
| 367 |
+
The algorithm is summarized in Algo. 2. We write the pseudo code for forward and backward function as in PyTorch. Note that we use “inversion” to represent reconstructing input from the output, and use “backward” to denote calculation of the gradient. To reduce memory consumption, in the forward function, we only keep the outputs $y _ { 1 } , y _ { 2 }$ and delete all other variables and computation graphs. In the backward function, we first “inverse” the block to calculate $x _ { 1 } , x _ { 2 }$ from $y _ { 1 } , y _ { 2 }$ , then perform a local forward and calculate the gradient $\frac { \partial [ y _ { 1 } , y _ { 2 } ] } { \partial [ x _ { 1 } , x _ { 2 } ] }$ .
|
| 368 |
+
|
| 369 |
+
Experiments In this section we demonstrate that our bijective block is memory efficient. We trained a GODE model with bijective blocks, and compared the memory consumption using our memory-efficient function as in Algo. 2 and a memory-inefficient method as in conventional backpropagation. Results were measured with a batchsize of 100 on MUTAG dataset.
|
| 370 |
+
|
| 371 |
+
Table 2: Memory consumption of bijective blocks. “Conventional” represents storing activation of all layers in cache, “memory-efficient” represents our method in Algo. 2.
|
| 372 |
+
|
| 373 |
+
<table><tr><td rowspan=1 colspan=1>Depth</td><td rowspan=1 colspan=1>Memory-efficient</td><td rowspan=1 colspan=1>Conventional</td></tr><tr><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>2.2G</td><td rowspan=1 colspan=1>5.3G</td></tr><tr><td rowspan=1 colspan=1>20</td><td rowspan=1 colspan=1>2.6G</td><td rowspan=1 colspan=1>10.5G</td></tr></table>
|
| 374 |
+
|
| 375 |
+
Results are summarized in Table. 2. We measured the memory consumption with different depths, which is the number of ODE blocks. When depth increases from 10 to 20, the memory by conventional methods increases from 5.3G to 10.5G, while our memory-efficient version only increases from 2.2G to 2.6G. In theory, our bijective block takes $\mathcal { O } ( 1 )$ memory, because we only need to store the outputs in cache, while deleting activations of middle layers. For memory-efficient network, the slightly increased memory consumption is because states of $F , G$ need to be cached; but this step takes up minimal memory compared to input data.
|
| 376 |
+
|
| 377 |
+
Algorithm 2: Function for memory-efficient bijective blocks
|
| 378 |
+
|
| 379 |
+
<table><tr><td>Forward (cache,x1,x2,F,G,$) cache.save([F states,G states])</td><td>Backward(cache, y1, y2,F,G,,y, aL aL y2 Reset Fand G states from cache</td></tr><tr><td>forward in Eq. 8</td><td>Inverse from y1,y2 to x1,2</td></tr><tr><td>n1 =F(x1),y2=γ(x2,n1)</td><td>n2 =G(y2),x1=-1(yi,n2)</td></tr><tr><td>n2=G(y2),yi=γ(x1,n2)</td><td>η1 =F(x1),x2=-1(y2,n1)</td></tr><tr><td>delete ni,n2,x1,x2</td><td>Local forward passand gradient</td></tr><tr><td>delete computation graphs generated by F and G return cache,y1, y2</td><td>X1,X2= x1.detach(),x2.detach()</td></tr><tr><td></td><td>calculateY1,Y2 from X1,X2 as Eq. 8</td></tr><tr><td></td><td>determine δ[Yi,Y2]/a[X1,X2,0F,0G]</td></tr><tr><td></td><td>aL aL a[Y,Y2]</td></tr><tr><td></td><td>x1,x2] 0y1,y2]0XX2] aL aL Y,Y2]</td></tr><tr><td></td><td>[0F,G] y1y2]FG]</td></tr><tr><td></td><td>deleteY,Y2,X1,X2</td></tr><tr><td></td><td>return dL/d[x1,x2],δL/δ[0F,0G]</td></tr><tr><td></td><td></td></tr></table>
|
| 380 |
+
|
| 381 |
+
# C PROOF FOR PROPOSITION 1
|
| 382 |
+
|
| 383 |
+
Proposition 1 For an ODE in the form $\begin{array} { r } { \frac { \mathrm { d } \boldsymbol { z } ( t ) } { \mathrm { d } t } = \boldsymbol { f } ( \boldsymbol { z } ( t ) , t ) , } \end{array}$ , denote the Jacobian of $f$ as $J _ { f }$ . If this ODE is stable both in forward-time and reverse-time, then $\operatorname { R e } ( \lambda _ { i } ( J _ { f } ) ) = 0 ~ \forall i$ , where $\lambda _ { i } ( \dot { J } _ { f } )$ is the ith eigenvalue of $J _ { f }$ , and $\mathrm { R e } ( \lambda )$ is the real part of $\lambda$ .
|
| 384 |
+
|
| 385 |
+
Proof Denote $s = T - t$ , where $T$ is the end time. Notice that the reverse-time in $t$ is equivalent to forward-time in $s$ .
|
| 386 |
+
|
| 387 |
+
Therefore, we have forward-time ODE:
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\frac { \mathrm { d } \boldsymbol { z } ( t ) } { \mathrm { d } t } = \boldsymbol { f } ( \boldsymbol { z } ( t ) , t )
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
and reverse-time ODE:
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\frac { \mathrm { d } z ( s ) } { \mathrm { d } s } = - f ( z ( s ) , s ) = g ( z ( s ) , s )
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Therefore, we have $\lambda ( J _ { f } ) = - \lambda ( J _ { g } )$ . For both forward-time and reverse-time ODE to be stable, the eigenvalues of $J$ need to have non-positive real part.
|
| 400 |
+
|
| 401 |
+
Therefore
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\mathrm { R e } \lambda _ { i } ( J _ { f } ) \leq 0 , \ \mathrm { R e } \lambda _ { i } ( J _ { g } ) = - \mathrm { R e } \lambda _ { i } ( J _ { f } ) \leq 0 , \ \forall i
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
The only solution is
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\mathrm { R e } \lambda _ { i } ( J _ { g } ) = - \mathrm { R e } \lambda _ { i } ( J _ { f } ) = 0 , \ \forall i
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
# D PROOF FOR THEOREM 1
|
| 414 |
+
|
| 415 |
+
Theorem 1 For bijective block whose forward and reverse mappings are defined as
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
F o r w a r d ( x _ { 1 } , x _ { 2 } ) = \left\{ \begin{array} { l l } { y _ { 2 } = \psi \Big ( x _ { 2 } , F ( x _ { 1 } ) \Big ) } \\ { y _ { 1 } = \psi \Big ( x _ { 1 } , G ( y _ { 2 } ) \Big ) } \end{array} \right. R e v e r s e ( y _ { 1 } , y _ { 2 } ) = \left\{ \begin{array} { l l } { x _ { 1 } = \psi ^ { - 1 } \Big ( y _ { 1 } , G ( y _ { 2 } ) \Big ) } \\ { x _ { 2 } = \psi ^ { - 1 } \Big ( y _ { 2 } , F ( x _ { 1 } ) \Big ) } \end{array} \right.
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
If $\psi ( \alpha , \beta )$ is a bijective function w.r.t $\alpha$ when $\beta$ is given, then the block is a bijective mapping.
|
| 422 |
+
|
| 423 |
+
Proof To prove the forward mapping is bijective, it is equivalent to prove the mapping is both injective and surjective.
|
| 424 |
+
|
| 425 |
+
Injective We need to prove, if F o $\mathbf { \cdot } w a r d ( x _ { 1 } , x _ { 2 } ) = F o r w a r d ( x _ { 3 } , x _ { 4 } )$ , then $x _ { 1 } = x _ { 3 } , x _ { 2 } = x _ { 4 } $
|
| 426 |
+
|
| 427 |
+
The assumption above is equivalent to
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
{ \begin{array} { r l r } & { } & { F o r w a r d ( x _ { 1 } , x _ { 2 } ) = F o r w a r d ( x _ { 3 } , x _ { 4 } ) \iff y _ { 2 } = \psi ( x _ { 2 } , F ( x _ { 1 } ) ) = \psi ( x _ { 4 } , F ( x _ { 3 } ) ) } \\ & { } & { \psi ( x _ { 1 } , G ( y _ { 2 } ) ) = \psi ( x _ { 3 } , G ( y _ { 2 } ) ) } \end{array} }
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
Since $\psi ( \alpha , \beta )$ is bijective $w . r . t \alpha$ when $\beta$ is given, from Eq.(6), we have $x _ { 1 } = x _ { 3 }$ .
|
| 434 |
+
Similarly, condition on $x _ { 1 } = x _ { 3 }$ and Eq.(5), using bijective property of $\psi$ , we have $x _ { 2 } = x _ { 4 }$ .
|
| 435 |
+
Therefore, the mapping is injective.
|
| 436 |
+
|
| 437 |
+
Surjective We need to prove $\forall [ y _ { 1 } , y _ { 2 } ]$ , ∃ $[ x _ { 1 } , x _ { 2 } ]$ s.t. F orward(x1, x2) = [y1, y2].
|
| 438 |
+
|
| 439 |
+
Given $y _ { 1 } , y _ { 2 }$ , we construct
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
x _ { 1 } = \psi ^ { - 1 } { \Big ( } y _ { 1 } , G ( y _ { 2 } ) { \Big ) } , x _ { 2 } = \psi ^ { - 1 } { \Big ( } y _ { 2 } , F ( x _ { 1 } ) { \Big ) }
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
Then for the forward function, given bijective property of $\psi$ , apply F orward and Reverse defined in the proposition statement,
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
z _ { 2 } = \psi ( x _ { 2 } , F ( x _ { 1 } ) ) = \psi \Bigl ( \psi ^ { - 1 } \bigl ( y _ { 2 } , F ( x _ { 1 } ) \bigr ) , F ( x _ { 1 } ) \Bigr ) = y _ { 2 }
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
z _ { 1 } = \psi ( x _ { 1 } , G ( y _ { 2 } ) ) = \psi \Bigl ( \psi ^ { - 1 } \bigl ( y _ { 1 } , G ( y _ { 2 } ) \bigr ) , G ( y _ { 2 } ) \Bigr ) = y _ { 1 }
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Therefore we construct $x _ { 1 } , x _ { 2 }$ s.t. F orwar $d ( x _ { 1 } , x _ { 2 } ) = [ y _ { 1 } , y _ { 2 } ]$ .
|
| 456 |
+
|
| 457 |
+
Therefore the mapping is surjective.
|
| 458 |
+
|
| 459 |
+
Therefore is bijective.
|
| 460 |
+
|
| 461 |
+
# E DERIVATION OF GRADIENT IN DISCRETE CASE
|
| 462 |
+
|
| 463 |
+
We use a figure to demonstrate the computation graph, and derive the gradient from the computation graph.
|
| 464 |
+
|
| 465 |
+

|
| 466 |
+
|
| 467 |
+
The loss is $L$ , forward pass is denoted with black arrows, gradient back-propagation is shown with red arrows. We use $p$ to denote each path from $\theta$ to $L$ , corresponding to all paths in red that goes from $L$ to $\theta$ .
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
{ \frac { \mathrm { d } L } { \mathrm { d } \theta } } = \sum _ { p } { \frac { \partial L _ { p } } { \partial \theta } } = \sum _ { i } { \frac { \partial L } { \partial z _ { ( } t _ { i } ) } } { \frac { \partial z ( t _ { i } ) } { \partial \theta } } = \sum _ { i } a _ { i } { \frac { \partial z ( t _ { i } ) } { \partial \theta } }
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
a _ { i } = \frac { \partial L } { \partial z ( t _ { i } ) } = \frac { \partial L } { \partial z ( t _ { i + 1 } ) } \frac { \partial z ( t _ { i + 1 } ) } { \partial z ( t _ { i } ) } = a _ { i + 1 } \frac { \partial z ( t _ { i + 1 } ) } { \partial z ( t _ { i } ) }
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
# F DERIVATION OF PARAMETER GRADIENTS IN CONTINUOUS CASE
|
| 478 |
+
|
| 479 |
+
In this section we derive the gradient of parameters in an neural-ODE model from an optimization perspective. Then we extend from continuous cases to discrete cases.
|
| 480 |
+
|
| 481 |
+
Notations With the same notations as in the main paper, we use $z ( t )$ to denote hidden states $z$ at time $t$ . Denote parameters as $\theta$ , and input as $x$ , target as $y$ , and predicted output as $\hat { y }$ . Denote the loss as $J ( \hat { y } , y )$ . Denote the integration time as 0 to $T$ .
|
| 482 |
+
|
| 483 |
+
Problem setup The continuous model is defined to follow an ODE:
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\frac { d z ( t ) } { d t } = f ( z ( t ) , t , \theta ) , s . t . z ( 0 ) = x
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
We assume $f$ is differentiable, since $f$ is represented by a neural network in our case. The forward pass is defined as:
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
\hat { y } = z ( T ) = z ( 0 ) + \int _ { 0 } ^ { T } f ( z ( t ) , t , \theta ) d t
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
The loss function is defined as:
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
J ( \hat { y } , y ) = J ( z ( T ) , y )
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
We formulate the training process as an optimization problem:
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
\operatorname { a r g m i n } _ { \theta } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } J ( \hat { y } _ { i } , y _ { i } ) { s . t . } \frac { d z ( t ) } { d t } = f ( z ( t ) , t , \theta ) , { z } _ { i } ( 0 ) = x _ { i }
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
For simplicity, Eq. 15 only considers one ODE block. In the case of multiple blocks, $z ( T )$ is the input to the next ODE block. As long as we can derive $\textstyle { \frac { d L o s s } { d \theta } }$ and $\begin{array} { r } { \frac { d L o s s } { d z ( 0 ) } } \end{array}$ when $\begin{array} { l } { \frac { d L o s s } { d z ( T ) } } \end{array}$ is given, the same analysis here can be applied to the case with a chain of ODE blocks.
|
| 508 |
+
|
| 509 |
+
Lagrangian Multiplier Method We use the Lagrangian Multiplier Method to solve the problem defined in Eq. 15. For simplicity, only consider one example (can be easily extended to multiple examples cases), the Lagrangian is
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
L = J ( z ( T ) , y ) + \int _ { 0 } ^ { T } \lambda ( t ) [ \frac { d z ( t ) } { d t } - f ( z ( t ) , t , \theta ) ] d t
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
Karush-Kuhn-Tucker (KKT) conditions are necessary conditions for an solution to be optimal. In the following sections we start from the KKT condition and derive our results.
|
| 516 |
+
|
| 517 |
+
Derivative w.r.t. $\lambda$ At optimal point, we have $\begin{array} { r } { \frac { \delta L } { \delta \lambda } = 0 } \end{array}$ . Note that $\lambda$ is a function of $t$ , we derive the derivative from calculus of variation.
|
| 518 |
+
|
| 519 |
+
Consider a cotninuous and differentiable perturbation $\overline { { \lambda ( t ) } }$ on $\lambda ( t )$ , and a scalar $\epsilon$ , $L$ now becomes a function of $\epsilon$ ,
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
L ( \epsilon ) = J ( z ( 0 ) + \int _ { 0 } ^ { T } f ( z ( t ) , t , \theta ) , y ) + \int _ { 0 } ^ { T } ( \lambda ( t ) + \epsilon { \overline { { \lambda ( t ) } } } ) [ { \frac { d z ( t ) } { d t } } - f ( z ( t ) , t , \theta ) ] d t
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
It’s easy to check the conditions for Leibniz integral rule, and we can switch integral and differentiation, thus:
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
\frac { d L } { d \epsilon } = \int _ { 0 } ^ { T } \overline { { \lambda ( t ) } } [ \frac { d z ( t ) } { d t } - f ( z ( t ) , t , \theta ) ] d t
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
At optimal $\begin{array} { r } { \lambda ( t ) , \frac { d L } { d \epsilon } | _ { \epsilon = 0 } = 0 } \end{array}$ for all continuous differentiable $\overline { { \lambda ( t ) } }$
|
| 532 |
+
|
| 533 |
+
Therefore,
|
| 534 |
+
|
| 535 |
+
$$
|
| 536 |
+
\frac { d z ( t ) } { d t } - f ( z ( t ) , t , \theta ) = 0 , \forall t \in ( 0 , T )
|
| 537 |
+
$$
|
| 538 |
+
|
| 539 |
+
Derivative w.r.t $z$ Consider perturbation $\overline { { z ( t ) } }$ on $z ( t )$ , with scale $\epsilon$ . With similar analysis:
|
| 540 |
+
|
| 541 |
+
$$
|
| 542 |
+
L ( \epsilon ) = J ( z ( T ) + \epsilon \overline { { z ( T ) } } , y ) + \int _ { 0 } ^ { T } \lambda ( t ) [ \frac { d z ( t ) + \epsilon \overline { { z ( t ) } } } { d t } - f ( z ( t ) + \epsilon \overline { { z ( t ) } } , t , \theta ) ] d t
|
| 543 |
+
$$
|
| 544 |
+
|
| 545 |
+
Take derivative w.r.t $\epsilon$ , it’s easy to check conditions for Leibniz integral rule are satisfied, when $f$ and $\overline { { z ( t ) } }$ are Lipschitz continuous differentiable functions:
|
| 546 |
+
|
| 547 |
+
(1) $f ( z ( t ) , t , \theta )$ is a Lebesgue-integrable function of $\theta$ for each $\boldsymbol { z } ( t ) \in \mathbf { R } ^ { d }$ , since we use a neural network to represent $f$ , which is continuous and differentiable almost everywhere.
|
| 548 |
+
|
| 549 |
+
(2) for almost all θ, ∂f (z(t),t,θ) exists for almost all $x \in \mathbf { R } ^ { d }$ .
|
| 550 |
+
|
| 551 |
+
(3 ) ∂f(z(t),t,θ)∂z(t) is bounded by g(θ) for all z(t) for almost all θ.
|
| 552 |
+
|
| 553 |
+
Then we calculat e dL()d , note that we can switch integral and derivative:
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\begin{array} { r l } { \frac { d L } { d \varepsilon } | _ { - \infty } = - \frac { \partial J } { \partial \varepsilon ( T ) } \overline { { \varepsilon ( T ) } } + \frac { d } { d \varepsilon } \int _ { 0 } ^ { 2 \pi } \lambda ( t ) \frac { d \varepsilon ( t ) } { d t } + \overline { { \varepsilon ( t ) } } - f ( \varepsilon ( t ) + \varepsilon \overline { { \varepsilon ( t ) } } , t , \theta ) | d t } & { ( 2 1 , \theta ) } \\ & { = \frac { \partial J } { \partial \varepsilon ( T ) } \overline { { \varepsilon ( T ) } } + \int _ { 0 } ^ { 2 \pi } \lambda ( t ) \frac { d \overline { { \varepsilon ( t ) } } } { d t } - \frac { \partial J } { \partial \varepsilon } \frac { \partial \overline { { \varepsilon ( t ) } } ( \varepsilon , t , \theta ) } { \partial \varepsilon ( t ) } \overline { { \varepsilon ( t ) } } | d t } & { ( 2 2 , \theta ) } \\ & { = \frac { \partial J } { \partial \varepsilon ( T ) } \overline { { \varepsilon ( T ) } } + \int _ { 0 } ^ { T } \mathbb { I } ( \lambda ( t ) \frac { d \overline { { \varepsilon ( t ) } } } { d t } + \frac { d \lambda ( t ) } { d t } \overline { { \varepsilon ( t ) } } - \frac { d \lambda ( t ) } { d t } \overline { { \varepsilon ( t ) } } - \lambda ( t ) \frac { \partial \overline { { \varepsilon ( t ) } } ( \varepsilon , t , \theta ) } { \partial \varepsilon ( t ) } \overline { { \varepsilon ( t ) } } | d t } \\ & { = \frac { \partial J } { \partial \varepsilon ( T ) } \overline { { \varepsilon ( T ) } } + \lambda ( t ) \overline { { \varepsilon ( t ) } } | _ { 0 } ^ { \pi } - \int _ { 0 } ^ { T } \overline { { \varepsilon ( t ) } } | \frac { d \lambda ( t ) } { d t } + \lambda ( t ) \frac { \partial \overline { { f } } [ \varepsilon ( t ) , t , \theta ) } { \partial \varepsilon ( t ) } | d t } & { ( 2 4 , \theta ) } \\ & { = \frac { \partial J } { \partial \varepsilon ( T ) } \overline { { \varepsilon ( T ) } } + \lambda ( \overline { { \varepsilon ( T ) } } \overline { { \varepsilon ( T ) } } - \lambda ( t ) \overline { { \varepsilon ( 0 ) } } - \int _ { 0 } ^ { T } \overline { { \varepsilon ( t ) } } | \frac { d \lambda ( t ) } { d t } + \lambda ( t ) \frac { \partial \overline { { f } } ( \varepsilon ( t ) , t , \theta ) } { \partial \varepsilon ( t ) } | d t } & ( 2 \overline { { s } } \end{array}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
Since the initial condition $z ( 0 ) = x$ is given, perturbation $\overline { { z ( 0 ) } }$ at $t = 0$ is 0, then we have:
|
| 560 |
+
|
| 561 |
+
$$
|
| 562 |
+
\frac { d L } { d \epsilon } | _ { \epsilon = 0 } = ( \frac { \partial J } { \partial z ( T ) } + \lambda ( T ) ) \overline { { z ( T ) } } - \int _ { 0 } ^ { T } \overline { { z ( t ) } } [ \frac { d \lambda ( t ) } { d t } + \lambda ( t ) \frac { \partial f ( z ( t ) , t , \theta ) } { \partial z ( t ) } ] d t = 0
|
| 563 |
+
$$
|
| 564 |
+
|
| 565 |
+
for any $\overline { { z ( t ) } }$ s.t. $\overline { { z ( 0 ) } } = 0$ and $\overline { { z ( t ) } }$ is differentiable.
|
| 566 |
+
|
| 567 |
+
The solution is:
|
| 568 |
+
|
| 569 |
+
$$
|
| 570 |
+
\begin{array} { c } { \displaystyle \frac { \partial J } { \partial z ( T ) } + \lambda ( T ) = 0 } \\ { \displaystyle \frac { d \lambda ( t ) } { d t } + \lambda ( t ) \frac { \partial f ( z ( t ) , t , \theta ) } { \partial z ( t ) } = 0 \mathrm { ~ } \forall t \in ( 0 , T ) } \end{array}
|
| 571 |
+
$$
|
| 572 |
+
|
| 573 |
+
Derivative w.r.t $\theta$ From Eq. 16,
|
| 574 |
+
|
| 575 |
+
$$
|
| 576 |
+
\frac { d L } { d \theta } = - \int _ { 0 } ^ { T } \lambda ( t ) \frac { \partial f ( z ( t ) , t , \theta ) } { \partial \theta } d t
|
| 577 |
+
$$
|
| 578 |
+
|
| 579 |
+
To sum up, first solve the ODE forward-in-time with Eq. 19, then determine the boundary condition by Eq. 28, then solve the ODE backward with Eq. 29, and finally calculate the gradient with Eq. 30. In fact $\lambda$ corresponds to the negative adjoint.
|
| 580 |
+
|
| 581 |
+
From continuous to discrete case To derive corresponding results in discrete cases, we need to replace all integration with finite sum.
|
| 582 |
+
|
| 583 |
+
In discrete cases, the ODE condition turns into:
|
| 584 |
+
|
| 585 |
+
$$
|
| 586 |
+
\frac { z _ { i + 1 } - z _ { i } } { t _ { i + 1 } - t _ { i } } = f ( z _ { i } , t _ { i } , \theta )
|
| 587 |
+
$$
|
| 588 |
+
|
| 589 |
+
from Eq. 31, we can get:
|
| 590 |
+
|
| 591 |
+
$$
|
| 592 |
+
\frac { \partial L } { \partial z _ { i } } = \frac { \partial L } { \partial z _ { i + 1 } } \frac { \partial z _ { i + 1 } } { \partial z _ { i } } = \frac { \partial L } { \partial z _ { i + 1 } } ( I + \frac { \partial f ( z _ { i } , t _ { i } , \theta ) } { \partial z _ { i } } ( t _ { i + 1 } - t _ { i } ) )
|
| 593 |
+
$$
|
| 594 |
+
|
| 595 |
+
Re-arranging terms we have:
|
| 596 |
+
|
| 597 |
+
$$
|
| 598 |
+
[ ( - \frac { \partial L } { \partial z _ { i + 1 } } ) - ( - \frac { \partial L } { \partial z _ { i } } ) ] / [ t _ { i + 1 } - t _ { i } ] + ( - \frac { \partial L } { \partial z _ { i + 1 } } ) \frac { \partial f ( z _ { i } , t _ { i } , \theta ) } { \partial z _ { i } } = 0
|
| 599 |
+
$$
|
| 600 |
+
|
| 601 |
+
which is the discrete version of Eq. 29. Which also corresponds to our analysis in Eq. 10 and 11.
|
md/train/SJlsFpVtDB/SJlsFpVtDB.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/SJxUjlBtwB/SJxUjlBtwB.md
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RECONSTRUCTING CONTINUOUS DISTRIBUTIONS OF 3D PROTEIN STRUCTURE FROM CRYO-EM IMAGES
|
| 2 |
+
|
| 3 |
+
Ellen D. Zhong MIT zhonge@mit.edu
|
| 4 |
+
|
| 5 |
+
Tristan Bepler MIT tbepler@mit.edu
|
| 6 |
+
|
| 7 |
+
Joseph H. Davis∗ MIT jhdavis@mit.edu
|
| 8 |
+
|
| 9 |
+
Bonnie Berger∗ MIT bab@mit.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Cryo-electron microscopy (cryo-EM) is a powerful technique for determining the structure of proteins and other macromolecular complexes at near-atomic resolution. In single particle cryo-EM, the central problem is to reconstruct the 3D structure of a macromolecule from $1 0 ^ { 4 - 7 }$ noisy and randomly oriented 2D projection images. However, the imaged protein complexes may exhibit structural variability, which complicates reconstruction and is typically addressed using discrete clustering approaches that fail to capture the full range of protein dynamics. Here, we introduce a novel method for cryo-EM reconstruction that extends naturally to modeling continuous generative factors of structural heterogeneity. This method encodes structures in Fourier space using coordinate-based deep neural networks, and trains these networks from unlabeled 2D cryo-EM images by combining exact inference over image orientation with variational inference for structural heterogeneity. We demonstrate that the proposed method, termed cryoDRGN, can perform ab initio reconstruction of 3D protein complexes from simulated and real 2D cryo-EM image data. To our knowledge, cryoDRGN is the first neural networkbased approach for cryo-EM reconstruction and the first end-to-end method for directly reconstructing continuous ensembles of protein structures from cryo-EM images.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Cryo-electron microscopy (cryo-EM) is a Nobel Prize-winning technique capable of determining the structure of proteins and macromolecular complexes at near-atomic resolution. In a single particle cryo-EM experiment, a purified solution of the target protein or biomolecular complex is frozen in a thin layer of vitreous ice and imaged at sub-nanometer resolution using an electron microscope. After initial preprocessing and segmentation of the raw data, the dataset typically comprises $1 0 ^ { 4 ^ { 2 } - 7 }$ noisy projection images. Each image contains a separate instance of the molecule, recorded as the molecule’s electron density integrated along the imaging axis (Figure 1). A major bottleneck in cryo-EM structure determination is the computational task of 3D reconstruction, where the goal is to solve the inverse problem of learning the structure, i.e. the 3D electron density volume, which gave rise to the projection images. Unlike classic tomographic reconstruction (e.g. MRI), cryoEM reconstruction is complicated by the unknown orientation of each copy of the molecule in the ice. Furthermore, cryo-EM reconstruction algorithms must handle challenges such as an extremely low signal to noise ratio (SNR), unknown in-plane translations, imperfect signal transfer due to microscope optics, and discretization of the measurements. Despite these challenges, continuing advances in hardware and software have enabled structure determination at near-atomic resolution for rigid proteins (Kühlbrandt (2014); Scheres (2012b); Renaud et al. (2018); Li et al. (2013)).
|
| 18 |
+
|
| 19 |
+
Many proteins and other biomolecules are intrinsically flexible and undergo large conformational changes to perform their function. Since each cryo-EM image contains a unique instance of the molecule of interest, cryo-EM has the potential to resolve structural heterogeneity, which is experimentally infeasible with other structural biology techniques such as X-ray crystallography. However, this heterogeneity poses a substantial challenge for reconstruction as each image is no longer of the same structure. Traditional reconstruction algorithms address heterogeneity with discrete clustering approaches, however, protein conformations are continuous and may be poorly approximated with discrete clusters (Malhotra & Udgaonkar (2016); Nakane et al. (2018)).
|
| 20 |
+
|
| 21 |
+
Here, we introduce a neural network-based reconstruction algorithm that learns a continuous low-dimensional manifold over a protein’s conformational states from unlabeled 2D cryoEM images. We present an end-to-end learning framework for a generative model over 3D volumes using an image encoder-volume decoder neural network architecture. Extending spatialVAE, we formulate our decoder as a function of 3D Cartesian coordinates and unconstrained latent variables representing factors of image variation that we expect to result from protein structural heterogeneity (Bepler et al. (2019)). All inference is performed in Fourier space, which allows us to efficiently relate 2D projections to 3D volumes via the Fourier slice theorem. By
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Cryo-EM reconstruction algorithms tackle the inverse problem of determining the 3D electron density volume from 104−7 noisy images. Each image is a noisy projection of a unique instance of the molecule suspended in ice at a random orientation. Algorithms must jointly learn the volume and the orientation of each particle image. Example image from Wong et al. (2014).
|
| 25 |
+
|
| 26 |
+
formulating our decoder as a function of Cartesian coordinates, we can explicitly model the imaging operation to disentangle the orientation of the molecule during imaging from intrinsic protein structural heterogeneity. Our learning framework avoids errant local minima in image orientation by optimizing with exact inference over a discretization of $S O ( 3 ) \times \mathbb { R } ^ { 2 }$ using a branch and bound algorithm. The unconstrained latent variables are trained in the standard variational autoencoder approach. We present results on both real and simulated cryo-EM data.
|
| 27 |
+
|
| 28 |
+
# 2 BACKGROUND AND NOTATION
|
| 29 |
+
|
| 30 |
+
# 2.1 IMAGE FORMATION MODEL
|
| 31 |
+
|
| 32 |
+
Cryo-EM aims to recover a structure of interest $V : \mathbb { R } ^ { 3 } \mathbb { R }$ consisting of an electron density at each point in space based on a collection of noisy images $X _ { 1 } , . . . , X _ { N }$ produced by projecting (i.e. integrating) the volume in an unknown orientation along the imaging axis. Formally, the generation of image $X$ can be modeled as:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
X ( r _ { x } , r _ { y } ) = g * \int _ { \mathbb { R } } V ( R ^ { T } { \mathbf { r } } + t ) d r _ { z } + n o i s e \mathbf { r } \qquad { \mathbf { r } } = ( r _ { x } , r _ { y } , r _ { z } ) ^ { T }
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $V$ is the electron density (volume), $R \in S O ( 3 )$ , the 3D rotation group, is an unknown orientation of the volume, and $t = ( t x , t y , 0 )$ is an unknown in-plane translation, corresponding to imperfect centering of the volume within the image. The image signal is convolved with $g$ , the point spread function for the microscope before being corrupted with frequency-dependent noise and registered on a discrete grid of size DxD, where $\mathrm { D }$ is the size of the image along one dimension.
|
| 39 |
+
|
| 40 |
+
The reconstruction problem is simplified by the observation that the Fourier transform of a 2D projection of $V$ is a 2D slice through the origin of $V$ in the Fourier domain, where the slice is perpendicular to the projection direction. This correspondence is known as the Fourier slice theorem (Bracewell (1956)). In the Fourier domain, the generative process for image $\hat { X }$ from volume $\hat { V }$ can thus be written:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\hat { X } ( k _ { x } , k _ { y } ) = \hat { g } S ( t ) A ( R ) \hat { V } ( k _ { x } , k _ { y } ) + \epsilon
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $\hat { g } = \mathcal { F } g$ is the contrast transfer function (CTF) of the microscope, $S ( t )$ is a phase shift operator corresponding to image translation by $t$ in real space, and $A ( R ) \hat { V } = \hat { V } ( R ^ { T } ( \cdot , \cdot , 0 ) ^ { T } )$ is a linear slice operator corresponding to rotation by $R$ and linear projection along the $\mathbf { Z }$ -axis in real space. The frequency-dependent noise $\epsilon$ is typically modelled as independent, zero-centered Gaussian noise in Fourier space. Under this model, the probability of of observing an image $\hat { X }$ with pose $\phi = ( R , t )$ from volume $\hat { V }$ is thus:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
p ( \hat { X } | \phi , \hat { V } ) = p ( \hat { X } | R , t , \hat { V } ) = \frac { 1 } { Z } \exp \Bigg ( \sum _ { l } \frac { - 1 } { 2 \sigma _ { l } ^ { 2 } } \left| \hat { g } _ { l } A _ { l } ( R ) \hat { V } - S _ { l } ( t ) \hat { X } _ { l } \right| ^ { 2 } \Bigg )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $l$ is a two-component index over Fourier coefficients for the image, $\sigma _ { l }$ is the width of the Gaussian noise expected at each frequency, and $Z$ is a normalization constant.
|
| 53 |
+
|
| 54 |
+
# 2.2 TRADITIONAL CRYO-EM RECONSTRUCTION
|
| 55 |
+
|
| 56 |
+
To recover the desired structure, cryo-EM reconstruction methods must jointly solve for the unknown volume $V$ and image poses $\phi _ { i } = ( R _ { i } , t _ { i } )$ . Expectation maximization (Scheres (2012a)) and simpler variants of coordinate ascent are typically employed to find a maximum a posteriori estimate of $V$ marginalizing over the posterior distribution of $\phi _ { i }$ ’s, i.e.:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
V ^ { \mathrm { M A P } } = \underset { V } { \arg \operatorname* { m a x } } \sum _ { i = 1 } ^ { N } \log \int p ( X _ { i } | \phi , V ) p ( \phi ) d \phi + \log p ( V )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Intuitively, given $V ^ { ( n ) }$ , the estimate of the volume at iteration $n$ , images are first aligned with $V ^ { ( n ) }$ (Estep), then with the updated alignments, the images are backprojected to yield $V ^ { ( n + 1 ) }$ (M-step). This iterative refinement procedure is sensitive to the initial estimate of $V$ as the optimization objective is highly nonconvex; stochastic gradient descent is commonly used for ab initio reconstruction1 to provide an initial estimate $V ^ { ( 0 ) }$ (Punjani et al. (2017)).
|
| 63 |
+
|
| 64 |
+
Given sample heterogeneity, the standard approach in the cryo-EM field is to simultaneously reconstruct $K$ independent volumes. Termed multiclass refinement, the image formation model is extended to assume images are generated from $V _ { 1 } , . . . , V _ { K }$ independent volumes, with inference now requiring marginalization over $\phi _ { i }$ ’s and class assignment probabilities $\pi _ { j }$ ’s:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\underset { V _ { 1 } , . . . , V _ { K } } { \arg \operatorname* { m a x } } \ \sum _ { i = 1 } ^ { N } \log \sum _ { j = 1 } ^ { K } \left( \pi _ { j } \int p ( X _ { i } | \phi , V _ { j } ) p ( \phi ) d \phi \right) + \sum _ { j = 1 } ^ { K } \log p ( V _ { j } )
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
While this formulation is sufficiently descriptive when the structural heterogeneity consists of a small number of discrete conformations, it suffers when the heterogeneity is complex or when conformations lie along a continuum of states. In practice, resolving such heterogeneity is handled through a hierarchical approach refining subsets of the imaging dataset with manual choices for the number of classes and the initial models for refinement. Because the number and nature of the underlying structural states are unknown, multiclass refinement is error-prone, and in general, the identification and analysis of heterogeneity is an open problem in single particle cryo-EM.
|
| 71 |
+
|
| 72 |
+
# 3 METHODS
|
| 73 |
+
|
| 74 |
+
We propose a neural network-based reconstruction method, cryoDRGN (Deep Reconstructing Generative Networks), that can perform ab-initio unsupervised reconstruction of a continuous distribution over 3D volumes from unlabeled 2D images (Figure 2). We formulate an image encoder-volume decoder architecture based on the variational autoencoder (VAE) (Kingma & Welling (2013)), where protein structural heterogeneity is modeled in the latent variable. While a standard VAE assumes all sources of image heterogeneity are entangled in the latent variable, we propose an architecture that enables modelling the intrinsic heterogeneity of the volume separately from the extrinsic orientation of the volume during imaging. Our end-to-end training framework explicitly models the forward image formation process to relate 2D views to 3D volumes and employs two separate strategies for inference: a variational approach for the unconstrained latent variables and a global search over $S O ( 3 ) \times \mathbb { R } ^ { 2 }$ for the unknown pose of each image. These elements are described in further detail below.
|
| 75 |
+
|
| 76 |
+
# 3.1 GENERATIVE MODEL
|
| 77 |
+
|
| 78 |
+
We design a deep generative model to approximate a single function, $\hat { V } : \mathbb { R } ^ { 3 + n } \mathbb { R }$ , representing a n-dimensional manifold of 3D electron densities in the Fourier domain. Specifically, the volume $\hat { V }$ is modelled as a probabilistic decoder $p _ { \theta } ( \hat { V } | k , z )$ , where $\theta$ are parameters of a multilayer perceptron (MLP). Given Cartesian coordinates $k \in \mathbb { R } ^ { 3 }$ and continuous latent variable $z$ , the decoder outputs distribution parameters for a Gaussian distribution over $\hat { V } ( \boldsymbol { k } , z )$ , i.e. the electron density of volume $\hat { V } _ { z }$ at frequency $k$ in Fourier space. Unlike a standard deconvolutional decoder which produces a separate distribution for each voxel of a $D ^ { 3 }$ lattice given the latent variable, following spatial-VAE, we model a function over Cartesian coordinates (Bepler et al. (2019)). Here, these coordinates are explicitly treated as each pixel’s location in 3D Fourier space and thus enforce the topological constraints between 2D views in 3D via the Fourier slice theorem.
|
| 79 |
+
|
| 80 |
+
By the image formation model, each image corresponds to an oriented central slice of the 3D volume in the Fourier domain (Section 2). During training, the 3D coordinates of an image’s pixels can be explicitly represented by the rotation of a $\mathrm { D x D }$ lattice initially on the $\mathbf { X }$ -y plane. Under this model, the log probability of an image, $\hat { X }$ , represented as a vector of size DxD, given the current MLP, latent pose variables $\bar { R ^ { \prime } } \in S O ( 3 )$ and $t \in \mathbb { R } ^ { 2 }$ , and unconstrained latent variable, $z$ , is:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\log p ( \hat { X } | R , t , z ) = \log p ( \hat { X } ^ { \prime } | R , z ) = \sum _ { i } \log p _ { \theta } ( \hat { V } | R ^ { T } c _ { 0 } ^ { ( i ) } , z )
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $i$ indexes over the coordinates of a fixed lattice $c _ { 0 }$ . Note that ${ \hat { X } } ^ { \prime } = S ( - t ) { \hat { X } }$ is the centered image, where $S$ is the phase shift operator corresponding to image translation in real space. We define $c _ { 0 }$ as a vector of 3D coordinates of a fixed lattice spanning $[ - 0 . { \overset { - } { . } } , 0 . 5 ] ^ { 2 }$ on the x-y plane to represent the unoriented coordinates of an image’s pixels.
|
| 87 |
+
|
| 88 |
+
Instead of directly supplying $k$ , a fixed positional encoding of $k$ is supplied to the decoder, consisting of sine and cosine waves of varying frequency:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
p e ^ { ( 2 i ) } ( k _ { j } ) = s i n ( k _ { j } D \pi ( 2 / D ) ^ { 2 i / D } ) , i = 1 , . . . , D / 2 ; k _ { j } \in k
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
p e ^ { ( 2 i + 1 ) } ( k _ { j } ) = c o s ( k _ { j } D \pi ( 2 / D ) ^ { 2 i / D } ) , i = 1 , . . . , D / 2 ; k _ { j } \in k
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
Without loss of generality, we assume a length scale by our definition of $c _ { 0 }$ which restricts the support of the volume to a sphere of radius 0.5. The wavelengths of the positional encoding thus follow a geometric series spanning the Fourier basis from wavelength 1 to the Nyquist limit $( 2 / D )$ of the image data. While this encoding empirically works well for noiseless data, we obtain better results with a slightly modified featurization for noisy datasets consisting of a geometric series which excludes the top 10 percentile of highest frequency components of the noiseless positional encoding.
|
| 99 |
+
|
| 100 |
+
# 3.2 INFERENCE
|
| 101 |
+
|
| 102 |
+
We employ a standard VAE for approximate inference of the latent variable $z$ , but use a global search to infer the pose $\phi = ( R , t )$ using a branch and bound algorithm.
|
| 103 |
+
|
| 104 |
+
Variational encoder: As each cryo-EM image is a noisy projection of an instance of the volume at a random, unknown pose (viewing direction), the image encoder aims to learn a pose-invariant representation of the protein’s structural heterogeneity. Following the standard VAE framework, the probabilistic encoder $q _ { \xi } ( z | \hat { X } )$ is a MLP with variational parameters $\xi$ and Gaussian output with diagonal covariance. Given an input cryo-EM image $\hat { X }$ , represented as a $\mathrm { D x D }$ vector, the encoder MLP outputs $\mu _ { z | \hat { X } }$ and $\Sigma _ { z | \hat { X } }$ , statistics that parameterize an approximate posterior to the intractable true posterior $p ( z | \hat { X } )$ . The prior on $z$ is a standard normal, $\mathcal { N } ( 0 , \bf { I } )$ .
|
| 105 |
+
|
| 106 |
+
Pose inference: We perform a global search over $S O ( 3 ) \times \mathbb { R } ^ { 2 }$ for the maximum-likelihood pose for each image given the current decoder MLP and a sampled value of $z$ from the approximate posterior. Two techniques are used to improve the efficiency of the search over poses: (1) discretizing the search space on a uniform grid and sub-dividing grid points after pruning candidate poses with branch and bound (BNB), and (2) band pass limiting the objective to low frequency components and incrementally increasing the $\mathbf { k }$ -space limit at each iteration (frequency marching). The pose inference procedure encodes the intuition that low-frequency components dominate pose estimation, and is fully described in Appendix A.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 2: CryoDRGN model architecture. We use a VAE to perform approximate inference for latent variable $z$ denoting image heterogeneity. The decoder reconstructs an image pixel by pixel given $z$ and $p e ( k )$ , the positional encoding of 3D Cartesian coordinates. The 3D coordinates corresponding to each image pixel are obtained by rotating a DxD lattice on the x-y plane by $R$ , the image orientation. The latent orientation for each image is inferred through a branch and bound global optimization procedure (not shown).
|
| 110 |
+
|
| 111 |
+
In summary, for a given image ${ \hat { X } } _ { i }$ , the image encoder produces $\mu _ { z | \hat { X _ { i } } }$ and $\Sigma _ { z | \hat { X } _ { i } }$ . A sampled value of the latent $z _ { i } \sim \mathcal N ( \mu _ { z | \hat { X } _ { i } } , \Sigma _ { z | \hat { X } _ { i } } )$ is broadcast to all pixels. Given $z _ { i }$ and the current decoder, BNB orientational search identifies the maximum likelihood rotation $R _ { i }$ and translation $t _ { i }$ for ${ \hat { X } } _ { i }$ . The decoder $p _ { \theta }$ then reconstructs the image pixel by pixel given the positional encoding of $R _ { i } ^ { T } c _ { 0 }$ and $z _ { i }$ . The phase shift corresponding to $t _ { i }$ and optionally the microscope CTF $\hat { g } _ { i }$ is then applied on the reconstructed pixel intensities. Following the standard VAE framework, the optimization objective is the variational lower bound of the model evidence:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathcal { L } ( \hat { X } _ { i } ; \xi , \theta ) = \mathbb { E } _ { q _ { \xi } ( z | \hat { X } _ { i } ) } [ \log p _ { \theta } ( \hat { X } _ { i } | z ) ] - K L ( q _ { \xi } ( z | \hat { X } _ { i } ) | | p ( z ) )
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where the expectation of the log likelihood is estimated with one Monte Carlo sample. By comparing many 2D slices from the imaging dataset, the volume can be learned through feedback from these single views. Furthermore, this learning process is denoising as overfitting to noise from a single image would lead to higher reconstruction error for other views. We note that the distribution of 3D volumes models heterogeneity within a single imaging dataset, capturing structural variation for a particular protein or biomolecular complex, and that a separate network is trained per experimental dataset. Unless otherwise specified, the encoder and decoder networks are both MLPs containing 10 hidden layers of dimension 128 with ReLU activations. Further architecture and implementation details are given in Appendix A.
|
| 118 |
+
|
| 119 |
+
# 4 RELATED WORK
|
| 120 |
+
|
| 121 |
+
Homogeneous cryo-EM reconstruction: Cryo-EM reconstruction is typically accomplished in two stages: 1) generation of an initial low-resolution model followed by 2) iterative refinement of the initial model with a coordinate ascent procedure alternating between projection matching and refinement of the structure. In practice, initial structures can be obtained experimentally (Leschziner & Nogales (2006)), inferred based on homology to complexes with known structure, or via ab-initio reconstruction with stochastic gradient descent (Punjani et al. (2017)). Once an initial model is generated, there are many tools for iterative refinement of the model (Scheres (2012b); Punjani et al. (2017); Hohn et al. (2007); Lyumkis, Dmitry et al. (2013); Tang et al. (2007)). For example, Scheres (2012a) presents a Bayesian approach based on a probabilistic model of the image formation process and refines the structure via Expectation Maximization. Frequency marching is used extensively in existing tools to speed up the search for the optimal pose for each image (Scheres (2012b); Barnett et al. (2016); Punjani et al. (2017)). CryoSPARC implements a branch and bound optimization scheme, where their bound is a probabilistic lower bound based on the noise characteristics from the image formation model (Punjani et al. (2017)). Ullrich et al. (2019) propose a differentiable voxelbased representation for the volume and introduce a variational inference algorithm for homogeneous reconstruction with known poses.
|
| 122 |
+
|
| 123 |
+
Heterogeneous cryo-EM reconstruction: In the cryo-EM literature, standard approaches for addressing structural heterogeneity use mixture models of discrete, independent volumes, termed multiclass refinement (Scheres (2010); Lyumkis, Dmitry et al. (2013)). These mixture models assume that the clusters are independent and homogeneous, and in practice require many rounds of expertguided hierarchical clustering from appropriate initial volumes and manual choices for number of clusters. More recently, Nakane et al. (2018) extend the image generative model to model the protein as a sum of rigid bodies (determined from a homogeneous reconstruction), thus imposing structural assumptions on the type of heterogeneity. Frank & Ourmazd (2016) aim to build a continuous manifold of the images, however their approach requires pose supervision and final structures are obtained by clustering the images along the manifold and reconstructing with traditional tools. Recent theoretical work for continuous heterogeneous reconstruction includes expansion of discrete 3D volumes in a basis of Laplacian eigenvectors (Moscovich et al. (2019)) and a general framework for modelling hyper-volumes (Lederman et al. (2019)) e.g. as a tensor product of spatial and temporal basis functions (Lederman & Singer (2017)). To our knowledge, our work is the first to apply deep neural networks to cryo-EM reconstruction, and in doing so, is the first that can learn a continually heterogeneous volume from real cryo-EM data.
|
| 124 |
+
|
| 125 |
+
Neural network 3D reconstruction in computer vision: There is a large body of work in computer vision on 3D object reconstruction from 2D viewpoints. While these general approaches have elements in common with single particle cryo-EM reconstruction, the problem in the context of computer vision differs substantially in that 2D viewpoints are not projections and viewing directions are typically known. For example, Yan et al. (2016) propose a neural network that can predict a 3D volume from a single 2D viewpoint using only 2D image supervision. Gadelha et al. (2017) learn a generative model over 3D object shapes based on 2D images of the objects thereby disentangling variation in shape and pose. Tulsiani et al. (2018) also reconstruct and disentangle the shape and pose of 3D objects from 2D images by enforcing geometric consistency. These works attempt to encode the viewpoint ‘projection’ operation 2 explicitly in the model in a manner similar to our use of the Fourier slice theorem.
|
| 126 |
+
|
| 127 |
+
Coordinate-based neural networks in computer vision: Using spatial (i.e. pixel) coordinates as features to a convolutional decoder to improve generative modeling has been proposed many times, with recent work computing each image as a function of a fixed coordinate lattice and latent variables (Watters et al. (2019)). However, directly modeling a function that maps spatial coordinates to values is less extensively explored. In CocoNet, the authors present a deep neural network that maps 2D pixel coordinates to RBG color values. CocoNet learns an image model for single images, using the capacity of the network to memorize the image, which can then be used for various tasks such as denoising and upsampling (Bricman & Ionescu (2018)). Similarly, Spatial-VAE proposes a similar coordinate-based image model to enforce geometric consistency between rotated 2D images in order to learn latent image factors and disentangle positional information from image content (Bepler et al. (2019)). Our method extends many of these ideas from simpler 2D image modelling to enable 3D cryo-EM reconstruction in the Fourier domain.
|
| 128 |
+
|
| 129 |
+
# 5 RESULTS
|
| 130 |
+
|
| 131 |
+
Here, we present both qualitative and quantitative results for 1) homogeneous cryo-EM reconstruction, validating that cryoDRGN reconstructed volumes match those from existing tools; 2) heterogeneous cryo-EM reconstruction with pose supervision, demonstrating automatic learning of the latent manifold that previously required many expert-guided rounds of multiclass refinement; and 3) fully unsupervised reconstruction of continuous distributions of 3D protein structures, a capability not provided by any existing tool.
|
| 132 |
+
|
| 133 |
+
# 5.1 UNSUPERVISED HOMOGENEOUS RECONSTRUCTION
|
| 134 |
+
|
| 135 |
+
We first evaluate cryoDRGN on homogeneous datasets, where existing tools are capable of reconstruction. We create two synthetic datasets following the cryo-EM image formation model (image size $\scriptstyle \mathrm { D } = 1 2 8$ , 50k projections, with and without noise), and use one real dataset from EMPIAR-10028 consisting of 105,247 images of the 80S ribosome downsampled to image size $\scriptstyle \mathrm { D = } 9 0$ . The encoder network is not used in homogeneous reconstruction. As a baseline for comparison, we perform homogeneous $a b$ -initio reconstruction followed by iterative refinement in cryoSPARC (Punjani et al. (2017)). We compare against cryoSPARC as a representative of traditional state-of-the-art tools, which all implement variants of the same algorithm (Section 2). Further dataset preprocessing and training details are given in Appendix B.
|
| 136 |
+
|
| 137 |
+
We find that cryoDRGN inferred poses and reconstructed volumes match those from state ofthe-art tools. The similarity of the volumes to the ground truth can be quantified with the with the Fourier shell correlation (FSC) curve3. Reconstructed volumes and quantitative comparison with the FSC curve is given in Figure S5. Pose error to the ground truth image poses are
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Method</td><td colspan="2">Dataset</td></tr><tr><td>cryoSPARC</td><td>No Noise</td><td>SNR=0.1 0.002/0.64</td></tr><tr><td rowspan="2">cryoDRGN</td><td>0.0009/ /0.47</td><td></td></tr><tr><td>0.0004/0.27</td><td>0.003/0.38</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 1: Homogeneous reconstruction pose accuracy quantified by median rotation/translation error to the ground truth image poses. Rotation/translation error is defined as the Frobenius/L2 norm after alignment.
|
| 142 |
+
|
| 143 |
+
given in Table 1. For the real cryoEM dataset (no ground truth), the median pose difference between cryoDRGN and cryoSPARC reconstructions is 0.002 for rotations and 1.0 pixels for translations, and the resulting volumes are correlated above a FSC cutoff of 0.5 across all frequencies.
|
| 144 |
+
|
| 145 |
+
# 5.2 HETEROGENEOUS RECONSTRUCTION WITH POSE SUPERVISION
|
| 146 |
+
|
| 147 |
+
Next, we evaluate cryoDRGN for heterogeneous cryo-EM reconstruction on EMPIAR-10076, a real dataset of the $E$ . coli large ribosomal subunit (LSU) undergoing assembly (131,899 images, downsampled to ${ \mathrm { D } } { = } 9 0 \ \mathrm { \Omega }$ ) (Davis et al. (2016)). Here, poses are obtained through alignment to an existing structure of the LSU and treated as known during training. In the original analysis of this dataset, multiple rounds of discrete multiclass refinement with varying number of classes followed by human comparison of similar volumes were used to identify 4 major structural states of the LSU. We train cryoDRGN with a 1-D latent variable treating image pose as fixed to skip BNB pose inference. As a baseline, we reproduce the published structures originally obtained through multiclass refinement with cryoSPARC. Further baseline and training details are given in Appendix C.
|
| 148 |
+
|
| 149 |
+
We find that CryoDRGN automatically identifies all 4 major states of the LSU (Figure 3a). Quantitative comparison with FSC curves3 and additional volumes along the latent space are shown in Figure S7. We compare the cryoDRGN latent encoding $\mu _ { z | X }$ for each image to the MAP cluster assignment in cryoSPARC and find that the learned latent manifold aligns with cryoSPARC clusters (Figure 3b). CryoDRGN identifies subpopulations in some of the cryoSPARC clusters (e.g. Class D), which is partitioned by a subsequent round of cryoSPARC multiclass refinement (Figure S8). Published structures A and F correspond to impurities in the sample. CryoDRGN correctly assigns images from these impurities to distinct clusters, but does not learn their correct structure since the poses inferred from aligning to the LSU template structure are incorrect.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: a) Volumes generated at values of the latent (at dashed lines) match the published volumes of the 4 major states B-E of the LSU. b) Distribution of images in the latent space, colored by cluster assignment from a discrete multiclass reconstruction in cryoSPARC.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 4: Left: Ground truth volume containing a continuous circular 1D motion. Middle: Reconstructed structures from cryoDRGN match the ground truth volumes with the correct continuous deformation. We visualize 10 structures (superimposed) sampled at the depicted points in the latent space. The distribution of images in the latent space (visualized in 2D with PCA) matches the topology of the true data manifold. Right: Reconstructed volumes from discrete 3-class reconstruction in cryoSPARC and the distribution of images over the three reconstructed volumes.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Dataset</td><td>cryoDRGN</td><td>cryoDRGN+tilt</td><td>cryoSPARC</td></tr><tr><td>Linear 1D motion</td><td>2.50(0.62)</td><td>2.35(0.36)</td><td>3.60(2.27)</td></tr><tr><td>Linear 2D motion</td><td>4.44(2.50)</td><td>2.93(1.02)</td><td>6.90(3.77)</td></tr><tr><td>Circular :1D motion</td><td>4.05(2.40)</td><td>2.63(0.74)</td><td>4.87(2.17)</td></tr><tr><td>Discrete 10 class</td><td>4.95(3.16)</td><td>2.58(1.00)</td><td>5.69(5.15)</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 2: Reconstruction accuracy quantified by an $\mathrm { F S C } { = } 0 . 5$ resolution metric between the reconstructed volumes corresponding to each image and its ground truth volume. We report the average and standard deviation across 100 images in the dataset (lower is better; best possible is 2 pixels).
|
| 160 |
+
|
| 161 |
+
# 5.3 UNSUPERVISED HETEROGENEOUS RECONSTRUCTION
|
| 162 |
+
|
| 163 |
+
We test the ability of cryoDRGN to perform fully unsupervised heterogeneous reconstruction from datasets with different latent structure. We generate four datasets (each $5 0 \mathrm { k }$ projections, $\scriptstyle \mathrm { D = 6 4 }$ ) from an atomic model of a protein complex, containing either a 1D continuous motion, 2D continuous motion, 1D continuous circular motion, or a mixture of 10 discrete conformations (Figure S7). We train cryoDRGN with a 1D latent variable for the linear 1D dataset and a 10D latent variable for the other 3 datasets. As a baseline, we perform multiclass reconstruction in cryoSPARC sweeping ${ \tt K } = 2 \cdot 5$ classes. We compare against ${ \mathrm { K } } { = } 3$ , which had the best qualitative results.
|
| 164 |
+
|
| 165 |
+
We also propose a modification to cryoDRGN in order to train on tilt series pairs datasets. Tilt series pairs is a variant of cryo-EM in which, for each image $X _ { i }$ , a corresponding image $X _ { i } ^ { ' }$ is acquired after tilting the imaging stage by a known angle. This technique was originally employed to identify the chirality of molecules (Belnap et al. (1997)), which is lost in the projection from 3D to 2D. We propose using tilt series pairs to encourage invariance of $q _ { \xi }$ with respect to pose transformations for a given $\hat { V } _ { \mathbf { z } }$ (and incidentally to identify the chirality of $\hat { V } _ { \mathbf { z } }$ ). We make minor modifications to the architecture as described in Appendix D.
|
| 166 |
+
|
| 167 |
+
In Figure 4, we show that cryoDRGN reconstructed volumes for the circular 1D dataset qualitatively match the ground truth structures. Note that while we only visualize 10 structures sampled along the latent space, the volume decoder can reconstruct the full continuum of states. In contrast, cryoSPARC multiclass reconstruction, a discrete mixture model of independent structures, is only able to reconstruct 2 (originally unaligned) structures which resemble the ground truth. Volumes contain blurring artifacts from clustering images from different conformations into the assumedhomogeneous clusters in the mixture model. Results for the remaining datasets are given in Figures S10-13.
|
| 168 |
+
|
| 169 |
+
We quantitatively measure performance on this task with an FSC resolution metric computed between the MAP volume for each image $V _ { z _ { i } | \hat { X } _ { i } }$ and the ground truth volume which generated each image, averaged across images in the dataset (Table S4). We find that cryoDRGN reconstruction accuracy is much higher than state-of-the-art discrete multiclass reconstruction in cryoSPARC, with further improvement achieved by training on tilt series pairs.
|
| 170 |
+
|
| 171 |
+
# 6 CONCLUSIONS
|
| 172 |
+
|
| 173 |
+
We present a novel neural network-based reconstruction method for single particle cryo-EM that learns continuous variation in protein structure. We applied cryoDRGN on a real dataset of highly heterogeneous ribosome assembly intermediates and demonstrate automatic partitioning of structural states. In the presence of simulated continuous heterogeneity, we show that cryoDRGN learns a continuous representation of structure along the true reaction coordinate, effectively disentangling imaging orientation from intrinsic structural heterogeneity. The techniques described here may also have broader applicability to image and volume generative modelling in other domains of computer vision and 3D shape reconstruction.
|
| 174 |
+
|
| 175 |
+
# ACKNOWLEDGMENTS
|
| 176 |
+
|
| 177 |
+
We thank Ben Demeo, Ashwin Narayan, Adam Lerer, Roy Lederman, and Kotaro Kelley for helpful discussions and feedback. This work was funded by the National Science Foundation Graduate Research Fellowship Program, NIH grant R01-GM081871, NIH grant R00-AG050749, and the MIT J-Clinic for Machine Learning and Health.
|
| 178 |
+
|
| 179 |
+
# REFERENCES
|
| 180 |
+
|
| 181 |
+
Alex Barnett, Leslie Greengard, Andras Pataki, and Marina Spivak. Rapid solution of the cryo-EM reconstruction problem by frequency marching. arXiv.org, October 2016.
|
| 182 |
+
|
| 183 |
+
William T Baxter, Robert A Grassucci, Haixiao Gao, and Joachim Frank. Determination of signal-tonoise ratios and spectral SNRs in cryo-EM low-dose imaging of molecules. Journal of structural biology, 166(2):126–132, May 2009.
|
| 184 |
+
|
| 185 |
+
D M Belnap, N H Olson, and T S Baker. A method for establishing the handedness of biological macromolecules. Journal of structural biology, 120(1):44–51, October 1997.
|
| 186 |
+
|
| 187 |
+
Tristan Bepler, Ellen Zhong, Kotaro Kelley, Edward Brignole, and Bonnie Berger. Explicitly disentangling image content from rotation and translation with spatial-VAE. Neural Informational Processing Systems (NeurIPS), 2019.
|
| 188 |
+
|
| 189 |
+
Ronald N Bracewell. Strip integration in radio astronomy. Australian Journal of Physics, 9(2): 198–217, 1956.
|
| 190 |
+
|
| 191 |
+
Paul Andrei Bricman and Radu Tudor Ionescu. CocoNet: A deep neural network for mapping pixel coordinates to color values. arXiv.org, May 2018.
|
| 192 |
+
|
| 193 |
+
Joseph H Davis, Yong Zi Tan, Bridget Carragher, Clinton S Potter, Dmitry Lyumkis, and James R Williamson. Modular Assembly of the Bacterial Large Ribosomal Subunit. Cell, 167(6):1610– 1622.e15, December 2016.
|
| 194 |
+
|
| 195 |
+
Joachim Frank and Abbas Ourmazd. Continuous changes in structure mapped by manifold embedding of single-particle data in cryo-EM. Methods (San Diego, Calif.), 100:61–67, May 2016.
|
| 196 |
+
|
| 197 |
+
Matheus Gadelha, Subhransu Maji, and Rui Wang. 3d shape induction from 2d views of multiple objects. In 2017 International Conference on 3D Vision (3DV), pp. 402–411. IEEE, 2017.
|
| 198 |
+
|
| 199 |
+
Krzysztof M Gorski, Eric Hivon, Anthony J Banday, Benjamin D Wandelt, Frode K Hansen, Mstvos Reinecke, and Matthia Bartelmann. Healpix: a framework for high-resolution discretization and fast analysis of data distributed on the sphere. The Astrophysical Journal, 622(2):759, 2005.
|
| 200 |
+
|
| 201 |
+
Ralph VL Hartley. A more symmetrical fourier analysis applied to transmission problems. Proceedings of the IRE, 30(3):144–150, 1942.
|
| 202 |
+
|
| 203 |
+
Michael Hohn, Grant Tang, Grant Goodyear, P R Baldwin, Zhong Huang, Pawel A Penczek, Chao Yang, Robert M Glaeser, Paul D Adams, and Steven J Ludtke. SPARX, a new environment for Cryo-EM image processing. Journal of structural biology, 157(1):47–55, January 2007.
|
| 204 |
+
|
| 205 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 206 |
+
|
| 207 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. In The 2nd International Conference on Learning Representations (ICLR), 2013.
|
| 208 |
+
|
| 209 |
+
Werner Kühlbrandt. Cryo-EM enters a new era. eLife, 3:e03678, August 2014.
|
| 210 |
+
|
| 211 |
+
Roy R Lederman and Amit Singer. Continuously heterogeneous hyper-objects in cryo-EM and 3-D movies of many temporal dimensions. arXiv.org, April 2017.
|
| 212 |
+
|
| 213 |
+
Roy R Lederman, Joakim Andén, and Amit Singer. Hyper-Molecules: on the Representation and Recovery of Dynamical Structures, with Application to Flexible Macro-Molecular Structures in Cryo-EM. arXiv.org, July 2019.
|
| 214 |
+
|
| 215 |
+
Andres E Leschziner and Eva Nogales. The orthogonal tilt reconstruction method: an approach to generating single-class volumes with no missing cone for ab initio reconstruction of asymmetric particles. Journal of structural biology, 153(3):284–299, 2006.
|
| 216 |
+
|
| 217 |
+
Xueming Li, Paul Mooney, Shawn Zheng, Christopher R Booth, Michael B Braunfeld, Sander Gubbens, David A Agard, and Yifan Cheng. Electron counting and beam-induced motion correction enable near-atomic-resolution single-particle cryo-EM. Nature methods, 10(6):584–590, June 2013.
|
| 218 |
+
|
| 219 |
+
Lyumkis, Dmitry, Brilot, Axel F, Theobald, Douglas L, and Grigorieff, Nikolaus. Likelihoodbased classification of cryo-EM images using FREALIGN. Journal of structural biology, 183(3): 377–388, September 2013.
|
| 220 |
+
|
| 221 |
+
Pooja Malhotra and Jayant B Udgaonkar. How cooperative are protein folding and unfolding transitions? Protein science : a publication of the Protein Society, 25(11):1924–1941, November 2016.
|
| 222 |
+
|
| 223 |
+
Amit Moscovich, Amit Halevi, Joakim Andén, and Amit Singer. Cryo-EM reconstruction of continuous heterogeneity by Laplacian spectral volumes. arXiv.org, July 2019.
|
| 224 |
+
|
| 225 |
+
Takanori Nakane, Dari Kimanius, Erik Lindahl, and Sjors Hw Scheres. Characterisation of molecular motions in cryo-EM single-particle data by multi-body refinement in RELION. eLife, 7:e36861, June 2018.
|
| 226 |
+
|
| 227 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
|
| 228 |
+
|
| 229 |
+
Ali Punjani, John L Rubinstein, David J Fleet, and Marcus A Brubaker. cryoSPARC: algorithms for rapid unsupervised cryo-EM structure determination. Nature methods, 14(3):290–296, March 2017.
|
| 230 |
+
|
| 231 |
+
Jean-Paul Renaud, Ashwin Chari, Claudio Ciferri, Wen-Ti Liu, Hervé-William Rémigy, Holger Stark, and Christian Wiesmann. Cryo-EM in drug discovery: achievements, limitations and prospects. Nature reviews. Drug discovery, 17(7):471–492, July 2018.
|
| 232 |
+
|
| 233 |
+
Sjors H W Scheres. A Bayesian view on cryo-EM structure determination. Journal of molecular biology, 415(2):406–418, January 2012a.
|
| 234 |
+
|
| 235 |
+
Sjors H W Scheres. RELION: implementation of a Bayesian approach to cryo-EM structure determination. Journal of structural biology, 180(3):519–530, December 2012b.
|
| 236 |
+
|
| 237 |
+
Sjors HW Scheres. Maximum-likelihood methods in cryo-em. part ii: Application to experimental data. Methods in enzymology, 482:295, 2010.
|
| 238 |
+
|
| 239 |
+
Guang Tang, Liwei Peng, Philip R Baldwin, Deepinder S Mann, Wen Jiang, Ian Rees, and Steven J Ludtke. EMAN2: an extensible image processing suite for electron microscopy. Journal of structural biology, 157(1):38–46, January 2007.
|
| 240 |
+
|
| 241 |
+
Shubham Tulsiani, Alexei A. Efros, and Jitendra Malik. Multi-view consistency as supervisory signal for learning shape and pose prediction. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 242 |
+
|
| 243 |
+
Karen Ullrich, Rianne van den Berg, Marcus Brubaker, David Fleet, and Max Welling. Differentiable probabilistic models of scientific imaging with the Fourier slice theorem. arXiv.org, June 2019.
|
| 244 |
+
|
| 245 |
+
Nicholas Watters, Loic Matthey, Christopher P Burgess, and Alexander Lerchner. Spatial Broadcast Decoder: A Simple Architecture for Learning Disentangled Representations in VAEs. arXiv.org, January 2019.
|
| 246 |
+
|
| 247 |
+
Wilson Wong, Xiao-Chen Bai, Alan Brown, Israel S Fernandez, Eric Hanssen, Melanie Condron, Yan Hong Tan, Jake Baum, and Sjors H W Scheres. Cryo-EM structure of the Plasmodium falciparum 80S ribosome bound to the anti-protozoan drug emetine. eLife, 3:e01963, June 2014.
|
| 248 |
+
|
| 249 |
+
Xinchen Yan, Jimei Yang, Ersin Yumer, Yijie Guo, and Honglak Lee. Perspective Transformer Nets: Learning Single-View 3D Object Reconstruction without 3D Supervision. arXiv.org, December 2016.
|
| 250 |
+
|
| 251 |
+
Anna Yershova, Swati Jain, Steven M LaValle, and Julie C Mitchell. Generating Uniform Incremental Grids on SO(3) Using the Hopf Fibration. The International Journal of Robotics Research, 29(7): 801–812, May 2010.
|
| 252 |
+
|
| 253 |
+
# A APPENDIX - METHODS
|
| 254 |
+
|
| 255 |
+
# A.1 BRANCH AND BOUND IMPLEMENTATION DETAILS
|
| 256 |
+
|
| 257 |
+
We perform a global search over $S O ( 3 ) \times \mathbb { R } ^ { 2 }$ for the maximum-likelihood pose for each image given the current decoder MLP. Two techniques are used to improve the efficiency of the search over poses: (1) discretizing the search space on a uniform grid and sub-dividing grid points after pruning candidate poses with branch and bound, and (2) band pass limiting the objective to low frequency components and incrementally increasing the $\mathbf { k }$ -space limit at each iteration (frequency marching).
|
| 258 |
+
|
| 259 |
+
Our branch and bound algorithm for pose optimization is given in Algorithm 1. Briefly, we discretize $S O ( 3 )$ uniformly using the Hopf fibration Yershova et al. (2010) at a predefined base resolution of the grid and incrementally increase the grid resolution by sub-dividing grid points. At each resolution of the grid, the set of candidate poses is pruned using a branch and bound (BNB) optimization scheme, which alternates between a computationally inexpensive lower bound on the objective function evaluated at all grid points and an upper bound consisting of the true objective evaluated on the best lower-bound candidate. Grid points whose lower bound is higher than this value are excluded for subsequent iterations. In our case, the loss is evaluated on low-frequency components of the image; specifically, Fourier components with $| \mathbf { k } | < k _ { m a x }$ is an effective lower bound, as it is both inexpensive to compute and captures most of the power (and thus the error). This bound encodes the intuition that low-frequency components dominate pose estimation. We concomitantly increase $k _ { m a x }$ at each iteration of grid subdivision.
|
| 260 |
+
|
| 261 |
+
At each iteration, some poses are excluded by BNB, and the remaining poses are further discretized. Although BNB is risk-free in the sense that the optimal pose at a given resolution will not be pruned, our application of it is not risk-free as a candidate pose with high loss at a given resolution doesn’t guarantee that its neighbor in the next iteration will not have a lower loss. Irrespective, in practice, we find that at a sufficiently fine base resolution, we obtain good results on a tractable timescale (hours on a single GPU).4
|
| 262 |
+
|
| 263 |
+
We reimplement the uniform multiresolution grids on $S O ( 3 )$ based on Yershova et al. (2010), using the Healpix Gorski et al. (2005) grid for the sphere and the Hopf fibration to uniformly lift the grid to $S O ( 3 )$ . The base grid on $S O ( 3 )$ contains 576 orientations. We use the ordinary grid for translations containing $7 ^ { 2 }$ points with an extent of 20 pixels for $\scriptstyle \mathrm { D } = 1 2 8$ datasets. We subdivide the grid 5 times for a final resolution of 0.92 degrees for the orientation and 0.08 pixels for the translation. For $\scriptstyle \mathrm { D = 6 4 }$ datasets, we use a translational grid with extent of 10 pixels.
|
| 264 |
+
|
| 265 |
+
# Algorithm 1 CryoDRGN branch and bound with frequency marching
|
| 266 |
+
|
| 267 |
+
1: procedure $\mathrm { O P T P H I } ( \hat { X } , \hat { V } _ { \mathbf { z } } )$ . Find the optimal image pose given the current decoder
|
| 268 |
+
2: $k _ { m i n } \gets 1 2$ , $k _ { m a x } \gets D / 2$ , $N _ { i t e r } \gets 5$
|
| 269 |
+
3: $\Phi S O ( 3 ) \times \mathbb { R } ^ { 2 }$ grid at base resolution
|
| 270 |
+
4: k ← kmin
|
| 271 |
+
5: for iter $= 1$ . . . $N _ { i t e r }$ do
|
| 272 |
+
6: for $\phi _ { i } \in \Phi$ do . Compute lower bound at all grid points
|
| 273 |
+
7: $l b ( \phi _ { i } ) \mathrm { l o s s }$ between $\hat { X }$ and SLICE $( \hat { V } _ { \mathbf { z } } , \phi _ { i } )$ at $\mathbf { k } < k$
|
| 274 |
+
8: $\phi ^ { * } \gets \mathrm { a r g } \operatorname* { m i n } ( l b )$
|
| 275 |
+
9: $u b \gets 1 0 \mathrm { s s }$ between $\hat { X }$ and SLICE $( \hat { V } _ { \mathbf { z } } , \phi ^ { * } )$ at $\mathbf { k } < k _ { m a x }$ . Compute upper bound
|
| 276 |
+
10: $\Phi _ { n e w } \{ \}$
|
| 277 |
+
11: for $\phi _ { i } \in \Phi$ do $\triangleright$ Subdivide grid points below the upper bound
|
| 278 |
+
12: if $l b ( \phi _ { i } ) < u b$ then
|
| 279 |
+
13: $\begin{array} { c } { \Phi _ { n e w } \Phi _ { n e w } \cup et { } { : } \mathrm { S U B D I V I D E } ( \phi _ { i } ) } \\ { \Phi \Phi _ { n e w } } \\ { k k + ( k _ { m a x } - k _ { m i n } ) / ( N _ { i t e r } - 1 ) } \end{array}$
|
| 280 |
+
14:
|
| 281 |
+
15: . Increase frequency band limit
|
| 282 |
+
16: return φ∗
|
| 283 |
+
|
| 284 |
+
# A.2 TRAINING DETAILS
|
| 285 |
+
|
| 286 |
+
Given an imaging dataset, $\hat { X } _ { 1 } , . . . \hat { X } _ { N }$ , we summarize three training paradigms of cryoDRGN. 1) For homogeneous reconstruction, we only train the volume decoder $p _ { \theta }$ and perform BNB pose inference for the unknown $\phi _ { i }$ ’s for each image. 2) As an intermediate task, we can perform heterogeneous reconstruction training the image encoder $q _ { \xi }$ and the volume decoder $p _ { \theta }$ with known $\phi _ { i }$ ’s to skip BNB pose inference. 3) For fully unsupervised heterogeneous reconstruction, we jointly train $q _ { \xi }$ and $p _ { \theta }$ to learn a continuous latent representation, performing BNB pose inference for the unknown pose of each image.
|
| 287 |
+
|
| 288 |
+
Unless otherwise specified, the encoder and decoder networks are both MLPs containing 10 hidden layers of dimension 128 with ReLU activations. A fully connected architecture is used instead of a convolutional architecture because the images are not represented in real space.
|
| 289 |
+
|
| 290 |
+
Instead of representing both the real and imaginary components of each image, we use the closelyrelated Hartley space representation (Hartley (1942)). The Hartley transform of real-valued functions is equivalent to the real minus imaginary component of the FT, and thus is real valued. The Fourier slice theorem still holds and the error model is equivalent.
|
| 291 |
+
|
| 292 |
+
In this work, we simplify the image generation model to Gaussian white noise. Therefore, for a given image, the negative log likelihood for a reconstructed slice from the decoder corresponds to the mean squared error between the phase-shifted image and the oriented slice from the volume decoder. We leave the implementation of a colored noise model to future work.
|
| 293 |
+
|
| 294 |
+
We use the Adam optimizer (Kingma & Ba (2014)) with learning rate of 5e-4 for experiments involving noiseless, homogeneous datasets, and 1e-4 for all other experiments. All models are implemented in Pytorch (Paszke et al. (2017)).
|
| 295 |
+
|
| 296 |
+
# B HOMOGENEOUS RECONSTRUCTION
|
| 297 |
+
|
| 298 |
+
# B.1 DATASET PREPARATION
|
| 299 |
+
|
| 300 |
+
Simulated datasets: From a ground truth 3D volume, we simulated datasets following the cryo-EM image formation model by 1) rotating the 3D volume in real space by $R$ , where $R \in S O ( 3 )$ is sampled uniformly, 2) projecting (integrating) the volume along the $\mathbf { Z }$ -axis, 3) shifting the resulting 2D image by $t$ , where $t$ is sampled uniformly from $[ - 1 0 , 1 0 ] ^ { 2 }$ pixels, and 4) optionally adding noise to an SNR of 0.1, a typical value for cryo-EM data (Baxter et al. (2009)). Following convention in the cryo-EM field, we define SNR as the ratio of the variance of the signal to the variance of the noise. We define the noise-free signal images to be the entire DxD image. $5 0 \mathrm { k }$ projections were generated for each dataset with image size of $\scriptstyle \mathrm { D } = 1 2 8$ .
|
| 301 |
+
|
| 302 |
+
Real dataset: To generate the real cryo-EM dataset for homogeneous reconstruction, images from EMPIAR-10028 (Wong et al. (2014)) were downsampled by a factor of 4 by clipping in Fourier space. The images were then ’phase flipped’ in Fourier space by their contrast transfer function, a given real-valued function with range [-1,1] determined by the microscopy conditions, i.e. the Fourier components are negated where the CTF is negative.
|
| 303 |
+
|
| 304 |
+
# B.2 TRAINING
|
| 305 |
+
|
| 306 |
+
For each dataset, we train the volume decoder (10 hidden layers of dimension 128) in minibatches of 10 images with random orientations for the first epoch to learn a volume with roughly correct spatial extent, followed by 4 epochs with branch and bound (BNB) pose inference $3 0 \mathrm { m i n } ,$ /epoch noiseless, $8 0 \mathrm { m i n }$ /noisy datasets). Since BNB pose inference is the bottleneck during training, we employ a multiscale training protocol, where after 4 epochs with BNB pose inference, the latent pose is fixed, and we train a separate, larger volume decoder (10 hidden layers of dimension 500) for 15 epochs with fixed poses to "refine" the structure to high resolution (20 min/epoch). Training times are reported for 50k, $\scriptstyle \mathrm { D } = 1 2 8$ image datasets trained on a Nvidia Titan V GPU.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure S5: Left: CryoDRGN unsupervised homogeneous reconstruction on 2 simulated datasets and 1 real cryoEM dataset matches state-of-the-art. Right: Fourier shell correlation (FSC) curves between the reconstructed volume and the ground truth volume for the synthetic ribosome datasets.
|
| 310 |
+
|
| 311 |
+
# C HETEROGENEOUS RIBOSOME RECONSTRUCTION WITH POSE SUPERVISION
|
| 312 |
+
|
| 313 |
+
Dataset preparation: We used the dataset from EMPIAR-10076 which contains 131,899 images of the $E$ . coli large ribosomal subunit (LSU) in various stages of assembly (Davis et al. (2016)). Images were downsampled to $\scriptstyle \mathrm { D } = 1 2 8$ by clipping in Fourier space. Poses were determined by aligning the images to a mature LSU structure obtained from a homogeneous reconstruction of the full resolution dataset in cryoSPARC, i.e. "a consensus reconstruction".
|
| 314 |
+
|
| 315 |
+
Baseline: In the original analysis of this dataset, multiple rounds of multiclass refinement in sweeps of varying number of classes followed by expert manual alignment and clustering of similar volumes were used to identify 6 classes, labeled A-F consisting of 4 major structural states of the LSU (classes B-E) and 2 additional structures of the 70S and 30S ribosome, class A and F, respectively.
|
| 316 |
+
|
| 317 |
+
Since the published dataset did not contain the corresponding image cluster assignments, we perform multiclass refinement in cryoSPARC using the published structures of the 6 major states, low pass filtered to $2 5 \mathring \mathrm { A }$ as initial models, to reproduce the results and obtain image cluster assignments. Aside from class A and F (low population impurities in the sample), the remaining structures correlate well with the published volumes (Figure S6).
|
| 318 |
+
|
| 319 |
+

|
| 320 |
+
Figure S6: Reconstructed volumes from cryoSPARC multiclass refinement using the published structures of the 6 major states, low pass filtered to 25Åas initial models. Right: FSC curves between the cryoSPARC reconstructed and published volumes.
|
| 321 |
+
|
| 322 |
+
cryoDRGN training: We train cryoDRGN with a 1-D latent variable in minibatches of 10 images for 200 epochs, treating image pose as fixed ( $1 1 \mathrm { m i n }$ /epoch on a Nvidia Titan V GPU). To simplify representation learning for $q _ { \xi }$ , we center and phase flip images before inputting to the encoder. We encode and decode a circle of pixels with diameter $\scriptstyle \mathrm { D } = 1 2 8$ instead of the full $1 2 8 \mathrm { x } 1 2 8$ image.
|
| 323 |
+
|
| 324 |
+
# C.1 SUPPLEMENTARY RESULTS
|
| 325 |
+
|
| 326 |
+

|
| 327 |
+
Figure S7: Left: Latent encoding for each image of the dataset from EMPIAR-10076. Bottom: Volumes from 12 sampled values along the latent space (dashed lines). Right: Fourier shell correlation (FSC) curves for 4 structures against the published volumes for classes B-E from corresponding to structural states of the large ribosomal subunit during assembly (Davis et al. (2016)).
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure S8: The latent encoding aligns with cluster assignments from a successive round of multiclass refinement in cryoSPARC on the subset of images from class $\mathrm { D }$ and E.
|
| 331 |
+
|
| 332 |
+
# D FULLY UNSUPERVISED HETEROGENEOUS RECONSTRUCTION
|
| 333 |
+
|
| 334 |
+
# D.1 DATASET PREPARATION
|
| 335 |
+
|
| 336 |
+
Linear 1D motion: We generated a dataset containing one continuous degree of freedom as follows: From an atomic model of a protein complex, a single bond in the atomic model was rotated while keeping the remaining structure fixed, and 50 atomic models were sampled along this reaction coordinate. 1000 projections with random rotations and in-plane translations were generated for each model, yielding a total of $5 0 \mathrm { k }$ images, approximating a uniform distribution along a continuous reaction coordinate.
|
| 337 |
+
|
| 338 |
+
Linear $2 D$ motion: We extended the linear 1D motion dataset by introducing a second degree of freedom from rotating a bond in the atomic model that connected a different protein in the complex. Similar to the 1D motion dataset, from a starting configuration, the original bond was rotated $+ / -$ N degrees, and 50 models were sampled along this reaction coordinate. Then from the starting conformation, the second bond was rotated $+ / - 9 0$ degrees, and 50 additional models were sampled along the second reaction coordination. 500 projections were generated from each model, yielding a total of $5 0 \mathrm { k }$ images.
|
| 339 |
+
|
| 340 |
+
Circular 1D motion: For this dataset, we rotated a bond a full 360 degrees and sample 100 models along this circular reaction coordinate. 500 projections were generated from each model, yielding a total of 50k images.
|
| 341 |
+
|
| 342 |
+
Discrete 10 class: For this dataset, we sampled 10 random configurations for the proteins in the complex. 5000 projection images were generated from each model, yielding a dataset containing a mixture of 10 discrete states.
|
| 343 |
+
|
| 344 |
+
For all four datasets, random rotations were generated uniformly from $S O ( 3 )$ , and translations were sampled uniformly from $[ - 5 , 5 ]$ pixels. The image size was $\scriptstyle \mathrm { D = 6 4 }$ with absolute spatial extent of 720Åand Nyquist limit of $2 2 . 5 \mathring \mathrm { A }$ . Schematics of the simulated motions are given in Figure S9.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure S9: Ground truth atomic model and the heterogeneity introduced for different datasets.
|
| 348 |
+
|
| 349 |
+
# D.2 TILT SERIES PAIRS
|
| 350 |
+
|
| 351 |
+
Tilt series pairs is a variant of cryo-EM in which, for each image $X _ { i }$ , a corresponding image $X _ { i } ^ { ' }$ is acquired after tilting the imaging stage by a known angle. This technique was originally employed to identify the chirality of molecules (Belnap et al. (1997)), which is lost in the projection from 3D to 2D and therefore cannot be inferred from standard cryo-EM. Inferential procedures such as expectation maximization converge to one handedness or the other depending on their initialization. In multiclass reconstruction, different classes are not guaranteed to possess the same handedness even if there is a high relatedness between structures. We remark on this experimental technique as we propose using tilt series pairs to encourage invariance of $q _ { \xi }$ with respect to pose transformations for a given $\hat { V } _ { \mathbf { z } }$ (and incidentally also to identify the chirality of $\hat { V } _ { \mathbf { z } } ^ { \ \prime }$ ). To train on tilt series pairs, the encoder is split into two MLPs, the first learning an intermediate encoding of each image, and the second mapping the concatenation of the two encodings to the latent space. We use an 8 layer MLP with output dimension 128 for the former and a 2 layer MLP with input dimension 256 for the latter. All hidden layers have dimension 128. For branch and bound, the combined loss over both images is evaluated for each grid point of $S O ( 3 ) \times \mathbb { R } ^ { 2 }$ . To generate the image $X _ { t i l t , i }$ associated with $X _ { i }$ , prior to rotating the volume by $R _ { i }$ , we rotate the volume by a constant 45 degrees around the $\mathbf { X }$ -axis.
|
| 352 |
+
|
| 353 |
+
# D.3 TRAINING
|
| 354 |
+
|
| 355 |
+
We trained cryoDRGN in minibatches of 5 images for 40 epochs without tilt series pairs and 20 epochs with tilt series pairs. We trained a 1-D latent variable for the linear 1D motion dataset, and 10-D latent variables for the remaining datasets. Random angles were used for the first epoch of training to learn roughly the correct spatial extent of the volume and BNB pose inference was used for the remaining epochs. The runtime was $1 2 0 \mathrm { m i n }$ /epoch vs 2 min/epoch with and without BNB pose inference, respectively, on a Nvidia Titan V GPU.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure S10: Reconstruction results for the linear 1D dataset by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: Reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) matches the ground truth variation. The predicted latent encoding correlates with the ground truth latent degree of freedom. Middle: CryoDRGN results with tilt series Bottom: Reconstructed volumes and the distribution of images over clusters from discrete multiclass reconstruction in cryoSPARC. Volumes are visualized at high and low isosurface, showing artifacts in the cryoSPARC structures.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure S11: Reconstruction results for the circular 1D dataset by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: Reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) matches the ground truth variation. The distribution of images in the latent space matches the ciruclar topology of the true data manifold. Middle: CryoDRGN results with tilt series Bottom: Reconstructed volumes and the distribution of images over clusters from discrete multiclass reconstruction in cryoSPARC. Volumes are visualized at high and low isosurface, showing artifacts in the cryoSPARC structures.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure S12: Reconstruction results for the linear 2D dataset by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: Reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) roughly matches the ground truth variation, however the distribution of images in the latent space does not recapitulate the true data manifold well. Middle: CryoDRGN results with tilt series reconstructs the true structural variation and the distribution of images in the latent space matches the topology of the true data manifold. Bottom: Reconstructed volumes and the distribution of images over clusters from discrete multiclass reconstruction in cryoSPARC. CryoSPARC volumes are visualized at high and low isosurface, showing artifacts at low isosurface
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure S13: Reconstruction results for the dataset containing 10 discrete structures by cryoDRGN and by discrete multiclass reconstruction in cryoSPARC. Top: The majority of reconstructed structures from cryoDRGN sampled along the latent space (at depicted points) matches the ground truth structures, however some are incorrect (red boxes), and the learned data manifold is not well separated into clusters. Middle: CryoDRGN results with tilt series reconstructs the 10 structures and clusters the images in the latent space accordingly. Bottom: Reconstructed volumes from discrete multiclass reconstruction in cryoSPARC and the distribution of images over clusters. CryoSPARC learns 8 out of 10 structures correctly.
|
| 368 |
+
|
| 369 |
+
Table S3: Relationship between number of classes in cryoSPARC and reconstruction accuracy quantified by an $\mathrm { F S C } { = } 0 . 5$ resolution metric between the reconstructed volumes corresponding to each image and its ground truth volume. We report the average and standard deviation across 100 images in the dataset (lower is better; best possible is 2 pixels).
|
| 370 |
+
|
| 371 |
+
<table><tr><td></td><td colspan="4">cryoSPARC</td></tr><tr><td>Dataset</td><td>K=2</td><td>K=3</td><td>K=4</td><td>K=5</td></tr><tr><td>Linear 1D1 motion</td><td>5.11(3.82)</td><td>3.60(2.27)</td><td>7.40(4.16)</td><td>7.59(4.58)</td></tr><tr><td>Linear 2D motion</td><td>6.89(2.21)</td><td>6.90(3.77)</td><td>5.98(2.10)</td><td>6.76(4.47)</td></tr><tr><td>Circular 1D motion</td><td>5.16(2.70)</td><td>4.87(2.17)</td><td>7.50(3.32)</td><td>4.62(1.93)</td></tr></table>
|
| 372 |
+
|
| 373 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">cryoDRGN</td><td colspan="3">cryoDRGN+tilt</td></tr><tr><td>z-D=1</td><td>z-D=2</td><td>z-D=10</td><td>z-D=1</td><td>z-D=2</td><td>z-D=10</td></tr><tr><td>Linear 1D motion</td><td>2.50(0.62)</td><td>2.34(0.12)</td><td>1</td><td>2.35(0.36)</td><td>2.43(0.26)</td><td>1</td></tr><tr><td>Linear 2D motion</td><td>7.16(4.69)</td><td>4.38(3.15)</td><td>4.44(2.50)</td><td>3.38(1.18)</td><td>2.97(1.24)</td><td>2.93(1.02)</td></tr><tr><td>Circular 1D motion</td><td>5.61(4.36)</td><td>4.95(2.91)</td><td>4.05(2.40)</td><td>3.12(0.96)</td><td>2.65(0.67)</td><td>2.63(0.74)</td></tr></table>
|
| 374 |
+
|
| 375 |
+
Table S4: Relationship between $z$ dimension in cryoDRGN and reconstruction accuracy quantified by an $\mathrm { F S C } { = } 0 . 5$ resolution metric between the reconstructed volumes corresponding to each image and its ground truth volume. We report the average and standard deviation across 100 images in the dataset (lower is better; best possible is 2 pixels).
|
md/train/SktLlGbRZ/SktLlGbRZ.md
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CYCADA: CYCLE-CONSISTENT ADVERSARIAL DOMAIN ADAPTATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Domain adaptation is critical for success in new, unseen environments. Adversarial adaptation models applied in feature spaces discover domain invariant representations, but are difficult to visualize and sometimes fail to capture pixel-level and low-level domain shifts. Recent work has shown that generative adversarial networks combined with cycle-consistency constraints are surprisingly effective at mapping images between domains, even without the use of aligned image pairs. We propose a novel discriminatively-trained Cycle-Consistent Adversarial Domain Adaptation model. CyCADA adapts representations at both the pixel-level and feature-level, enforces cycle-consistency while leveraging a task loss, and does not require aligned pairs. Our model can be applied in a variety of visual recognition and prediction settings. We show new state-of-the-art results across multiple adaptation tasks, including digit classification and semantic segmentation of road scenes demonstrating transfer from synthetic to real world domains.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks excel at learning from large amounts of data, but can be poor at generalizing learned knowledge to new datasets or environments. Even a slight departure from a network’s training domain can cause it to make spurious predictions and significantly hurt its performance (Tzeng et al., 2017). The visual domain shift from non-photorealistic synthetic data to real images presents an even more significant challenge. While we would like to train models on large amounts of synthetic data such as data collected from graphics game engines, such models fail to generalize to real-world imagery. For example, a state-of-the-art semantic segmentation model trained on synthetic dashcam data fails to segment the road in real images, and its overall per-pixel label accuracy drops from $93 \%$ (if trained on real imagery) to $54 \%$ (if trained only on synthetic data, see Table 5).
|
| 12 |
+
|
| 13 |
+
Feature-level unsupervised domain adaptation methods address this problem by aligning the features extracted from the network across the source (e.g. synthetic) and target (e.g. real) domains, without any labeled target samples. Alignment typically involves minimizing some measure of distance between the source and target feature distributions, such as maximum mean discrepancy (Long & Wang, 2015), correlation distance (Sun & Saenko, 2016), or adversarial discriminator accuracy (Ganin & Lempitsky, 2015; Tzeng et al., 2017). This class of techniques suffers from two main limitations. First, aligning marginal distributions does not enforce any semantic consistency, e.g. target features of a car may be mapped to source features of a bicycle. Second, alignment at higher levels of a deep representation can fail to model aspects of low-level appearance variance which are crucial for the end visual task.
|
| 14 |
+
|
| 15 |
+
Generative pixel-level domain adaptation models perform similar distribution alignment—not in feature space but rather in raw pixel space—translating source data to the “style” of a target domain. Recent methods can learn to translate images given only unsupervised data from both domains (Bousmalis et al., 2017b; Liu & Tuzel, 2016b; Shrivastava et al., 2017). The results are visually compelling, but such image-space models have only been shown to work for small image sizes and limited domain shifts. A more recent approach (Bousmalis et al., 2017a) was applied to larger (but still not high resolution) images, but in a controlled environment with visually simple images for robotic applications. Furthermore, they also do not necessarily preserve content: while the translated image may “look” like it came from the right domain, crucial semantic information may be lost. For example, a model adapting from line-drawings to photos could learn to make a line-drawing of a cat look like a photo of a dog.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: We propose CyCADA, an adversarial unsupervised adaptation algorithm which uses cycle and semantic consistency to perform adaptation at multiple levels in a deep network. Our model provides significant performance improvements over source model baselines.
|
| 19 |
+
|
| 20 |
+
Table 1: Our model, CyCADA, may use pixel, feature, and semantic information during adaptation while learning an invertible mapping through cycle consistency.
|
| 21 |
+
|
| 22 |
+
<table><tr><td></td><td>Pixel Loss</td><td>Feature Loss</td><td>Semantic Loss</td><td>Cycle Consistent</td></tr><tr><td>CycleGAN (Zhu et al., 2017)</td><td>√</td><td></td><td></td><td>√</td></tr><tr><td>Feature Adapt (Ganin & Lempitsky,2015; Tzeng et al., 2017)</td><td></td><td>1</td><td>√</td><td></td></tr><tr><td>Pixel Adapt (Taigman et al.,2017a; Bousmalis et al., 2017b)</td><td></td><td></td><td></td><td></td></tr><tr><td>CyCADA</td><td>?</td><td>√</td><td>√</td><td>√</td></tr></table>
|
| 23 |
+
|
| 24 |
+
How can we encourage the model to preserve semantic information in the process of distribution alignment? In this paper, we explore a simple yet powerful idea: give an additional objective to the model to reconstruct the original data from the adapted version. Cycle-consistency was recently proposed in a cross-domain image generation GAN model, CycleGAN (Zhu et al., 2017), which showed transformative image-to-image generation results, but was agnostic to any particular task.
|
| 25 |
+
|
| 26 |
+
We propose Cycle-Consistent Adversarial Domain Adaptation (CyCADA), which adapts representations at both the pixel-level and feature-level while enforcing pixel and semantic consistency. We use a reconstruction (cycle-consistency) loss to enforce the cross-domain transformation to preserve pixel information and a semantic labeling loss to enforce semantic consistency. CyCADA unifies prior feature-level (Ganin & Lempitsky, 2015; Tzeng et al., 2017) and image-level (Liu & Tuzel, 2016b; Bousmalis et al., 2017b; Shrivastava et al., 2017) adversarial domain adaptation methods together with cycle-consistent image-to-image translation techniques (Zhu et al., 2017), as illustrated in Table 1. It is applicable across a range of deep architectures and/or representation levels, and has several advantages over existing unsupervised domain adaptation methods.
|
| 27 |
+
|
| 28 |
+
We apply our CyCADA model to the task of digit recognition across domains and the task of semantic segmentation of urban scenes across domains. Experiments show that our model achieves state of the art results on digit adaptation, cross-season adaptation in synthetic data, and on the challenging synthetic-to-real scenario. In the latter case, it improves per-pixel accuracy from $54 \%$ to $83 \%$ , nearly closing the gap to the target-trained model.
|
| 29 |
+
|
| 30 |
+
Our experiments confirm that domain adaptation can benefit greatly from cycle-consistent pixel transformations, and that this is especially important for pixel-level semantic segmentation with contemporary FCN architectures. We demonstrate that enforcing semantic consistency between input and stylized images prevents label flipping on the large shift between SVHN and MNIST (example, prevents a SVHN 9 from being mapped into an MNIST 2). Interestingly, on our semantic segmentation tasks (GTA to CityScapes) we did not observe label flipping to be a major source of error, even without the semantic consistency loss. Because of this, and due to memory constraints, we do not include this loss for the segmentation tasks. Further, we show that adaptation at both the pixel and representation level can offer complementary improvements with joint pixel-space and feature adaptation leading to the highest performing model for digit classification tasks.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
The problem of visual domain adaptation was introduced along with a pairwise metric transform solution by Saenko et al. (2010) and was further popularized by the broad study of visual dataset bias (Torralba & Efros, 2011). Early deep adaptive works focused on feature space alignment through minimizing the distance between first or second order feature space statistics of the source and target (Tzeng et al., 2014; Long & Wang, 2015). These latent distribution alignment approaches were further improved through the use of domain adversarial objectives whereby a domain classifier is trained to distinguish between the source and target representations while the domain representation is learned so as to maximize the error of the domain classifier. The representation is optimized using the standard minimax objective (Ganin & Lempitsky, 2015), the symmetric confusion objective (Tzeng et al., 2015), or the inverted label objective (Tzeng et al., 2017). Each of these objectives is related to the literature on generative adversarial networks (Goodfellow et al., 2014) and follow-up work for improved training procedures for these networks (Salimans et al., 2016b; Arjovsky et al., 2017).
|
| 35 |
+
|
| 36 |
+
The feature-space adaptation methods described above focus on modifications to the discriminative representation space. In contrast, other recent methods have sought adaptation in the pixel-space using various generative approaches. One advantage of pixel-space adaptation, as we have shown, is that the result may be more human interpretable, since an image from one domain can now be visualized in a new domain. CoGANs (Liu & Tuzel, 2016b) jointly learn a source and target representation through explicit weight sharing of certain layers while each source and target has a unique generative adversarial objective. Ghifary et al. (2016) uses an additional reconstruction objective in the target domain to encourage alignment in the unsupervised adaptation setting.
|
| 37 |
+
|
| 38 |
+
In contrast, another approach is to directly convert the target image into a source style image (or visa versa), largely based on Generative Adversarial Networks (GANs) (Goodfellow et al., 2014). Researchers have successfully applied GANs to various applications such as image generation (Denton et al., 2015; Radford et al., 2015; Zhao et al., 2016), image editing (Zhu et al., 2016) and feature learning (Salimans et al., 2016a; Donahue et al., 2017). Recent work (Isola et al., 2016; Sangkloy et al., 2016; Karacan et al., 2016) adopt conditional GANs (Mirza & Osindero, 2014) for these image-to-image translation problems (Isola et al., 2016), but they require input-output image pairs for training, which is in general not available in domain adaptation problems.
|
| 39 |
+
|
| 40 |
+
There also exist lines of work where such training pairs are not given. Yoo et al. (2016) learns a source to target encoder-decoder along with a generative adversarial objective on the reconstruction which is is applied for predicting the clothing people are wearing. The Domain Transfer Network (Taigman et al., 2017b) trains a generator to transform a source image into a target image by enforcing consistency in the embedding space. Shrivastava et al. (2017) instead uses an L1 reconstruction loss to force the generated target images to be similar to their original source images.This works well for limited domain shifts where the domains are similar in pixel-space, but can be too limiting for settings with larger domain shifts. Bousmalis et al. (2017b) use a content similarity loss to ensure the generated target image is similar to the original source image; however, this requires prior knowledge about which parts of the image stay the same across domains (e.g. foreground). Our method does not require pre-defining what content is shared between domains and instead simply translates images back to their original domains while ensuring that they remain identical to their original versions. BiGAN (Donahue et al., 2017) and ALI (Dumoulin et al., 2016) take an approach of simultaneously learning the transformations between the pixel and the latent space. More recently, Cycle-consistent Adversarial Networks (CycleGAN) (Zhu et al., 2017) produced compelling image translation results such as generating photorealistic images from impressionism paintings or transforming horses into zebras at high resolution using the cycle-consistency loss. This loss was simultaneously proposed by Yi et al. (2017) and Kim et al. (2017) to great effect as well. Our motivation comes from such findings about the effectiveness of the cycle-consistency loss.
|
| 41 |
+
|
| 42 |
+
Few works have explicitly studied visual domain adaptation for the semantic segmentation task. Adaptation across weather conditions in simple road scenes was first studied by Levinkov & Fritz (2013). More recently, a convolutional domain adversarial based approached was proposed for more general drive cam scenes and for adaptation from simulated to real environments (Hoffman et al., 2016). Ros et al. (2016b) learns a multi-source model through concatenating all available labeled data and learning a single large model and then transfers to a sparsely labeled target domain through distillation (Hinton et al., 2015). Chen et al. (2017) use an adversarial objective to align both global and class-specific statistics, while mining additional temporal data from street view datasets to learn a static object prior. Zhang et al. (2017) instead perform segmentation adaptation by aligning label distributions both globally and across superpixels in an image.
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 2: Cycle-consistent adversarial adaptation overview. By directly remapping source training data into the target domain, we remove the low-level differences between the domains, ensuring that our task model is well-conditioned on target data. We depict here the image-level adaptation as composed of the pixel GAN loss (green), the source cycle loss (red), and the source and target semantic consistency losses (black dashed) – used when needed to prevent label flipping. For clarity the target cycle is omitted. The feature-level adaptation is depicted as the feature GAN loss (orange) and the source task loss (purple).
|
| 46 |
+
|
| 47 |
+
# 3 CYCLE-CONSISTENT ADVERSARIAL DOMAIN ADAPTION
|
| 48 |
+
|
| 49 |
+
We consider the problem of unsupervised adaptation, where we are provided source data $X _ { S }$ , source labels $Y _ { S }$ , and target data $X _ { T }$ , but no target labels. The goal is to learn a model $f _ { T }$ that correctly predicts the label for the target data $X _ { T }$ .
|
| 50 |
+
|
| 51 |
+
Pretrain Source Task Model. We begin by simply learning a source model $f _ { S }$ that can perform the task on the source data. For $K$ -way classification with a cross-entropy loss, this corresponds to
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } _ { \mathrm { t a s k } } ( f _ { S } , X _ { S } , Y _ { S } ) = - \mathbb { E } _ { ( x _ { s } , y _ { s } ) \sim ( X _ { S } , Y _ { S } ) } \sum _ { k = 1 } ^ { K } \mathbb { 1 } _ { [ k = y _ { s } ] } \log \Big ( \sigma \big ( f _ { S } ^ { ( k ) } ( x _ { s } ) \big ) \Big )
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\sigma$ denotes the softmax function. However, while the learned model $f _ { S }$ will perform well on the source data, typically domain shift between the source and target domain leads to reduced performance when evaluating on target data.
|
| 58 |
+
|
| 59 |
+
Pixel-level Adaptation. To mitigate the effects of domain shift, we follow previous adversarial adaptation approaches and learn to map samples across domains such that an adversarial discriminator is unable to distinguish the domains. By mapping samples into a common space, we enable our model to learn on source data while still generalizing to target data.
|
| 60 |
+
|
| 61 |
+
To this end, we introduce a mapping from source to target $G _ { S T }$ and train it to produce target samples that fool an adversarial discriminator $D _ { T }$ . Conversely, the adversarial discriminator attempts to classify the real target data from the source target data. This corresponds to the loss function
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathscr { L } _ { \mathrm { G A N } } ( G _ { S T } , D _ { T } , X _ { T } , X _ { S } ) = \mathbb { E } _ { x _ { t } \sim X _ { T } } [ \log D _ { T } ( x _ { t } ) ] + \mathbb { E } _ { x _ { s } \sim X _ { S } } [ \log ( 1 - D _ { T } ( G _ { S T } ( x _ { s } ) ) ) ] .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
This objective ensures that $G _ { S T }$ , given source samples, produces convincing target samples. In turn, this ability to directly map samples between domains allows us to learn a target model $f _ { T }$ by minimizing $\tilde { \mathcal { L } } _ { \mathrm { t a s k } } ( f _ { T } , G _ { S T } ( \bar { X _ { S } } ) , \bar { Y _ { S } } )$ (see Figure 2 green portion).
|
| 68 |
+
|
| 69 |
+
However, while previous approaches that optimized similar objectives have shown effective results, in practice they can often be unstable and prone to failure. Although the GAN loss in Equation 2 ensures that $G _ { S \to T } ( x _ { s } )$ for some $x _ { s }$ will resemble data drawn from $X _ { T }$ , there is no way to guarantee that $G _ { S \to T } ( x _ { s } )$ preserves the structure or content of the original sample $x _ { s }$ .
|
| 70 |
+
|
| 71 |
+
In order to encourage the source content to be preserved during the conversion process, we impose a cycle-consistency constraint on our adaptation method (Zhu et al., 2017; Yi et al., 2017; Kim et al., 2017) (see Figure 2 red portion). To this end, we introduce another mapping from target to source $G _ { T S }$ and train it according to the same GAN loss $\mathcal { L } _ { \mathrm { G A N } } ( G _ { T S } , D _ { S } , \mathbf { \bar { \boldsymbol { X } } } _ { S } , \mathbf { \bar { \boldsymbol { X } } } _ { T } )$ . We then require that mapping a source sample from source to target and back to the source reproduces the original sample, thereby enforcing cycle-consistency. In other words, we want $G _ { T S } ( \bar { G } _ { S T } ( x _ { s } ) ) \approx x _ { s }$ and $G _ { S T } ( G _ { T S } ( x _ { t } ) ) \approx x _ { t }$ . This is done by imposing an L1 penalty on the reconstruction error, which is referred to as the cycle-consistency loss:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { c y c } } ( G _ { S T } , G _ { T S } , X _ { S } , X _ { T } ) = \mathbb { E } _ { x _ { s } \sim X _ { S } } [ | | G _ { T S } ( G _ { S T } ( x _ { s } ) ) - x _ { s } | | _ { 1 } ] } \\ { + \mathbb { E } _ { x _ { t } \sim X _ { T } } [ | | G _ { S T } ( G _ { T S } ( x _ { t } ) ) - x _ { t } | | _ { 1 } ] . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Additionally, as we have access to source labeled data, we explicitly encourage high semantic consistency before and after image translation. We used the pretrained source task model $f _ { S }$ , as a noisy labeler by which we encourage an image to be classified in the same way after translation as it was before translation according to this classifier. Let us define the predicted label from a fixed classifier, $f$ , for a given input $X$ as $p ( f , X ) = \arg \operatorname* { m a x } ( f ( X ) )$ . Then we can define the semantic consistency before and after image translation as follows:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \mathcal { L } _ { \mathrm { s e m } } ( G _ { S T } , G _ { T S } , X _ { S } , X _ { T } , f _ { S } ) = \mathcal { L } _ { \mathrm { t a s k } } ( f _ { S } , G _ { T S } ( X _ { T } ) , p ( f _ { S } , X _ { T } ) ) } \\ { + \mathcal { L } _ { \mathrm { t a s k } } ( f _ { S } , G _ { S T } ( X _ { S } ) , p ( f _ { S } , X _ { S } ) ) } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
See Figure 2 black portion. This can be viewed as analogously to content losses in style transfer (Gatys et al., 2016) or in pixel adaptation (Taigman et al., 2017a), where the shared content to preserve is dictated by the source task model $f _ { S }$ .
|
| 84 |
+
|
| 85 |
+
Feature-level Adaptation. We have thus far described an adaptation method which combines cycle consistency, semantic consistency, and adversarial objectives to produce a final target model. As a pixel-level method, the adversarial objective consists of a discriminator which distinguishes between two image sets, e.g. transformed source and real target image. Note that we could also consider a feature-level method which discriminates between the features or semantics from two image sets as viewed under a task network. This would amount to an additional feature level GAN loss (see Figure 2 orange portion):
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathcal { L } _ { \mathrm { G A N } } ( f _ { T } , D _ { \mathrm { f e a t } } , f _ { S } ( G _ { S T } ( X _ { S } ) ) , X _ { T } ) .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Taken together, these loss functions form our complete objective:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l } & { \mathcal { L } _ { \mathrm { C y C A D A } } ( f _ { T } , X _ { S } , X _ { T } , Y _ { S } , G _ { S T } , G _ { T S } , D _ { S } , D _ { T } ) } \\ & { \qquad = \mathcal { L } _ { \mathrm { u s k } } ( f _ { T } , G _ { S T } ( X _ { S } ) , Y _ { S } ) } \\ & { \qquad + \mathcal { L } _ { \mathrm { G A N } } ( G _ { S T } , D _ { T } , X _ { T } , X _ { S } ) + \mathcal { L } _ { \mathrm { G A N } } ( G _ { T S } , D _ { S } , X _ { S } , X _ { T } ) } \\ & { \qquad + \mathcal { L } _ { \mathrm { G A N } } ( f _ { T } , D _ { \mathrm { f e a t } } , f _ { S } ( G _ { S T } ( X _ { S } ) ) , X _ { T } ) } \\ & { \qquad + \mathcal { L } _ { \mathrm { c y c } } ( G _ { S T } , G _ { T S } , X _ { S } , X _ { T } ) + \mathcal { L } _ { \mathrm { s e m } } ( G _ { S T } , G _ { T S } , X _ { S } , X _ { T } , f _ { S } ) . } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
This ultimately corresponds to solving for a target model $f _ { T }$ according to the optimization problem
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
f _ { T } ^ { * } = \underset { f _ { T } } { \arg \operatorname* { m i n } } \ \underset { G _ { S T } } { \operatorname* { m i n } } \ \underset { D _ { S } , D _ { T } } { \operatorname* { m a x } } \ \mathcal { L } _ { \mathrm { C y C A D A } } ( f _ { T } , X _ { S } , X _ { T } , Y _ { S } , G _ { S T } , G _ { T S } , D _ { S } , D _ { T } ) .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
We have introduced a method for unsupervised adaptation which views prior adversarial objectives as operating at the pixel or feature level and generalizes to a method which may benefit from both approaches. In addition, we introduce the combination of cycle-consistency together with semantic transformation constraints to regularize the mapping from one domain to another. We apply CyCADA to both digit classification and to semantic segmentation. We implement $G _ { S }$ and $G _ { T }$ as a pixel-topixel convnet, $f _ { S }$ and $f _ { T }$ as a convnet classifier or a Fully-Convolutional Net (FCN), and $D _ { S } , D _ { T }$ and $D _ { \mathrm { f e a t } }$ as a convnet with binary outputs.
|
| 104 |
+
|
| 105 |
+
# 4 EXPERIMENTS
|
| 106 |
+
|
| 107 |
+
We evaluate CyCADA on several unsupervised adaptation scenarios. We first focus on adaptation for digit classification using the MNIST (LeCun et al., 1998), USPS, and Street View House Numbers
|
| 108 |
+
|
| 109 |
+
<table><tr><td>Model</td><td>MNIST → USPSUSPS</td><td></td><td>→MNISTSVHN→MNIST</td></tr><tr><td>Source only</td><td>82.2 ±0.8</td><td>69.6 ± 3.8</td><td>67.1 ± 0.6</td></tr><tr><td>DANN (Ganin et al., 2016)</td><td></td><td>1</td><td>73.6</td></tr><tr><td>DTN (Taigman et al.,2017a)</td><td></td><td>=</td><td>84.4</td></tr><tr><td>CoGAN (Liu& Tuzel,2016a)</td><td>91.2</td><td>89.1</td><td>-</td></tr><tr><td>ADDA (Tzeng et al., 2017)</td><td>89.4±0.2</td><td>90.1 ± 0.8</td><td>76.0 ± 1.8</td></tr><tr><td>CyCADA pixel only</td><td>95.6 ± 0.2</td><td>96.4 ± 0.1</td><td>70.3 ±0.2</td></tr><tr><td>CyCADA pixel+feat</td><td>95.6± 0.2</td><td>96.5 ± 0.1</td><td>90.4 ± 0.4</td></tr><tr><td>Target only</td><td>96.3± 0.1</td><td>99.2 ± 0.1</td><td>99.2 ±0.1</td></tr></table>
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Table 2: Unsupervised domain adaptation across digit datasets. Our model is competitive with or outperforms state-of-the-art models for each shift. For the difficult shift of SVHN to MNIST we also note that feature space adaptation provides additional benefit beyond the pixel-only adaptation.
|
| 113 |
+
Figure 3: Ablation: Effect of Semantic or Cycle Consistency Examples of translation failures without the semantic consistency loss. Each triple contains the original SVHN image (left), the image translated into MNIST style (middle), and the image reconstructed back into SVHN (right). (a) Without semantic loss, both the GAN and cycle constraints are satisfied (translated image matches MNIST style and reconstructed image matches original), but the image translated to the target domain lacks the proper semantics. (b) Without cycle loss, the reconstruction is not satisfied and though the semantic consistency leads to some successful semantic translations (top) there are still cases of label flipping (bottom).
|
| 114 |
+
|
| 115 |
+
(SVHN) (Netzer et al., 2011) datasets. After which we present results for the task of semantic image segmentation, using the GTA (Richter et al., 2016) and CityScapes (Cordts et al., 2016) datasets, see Appendix A.1.2 for an additional experiment with the SYNTHIA (Ros et al., 2016a) dataset.
|
| 116 |
+
|
| 117 |
+
# 4.1 DIGIT ADAPTATION
|
| 118 |
+
|
| 119 |
+
We evaluate our method across the adaptation shifts of USPS to MNIST, MNIST to USPS, and SVHN to MNIST, using the full training sets during learning phases and evaluating on the standard test sets. We report classification accuracy for each shift in Table 2 and find that our method outperforms competing approaches on average. The classifier for our method for all digit shifts uses a variant of the LeNet architecture (see A.1.1 for full implementation details). Note that the recent pixel-da method by Bousmalis et al. (2017b) presents results for only the MNIST to USPS shift and reports $9 5 . 9 \%$ accuracy, while our method achieves $9 5 . 6 \%$ accuracy. However, the pixel-da approach cross validates with some labeled data which is not an equivalent evaluation setting.
|
| 120 |
+
|
| 121 |
+
Ablation: Pixel vs Feature Level Transfer. We begin by evaluating the contribution of the pixel space and feature space transfer. We find that in the case of the small domain shifts between USPS and MNIST, the pixel space adaptation by which we train a classifier using images translated using CycleGAN (Zhu et al., 2017), performs very well, outperforming or comparable to prior adaptation approaches. Feature level adaptation offers a small benefit in this case of a small pixel shift. However, for the more difficult shift of SVHN to MNIST, we find that feature level adaptation outperforms the pixel level adaptation, and importantly, both may be combined to produce an overall model which outperforms all competing methods.
|
| 122 |
+
|
| 123 |
+
Ablation: No Semantic Consistency. We experiment without the addition of our semantic consistency loss and find that the standard unsupervised CycleGAN approach diverged when training SVHN to MNIST often suffering from random label flipping. Figure 3(a) demonstrates two examples where cycle constraints alone fail to have the desired behavior for our end task. An SVHN image is mapped to a convincing MNIST type image and back to a SVHN image with correct semantics. However, the MNIST-like image has mismatched semantics. Our modified version, which uses the source labels to train a weak classification model which can be used to enforce semantic consistency before and after translation, resolves this issue and produces strong performance.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 4: GTA5 to CityScapes Semantic Segmentation. Each test CityScapes image (a) along with the corresponding predictions from the source only model (b) and our CyCADA model (c) are shown and may be compared against the ground truth annotation (d).
|
| 127 |
+
|
| 128 |
+
Ablation: No Cycle Consistency. We study the result when learning without the cycle consistency loss. First note that there is no reconstruction guarantee in this case, thus in Figure 3(b) we see that the translation back to SVHN fails. In addition, we find that while the semantic loss does encourage correct semantics it relies on the weak source labeler and thus label flipping still occurs (see right image triple).
|
| 129 |
+
|
| 130 |
+
# 4.2 SEMANTIC SEGMENTATION ADAPTATION
|
| 131 |
+
|
| 132 |
+
The task is to assign a semantic label to each pixel in the input image, e.g. road, building, etc. We limit our evaluation to the unsupervised adaptation setting, where labels are only available in the source domain, but we are evaluated solely on our performance in the target domain.
|
| 133 |
+
|
| 134 |
+
For each experiment, we use three metrics to evaluate performance. Let $n _ { i j }$ be the number of pixels of class $i$ predicted as class $j$ , let $t _ { i } = \textstyle \sum _ { j } n _ { i j }$ be the total number of pixels of class $i$ , and let $N$ be the number of classes. Our three evaluation metrics are, mean intersection-over-union (mIoU), frequency weighted intersection-over-union (fwIoU), and pixel accuracy, which are defined as follows:
|
| 135 |
+
|
| 136 |
+
Cycle-consistent adversarial adaptation is general and can be applied at any layer of a network. Since optimizing the full CyCADA objective in Equation 6 end-to-end is memory-intensive in practice, we train our model in stages. First, we perform image-space adaptation and map our source data into the target domain. Next, using the adapted source data with the original source labels, we learn a task model that is suited to operating on target data. Finally, we perform another round of adaptation between the adapted source data and the target data in feature-space, using one of the intermediate layers of the task model. Additionally, we do not use the semantic loss for the segmentation experiments as it would require loading generators, discriminators, and an additional semantic segmenter into memory all at once for two images. We did not have the required memory for this at the time of submission, but leave it to future work to deploy model parallelism or experiment with larger GPU memory.
|
| 137 |
+
|
| 138 |
+
To demonstrate our method’s applicability to real-world adaptation scenarios, we also evaluate our model in a challenging synthetic-to-real adaptation setting. For our synthetic source domain, we use the GTA5 dataset (Richter et al., 2016) extracted from the game Grand Theft Auto V, which contains 24966 images. We consider adaptation from GTA5 to the real-world Cityscapes dataset (Cordts et al., 2016), from which we used 19998 images without annotation for training and 500 images for validation. Both of these datasets are evaluated on the same set of 19 classes, allowing for
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan=1 colspan=6>GTA5→ Cityscapes</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>eeree</td><td rowspan=1 colspan=4>iorensaeaartBuiplingursorien Veneee morirrtt Prre rectirrnuos.iadaatiie0NOIMJ对u</td></tr><tr><td rowspan=2 colspan=1>Source onlyFCNs in the wild*CyCADA feat-onlyCyCADA pixel-onlyCyCADA pixel+feat</td><td rowspan=2 colspan=1>AAAA</td><td rowspan=2 colspan=3>A|26.0 14.9 65.15.512.98.96.02.570.02.947.0 24.50.040.012.11.50.00.00.070.4 32.4 62.114.95.410.9 14.22.779.2 21.3 64.6 44.14.270.48.07.30.03.50.085.6 30.7 74.714.4 13.0 17.6 13.75.874.6 15.8 69.9 38.23.572.3 16.05.00.13.60.083.538.376.4220.616.522.226.221.980.4 28.7 65.7 49.44.274.6 16.0 26.62.08.00.085.2 37.2 76.5 21.8 15.0 23.8 22.9 21.5880.5 31.3 60.7 50.59.076.917.128.24.59.80.0</td><td rowspan=2 colspan=1>17.9 41.9 54.027.129.2 71.5 82.534.8 73.1 82.835.4 73.8 83.6</td></tr><tr><td rowspan=1 colspan=1>34.8 73.1 82.835.4 73.8 83.6</td></tr><tr><td rowspan=1 colspan=2>Oracle - Target Super|</td><td rowspan=1 colspan=4>|A|96.4 74.5 87.1 35.337.8 36.4 46.9 60.189.0 54.3 89.8 65.6 35.9 89.4 38.6 64.1 38.6 40.5 65.160.3 87.6 93.1</td></tr><tr><td rowspan=4 colspan=1>Source onlyCyCADA feat-onlyCyCADA pixel-onlyCyCADA pixel+feat</td><td rowspan=1 colspan=1>B</td><td rowspan=4 colspan=4>42.7 26.3 51.75.56.813.8 23.6 6.9 75.511.5 36.8 49.30.946.73.45.00.05.01.421.7 47.4 62.578.1 31.171.210.314.129.8 28.120.9 74.0 16.8 51.9 53.66.165.4 8.2 20.91.813.9 5.931.7 67.4 78.463.7 24.7 69.3 21.2 17.0 30.3 33.0 32.0 80.5 25.3 62.3 62.0 15.1 73.1119.8 23.65.516.2 28.737.0 63.8 75.479.133.1 77.9 23.417.332.133.331.881.526.7 69.0 62.814.774.520.9 25.66.918.8 20.439.5 72.4 82.3</td></tr><tr><td rowspan=2 colspan=1>BB</td></tr><tr><td rowspan=1 colspan=1>5.5</td></tr><tr><td rowspan=1 colspan=1>B</td></tr><tr><td rowspan=1 colspan=1>Oracle - Target Super|</td><td rowspan=1 colspan=1>B</td><td rowspan=1 colspan=4>Bl97.379.8 88.6 32.5 48.2 56.3 63.6 73.3 89.0 58.9 93.0 78.2 55.2 92.2 45.067.339.649.973.667.489.6 94.3</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 3: Adaptation between GTA5 and Cityscapes, showing IoU for each class and mean IoU, freqweighted IoU and pixel accuracy. CyCADA significantly outperforms baselines, nearly closing the gap to the target-trained oracle on pixel accuracy. ${ } ^ { * } \mathrm { F C N s }$ in the wild is by Hoffman et al. (2016). We compare our model using two base semantic segmentation architectures (A) VGG16-FCN8s (Long et al., 2015) base network and (B) DRN-26 (Yu et al., 2017).
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 5: GTA5 to CityScapes Image Translation. Example images from the GTA5 (a) and Cityscapes (c) datasets, alongside their image-space conversions to the opposite domain, (b) and (d), respectively. Our model achieves highly realistic domain conversions.
|
| 146 |
+
|
| 147 |
+
straightforward adaptation between the two domains. For an additional experiment evaluating cross-season adaptation in synthetic environments see the Appendix.
|
| 148 |
+
|
| 149 |
+
Image-space adaptation also affords us the ability to visually inspect the results of the adaptation method. This is a distinct advantage over opaque feature-space adaptation methods, especially in truly unsupervised settings—without labels, there is no way to empirically evaluate the adapted model, and thus no way to verify that adaptation is improving task performance. Visually confirming that the conversions between source and target images are reasonable, while not a guarantee of improved task performance, can serve as a sanity check to ensure that adaptation is not completely diverging. This process is diagrammed in Figure 2. For implementation details please see Appendix A.1.2.
|
| 150 |
+
|
| 151 |
+
# 4.2.1 SYNTHETIC TO REAL ADAPTATION
|
| 152 |
+
|
| 153 |
+
To evaluate our method’s applicability to real-world adaptation settings, we investigate adaptation from synthetic to real-world imagery. The results of this evaluation are presented in Table 3 with qualitative results shown in Figure 4. Once again, CyCADA achieves state-of-the-art results, recovering approximately $40 \%$ of the performance lost to domain shift. CyCADA also improves or maintains performance on all 19 classes. Examination of fwIoU and pixel accuracy as well as individual class IoUs reveals that our method performs well on most of the common classes. Although some classes such as train and bicycle see little or no improvement, we note that those classes are poorly represented in the GTA5 data, making recognition very difficult. We compare our model against Shrivastava et al. (2017) for this setting, but found this approach did not converge and resulted in worse performance than the source only model (see Appendix for full details).
|
| 154 |
+
|
| 155 |
+
We visualize the results of image-space adaptation between GTA5 and Cityscapes in Figure 5. The most obvious difference between the original images and the adapted images is the saturation levels— the GTA5 imagery is much more vivid than the Cityscapes imagery, so adaptation adjusts the colors to compensate. We also observe texture changes, which are perhaps most apparent in the road: in-game, the roads appear rough with many blemishes, but Cityscapes roads tend to be fairly uniform in appearance, so in converting from GTA5 to Cityscapes, our model removes most of the texture. Somewhat amusingly, our model has a tendency to add a hood ornament to the bottom of the image, which, while likely irrelevant to the segmentation task, serves as a further indication that image-space adaptation is producing reasonable results.
|
| 156 |
+
|
| 157 |
+
# 5 CONCLUSION
|
| 158 |
+
|
| 159 |
+
We presented a cycle-consistent adversarial domain adaptation method that unifies cycle-consistent adversarial models with adversarial adaptation methods. CyCADA is able to adapt even in the absence of target labels and is broadly applicable at both the pixel-level and in feature space. An image-space adaptation instantiation of CyCADA also provides additional interpretability and serves as a useful way to verify successful adaptation. Finally, we experimentally validated our model on a variety of adaptation tasks: state-of-the-art results in multiple evaluation settings indicate its effectiveness, even on challenging synthetic-to-real tasks.
|
| 160 |
+
|
| 161 |
+
# REFERENCES
|
| 162 |
+
|
| 163 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. CoRR, abs/1701.07875, 2017. URL http://arxiv.org/abs/1701.07875.
|
| 164 |
+
|
| 165 |
+
Konstantinos Bousmalis, Alex Irpan, Paul Wohlhart, Yunfei Bai, Matthew Kelcey, Mrinal Kalakrishnan, Laura Downs, Julian Ibarz, Peter Pastor, Kurt Konolige, Sergey Levine, and Vincent Vanhoucke. Using simulation and domain adaptation to improve efficiency of deep robotic grasping. CoRR, abs/1709.07857, 2017a. URL http://arxiv.org/abs/1709.07857.
|
| 166 |
+
|
| 167 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017b.
|
| 168 |
+
|
| 169 |
+
Yi-Hsin Chen, Wei-Yu Chen, Yu-Ting Chen, Bo-Cheng Tsai, Yu-Chiang Frank Wang, and Min Sun. No more discrimination: Cross city adaptation of road scene segmenters. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017.
|
| 170 |
+
|
| 171 |
+
Marius Cordts, Mohamed Omran, Sebastian Ramos, Timo Rehfeld, Markus Enzweiler, Rodrigo Benenson, Uwe Franke, Stefan Roth, and Bernt Schiele. The Cityscapes dataset for semantic urban scene understanding. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 172 |
+
|
| 173 |
+
Emily L Denton, Soumith Chintala, Rob Fergus, et al. Deep generative image models using a laplacian pyramid of adversarial networks. In Neural Information Processing Systems (NIPS), pp. 1486–1494, 2015.
|
| 174 |
+
|
| 175 |
+
Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. In ICLR, 2017.
|
| 176 |
+
|
| 177 |
+
Vincent Dumoulin, Ishmael Belghazi, Ben Poole, Alex Lamb, Martin Arjovsky, Olivier Mastropietro, and Aaron Courville. Adversarially learned inference. arXiv preprint arXiv:1606.00704, 2016.
|
| 178 |
+
|
| 179 |
+
Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, M. Marchand, and V. Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 2016.
|
| 180 |
+
|
| 181 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In David Blei and Francis Bach (eds.), Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pp. 1180–1189. JMLR Workshop and Conference Proceedings, 2015. URL http://jmlr.org/proceedings/papers/v37/ganin15.pdf.
|
| 182 |
+
|
| 183 |
+
Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Computer Vision and Pattern Recognition (CVPR), pp. 2414–2423, 2016.
|
| 184 |
+
|
| 185 |
+
Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, David Balduzzi, and Wen Li. Deep reconstruction-classification networks for unsupervised domain adaptation. In European Conference on Computer Vision (ECCV), pp. 597–613. Springer, 2016.
|
| 186 |
+
|
| 187 |
+
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 27. 2014. URL http://papers.nips.cc/paper/ 5423-generative-adversarial-nets.pdf.
|
| 188 |
+
|
| 189 |
+
G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. 2015.
|
| 190 |
+
|
| 191 |
+
Judy Hoffman, Dequan Wang, Fisher Yu, and Trevor Darrell. FCNs in the wild: Pixel-level adversarial and constraint-based adaptation. CoRR, abs/1612.02649, 2016. URL http://arxiv.org/ abs/1612.02649.
|
| 192 |
+
|
| 193 |
+
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.
|
| 194 |
+
|
| 195 |
+
Levent Karacan, Zeynep Akata, Aykut Erdem, and Erkut Erdem. Learning to generate images of outdoor scenes from attributes and semantic layouts. arXiv preprint arXiv:1612.00215, 2016.
|
| 196 |
+
|
| 197 |
+
Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. arXiv preprint arXiv:1703.05192, 2017.
|
| 198 |
+
|
| 199 |
+
Y. LeCun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, November 1998.
|
| 200 |
+
|
| 201 |
+
Evgeny Levinkov and Mario Fritz. Sequential bayesian model update under structured scene prior for semantic road scenes labeling. In IEEE International Conference on Computer Vision (ICCV), 2013. URL http://scalable.mpi-inf.mpg.de/files/2013/10/levinkov13iccv. pdfhttp://www.d2.mpi-inf.mpg.de/sequential-bayesian-update.
|
| 202 |
+
|
| 203 |
+
M.-Y. Liu and O. Tuzel. Coupled generative adversarial networks. In Advances in Neural Information Processing Systems, 2016a.
|
| 204 |
+
|
| 205 |
+
Ming-Yu Liu and Oncel Tuzel. Coupled generative adversarial networks. In Neural Information Processing Systems (NIPS), 2016b.
|
| 206 |
+
|
| 207 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. CVPR (to appear), November 2015.
|
| 208 |
+
|
| 209 |
+
Mingsheng Long and Jianmin Wang. Learning transferable features with deep adaptation networks. In International Conference on Machine Learning (ICML), 2015.
|
| 210 |
+
|
| 211 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. CoRR, abs/1411.1784, 2014. URL http://arxiv.org/abs/1411.1784.
|
| 212 |
+
|
| 213 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y. Ng. Reading digits in natural images with unsupervised feature learning. In NIPS Workshop on Deep Learning and Unsupervised Feature Learning 2011, 2011. URL http://ufldl.stanford.edu/ housenumbers/nips2011_housenumbers.pdf.
|
| 214 |
+
|
| 215 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 216 |
+
|
| 217 |
+
Stephan R. Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun. Playing for data: Ground truth from computer games. In Bastian Leibe, Jiri Matas, Nicu Sebe, and Max Welling (eds.), European Conference on Computer Vision (ECCV), volume 9906 of LNCS, pp. 102–118. Springer International Publishing, 2016.
|
| 218 |
+
|
| 219 |
+
German Ros, Laura Sellart, Joanna Materzynska, David Vazquez, and Antonio Lopez. The SYNTHIA Dataset: A large collection of synthetic images for semantic segmentation of urban scenes. In Proc. of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016a.
|
| 220 |
+
|
| 221 |
+
Germán Ros, Simon Stent, Pablo F. Alcantarilla, and Tomoki Watanabe. Training constrained deconvolutional networks for road scene semantic segmentation. CoRR, abs/1604.01545, 2016b. URL http://arxiv.org/abs/1604.01545.
|
| 222 |
+
|
| 223 |
+
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In European conference on computer vision, pp. 213–226. Springer, 2010.
|
| 224 |
+
|
| 225 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. arXiv preprint arXiv:1606.03498, 2016a.
|
| 226 |
+
|
| 227 |
+
Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. CoRR, abs/1606.03498, 2016b. URL http://arxiv. org/abs/1606.03498.
|
| 228 |
+
|
| 229 |
+
Patsorn Sangkloy, Jingwan Lu, Chen Fang, Fisher Yu, and James Hays. Scribbler: Controlling deep image synthesis with sketch and color. arXiv preprint arXiv:1612.00835, 2016.
|
| 230 |
+
|
| 231 |
+
Ashish Shrivastava, Tomas Pfister, Oncel Tuzel, Joshua Susskind, Wenda Wang, and Russell Webb. Learning from simulated and unsupervised images through adversarial training. In The IEEE Conference on Computer Vision and Pattern Recognition (CVPR), July 2017.
|
| 232 |
+
|
| 233 |
+
Baochen Sun and Kate Saenko. Deep CORAL: correlation alignment for deep domain adaptation. In ICCV workshop on Transferring and Adapting Source Knowledge in Computer Vision (TASK-CV), 2016.
|
| 234 |
+
|
| 235 |
+
Y. Taigman, A. Polyak, and L. Wolf. Unsupervised cross-domain image generation. In International Conference on Learning Representations, 2017a.
|
| 236 |
+
|
| 237 |
+
Yaniv Taigman, Adam Polyak, and Lior Wolf. Unsupervised cross-domain image generation. In International Conference on Learning Representations (ICLR), 2017b.
|
| 238 |
+
|
| 239 |
+
Antonio Torralba and Alexei A. Efros. Unbiased look at dataset bias. In CVPR’11, June 2011.
|
| 240 |
+
|
| 241 |
+
Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. CoRR, abs/1412.3474, 2014. URL http://arxiv.org/ abs/1412.3474.
|
| 242 |
+
|
| 243 |
+
Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains and tasks. In International Conference in Computer Vision (ICCV), 2015.
|
| 244 |
+
|
| 245 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Computer Vision and Pattern Recognition (CVPR), 2017. URL http://arxiv. org/abs/1702.05464.
|
| 246 |
+
|
| 247 |
+
Zili Yi, Hao Zhang, Ping Tan Gong, et al. Dualgan: Unsupervised dual learning for image-to-image translation. arXiv preprint arXiv:1704.02510, 2017.
|
| 248 |
+
|
| 249 |
+
Donggeun Yoo, Namil Kim, Sunggyun Park, Anthony S. Paek, and In-So Kweon. Pixel-level domain transfer. In European Conference on Computer Vision (ECCV), 2016. URL http: //arxiv.org/abs/1603.07442.
|
| 250 |
+
|
| 251 |
+
Fisher Yu, Vladlen Koltun, and Thomas Funkhouser. Dilated residual networks. In Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 252 |
+
|
| 253 |
+
Yang Zhang, Philip David, and Boqing Gong. Curriculum domain adaptation for semantic segmentation of urban scenes. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017.
|
| 254 |
+
|
| 255 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 256 |
+
|
| 257 |
+
Jun-Yan Zhu, Philipp Krähenbühl, Eli Shechtman, and Alexei A. Efros. Generative visual manipulation on the natural image manifold. In European Conference on Computer Vision (ECCV), 2016.
|
| 258 |
+
|
| 259 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In International Conference on Computer Vision (ICCV), 2017.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 6: Network architectures used for digit experiments. We show here the task net $( f )$ , discriminator for feature level adaptation $( D ^ { f e a t } )$ , discriminator for image level adaptation $( D ^ { i m a g e } )$ , and generator for source to target $( G )$ – same network used for target to source.
|
| 263 |
+
|
| 264 |
+
# A APPENDIX
|
| 265 |
+
|
| 266 |
+
# A.1 IMPLEMENTATION DETAILS
|
| 267 |
+
|
| 268 |
+
We begin by pretraining the source task model, $f _ { S }$ , using the task loss on the labeled source data. Next, we perform pixel-level adaptation using our image space GAN losses together with semantic consistency and cycle consistency losses. This yeilds learned parameters for the image transformations, $G _ { S T }$ and $G _ { T S }$ , image discriminators, $D _ { S }$ and $D _ { T }$ , as well as an initial setting of the task model, $f _ { T }$ , which is trained using pixel transformed source images and the corresponding source pixel labels. Finally, we perform feature space adpatation in order to update the target semantic model, $f _ { T }$ , to have features which are aligned between the source images mapped into target style and the real target images. During this phase, we learn the feature discriminator, $D _ { \mathrm { f e a t } }$ and use this to guide the representation update to $f _ { T }$ . In general, our method could also perform phases 2 and 3 simultaneously, but this would require more GPU memory then available at the time of these experiments.
|
| 269 |
+
|
| 270 |
+
For all feature space adaptation we equally weight the generator and discriminator losses. We only update the generator when the discriminator accuracy is above $60 \%$ over the last batch (digits) or last 100 iterations (semantic segmentation) – this reduces the potential for volatile training. If after an epoch (entire pass over dataset) no suitable discriminator is found, the feature adaptation stops, otherwise it continues until max iterations are reached.
|
| 271 |
+
|
| 272 |
+
# A.1.1 DIGIT EXPERIMENTS
|
| 273 |
+
|
| 274 |
+
For all digit experiments we use a variant of the LeNet architecture as the task net (Figure 6 left). Our feature discriminator network consists of 3 fully connected layers (Figure 6 mid left). The image discriminator network consists of 6 convolutional layers culminating in a single value per pixel (Figure 6 mid right). Finally, to generate one image domain from another we use a multilayer network which consists of convolution layers followed by two residual blocks and then deconvolution layers (Figure 6 right). All stages are trained using the Adam optimizer.
|
| 275 |
+
|
| 276 |
+
Hyperparameters. For training the source task net model, we use learning rate 1e-4 and train for 100 epochs over the data with batch size 128. For feature space adaptation we use learning rate 1e-5 and train for max 200 epochs over the data. For pixel space adaptation we train our generators and discriminators with equal weighting on all losses, use batch size 100, learning rate 2e-4 (default from CycleGAN), and trained for 50 epochs. We ran each experiment 4 times and report the average and standard error across the runs.
|
| 277 |
+
|
| 278 |
+
# A.1.2 SEMANTIC SEGMENTATION
|
| 279 |
+
|
| 280 |
+

|
| 281 |
+
Figure 7: GTA5 to CityScapes Image Translation. Example images from the GTA5 (a) and Cityscapes (c) datasets, alongside their image-space conversions to the opposite domain, (b) and (d), respectively. Our model achieves highly realistic domain conversions.
|
| 282 |
+
|
| 283 |
+
We experiment with both the VGG16-FCN8s Long et al. (2015) architecture as well as the DRN-26 Yu et al. (2017) architecture. For FCN8s, we train our source semantic segmentation model for 100k iterations using SGD with learning rate 1e-3 and momentum 0.9. For the DRN-26 architecture, we train our source semantic segmentation model for 115K iterations using SGD with learning rate 1e-3 and momentum 0.9. We use a crop size of $6 0 0 \times 6 0 0$ and a batch size of 8 for this training. For cycle-consistent image level adaptation, we followed the network architecture and hyperparameters of CycleGAN(Zhu et al., 2017). All images were resized to have width of 1024 pixels while keeping the aspect ratio, and the training was performed with randomly cropped patches of size 400 by 400. Also, due to large size of the dataset, we trained only 20 epochs. For feature level adaptation, we train using SGD with momentum, 0.99, and learning rate 1e-5. We weight the representation loss ten times less than the discriminator loss as a convenience since otherwise the discriminator did not learn a suitable model within a single epoch. Then the segmentation model was trained separately using the adapted source images and the ground truth labels of the source data. Due to memory limitations we can only include a single source and single target image at a time (crops of size $7 6 8 x 7 6 8 $ ), this small batch is one of the main reasons for using a high momentum parameter.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 8: Cross Season Image Translation. Example image-space conversions for the SYNTHIA seasons adaptation setting. We show real samples from each domain (Fall and Winter) alongside conversions to the opposite domain.
|
| 287 |
+
|
| 288 |
+
Table 4: Adaptation between seasons in the SYNTHIA dataset. We report IoU for each class and mean IoU, freq-weighted IoU and pixel accuracy. Our CyCADA method achieves state-of-the-art performance on average across all categories. ${ } ^ { * } \mathrm { F C N s }$ in the wild is by Hoffman et al. (2016).
|
| 289 |
+
|
| 290 |
+
<table><tr><td></td><td colspan="13">SYNTHIA Fall -→Winter</td></tr><tr><td></td><td>多</td><td>Buipping</td><td></td><td>seeare</td><td></td><td>Vegeeee</td><td></td><td>u</td><td>us ogen</td><td>uerrespad</td><td>elair</td><td>Brraiiaa</td><td>naiggee</td><td></td><td>Prrr pxecs NOIMJ</td></tr><tr><td>Source only</td><td>91.7</td><td>80.6</td><td>79.7</td><td>12.1</td><td>71.8</td><td>44.2</td><td>26.1</td><td>42.8</td><td>49.0</td><td>38.7</td><td>45.1</td><td>41.3 24.5</td><td>49.8</td><td>71.7</td><td>82.3</td></tr><tr><td>FCNs in the wild</td><td>92.1</td><td>86.7</td><td>91.3</td><td>20.8</td><td>72.7</td><td>52.9</td><td>46.5</td><td>64.3</td><td>50.0</td><td>59.5</td><td>54.6 57.5</td><td>26.1</td><td>59.6</td><td>一</td><td></td></tr><tr><td>CyCADA pixel-only</td><td>92.5</td><td>90.1</td><td>91.9</td><td>79.9</td><td>85.7</td><td>47.1</td><td>36.9</td><td>82.6</td><td>45.0</td><td>49.1</td><td>46.2 54.6</td><td>21.5</td><td>63.3</td><td>85.7</td><td>92.1</td></tr><tr><td>Oracle (Train on target)</td><td>93.8</td><td>92.2</td><td>94.7</td><td>90.7</td><td>90.2</td><td>64.4</td><td>38.1</td><td>88.5</td><td>55.4</td><td>51.0</td><td>52.0</td><td>68.9 37.3</td><td></td><td></td><td>70.589.9 94.5</td></tr></table>
|
| 291 |
+
|
| 292 |
+
# A.1.3 CROSS-SEASON ADAPTATION
|
| 293 |
+
|
| 294 |
+
As an additional semantic segmentation evaluation, we consider the SYNTHIA dataset (Ros et al., 2016a), which contains synthetic renderings of urban scenes. We use the SYNTHIA video sequences, which are rendered across a variety of environments, weather conditions, and lighting conditions. This provides a synthetic testbed for evaluating adaptation techniques. For comparison with previous work, in this work we focus on adaptation between seasons. We use only the front-facing views in the sequences so as to mimic dashcam imagery, and adapt from fall to winter. The subset of the dataset we use contains 13 classes and consists of 10,852 fall images and 7,654 winter images.
|
| 295 |
+
|
| 296 |
+
We start by exploring the abilities of pixel space adaptation alone (using FCN8s architecture) for the setting of adapting across seasons in synthetic data. For this we use the SYNTHIA dataset and adapt from fall to winter weather conditions. Typically in unsupervised adaptation settings it is difficult to interpret what causes the performance improvement after adaptation. Therefore, we use this setting as an example where we may directly visualize the shift from fall to winter and inspect the intermediate pixel level adaptation result from our algorithm. In Figure 8 we show the result of pixel only adaptation as we generate a winter domain image (b) from a fall domain image (a), and visa versa (c-d). We may clearly see the changes of adding or removing snow. This visually interpretable result matches our expectation of the true shift between these domains and indeed results in favorable final semantic segmentation performance from fall to winter as shown in Table 4. We find that CyCADA achieves state-of-the-art performance on this task with image space adaptation alone, however does not recover full supervised learning performance (train on target). Some example errors includes adding snow to the sidewalks, but not to the road, while in the true winter domain snow appears in both locations. However, even this mistake is interesting as it implies that the model is learning to distinguish road from sidewalk during pixel adaptation, despite the lack of pixel annotations.
|
| 297 |
+
|
| 298 |
+
Cycle-consistent adversarial adaptation achieves state-of-the-art adaptation performance. We see that under the fwIoU and pixel accuracy metrics, CyCADA approaches oracle performance, falling short by only a few points, despite being entirely unsupervised. This indicates that CyCADA is extremely effective at correcting the most common classes in the dataset. This conclusion is supported by inspection of the individual classes in Table 4, where we see the largest improvement on common classes such as road and sidewalk.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 9: Image transformation results from Shrivastava et al. (2017) applied to GTA to CityScapes transformation. We demonstrate results using three different settings for $\lambda$ .
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 10: Confusion matrices for SVHN MNIST experiment.
|
| 305 |
+
|
| 306 |
+
# A.2 COMPARISON TO SHRIVASTAVA ET AL. (2017) FOR SEMANTIC SEGMENTATION
|
| 307 |
+
|
| 308 |
+
We illustrate the performance of a recent pixel level adaptation approach proposed by Shrivastava et al. (2017) on our semantic segmentation data – GTA to Cityscapes. These images are significantly larger and more complex than those shown in the experiments in the original paper. We show image to image translation results under three different settings of the model hyperparameter, $\lambda$ , which controls the tradeoff between the reconstruction loss and the visual style loss. When $\lambda = 1 0$ (Figure 9 right), the resulting image converges to a near replica of the original image, thus preserving content but lacking the correct target style. When $\lambda = 1$ or $\lambda = 2 . 5$ (Figure 9 left), the results lack any consistent semantics making it difficult to perceive the style of the transformed image. Thus, the resulting performance for this model is 11.6 mIoU for FCN8s with VGG, well below the performance of the corresponding source model of 17.9 mIoU.
|
| 309 |
+
|
| 310 |
+
# A.3 EXPERIMENT ANALYSIS
|
| 311 |
+
|
| 312 |
+
To understand the types of mistakes which are improved upon and those which still persist after adaptation, we present the confusion matrices before and after our approach for the digit experiment of SVHN to MNIST (Figure 10). Before adaptation we see common confusions are 0s with 2s, 4s, and 7s. 6 with 4, 8 with 3, and 9 with 4. After adaptation all errors are reduced, but we still find that 7s are confused with 1s and 0s with 2s. These errors make some sense as with hand written digits, these digits sometimes resemble one another. It remains an open question to produce a model which may overcome these types of errors between highly similar classes.
|
md/train/SkzK4iC5Ym/SkzK4iC5Ym.md
ADDED
|
@@ -0,0 +1,916 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIMINISHING BATCH NORMALIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In this paper, we propose a generalization of the BN algorithm, diminishing batch normalization (DBN), where we update the BN parameters in a diminishing moving average way. Batch normalization (BN) is very effective in accelerating the convergence of a neural network training phase that it has become a common practice. Our proposed DBN algorithm remains the overall structure of the original BN algorithm while introduces a weighted averaging update to some trainable parameters. We provide an analysis of the convergence of the DBN algorithm that converges to a stationary point with respect to trainable parameters. Our analysis can be easily generalized for original BN algorithm by setting some parameters to constant. To the best knowledge of authors, this analysis is the first of its kind for convergence with Batch Normalization introduced. We analyze a two-layer model with arbitrary activation function. The primary challenge of the analysis is the fact that some parameters are updated by gradient while others are not. The convergence analysis applies to any activation function that satisfies our common assumptions. For the analysis, we also show the sufficient and necessary conditions for the stepsizes and diminishing weights to ensure the convergence. In the numerical experiments, we use more complex models with more layers and ReLU activation. We observe that DBN outperforms the original BN algorithm on Imagenet, MNIST, NI and CIFAR-10 datasets with reasonable complex FNN and CNN models.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNN) have shown unprecedented success in various applications such as object detection. However, it still takes a long time to train a DNN until it converges. Ioffe & Szegedy identified a critical problem involved in training deep networks, internal covariate shift, and then proposed batch normalization (BN) to decrease this phenomenon. BN addresses this problem by normalizing the distribution of every hidden layer’s input. In order to do so, it calculates the preactivation mean and standard deviation using mini-batch statistics at each iteration of training and uses these estimates to normalize the input to the next layer. The output of a layer is normalized by using the batch statistics, and two new trainable parameters per neuron are introduced that capture the inverse operation. It is now a standard practice Bottou et al. (2016); He et al. (2016). While this approach leads to a significant performance jump, to the best of our knowledge, there is no known theoretical guarantee for the convergence of an algorithm with BN. The difficulty of analyzing the convergence of the BN algorithm comes from the fact that not all of the BN parameters are updated by gradients. Thus, it invalidates most of the classical studies of convergence for gradient methods.
|
| 12 |
+
|
| 13 |
+
In this paper, we propose a generalization of the BN algorithm, diminishing batch normalization (DBN), where we update the BN parameters in a diminishing moving average way. It essentially means that the BN layer adjusts its output according to all past mini-batches instead of only the current one. It helps to reduce the problem of the original BN that the output of a BN layer on a particular training pattern depends on the other patterns in the current mini-batch, which is pointed out by Bottou et al.. By setting the layer parameter we introduce into DBN to a specific value, we recover the original BN algorithm.
|
| 14 |
+
|
| 15 |
+
We give a convergence analysis of the algorithm with a two-layer batch-normalized neural network and diminishing stepsizes. We assume two layers (the generalization to multiple layers can be made by using the same approach but substantially complicating the notation) and an arbitrary loss function. The convergence analysis applies to any activation function that follows our common assumption. The main result shows that under diminishing stepsizes on gradient updates and updates on mini-batch statistics, and standard Lipschitz conditions on loss functions DBN converges to a stationary point. As already pointed out the primary challenge is the fact that some trainable parameters are updated by gradient while others are updated by a minor recalculation.
|
| 16 |
+
|
| 17 |
+
Contributions. The main contribution of this paper is in providing a general convergence guarantee for DBN. Specifically, we make the following contributions.
|
| 18 |
+
|
| 19 |
+
• In section 4, we show the sufficient and necessary conditions for the stepsizes and diminishing weights to ensure the convergence of BN parameters.
|
| 20 |
+
• We show that the algorithm converges to a stationary point under a general nonconvex objective function.
|
| 21 |
+
|
| 22 |
+
This paper is organized as follows. In Section 2, we review the related works and the development of the BN algorithm. We formally state our model and algorithm in Section 3. We present our main results in Sections 4. In Section 5, we numerically show that the DBN algorithm outperforms the original BN algorithm. Proofs for main steps are collected in the Appendix.
|
| 23 |
+
|
| 24 |
+
# 2 LITERATURE REVIEW
|
| 25 |
+
|
| 26 |
+
Before the introduction of BN, it has long been known in the deep learning community that input whitening and decorrelation help to speed up the training process. In fact, Orr & Muller show that ¨ preprocessing the data by subtracting the mean, normalizing the variance, and decorrelating the input has various beneficial effects for back-propagation. Krizhevsky et al. propose a method called local response normalization which is inspired by computational neuroscience and acts as a form of lateral inhibition, i.e., the capacity of an excited neuron to reduce the activity of its neighbors. Gulc¸ehre ¨ & Bengio propose a standardization layer that bears significant resemblance to batch normalization, except that the two methods are motivated by very different goals and perform different tasks.
|
| 27 |
+
|
| 28 |
+
Inspired by BN, several new works are taking BN as a basis for further improvements. Layer normalization Ba et al. (2016) is much like the BN except that it uses all of the summed inputs to compute the mean and variance instead of the mini-batch statistics. Besides, unlike BN, layer normalization performs precisely the same computation at training and test times. Normalization propagation that Arpit et al. uses data-independent estimations for the mean and standard deviation in every layer to reduce the internal covariate shift and make the estimation more accurate for the validation phase. Weight normalization also removes the dependencies between the examples in a minibatch so that it can be applied to recurrent models, reinforcement learning or generative models Salimans & Kingma (2016). Cooijmans et al. propose a new way to apply batch normalization to RNN and LSTM models.
|
| 29 |
+
|
| 30 |
+
Given all these flavors, the original BN method is the most popular technique and for this reason our choice of the analysis. To the best of our knowledge, we are not aware of any prior analysis of BN.
|
| 31 |
+
|
| 32 |
+
BN has the gradient and non-gradient updates. Thus, nonconvex convergence results do not immediately transfer. Our analysis explicitly considers the workings of BN. However, nonconvex convergence proofs are relevant since some small portions of our analysis rely on known proofs and approaches.
|
| 33 |
+
|
| 34 |
+
Neural nets are not convex, even if the loss function is convex. For classical convergence results with a nonconvex objective function and diminishing learning rate, we refer to survey papers Bertsekas (2011); Bertsekas & Tsitsiklis (2000); Bottou et al. (2016). Bertsekas & Tsitsiklis provide a convergence result with the deterministic gradient with errors. Bottou et al. provide a convergence result with the stochastic gradient. The classic analyses showing the norm of gradients of the objective function going to zero date back to Grippo (1994); Polyak & Tsypkin (1973); Polyak (1987). For strongly convex objective functions with a diminishing learning rate, we learn the classic convergence results from Bottou et al..
|
| 35 |
+
|
| 36 |
+
# 3 MODEL AND ALGORITHM
|
| 37 |
+
|
| 38 |
+
The optimization problem for a network is an objective function consisting of a large number of component functions, that reads:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\operatorname* { m i n } { \bar { f } } ( \theta , \lambda ) = \sum _ { i = 1 } ^ { N } f _ { i } ( X _ { i } : \theta , \lambda ) ,
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $f _ { i } : \mathbb { R } ^ { n _ { 1 } } \times \mathbb { R } ^ { n _ { 2 } } \to \mathbb { R } , i = 1 , . . . , N$ , are real-valued functions for any data record $X _ { i }$ . Index $i$ associates with data record $X _ { i }$ and target response $y _ { i }$ (hidden behind the dependency of $f$ on $i$ ) in the training set. Parameters $\theta$ include the common parameters updated by gradients directly associated with the loss function, i.e., behind the part that we have a parametric model, while BN parameters $\lambda$ are introduced by the BN algorithm and not updated by gradient methods but by the mini-batch statistics. We define that the derivative of $f _ { i }$ is always taken with respect to $\theta$ :
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\nabla f _ { i } ( X _ { i } : \theta , \lambda ) : = \nabla _ { \theta } f _ { i } ( X _ { i } : \theta , \lambda ) .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
The deep network we analyze has 2 fully-connected layers with $D _ { 1 }$ neurons each. The techniques presented can be extended to more layers with additional notation. Each hidden layer computes $y = a ( W u )$ with activation function $a ( \cdot )$ and $u$ is the input vector of the layer. We do not need to include an intercept term since the BN algorithm automatically adjusts for it. BN is applied to the output of the first hidden layer.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 1: The structure of our batch-normalized network model in the analysis.
|
| 54 |
+
|
| 55 |
+
We next describe the computation in each layer to show how we obtain the output of the network. The notations introduced here is used in the analysis. Figure 1 shows the full structure of the network. The input data is vector $X$ , which is one of $\{ X _ { i } \} _ { i = 1 } ^ { N }$ . Vector $\lambda = \left( ( \mu _ { j } ) _ { j = 1 } ^ { D } , ( \sigma _ { j } ) _ { j = 1 } ^ { D } \right)$ is the set of all BN parameters and vector $\theta = \left( W _ { 1 } , W _ { 2 } , ( \beta _ { j } ^ { ( 1 ) } ) _ { j = 1 } ^ { D } , ( \gamma _ { j } ^ { ( 1 ) } ) _ { j = 1 } ^ { D } \right)$ is the set of all trainable parameters which are updated by gradients.
|
| 56 |
+
|
| 57 |
+
Matrices $W _ { 1 } , W _ { 2 }$ are the actual model parameters and $\beta , \gamma$ are introduced by BN. The value of $j ^ { t h }$ neuron of the first hidden layer is
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
z _ { j } ^ { ( 1 ) } ( X : \theta ) = a ( W _ { 1 , j , \cdot } X ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $W _ { 1 , j , }$ ,· denotes the weights of the linear transformations for the $j ^ { t h }$ neuron.
|
| 64 |
+
|
| 65 |
+
The $j ^ { t h }$ entry of batch-normalized output of the first layer is
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
y _ { j } ^ { ( 1 ) } ( X : \theta , \lambda ) = \gamma _ { j } ^ { ( 1 ) } \left( \frac { z _ { j } ^ { ( 1 ) } ( X : \theta ) - \mu _ { j } } { \sigma _ { j } + \epsilon _ { B } } \right) + \beta _ { j } ^ { ( 1 ) } ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $\beta _ { j } ^ { ( 1 ) }$ and $\gamma _ { j } ^ { ( 1 ) }$ are trainable parameters updated by gradient and $\mu _ { j }$ and $\sigma _ { j }$ are batch normalization parameters for $z _ { j } ^ { ( 1 ) }$ . Trainable parameter $\mu _ { j }$ is the mini-batch mean of $z _ { j } ^ { ( 1 ) }$ and trainable parameter σj is the mini-batch sample deviation of z(1)j . Constant $\epsilon _ { B }$ keeps the denominator from zero. The output of $j ^ { t h }$ entry of the output layer is:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
z _ { j } ^ { ( 2 ) } ( X : \theta ) = a \left( W _ { 2 , j , \cdot } \left[ \gamma _ { j } ^ { ( 1 ) } \left( \frac { z _ { j } ^ { ( 1 ) } ( X : \theta ) - \mu _ { j } } { \sigma _ { j } + \epsilon _ { B } } \right) + \beta _ { j } ^ { ( 1 ) } \right] \right)
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
The objective function for the $i ^ { t h }$ sample is
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
f _ { i } ( X _ { i } : \theta , \lambda ) = l _ { i } \left( \left( z _ { j } ^ { ( 2 ) } ( X _ { i } : \theta , \lambda ) \right) _ { j } \right) ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $l _ { i } ( \cdot )$ is the loss function associated with the target response $y _ { i }$ . For sample $i$ , we have the following complete expression for the objective function:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
f _ { i } ( X _ { i } : \theta , \lambda ) = l _ { i } \left( a ( \sum _ { j = 1 } ^ { D } W _ { 2 , k , j } \left[ \gamma _ { j } ^ { ( 1 ) } \frac { a ( W _ { 1 , j , } . X _ { i } - \mu _ { j } ) } { \sigma _ { j } + \epsilon _ { B } } + \beta _ { j } ^ { ( 1 ) } \right] ) _ { k } \right) .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Function $f _ { i } ( X _ { i } : \theta , \lambda )$ is nonconvex with respect to $\theta$ and $\lambda$ .
|
| 90 |
+
|
| 91 |
+
# 3.1 ALGORITHM
|
| 92 |
+
|
| 93 |
+
Algorithm 1 shows the algorithm studied herein. There are two deviations from the standard BN algorithm, one of them actually being a generalization. We use the full gradient instead of the more popular stochastic gradient (SG) method. It essentially means that each batch contains the entire training set instead of a randomly chosen subset of the training set. An analysis of SG is potential future research. Although the primary motivation for full gradient update is to reduce the burdensome in showing the convergence, the full gradient method is similar to SG in the sense that both of them go through the entire training set, while full gradient goes through it deterministically and the SG goes through it in expectation. Therefore, it is reasonable to speculate that the SG method has similar convergence property as the full algorithm studied herein.
|
| 94 |
+
|
| 95 |
+
# Algorithm 1 DBN: Diminishing Batch-Normalized Network Update Algorithm
|
| 96 |
+
|
| 97 |
+
<table><tr><td>1: Initializeθ ∈ Rn1 and X ∈Rn2 for iteration m=1,2.,.. do</td><td></td></tr><tr><td>2:</td><td>((m+1):=0(m)-n(m)∑1fi(Xi:0(m),(m))</td></tr><tr><td>3:</td><td></td></tr><tr><td>4:</td><td>for j=1..,.D do</td></tr><tr><td>5:</td><td>μm+1):=∑N12(xt:0(m+1))</td></tr><tr><td>6:</td><td>)=∑(()</td></tr><tr><td>7:</td><td>(1):()()))+)</td></tr></table>
|
| 98 |
+
|
| 99 |
+
The second difference is that we update the BN parameters $( \theta , \lambda )$ by their moving averages with respect to diminishing $\alpha ^ { ( m ) }$ . The original BN algorithm can be recovered by setting $\alpha ^ { ( m ) } = 1$ for every $m$ . After introducing diminishing $\alpha ^ { ( m ) }$ , $\lambda ^ { ( m ) }$ and hence the output of the BN layer is determined by the history of all past data records, instead of those solely in the last batch. Thus, the output of the BN layer becomes more general that better reflects the distribution of the entire dataset. We use two strategies to decide the values of $\alpha ^ { ( m ) }$ . One is to use a constant smaller than 1 for all $m$ , and the other one is to decay the $\alpha ^ { ( m ) }$ gradually, such as $\alpha ^ { ( m ) } = 1 / m$ .
|
| 100 |
+
|
| 101 |
+
In our numerical experiment, we show that Algorithm 1 outperforms the original BN algorithm, where both are based on SG and non-linear activation functions with many layers FNN and CNN models.
|
| 102 |
+
|
| 103 |
+
# 4 GENERAL CASE
|
| 104 |
+
|
| 105 |
+
The main purpose of our work is to show that Algorithm 1 converges. In the general case, we focus on the nonconvex objective function.
|
| 106 |
+
|
| 107 |
+
# 4.1 ASSUMPTIONS
|
| 108 |
+
|
| 109 |
+
Here are the assumptions we used for the convergence analysis.
|
| 110 |
+
|
| 111 |
+
Assumption 1 (Lipschitz continuity on $\theta$ and $\lambda$ ). For every $i$ we have
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r l r } & { } & { \Vert \nabla f _ { i } ( X : \tilde { \theta } , \lambda ) - \nabla f _ { i } ( X : \hat { \theta } , \lambda ) \Vert _ { 2 } \leq \bar { L } \Vert \tilde { \theta } - \hat { \theta } \Vert _ { 2 } , \forall \tilde { \theta } , \hat { \theta } , \lambda , } \\ & { } & \\ & { } & { \Vert \nabla _ { W _ { 1 , j , \cdot } } f _ { i } ( X : \tilde { \theta } , \lambda ) - \nabla _ { W _ { 1 , j , \cdot } } f _ { i } ( X : \hat { \theta } , \lambda ) \Vert _ { 2 } } \\ & { } & { \leq \bar { L } \Vert \tilde { W } _ { 1 , j , \cdot } - \hat { W } _ { 1 , j , \cdot } \Vert _ { 2 } , \forall \lambda , \tilde { \theta } , \hat { \theta } , X , j \in \{ 1 , . . . , D _ { 1 } \} . } \\ & { } & { \Vert \nabla f _ { i } ( X : \theta , \tilde { \lambda } ) - \nabla f _ { i } ( X : \theta , \hat { \lambda } ) \Vert _ { 2 } \leq \bar { L } \Vert \tilde { \lambda } - \hat { \lambda } \Vert _ { 2 } , } \\ & { } & { \forall \theta , \tilde { \lambda } , \hat { \lambda } , X , j \in \{ 1 , . . . , D _ { 1 } \} . } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
Noted that the Lipschitz constants associated with each of the above inequalities are not necessarily the same. Here $\bar { L }$ is an upper bound for these Lipschitz constants for simplicity.
|
| 118 |
+
|
| 119 |
+
Assumption 2 (bounded parameters). Sets $P$ and $Q$ are compact set, where $\theta \in P$ and $\lambda \in Q$ . Thus, there exists a constant $M$ that weights $W$ and parameters $\lambda$ are bounded element-wise by this constant $M$ .
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\lVert W _ { 1 } \rVert \preceq M a n d \lVert W _ { 2 } \rVert \preceq M a n d \lVert \lambda \rVert \preceq M .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
This also implies that the updated $\theta , \lambda$ in Algorithm 1 remain in $P$ and $Q$ , respectively.
|
| 126 |
+
|
| 127 |
+
Assumption 3 (diminishing update on $\theta$ ). The stepsizes of $\theta$ update satisfy
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\sum _ { m = 1 } ^ { \infty } \eta ^ { ( m ) } = \infty a n d \sum _ { m = 1 } ^ { \infty } ( \eta ^ { ( m ) } ) ^ { 2 } < \infty .
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
This is a common assumption for diminishing stepsizes in optimization problems.
|
| 134 |
+
|
| 135 |
+
Assumption 4 (Lipschitz continuity of $l _ { i } ( \cdot ) .$ ). Assume the loss functions $l _ { i } ( \cdot )$ for every $i$ is continuously differentiable. It implies that there exists $\hat { M }$ such that
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\lVert l _ { i } ( x ) - l _ { i } ( y ) \rVert \leq \hat { M } \lVert x - y \rVert , \forall x , y .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
Assumption 5 (existence of a stationary point). There exists a stationary point $( \theta ^ { * } , \lambda ^ { * } )$ such that $\| \nabla \bar { f } ( \theta ^ { \ast } , \lambda ^ { \ast } ) \| = 0$ .
|
| 142 |
+
|
| 143 |
+
We note that all these are standard assumptions in convergence proofs. We also stress that Assumption 4 does not directly imply 1. Since we assume that $P$ and $Q$ are compact, then Assumptions 1, 4 and 5 hold for many standard loss function such as softmax and MSE.
|
| 144 |
+
|
| 145 |
+
Assumption 6 (Lipschitz at activation function). The activation function $a ( \cdot )$ is Lipschitz with constant $k$ :
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
| a ( x ) | \leq k \| x \|
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
Since for all activation function there is $a ( 0 ) = 0$ , the condition is equivalent to $| a ( x ) - a ( 0 ) | \leq$ $k \| x - 0 \|$ . We note that this assumption works for many popular choices of activation functions, such as ReLU and LeakyReLu.
|
| 152 |
+
|
| 153 |
+
# 4.2 CONVERGENCE ANALYSIS
|
| 154 |
+
|
| 155 |
+
We first have the following lemma specifying sufficient conditions for $\lambda$ to converge. Proofs for main steps are given in the Appendix.
|
| 156 |
+
|
| 157 |
+
Theorem 7 Under Assumptions 1, 2, 3 and 6, if $\{ \alpha ^ { ( m ) } \}$ satisfies
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\sum _ { m = 1 } ^ { \infty } \alpha ^ { ( m ) } < \infty a n d \sum _ { m = 1 } ^ { \infty } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } < \infty ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
then sequence $\{ \lambda ^ { ( m ) } \}$ converges to $\bar { \lambda } .$
|
| 164 |
+
|
| 165 |
+
We give a discussion of the above conditions for $\alpha ^ { ( m ) }$ and $\eta ^ { ( m ) }$ at the end of this section. With the help of Theorem 7, we can show the following convergence result.
|
| 166 |
+
|
| 167 |
+
Lemma 8 Under Assumptions 4, 5 and the assumptions of Theorem 7, when
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty \quad a n d \quad \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty ,
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
we have
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\operatorname* { l i m } _ { M \to \infty } \sum _ { m = 1 } ^ { M } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } < \infty .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
This result is similar to the classical convergence rate analysis for the non-convex objective function with diminishing stepsizes, which can be found in Bottou et al. (2016).
|
| 180 |
+
|
| 181 |
+
Lemma 9 Under the assumptions of Lemma 8, we have
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\operatorname* { l i m } _ { m \to \infty } \lvert \operatorname* { n f } _ { \mathbf { \theta } } \rvert | \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \rvert | _ { 2 } ^ { 2 } = 0 .
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
This theorem states that for the full gradient method with diminishing stepsizes the gradient norms cannot stay bounded away from zero. The following result characterizes more precisely the convergence property of Algorithm 1.
|
| 188 |
+
|
| 189 |
+
Lemma 10 Under the assumptions stated in Lemma 8, we have
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\operatorname* { l i m } _ { m \to \infty } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } = 0 .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
Our main result is listed next.
|
| 196 |
+
|
| 197 |
+
Theorem 11 Under the assumptions stated in Lemma 8, we have
|
| 198 |
+
|
| 199 |
+
$$
|
| 200 |
+
\operatorname* { l i m } _ { m \to \infty } \lVert \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) \rVert _ { 2 } ^ { 2 } = 0 .
|
| 201 |
+
$$
|
| 202 |
+
|
| 203 |
+
We cannot show that $\{ \theta ^ { ( m ) } \}$ ’s converges (standard convergence proofs are also unable to show such a stronger statement). For this reason, Theorem 11 does not immediately follow from Lemma 10 together with Theorem 7. The statement of Theorem 11 would easily follow from Lemma 10 if the convergence of $\{ \theta ^ { ( m ) } \}$ is established and the gradient being continuous.
|
| 204 |
+
|
| 205 |
+
Considering the cases $\begin{array} { r } { \eta ^ { ( m ) } = { O } \left( \frac { 1 } { m ^ { k } } \right) } \end{array}$ and $\begin{array} { r } { \alpha ^ { ( m ) } = { O } \left( \frac { 1 } { m ^ { h } } \right) } \end{array}$ . We show in the Appendix that the set of sufficient and necessary conditions to satisfy the assumptions of Theorem 7 are $h > 1$ and $k \geq 1$ . The set of sufficient and necessary conditions to satisfy the assumptions of Lemma 8 are $h > 2$ and $k \geq 1$ . For example, we can pick $\begin{array} { r } { \eta ^ { ( m ) } = { O } \left( \frac { 1 } { m } \right) } \end{array}$ and $\begin{array} { r } { \alpha ^ { ( m ) } = { \bar { O } } { \left( \frac { 1 } { m ^ { 2 . 0 0 1 } } \right) } } \end{array}$ to achieve the above convergence result in Theorem 11.
|
| 206 |
+
|
| 207 |
+
# 5 COMPUTATIONAL EXPERIMENTS
|
| 208 |
+
|
| 209 |
+
We conduct the computational experiments with Theano and Lasagne on a Linux server with a Nvidia Titan-X GPU. We use MNIST LeCun et al. (1998), CIFAR-10 Krizhevsky & Hinton (2009) and Network Intrusion (NI) kdd (1999) datasets to compare the performance between DBN and the original BN algorithm. For the MNIST dataset, we use a four-layer fully connected FNN ( $7 8 4 \times$ $3 0 0 \times 3 0 0 \times 1 0 \%$ with the ReLU activation function and for the NI dataset, we use a four-layer fully connected FNN $7 8 4 \times 5 0 \times 5 0 \times 1 0 )$ with the ReLU activation function. For the CIFAR-10 dataset, we use a reasonably complex CNN network that has a structure of (Conv-Conv-MaxPool-DropoutConv-Conv-MaxPool-Dropout-FC-Dropout-FC), where all four convolution layers and the first fully connected layers are batch normalized. We use the softmax loss function and $l _ { 2 }$ regularization with for all three models. All the trainable parameters are randomly initialized before training. For all 3 datasets, we use the standard epoch/minibatch setting with the minibatch size of 100, i.e., we do not compute the full gradient and the statistics are over the minibatch. We use AdaGrad Duchi, John and Hazan, Elad and Singer (2011) to update the learning rates $\eta ^ { ( m ) }$ for trainable parameters, starting from 0.01.
|
| 210 |
+
|
| 211 |
+
We use two different strategies to decide the values of $\alpha ^ { ( m ) }$ in DBN: constant values of $\alpha ^ { ( m ) }$ and diminishing $\alpha ^ { ( m ) }$ where $\alpha ^ { ( \bar { m } ) } = 1 / m$ and $\alpha ^ { ( m ) } = 1 / m ^ { 2 }$ . We test the choices of constant $\alpha ^ { ( m ) } \in$ $\{ 1 , 0 . 7 5 , 0 . 5 , 0 . 2 5 , 0 . 1 , 0 . 0 1 , 0 . 0 0 1 , 0 \}$ .
|
| 212 |
+
|
| 213 |
+

|
| 214 |
+
Figure 2: Comparison of predicted accuracy on test datasets for different choices of $\alpha ^ { ( m ) }$ . From left to right are FNN on MNIST, FNN on NI and CNN on CIFAR-10.
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 3: Comparison of predicted accuracy on test datasets for the most efficient choices of $\alpha ^ { ( m ) }$ . From left to right are FNN on MNIST, FNN on NI and CNN on CIFAR-10.
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure 4: Comparison of the convergence of the loss function value on the validation set for different choices of $\bar { \alpha } ^ { ( m ) }$ . From left to right are FNN on MNIST, FNN on NI and CNN on CIFAR-10.
|
| 221 |
+
|
| 222 |
+
We test all the choices of $\alpha ^ { ( m ) }$ with the performances presented in Figure 2. Figure 2 shows that all the non-zero choices of $\alpha ^ { ( m ) }$ converge properly. The algorithms converge without much difference even when $\alpha ^ { ( m ) }$ in DBN is very small, e.g., $1 / m ^ { 2 }$ . However, if we select $\alpha ^ { ( m ) } = 0$ , the algorithm is erratic. Besides, we observe that all the non-zero choices of $\alpha ^ { ( m ) }$ converge at a similar rate. The fact that DBN keeps the batch normalization layer stable with a very small $\alpha ^ { ( m ) }$ suggests that the BN parameters do not have to be depended on the latest minibatch, i.e., the original BN.
|
| 223 |
+
|
| 224 |
+
We compare a selected set of the most efficient choices of $\alpha ^ { ( m ) }$ in Figures 3 and 4. They show that DBN with $\alpha ^ { ( m ) } < 1$ is more stable than the original BN algorithm. The variances with respect to epochs of the DBN algorithm are smaller than those of the original BN algorithms in each figure.
|
| 225 |
+
|
| 226 |
+
Table 1: Best results for different choices of $\alpha ^ { ( m ) }$ on each dataset, showing the top three with a heat map.
|
| 227 |
+
|
| 228 |
+
<table><tr><td></td><td colspan="3">Test Error</td></tr><tr><td>Model</td><td>MNIST</td><td>NI</td><td>CIFAR-10</td></tr><tr><td>a(m) =1</td><td>2.70%</td><td>7.69%</td><td>17.31%</td></tr><tr><td>Q(m) =0.75</td><td>1.91%</td><td>7.37%</td><td>17.03%</td></tr><tr><td>a(m) = 0.5</td><td>1.84%</td><td>7.46%</td><td>17.11%</td></tr><tr><td>a(m) =0.25</td><td>1.91%</td><td>7.24%</td><td>17.00%</td></tr><tr><td>a(m) =0.1</td><td>1.90%</td><td>7.36%</td><td>17.10%</td></tr><tr><td>a(m) =0.01</td><td>1.94%</td><td>7.47%</td><td>16.82%</td></tr><tr><td>q(m) =0.001</td><td>1.95%</td><td>7.43%</td><td>16.28%</td></tr><tr><td>Q(m) =1/m</td><td>2.10%</td><td>7.45%</td><td>17.26%</td></tr><tr><td>a(m) =1/m²</td><td>2.00%</td><td>7.59%</td><td>17.23%</td></tr><tr><td>a(m)=0</td><td>24.27%</td><td>26.09%</td><td>79.34%</td></tr></table>
|
| 229 |
+
|
| 230 |
+
Table 1 shows the best result obtained from each choice of $\alpha ^ { ( m ) }$ . Most importantly, it suggests that the choices of $\alpha ^ { ( m ) } = 1 / m$ and $1 / m ^ { 2 }$ perform better than the original BN algorithm. Besides, all the constant less-than-one choices of $\alpha ^ { ( m ) }$ perform better than the original BN, showing the importance of considering the mini-batch history for the update of the BN parameters. The BN algorithm in each figure converges to similar error rates on test datasets with different choices of $\alpha ^ { ( m ) }$ except for the $\alpha ^ { ( m ) } = 0$ case. Among all the models we tested, $\alpha ^ { ( m ) } = 0 . 2 5$ is the only one that performs top 3 for all three datasets, thus the most robust choice.
|
| 231 |
+
|
| 232 |
+
To summarize, our numerical experiments show that the DBN algorithm outperforms the original BN algorithm on the MNIST, NI and CIFAT-10 datasets with typical deep FNN and CNN models.
|
| 233 |
+
|
| 234 |
+
Future Directions. On the analytical side, we believe an extension to more than 2 layers is doable with significant augmentations of the notation. A stochastic gradient version is likely to be much more challenging to analyze. A second open question concerns more general activation functions. It would be interesting to analyze other activation functions, such as Sigmoid, that do not apply to our current assumptions.
|
| 235 |
+
|
| 236 |
+
REFERENCES
|
| 237 |
+
KDD Cup 1999 Data, 1999. URL http://www.kdd.org/kdd-cup/view/ kdd-cup-1999/Data.
|
| 238 |
+
Devansh Arpit, Yingbo Zhou, Bhargava U. Kota, and Venu Govindaraju. Normalization Propagation: A Parametric Technique for Removing Internal Covariate Shift in Deep Networks. In International Conference on Machine Learning, volume 48, pp. 11, 2016.
|
| 239 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E. Hinton. Layer Normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 240 |
+
Dimitri P. Bertsekas. Incremental gradient, subgradient, and proximal methods for convex optimization: A Survey. Optimization for Machine Learning, 2010(3):1–38, 2011.
|
| 241 |
+
Dimitri P. Bertsekas and John N. Tsitsiklis. Gradient Convergence in Gradient Methods with Errors. SIAM Journal on Optimization, 10:627–642, 2000.
|
| 242 |
+
Leon Bottou, Frank E. Curtis, and Jorge Nocedal. Optimization Methods for Large-Scale Machine ´ Learning. arXiv preprint arXiv:1606.04838, 2016.
|
| 243 |
+
Tim Cooijmans, Nicolas Ballas, Cesar Laurent, and Aaron Courville. Recurrent Batch Normaliza- ´ tion. arXiv preprint arXiv:1603.09025, 2016.
|
| 244 |
+
Yoram Duchi, John and Hazan, Elad and Singer. Adaptive Subgradient Methods for Online Learning and Stochastic Optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 245 |
+
L. Grippo. A Class of Unconstrained Minimization Methods for Neural Network Training. Optimization Methods and Software, 4(2):135–150, 1994.
|
| 246 |
+
C¸ aglar Gulc¸ehre and Yoshua Bengio. Knowledge Matters: Importance of Prior Information for ¨ Optimization. Journal of Machine Learning Research, 17(8):1–32, 2016.
|
| 247 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. In Computer Vision and Pattern Recognition, pp. 770–778, dec 2016.
|
| 248 |
+
Sergey Ioffe and Christian Szegedy. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In International Conference on Machine Learning, pp. 448–456, 2015.
|
| 249 |
+
Alex Krizhevsky and Geoffrey E. Hinton. Learning Multiple Layers of Features from Tiny Images. PhD thesis, 2009.
|
| 250 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet Classification with Deep Convolutional Neural Networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 251 |
+
Yann LeCun, Leon Bottou, and Yoshua Bengio. Gradient-based learning applied to document recog- ´ nition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 252 |
+
Genevieve B. Orr and Klaus-Robert Muller. ¨ Neural Networks: Tricks of the Trade. Springer, New York, 2003.
|
| 253 |
+
B. T. Polyak. Introduction to optimization. Translations series in mathematics and engineering. Optimization Software, 1987.
|
| 254 |
+
B. T. Polyak and Y. Z. Tsypkin. Pseudogradient Adaption and Training Algorithms. Automation and Remote Control, 34:45–67, 1973.
|
| 255 |
+
Tim Salimans and Diederik P. Kingma. Weight Normalization: A Simple Reparameterization to Accelerate Training of Deep Neural Networks. In Advances in Neural Information Processing Systems, pp. 901–901, 2016.
|
| 256 |
+
|
| 257 |
+
# 6 APPENDIX: PROOFS
|
| 258 |
+
|
| 259 |
+
# 6.1 PRELIMINARY RESULTS
|
| 260 |
+
|
| 261 |
+
The following proofs are shortened to corporate with AAAI submission page limit.
|
| 262 |
+
|
| 263 |
+
Proposition 12 There exists a constant M such that, for any $\theta$ and fixed $\lambda$ , we have
|
| 264 |
+
|
| 265 |
+
$$
|
| 266 |
+
\begin{array} { r } { \| \nabla \bar { f } ( \theta , \lambda ) \| _ { 2 } ^ { 2 } \leq M . } \end{array}
|
| 267 |
+
$$
|
| 268 |
+
|
| 269 |
+
Proof. By Assumption 5, we know there exists $( \theta ^ { * } , \lambda ^ { * } )$ such that $\| \nabla \bar { f } ( \theta ^ { * } , \lambda ^ { * } ) \| _ { 2 } = 0$ . Then we have
|
| 270 |
+
|
| 271 |
+
$$
|
| 272 |
+
\begin{array} { l } { \displaystyle | | \nabla \bar { f } ( \theta , \lambda ) | | _ { 2 } } \\ { = | | \nabla \bar { f } ( \theta , \lambda ) | | _ { 2 } - | | \nabla \bar { f } ( \theta , \lambda ^ { * } ) | | _ { 2 } + | | \nabla \bar { f } ( \theta , \lambda ^ { * } ) | | _ { 2 } - | | \nabla \bar { f } ( \theta ^ { * } , \lambda ^ { * } ) | | _ { 2 } } \\ { \displaystyle \le | | \nabla \bar { f } ( \theta , \lambda ) - \nabla \bar { f } ( \theta , \lambda ^ { * } ) | | _ { 2 } + | | \nabla \bar { f } ( \theta , \lambda ^ { * } ) - \nabla \bar { f } ( \theta ^ { * } , \lambda ^ { * } ) | | _ { 2 } } \\ { \displaystyle \le \sum _ { i = 1 } ^ { N } | | \nabla f _ { i } ( X _ { i } : \theta , \lambda ) - \nabla f _ { i } ( X _ { i } : \theta , \lambda ^ { * } ) | | _ { 2 } } \\ { + \displaystyle \sum _ { i = 1 } ^ { N } | | \nabla f _ { i } ( X _ { i } : \theta , \lambda ^ { * } ) - \nabla f _ { i } ( X _ { i } : \theta ^ { * } , \lambda ^ { * } ) | | _ { 2 } } \\ { \displaystyle \le N \bar { L } ( | \lambda - \lambda ^ { * } | | _ { 2 } + | | \theta - \theta ^ { * } | | _ { 2 } ) , } \end{array}
|
| 273 |
+
$$
|
| 274 |
+
|
| 275 |
+
where the last inequality is by Assumption 1. We then have
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
\begin{array} { r } { \| \nabla \bar { f } ( \theta , \lambda ) \| _ { 2 } ^ { 2 } \leq N ^ { 2 } \bar { L } ^ { 2 } ( \| \lambda - \lambda ^ { * } \| _ { 2 } + \| \theta - \theta ^ { * } \| _ { 2 } ) ^ { 2 } \leq M , } \end{array}
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
because sets $\mathrm { P }$ and $\mathrm { Q }$ are compact by Assumption 2.
|
| 282 |
+
|
| 283 |
+
Proposition 13 We have
|
| 284 |
+
|
| 285 |
+
$$
|
| 286 |
+
f _ { i } ( \boldsymbol { X } : \tilde { \boldsymbol { \theta } } , \lambda ) \leq f _ { i } ( \boldsymbol { X } : \hat { \boldsymbol { \theta } } , \lambda ) + \nabla f _ { i } ( \boldsymbol { X } : \hat { \boldsymbol { \theta } } , \lambda ) ^ { T } ( \tilde { \boldsymbol { \theta } } - \hat { \boldsymbol { \theta } } ) + \frac { 1 } { 2 } \bar { L } \| \tilde { \boldsymbol { \theta } } - \hat { \boldsymbol { \theta } } \| _ { 2 } ^ { 2 } , \forall \tilde { \boldsymbol { \theta } } , \hat { \boldsymbol { \theta } } , \boldsymbol { X } .
|
| 287 |
+
$$
|
| 288 |
+
|
| 289 |
+
Proof. This is a known result of the Lipschitz-continuous condition that can be found in Bottou et al. (2016).
|
| 290 |
+
We have this result together with Assumption 1.
|
| 291 |
+
|
| 292 |
+
# 6.2 PROOF OF THEOREM 7
|
| 293 |
+
|
| 294 |
+
$$
|
| 295 |
+
\begin{array} { r l } & { \mathbf { L e m m a 1 4 } \ : \ : W h e n \sum _ { m = 1 } ^ { \infty } \alpha ^ { ( m ) } < \infty a n d \ : \sum _ { m = 1 } ^ { \infty } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } < \infty , } \\ & { \tilde { \mu } _ { j } ^ { ( m ) } : = \frac { \mu _ { j } ^ { ( m ) } } { \left( 1 - \alpha ^ { ( 1 ) } \right) \left( 1 - \alpha ^ { ( 2 ) } \right) \ldots \left( 1 - \alpha ^ { ( m ) } \right) } i s a c a u c h y s e r i e s . } \end{array}
|
| 296 |
+
$$
|
| 297 |
+
|
| 298 |
+
Proof. By Algorithm 1, we have
|
| 299 |
+
|
| 300 |
+
$$
|
| 301 |
+
\mu _ { j } ^ { ( m ) } = \alpha ^ { ( m ) } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } a ( W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } ) + ( 1 - \alpha ^ { ( m ) } ) \mu _ { j } ^ { ( m - 1 ) } .
|
| 302 |
+
$$
|
| 303 |
+
|
| 304 |
+
We define $\tilde { \alpha } ^ { ( m ) } : = \frac { \alpha ^ { ( m ) } } { ( 1 - \alpha ^ { ( 1 ) } ) ( 1 - \alpha ^ { ( 2 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) }$ and ∆W (m)1,j,· : $\Delta W _ { 1 , j , \cdot } ^ { ( m ) } : = W _ { 1 , j , \cdot } ^ { ( m ) } - W _ { 1 , j , \cdot } ^ { ( m - 1 ) }$ . After dividing equation 21 by $( 1 - \alpha ^ { ( 1 ) } ) ( 1 - \alpha ^ { ( 2 ) } ) . . . ( 1 - \alpha ^ { ( m ) } )$ , we obtain
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\tilde { \mu } _ { j } ^ { ( m ) } = \tilde { \alpha } ^ { ( m ) } \frac { 1 } { N } \sum _ { i = 1 } ^ { N } a ( W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } ) + \tilde { \mu } _ { j } ^ { ( m - 1 ) } .
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
Then we have
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
| \tilde { \mu } _ { j } ^ { ( m ) } - \tilde { \mu } _ { j } ^ { ( m - 1 ) } | \leq \tilde { \alpha } ^ { ( m ) } | k | \frac { 1 } { N } \sum _ { i = 1 } ^ { N } | \sum _ { n = 1 } ^ { m } \Delta W _ { 1 , j , \cdot } ^ { ( n ) } X _ { i } |
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
= \tilde { \alpha } ^ { ( m ) } | k | \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left| \sum _ { n = 1 } ^ { m } \left( \eta ^ { ( n ) } \sum _ { l = 1 } ^ { N } \nabla _ { W _ { 1 , j , . } } f _ { l } ( X _ { l } : \theta ^ { ( n ) } , \lambda ^ { ( n ) } ) \right) \cdot X _ { i } \right|
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
$$
|
| 321 |
+
= \tilde { \alpha } ^ { ( m ) } | k | \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \sum _ { n = 1 } ^ { m } \left( \eta ^ { ( n ) } \left| \left( \sum _ { l = 1 } ^ { N } \nabla _ { W _ { 1 , j , . } } f _ { l } ( X _ { l } : \theta ^ { ( n ) } , \lambda ^ { ( n ) } ) \right) \cdot X _ { i } \right| \right)
|
| 322 |
+
$$
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\leq \tilde { \alpha } ^ { ( m ) } | k | \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \sum _ { n = 1 } ^ { m } \left( \eta ^ { ( n ) } \| \sum _ { l = 1 } ^ { N } \nabla _ { W _ { 1 , j , . } } f _ { l } ( X _ { l } : \theta ^ { ( n ) } , \lambda ^ { ( n ) } ) \| \cdot \| X _ { i } \| \right)
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
$$
|
| 329 |
+
\begin{array} { r l } & { \displaystyle \le \tilde { \alpha } ^ { ( m ) } | k | \sum _ { i = 1 } ^ { N } \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } \left( \bar { L } \cdot ( \| W _ { 1 , j , \cdot } ^ { ( n ) } - W _ { 1 , j , \cdot } ^ { * } \| _ { 2 } + \| \lambda _ { j , \cdot } ^ { ( n ) } - \lambda _ { j , \cdot } ^ { * } \| _ { 2 } ) \cdot \| X _ { i } \| _ { 2 } \right) } \\ & { \qquad \le \tilde { \alpha } ^ { ( m ) } \displaystyle \sum _ { n = 1 } ^ { m } \left( \eta ^ { ( n ) } \right) | k | \displaystyle \sum _ { i = 1 } ^ { N } \left( 2 \bar { L } M \| X _ { i } \| _ { 2 } \right) } \\ & { \qquad \le \tilde { \alpha } ^ { ( m ) } \displaystyle \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } \displaystyle \tilde { M } _ { \bar { L } , M } . } \end{array}
|
| 330 |
+
$$
|
| 331 |
+
|
| 332 |
+
$\begin{array} { r } { W _ { 1 , i , j } ^ { ( m ) } = \sum _ { n = 1 } ^ { m } \Delta W _ { 1 , i , j } ^ { ( n ) } } \end{array}$
|
| 333 |
+
|
| 334 |
+
Therefore,
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\lvert \tilde { \mu } _ { j } ^ { ( p ) } - \tilde { \mu } _ { j } ^ { ( q ) } \rvert \leq \tilde { M } _ { \bar { L } , M } \cdot \sum _ { m = p } ^ { q } \sum _ { n = 1 } ^ { m } \tilde { \alpha } ^ { ( m ) } \eta ^ { ( n ) } .
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
It remains to show that
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { c } { { \displaystyle \displaystyle \sum _ { m = 1 } ^ { \infty } \alpha ^ { ( m ) } < \infty \mathrm { , } } } \\ { { \displaystyle \sum _ { m = 1 } ^ { \infty } \displaystyle \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } < \infty \mathrm { , } } } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
implies the convergence of $\{ \tilde { \mu } ^ { ( m ) } \}$ . By (28), we have $\Pi _ { m = 1 } ^ { \infty } \big ( 1 - \alpha ^ { ( m ) } \big ) > 0$ , since $\ln ( \Pi _ { m = 1 } ^ { \infty } ( 1 - \alpha ^ { ( m ) } ) ) >$ $\textstyle \sum _ { m = 1 } ^ { \infty } - \alpha ^ { ( m ) } > - \infty$ .
|
| 347 |
+
|
| 348 |
+
It is also easy to show that there exists $C$ and $M _ { c }$ such that for all $m \geq M _ { c }$ , we have
|
| 349 |
+
|
| 350 |
+
Therefore,
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\begin{array} { c } { ( 1 - \alpha ^ { ( 1 ) } ) ( 1 - \alpha ^ { ( 2 ) } ) \dots ( 1 - \alpha ^ { ( m ) } ) \ge C . } \\ { \displaystyle \operatorname* { l i m } _ { \imath \to \infty } ( 1 - \alpha ^ { ( 1 ) } ) ( 1 - \alpha ^ { ( 2 ) } ) \dots ( 1 - \alpha ^ { ( m ) } ) \ge C . } \end{array}
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
Thus the following holds:
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\tilde { \alpha } ^ { ( m ) } \leq \frac { 1 } { C } \alpha ^ { ( m ) }
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
and
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\sum _ { m = p } ^ { q } \sum _ { n = 1 } ^ { m } \tilde { \alpha } ^ { ( m ) } \eta ^ { ( n ) } \leq \frac { 1 } { C } \sum _ { m = p } ^ { q } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } .
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
From equation 29 and equation 32 it follows that the sequence $\{ \tilde { \mu } _ { j } ^ { ( m ) } \}$ is a Cauchy series.
|
| 369 |
+
|
| 370 |
+
Lemma 15 Since $\{ \tilde { \mu } _ { j } ^ { ( m ) } \}$ is a Cauchy series, $\{ \mu _ { j } ^ { ( m ) } \}$ is a Cauchy series.
|
| 371 |
+
|
| 372 |
+
Proof. We know that $\mu _ { j } ^ { ( m ) } = \tilde { \mu } _ { j } ^ { ( m ) } ( 1 { - } \alpha ^ { ( 1 ) } ) . . . ( 1 { - } \alpha ^ { ( m ) } )$ . Since $\operatorname* { l i m } _ { m \infty } \tilde { \mu } _ { j } ^ { ( m ) } \tilde { \mu } _ { j }$ and $\operatorname* { l i m } _ { m \to \infty } ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 -$ $\alpha ^ { ( m ) } ) \tilde { C }$ , we have $\operatorname* { l i m } _ { m \infty } \mu _ { j } ^ { ( m ) } \tilde { \mu } _ { j } \cdot \tilde { C }$ . Thus $\mu _ { j } ^ { ( m ) }$ is a Cauchy series.
|
| 373 |
+
|
| 374 |
+
Lemma 16 If $\textstyle \sum _ { m = 1 } ^ { \infty } \alpha ^ { ( m ) } < \infty$ and $\begin{array} { r } { \sum _ { m = 1 } ^ { \infty } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } < \infty , \left\{ c \right. } \qquad \end{array}$ $\{ \sigma _ { j } ^ { ( m ) } \}$ is a Cauchy series.
|
| 375 |
+
|
| 376 |
+
Proof. We define $\sigma _ { j } ^ { ( m ) } : = \tilde { \sigma } _ { j } ^ { ( m ) } ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) \ / \nonumber$ . Then we have
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
| \tilde { \sigma } _ { j } ^ { ( m + 1 ) } - \tilde { \sigma } _ { j } ^ { ( m ) } | = \tilde { \alpha } ^ { ( m ) } \sqrt { \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left( a ( W _ { 1 , j , } ^ { ( m ) } X _ { i } ) - \mu _ { j } ^ { ( m ) } \right) ^ { 2 } }
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
= \tilde { \alpha } ^ { ( m ) } \frac { | k | } { \sqrt { N } } \sqrt { \sum _ { i = 1 } ^ { N } { \left( \frac { a ( W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } ) } { k } - \frac { \mu _ { j } ^ { ( m ) } } { k } \right) ^ { 2 } } } .
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
Since $\{ \mu _ { j } ^ { ( m ) } \}$ is convergent, there exists $c _ { 1 } , c _ { 2 }$ and $N _ { 1 }$ such that for any $m > N _ { 1 } , - \infty < c _ { 1 } < \mu _ { j } ^ { ( m ) } < c _ { 2 } <$ $\infty$ . For any $\bar { C } \in \left\{ \frac { c _ { 1 } } { k } , \frac { c _ { 2 } } { k } \right\}$ , we have
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
| \tilde { \sigma } _ { j } ^ { ( m + 1 ) } - \tilde { \sigma } _ { j } ^ { ( m ) } | \leq \tilde { \alpha } ^ { ( m ) } \frac { | k | } { \sqrt { N } } \cdot \sqrt { \sum _ { i = 1 } ^ { N } \left( \frac { a ( W _ { 1 , j , } ^ { ( m ) } X _ { i } ) } { k } - \bar { C } \right) ^ { 2 } }
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\leq \tilde { \alpha } ^ { ( m ) } \frac { | k | } { \sqrt { N } } \cdot \sqrt { \sum _ { i = 1 } ^ { N } \left( | \frac { a ( W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } ) } { k } | + | \bar { C } | \right) ^ { 2 } }
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
\leq \tilde { \alpha } ^ { ( m ) } \frac { \vert k \vert } { \sqrt { N } } \cdot \sqrt { \sum _ { i = 1 } ^ { N } \left( \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } \left( 2 N \bar { L } M \| X _ { i } \| _ { 2 } \right) + | \bar { C } | \right) ^ { 2 } }
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\leq \tilde { \alpha } ^ { ( m ) } \frac { | k | } { \sqrt { N } } \cdot \sqrt { N \cdot \left( \tilde { M } _ { \bar { L } , M } \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } + | \bar { C } | \right) ^ { 2 } }
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
= \tilde { \alpha } ^ { ( m ) } | k | \cdot \left( \tilde { M } _ { \bar { L } , M } \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } + | \bar { C } | \right) .
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
Inequality equation 35 is by the following fact:
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\sqrt { \sum _ { i = 1 } ^ { n } ( a _ { i } - c ) ^ { 2 } } \leq \sqrt { \sum _ { i = 1 } ^ { n } ( | a _ { i } | + | c | ) ^ { 2 } } ,
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
where $^ { b }$ and $a _ { i }$ for every $_ { i }$ are arbitrary real scalars. Besides, equation 39 is due to $\_ \subseteq$ $\operatorname* { m a x } \{ - 2 | a _ { i } | c , 2 | a _ { i } | c \}$ .
|
| 415 |
+
|
| 416 |
+
Inequality equation 36 follow from the square function being increasing for nonnegative numbers. Besides these facts, equation 36 is also by the same techniques we used in equation 23-equation 25 where we bound the derivatives with the Lipschitz continuity in the following inequality:
|
| 417 |
+
|
| 418 |
+
$$
|
| 419 |
+
\begin{array} { r } { \| \displaystyle \sum _ { l = 1 } ^ { N } \nabla _ { W _ { 1 , j , \cdot } } f _ { l } ( X _ { l } : \theta ^ { ( n ) } , \lambda ^ { ( n ) } ) \| \le 2 N \bar { L } M . } \end{array}
|
| 420 |
+
$$
|
| 421 |
+
|
| 422 |
+
Inequality equation 37 is by collecting the bounded terms into a single bound $\tilde { M } _ { \bar { L } , M }$ . Therefore,
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
| \tilde { \sigma } _ { j } ^ { ( q ) } - \tilde { \sigma } _ { j } ^ { ( p ) } | \leq \sum _ { m = p } ^ { q - 1 } \tilde { \alpha } ^ { ( m ) } | k | \cdot \left( \tilde { M } _ { \bar { L } , M } \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } + | \bar { C } | \right) .
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
Using the similar methods in deriving equation 28 and equation 29, it can be seen that a set of sufficient conditions ensuring the convergence for $\{ \tilde { \sigma } _ { j } ^ { ( m ) } \}$ is: $\textstyle \sum _ { m = 1 } ^ { \infty } \alpha ^ { ( m ) } < \infty$ and $\begin{array} { r } { \sum _ { m = 1 } ^ { \infty } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } < \infty } \end{array}$ .
|
| 429 |
+
|
| 430 |
+
Therefore, the convergence conditions for $\{ \sigma _ { j } ^ { ( m ) } \}$ are the same as for $\{ \mu _ { j } ^ { ( m ) } \}$
|
| 431 |
+
|
| 432 |
+
It is clear that these lemmas establish the proof of Theorem 7.
|
| 433 |
+
|
| 434 |
+
# 6.3 CONSEQUENCES OF THEOREM 7
|
| 435 |
+
|
| 436 |
+
Proposition 17 Under the assumptions of Theorem 7, we have $| \lambda ^ { ( m ) } - \bar { \lambda } | _ { \infty } \leq a _ { m }$ , where
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
a _ { m } = M _ { 1 } \sum _ { i = m } ^ { \infty } \sum _ { j = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( j ) } + M _ { 2 } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } .
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
$M _ { 1 }$ and $M _ { 2 }$ are constants.
|
| 443 |
+
|
| 444 |
+
Proof. For the upper bound of $\sigma _ { j } ^ { ( m ) }$ , by equation 38, we have
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
| \tilde { \sigma } _ { j } ^ { ( q ) } - \tilde { \sigma } _ { j } ^ { ( p ) } | \leq \sum _ { m = p } ^ { q - 1 } \tilde { \alpha } ^ { ( m ) } | k | \left( \tilde { M } _ { { \bar { L } } , M } \sum _ { n = 1 } ^ { m } \eta ^ { ( n ) } + | \bar { C } | \right) .
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
We define σ˜j := j(1 − α(1))...(1 − α(u))... . Therefore,
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\begin{array} { r l r } { { \vert \tilde { \sigma } _ { j } - \tilde { \sigma } _ { j } ^ { ( m ) } \vert \leq \sum _ { i = m } ^ { \infty } \tilde { \alpha } ^ { ( i ) } \vert k \vert ( \tilde { M } _ { { \bar { L } } , M } \sum _ { j = 1 } ^ { i } \eta ^ { ( j ) } + \vert \bar { C } \vert ) } } \\ & { } & { \leq \frac { \vert k \vert } { C } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } ( \tilde { M } _ { { \bar { L } } , M } \sum _ { j = 1 } ^ { i } \eta ^ { ( j ) } + \vert \bar { C } \vert ) . } \end{array}
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
The first inequality comes by substituting $p$ by $m$ and by taking lim as $q \infty$ in equation 41. The second inequality comes from equation 30. We then obtain,
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\begin{array} { l } { \displaystyle \left| \sigma _ { j } ^ { ( m ) } - \bar { \sigma } _ { j } \right| \leq \left| \tilde { \sigma } _ { j } ^ { ( m ) } - \tilde { \sigma } _ { j } ^ { ( \infty ) } \right| + \left| \frac { \bar { \sigma } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) \dots ( 1 - \alpha ^ { ( m ) } ) } - \tilde { \sigma } _ { j } ^ { ( \infty ) } \right| } \\ { \displaystyle = \left| \tilde { \sigma } _ { j } ^ { ( m ) } - \tilde { \sigma } _ { j } ^ { ( \infty ) } \right| + \left| \frac { \bar { \sigma } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) \dots ( 1 - \alpha ^ { ( m ) } ) } - \frac { \bar { \sigma } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) \dots ( 1 - \alpha ^ { ( m ) } ) \dots } \right| } \\ { \displaystyle = \left| \tilde { \sigma } _ { j } ^ { ( m ) } - \tilde { \sigma } _ { j } ^ { ( \infty ) } \right| + \bar { \sigma } _ { j } \left| \frac { ( 1 - \alpha ^ { ( m + 1 ) } ) \dots ( 1 - \alpha ^ { ( u ) } ) \dots - 1 } { ( 1 - \alpha ^ { ( 1 ) } ) \dots ( 1 - \alpha ^ { ( u ) } ) \dots } \right| } \\ { \displaystyle \leq \left| \tilde { \sigma } _ { j } ^ { ( m ) } - \tilde { \sigma } _ { j } ^ { ( \infty ) } \right| + \frac { \bar { \sigma } _ { j } } { \mathcal { C } } \left| 1 - ( 1 - \alpha ^ { ( m + 1 ) } ) \dots ( 1 - \alpha ^ { ( u ) } ) \dots \right| } \\ { \displaystyle \leq \left| \tilde { \sigma } _ { j } ^ { ( m ) } - \tilde { \sigma } _ { j } ^ { ( \infty ) } \right| + \frac { \bar { \sigma } _ { j } } { \mathcal { C } } \sum _ { n = m + 1 } ^ { \infty } \alpha ^ { ( n ) } . } \end{array}
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
The second inequality is by $( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) < 1$ , the third inequality is by equation 30 and the last inequality can be easily seen by induction. By equation 44, we obtain
|
| 463 |
+
|
| 464 |
+
$$
|
| 465 |
+
| \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } | = \operatorname* { l i m } _ { M \to \infty } | \sigma _ { j } ^ { ( M ) } - \sigma _ { j } ^ { ( m ) } | \leq | \tilde { \sigma } _ { j } - \tilde { \sigma } _ { j } ^ { ( m ) } | + \frac { \bar { \sigma _ { j } } } { C } \sum _ { n = m + 1 } ^ { \infty } \alpha ^ { ( n ) } .
|
| 466 |
+
$$
|
| 467 |
+
|
| 468 |
+
Therefore, we have
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
\begin{array} { r l } & { \displaystyle | \bar { \boldsymbol { \sigma } } _ { j } - \boldsymbol { \sigma } _ { j } ^ { ( m ) } | \leq | \tilde { \boldsymbol { \sigma } } _ { j } - \tilde { \boldsymbol { \sigma } } _ { j } ^ { ( m ) } | + \frac { \bar { \boldsymbol { \sigma } } _ { j } } { C } \displaystyle \sum _ { n = m + 1 } ^ { \infty } \alpha ^ { ( n ) } } \\ & { \leq \displaystyle \sum _ { i = m } ^ { \infty } \tilde { \alpha } ^ { ( i ) } | k | \cdot \bigg ( \tilde { M } _ { { \bar { L } } , M } \displaystyle \sum _ { j = 1 } ^ { i } \eta ^ { ( j ) } + | \bar { C } | \bigg ) + \frac { \bar { \boldsymbol { \sigma } } _ { j } } { C } \displaystyle \sum _ { i = m + 1 } ^ { \infty } \alpha ^ { ( i ) } } \\ & { \leq \displaystyle \sum _ { i = m } ^ { \infty } \frac { 1 } { C } \alpha ^ { ( i ) } | k | \cdot \bigg ( \tilde { M } _ { { \bar { L } } , M } \displaystyle \sum _ { j = 1 } ^ { i } \eta ^ { ( j ) } + | \bar { C } | \bigg ) + \frac { \bar { \boldsymbol { \sigma } } _ { j } } { C } \displaystyle \sum _ { i = m + 1 } ^ { \infty } \alpha ^ { ( i ) } } \\ & { \leq \displaystyle \frac { \tilde { M } _ { { \bar { L } } , M } | k | } { C } \sum _ { \sum } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( i ) } + \bigg ( \frac { \bar { \boldsymbol { \sigma } } _ { j } } { C } + \frac { | k | | \bar { C } | } { C } \bigg ) \sum _ { \alpha } ^ { \infty } \alpha ^ { ( i ) } . } \end{array}
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
The first inequality is by equation 45, the second inequality is by equation 41, the third inequality is by equation 31 and the fourth inequality is by adding the nonnegative term $\frac { \bar { \sigma } _ { j } } { C } \alpha ^ { ( m ) }$ to the right-hand side.
|
| 475 |
+
|
| 476 |
+
For the upper bound of $\mu _ { j } ^ { ( m ) }$ , we have
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
\left| \mu _ { j } ^ { ( m ) } - \bar { \mu } _ { j } \right| \leq \left| \tilde { \mu } ^ { ( m ) } - \tilde { \mu } ^ { ( \infty ) } \right| + \left| \frac { \bar { \mu } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) } - \tilde { \mu } ^ { ( \infty ) } \right| .
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Let us define ${ \cal A } _ { m } : = \Big | \tilde { \mu } ^ { ( m ) } - \tilde { \mu } ^ { ( \infty ) } \Big |$ and $B _ { m } : = \left| \frac { \bar { \mu } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) } - \tilde { \mu } ^ { ( \infty ) } \right|$ . Recall from Theorem 7 that $\{ \mu _ { j } ^ { ( m ) } \}$ is a Cauchy series, by equation 27, $\begin{array} { r } { | \tilde { \mu } _ { j } ^ { ( p ) } - \tilde { \mu } _ { j } ^ { ( q ) } | \leq \bar { M } _ { \bar { L } , M } \cdot \sum _ { m = p } ^ { q } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } } \end{array}$ . Therefore, the first term in equation 47 is bounded by
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
| \tilde { \mu } _ { j } ^ { ( m ) } - \tilde { \mu } _ { j } ^ { \infty } | \leq \tilde { M } _ { { \bar { L } } , M } \cdot \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty .
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
For the second term in equation 47, recall that ${ \cal C } ~ : = ~ ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( u ) } ) . . .$ . Then we have $C \cdot \left. \frac { \bar { \mu } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) } - \tilde { \mu } ^ { ( \infty ) } \right. \leq \bar { \mu } _ { j } \sum _ { i = m + 1 } ^ { \infty } \alpha ^ { ( i ) } ,$ where the inequality can be easily seen by induction. Therefore, the second term in equation 47 is bounded by
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\left| \frac { \bar { \mu } _ { j } } { ( 1 - \alpha ^ { ( 1 ) } ) . . . ( 1 - \alpha ^ { ( m ) } ) } - \tilde { \mu } ^ { ( \infty ) } \right| \leq \frac { \bar { \mu } _ { j } } { C } \sum _ { i = m + 1 } ^ { \infty } \alpha ^ { ( i ) } .
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
From these we obtain
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\left| \mu _ { j } ^ { ( m ) } - \bar { \mu } _ { j } \right| \leq \tilde { M } _ { \bar { L } , M } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } + \frac { \bar { \mu } _ { j } } { C } \sum _ { i = m + 1 } ^ { \infty } \alpha ^ { ( i ) } .
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
The first inequality is by equation 47 and the second inequality is by equation 48 and equation 49. Combining equation 46 and equation 50, we have that
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
| \lambda ^ { ( m ) } - \bar { \lambda } | _ { \infty } \leq M _ { 1 } \sum _ { i = m } ^ { \infty } \sum _ { j = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( j ) } + M _ { 2 } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } ,
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
where $M _ { 1 }$ and $M _ { 2 }$ are constants defined as $\begin{array} { r l r } { M _ { 1 } } & { { } = } & { \operatorname* { m a x } ( \frac { \tilde { M } _ { \bar { L } , M } | k | } { C } , \bar { M } _ { \bar { L } , M } ) } \end{array}$ | , M¯ L,M¯ ) and M2 = $\operatorname* { m a x } ( \frac { \bar { \sigma } _ { j } + | k | | \bar { C } | } { C } , \frac { \bar { \mu } _ { j } } { C } ) .$
|
| 507 |
+
|
| 508 |
+
Proposition 18 Under the assumptions of Theorem 7,
|
| 509 |
+
|
| 510 |
+
$$
|
| 511 |
+
\begin{array} { r } { - \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) ^ { T } \cdot \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) \leq - \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| ^ { 2 } + \bar { L } M \sqrt { n _ { 2 } } a _ { m } , } \end{array}
|
| 512 |
+
$$
|
| 513 |
+
|
| 514 |
+
where $a _ { m }$ is defined in Proposition $^ { 1 7 }$ .
|
| 515 |
+
|
| 516 |
+
Proof. For simplicity of the proof, let us define $\begin{array} { r } { \boldsymbol { x } ^ { ( m ) } : = \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) , \quad \boldsymbol { y } ^ { ( m ) } : = \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) } \end{array}$ . We have
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array} { r } { | x ^ { ( m ) } - y ^ { ( m ) } | _ { \infty } \leq \bar { L } \sqrt { n _ { 2 } } \| \lambda ^ { ( m ) } - \bar { \lambda } \| _ { \infty } \leq \bar { L } \sqrt { n _ { 2 } } a _ { m } , } \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
where $\sqrt { n _ { 2 } }$ is the dimension of $\lambda$ . The second inequality is by Assumption 1 and the fourth inequality is by Proposition 17. Inequality equation 51 implies that for all $m$ and $_ { i }$ , we have $| x _ { i } ^ { ( m ) } - y _ { i } ^ { ( m ) } | \leq \bar { L } \sqrt { n _ { 2 } } a _ { m }$ .
|
| 523 |
+
|
| 524 |
+
It remains to show
|
| 525 |
+
|
| 526 |
+
$$
|
| 527 |
+
- \sum _ { i } y _ { i } ^ { ( m ) } x _ { i } ^ { ( m ) } \leq - \sum _ { i } x _ { i } ^ { ( m ) ^ { 2 } } + \bar { L } M \sqrt { n _ { 2 } } a _ { m } , \forall i , m .
|
| 528 |
+
$$
|
| 529 |
+
|
| 530 |
+
This is established by the following four cases.
|
| 531 |
+
|
| 532 |
+
1) If x(m)i ≥ $x _ { i } ^ { ( m ) } \geq 0 , x _ { i } ^ { ( m ) } - y _ { i } ^ { ( m ) } \geq 0$ , then $x _ { i } ^ { ( m ) } \leq \bar { L } \sqrt { n _ { 2 } } a _ { m } + y _ { i } ^ { ( m ) }$ . Thus $- x _ { i } ^ { ( m ) } y _ { i } ^ { ( m ) } \leq - x _ { i } ^ { ( m ) ^ { 2 } } + \bar { L } M \sqrt { n _ { 2 } } a _ { m }$ by Proposition 12.
|
| 533 |
+
|
| 534 |
+
2) If x(i $) , x _ { i } ^ { ( m ) } - y _ { i } ^ { ( m ) } \leq 0 , \mathrm { t h e n ~ } x _ { i } ^ { ( m ) } \leq y _ { i } ^ { ( m ) } , x _ { i } ^ { ( m ) ^ { 2 } } \leq x _ { i } ^ { ( m ) } \cdot y _ { i } ^ { ( m ) } \mathrm { ~ a n d ~ } - x _ { i } ^ { ( m ) } y _ { i } ^ { ( m ) } \leq - x _ { i } ^ { ( m ) ^ { 2 } } .$
|
| 535 |
+
|
| 536 |
+
3) If $x _ { i } ^ { ( m ) } < 0 , x _ { i } ^ { ( m ) } - y _ { i } ^ { ( m ) } \geq 0$ ) ≥ 0, then x(i $x _ { i } ^ { ( m ) } \geq y _ { i } ^ { ( m ) } , x _ { i } ^ { ( m ) ^ { 2 } } \leq x _ { i } ^ { ( m ) } \cdot y _ { i } ^ { ( m ) }$ and $- x _ { i } ^ { ( m ) } y _ { i } ^ { ( m ) } \leq - x _ { i } ^ { ( m ) ^ { 2 } }$
|
| 537 |
+
|
| 538 |
+
4) If $x _ { i } ^ { ( m ) } < 0 , x _ { i } ^ { ( m ) } - y _ { i } ^ { ( m ) } \leq 0$ ≤ 0, then y(i $y _ { i } ^ { ( m ) } - x _ { i } ^ { ( m ) } \leq \bar { L } \sqrt { n _ { 2 } } a _ { m }$ , $y _ { i } ^ { ( m ) } x _ { i } ^ { ( m ) } - x _ { i } ^ { ( m ) ^ { 2 } } \geq \bar { L } \sqrt { n _ { 2 } } a _ { m } x _ { i } ^ { ( m ) }$ an d $- y _ { i } ^ { ( m ) } x _ { i } ^ { ( m ) } \leq - x _ { i } ^ { ( m ) ^ { 2 } } - \bar { L } \sqrt { n _ { 2 } } a _ { m } x _ { i } ^ { ( m ) } \leq - x _ { i } ^ { ( m ) ^ { 2 } } + \bar { L } M \sqrt { n _ { 2 } } a _ { m } .$ . The last inequality is by Proposition 12.
|
| 539 |
+
|
| 540 |
+
All these four cases yield equation 52.
|
| 541 |
+
|
| 542 |
+
Proposition 19 Under the assumptions of Theorem 7, we have
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\begin{array} { r l } & { \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) \le \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) - \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } } \\ & { \quad \quad \quad + \eta ^ { ( m ) } \bar { L } M \sqrt { n _ { 2 } } a _ { m } + \frac { 1 } { 2 } ( \eta ^ { ( m ) } ) ^ { 2 } \cdot N \bar { L } M , } \end{array}
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
where $M$ is a constant and $a _ { m }$ is defined in Proposition $^ { 1 7 }$ .
|
| 549 |
+
|
| 550 |
+
Proof. By Proposition 13,
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
f _ { i } ( X _ { i } : \tilde { \theta } , \lambda ) \leq f _ { i } ( X _ { i } : \hat { \theta } , \lambda ) + \nabla f _ { i } ( X _ { i } : \hat { \theta } , \lambda ) ^ { T } ( \tilde { \theta } - \hat { \theta } ) + \frac { 1 } { 2 } \bar { L } \| \tilde { \theta } - \hat { \theta } \| _ { 2 } ^ { 2 } .
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
Therefore, we can sum it over the entire training set from $i = 1$ to $N$ to obtain
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
\bar { f } ( \tilde { \theta } , \lambda ) \leq \bar { f } ( \hat { \theta } , \lambda ) + \nabla \bar { f } ( \hat { \theta } , \lambda ) ^ { T } ( \tilde { \theta } - \hat { \theta } ) + \frac { N } { 2 } \bar { L } \| \tilde { \theta } - \hat { \theta } \| _ { 2 } ^ { 2 } .
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
In Algorithm 1, we define the update of $\theta$ in the following full gradient way:
|
| 563 |
+
|
| 564 |
+
$$
|
| 565 |
+
\boldsymbol { \theta } ^ { ( m + 1 ) } : = \boldsymbol { \theta } ^ { ( m ) } - \boldsymbol { \eta } ^ { ( m ) } \cdot \sum _ { i = 1 } ^ { N } \cdot \nabla f _ { i } ( X _ { i } : \boldsymbol { \theta } ^ { ( m ) } , \boldsymbol { \lambda } ^ { ( m ) } ) ,
|
| 566 |
+
$$
|
| 567 |
+
|
| 568 |
+
which implies
|
| 569 |
+
|
| 570 |
+
$$
|
| 571 |
+
\boldsymbol { \theta } ^ { ( m + 1 ) } - \boldsymbol { \theta } ^ { ( m ) } = - \boldsymbol { \eta } ^ { ( m ) } \cdot \nabla \bar { f } ( \boldsymbol { \theta } ^ { ( m ) } , \lambda ^ { ( m ) } ) .
|
| 572 |
+
$$
|
| 573 |
+
|
| 574 |
+
By equation 56 we have $\begin{array} { r } { \tilde { \theta } - \hat { \theta } = \theta ^ { ( m + 1 ) } - \theta ^ { ( m ) } = - \eta ^ { ( m ) } \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) } \end{array}$ . We now substitute $\tilde { \theta } : = \theta ^ { ( m + 1 ) }$ , $\hat { \theta } : = \theta ^ { ( m ) }$ and $\lambda : = \bar { \lambda }$ into equation 54 to obtain
|
| 575 |
+
|
| 576 |
+
$$
|
| 577 |
+
\begin{array} { l } { \displaystyle \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) } \\ { \displaystyle \le \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) - \eta ^ { ( m ) } \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) ^ { T } \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) + ( \eta ^ { ( m ) } ) ^ { 2 } \cdot \frac { N \bar { L } M } { 2 } } \\ { \displaystyle \le \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) - \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } + \eta ^ { ( m ) } \bar { L } M \sqrt { n _ { 2 } } a _ { m } } \\ { \displaystyle \quad + \frac { 1 } { 2 } ( \eta ^ { ( m ) } ) ^ { 2 } \cdot N \bar { L } M . } \end{array}
|
| 578 |
+
$$
|
| 579 |
+
|
| 580 |
+
The first inequality is by plugging equation 56 into equation 54, the second inequality comes from Proposition 12 and the third inequality comes from Proposition 18.
|
| 581 |
+
|
| 582 |
+
# 6.4 PROOF OF THEOREM 11
|
| 583 |
+
|
| 584 |
+
Here we show Theorem 11 as the consequence of Theorem 7 and Lemmas 8, 9 and 10.
|
| 585 |
+
|
| 586 |
+
# 6.4.1 PROOF OF LEMMA 8
|
| 587 |
+
|
| 588 |
+
Here we show Lemma 8 as the consequence of Lemmas 20, 21 and 22.
|
| 589 |
+
|
| 590 |
+
Lemma 20 to ensure $\begin{array} { r } { \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty } \end{array}$ and $\textstyle \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty$ is a set of sufficient condition
|
| 591 |
+
|
| 592 |
+
$$
|
| 593 |
+
\sum _ { m = 1 } ^ { \infty } | \bar { \sigma _ { j } } - \sigma _ { j } ^ { ( m ) } | < \infty , \forall j .
|
| 594 |
+
$$
|
| 595 |
+
|
| 596 |
+
Proof. By plugging equation 45 and equation 43 into equation 58, we have the following for all $j$ :
|
| 597 |
+
|
| 598 |
+
$$
|
| 599 |
+
\begin{array} { r l } & { \quad \displaystyle \sum _ { m = 1 } ^ { \infty } \left| \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } \right| \leq \sum _ { m = 1 } ^ { \infty } \left( | \tilde { \sigma } _ { j } - \tilde { \sigma } _ { j } ^ { ( m ) } | + \frac { \bar { \sigma } _ { j } } { C } \sum _ { n = m + 1 } ^ { \infty } \alpha ^ { ( n ) } \right) } \\ & { \leq \frac { | \boldsymbol { k } | \cdot \tilde { M } _ { \bar { L } , M } } { C } \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } \sum _ { j = 1 } ^ { i } \eta ^ { ( j ) } + \frac { \bar { \sigma } _ { j } + | \boldsymbol { k } | | \bar { C } | } { C } \sum _ { m = 1 } ^ { \infty } \sum _ { n = m + 1 } ^ { \infty } \alpha ^ { ( n ) } . } \end{array}
|
| 600 |
+
$$
|
| 601 |
+
|
| 602 |
+
$\begin{array} { r } { \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty } \end{array}$ g coand $\textstyle \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty$ ight-hand side of equation 59 to be finite:.
|
| 603 |
+
|
| 604 |
+
Therefore, we obtain
|
| 605 |
+
|
| 606 |
+
$$
|
| 607 |
+
\sum _ { m = 1 } ^ { \infty } | \bar { \sigma _ { j } } - \sigma _ { j } ^ { ( m ) } | < \infty , \forall j .
|
| 608 |
+
$$
|
| 609 |
+
|
| 610 |
+
Lemma 21 Under Assumption 4,
|
| 611 |
+
|
| 612 |
+
$$
|
| 613 |
+
\sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty \quad a n d \quad \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty
|
| 614 |
+
$$
|
| 615 |
+
|
| 616 |
+
is a set of sufficient conditions to ensure
|
| 617 |
+
|
| 618 |
+
$$
|
| 619 |
+
\operatorname * { l i m } _ { M \to \infty } \operatorname * { s u p } _ { m = 1 } ^ { M } \left| \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) - \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \right| < \infty .
|
| 620 |
+
$$
|
| 621 |
+
|
| 622 |
+
Proof. By Assumption 4, we have
|
| 623 |
+
|
| 624 |
+
$$
|
| 625 |
+
\| l _ { i } ( x ) - l _ { i } ( y ) \| \leq \hat { M } \| x - y \| \leq \hat { M } \sum _ { i = 1 } ^ { D } | x _ { i } - y _ { i } | .
|
| 626 |
+
$$
|
| 627 |
+
|
| 628 |
+
By the definition of $f _ { i } ( \cdot )$ , we then have
|
| 629 |
+
|
| 630 |
+
$$
|
| 631 |
+
\begin{array} { r l } & { \quad \displaystyle \sum _ { m = 1 } ^ { \infty } | \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) - \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) | } \\ & { \leq \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { i = 1 } ^ { N } | ( \bar { l } _ { i } ( X _ { i } : \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) - l _ { i } ( X _ { i } : \theta ^ { ( m ) } , \bar { \lambda } ) ) | } \\ & { \leq M _ { 2 } \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { j = 1 } ^ { D } \sum _ { i = 1 } ^ { N } | \frac { a ( W _ { 1 , j } ^ { ( m ) } , X _ { i } ) - \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } } - \frac { a ( W _ { 1 , j , \bar { j } } ^ { ( m ) } , X _ { i } ) - \bar { \mu } _ { j } } { \sigma _ { j } + \epsilon _ { B } } | } \\ & { \leq M _ { 3 } \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { j = 1 } ^ { D } ( \displaystyle \sum _ { i = 1 } ^ { N } | k | | W _ { 1 , j , \bar { j } } ^ { ( m ) } , X _ { i } | | \displaystyle \frac { | \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } | } { \epsilon _ { B } ^ { 2 } } | + N | \frac { \bar { \mu } _ { j } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } | ) . } \end{array}
|
| 632 |
+
$$
|
| 633 |
+
|
| 634 |
+
The first inequality is by the Cauchy-Schwarz inequality, and the second one is by equation 60. To show the finiteness of equation 64, we only need to show the following two statements:
|
| 635 |
+
|
| 636 |
+
and
|
| 637 |
+
|
| 638 |
+
$$
|
| 639 |
+
\begin{array} { l } { { \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { i = 1 } ^ { N } | k | | W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } | | | \frac { \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } } { \epsilon _ { B } ^ { 2 } } | < \infty , \forall j } } \\ { { \displaystyle \sum _ { m = 1 } ^ { \infty } | \frac { \bar { \mu } _ { j } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } | < \infty , \forall j . } } \end{array}
|
| 640 |
+
$$
|
| 641 |
+
|
| 642 |
+
Proof of equation $6 5$ : For all $j$ we have
|
| 643 |
+
|
| 644 |
+
$$
|
| 645 |
+
\begin{array} { r l } & { \quad \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { i = 1 } ^ { N } | k | | W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } | \left| \frac { \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } } { \epsilon _ { B } ^ { 2 } } \right| } \\ & { \leq \displaystyle \sum _ { m = 1 } ^ { \infty } | k | N D M \operatorname* { m a x } _ { i } \| X _ { i } \| \frac { 1 } { \epsilon _ { B } ^ { 2 } } \left| \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } \right| } \\ & { = | k | N D M \operatorname* { m a x } _ { i } \| X _ { i } \| \frac { 1 } { \epsilon _ { B } ^ { 2 } } \sum _ { m = 1 } ^ { \infty } \left| \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } \right| . } \end{array}
|
| 646 |
+
$$
|
| 647 |
+
|
| 648 |
+
The inequality comes from $| W _ { 1 , j , \cdot } ^ { ( m ) } X _ { i } | \leq D M \| X _ { i } \| _ { 2 }$ , where $D$ is the dimension of $X _ { i }$ and $M$ is the elementwise upper bound for $W _ { 1 , j , \cdot } ^ { ( m ) }$ in Assumption 2.
|
| 649 |
+
|
| 650 |
+
Finally, we invoke Lemma 14 to assert that $\begin{array} { r } { \sum _ { m = 1 } ^ { \infty } \bigg | \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } \bigg | } \end{array}$ is finite.
|
| 651 |
+
|
| 652 |
+
Proof of equation $^ { 6 6 }$ : For all $j$ we have
|
| 653 |
+
|
| 654 |
+
$$
|
| 655 |
+
\begin{array} { l } { { \displaystyle \sum _ { m = 1 } ^ { \infty } \left| \frac { \bar { \mu } _ { j } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| } } \\ { { \displaystyle \leq \sum _ { m = 1 } ^ { \infty } \left| \frac { \bar { \mu } _ { j } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } \right| + \sum _ { m = 1 } ^ { \infty } \left| \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| . } } \end{array}
|
| 656 |
+
$$
|
| 657 |
+
|
| 658 |
+
The first term in equation 68 is finite since $\{ \mu _ { j } ^ { ( m ) } \}$ is a Cauchy series. For the second term, we know that there exists a constant $M$ such that for all $m \geq M$ , $\mu _ { j } ^ { ( m ) } \leq \bar { \mu } + 1$ . This is also by the fact that $\{ \mu _ { j } ^ { ( m ) } \}$ is a Cauchy series and it converges to $\bar { \mu }$ . Therefore, the second term in equation 68 becomes
|
| 659 |
+
|
| 660 |
+
$$
|
| 661 |
+
\begin{array} { r l } & { \displaystyle \sum _ { m = 1 } ^ { M - 1 } \left| \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| + \displaystyle \sum _ { m = M } ^ { \infty } \left| \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| } \\ & { \leq \displaystyle \sum _ { m = 1 } ^ { M - 1 } \left| \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| + \displaystyle \sum _ { m = M } ^ { \infty } ( \bar { \mu } + 1 ) \left| \frac { 1 } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { 1 } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| . } \end{array}
|
| 662 |
+
$$
|
| 663 |
+
|
| 664 |
+
Noted that function $f ( { \boldsymbol { \sigma } } ) = \frac { 1 } { { \boldsymbol { \sigma } } + { \epsilon _ { B } } }$ is Lipschitz continuous since its gradient is bounded by $\frac { 1 } { \epsilon _ { B } ^ { 2 } }$ Therefore we can choose $\frac { 1 } { \epsilon _ { B } ^ { 2 } }$ as the Lipschitz constant for $f ( \sigma )$ . We then have the following inequality:
|
| 665 |
+
|
| 666 |
+
$$
|
| 667 |
+
\left| \frac { 1 } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { 1 } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| \leq \frac { 1 } { \epsilon _ { B } ^ { 2 } } | \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } | .
|
| 668 |
+
$$
|
| 669 |
+
|
| 670 |
+
Plugging equation 70 into equation 69, we obtain
|
| 671 |
+
|
| 672 |
+
$$
|
| 673 |
+
\begin{array} { r l } & { ~ \displaystyle \sum _ { m = 1 } ^ { M - 1 } \left| \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| + \displaystyle \sum _ { m = M } ^ { \infty } ( \bar { \mu } + 1 ) \left| \frac { 1 } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { 1 } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| } \\ & { \le \displaystyle \sum _ { m = 1 } ^ { M - 1 } \left| \frac { \mu _ { j } ^ { ( m ) } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| + \displaystyle \sum _ { m = M } ^ { \infty } \frac { ( \bar { \mu } + 1 ) } { \epsilon _ { B } ^ { 2 } } | \bar { \sigma } _ { j } - \sigma _ { j } ^ { ( m ) } | , } \end{array}
|
| 674 |
+
$$
|
| 675 |
+
|
| 676 |
+
where the first term is finite by the fact that $M$ is a finite constant. We have shown the condition for the second term to be finite in Lemma 20. Therefore,
|
| 677 |
+
|
| 678 |
+
$$
|
| 679 |
+
\sum _ { m = 1 } ^ { \infty } \left| \frac { \bar { \mu } _ { j } } { \bar { \sigma } _ { j } + \epsilon _ { B } } - \frac { \mu _ { j } ^ { ( m ) } } { \sigma _ { j } ^ { ( m ) } + \epsilon _ { B } } \right| < \infty , \forall j .
|
| 680 |
+
$$
|
| 681 |
+
|
| 682 |
+
By equation 65 and equation 66, we have that the right-hand side of equation 64 is finite. It means that the left-hand side of equation 64 is finite. Thus,
|
| 683 |
+
|
| 684 |
+
$$
|
| 685 |
+
\sum _ { m = 1 } ^ { \infty } \left| \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) - \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \right| < \infty .
|
| 686 |
+
$$
|
| 687 |
+
|
| 688 |
+
Lemma 22 If
|
| 689 |
+
|
| 690 |
+
then
|
| 691 |
+
|
| 692 |
+
$$
|
| 693 |
+
\begin{array} { c } { { \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty \quad a n d \quad \displaystyle \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty , } } \\ { { \displaystyle \operatorname* { l i m } _ { M \to \infty } \sum _ { m = 1 } ^ { M } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } < \infty . } } \end{array}
|
| 694 |
+
$$
|
| 695 |
+
|
| 696 |
+
Proof. For simplicity of the proof, we define
|
| 697 |
+
|
| 698 |
+
$$
|
| 699 |
+
\begin{array} { c } { { \displaystyle T ^ { ( M ) } : = \sum _ { m = 1 } ^ { M } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } , } } \\ { { \displaystyle O ^ { ( m ) } : = \bar { f } ( \theta ^ { ( m + 1 ) } , \lambda ^ { ( m + 1 ) } ) - \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) , } } \\ { { \Delta _ { 1 } ^ { ( m + 1 ) } : = \bar { f } ( \theta ^ { ( m + 1 ) } , \lambda ^ { ( m + 1 ) } ) - \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) , } } \\ { { \displaystyle \Delta _ { 2 } ^ { ( m ) } : = \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) - \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) , } } \end{array}
|
| 700 |
+
$$
|
| 701 |
+
|
| 702 |
+
where $\bar { \lambda }$ is the converged value of $\lambda$ in Theorem 7. Therefore,
|
| 703 |
+
|
| 704 |
+
$$
|
| 705 |
+
O ^ { ( m ) } = \Delta _ { 1 } ^ { ( m + 1 ) } + \Delta _ { 1 } ^ { ( m ) } + \Delta _ { 2 } ^ { ( m ) } \leq | \Delta _ { 1 } ^ { ( m + 1 ) } | + | \Delta _ { 1 } ^ { ( m ) } | + \Delta _ { 2 } ^ { ( m ) } .
|
| 706 |
+
$$
|
| 707 |
+
|
| 708 |
+
By Proposition 19,
|
| 709 |
+
|
| 710 |
+
$$
|
| 711 |
+
\Delta _ { 2 } ^ { ( m ) } \leq - \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } + \eta ^ { ( m ) } \bar { L } M \sqrt { n _ { 2 } } a _ { m } + \frac { 1 } { 2 } ( \eta ^ { ( m ) } ) ^ { 2 } \cdot N \bar { L } M .
|
| 712 |
+
$$
|
| 713 |
+
|
| 714 |
+
We sum the inequality equation 72 from 1 to $K$ with respect to $m$ and plug equation 73 into it to obtain
|
| 715 |
+
|
| 716 |
+
$$
|
| 717 |
+
\begin{array} { l } { \displaystyle \sum _ { m = 1 } ^ { K } O ^ { ( m ) } \le \displaystyle \sum _ { m = 1 } ^ { K } | \Delta _ { 1 } ^ { ( m + 1 ) } | + \displaystyle \sum _ { m = 1 } ^ { K } | \Delta _ { 1 } ^ { ( m ) } | - \displaystyle \sum _ { m = 1 } ^ { K } \{ \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } \} } \\ { \displaystyle \qquad + \displaystyle \sum _ { m = 1 } ^ { K } \eta ^ { ( m ) } \bar { L } M \sqrt { n _ { 2 } } a _ { m } + \displaystyle \sum _ { m = 1 } ^ { K } \{ \frac { 1 } { 2 } ( \eta ^ { ( m ) } ) ^ { 2 } N \bar { L } M \} } \\ { \displaystyle \qquad = \sum _ { m = 1 } ^ { K } | \Delta _ { 1 } ^ { ( m + 1 ) } | + \displaystyle \sum _ { m = 1 } ^ { K } | \Delta _ { 1 } ^ { ( m ) } | - T ^ { ( K ) } } \\ { \displaystyle \qquad + \bar { L } ^ { 2 } \sqrt { n _ { 2 } } \cdot \displaystyle \sum _ { m = 1 } ^ { K } \eta ^ { ( m ) } a _ { m } + \displaystyle \sum _ { m = 1 } ^ { K } \{ \frac { 1 } { 2 } ( \eta ^ { ( m ) } ) ^ { 2 } N \bar { L } M \} . } \end{array}
|
| 718 |
+
$$
|
| 719 |
+
|
| 720 |
+
From this, we have:
|
| 721 |
+
|
| 722 |
+
$$
|
| 723 |
+
\begin{array} { r l } { \displaystyle \operatorname* { l i m } _ { K \to \infty } T ^ { ( K ) } \le \displaystyle \operatorname* { l i m } _ { K \to \infty } \frac { 1 } { c _ { 1 } } ( \bar { f } ( \theta ^ { ( K ) } , \lambda ^ { ( K ) } ) - \bar { f } ( \theta ^ { ( 1 ) } , \lambda ^ { ( 1 ) } ) ) } \\ { \displaystyle \qquad + \operatorname* { l i m } _ { K \to \infty } \frac { 1 } { c _ { 1 } } \sum _ { m = 1 } ^ { K } ( | \Delta _ { 1 } ^ { ( m + 1 ) } | + | \Delta _ { 1 } ^ { ( m ) } | ) } \\ { \displaystyle \qquad + \operatorname* { l i m } _ { K \to \infty } \bar { L } ^ { 2 } \sqrt { n _ { 2 } } \sum _ { m = 1 } ^ { K } \eta ^ { ( m ) } a _ { m } } \\ { \displaystyle \qquad + \operatorname* { l i m } _ { K \to \infty } \frac { N \bar { L } K } { 2 c _ { 1 } } \sum _ { m = 1 } ^ { K } \eta ^ { ( m ) ^ { 2 } } . } \end{array}
|
| 724 |
+
$$
|
| 725 |
+
|
| 726 |
+
Next we show that each of the four terms in the right-hand side of equation 75 is finite, respectively. For the first term,
|
| 727 |
+
|
| 728 |
+
$$
|
| 729 |
+
\operatorname* { l i m } _ { K \to \infty } \operatorname* { s u p } _ { c _ { 1 } } \bigl ( \bar { f } ( \theta ^ { ( K ) } , \lambda ^ { ( K ) } ) - \bar { f } ( \theta ^ { ( 1 ) } , \lambda ^ { ( 1 ) } ) \bigr ) < \infty
|
| 730 |
+
$$
|
| 731 |
+
|
| 732 |
+
is by the fact that the parameters $\{ \theta , \lambda \}$ are in compact sets, which implies that the image of $f _ { i } ( \cdot )$ is in a bounded set.
|
| 733 |
+
|
| 734 |
+
For the second term, we showed its finiteness in Lemma 21.
|
| 735 |
+
|
| 736 |
+
For the third term, by equation 42, we have
|
| 737 |
+
|
| 738 |
+
$$
|
| 739 |
+
\begin{array} { r l } { { \operatorname* { l i m s u p } _ { \kappa \to \infty } \displaystyle \sum _ { m = 1 } ^ { \kappa } \eta ^ { ( m ) } a _ { m } } } \\ & { = \operatorname* { l i m s u p } _ { \kappa \to \infty } \displaystyle \sum _ { m = 1 } ^ { \kappa } \eta ^ { ( m ) } ( K _ { 1 } \sum _ { i = m } ^ { \infty } \sum _ { j = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( j ) } + K _ { 2 } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } ) } \\ & { = K _ { 1 } \operatorname* { l i m s u p } _ { \kappa \to \infty } \displaystyle \sum _ { m = 1 } ^ { \kappa } \eta ^ { ( m ) } ( \sum _ { i = m } ^ { \infty } \sum _ { j = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( j ) } ) + K _ { 2 } \operatorname* { l i m s u p } _ { \kappa \to \infty } \displaystyle \sum _ { m = 1 } ^ { \kappa } \eta ^ { ( m ) } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } . } \end{array}
|
| 740 |
+
$$
|
| 741 |
+
|
| 742 |
+
The right-hand side of equation 77 is finite because
|
| 743 |
+
|
| 744 |
+
$$
|
| 745 |
+
\sum _ { m = 1 } ^ { \infty } \eta ^ { ( m ) } \left( \sum _ { i = m } ^ { \infty } \sum _ { j = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( j ) } \right) < \sum _ { m = 1 } ^ { \infty } \left( \sum _ { i = m } ^ { \infty } \sum _ { j = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( j ) } \right) < \infty
|
| 746 |
+
$$
|
| 747 |
+
|
| 748 |
+
and
|
| 749 |
+
|
| 750 |
+
$$
|
| 751 |
+
\sum _ { m = 1 } ^ { \infty } \eta ^ { ( m ) } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } < \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } < \infty .
|
| 752 |
+
$$
|
| 753 |
+
|
| 754 |
+
The second inequalities in equation 78 and equation 79 come from the stated assumptions of this lemma.
|
| 755 |
+
|
| 756 |
+
For the fourth term,
|
| 757 |
+
|
| 758 |
+
$$
|
| 759 |
+
\operatorname* { l i m } _ { K \to \infty } \frac { N \bar { L } M } { 2 c } \sum _ { m = 1 } ^ { K } \eta ^ { ( m ) ^ { 2 } } < \infty
|
| 760 |
+
$$
|
| 761 |
+
|
| 762 |
+
holds, because we have $\begin{array} { r l r } { \sum _ { m = 1 } ^ { \infty } ( \eta ^ { ( m ) } ) ^ { 2 } } & { { } < } & { \infty } \end{array}$ in Assumption 3. Therefore, $T ^ { ( \infty ) } =$ $\begin{array} { r } { \sum _ { m = 1 } ^ { \infty } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } < \infty } \end{array}$ holds.
|
| 763 |
+
|
| 764 |
+
In Lemmas 20, 21 and 22, we show that $\{ \sigma ^ { ( m ) } \}$ and $\{ \mu ^ { ( m ) } \}$ are Cauchy series, hence Lemma 8 holds.
|
| 765 |
+
|
| 766 |
+
# 6.4.2 PROOF OF LEMMA 9
|
| 767 |
+
|
| 768 |
+
This proof is similar to the the proof by Bertsekas $\&$ Tsitsiklis (2000).
|
| 769 |
+
|
| 770 |
+
Proof. By Theorem 8, we have
|
| 771 |
+
|
| 772 |
+
$$
|
| 773 |
+
\operatorname* { l i m } _ { M \to \infty } \sum _ { m = 1 } ^ { M } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } < \infty .
|
| 774 |
+
$$
|
| 775 |
+
|
| 776 |
+
If there exists a $\epsilon > 0$ and an integer $\bar { m }$ such that
|
| 777 |
+
|
| 778 |
+
$$
|
| 779 |
+
\| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } \geq \epsilon
|
| 780 |
+
$$
|
| 781 |
+
|
| 782 |
+
for all $m \geq { \bar { m } }$ , we would have
|
| 783 |
+
|
| 784 |
+
$$
|
| 785 |
+
\operatorname* { l i m i n f } _ { M \to \infty } \sum _ { m = \bar { m } } ^ { M } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } \geq \operatorname* { l i m i n f } _ { M \to \infty } \epsilon ^ { 2 } \sum _ { m = \bar { m } } ^ { M } \eta ^ { ( m ) } = \infty
|
| 786 |
+
$$
|
| 787 |
+
|
| 788 |
+
which contradicts equation 81. Therefore, $\operatorname* { l i m } _ { m \to \infty } \operatorname* { i n f } _ { } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } = 0$
|
| 789 |
+
|
| 790 |
+
# 6.4.3 PROOF OF LEMMA 10
|
| 791 |
+
|
| 792 |
+
Lemma 23 Let $Y _ { t } , W , t$ and $Z _ { t }$ be three sequences such that $W _ { t }$ is nonnegative for all t. Assume that
|
| 793 |
+
|
| 794 |
+
$$
|
| 795 |
+
Y _ { t + 1 } \le Y _ { t } - W _ { t } + Z _ { t } , \quad t = 0 , 1 , . . . ,
|
| 796 |
+
$$
|
| 797 |
+
|
| 798 |
+
and that the series $\textstyle \sum _ { t = 0 } ^ { T } Z _ { t }$ converges as $T \to \infty$ . Then either $Y _ { t } \infty$ or else $Y _ { t }$ converges to a finite value and $\textstyle \sum _ { t = 0 } ^ { \infty } W _ { t } < \infty$ .
|
| 799 |
+
|
| 800 |
+
This lemma has been proven by Bertsekas & Tsitsiklis (2000).
|
| 801 |
+
|
| 802 |
+
Lemma 24 When
|
| 803 |
+
|
| 804 |
+
$$
|
| 805 |
+
\sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty \quad a n d \quad \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty ,
|
| 806 |
+
$$
|
| 807 |
+
|
| 808 |
+
it follows that $\bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } )$ converge to a finite value.
|
| 809 |
+
|
| 810 |
+
Proof. By Proposition 19, we have
|
| 811 |
+
|
| 812 |
+
$$
|
| 813 |
+
\begin{array} { r l } & { \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) \le \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) - \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } } \\ & { \qquad + \eta ^ { ( m ) } \bar { L } M \sqrt { n _ { 2 } } a _ { m } + \displaystyle \frac 1 2 ( \eta ^ { ( m ) } ) ^ { 2 } \cdot N \bar { L } M . } \end{array}
|
| 814 |
+
$$
|
| 815 |
+
|
| 816 |
+
L $\mathfrak { a } \mathfrak { t } Y ^ { ( m ) } : = \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) , \index { W ^ { ( m ) } } : = \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } ^ { 2 } \mathrm { a n d } Z ^ { ( m ) } : = \eta ^ { ( m ) } \bar { L } M \sqrt { n _ { 2 } } a _ { m } + \frac { 1 } { \gamma } ( \eta ^ { ( m ) } ) ^ { 2 } \cdot N \bar { L } M .$ By equation 10 and equation 77- equation 79, it is easy to see that $\textstyle \sum _ { m = 0 } ^ { M } Z ^ { ( m ) }$ converges as $M \infty$ . Therefore, by Lemma 23, $Y ^ { ( m ) }$ converges to a finite value. The infinite case can not occur in our setting due to Assumptions 1 and 2.
|
| 817 |
+
|
| 818 |
+
# Lemma 25 If
|
| 819 |
+
|
| 820 |
+
$$
|
| 821 |
+
\begin{array} { l } { { \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } < \infty \quad a n d \quad \sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } < \infty , } } \\ { { t h e n \underset { m \infty } { \operatorname* { l i m } } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } = 0 . } } \end{array}
|
| 822 |
+
$$
|
| 823 |
+
|
| 824 |
+
Proof. To show that $\operatorname* { l i m } _ { m \to \infty } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } = 0$ , assume the contrary; that is,
|
| 825 |
+
|
| 826 |
+
$$
|
| 827 |
+
\operatorname* { l i m } _ { m \to \infty } \operatorname* { s u p } _ { \mathbf { \delta } } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| _ { 2 } > 0 .
|
| 828 |
+
$$
|
| 829 |
+
|
| 830 |
+
Then there exists an $\epsilon > 0$ such that $\| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| < \epsilon / 2$ for infinitely many $m$ and also $\| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| > \epsilon$ for infinitely many $m$ . Therefore, there is an infinite subset of integers $\mathbb { M }$ , such that for each $m \in \mathbb { M }$ , there exists an integer $q ( m ) > m$ such that
|
| 831 |
+
|
| 832 |
+
$$
|
| 833 |
+
\begin{array} { r l } & { \quad \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| < \epsilon / 2 , } \\ & { \| \nabla \bar { f } ( \theta ^ { ( i ( m ) ) } , \bar { \lambda } ) \| > \epsilon , } \\ & { \epsilon / 2 \leq \| \nabla \bar { f } ( \theta ^ { ( i ) } , \bar { \lambda } ) \| \leq \epsilon , } \\ & { \quad \quad \operatorname { i f } m < i < q ( m ) . } \end{array}
|
| 834 |
+
$$
|
| 835 |
+
|
| 836 |
+
From $\| \nabla \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) \| - \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| \leq \bar { L } \eta ^ { ( m ) } \| \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) \|$ , it follows that for all $m \in \mathbb { M }$ that are sufficiently large so that $\bar { L } \eta ^ { ( m ) } < \epsilon / 4$ , we have
|
| 837 |
+
|
| 838 |
+
$$
|
| 839 |
+
\epsilon / 4 \leq \| \nabla \bar { f } ( \theta ^ { ( m ) } , \lambda ^ { ( m ) } ) \| .
|
| 840 |
+
$$
|
| 841 |
+
|
| 842 |
+
Otherwise the condition $\epsilon / 2 \leq \| \nabla \bar { f } ( \theta ^ { ( m + 1 ) } , \bar { \lambda } ) \|$ would be violated. Without loss of generality, we assume that the above relations as well as equation 57 hold for all $m \in \mathbb { M }$ . With the above observations, we have for all $m \in \mathbb { M }$ ,
|
| 843 |
+
|
| 844 |
+
$$
|
| 845 |
+
\begin{array} { r l } & { \frac { \epsilon } { 2 } \leq \| \nabla \bar { f } ( \theta ^ { q ( m ) } , \bar { \lambda } ) \| - \| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| \leq \bar { L } \| \theta ^ { q ( m ) } - \theta ^ { ( m ) } \| } \\ & { \leq \bar { L } \displaystyle \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } ( \| \nabla \bar { f } ( \theta ^ { ( i ) } , \bar { \lambda } ) \| + \| \nabla \bar { f } ( \theta ^ { ( i ) } , \lambda ^ { ( i ) } ) - \nabla \bar { f } ( \theta ^ { ( i ) } , \bar { \lambda } ) \| ) } \\ & { = \bar { L } \displaystyle \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } + \bar { L } ^ { 2 } \sqrt { n _ { 2 } } M _ { 1 } \displaystyle \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } \displaystyle \sum _ { j = m } ^ { \infty } \sum _ { k = 1 } ^ { j } \alpha ^ { ( j ) } \eta ^ { ( k ) } } \\ & { + \bar { L } ^ { 2 } \sqrt { n _ { 2 } } M _ { 2 } \displaystyle \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } \displaystyle \sum _ { j = m } ^ { \infty } \alpha ^ { ( j ) } } \end{array}
|
| 846 |
+
$$
|
| 847 |
+
|
| 848 |
+
The first inequality is by equation 86 and the third one is by the Lipschitz condition assumption. The seventh one is by equation 51. By equation 12, we have for all $m \in \mathbb { M }$ ,
|
| 849 |
+
|
| 850 |
+
and
|
| 851 |
+
|
| 852 |
+
$$
|
| 853 |
+
\begin{array} { r l } { { \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } \sum _ { j = m } ^ { \infty } \sum _ { k = 1 } ^ { j } \alpha ^ { ( j ) } \eta ^ { ( k ) } < \sum _ { i = 1 } ^ { \infty } \sum _ { j = i } ^ { \infty } \sum _ { k = 1 } ^ { j } \alpha ^ { ( j ) } \eta ^ { ( k ) } < \infty } } \\ & { \underset { i = m } { \overset { q ( m ) - 1 } { \sum } } \ \eta ^ { ( i ) } \sum _ { j = m } ^ { \infty } \alpha ^ { ( j ) } < \sum _ { i = 1 } ^ { \infty } \sum _ { j = i } ^ { \infty } \alpha ^ { ( j ) } < \infty . } \end{array}
|
| 854 |
+
$$
|
| 855 |
+
|
| 856 |
+
It is fore, $\left\{ \alpha _ { i } \right\}$ $\textstyle \sum _ { i = 1 } ^ { \infty } \alpha _ { i } < \infty$ $M \to \infty$ P∞i=M αi = 0 . There-rom this $\begin{array} { r } { \underset { m \infty } { \operatorname* { l i m } \operatorname* { i n f } } \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } \sum _ { j = m } ^ { \infty } \sum _ { k = 1 } ^ { j } \alpha ^ { ( j ) } \eta ^ { ( k ) } = 0 } \end{array}$ $\begin{array} { r } { \underset { m \infty } { \operatorname* { l i m } \operatorname* { i n f } } \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } \sum _ { j = m } ^ { \infty } \alpha ^ { ( j ) } = 0 } \end{array}$ it follows that
|
| 857 |
+
|
| 858 |
+
$$
|
| 859 |
+
\operatorname* { l i m } _ { m \to \infty } \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } \ge \frac { 1 } { 2 \bar { L } } .
|
| 860 |
+
$$
|
| 861 |
+
|
| 862 |
+
By equation 51 and equation 87, if we pick $m \in \mathbb { M }$ such that $L \sqrt { n _ { 2 } } a _ { m } \leq \frac { \epsilon } { 8 }$ , we have $\| \nabla \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) \| \ge \frac { \epsilon } { 8 }$ Using equation 57, we observe that
|
| 863 |
+
|
| 864 |
+
$$
|
| 865 |
+
\leq \bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } ) - c _ { 1 } \left( \frac { \epsilon } { 8 } \right) ^ { 2 } \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } + \frac { 1 } { 2 } \cdot N \bar { L } M \sum _ { i = m } ^ { q ( m ) - 1 } ( \eta ^ { ( i ) } ) ^ { 2 } , \forall m \in \mathbb { M } ,
|
| 866 |
+
$$
|
| 867 |
+
|
| 868 |
+
where the second inequality is by equation 87. By Lemma 24, $\bar { f } ( \theta ^ { q ( m ) } , \bar { \lambda } )$ and $\bar { f } ( \theta ^ { ( m ) } , \bar { \lambda } )$ converge to the same finite value. Using this convergence result and the assumption $\textstyle \sum _ { m = 0 } ^ { \infty } ( \eta ^ { ( m ) } ) ^ { 2 } < \infty$ , this relation implies that
|
| 869 |
+
|
| 870 |
+
$\operatorname* { l i m } _ { m \to \infty , m \in \mathbb { M } } \sum _ { i = m } ^ { q ( m ) - 1 } \eta ^ { ( i ) } = 0$ and contradicts equation 91.
|
| 871 |
+
|
| 872 |
+
By Lemmas 23, 24 and 25, we show that Theorem 11 holds.
|
| 873 |
+
|
| 874 |
+
# 6.5 DISCUSSIONS OF CONDITIONS FOR STEPSIZES
|
| 875 |
+
|
| 876 |
+
Here we discuss the actual conditions for $\eta ^ { ( m ) }$ and $\alpha ^ { ( m ) }$ to satisfy the assumptions of Theorem 7 and Lemma 8. We only consider the cases $\begin{array} { r } { \eta ^ { ( m ) } = \frac { 1 } { m ^ { k } } } \end{array}$ and α(m) $\alpha ^ { ( m ) } \ = \ \frac { 1 } { m ^ { h } }$ , but the same analysis applies to the cases $\begin{array} { r } { \eta ^ { ( m ) } = { \cal O } ( \frac { 1 } { m ^ { k } } ) } \end{array}$ and $\begin{array} { r } { \alpha ^ { ( m ) } = { O } \left( \frac { 1 } { m h } \right) } \end{array}$ .
|
| 877 |
+
|
| 878 |
+
# 6.6 ASSUMPTIONS OF THEOREM 7
|
| 879 |
+
|
| 880 |
+
For the assumptions of Theorem 7, the first condition $\textstyle \sum _ { m = 1 } ^ { \infty } \alpha ^ { ( m ) } < \infty$ requires $h > 1$ . Besides, the second condition
|
| 881 |
+
|
| 882 |
+
$$
|
| 883 |
+
\sum _ { m = 1 } ^ { \infty } \sum _ { n = 1 } ^ { m } \alpha ^ { ( m ) } \eta ^ { ( n ) } \approx \frac { 1 } { h - 1 } \sum _ { n = 1 } ^ { \infty } \eta ^ { ( n ) } \frac { 1 } { n ^ { h - 1 } } = \frac { 1 } { h - 1 } \sum _ { n = 1 } ^ { \infty } \frac { 1 } { n ^ { k + h - 1 } } < \infty
|
| 884 |
+
$$
|
| 885 |
+
|
| 886 |
+
requires $k + h > 2$ . The approximation comes from the fact that for every $p > 1$ , we have
|
| 887 |
+
|
| 888 |
+
$$
|
| 889 |
+
\sum _ { k = n } ^ { \infty } k ^ { - p } \approx \int _ { k = n } ^ { \infty } k ^ { - p } d x = \left. { \frac { 1 } { 1 - p } } x ^ { 1 - p } \right| _ { n } ^ { \infty } = { \frac { 1 } { p - 1 } } { \frac { 1 } { n ^ { p - 1 } } } .
|
| 890 |
+
$$
|
| 891 |
+
|
| 892 |
+
Since $k \geq 1$ due to Assumption 3, we conclude that $k + h > 2$ . Therefore, the conditions for $\eta ^ { ( m ) }$ and $\alpha ^ { ( m ) }$ to satisfy the assumptions of Theorem 7 are $h > 1$ and $k \geq 1$ .
|
| 893 |
+
|
| 894 |
+
# 6.7 ASSUMPTIONS OF LEMMA 8
|
| 895 |
+
|
| 896 |
+
For the assumptions of Theorem 7, the first condition
|
| 897 |
+
|
| 898 |
+
$$
|
| 899 |
+
\sum _ { m = 1 } ^ { \infty } \sum _ { n = m } ^ { \infty } \alpha ^ { ( n ) } \approx \sum _ { m = 1 } ^ { \infty } \frac { 1 } { m ^ { h - 1 } } < \infty
|
| 900 |
+
$$
|
| 901 |
+
|
| 902 |
+
requires $h > 2$ .
|
| 903 |
+
|
| 904 |
+
Besides, the second condition is
|
| 905 |
+
|
| 906 |
+
$$
|
| 907 |
+
\sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \sum _ { n = 1 } ^ { i } \alpha ^ { ( i ) } \eta ^ { ( n ) } = \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } \sum _ { n = 1 } ^ { i } \eta ^ { ( n ) } \le C \sum _ { m = 1 } ^ { \infty } \sum _ { i = m } ^ { \infty } \alpha ^ { ( i ) } < \infty .
|
| 908 |
+
$$
|
| 909 |
+
|
| 910 |
+
The inequality holds because for any $p > 1$ , we have
|
| 911 |
+
|
| 912 |
+
$$
|
| 913 |
+
\sum _ { k = 1 } ^ { n } k ^ { - p } \approx \int _ { k = 1 } ^ { n } k ^ { - p } d k = \left. { \frac { 1 } { 1 - p } } k ^ { 1 - p } \right| _ { 1 } ^ { n } = { \frac { 1 } { p - 1 } } ( 1 - n ^ { 1 - p } ) \leq C
|
| 914 |
+
$$
|
| 915 |
+
|
| 916 |
+
Therefore, the conditions for $\eta ^ { ( m ) }$ and $\alpha ^ { ( m ) }$ to satisfy the assumptions of Lemma 8 are $h > 2$ and $k \geq 1$
|
md/train/SyJS-OgR-/SyJS-OgR-.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MULTI-LEVEL RESIDUAL NETWORKS FROM DYNAMICAL SYSTEMS VIEW
|
| 2 |
+
|
| 3 |
+
Bo Chang∗, Lili Meng∗ & Eldad Haber
|
| 4 |
+
University of British Columbia & Xtract Technologies Inc.
|
| 5 |
+
Vancouver, Canada
|
| 6 |
+
{bchang@stat, menglili@cs, haber@math}.ubc.ca
|
| 7 |
+
|
| 8 |
+
Frederick Tung Simon Fraser University Burnaby, Canada ftung@sfu.ca
|
| 9 |
+
|
| 10 |
+
David Begert Xtract Technologies Inc. Vancouver, Canada david@xtract.ai
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Deep residual networks (ResNets) and their variants are widely used in many computer vision applications and natural language processing tasks. However, the theoretical principles for designing and training ResNets are still not fully understood. Recently, several points of view have emerged to try to interpret ResNet theoretically, such as unraveled view, unrolled iterative estimation and dynamical systems view. In this paper, we adopt the dynamical systems point of view, and analyze the lesioning properties of ResNet both theoretically and experimentally. Based on these analyses, we additionally propose a novel method for accelerating ResNet training. We apply the proposed method to train ResNets and Wide ResNets for three image classification benchmarks, reducing training time by more than $40 \%$ with superior or on-par accuracy.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Deep neural networks have powered many research areas from computer vision (He et al., 2016; Huang et al., 2017b), natural language processing (Cho et al., 2014) to biology (Esteva et al., 2017) and e-commerce (Ha et al., 2016). Deep Residual Networks (ResNets) (He et al., 2016), and their variants such as Wide ResNets (Zagoruyko & Komodakis, 2016) and DenseNets (Huang et al., 2017b), are among the most successful architectures. In ResNets, the authors employ identity skipconnections that bypass residual layers, allowing data to flow from previous layers directly to any subsequent layers.
|
| 19 |
+
|
| 20 |
+
With the success of ResNet and its variants on various applications (He et al., 2016; 2017; Pohlen et al., 2017; Xiong et al., 2017; Oord et al., 2016; Wu et al., 2016), several views such as unraveled view (Veit et al., 2016), unrolled iterative estimation view (Greff et al., 2017) and dynamical systems view (Haber et al., 2017; E, 2017; Chang et al., 2017) have emerged to try to interpret ResNets through theoretical analysis and empirical results. These views provide preliminary interpretations, however, deep understanding of ResNets is still an active on-going research topic (Jastrzebski et al., 2017; Li et al., 2016; Hardt & Ma, 2017; Li & Yuan, 2017).
|
| 21 |
+
|
| 22 |
+
The dynamical systems view interprets ResNets as ordinary differential equations (ODEs), a special kind of dynamical systems (Haber et al., 2017; E, 2017), opening up possibilities of exploiting the computational and theoretical success from dynamical systems to ResNets. From this point of view, stable and reversible architectures (Haber & Ruthotto, 2017; Chang et al., 2017) are developed. However, few empirical analysis of this view has been done and many phenomena such as the removing of layers not leading to performance drop are not explained by the dynamical systems view. In this work, we take steps forward to complement this dynamical systems view with empirical analysis of its properties and the lesion studies.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: Dynamical systems view of ResNets. ResNets equally discretize the time interval $[ 0 , T ]$ using time points $T _ { 0 } , T _ { 1 } , \ldots , T _ { d }$ , where $T _ { 0 } = 0$ , $T _ { d } = T$ and $d$ is the total number of blocks.
|
| 26 |
+
|
| 27 |
+
One challenge of deep ResNets is the long training time. It is extremely time-consuming to train on large datasets such as ImageNet or with very deep ResNets such as 1000-layer networks, which may Yjtake several days or even weeks on high-performance hardware with GPU acceleration. Recently Identitythe reversible residual networks (Gomez et al., 2017; Chang et al., 2017) consumes $50 \%$ more comG(Yj ) Yjputational time for reducing memory usage by reconstructing the activations, which exposes training time to be a more severe problem. Inspired by the dynamical systems interpretation, we additionally G(Y )+Ypropose a simple yet effective multi-level method for accelerating ResNets training.
|
| 28 |
+
|
| 29 |
+
In summary, the main contributions of this work are:
|
| 30 |
+
|
| 31 |
+
• We study the dynamical systems view and explain the lesion studies from this view through empirical analysis.
|
| 32 |
+
• We propose a simple yet efficient multi-level training method for ResNets based on dynamical systems view.
|
| 33 |
+
• We demonstrate the proposed multi-level training method on ResNets (He et al., 2016) Stage 3 and Wide ResNets (Zagoruyko & Komodakis, 2016) across three widely used datasets, achieving more than $40 \%$ training time reduction with superior or on-par accuracy.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORKblock 1
|
| 36 |
+
|
| 37 |
+
# 2.1 RESNETS AND VARIANTS
|
| 38 |
+
|
| 39 |
+
ResNets (He et al., 2016) are deep neural networks of stacking simple residual blocks, which contain identity skip-connections that bypass the residual layers. A residual block, as shown in Fig. 2, can be written as
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathbf { Y } _ { j + 1 } = \mathbf { Y } _ { j } + G ( \mathbf { Y } _ { j } , \theta _ { j } ) \quad \mathrm { f o r } \quad j = 0 , . . . , N - 1 ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathbf { Y } _ { j }$ is the feature map at the $j$ th layer, $\theta _ { j }$ represents the jth layer’s network parameters. $G$ is referred to as a residual module, consisting of two convolutional layers. As shown in Fig. 1, the network is divided into several stages; each consists of a number of residual blocks. In the first block of each stage, the feature map size is halved, and the number of filters is doubled. The feature map remains the same dimensionality for subsequent blocks in a stage.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 2: A residual block. Each residual block has two components: the residual module $G$ and the identity skip-connection, which add up to the output of a block.
|
| 49 |
+
|
| 50 |
+
After the success of ResNets in popular competitions such as ImageNet (Russakovsky et al., 2015), Pascal VOC (Everingham et al.,
|
| 51 |
+
|
| 52 |
+
2010) and Microsoft COCO (Lin et al., 2014), there emerged many successors (Huang et al., 2016; 2017b; Chang et al., 2017; Gomez et al., 2017; Targ et al., 2016; Hardt & Ma, 2017; Zagoruyko & Komodakis, 2016). For instance, DenseNet (Huang et al., 2017b) connects between any two layers with the same feature-map size. ResNxt (Xie et al., 2017) introduces a homogeneous, multi-branch architecture to increase the accuracy.
|
| 53 |
+
|
| 54 |
+
# 2.2 INTERPRETATIONS OF RESNETS
|
| 55 |
+
|
| 56 |
+
Unraveled view In Veit et al. (2016), ResNets are interpreted from an unraveled view in which ResNets are viewed as a collection of many paths which data flow along from input to output. Each residual block consists of a residual module and an identity skip-connection; a path is defined as a configuration of which residual module to enter and which to skip. For a ResNet with $n$ residual blocks, there are $2 ^ { n }$ unique paths. Through lesion studies, Veit et al. (2016) further demonstrate that paths in ResNets do not strongly depend on each other and behave like an ensemble. When a residual block is removed, the number of paths is reduced from $2 ^ { n }$ to $2 ^ { n - 1 }$ , leaving half of the paths still valid, which explains why ResNets are resilient to dropping blocks. Besides the explicit ensemble view, training ResNets with stochastic depth (Huang et al., 2016) can be viewed as an ensemble of networks with varying depths implicitly.
|
| 57 |
+
|
| 58 |
+
Unrolled iterative estimation view ResNets are interpreted as unrolled iterative estimation in Greff et al. (2017). From this view, the level of representation stays the same within each stage. The residual blocks in a stage work together to estimate and iteratively refine a single level of representation: the first layer in a stage provides a rough estimate for the representation, and subsequent layers refine that estimate. An implication of this view is that processing in each block is incremental and removing blocks only has a mild effect on the final results. Based on this view, Jastrzebski et al. (2017) provide more analytical and empirical results.
|
| 59 |
+
|
| 60 |
+
Dynamical systems view ResNets can be interpreted as a discretization of dynamical systems (Haber et al., 2017; E, 2017). The basic dynamics at each step is a linear transformation followed by component-wise nonlinear activation function. The behavior of large dynamical systems is often a notoriously difficult problem in mathematics, particularly for discrete dynamical systems. This is similar to the gradient exploding/vanishing problem for deep neural networks or recurrent neural networks. Imposing structural constraints on dynamical systems such as Hamiltonian systems to conserve the energy is explored in Haber & Ruthotto (2017); Chang et al. (2017). However, no interpretation on the phenomenon of deleting layers is studied from this point of view.
|
| 61 |
+
|
| 62 |
+
# 2.3 RESNETS EFFICIENT TRAINING METHODS
|
| 63 |
+
|
| 64 |
+
One major challenge of deep ResNets is their long training time. To alleviate this issue, several attempts have been made. Stochastic depth (Huang et al., 2016) randomly drops entire residual blocks during training and bypassing their transformations through identity skip-connections; during testing, all the blocks are in use. When a block is bypassed for a specific iteration, there is no need to perform forward-backward computation. With stochastic depth, approximately $2 5 \%$ of training time could be saved. Figurnov et al. (2017) reduce the inference time of residual networks by learning to predict early halting scores based on the image content. Huang et al. (2017a) investigate image classification with computational resource limits at test time. SparseNets (Zhu et al., 2018) is a simple feature aggregation structure with shortcut paths bypassing exponentially growing number of layers. Mollifying networks (Gulcehre et al., 2016) start the optimization with an easier (possibly convex) objective function and let it evolve during the training, until it eventually goes back to being the original, difficult to optimize, objective function. It can also be interpreted as a form adaptive noise injection that only depends on a single hyperparameter.
|
| 65 |
+
|
| 66 |
+
# 3 RESNETS FROM DYNAMICAL SYSTEMS VIEW
|
| 67 |
+
|
| 68 |
+
In this section, we first provide a brief introduction to the dynamical systems view in which ResNets are considered as ODEs. Based on this view, we provide empirical analysis to explain some intriguing properties and phenomena of ResNets.
|
| 69 |
+
|
| 70 |
+
# 3.1 DYNAMICAL SYSTEMS VIEW
|
| 71 |
+
|
| 72 |
+
For the pre-activation ResNets $\mathbf { Y } _ { j + 1 } = \mathbf { Y } _ { j } + G ( \mathbf { Y } _ { j } , \pmb { \theta } _ { j } )$ , the residual module $G$ consists of two sets of batch normalization, ReLU and convolutional layers. Without loss of generality, we can conceptually add a parameter $h$ and rewrite the residual module as $G = h F$ . The residual block becomes
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
{ \displaystyle { \bf Y } _ { j + 1 } = { \bf Y } _ { j } + h F ( { \bf Y } _ { j } , { \boldsymbol { \theta } } _ { j } ) } ,
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 3: The average $L ^ { 2 }$ -norm of the residual modules γ vs the number of residual blocks $d$ . The curve resembles a reciprocal function, which is consistent with Eq. (5) and the dynamical systems view.
|
| 80 |
+
|
| 81 |
+
which can be further rewritten as
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\frac { { \bf Y } _ { j + 1 } - { \bf Y } _ { j } } { h } = F ( { \bf Y } _ { j } , \theta _ { j } ) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
For a sufficiently small $h$ , Eq. (3) can be regarded as a forward Euler discretization of the initial value ODE
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\dot { \mathbf { Y } } ( t ) = F ( \mathbf { Y } ( t ) , \theta ( t ) ) , \mathbf { Y } ( 0 ) = \mathbf { Y } _ { 0 } , \mathrm { f o r } 0 \leq t \leq T ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
where time $t$ corresponds to the direction from input to output, $\mathbf { Y } ( 0 )$ is the input feature map after the initial convolution, and $\mathbf { Y } ( T )$ is the output feature map before the softmax classifier. Thus, the problem of learning the network parameters, $\theta$ , is equivalent to solving a parameter estimation problem or optimal control problem involving the ODE in Eq. (4).
|
| 94 |
+
|
| 95 |
+
# 3.2 TIME STEP SIZE
|
| 96 |
+
|
| 97 |
+
The new parameter $h$ is called the step size of discretization. In the original formulation of ResNets in Eq. (1), $h$ does not exist, and is implicitly absorbed by the residual module $G$ . We call it the implicit step size. The step size $h$ can also be explicitly expressed in the model: the output of the residual module is multiplied by $h$ before being added to the identity mapping. In this case, $h$ is a hyper-parameter and we name it the explicit step size. In this section, we only consider implicit step size.
|
| 98 |
+
|
| 99 |
+
We assume that $\mathbf { Y } ( 0 )$ and $\mathbf { Y } ( T )$ correspond to the input and output feature maps of the network respectively, where the time length $T$ is fixed. As illustrated in Fig. 1, ResNets equally discretize $[ 0 , { \bar { T } } ]$ using time points $T _ { 0 } , T _ { 1 } , \dots , T _ { j } , \dots , T _ { d }$ , where $T _ { 0 } = 0$ , $T _ { d } = T$ and $d$ is the number of blocks. Thus each time step is $h = T _ { j + 1 } - T _ { j } = T / d$ .
|
| 100 |
+
|
| 101 |
+
Thus, we can obtain
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\| G ( \mathbf { Y } _ { j } ) \| = \| h F ( \mathbf { Y } _ { j } ) \| = { \frac { T } { d } } \| F ( \mathbf { Y } _ { j } ) \| ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $F$ in the underlying ODE in Eq. (4) does not depend on $d$ . In other words, $d$ is inversely proportional to the norm of the residual modules $G ( Y _ { j } )$ .
|
| 108 |
+
|
| 109 |
+
Empirical analysis To verify the above statement, we run experiments on ResNets with varying depths. If our theory is correct, the norm of the residual module $\| G ( \mathbf { Y } _ { j } ) \|$ should be inversely proportional to the number of residual blocks. Take ResNet-32 with 15 residual blocks in total as an example. We calculate the average $L ^ { 2 }$ -norm of the residual modules $\begin{array} { r } { \gamma = \frac { 1 } { 1 5 } \sum _ { j = 1 } ^ { 1 5 } \| G ( \mathbf { Y } _ { j } ) \| } \end{array}$ . Figure 3 shows $\gamma$ for different ResNet models. The curve resembles a reciprocal function, which is consistent with Eq. (5) and the dynamical system point of view.
|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 4: $L ^ { 2 }$ -norm of the input and output of the residual module $G$ . ResNet-110 models are trained on CIFAR-10 and CIFAR-100. The norms are evaluated at test time. It shows that within a residual block, the identity mapping contributes much more than the residual module. In other words, $G ( \mathbf { Y } _ { j } )$ is relatively small for most residual blocks.
|
| 113 |
+
|
| 114 |
+
# 3.3 LESION STUDY
|
| 115 |
+
|
| 116 |
+
Lesion studies for ResNets in Veit et al. (2016) remove single or multiple residual blocks, and shuffle the residual blocks at test time. Surprisingly, only removing downsampling blocks has a modest impact on performance, no other block removal leads to a noticeable effect.
|
| 117 |
+
|
| 118 |
+
According to the dynamical systems view, removing one residual block is equivalent to skipping one time step and squeezing two adjacent steps into one. This operation may change the dynamical system. However, we will show in the following that the effect is negligible when the output of residual module $G ( \mathbf { Y } _ { j } )$ is small enough.
|
| 119 |
+
|
| 120 |
+
Let $t _ { 0 } , t _ { 1 } , t _ { 2 }$ be three consecutive time points such that $t _ { 1 } = t _ { 0 } + h$ and $t _ { 2 } = t _ { 0 } + 2 h$ . Suppose the removed block corresponds to time point $t _ { 1 }$ . Before the removal of the time point, the discretization is
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r l } & { { \mathbf Y } ( t _ { 1 } ) = { \mathbf Y } ( t _ { 0 } ) + h F ( { \mathbf Y } ( t _ { 0 } ) ) , } \\ & { { \mathbf Y } ( t _ { 2 } ) = { \mathbf Y } ( t _ { 1 } ) + h F ( { \mathbf Y } ( t _ { 1 } ) ) = { \mathbf Y } ( t _ { 0 } ) + h F ( { \mathbf Y } ( t _ { 0 } ) ) + h F ( { \mathbf Y } ( t _ { 1 } ) ) . } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
After $t _ { 1 }$ is removed, the time interval $[ t _ { 0 } , t _ { 2 } ]$ is squeezed to $[ t _ { 0 } , t _ { 2 } ^ { \prime } ]$ , where $t _ { 2 } ^ { \prime } = t _ { 0 } + h$ is the new time point after $t _ { 0 }$ . The new discretization is
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathbf { Y } ( t _ { 2 } ^ { \prime } ) = \mathbf { Y } ( t _ { 0 } ) + h F ( \mathbf { Y } ( t _ { 0 } ) ) .
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
The difference of the feature before and after the removal operation is
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\mathbf { Y } ( t _ { 2 } ^ { \prime } ) - \mathbf { Y } ( t _ { 2 } ) = h F ( \mathbf { Y } ( t _ { 1 } ) ) ,
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
which is the output of the residual module $G ( \mathbf { Y } ( t _ { 1 } ) )$ . Therefore, the effect of removing the block is negligible when $\dot { G } ( \mathbf { Y } ( t _ { 1 } ) )$ is small.
|
| 139 |
+
|
| 140 |
+
Empirical analysis To empirically verify that $G ( \mathbf { Y } ( t ) )$ are small, we train a ResNet-110 model (3 stages with 18 residual blocks per stage) on CIFAR-10/100, and plot the $L ^ { 2 }$ -norm of input $\mathbf { Y } _ { j }$ and output $G ( \mathbf { Y } _ { j } )$ of each residual module at test time. As shown in Figure 4, except for the first block at each stage, later blocks have tiny residual module outputs $G ( \mathbf { Y } _ { j } )$ compared with the inputs $\mathbf { Y } _ { j }$ . This provides an explanation why removing one block does not notably impact the performance.
|
| 141 |
+
|
| 142 |
+
The effect of shuffling residual blocks can be analyzed in a similar way. When the outputs of the residual modules are small, each block only slightly modifies the feature map. Therefore, we can expect the effect of shuffling to be moderate, especially in later stages.
|
| 143 |
+
|
| 144 |
+
When the network is deep, the outputs of the residual modules are close to zero. Each residual module can be regarded as feature refinement. The magnitude of change is large only in the first block; the subsequent blocks only slightly refine the features, which is consistent with the unrolled iterative estimation view.
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 5: An illustration of the interpolation operation for one stage. We insert one residual block right after each existing block in the stage. The model parameters, including convolutional weights and batch normalization parameters, are copied from the adjacent old block to interpolated blocks. After that, the explicit step size $h$ is halved. For example, before interpolation, this stage has three residual blocks, numbered 1 to 3. After interpolation, block 1, 2 and 3 become block 1’, $_ { 3 } ,$ and $_ 5 '$ respectively. Three new blocks are inserted: block $2 ^ { \bullet }$ , $_ 4 \cdot$ and $\mathbf { \omega } _ { 6 } { \mathrm { : } }$ , whose parameters are copied from its previous block respectively.
|
| 148 |
+
|
| 149 |
+
<table><tr><td></td><td>#Residual Blocks</td><td>Explicit Step Size h# Training Steps</td><td></td></tr><tr><td>Cycle 1</td><td>2-2-2</td><td>1</td><td>N1</td></tr><tr><td>Cycle 2</td><td>4-4-4</td><td>0.5</td><td>N2</td></tr><tr><td>Cycle 3</td><td>8-8-8</td><td>0.25</td><td>N3</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 1: An illustration of the multi-level method with 3 cycles. The ResNet model has 3 stages; # Residual Blocks column represents the number of blocks in each stage. In cycle 1, the training starts with a 2-2-2 model using $h = 1$ . After $N _ { 1 }$ training steps, the first interpolation happens: the model becomes 4-4-4, and the step size is halved to 0.5. Similarly, $N _ { 2 }$ training steps later, the second interpolation doubles the number of blocks to 8-8-8 and halves $h$ to 0.25. Cycle 3 lasts for $N _ { 3 }$ training steps.
|
| 152 |
+
|
| 153 |
+
# 4 EFFICIENT TRAINING WITH MULTI-LEVEL METHOD
|
| 154 |
+
|
| 155 |
+
Given the connection between ResNets and ODEs, existing theories and numerical techniques for ODEs can be applied to ResNets. In numerical analysis, multi-grid methods (Hackbusch, 2013) are algorithms for solving differential equations using a hierarchy of discretizations with varying step sizes. Inspired by multi-grid methods, we propose the multi-level training method.
|
| 156 |
+
|
| 157 |
+
# 4.1 MULTI-LEVEL TRAINING
|
| 158 |
+
|
| 159 |
+
The idea of the multi-level method is, during training, we start with a shallow network using a large explicit step size $h$ . After a few training steps, we switch to a deeper network, by doubling the number of residual blocks and halving the step size to $h / 2$ . This operation is called interpolation, which applies to all the stages at the same time. Fig. 5 illustrates the interpolation operation for one stage. The interpolation operation inserts a new residual block right after every existing block, and copies the convolutional weights and batch normalization parameters from the adjacent old block to the new block.
|
| 160 |
+
|
| 161 |
+
In the multi-level training process, interpolations happen several times, thus dividing the training steps into cycles. Table 1 gives an example to illustrate this process. According to our dynamical systems view, by interpolating the residual blocks and halving the step size, we solve exactly the same differential equation. Therefore, the interpolation operation at the beginning of a cycle gives a good initialization of the parameters.
|
| 162 |
+
|
| 163 |
+
Each cycle itself can be regarded as a training process, thus we need to reset the learning rate to a large value at the beginning of each training cycle and anneal the learning rate during that cycle. Here we adopt the cosine annealing learning rate schedule (Loshchilov & Hutter, 2017). Within
|
| 164 |
+
|
| 165 |
+
Table 2: Number of interpolations vs theoretical time saved, relative to the full model. Theoretically, time saved is monotonically increasing as the number of interpolation increases, but the marginal benefit is diminishing.
|
| 166 |
+
|
| 167 |
+
<table><tr><td># Interpolations</td><td>0</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td></td></tr><tr><td>Theoretical TimeSaved</td><td>0%</td><td>25%</td><td>42%</td><td>53%</td><td>61%</td><td>67%</td><td>:</td></tr></table>
|
| 168 |
+
|
| 169 |
+
each cycle, the learning rate is
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\eta = \eta _ { \mathrm { m i n } } + \frac { 1 } { 2 } ( \eta _ { \mathrm { m a x } } - \eta _ { \mathrm { m i n } } ) ( 1 + \cos ( \frac { T _ { \mathrm { c u r } } } { T } \pi ) ) ,
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $\eta _ { \mathrm { m i n } }$ and $\eta _ { \mathrm { m a x } }$ represent the minimum and maximum learning rate respectively, $T _ { \mathrm { c u r } }$ accounts for how many training steps have been performed in the current cycle, and $T$ denotes the total number of training steps in this cycle. The learning rate starts from $\eta _ { \mathrm { m a x } }$ at the beginning of each cycle and decreases to $\eta _ { \mathrm { m i n } }$ at the end of the cycle.
|
| 176 |
+
|
| 177 |
+
# 4.2 TRAINING TIME
|
| 178 |
+
|
| 179 |
+
Since the number of residual blocks in cycle $i$ is half of that in cycle $i + 1$ , theoretically, the running time in cycle $i$ should also be half of that in cycle $i + 1$ . Take a multi-level method with two cycles as an example, it trains a shallow model (2-2-2 blocks) for $N$ steps and switches to a deep model (4-4-4 blocks) for another $N$ steps. Compared with the deep model trained for $2 N$ steps, the multi-level method reduces training time by $1 / 4$ .
|
| 180 |
+
|
| 181 |
+
More generally, if one uses the multi-level method with $k$ interpolations equally dividing the training steps, theoretically it saves $1 - \frac { 2 ^ { k + 1 } - 1 } { 2 ^ { k } ( k + 1 ) }$ of training time, compared to the full model (model in the last cycle) trained for the same number of total steps. Table 2 shows the theoretical time saved. Time saved is monotonically increasing as the number of interpolation increases, but the marginal time saved is diminishing. Furthermore, when the number of interpolations is large, each cycle might not have enough training steps. Therefore, there is a trade-off between efficiency and accuracy.
|
| 182 |
+
|
| 183 |
+
# 5 EXPERIMENTS
|
| 184 |
+
|
| 185 |
+
The empirical results on the dynamical systems view are presented in Sec. 3.2 and 3.3. In this section, we evaluate the efficacy and efficiency of the proposed multi-level method on two state-ofthe art deep learning architectures for image classification: ResNet and Wide ResNet, across three standard benchmarks.
|
| 186 |
+
|
| 187 |
+
Table 3: Main multi-level method results for ResNets with different depths. The model name with $i$ corresponds to the multi-level method. Our multi-level training method achieves superior or on-par accuracy with the last cycle model while saving about $40 \%$ of training time. The unit of training time is a minute.
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan=2 colspan=1>Model</td><td rowspan=2 colspan=1># Blocks</td><td rowspan=1 colspan=2>CIFAR-10</td><td rowspan=1 colspan=2>CIFAR-100</td><td rowspan=1 colspan=2>STL-10</td></tr><tr><td rowspan=1 colspan=1>Error</td><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Error</td><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Error</td><td rowspan=1 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>ResNet-14ResNet-50</td><td rowspan=1 colspan=1>2-2-28-8-8</td><td rowspan=1 colspan=1>9.75%7.58%</td><td rowspan=1 colspan=1>38m114m</td><td rowspan=1 colspan=1>33.34%28.64%</td><td rowspan=1 colspan=1>38m115m</td><td rowspan=1 colspan=1>27.78%25.95%</td><td rowspan=1 colspan=1>33m114m</td></tr><tr><td rowspan=1 colspan=1>ResNet-50-i (Ours)</td><td rowspan=1 colspan=1>2-2-2 to8-8-8</td><td rowspan=1 colspan=1>7.10%</td><td rowspan=1 colspan=1>67m</td><td rowspan=1 colspan=1>28.71%</td><td rowspan=1 colspan=1>68m</td><td rowspan=1 colspan=1>25.98%</td><td rowspan=1 colspan=1>68m</td></tr><tr><td rowspan=1 colspan=1>ResNet-32ResNet-122</td><td rowspan=1 colspan=1>5-5-520-20-20</td><td rowspan=1 colspan=1>7.74%6.47%</td><td rowspan=1 colspan=1>76m266m</td><td rowspan=1 colspan=1>29.96%26.74%</td><td rowspan=1 colspan=1>74m266m</td><td rowspan=1 colspan=1>26.02%25.16%</td><td rowspan=1 colspan=1>71m266m</td></tr><tr><td rowspan=1 colspan=1>ResNet-122-i (Ours)</td><td rowspan=1 colspan=1>5-5-5 to20-20-20</td><td rowspan=1 colspan=1>6.56%</td><td rowspan=1 colspan=1>154m</td><td rowspan=1 colspan=1>26.81%</td><td rowspan=1 colspan=1>154m</td><td rowspan=1 colspan=1>24.36%</td><td rowspan=1 colspan=1>162m</td></tr></table>
|
| 190 |
+
|
| 191 |
+
# 5.1 DATASETS AND NETWORKS
|
| 192 |
+
|
| 193 |
+
Datasets Three widely used datasets are used for evaluation: CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009), and STL10 (Coates et al., 2011). Details on these datasets and data augmentation methods can be found in Appendix A.
|
| 194 |
+
|
| 195 |
+
Networks We use ResNets (He et al., 2016) and Wide ResNets (Zagoruyko & Komodakis, 2016) for all the datasets. All the networks have three stages, with the number of filters equal to 16-32-64 for ResNets, and 32-64-128 for Wide ResNets.
|
| 196 |
+
|
| 197 |
+
# 5.2 EXPERIMENTAL SETTINGS
|
| 198 |
+
|
| 199 |
+
Based on the analysis in Table 2, we use two interpolations, that is three cycles, for the multi-level method in order to optimize the trade-off between efficiency and accuracy.
|
| 200 |
+
|
| 201 |
+
For each experiment, we run our multi-level model with three cycles. For comparison, two other models are trained for the same number of steps: a model with the same architecture as the first cycle and a model with the same architecture as the last cycle.
|
| 202 |
+
|
| 203 |
+
We call them first cycle model and last cycle model respectively. We also use the cyclic learning rate schedule (Loshchilov & Hutter, 2017) for the first cycle model and last cycle model for fair comparison.
|
| 204 |
+
|
| 205 |
+
All the models are trained for 160 epochs. For our multi-level method, the models are interpolated at the 60th and 110th epochs. For baseline models, the learning rate cycle also restarts at epoch 60 and 110. The maximum and minimum learning rates $\eta _ { \mathrm { m i n } }$ and $\eta _ { \mathrm { m a x } }$ are set 0.001 and 0.5 respectively. For CIFAR-10 and CIFAR-100 experiments, the mini-batch size is 100. For STL-10 experiments, the mini-batch size is 32. We use a weight decay of $2 \times 1 0 ^ { - 4 }$ , and momentum of 0.9. All the experiments are evaluated on machines with a single Nvidia GeForce GTX 1080 GPU. The networks are implemented using TensorFlow library (Abadi et al., 2016).
|
| 206 |
+
|
| 207 |
+
# 5.3 MAIN RESULTS AND ANALYSIS
|
| 208 |
+
|
| 209 |
+
We present the main results and analysis in this section. More experimental results can be found in Appendix D. The theoretical time saved for two interpolations is $42 \%$ , which is consistent with the experiment results.
|
| 210 |
+
|
| 211 |
+
The main results are shown in Table 3 and 4, for ResNets and Wide ResNets respectively. We report the test error rate and training time. Compared with the first cycle model, our multi-level method achieves much lower test error. Compared with the last cycle model, the test error is competitive or slightly lower, but the training time reduction is over $40 \%$ . This result applies to both ResNets and WResNets across three datasets. The interpolation of (Wide) ResNet-50-i from 2-2-2 to 8-8-8 and (Wide) ResNet-122-i from 5-5-5 to 20-20-20 show that our multi-level training method is effective for different network depths.
|
| 212 |
+
|
| 213 |
+
The train and test curves with both ResNets and Wide ResNets are shown in Fig. 6. Although both training and test accuracy temporarily drops at the start of each cycle, the performance eventually surpasses the previous cycles. ResNets and Wide ResNets have similar train and test curves, indicating that our multi-level training method is effective for different network widths.
|
| 214 |
+
|
| 215 |
+
# 6 CONCLUSION
|
| 216 |
+
|
| 217 |
+
In this work, we study ResNets from the dynamical systems view and explain the lesion studies from this view through both theoretical and empirical analyses. Based on these analyses, we develop a simple yet effective multi-level method for accelerating the training of ResNets. The proposed multi-level training method is evaluated on two state-of-the-art residual network architectures across three widely used classification benchmarks, reducing training time by more than $40 \%$ with similar accuracy. For future work, we would like to explore the dynamical systems view on other ResNets variants such as DenseNets.
|
| 218 |
+
|
| 219 |
+
<table><tr><td rowspan=2 colspan=1>Model</td><td rowspan=2 colspan=1># Blocks</td><td rowspan=1 colspan=2>CIFAR-10</td><td rowspan=1 colspan=2>CIFAR-100</td><td rowspan=1 colspan=2>STL-10</td></tr><tr><td rowspan=1 colspan=1>Error</td><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Error</td><td rowspan=1 colspan=1>Time</td><td rowspan=1 colspan=1>Error</td><td rowspan=1 colspan=1>Time</td></tr><tr><td rowspan=1 colspan=1>WResNet-14WResNet-50</td><td rowspan=1 colspan=1>2-2-28-8-8</td><td rowspan=1 colspan=1>7.38%5.87%</td><td rowspan=1 colspan=1>51m174m</td><td rowspan=1 colspan=1>27.92%24.49%</td><td rowspan=1 colspan=1>51m173m</td><td rowspan=1 colspan=1>24.58%23.82%</td><td rowspan=1 colspan=1>63m222m</td></tr><tr><td rowspan=1 colspan=1>WResNet-50-i (Ours)</td><td rowspan=1 colspan=1>2-2-2 to8-8-8</td><td rowspan=1 colspan=1>5.95%</td><td rowspan=1 colspan=1>101m</td><td rowspan=1 colspan=1>24.92%</td><td rowspan=1 colspan=1>101m</td><td rowspan=1 colspan=1>22.82%</td><td rowspan=1 colspan=1>131m</td></tr><tr><td rowspan=1 colspan=1>WResNet-32WResNet-122</td><td rowspan=1 colspan=1>5-5-520-20-20</td><td rowspan=1 colspan=1>6.29%5.38%</td><td rowspan=1 colspan=1>111m406m</td><td rowspan=1 colspan=1>25.32%23.11%</td><td rowspan=1 colspan=1>111m406m</td><td rowspan=1 colspan=1>23.51%22.00%</td><td rowspan=1 colspan=1>136m516m</td></tr><tr><td rowspan=1 colspan=1>WResNet-122-i (0urs)</td><td rowspan=1 colspan=1>5-5-5 to20-20-20</td><td rowspan=1 colspan=1>5.46%</td><td rowspan=1 colspan=1>239m</td><td rowspan=1 colspan=1>23.04%</td><td rowspan=1 colspan=1>237m</td><td rowspan=1 colspan=1>22.65%</td><td rowspan=1 colspan=1>307m</td></tr></table>
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Table 4: Main multi-level method results for Wide ResNets (WResNets) with different depths. The model name with i corresponds to the multi-level method. Our multi-level training method achieves superior or on-par accuracy with the last cycle model while saving about $40 \%$ of training time. The unit of training time is a minute.
|
| 223 |
+
Figure 6: Train and test curves using our multi-level method with ResNet-50-i and WResNet50-i on CIFAR-10/100. The models are interpolated at epoch 60 and 110, dividing the training steps to three cycles. Although both training and test accuracy temporarily drops at the start of each cycle, the performance eventually surpasses the previous cycles.
|
| 224 |
+
|
| 225 |
+
# REFERENCES
|
| 226 |
+
|
| 227 |
+
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.
|
| 228 |
+
|
| 229 |
+
Bo Chang, Lili Meng, Eldad Haber, Lars Ruthotto, David Begert, and Elliot Holtham. Reversible architectures for arbitrarily deep residual neural networks. arXiv preprint arXiv:1709.03698, 2017.
|
| 230 |
+
|
| 231 |
+
Kyunghyun Cho, Bart Van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Hol- ¨ ger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder-decoder for statistical machine translation. ACL, 2014.
|
| 232 |
+
|
| 233 |
+
Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, 2011.
|
| 234 |
+
|
| 235 |
+
Weinan E. A proposal on machine learning via dynamical systems. Communications in Mathematics and Statistics, 5(1):1–11, 3 2017.
|
| 236 |
+
|
| 237 |
+
Andre Esteva, Brett Kuprel, Roberto A Novoa, Justin Ko, Susan M Swetter, Helen M Blau, and Sebastian Thrun. Dermatologist-level classification of skin cancer with deep neural networks. Nature, 2017.
|
| 238 |
+
|
| 239 |
+
Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 2010.
|
| 240 |
+
|
| 241 |
+
Michael Figurnov, Maxwell D Collins, Yukun Zhu, Li Zhang, Jonathan Huang, Dmitry Vetrov, and Ruslan Salakhutdinov. Spatially adaptive computation time for residual networks. CVPR, 2017.
|
| 242 |
+
|
| 243 |
+
Aidan N Gomez, Mengye Ren, Raquel Urtasun, and Roger B Grosse. The reversible residual network: Backpropagation without storing activations. NIPS, 2017.
|
| 244 |
+
|
| 245 |
+
Klaus Greff, Rupesh K Srivastava, and Jurgen Schmidhuber. Highway and residual networks learn ¨ unrolled iterative estimation. In ICLR, 2017.
|
| 246 |
+
|
| 247 |
+
Caglar Gulcehre, Marcin Moczulski, Francesco Visin, and Yoshua Bengio. Mollifying networks. arXiv preprint arXiv:1608.04980, 2016.
|
| 248 |
+
|
| 249 |
+
Jung-Woo Ha, Hyuna Pyo, and Jeonghee Kim. Large-scale item categorization in e-commerce using multiple recurrent neural networks. In KDD, 2016.
|
| 250 |
+
|
| 251 |
+
Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. arXiv preprint arXiv:1705.03341, 2017.
|
| 252 |
+
|
| 253 |
+
Eldad Haber, Lars Ruthotto, and Elliot Holtham. Learning across scales-a multiscale method for convolution neural networks. arXiv preprint arXiv:1703.02009, 2017.
|
| 254 |
+
|
| 255 |
+
Wolfgang Hackbusch. Multi-grid methods and applications, volume 4. Springer Science & Business Media, 2013.
|
| 256 |
+
|
| 257 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. ICLR, 2017.
|
| 258 |
+
|
| 259 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 260 |
+
|
| 261 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask R-CNN. In ´ ICCV, 2017.
|
| 262 |
+
|
| 263 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
|
| 264 |
+
|
| 265 |
+
Gao Huang, Danlu Chen, Tianhong Li, Felix Wu, Laurens van der Maaten, and Kilian Q Weinberger. Multi-scale dense convolutional networks for efficient prediction. arXiv preprint arXiv:1703.09844, 2017a.
|
| 266 |
+
|
| 267 |
+
Gao Huang, Zhuang Liu, Kilian Q Weinberger, and Laurens van der Maaten. Densely connected convolutional networks. CVPR, 2017b.
|
| 268 |
+
|
| 269 |
+
Stanisław Jastrzebski, Devansh Arpit, Nicolas Ballas, Vikas Verma, Tong Che, and Yoshua Bengio. Residual connections encourage iterative inference. arXiv preprint arXiv:1710.04773, 2017.
|
| 270 |
+
|
| 271 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 272 |
+
|
| 273 |
+
Sihan Li, Jiantao Jiao, Yanjun Han, and Tsachy Weissman. Demystifying resnet. arXiv preprint arXiv:1611.01186, 2016.
|
| 274 |
+
|
| 275 |
+
Yuanzhi Li and Yang Yuan. Convergence analysis of two-layer neural networks with relu activation. NIPS, 2017.
|
| 276 |
+
|
| 277 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ´ ECCV, 2014.
|
| 278 |
+
|
| 279 |
+
Ilya Loshchilov and Frank Hutter. SGDR: Stochastic gradient descent with warm restarts. ICLR, 2017.
|
| 280 |
+
|
| 281 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. Wavenet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 282 |
+
|
| 283 |
+
Tobias Pohlen, Alexander Hermans, Markus Mathias, and Bastian Leibe. Full resolution image compression with recurrent neural networks. CVPR, 2017.
|
| 284 |
+
|
| 285 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. IJCV, 2015.
|
| 286 |
+
|
| 287 |
+
Sasha Targ, Diogo Almeida, and Kevin Lyman. Resnet in resnet: generalizing residual architectures. ICLR Workshop, 2016.
|
| 288 |
+
|
| 289 |
+
Andreas Veit, Michael J Wilber, and Serge Belongie. Residual networks behave like ensembles of relatively shallow networks. In NIPS, 2016.
|
| 290 |
+
|
| 291 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 292 |
+
|
| 293 |
+
Saining Xie, Ross Girshick, Piotr Dollar, Zhuowen Tu, and Kaiming He. Aggregated residual trans- ´ formations for deep neural networks. CVPR, 2017.
|
| 294 |
+
|
| 295 |
+
Wayne Xiong, Jasha Droppo, Xuedong Huang, Frank Seide, Mike Seltzer, Andreas Stolcke, Dong Yu, and Geoffrey Zweig. The microsoft 2016 conversational speech recognition system. In ICASSP, 2017.
|
| 296 |
+
|
| 297 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. BMVC, 2016.
|
| 298 |
+
|
| 299 |
+
Ligeng Zhu, Ruizhi Deng, Zhiwei Deng, Greg Mori, and Ping Tan. Sparsely connected convolutional networks. arXiv preprint arXiv:1801.05895, 2018.
|
| 300 |
+
|
| 301 |
+
# A DATASETS AND MODEL DETAILS
|
| 302 |
+
|
| 303 |
+
CIFAR-10 and CIFAR-100 The CIFAR-10 dataset (Krizhevsky & Hinton, 2009) consists of 50,000 training images and 10,000 testing images in 10 classes with $3 2 \times 3 2$ image resolution. The CIFAR100 dataset has the same number of training and testing images as CIFAR-10, but has 100 classes. We use the common data augmentation techniques including padding four zeros around the image, random cropping, random horizontal flipping and image standardization (Huang et al., 2016).
|
| 304 |
+
|
| 305 |
+
STL-10 The STL-10 dataset (Coates et al., 2011) is an image classification dataset with 10 classes with image resolutions of $9 6 \times 9 6$ . It contains 5,000 training images and 8,000 testing images. Compared with CIFAR-10/100, each class has fewer training samples but higher image resolution. We use the same data augmentation as the CIFAR-10/100 except for padding 12 zeros around the images.
|
| 306 |
+
|
| 307 |
+
Number of parameters We list the number of parameters for each model in Table 5.
|
| 308 |
+
|
| 309 |
+
Table 5: The number of parameters for each network model.
|
| 310 |
+
|
| 311 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1># Blocks</td><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>CIFAR-100</td><td rowspan=1 colspan=1>STL-10</td></tr><tr><td rowspan=1 colspan=1>ResNet-14</td><td rowspan=1 colspan=1>2-2-2</td><td rowspan=1 colspan=1>172,506</td><td rowspan=1 colspan=1>178,356</td><td rowspan=1 colspan=1>172,506</td></tr><tr><td rowspan=1 colspan=1>ResNet-50</td><td rowspan=1 colspan=1>8-8-8</td><td rowspan=1 colspan=1>755,802</td><td rowspan=1 colspan=1>761,652</td><td rowspan=1 colspan=1>755,802</td></tr><tr><td rowspan=1 colspan=1>ResNet-32</td><td rowspan=1 colspan=1>5-5-5</td><td rowspan=1 colspan=1>464,154</td><td rowspan=1 colspan=1>470,004</td><td rowspan=1 colspan=1>464,154</td></tr><tr><td rowspan=1 colspan=1>ResNet-122</td><td rowspan=1 colspan=1>20-20-20</td><td rowspan=1 colspan=1>19,22,394</td><td rowspan=1 colspan=1>1,928,244</td><td rowspan=1 colspan=1>19,22,394</td></tr><tr><td rowspan=1 colspan=1>WResNet-14</td><td rowspan=1 colspan=1>2-2-2</td><td rowspan=1 colspan=1>685,994</td><td rowspan=1 colspan=1>697,604</td><td rowspan=1 colspan=1>685,994</td></tr><tr><td rowspan=1 colspan=1>WResNet-50</td><td rowspan=1 colspan=1>8-8-8</td><td rowspan=1 colspan=1>3,013,802</td><td rowspan=1 colspan=1>3,025,412</td><td rowspan=1 colspan=1>3,013,802</td></tr><tr><td rowspan=1 colspan=1>WResNet-32</td><td rowspan=1 colspan=1>5-5-5</td><td rowspan=1 colspan=1>1,849,898</td><td rowspan=1 colspan=1>1,861,508</td><td rowspan=1 colspan=1>1,849,898</td></tr><tr><td rowspan=1 colspan=1>ResNet-122</td><td rowspan=1 colspan=1>20-20-20</td><td rowspan=1 colspan=1>7,669,418</td><td rowspan=1 colspan=1>7,681,028</td><td rowspan=1 colspan=1>7,669,418</td></tr></table>
|
| 312 |
+
|
| 313 |
+
# B IMPLEMENTATION DETAILS
|
| 314 |
+
|
| 315 |
+
Interpolation Figure 5 gives a conceptual illustration of the interpolation operation. When implementing this operation, the first block in each stage requires special treatment. The first block changes the size of the feature map and the number of channels, thus the shapes of convolution and batch normalization parameters are different from those in subsequent blocks. As a result, we cannot simply copy the parameters from block $_ { 1 } \cdot$ to block $_ { 2 } \cdot$ . Instead, the parameters of block $_ { 2 } \cdot$ are copied from block $_ { 3 } ,$ .
|
| 316 |
+
|
| 317 |
+
# C FURTHER ANALYSIS OF TIME STEP SIZE
|
| 318 |
+
|
| 319 |
+
Instead of using $h$ as an implicit step size in Sec. 3.2, we can also explicitly express it in the model. That is, a residual block represents the function $F$ instead of $G$ , and $h$ becomes a hyperparameter of the model. In other words, in each residual block, the output of the residual module is multiplied by $h$ before being added to the identity mapping. Now $h$ is the explicit step size that we can control. This enables us to verify the claim that the depth of the network does not affect the underlying differential equation.
|
| 320 |
+
|
| 321 |
+
Empirical analysis We run the following experiments on CIFAR-10 and CIFAR-100:
|
| 322 |
+
|
| 323 |
+
• ResNet-32: 15 blocks with $h = 1$ ;
|
| 324 |
+
• ResNet-62: 30 blocks with $h = 0 . 5$ ;
|
| 325 |
+
• ResNet-122: 60 blocks with $h = 0 . 2 5$ ;
|
| 326 |
+
|
| 327 |
+
According to our theory, those three models are different discretizations of the same differential equation in Eq. (2). As a result, the function values $F ( t )$ should be roughly the same across the time interval $[ 0 , T ]$ , which is discretized to 15, 30 and 60 time steps respectively. In Figure 7, we plot the $L ^ { 2 }$ -norm of the residual blocks $F ( \mathbf { Y } _ { j } )$ and scale the block number to the corresponding conceptual time points. It can be seen from the figure that the three curves follow the same trend, which represents the underlying function $F ( t )$ .
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 7: Comparison of $\| F ( \mathbf { Y } _ { j } ) \|$ among three models: (1) ResNet-32 with $h = 1$ , (2) ResNet-62 with $h = 0 . 5$ , (3) ResNet-122 with $h = 0 . 2 5$ . If the dynamical systems view is correct, the three curves should approximately follow the same trend.
|
| 331 |
+
|
| 332 |
+
# D MORE EXPERIMENTAL RESULTS
|
| 333 |
+
|
| 334 |
+
Train and test curves on STL-10 We show the train and test curves using our multi-level training method on ResNet-50-i and Wide ResNet-50-i on STL10 in Fig. 8.
|
| 335 |
+
|
| 336 |
+
Effect of learning rate To study the effect of $\eta _ { \mathrm { m a x } }$ and $\eta _ { \mathrm { m i n } }$ on the cyclic learning rate in Eq. (9), we plot their effect on test accuracy in Fig. 9. We empirically find that $\eta _ { \mathrm { m a x } } = 0 . 5$ and $\eta _ { \mathrm { m i n } } = 0 . 0 0 1$ achieve the best accuracy. With the increase of maximum learning rate $\eta _ { \mathrm { m a x } }$ , the test accuracy increases first and then decreases. A potential explanation is that with a small learning rate, the system learns slowly, while with a high learning rate, the system contains too much kinetic energy and is unable to reach the deeper and narrower parts of the loss function.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 8: Train and test curves using our multi-level method with ResNet-50-i and WResNet50-i on STL10. Although both training and testing accuracy temporarily drops at the start of each cycle, the performance eventually surpasses the previous cycles.
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
Figure 9: Effect of $\eta _ { \mathrm { m a x } }$ and $\eta _ { \mathrm { m i n } }$ in cyclic learning rate. In most cases, as $\eta _ { \mathrm { m a x } }$ increases, the testing accuracy increases first and then decreases.
|
| 343 |
+
|
| 344 |
+
Effect of resetting the learning rate To study the effect of resetting the learning rate at the beginning of each cycle, we also run the multi-level training method without resetting the learning rate, that is to use Eq. 9 throughout all cycles. The experiment setting is the same as described in Section 5.2. We train Resnet-50-i on CIFAR-10, CIFAR-100 and STL-10. Each setting is repeated 10 times to obtain the confidence intervals. Fig. 10 shows the results: resetting the learning rate at the beginning of each cycle gives better validation accuracy.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 10: Effect of resetting the learning rate. Resetting the learning rate at the beginning of each cycle gives better validation accuracy.
|
| 348 |
+
|
| 349 |
+
Comparison with shallow and deep ResNets Fig. 11 shows that training accuracy curves for a shallow ResNet (same depth as the starting model) and a deep ResNet (same depth as the final model).
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 11: Shallow and deep ResNets. Training accuracy curves for a shallow ResNet (same depth as the starting model) and a deep ResNet (same depth as the final model).
|
md/train/SygGlIBcel/SygGlIBcel.md
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OPENING THE VOCABULARY OF NEURAL LANGUAGE MODELS WITH CHARACTER-LEVEL WORD REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Matthieu Labeau LIMSI-CNRS / Orsay, France labeau@limsi.fr
|
| 4 |
+
|
| 5 |
+
Alexandre Allauzen LIMSI-CNRS / Orsay, France allauzen@limsi.fr
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
This paper introduces an architecture for an open-vocabulary neural language model. Word representations are computed on-the-fly by a convolution network followed by pooling layer. This allows the model to consider any word, in the context or for the prediction. The training objective is derived from the NoiseContrastive Estimation to circumvent the lack of vocabulary. We test the ability of our model to build representations of unknown words on the MT task of IWSLT2016 from English to Czech, in a reranking setting. Experimental results show promising results, with a gain up to 0.7 BLEU point. They also emphasize the difficulty and instability when training such models with character-based representations for the predicted words.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Most of neural language models, such as $n$ -gram models Bengio et al. (2003) are word based and rely on the definition of a finite vocabulary $\nu$ . As a consequence, a Look-up table is associated to $\nu$ in which each word $w \in \mathcal { V }$ is mapped to a vector of $d _ { E }$ real valued features stored in a matrix $\mathbf { L } \in \mathbb { R } ^ { | \mathcal { V } | * d _ { E } }$ . While this approach has proven successful for a variety of tasks and languages, see for instance Schwenk (2007) in speech recognition and Le et al. (2012); Devlin et al. (2014); Bahdanau et al. (2014) in machine translation, it induces several limitations.
|
| 14 |
+
|
| 15 |
+
For morphologically-rich languages, like Czech or German, the lexical coverage is still an important issue, since there is a combinatorial explosion of word forms, most of which are hardly observed on training data. On the one hand, growing the Look-up table is not a solution, since it would increase the number of parameters without having enough training example for a proper estimation. On the other hand, rare words can be replaced by a special token. Nevertheless, this acts as a word class merging very different words without any distinction and using different word classes to handle outof-vocabulary words Allauzen & Gauvain (2005) does not really solve this issue, since rare words are difficult to classify.
|
| 16 |
+
|
| 17 |
+
Moreover, for most inflected or agglutinative forms, as well as for compound words, the word structure is overlooked, wasting parameters for modeling forms that could be more efficiently handled by word decomposition. While the use of subword units Botha & Blunsom (2014); Sennrich et al. (2016) could improve the generalization power of such models, it relies on a proper and efficient method to induce these subword units.
|
| 18 |
+
|
| 19 |
+
To overcome these issues, we propose to investigate a word based language model with an open vocabulary. Since most of existing models and training criteria rely on the assumption of a finite vocabulary, the definition of an open vocabulary model, along with a training criterion, constitutes a scientific challenge. Our goal is to build word representations every words. Word representations are inferred on-the-fly from its character sequence, using convolution filters which implicitly capture subword patterns, as described in section 2. The architecture is based on a neural ngram model inspired from Bengio et al. (2003), while this idea can be extended to other kind of models. By relaxing the normalized constraint, the objective function borrows from the noise contrastive estimation Gutmann & Hyvarinen (2012) to allow our model to consider a possibly infinite vocabulary. ¨ This paper focusses on this challenge and its related training issues. To assess the efficiency of this approach, the experimental setup described in section 3 uses a large scale translation task in a reranking setting. The experimental results summarized in section 4 show promising results as well as training issues.
|
| 20 |
+
|
| 21 |
+
# 2 MODEL DESCRIPTION
|
| 22 |
+
|
| 23 |
+
Word embeddings are parameters, stored in a Look-up matrix L. The embedding ${ \bf e } _ { w } ^ { w o r d }$ of a word $w$ is simply the column of $\mathbf { L }$ corresponding to its index in the vocabulary:
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\mathbf { e } _ { w } ^ { w o r d } = [ \mathbf { L } ] _ { w }
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
# 2.1 CHARACTER-LEVEL WORD EMBEDDINGS
|
| 30 |
+
|
| 31 |
+
To infer a word embedding from its character embeddings, we use a convolution layer Waibel et al. (1990); Collobert et al. (2011), similar to layers used in Santos & Zadrozny (2014); Kim et al. (2015). As illustrated in figure 1, a word $w$ is a character sequence $\{ c _ { 1 } , . . , c _ { | w | } \}$ represented by their embeddings $\{ \mathbf { C } _ { c _ { 1 } } , . . , \mathbf { C } _ { c _ { | w | } } \}$ , where $\mathbf { C } _ { c _ { i } }$ denotes the vector associated to the character $c _ { i }$ . A convolution filter $\mathbf { W } ^ { c o n v } \in \mathbb { R } ^ { d _ { e } } \times \mathbb { R } ^ { d _ { c } \ast n _ { c } }$ is applied over a sliding window of $n _ { c }$ characters, producing local features :
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
x _ { n } = { \bf W } ^ { c o n v } ( { \bf C } _ { c _ { n - n _ { c } + 1 } } : . . : { \bf C } _ { c _ { n } } ) ^ { T } + { \bf b } ^ { c o n v }
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $x _ { n }$ is a vector of size $d _ { e }$ obtained for each position $n$ in the word1. The notation $( \mathbf { C } _ { c _ { n - 1 } } : \mathbf { C } _ { c _ { n } } )$ denotes the concatenation of two embeddings. The $i$ -th element of the embedding of $w$ is the mean over the $i$ -th elements of the feature vectors, passed by the activation function $\phi$ :
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
[ { \bf e } ^ { c h a r } ] _ { i } = \phi \left( \sum _ { n = 1 } ^ { | w | - n _ { c } + 1 } \frac { [ { \bf x } _ { n } ] _ { i } } { | w | - n _ { c } + 1 } \right)
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Using a mean after a sliding convolution window ensures that the embedding combines local features from the whole word, and that the gradient is redistributed at scale for each character $\mathbf { n }$ -gram. The parameters of the layer are the matrices $\mathbf { C }$ and ${ \bf W } ^ { c o n v }$ and the bias $\mathbf { b } ^ { c o n v }$ .
|
| 44 |
+
|
| 45 |
+
# 2.2 MODELS
|
| 46 |
+
|
| 47 |
+
Our model follows the classic $\mathbf { n }$ -gram feedforward architecture. The input of the network is a $n$ - words context $H _ { i } = ( w _ { i - 1 } , \dots , w _ { N - i + 1 } )$ , and its output the probability $P ( w | H _ { i } )$ for each word $w \in \mathcal V$ . The embeddings of the word in the context are concatenated and fed into a hidden layer:
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mathbf { h } ^ { H _ { i } } = \phi ( \mathbf { W } ^ { h i d d e n } ( \mathbf { e } _ { i - 1 } : . . . : \mathbf { e } _ { N - i + 1 } ) + \mathbf { b } ^ { h i d d e n } )
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
A second hidden layer my be added. Finally, the output layer computes scores for each word:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { s } ^ { H _ { i } } = \exp \left( \mathbf { W } ^ { o u t } \mathbf { h } ^ { H _ { i } } + \mathbf { b } ^ { o u t } \right)
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Whidden, $\mathbf { b } ^ { h i d d e n }$ , ${ \bf W } ^ { o u t }$ and $\mathbf { b } ^ { o u t }$ are the parameters of the model. As the input Lookup-matrix $\mathbf { L }$ , the output weight matrix ${ \bf W } ^ { o u t }$ contains word embeddings, that are output representations of the words in the vocabulary:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbf { e } _ { w } ^ { o u t } = [ \mathbf { W } ^ { o u t } ] _ { w }
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Then, the output probabilities are expressed as:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
P ( w | H _ { i } ) = \frac { \exp { \mathbf { e } _ { w } ^ { o u t } } \mathbf { h } ^ { H _ { i } } } { \displaystyle \sum _ { 1 < j < | \mathcal { V } | } \exp { \mathbf { e } _ { j } ^ { o u t } } \mathbf { h } ^ { H _ { i } } }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Later, we will use three different input layer to obtain word representations:
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 1: CWE Model architecture
|
| 75 |
+
|
| 76 |
+
• A classic NLM using word-level embeddings only, that we will note WE, which uses $| \nu | *$ $d _ { e }$ parameters.
|
| 77 |
+
• A NLM using embeddings constructed from character n-grams by convolution $^ +$ pooling, that we will note CE, which uses $| \mathcal { V } _ { c } | \ast d _ { c } + d _ { c } \ast n _ { c } \ast d _ { e }$ parameters.
|
| 78 |
+
• A NLM using a concatenation of these two types of embeddings as word representation, that we will note CWE.
|
| 79 |
+
|
| 80 |
+
# 2.3 OBJECTIVE FUNCTION FOR OPEN VOCABULARY MODELS
|
| 81 |
+
|
| 82 |
+
Usually, such a model is trained by maximizing the log-likelihood. For a given word given its context, the model parameters $\theta$ are estimated in order to maximize the following function for all the n-grams observed in the training data:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
L L ( \theta ) = \sum _ { 1 < i < | D | } \log P _ { \theta } ( w _ { i } | H _ { i } ) .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
This objective function raises two important issues. For conventional word models, it implies a very costly summation imposed by the softmax activation of the output layer. More importantly, this objective requires the definition of a finite vocabulary, while the proposed model may use characterbased word embeddings, especially at the output, making the notion of vocabulary obsolete.
|
| 89 |
+
|
| 90 |
+
Therefore, the parameters estimation relies on Noise Contrastive Estimation (NCE) introduced in Gutmann & Hyvarinen (2012); Mnih & Teh (2012). This criterion allows us to train both types ¨ of models based on conventional word embeddings, along with character-based embeddings. The NCE objective function aims to discriminate between examples sampled from the real data and from a noise distribution. When presented with examples coming from a mixture of one sample from the data distribution $P _ { d }$ and $k$ from the noise distribution $P _ { n }$ , $\bar { P } ^ { H } ( w \in \mathcal { D } )$ denotes the posterior probability of a word $w$ given its context $H$ to be sampled from the training data $\mathcal { D }$ . This probability can be expressed as follows:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
P ^ { H } ( w \in \mathcal { D } ) = \frac { P _ { d } ^ { H } ( w ) } { P _ { d } ^ { H } ( w ) + k P _ { n } ( w ) }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
As suggested in Mnih & Teh (2012), $P _ { n }$ only depends on $w$ here, since we chose the unigram distribution estimated on the training data. If
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
s _ { \theta } ^ { H } ( w ) = \exp \left( \mathbf { e } ^ { o u t } \mathbf { h } ^ { H } + \mathbf { b } ^ { o u t } \right)
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
denotes the non-normalized score given by the model to a specific word $w$ , as a function of the parameters $\theta$ and the context $H$ , the final NCE objective function has the following form Gutmann
|
| 103 |
+
|
| 104 |
+
& Hyvarinen (2012): ¨
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
J _ { \theta } ^ { H } = E _ { s _ { \theta } ^ { H } } \left[ l o g \frac { s _ { \theta } ^ { H } ( w ) } { s ^ { H } ( w ) + k P _ { n } ( w ) } \right] + k E _ { P _ { n } } \left[ l o g \frac { k P _ { n } ( w ) } { s _ { \theta } ^ { H } ( w ) + k P _ { n } ( w ) } \right] ,
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $s _ { \theta } ^ { H }$ will tend to $P _ { d } ^ { H }$ without the need for an explicit normalization.
|
| 111 |
+
|
| 112 |
+
# 2.4 CHARACTER-BASED OUTPUT WEIGHTS WITH NOISE-CONTRASTIVE ESTIMATION
|
| 113 |
+
|
| 114 |
+
The output weights representing each word in the vocabulary $\mathbf { e } ^ { o u t }$ can also be replaced by embeddings computed by a convolution layer on character $n$ -grams. In this case the model can efficiently represent and infer a score to any word, observed during the training process or not, while with conventional word embeddings, out of vocabulary words only share the same representation and distribution. Instead of using a parameter matrix ${ \bf W } ^ { o u t }$ to estimate the score like in equation 2, the output representation of a word $w$ , $\mathbf { e } _ { w } ^ { o u t }$ can be replaced by a vector $\mathbf { e } _ { w } ^ { c h a r - o u t }$ estimated on the fly based on its character sequence as described in equation 1, using $| \mathcal { V } _ { c } | \ast d _ { c } + d _ { c } \ast n _ { c } \ast d _ { h }$ parameters. With this extension the model does not rely on a vocabulary anymore, hence motivating our choice of the NCE. This unnormalized objective allows us to handle an open vocabulary, since we only need to compute $k + 1$ word representations for each training examples. Models that use character-based embeddings both for input and output words are denoted by CWE-CWE.
|
| 115 |
+
|
| 116 |
+
Moreover, with this extension, the representations of words sharing character $n$ -grams are tied. This is an important property to let the model generalize to unseen words. However, it can be also an issue: the limited number of updates for output representations $\boldsymbol { k } + \boldsymbol { 1 }$ words) has a “rich get richer” effect: the most frequent words are usually short and will get most of the update. They may therefore ”contaminate” the representation of longer words with which they share character $n$ -grams, even if these words are not related. This issue is further addressed in section 4.1.
|
| 117 |
+
|
| 118 |
+
# 3 EXPERIMENTAL SET-UP
|
| 119 |
+
|
| 120 |
+
The impact of the models described in section 2 is evaluated within the machine translation (MT) shared task of IWSLT- $2 0 1 6 ^ { 2 }$ from Englih to Czech. This language pair is highly challenging since Czech is a morphologically-rich language. Neural language models are integrated in a two steps approach: the first step uses a conventional MT system to produce an $n$ -best list (the $n$ most likely translations); in the second step, these hypothesis are re-ranked by adding the score of the neural language model. To better benefit from the open vocabulary models introduced in section 2.1, a more complex system is also used: first an MT system is used to translate from English to a simplified form of Czech which is reinflected. With this pipeline we expect $n$ -best lists with more diversity and also words unseen during the training process. The neural language models are then used to re-rank the reinflected $n$ -best lists.
|
| 121 |
+
|
| 122 |
+
# 3.1 DATA
|
| 123 |
+
|
| 124 |
+
The IWSLT16 MT task is focused on the translation of TED talks. The translation systems are trained on parallel data from the TED, QED and europarl. Our Neural language models are trained on the same data, but training examples are sampled from these corpora given weights that are computed to balance between in-domain parallel data (TED), out-of domain parallel data, and additional monolingual data. Finally, we use the concatenation of TED.dev2010, TED.dev2011 and TED.tst2010 as development set, while TED.tst2012 and TED.tst2013 provide the test set.
|
| 125 |
+
|
| 126 |
+
# 3.2 CZECH RE-INFLECTION
|
| 127 |
+
|
| 128 |
+
In Czech, a morphologically rich language, each lemma can take a lot of possible word forms. Most of them won’t appear - or with a very low frequency - in training data. For an important part of the words found in test data and unseen during training, their lemmas however can be observed but with a different morphological derivation.
|
| 129 |
+
|
| 130 |
+
A non-observed word form can’t be generated by the translation system, and one seen too rarely won’t be used in a relevant way. To circumvent this limitation, in a similar fashion as the method described in Marie et al. (2015), each noun, pronoun and adjective is replaced in the training corpora by its lemma along with some morphological features. These word forms are considered in factored way, where some of the POS tags are discarded to reduce the vocabulary. After the translation process, a cascade of Conditional Random Fields (CRF) are used to reintroduce the discarded features, such as gender, number and case, and to generate a new word form.
|
| 131 |
+
|
| 132 |
+
Formally, the MT system translates English into a simplified version of Czech, that is reinflected. Within this process, the MT system can produce a $n$ -best list, that can be extended to a $n k$ -best list, considering for each translation hypothesis the $k$ -best reinflected sentences given by the factorized CRF. Intuitively, this process can introduce word forms potentially not yet seen in training data, but based on known paradigms, which can give an advantage to language models able to build a word representation from character $n$ -grams.
|
| 133 |
+
|
| 134 |
+
# 3.3 BASELINE TRANSLATION SYSTEM
|
| 135 |
+
|
| 136 |
+
Our baseline is built with a Statistical Machine Translation system based on bilingual n-grams, NCODE3, described in Crego et al. (2011). We follow the same setup as in Marie et al. (2015).
|
| 137 |
+
|
| 138 |
+
# 3.4 NLM TRAINING AND OPTIMIZATION
|
| 139 |
+
|
| 140 |
+
First, some comparative experiments on a smaller dataset are carried out to better understand how open vocabulary NLM behave and to set the hyper-parameters. First trained using stochastic gradient descent, we observed a quite unstable training process, restricting a proper hyper-parameters choices. We found that especially the embedding dimensions, and the activation functions used could make the NCE-objective hard to optimize. This was aggravated in Czech, which we found more difficult to work with than other morphologically complex languages, like German and Russian. The use of Adagrad Duchi et al. (2010) clearly helps to solve most of these issues, but adds consequent computation time. Following preliminary results on our work with a similar model on a different task Labeau et al. (2015), we made the choice of not implementing LSTMs to obtain character-level word representations. It gave similar results, at the cost of unstable training and extended computation time. We then train using batches of 128, for various context sizes, WE, CWE, and CWE-CWE models. The ReLu activation function is used, along with an embedding size of $d _ { e } = 1 2 8$ . When relevant, we used a character embedding size of $d _ { c } = 3 2$ and a convolution on $n _ { c } = 5$ -grams of characters for all experiments4. Concerning the NCE training, we sampled $k = 2 5$ examples from the unigram distribution obtained from the training data, for each example sampled from the data. The models were implemented using $C { + + } ^ { 5 }$ .
|
| 141 |
+
|
| 142 |
+
# 3.5 RERANKING
|
| 143 |
+
|
| 144 |
+
The re-ranking step uses additional features to find a better translation among the $n$ -best generated by the decoder (in our case, $n = 3 0 0$ ): we use the score (probability) of WE, CWE and CWECWE models given to each sentence by our models as such a feature. Tuning for re-ranking was performed with KB-MIRA Cherry & Foster (2012), and evaluation using BLEU score.
|
| 145 |
+
|
| 146 |
+
# 4 EXPERIMENTAL RESULTS
|
| 147 |
+
|
| 148 |
+
The first set of experiments investigates the impact of the padding design on the character-level representation followed by a study of the learning behavior of our proposed models and training criterion. Then, the proposed models are evaluated within the MT task. The final set of experiments analyzes the issues of the model based on character-level representation for output words, in order to propose remedies.
|
| 149 |
+
|
| 150 |
+
Preliminary results on smaller dataset are quite poor for models using character-level representation, and far worse when used for the output layer. We suspect that groups of characters are updated far more together, yielding a ”contamination” of several character n-grams by very frequent short words.
|
| 151 |
+
|
| 152 |
+
Indeed, our simple padding scheme, as shown in the left part of table 1, makes words sharing first or last letter(s) systematically share at least one character n-gram: we suppose it gives the models more chance to detect similarities in word forms sharing prefixes and suffixes.
|
| 153 |
+
|
| 154 |
+
The representations of any of the character n-grams that are included in the frequent words will thus be re-used in a large part of the other words in the corpus. A huge number of word forms are affected: a little more than one third of the training data shares its first character n-gram with one of the ten most frequent words, and a little more than one quarter shares its last.
|
| 155 |
+
|
| 156 |
+
While considering varying size of character n-grams when building our word representation, as in Kim et al. (2015), would certainly help, it would increase our computation time. We thus choose to alleviate our padding scheme, as shown on the right part of table 1. We add only one character token at the beginning of the word, and one at the end6. While it may inhibit the capacity of the model to build links between words sharing prefixes or suffixes, it improves results drastically, especially when using character-level outputs, as shown in figure 3. This limited padding scheme is used for the following experiments.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>。。。。a·…</td><td colspan="2">ooa..</td></tr><tr><td>ooooa oooon e</td><td>oale. a.</td><td>oona.</td></tr><tr><td>ooooa OOOON by oooobyl</td><td>oaby·</td><td>ooza.</td></tr><tr><td>ooooa 之</td><td>a ooax.</td><td>obyla.</td></tr><tr><td>ooooa1 ni.... oooodva..</td><td>oani.</td><td>odua.</td></tr><tr><td>ooooa si....</td><td>ooootreba. oasi. 1</td><td>otreba.</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 1: Padding for word decomposition in character 5-grams: $\circ$ is a character token indicating the beginning of the word, while $\bullet$ indicates the end of the word. The left part of the table shows our original padding scheme, which makes very different words share character 5-grams, especially with short, frequent words. The right part of the table shows our alleviated padding scheme.
|
| 161 |
+
|
| 162 |
+
# 4.2 NLM TRAINING
|
| 163 |
+
|
| 164 |
+
While the perplexity of our language models is not our main focus, it is still related to the quantity that our training seeks to optimize - since the NCE gradient approaches the maximum likelihood gradient Mnih & Teh (2012). On figure 2 are shown perplexity values of each model during training. These values are based on a vocabulary containing the 250K most frequent words on the training data - it is also the vocabulary used in the model when relevant. They are computed on the development set after each epoch. An epoch includes 2,5M N-grams sampled from the training data. On table 2 are shown the best perplexity obtained on the development set by each model, during training.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Context size (Number of words)</td><td>3</td><td>6</td></tr><tr><td>WE</td><td>227</td><td>193</td></tr><tr><td>CWE</td><td>207</td><td>185</td></tr><tr><td>CWE-CWE</td><td>308</td><td>243</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 2: Best perplexity reached on the development set, on a 250K output vocabulary, after 15 epochs of 2,5M n-grams
|
| 169 |
+
|
| 170 |
+
Table 2 shows that a character-level word representation helps to decrease the perplexity, even if a larger context closes the gap. To compute the perplexity of CWE-CWE models, we use the
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 2
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3
|
| 177 |
+
|
| 178 |
+
Figure 4: Model perplexity measured on the development set during training. The context size is 3 words. Figure 3 shows models based on character-level word representations, with and without complete padding. Models are trained on the same data than Figure 2 but on smaller epochs (250K n-grams).
|
| 179 |
+
|
| 180 |
+
same vocabulary as for other models, and use the ’unknown’ tokens for words and characters-based representations. Hence, the perplexity computed is difficult to interpret. The main downside of Adagrad is that the learning rate determined by accumulating the history of past gradients is usually too aggressive and stops learning rather early. We simply reset this history every five epochs to give the model a chance to improve, which explains the flattening followed by small improvements we see for WE and CWE models. We choose to do that reset 2 times, based on previous experiments. Despite adaptive gradient, training of CWE-CWE models stays unstable.
|
| 181 |
+
|
| 182 |
+
# 4.3 RERANKING
|
| 183 |
+
|
| 184 |
+
Table 3: Best BLEU score obtained after n-best reranking of the hypothesis given by the translation and translation $+ \mathrm { k }$ -best reinflection systems. $n$ is the context size (in number of words)
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">System to be re-ranked</td><td rowspan="2">BLEU Reference</td><td colspan="2">CWE</td><td colspan="2">CWE-CWE</td><td colspan="2">WE</td></tr><tr><td>n=3</td><td>n=6</td><td>n=3</td><td>n=6</td><td>n=3</td><td>n=6</td></tr><tr><td>En→Cz</td><td>Baseline system</td><td>19.6</td><td>20.1</td><td>20.3</td><td>19.8</td><td>20.0</td><td>20.0</td><td>20.2</td></tr><tr><td rowspan="3">En → Simplified Cz</td><td>Reinflected baseline system</td><td rowspan="3">19.5</td><td>20.0</td><td>20.2</td><td>19.6</td><td>20.1</td><td>20.1</td><td>20.0</td></tr><tr><td>3-best Reinflected baseline system</td><td>19.9</td><td>20.3</td><td>19.6</td><td>20.0</td><td>20.1</td><td>20.1</td></tr><tr><td>5-best Reinflected baseline system</td><td>19.9</td><td>20.3</td><td>19.5</td><td>19.9</td><td>20.0</td><td>20.1</td></tr></table>
|
| 187 |
+
|
| 188 |
+
The reranking results are shown in table 3. The first line corresponds to experiments with a direct translation from English to Czech, where $n$ -best lists generated by the MT system are simply rescored by our models. The best result is given by the longest-context CWE model, which produces a $\mathbf { + 0 . 7 }$ BLEU score improvement. CWE models gives on average $+ 0 . 1$ BLEU point compared to WE models, while CWE-CWE are $- 0 . 2$ BLEU point under. Doubling the context size consistently improves results of $+ 0 . 2$ BLEU point.
|
| 189 |
+
|
| 190 |
+
Experimental results on reinflected Czech seems to follow a similar trend: CWE models behave a little better than WE models, while CWE-CWE models are under. While simply reranking $n$ -best lists is not as efficient as doing it directly in Czech, reranking $n k$ -best lists extended by the factorized CRF gives a small improvement, reaching an improvement of $\mathbf { + 0 . 7 }$ BLEU point. As a general rule, small context models seem to have difficulties with reinflected Czech. The main advantage given by the CWE model is an ability to better rerank $n k$ -best lists. These results suggest that, while the normalization $^ +$ reinflection procedure may introduce diversity in the output to be reranked, our models are not able to draw any significant advantage from it.
|
| 191 |
+
|
| 192 |
+
# 4.4 ANALYSIS OF CHARACTER-LEVEL OUTPUT REPRESENTATIONS PERFORMANCE
|
| 193 |
+
|
| 194 |
+
Models using character-level output representations gave sub-par results on re-ranking. It is surprising, especially for re-inflected Czech: such a model is supposed to behave better on unknown words, and thus should benefit from diversity given by generating new words. However, as we can see in table 4, re-inflection doesn’t add that much diversity (About $0 . 1 ~ \%$ of OOV words, and about $0 . 0 0 1 \%$ of words never seen by the model before). Diversity is also inhibited by our training algorithm: while we train open-vocabulary models, the negative examples used with Noise-contrastive estimation come from a closed vocabulary.
|
| 195 |
+
|
| 196 |
+
Table 4: Ratio of unknown words in system outputs measured on the test set.
|
| 197 |
+
|
| 198 |
+
<table><tr><td></td><td>Full training vocabulary</td><td>250K words vocabulary</td></tr><tr><td>Reference</td><td>0.131 %</td><td>0.995 %</td></tr><tr><td>En → Cz (300-best)</td><td>0.566 %</td><td>1.173 %</td></tr><tr><td>En→ Simplified Cz + Reinflection</td><td>0.567 %</td><td>1.263 %</td></tr><tr><td>En→Simplified Cz + 3-Best reinflection</td><td>0.567 %</td><td>1.277 %</td></tr><tr><td>En→ Simplified Cz + 5-Best reinflection</td><td>0.568 %</td><td>1.285 %</td></tr></table>
|
| 199 |
+
|
| 200 |
+
This can related to the nature of the unigram distribution used to sample negative examples. As explained in section 4.1, it makes frequent short words completely outweigh the others in number of updates, and we are forced to reduce the ability of the model to find common morphological attributes between words to avoid ’contamination’ of character n-gram representations.
|
| 201 |
+
|
| 202 |
+
# 5 RELATED WORKS
|
| 203 |
+
|
| 204 |
+
There is a number of different strategies to efficiently train NNLMs with large vocabularies, such as different types of hierarchical softmax Mnih & Hinton (2009); Le et al. (2011), importance sampling Bengio & Sen´ ecal (2003), and Noise contrastive estimation Gutmann & Hyv ´ arinen (2012); Mnih & ¨ Teh (2012). Vaswani et al. (2013) has showed the interest of training a NLM with NCE to re-rank $k$ -best lists, while Devlin et al. (2014) uses a self-normalization. Recently, a comparative study Chen et al. (2016) has been made on how to deal with a large vocabulary. However, the purpose of this paper is to explore models with open vocabulary rather large vocabulary.
|
| 205 |
+
|
| 206 |
+
There is a surge of interest into using character-level information for a wide range of NLP tasks, with improved results in POS Tagging Santos & Zadrozny (2014), Text classification Zhang & LeCun (2015), Parsing Ballesteros et al. (2015), Named entity recognition Lample et al. (2016).
|
| 207 |
+
|
| 208 |
+
In language modeling, first applications to language modeling were strictly using characters, and performed less than word-level models Mikolov et al. (2012), while showing impressive results for text generation Sutskever et al. (2011); Graves (2013), using bi-directional LSTM Graves et al. (2013). Recently, Ling et al. (2015) has used bi-directional LSTM to build word representations from characters, with improvements in language modeling and POS-tagging.
|
| 209 |
+
|
| 210 |
+
The recent work of Kim et al. (2015), that uses convolutional networks and pooling to construct a word representation from character n-grams, coupled with highway networks Srivastava et al. (2015), showed on various languages that using characters improves results on the language modeling task (for a small corpus), even more so for languages with complex morphology. A similar architecture was used Jozefowicz et al. (2016) on a larger dataset, conjointly with bi-directional ´ LSTMs, and trained with importance sampling, showing great results.
|
| 211 |
+
|
| 212 |
+
On the study of NNLMs in the context of Machine Translation, we can mention the work of Luong et al. (2015) on the effect of the number of layers on reranking $n$ -best lists. Finally, while not directly related to our work, Luong & Manning (2016) very recently showed great improvements on a translation task by handling rare words with character-level recurrent networks, with a neural translation model.
|
| 213 |
+
|
| 214 |
+
# 6 CONCLUSION
|
| 215 |
+
|
| 216 |
+
In this work, we addressed the challenge of designing an open vocabulary Neural Language Model. For that purpose, word representations are estimated on-the-fly from n-grams of characters. Two kinds of models are introduced: first, NLMs using word and character-level embeddings to represent the input context (CWE); then its extension to an open-vocabulary even for the predicted words (CWE-CWE). These models were used to re-rank outputs of translation systems from English to Czech. We also carried out experiments on translation systems from English to a simplified Czech, which is then re-inflected into Czech before re-ranking.
|
| 217 |
+
|
| 218 |
+
We obtained a slight improvement in BLEU score using a CWE model, which, given the little variety of the words generated by translation systems, makes us suppose there is room for more. We plan to investigate with more complex translation systems, as well as with other applications, such as morphological re-inflection.
|
| 219 |
+
|
| 220 |
+
While the performance of our open-vocabulary models are to some extent disappointing, they open questions about the learned representations we will explore. We also plan to investigate on a more fitted noise distribution to use with NCE when training open-vocabulary models.
|
| 221 |
+
|
| 222 |
+
# ACKNOWLEDGMENTS
|
| 223 |
+
|
| 224 |
+
# REFERENCES
|
| 225 |
+
|
| 226 |
+
A. Allauzen and J.L Gauvain. Open vocabulary asr for audiovisual document indexation. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), April 2005.
|
| 227 |
+
|
| 228 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. CoRR, abs/1409.0473, 2014.
|
| 229 |
+
|
| 230 |
+
Miguel Ballesteros, Chris Dyer, and Noah A. Smith. Improved transition-based parsing by modeling characters instead of words with lstms. In Llus Mrquez, Chris Callison-Burch, Jian Su, Daniele Pighin, and Yuval Marton (eds.), EMNLP, pp. 349–359. The Association for Computational Linguistics, 2015. ISBN 978-1-941643-32-7. URL http://dblp.uni-trier.de/ db/conf/emnlp/emnlp2015.html#BallesterosDS15.
|
| 231 |
+
|
| 232 |
+
Yoshua Bengio and Jean-Sebastien S ´ en´ ecal. Quick training of probabilistic neural nets by impor- ´ tance sampling. In Proceedings of the conference on Artificial Intelligence and Statistics (AISTATS), 2003.
|
| 233 |
+
|
| 234 |
+
Yoshua Bengio, Rejean Ducharme, Pascal Vincent, and Christian Jauvin. A neural probabilistic ´ language model. Journal of Machine Learning Research, 3:1137 1155, 2003.
|
| 235 |
+
|
| 236 |
+
Jan A. Botha and Phil Blunsom. Compositional Morphology for Word Representations and Language Modelling. In Proceedings of the International Conference of Machine Learning (ICML), Beijing, China, jun 2014.
|
| 237 |
+
|
| 238 |
+
Wenlin Chen, David Grangier, and Michael Auli. Strategies for training large vocabulary neural language models. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics, ACL 2016, August 7-12, 2016, Berlin, Germany, Volume 1: Long Papers, 2016. URL http://aclweb.org/anthology/P/P16/P16-1186.pdf.
|
| 239 |
+
|
| 240 |
+
Colin Cherry and George Foster. Batch tuning strategies for statistical machine translation. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pp. 427–436, Montreal, Canada, June 2012. ´
|
| 241 |
+
|
| 242 |
+
Ronan Collobert, Jason Weston, Leon Bottou, Michael Karlen, Koray Kavukcuoglu, and Pavel ´ Kuksa. Natural language processing (almost) from scratch. J. Mach. Learn. Res., 12:2493– 2537, November 2011. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm? id=1953048.2078186.
|
| 243 |
+
|
| 244 |
+
Josep Maria Crego, Franois Yvon, and Jos B. Marino. N-code: an open-source Bilingual N-gram ˜ SMT Toolkit. Prague Bulletin of Mathematical Linguistics, 96:49–58, 2011.
|
| 245 |
+
|
| 246 |
+
Jacob Devlin, Rabih Zbib, Zhongqiang Huang, Thomas Lamar, Richard M. Schwartz, and John Makhoul. Fast and robust neural network joint models for statistical machine translation. In Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics, ACL 2014, June 22-27, 2014, Baltimore, MD, USA, Volume 1: Long Papers, pp. 1370–1380, 2014. URL http://aclweb.org/anthology/P/P14/P14-1129.pdf.
|
| 247 |
+
|
| 248 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Technical Report UCB/EECS-2010-24, EECS Department, University of California, Berkeley, Mar 2010. URL http://www2.eecs.berkeley.edu/Pubs/ TechRpts/2010/EECS-2010-24.html.
|
| 249 |
+
|
| 250 |
+
Alex Graves. Generating sequences with recurrent neural networks. CoRR, abs/1308.0850, 2013. URL http://arxiv.org/abs/1308.0850.
|
| 251 |
+
|
| 252 |
+
Alex Graves, Navdeep Jaitly, and Abdel-rahman Mohamed. Hybrid speech recognition with deep bidirectional LSTM. In 2013 IEEE Workshop on Automatic Speech Recognition and Understanding, Olomouc, Czech Republic, December 8-12, 2013, pp. 273–278, 2013. doi: 10.1109/ASRU. 2013.6707742. URL http://dx.doi.org/10.1109/ASRU.2013.6707742.
|
| 253 |
+
|
| 254 |
+
Michael U. Gutmann and Aapo Hyvarinen. Noise-contrastive estimation of unnormalized statistical ¨ models, with applications to natural image statistics. J. Mach. Learn. Res., 13(1):307–361, February 2012. ISSN 1532-4435. URL http://dl.acm.org/citation.cfm?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 2503308. 2188396.
|
| 255 |
+
|
| 256 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the ´ limits of language modeling. CoRR, abs/1602.02410, 2016. URL http://arxiv.org/abs/ 1602.02410.
|
| 257 |
+
|
| 258 |
+
Yoon Kim, Yacine Jernite, David Sontag, and Alexander M Rush. Character-aware neural language models. arXiv preprint arXiv:1508.06615, 2015.
|
| 259 |
+
|
| 260 |
+
Matthieu Labeau, Kevin Loser, and Alexandre Allauzen. Non-lexical neural architecture for fine- ¨ grained pos tagging. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 232–237, Lisbon, Portugal, September 2015.
|
| 261 |
+
|
| 262 |
+
Guillaume Lample, Miguel Ballesteros, Kazuya Kawakami, Sandeep Subramanian, and Chris Dyer. Neural architectures for named entity recognition. In In proceedings of NAACL-HLT (NAACL 2016)., San Diego, US, 2016.
|
| 263 |
+
|
| 264 |
+
Hai Son Le, Ilya Oparin, Alexandre Allauzen, Jean-Luc Gauvain, and Franc¸ois Yvon. Structured output layer neural network language model. In Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing, ICASSP 2011, May 22-27, 2011, Prague Congress Center, Prague, Czech Republic, pp. 5524–5527, 2011. doi: 10.1109/ICASSP.2011. 5947610. URL http://dx.doi.org/10.1109/ICASSP.2011.5947610.
|
| 265 |
+
|
| 266 |
+
Hai-Son Le, Alexandre Allauzen, and Franc¸ois Yvon. Continuous space translation models with neural networks. In Proceedings of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pp. 39–48, Montreal, Canada, ´ June 2012. Association for Computational Linguistics.
|
| 267 |
+
|
| 268 |
+
Wang Ling, Chris Dyer, Alan W. Black, Isabel Trancoso, Ramon Fermandez, Silvio Amir, Lus Marujo, and Tiago Lus. Finding function in form: Compositional character models for open vocabulary word representation. In EMNLP, pp. 1520–1530. The Association for Computational Linguistics, 2015. ISBN 978-1-941643-32-7. URL http://dblp.uni-trier.de/db/ conf/emnlp/emnlp2015.html#LingDBTFAML15.
|
| 269 |
+
|
| 270 |
+
Minh-Thang Luong and Christopher D. Manning. Achieving open vocabulary neural machine translation with hybrid word-character models. CoRR, abs/1604.00788, 2016. URL http: //arxiv.org/abs/1604.00788.
|
| 271 |
+
|
| 272 |
+
Thang Luong, Michael Kayser, and Christopher D. Manning. Deep neural language models for machine translation. In Proceedings of the 19th Conference on Computational Natural Language Learning, CoNLL 2015, Beijing, China, July 30-31, 2015, pp. 305–309, 2015. URL http: //aclweb.org/anthology/K/K15/K15-1031.pdf.
|
| 273 |
+
|
| 274 |
+
Benjamin Marie, Alexandre Allauzen, Franck Burlot, Quoc-Khanh Do, Julia Ive, elena knyazeva, Matthieu Labeau, Thomas Lavergne, Kevin Loser, Nicolas P ¨ echeux, and Franc¸ois Yvon. ´ Limsi@wmt’15 : Translation task. In Proceedings of the Tenth Workshop on Statistical Machine Translation, pp. 145–151, Lisbon, Portugal, September 2015. Association for Computational Linguistics. URL http://aclweb.org/anthology/W15-3016.
|
| 275 |
+
|
| 276 |
+
Tomas Mikolov, Ilya Sutskever, Anoop Deoras, Hai-Son Le, Stefan Kombrink, and Jan Cernocky. Subword language modeling with neural networks. 2012. Unpublished.
|
| 277 |
+
|
| 278 |
+
Andriy Mnih and Geoffrey Hinton. A scalable hierarchical distributed language model. In Advances in Neural Information Processing Systems, volume 21, pp. 1081–1088, 2009.
|
| 279 |
+
|
| 280 |
+
Andriy Mnih and Yee Whye Teh. A fast and simple algorithm for training neural probabilistic language models. In ICML. icml.cc / Omnipress, 2012. URL http://dblp.uni-trier. de/db/conf/icml/icml2012.html#MnihT12.
|
| 281 |
+
|
| 282 |
+
Cicero D. Santos and Bianca Zadrozny. Learning character-level representations for part-of-speech tagging. In Tony Jebara and Eric P. Xing (eds.), Proceedings of the 31st International Conference on Machine Learning (ICML-14), pp. 1818–1826. JMLR Workshop and Conference Proceedings, 2014. URL http://jmlr.org/proceedings/papers/v32/santos14.pdf.
|
| 283 |
+
|
| 284 |
+
Holger Schwenk. Continuous space language models. Computer Speech and Language, 21(3): 492–518, July 2007.
|
| 285 |
+
|
| 286 |
+
Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proceedings of the Annual Meeting on Association for Computational Linguistics (ACL), pp. 1715–1725, Berlin, Germany, August 2016.
|
| 287 |
+
|
| 288 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Training very deep networks. ¨ CoRR, abs/1507.06228, 2015. URL http://arxiv.org/abs/1507.06228.
|
| 289 |
+
|
| 290 |
+
Ilya Sutskever, James Martens, and Geoffrey Hinton. Generating text with recurrent neural networks. In Lise Getoor and Tobias Scheffer (eds.), Proceedings of the 28th International Conference on Machine Learning (ICML-11), ICML ’11, pp. 1017–1024, New York, NY, USA, June 2011. ACM.
|
| 291 |
+
|
| 292 |
+
Ashish Vaswani, Yinggong Zhao, Victoria Fossum, and David Chiang. Decoding with large-scale neural language models improves translation. In EMNLP, pp. 1387–1392. ACL, 2013. ISBN 978- 1-937284-97-8. URL http://dblp.uni-trier.de/db/conf/emnlp/emnlp2013. html#VaswaniZFC13.
|
| 293 |
+
|
| 294 |
+
Alexander Waibel, Toshiyuki Hanazawa, Geofrey Hinton, Kiyohiro Shikano, and Kevin J. Lang. Readings in Speech Recognition, chapter Phoneme Recognition Using Time-delay Neural Networks, pp. 393–404. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1990.
|
| 295 |
+
|
| 296 |
+
Xiang Zhang and Yann LeCun. Text understanding from scratch. CoRR, abs/1502.01710, 2015. URL http://arxiv.org/abs/1502.01710.
|
md/train/SylJ1D1C-/SylJ1D1C-.md
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PDE-NET: LEARNING PDES FROM DATA
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Partial differential equations (PDEs) play a prominent role in many disciplines such as applied mathematics, physics, chemistry, material science, computer science, etc. PDEs are commonly derived based on physical laws or empirical observations. However, the governing equations for many complex systems in modern applications are still not fully known. With the rapid development of sensors, computational power, and data storage in the past decade, huge quantities of data can be easily collected and efficiently stored. Such vast quantity of data offers new opportunities for data-driven discovery of hidden physical laws. Inspired by the latest development of neural network designs in deep learning, we propose a new feed-forward deep network, called PDE-Net, to fulfill two objectives at the same time: to accurately predict dynamics of complex systems and to uncover the underlying hidden PDE models. The basic idea of the proposed PDE-Net is to learn differential operators by learning convolution kernels (filters), and apply neural networks or other machine learning methods to approximate the unknown nonlinear responses. Comparing with existing approaches, which either assume the form of the nonlinear response is known or fix certain finite difference approximations of differential operators, our approach has the most flexibility by learning both differential operators and the nonlinear responses. A special feature of the proposed PDE-Net is that all filters are properly constrained, which enables us to easily identify the governing PDE models while still maintaining the expressive and predictive power of the network. These constrains are carefully designed by fully exploiting the relation between the orders of differential operators and the orders of sum rules of filters (an important concept originated from wavelet theory). We also discuss relations of the PDE-Net with some existing networks in computer vision such as Network-In-Network (NIN) and Residual Neural Network (ResNet). Numerical experiments show that the PDE-Net has the potential to uncover the hidden PDE of the observed dynamics, and predict the dynamical behavior for a relatively long time, even in a noisy environment.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Differential equations, especially partial differential equations(PDEs), play a prominent role in many disciplines to describe the governing physical laws underlying a given system of interest. Traditionally, PDEs are derived based on simple physical principles such as conservation laws, minimum energy principles, or based on empirical observations. Important examples include the NavierStokes equations in fluid dynamics, the Maxwell’s equations for electromagnetic propagation, and the Schrodinger’s equations in quantum mechanics. However, many complex systems in modern ¨ applications (such as many problems in climate science, neuroscience, finance, etc.) still have eluded mechanisms, and the governing equations of these systems are only partially known. With the rapid development of sensors, computational power, and data storage in the last decade, huge quantities of data can be easily collected and efficiently stored . Such vast quantity of data offers new opportunities for data-driven discovery of potentially new physical laws. Then, one may ask the following interesting and intriguing question: can we learn a PDE model (if there exists one) from a given data set and perform accurate and efficient predictions using the learned model?
|
| 12 |
+
|
| 13 |
+
One of earlier attempts on data-driven discovery of hidden physical laws is by Bongard & Lipson (2007) and Schmidt & Lipson (2009). Their main idea is to compare numerical differentiations of the experimental data with analytic derivatives of candidate functions, and apply the symbolic regression and the evolutionary algorithm to determining the nonlinear dynamical system. Recently,
|
| 14 |
+
|
| 15 |
+
Brunton et al. (2016), Schaeffer (2017), Rudy et al. (2017) and Wu & Zhang (2017) propose an alternative approach using sparse regression. They construct a dictionary of simple functions and partial derivatives that are likely to appear in the unknown governing equations. Then, they take advantage of sparsity promoting techniques to select candidates that most accurately represent the data. When the form of the nonlinear response of a PDE is known, except for some scalar parameters, Raissi & Karniadakis (2017) presented a framework to learn these unknown parameters by introducing regularity between two consecutive time step using Gaussian process. More recently, Raissi et al. (2017) introduced a new class of universal function approximators called the physics informed neural networks which is capable of discovering nonlinear PDEs parameterized by scalars.
|
| 16 |
+
|
| 17 |
+
These recent work greatly advanced the progress of the problem. However, symbolic regression is expensive and does not scale very well to large systems. The sparse regression method requires to fix certain numerical approximations of the spatial differentiations in the dictionary beforehand, which limits the expressive and predictive power of the dictionary. Although the framework presented by Raissi & Karniadakis (2017); Raissi et al. (2017) is able to learn hidden physical laws using less data than the approach of sparse regression, the explicit form of the PDEs are assumed to be known except for a few scalar learnable parameters. Therefore, extracting governing equations from data in a less restrictive setting remains a great challenge.
|
| 18 |
+
|
| 19 |
+
The main objective of this paper is to accurately predict the dynamics of complex systems and to uncover the underlying hidden PDE models (should they exist) at the same time, with minimal prior knowledge on the systems. Our inspiration comes from the latest development of deep learning techniques in computer vision. An interesting fact is that some popular networks in computer vision, such as ResNet(He et al., 2016a;b), have close relationship with PDEs (Chen et al., 2015; E, 2017; Haber & Ruthotto, 2017; Sonoda & Murata, 2017; Lu et al., 2017). Furthermore, the deeper is the network, the more expressive power the network possesses, which may enable us to learn more complex dynamics arose from fields other than computer vision. However, existing deep networks designed in deep learning mostly emphasis on expressive power and prediction accuracy. These networks are not transparent enough to be able to reveal the underlying PDE models, although they may perfectly fit the observed data and perform accurate predictions. Therefore, we need to carefully design the network by combining knowledge from deep learning and applied mathematics so that we can learn the governing PDEs of the dynamics and make accurate predictions at the same time. Note that our work is closely related to Chen et al. (2015) where the authors designed their network based on discretization of quasilinear parabolic equations. However, it is not clear if the dynamics of image denoising has to be governed by PDEs, nor did the authors attempt to recover the PDE (should there exists one).
|
| 20 |
+
|
| 21 |
+
In this paper, we design a deep feed-forward network, named PDE-Net, based on the following generic nonlinear evolution PDE
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
u _ { t } = F ( x , u , \nabla u , \nabla ^ { 2 } u , \ldots ) , \quad x \in \Omega \subset \mathbb { R } ^ { 2 } , \quad t \in [ 0 , T ] .
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
The objective of the PDE-Net is to learn the form of the nonlinear response $F$ and to perform accurate predictions. Unlike the existing work, the proposed network only requires minor knowledge on the form of the nonlinear response function $F$ , and requires no knowledge on the involved differential operators (except for their maximum possible order) and their associated discrete approximations. The nonlinear response function $F$ can be learned using neural networks or other machine learning methods, while discrete approximations of the differential operators are learned using convolution kernels (i.e. filters) jointly with the learning of the response function $F$ . If we have a prior knowledge on the form of the response function $F$ , we can easily adjust the network architecture by taking advantage of the additional information. This may simplify the training and improve the results. We will also discuss relations of the PDE-Net to some existing networks in computer vision such as Network-In-Network (NIN) and ResNet. Details are given in Section 2.
|
| 28 |
+
|
| 29 |
+
In Section 3 and Section 4, we conduct numerical experiments on a linear PDE (convection-diffusion equation) and a nonlinear PDE (convection-diffusion equation with a nonlinear source). We generate data set for each PDE using high precision numerical methods and add Gaussian noise to mimic real situations. Our numerical results show that the PDE-Net can uncover the hidden equations of the observed dynamics, and can predict the dynamical behavior for a relatively long time, even in a noisy environment.
|
| 30 |
+
|
| 31 |
+
A particular novelty of our approach is that we impose appropriate constraints on the learnable filters in order to easily identify the governing PDE models while still maintaining the expressive and predictive power of the network. This makes our approach different from existing deep convolutional networks which mostly emphasis on the prediction accuracy of the networks, as well as all the existing approaches of learning PDEs from data which assume either the form of the response function is known or have fixed approximations of the differential operators. In other words, our proposed approach not only has vast flexibility in fitting observed dynamics and is able to accurately predict its future behavior, but is also able to reveal the hidden equations driving the observed dynamics. The constraints on the filters are motivated by the earlier work of Cai et al. (2012); Dong et al. (2017) where general relations between wavelet frame transforms and differential operators were established. In particular, it was observed in Dong et al. (2017) that we can relate filters and finite difference approximation of differential operators by examining the orders of sum rules of the filters (an important concept in wavelet theory and closely related to vanishing moments of wavelet functions). These constraints on the filters may also be useful in network designs for machine learning tasks in computer vision.
|
| 32 |
+
|
| 33 |
+
# 2 PDE-NET: A FLEXIBLE DEEP ARCHTECTURE TO LEARN PDES FROM DATA
|
| 34 |
+
|
| 35 |
+
Given a series of measurements of some physical quantities $\{ u ( t , \cdot ) : t = t _ { 0 } , t _ { 1 } , \cdot \cdot \cdot \}$ on the spatial domain $\Omega \subset \mathbb { R } ^ { 2 }$ , with $u ( t , \cdot ) : \Omega \mapsto \mathbb { R }$ , we want to discover the governing PDEs of the data. We assume that the observed data are associated with a PDE that takes the following general form:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
u _ { t } ( t , x , y ) = F ( x , y , u , u _ { x } , u _ { y } , u _ { x x } , u _ { x y } , u _ { y y } , \ldots ) , \quad ( x , y ) \in \Omega \subset \mathbb { R } ^ { 2 } , t \in [ 0 , T ] .
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Our objective is to design a feed-forward network, named the PDE-Net, that approximates the PDE (1) in the way that: 1) we can predict the dynamical behavior of the equation for as long time as possible; 2) we are able to reveal the form of the response function $F$ and the differential operators involved. There are two main components of the PDE-Net that are combined together in the same network: one is automatic determination on the differential operators involved in the PDE and their discrete approximations; the other is to approximate the nonlinear response function $F$ . In this section, we start with discussions on the relation between convolutions and differentiations in discrete setting.
|
| 42 |
+
|
| 43 |
+
# 2.1 CONVOLUTIONS AND DIFFERENTIATIONS
|
| 44 |
+
|
| 45 |
+
A comprehensive analysis on the relations between convolutions and differentiations within variational and PDE framework were laid out by Cai et al. (2012) and Dong et al. (2017), where the authors established general connections between PDE based approach and wavelet frame based approach for image restoration problems. We demonstrate one of the key observations of their work using a simple example. Consider the 2-dimensional Haar wavelet frame filter bank contains one low-pass filter $h _ { 0 0 }$ and three high pass filters $h _ { 1 0 } , h _ { 0 1 }$ and $h _ { 1 1 }$ :
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
h _ { 0 0 } = \frac { 1 } { 4 } \left( \begin{array} { c c } { 1 } & { 1 } \\ { 1 } & { 1 } \end{array} \right) , h _ { 1 0 } = \frac { 1 } { 4 } \left( \begin{array} { c c } { 1 } & { - 1 } \\ { 1 } & { - 1 } \end{array} \right) , h _ { 0 1 } = \frac { 1 } { 4 } \left( \begin{array} { c c } { 1 } & { 1 } \\ { - 1 } & { - 1 } \end{array} \right) , h _ { 1 1 } = \frac { 1 } { 4 } \left( \begin{array} { c c } { 1 } & { - 1 } \\ { - 1 } & { 1 } \end{array} \right) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The associated Haar wavelet frame transform on an image $u$ is defined by
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
W u = \{ h _ { i j } [ - \cdot ] \circledast u : 0 \leq i , j \leq 1 \} ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\circledast$ is the circular convolution. It is easy to verify using Taylor’s expansion that the high frequency coefficients of the Haar wavelet frame transform on $u$ are discrete approximations of differential operators:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
h _ { 1 0 } [ - \cdot ] \circledast u \approx \frac { 1 } { 2 } \delta _ { x } u _ { x } , \ h _ { 0 1 } [ - \cdot ] \circledast u \approx \frac { 1 } { 2 } \delta _ { y } u _ { y } , \ h _ { 1 1 } [ - \cdot ] \circledast u \approx \frac { 1 } { 4 } \delta _ { x } \delta _ { y } u _ { x y } .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Here, $\delta _ { x }$ and $\delta _ { y }$ represent the horizontal and vertical spatial grid size respectively. For simplicity of notation, we use regular character to denote both discrete and continuum functions, since there should be no confusion within the context.
|
| 64 |
+
|
| 65 |
+
A profound relationship between convolutions and differentiations was presented in Dong et al. (2017), where the authors discussed the connection between the order of sum rules of filters and the orders of differential operators. Note that the order of sum rules is closely related to the order of vanishing moments in wavelet theory (Daubechies, 1992; Mallat, 1999). We first recall the definition of the order of sum rules.
|
| 66 |
+
|
| 67 |
+
Definition 2.1 (Order of Sum Rules). For a filter $q$ , we say $q$ to have sum rules of order $\alpha =$ $\left( \alpha _ { 1 } , \alpha _ { 2 } \right)$ , where $\alpha \in \mathbb { Z } _ { + } ^ { 2 }$ , provided that
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\sum _ { k \in \mathbb { Z } ^ { 2 } } k ^ { \beta } q [ k ] = 0
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
for all $\beta \in \mathbb { Z } _ { + } ^ { 2 }$ with $| \beta | < | \alpha |$ and for all $\beta \in \mathbb { Z } _ { + } ^ { 2 }$ with $| \beta | = | \alpha |$ but $\beta \neq \alpha$ . If (2) holds for all $\beta \in \mathbb { Z } _ { + } ^ { 2 }$ with $| \beta | < K$ except for $\beta \neq \beta _ { 0 }$ with certain $\beta _ { 0 } \in \mathbb { Z } _ { + } ^ { 2 }$ and $\left. \beta _ { 0 } \right. = J < K$ , then we say q to have total sum rules of order $K \backslash \{ J + 1 \}$ .
|
| 74 |
+
|
| 75 |
+
The following proposition from Dong et al. (2017) links the orders of sum rules with orders of differential operator.
|
| 76 |
+
|
| 77 |
+
Propositin 2.1. Let q be a filter with sum rules of order $\alpha \in \mathbb { Z } _ { + } ^ { 2 }$ . Then for a smooth function $F ( x )$ on $\mathbb { R } ^ { 2 }$ , we have
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
{ \frac { 1 } { \varepsilon ^ { | \alpha | } } } \sum _ { k \in \mathbb { Z } ^ { 2 } } q [ k ] F ( x + \varepsilon k ) = C _ { \alpha } { \frac { \partial ^ { \alpha } } { \partial x ^ { \alpha } } } F ( x ) + O ( \varepsilon ) , a s \varepsilon \to 0 ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $C _ { \alpha }$ is the constant defined by
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
C _ { \alpha } = \frac { 1 } { \alpha ! } \sum _ { k \in \mathbb { Z } ^ { 2 } } k ^ { \alpha } q [ k ] .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
If, in addition, $q$ has total sum rules of order $K \backslash \{ | \alpha | + 1 \}$ for some $K > | \alpha |$ , then
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
{ \frac { 1 } { \varepsilon ^ { | \alpha | } } } \sum _ { k \in \mathbb { Z } ^ { 2 } } q [ k ] F ( x + \varepsilon k ) = C _ { \alpha } { \frac { \partial ^ { \alpha } } { \partial x ^ { \alpha } } } F ( x ) + O ( \varepsilon ^ { K - | \alpha | } ) , a s \varepsilon \to 0 .
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
According to Proposition 2.1, an $\alpha$ th order differential operator can be approximated by the convolution of a filter with $\alpha$ order of sum rules. Furthermore, according to (4), one can obtain a high order approximation of a given differential operator if the corresponding filter has an order of total sum rules with $K > | \alpha | + k , k \geqslant 1$ . For example, the filter $h _ { 1 0 }$ in the Haar wavelet frame filter bank has a sum rules of order $( 1 , 0 )$ , and a total sum rules of order $2 \backslash \{ 2 \}$ . Thus, up to a constant and a proper scaling, h10 corresponds to a discretization of ∂∂x with first order approximation. The filer $h _ { 1 1 }$ has a sum rules of order $( 1 , 1 )$ , and a total sum rules of order $3 \backslash \{ 3 \}$ . Thus, up to a constant and a proper scaling, $h _ { 1 1 }$ corresponds to a discretization of $\frac { \partial ^ { 2 } } { \partial x \partial y }$ with first order approximation. Finally, consider filter
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
q = \left( \begin{array} { c c c } { { 1 } } & { { 0 } } & { { - 1 } } \\ { { 2 } } & { { 0 } } & { { - 2 } } \\ { { 1 } } & { { 0 } } & { { - 1 } } \end{array} \right) .
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
It has a sum rules of order $( 1 , 0 )$ , and a total sum rules of order $3 \backslash \{ 2 \}$ . Thus, up to a constant and a proper scaling, q corresponds to a discretization of ∂∂x with second order approximation.
|
| 102 |
+
|
| 103 |
+
Now, we introduce the concept of moment matrix for a given filter that will be used to constrain filters in the PDE-Net. For an $N \times N$ filter $q$ , define the moment matrix of $q$ as
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
M ( q ) = ( m _ { i , j } ) _ { N \times N } , \mathrm { ~ w h e r e ~ } m _ { i , j } = \frac { 1 } { ( i - 1 ) ! ( j - 1 ) ! } \sum _ { k \in \mathbb { Z } ^ { 2 } } k _ { 1 } ^ { i - 1 } k _ { 2 } ^ { j - 1 } q [ k _ { 1 } , k _ { 2 } ] ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
for $i , j = 1 , 2 , \dots , N$ . We shall call the $( i , j )$ -element of $M ( q )$ the $( i - 1 , j - 1 )$ -moment of $q$ for simplicity. Combining (5) and Proposition 2.1, one can easily see that filter $q$ can be designed to approximate any differential operator at any given approximation order by imposing constraints on $M ( q )$ . For example, if we want to approximate $\textstyle { \frac { \partial u } { \partial x } }$ (up to a constant) by convolution $q \circledast u$ where $q$ is a $3 \times 3$ filter, we can consider the following constrains on $M ( q )$ :
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { \star } } \\ { { 1 } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \end{array} \right) \quad \mathrm { o r } \quad \left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { 0 } } \\ { { 1 } } & { { 0 } } & { { \star } } \\ { { 0 } } & { { \star } } & { { \star } } \end{array} \right) .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Here, $\star$ means no constraint on the corresponding entry. The constraints described by the moment matrix on the left of (6) guarantee the approximation accuracy is at least first order, and the ones on
|
| 116 |
+
|
| 117 |
+
the right guarantee an approximation of at least second order. In particular, when all entries of $M ( q )$ are constrained, e.g.
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
M ( q ) = \left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { 0 } } \\ { { 1 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { 0 } } & { { 0 } } \end{array} \right) ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
the corresponding filter can be uniquely determined, in which case we call it a “frozen” filter. In the PDE-Net which shall be introduced in the next subsection, all filters are learned subjected to partial constraints on their associated moment matrices.
|
| 124 |
+
|
| 125 |
+
It is worth noticing that the approximation property of a filter is limited by its size. Generally speaking, large filters can approximate higher order differential operators or lower order differential operators with higher approximation orders. Taking 1-dimensional case as an example, 3-element filters cannot approximate the fifth order differential operator, whereas 7-element filters can. In other words, the larger are the filters, the stronger is the representation capability of filters. However, larger filters lead to more memory overhead and higher computation cost. It is a wisdom to balance the trade-off in practice.
|
| 126 |
+
|
| 127 |
+
# 2.2 ARCHITECTURE OF PDE-NET
|
| 128 |
+
|
| 129 |
+
Given the evolution PDE (1), we consider forward Euler as the temporal discretization. One may consider more sophisticated temporal discretization which leads to different network architectures. For simplicity, we focus on forward Euler in this paper.
|
| 130 |
+
|
| 131 |
+
# ONE $\delta t$ -BLOCK:
|
| 132 |
+
|
| 133 |
+
Let $\tilde { u } ( t _ { i + 1 } , \cdot )$ be the predicted value of $u$ at time $t _ { i + 1 }$ based on the value of $u$ at $t _ { i }$ . Then, we have
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\tilde { u } ( t _ { i + 1 } , \cdot ) = D _ { 0 } u ( t _ { i } , \cdot ) + \Delta t \cdot F ( x , y , D _ { 0 0 } u , D _ { 1 0 } u , D _ { 0 1 } u , D _ { 2 0 } u , D _ { 1 1 } u , D _ { 0 2 } u , \dots ) .
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
Here, the operators $D _ { 0 }$ and $D _ { i j }$ are convolution operators with the underlying filters denoted by $q _ { 0 }$ and $q _ { i j }$ , i.e. $D _ { 0 } u = q _ { 0 } \circledast u$ and $D _ { i j } u = q _ { i j } \circledast u$ . The operators $D _ { 1 0 }$ , $D _ { 0 1 }$ , $D _ { 1 1 }$ , etc. approximate differential operators, i.e. $\begin{array} { r } { D _ { i j } u \approx \frac { \partial ^ { i + j } u } { \partial ^ { i } x \partial ^ { j } y } } \end{array}$ . The operators $D _ { 0 }$ and $D _ { 0 0 }$ are average operators. The purpose of introducing these average operators in stead of using the identity is to improve stability of the network and enables it to capture more complex dynamics. Other than the assumption that the observed dynamics is governed by a PDE of the form (1), we assume that the highest order of the PDE is less than some positive integer. Then, the task of approximating $F$ is equivalent to a multivariate regression problem, which can be approximated by a point-wise neural network (with shared weights across the computation domain $\Omega$ ) or other classical machine learning methods. Combining the approximation of differential operators and the nonlinear function $F$ , we achieve an approximation framework of (7) which will be referred to as a $\delta t$ -block (see Figure 1). Note that if we have a prior knowledge on the form of the response function $F$ , we can easily adjust the network architecture by taking advantage of the additional information. This may simplify the training and improve the results.
|
| 140 |
+
|
| 141 |
+
# PDE-NET (MULTIPLE $\delta t$ -BLOCKS):
|
| 142 |
+
|
| 143 |
+
One $\delta t$ -block only guarantees the accuracy of one-step dynamics, which does not take error accumulation into consideration. This may cause severe instability in prediction. To improve the stability of the network and enable long-term prediction, we stack multiple $\delta t$ -blocks into a deep network, and call this network the $P D E$ -Net (see Figure 2). The importance of stacking multiple $\delta t$ -blocks will be demonstrated in Section 3.
|
| 144 |
+
|
| 145 |
+
The PDE-Net can be easily described as: (1) stacking one $\delta t$ -block multiple times; (2) sharing parameters in all $\delta t$ -blocks. Given an input data $u ( t _ { i } , \cdot )$ , training a PDE-Net with n $\delta t$ -blocks needs to minimize the accumulated error $| | u ( t _ { i + n } , \cdot ) - \tilde { u } ( t _ { i + n } , \cdot ) | | _ { 2 } ^ { 2 }$ , where $\tilde { u } ( t _ { i + n } , \cdot )$ is the output from the PDE-Net (i.e. n $\delta t$ -blocks) with input $u ( t _ { i } , \cdot )$ . Thus, the PDE-Net with bigger $n$ owns a longer time stability. Note that sharing parameters is a common practice in deep learning, which decreases the number of parameters and leads to significant memory reduction (Goodfellow et al., 2016).
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 1: The schematic diagram of a $\delta t$ -block.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 2: The schematic diagram of the PDE-Net: multiple $\delta t$ -blocks.
|
| 152 |
+
|
| 153 |
+
# LOSS FUNCTION AND CONSTRAINTS:
|
| 154 |
+
|
| 155 |
+
Consider the data set $\{ u _ { j } ( t _ { i } , \cdot ) : i , j = 0 , 1 , \ldots \}$ , where $j$ indicates the $j$ -th solution path with a certain initial condition of the unknown dynamics. We would like to train the PDE-Net with $n$ $\delta t$ -blocks. For a given $n \geq 1$ , every pair of the data $\{ u _ { j } ( t _ { i } , \cdot ) , u _ { j } ( t _ { i + n } , \cdot ) \}$ , for each $i$ and $j$ , is a training sample, where $u _ { j } ( t _ { i } , \cdot )$ is the input and $u _ { j } \big ( t _ { i + n } , \cdot \big )$ is the label that we need to match with the output from the PDE-Net. We select the following simple $\ell _ { 2 }$ loss function for training:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
L = \sum _ { i , j } l _ { i j } , \mathrm { w h e r e } \quad l _ { i j } = | | u _ { j } ( t _ { i + n } , \cdot ) - \tilde { u } _ { j } ( t _ { i + n } , \cdot ) | | _ { 2 } ^ { 2 } ,
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
where $\tilde { u } _ { j } \big ( t _ { i + n } , \cdot \big )$ is the output of the PDE-Net with $u _ { j } ( t _ { i } , \cdot )$ as the input.
|
| 162 |
+
|
| 163 |
+
All the filters involved in the PDE-Net are properly constrained using their associated moment matrices. Let $q _ { 0 }$ and $q _ { i j }$ be the underlying filters of $D _ { 0 }$ and $D _ { i j }$ . We impose the following constrains
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
( M ( q _ { 0 } ) ) _ { 1 , 1 } = 1 , \quad ( M ( q _ { 0 0 } ) ) _ { 1 , 1 } = 1
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
and for $i + j > 0$
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\left\{ \begin{array} { l l } { ( M ( q _ { i , j } ) ) _ { k _ { 1 } , k _ { 2 } } = 0 } & { k _ { 1 } + k _ { 2 } \leq i + j + 2 , ( k _ { 1 } , k _ { 2 } ) \neq ( i + 1 , j + 1 ) , } \\ { ( M ( q _ { i , j } ) ) _ { k _ { 1 } , k _ { 2 } } = 1 } & { ( k _ { 1 } , k _ { 2 } ) = ( i + 1 , j + 1 ) . } \end{array} \right.
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
For example, for $3 \times 3$ filters, we have
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
M ( q _ { 0 } ) = M ( q _ { 0 0 } ) = \left( \begin{array} { c c c } { { 1 } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \end{array} \right)
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
and
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
M ( q _ { 1 0 } ) = \left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { \star } } \\ { { 1 } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \end{array} \right) , M ( q _ { 0 1 } ) = \left( \begin{array} { c c c } { { 0 } } & { { 1 } } & { { \star } } \\ { { 0 } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \end{array} \right) , M ( q _ { 1 1 } ) = \left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { 0 } } \\ { { 0 } } & { { 1 } } & { { \star } } \\ { { 0 } } & { { \star } } & { { \star } } \end{array} \right) , \dots .
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
To demonstrate the necessity of learnable filters, we will compare the PDE-Net having the aforementioned constrains on the filters with the PDE-Net having frozen filters. To differentiate the two cases, we shall call the PDE-Net with frozen filters “the Frozen-PDE-Net”.
|
| 188 |
+
|
| 189 |
+
To further increase the expressive power and flexibility of the PDE-Net, we may associate multiple filters to approximate a given differential operator. However, in order not to mess up the identifiability of the underlying PDE model, we may select only one of the filters to provide correct approximation to the given differential operator in the way as described above. The rest of the filters are constrained in the way that they only contribute to modify the local truncation errors. For example, consider two $3 \times 3$ filters $\{ q _ { 0 } , q _ { 1 } \}$ and constrain their moment matrices as follows
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
M ( q _ { 0 } ) = \left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { \star } } \\ { { 1 } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \end{array} \right) , M ( q _ { 1 } ) = \left( \begin{array} { c c c } { { 0 } } & { { 0 } } & { { \star } } \\ { { 0 } } & { { \star } } & { { \star } } \\ { { \star } } & { { \star } } & { { \star } } \end{array} \right) .
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
Then, $q _ { 0 } \circledast u + q _ { 1 } \circledast u$ is potentially a better approximation to $u _ { x }$ (up to a constant) than $q _ { 0 } \circledast u$ . However, for simplicity, we only use one filter to approximate a given differential operator in this paper.
|
| 196 |
+
|
| 197 |
+
# NOVELTY OF THE PDE-NET:
|
| 198 |
+
|
| 199 |
+
Different from fixing numerical approximations of differentiations in advance in sparse regression methods (Schaeffer, 2017; Rudy et al., 2017), using learnable filters makes the PDE-Net more flexible, and enables more robust approximation of unknown dynamics and longer time prediction (see numerical experiments in Section 3 and Section 4). Furthermore, the specific form of the response function $F$ is also approximated from the data, rather than assumed to be known in advance (such as (Raissi & Karniadakis, 2017)). On the other hand, by inflicting constrains on moment matrices, we can identify which differential operators are included in the underlying PDE which helps with identifying the nonlinear response function $F$ . This grants transparency to the PDE-Net and the potential to reveal hidden physical laws. Therefore, the proposed PDE-Net is distinct from the existing learning based method to discover PDEs from data, as well as networks designed in deep learning for computer vision tasks.
|
| 200 |
+
|
| 201 |
+
# 2.3 INITIALIZATION AND TRAINING
|
| 202 |
+
|
| 203 |
+
In the PDE-Net, parameters can be divided into three groups:
|
| 204 |
+
|
| 205 |
+
• filters to approximate differential operators;
|
| 206 |
+
• the parameters of the point-wise neural network to approximate $F$ ;
|
| 207 |
+
• hyper-parameters, such as the number of filters, the size of filters, the number of layers, etc.
|
| 208 |
+
|
| 209 |
+
The parameters of the point-wise neural network are shared across the computation domain $\Omega$ , and are initialized by random sampling from a Gaussian distribution. For the filters, we initialize them by freezing them to their corresponding differential operators. For example, if a filter is to approximate $\frac { \partial } { \partial x }$ , we freeze it by constraining its $( 1 , 0 )$ -moment to 1 and other moments to 0. During the training process, we release the filters by switching to the constrains described in Section 2.2.
|
| 210 |
+
|
| 211 |
+
Instead of training an $n$ -layer PDE-Net directly, we adopt layer-wise training, which improves the training speed. To be more precise, we start with training the PDE-Net on the first $\delta t$ -block, and then use the results of the first $\delta t$ -block as the initialization and restart training the PDE-Net on the first two $\delta t$ -blocks. Repeat until we complete all $n$ blocks. Note that all the parameters in each of the $\delta t$ -block are shared across layers. In addition, we add a warm-up step before the training of the first $\delta t$ -block. The warm-up step is to obtain a good initial guess of the parameters of the point-wise neural network that approximates $F$ by using frozen filters.
|
| 212 |
+
|
| 213 |
+
# 2.4 RELATIONS TO SOME EXISTING NETWORKS
|
| 214 |
+
|
| 215 |
+
In recent years, a variety of deep neural networks have been introduced with great success in computer vision. The structure of the proposed PDE-Net is similar to some existing networks such as the Network-In-Network (NIN) (Lin et al., 2013) and the deep Residual Neural Network (ResNet) (He et al., 2016a;b).
|
| 216 |
+
|
| 217 |
+
The NIN is an improvement over the traditional convolutional neural networks. One of the special designs of NIN is the use of multilayer perceptron convolution (mlpconv) layers instead of the ordinary convolution layers. An mlpconv layer contains the convolutions and small point-wise neural networks. Such design can improve the ability of the network to extract nonlinear features from shallow layers. The inner structure of one $\delta t$ -block of the PDE-Net is similar to the mlpconv layer, and the multiple $\delta t$ -blocks structure is similar to the NIN structure, except for the pooling and ReLU operations.
|
| 218 |
+
|
| 219 |
+
On the other hand, each $\delta t$ -block of the PDE-Net has two paths (see Figure 1 and Figure 2): one is for the averaged quantity of $u$ and the other is for the increment $F$ . This structure coincides with the “residual block” introduced in ResNet. In fact, there has been a substantial study on the relation between ResNet and dynamical systems recently (E, 2017; Haber & Ruthotto, 2017; Sonoda & Murata, 2017).
|
| 220 |
+
|
| 221 |
+
# 3 NUMERICAL STUDIES: CONVECTION-DIFFUSION EQUATIONS
|
| 222 |
+
|
| 223 |
+
Convection-diffusion equations are classical PDEs that are used to describe physical phenomena where particles, energy, or other physical quantities are transferred inside a physical system due to two processes: diffusion and convection (Chandrasekhar, 1943). Convection-diffusion equations are widely applied in many scientific areas and industrial fields, such as pollutants dispersion in rivers or atmosphere, solute transferring in a porous medium, and oil reservoir simulation. In practical situations, usually the physical and chemical properties on different locations cannot be the same (called anisotropy in physics), thus it is more reasonable that convection coefficients and diffusion coefficients are variables instead of constants.
|
| 224 |
+
|
| 225 |
+
# 3.1 SIMULATED DATA, TRAINING AND TESTING
|
| 226 |
+
|
| 227 |
+
We consider a 2-dimensional linear variable-coefficient convection-diffusion equation on $\Omega \ =$ $[ 0 , 2 \pi ] \times [ 0 , 2 \pi ]$ ,
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
\left\{ \begin{array} { l l } { \frac { \partial u } { \partial t } } & { = a ( x , y ) u _ { x } + b ( x , y ) u _ { y } + c u _ { x x } + d u _ { y y } \qquad \mathrm { w i t h ~ } ( t , x , y ) \in [ 0 , 0 . 2 ] \times \Omega , } \\ { u | _ { t = 0 } } & { = u _ { 0 } ( x , y ) , } \end{array} \right.
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
where
|
| 234 |
+
|
| 235 |
+
$$
|
| 236 |
+
a ( x , y ) = 0 . 5 ( \cos ( y ) + x ( 2 \pi - x ) \sin ( x ) ) + 0 . 6 , b ( x , y ) = 2 ( \cos ( y ) + \sin ( x ) ) + 0 . 8 ,
|
| 237 |
+
$$
|
| 238 |
+
|
| 239 |
+
$c = 0 . 2$ and $d = 0 . 3$
|
| 240 |
+
|
| 241 |
+
The computation domain $\Omega$ is discretized using a $5 0 \times 5 0$ regular mesh. Data is generated by solving problem (8) using a high precision numerical scheme with pseudo-spectral method for spatial discretization and 4th order Runge-Kutta for temporal discretization (with time step size $\delta t = 0 . 0 1$ ). We assume periodic boundary condition and the initial value $u _ { 0 } ( x , y )$ is generated from
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
u _ { 0 } ( x , y ) = \sum _ { | k | , | l | \leq N } \lambda _ { k , l } \cos ( k x + l y ) + \gamma _ { k , l } \sin ( k x + l y ) ,
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
where $\begin{array} { r } { N = 9 , \lambda _ { k , l } , \gamma _ { k , l } \sim \mathcal { N } ( 0 , \frac { 1 } { 5 0 } ) } \end{array}$ , and $k$ and $l$ are chosen randomly. In order to mimic real world scenarios, we add noise to the generated data. For each sample sequence $u ( x , y , t ) , t \in [ 0 , 0 . 2 ]$ , the noise is added as
|
| 248 |
+
|
| 249 |
+
$$
|
| 250 |
+
\widehat { u } ( x , y , t ) = u ( x , y , t ) + 0 . 0 1 \times M W
|
| 251 |
+
$$
|
| 252 |
+
|
| 253 |
+
where $M = \operatorname* { m a x } _ { x , y , t } \{ u ( x , y , t ) \}$ , $W \sim \mathcal { N } ( 0 , 1 )$ and $\mathcal { N } ( 0 , 1 )$ represents the standard normal distribution.
|
| 254 |
+
|
| 255 |
+
Suppose we know a priori that the underlying PDE is linear with order no more than 4. Then, the response function $F$ takes the following form
|
| 256 |
+
|
| 257 |
+
$$
|
| 258 |
+
F = \sum _ { 0 \leq i + j \leq 4 } f _ { i j } ( x , y ) \frac { \partial ^ { i + j } u } { \partial x ^ { i } \partial y ^ { j } } .
|
| 259 |
+
$$
|
| 260 |
+
|
| 261 |
+
Each $\delta t$ -block of the PDE-Net can be written as
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\tilde { u } ( t _ { n + 1 } , \cdot ) = D _ { 0 } u ( t _ { n } , \cdot ) + \delta t \cdot ( c _ { 0 0 } D _ { 0 0 } u + c _ { 1 0 } D _ { 1 0 } u + \ldots + c _ { 0 4 } D _ { 0 4 } u ) ,
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
where $\{ D _ { 0 } , D _ { i j } : i + j \le 4 \}$ are convolution operators and $\{ c _ { i j } : i + j \leq 4 \}$ are 2D arrays which approximate functions $f _ { i j } ( x , y )$ on $\Omega$ . The approximation is achieved using piecewise quadratic polynomial interpolation with smooth transitions at the boundaries of each piece. The filters associated to the convolution operators $\{ D _ { 0 } , D _ { i j } : i + j \le 4 \}$ and the coefficients of the piecewise quadratic polynomials are the trainable parameters of the network.
|
| 268 |
+
|
| 269 |
+
During training and testing, the data is generated on-the-fly, i.e. we only generate the data needed following the aforementioned procedure when training and testing the PDE-Net. In our experiments, the size of the filters that will be used is $5 \times 5$ or $7 \times 7$ . The total number of trainable parameters for each $\delta t$ -block is approximately $1 7 \mathbf { k }$ . During training, we use LBFGS, instead of SGD, to optimize the parameters. We use 28 data samples per batch to train each layer (i.e. $\delta t$ -block) and we only construct the PDE-Net up to 20 layers, which requires totally 560 data samples per batch. Note that the PDE-Net is designed with the assumption that it approximates nonlinear evolution PDEs, which is a relatively stronger assumption than the networks in deep learning. Therefore, we require less training data and LBFGS performs better than SGD (which is widely adopted in deep learning). Furthermore, as will be shown by our numerical results, the learned PDE-Net generalizes very well. The PDE-Net can accurately predict the dynamics even when the initial data $u _ { 0 }$ does not come from the same distribution as in the training process.
|
| 270 |
+
|
| 271 |
+
# 3.2 RESULTS AND DISCUSSIONS
|
| 272 |
+
|
| 273 |
+
This section presents numerical results of training the PDE-Net using the data set described in the previous subsection. We will specifically observe how the learned PDE-Net performs in terms of prediction of dynamical behavior and identification of the underlying PDE model. Furthermore, we will investigate the effects of some of the hyper-parameters (e.g. size of the filters, number of $\delta t$ -blocks) on the learned PDE-Net.
|
| 274 |
+
|
| 275 |
+
# PREDICTING LONG-TIME DYNAMICS
|
| 276 |
+
|
| 277 |
+
We demonstrate the ability of the trained PDE-Net in prediction, which in the language of machine learning is the ability to generalize. After the PDE-Net with $n \delta t$ -blocks $1 \leq n \leq 2 0 ,$ ) is trained, we randomly generate 560 initial guesses based on (9) and (10), feed them to the PDE-Net, and measure the normalized error between the predicted dynamics (i.e. the output of the PDE-Net) and the actual dynamics (obtained by solving (8) using high precision numerical scheme). The normalized error between the true data $u$ and the predicted data $\tilde { u }$ is defined as
|
| 278 |
+
|
| 279 |
+
$$
|
| 280 |
+
\epsilon = \frac { \| \tilde { u } - u \| _ { 2 } ^ { 2 } } { \| u - \bar { u } \| _ { 2 } ^ { 2 } } ,
|
| 281 |
+
$$
|
| 282 |
+
|
| 283 |
+
where $\bar { u }$ is the spatial average of $u$ . The error plots are shown in Figure 3. Results of longer prediction for the PDE-Net with $7 \times 7$ learnable filters are shown in Figure 4. Some of the images of the predicted dynamics are presented in Figure 5. From these results, we can see that:
|
| 284 |
+
|
| 285 |
+
• Even trained with noisy data, the PDE-Net is able to perform long-term prediction (see Figure 5);
|
| 286 |
+
• Having multiple $\delta t$ -blocks helps with the stability of the PDE-Net and ensures long-term prediction (see Figure 3);
|
| 287 |
+
• The PDE-Net performs significantly better than Frozen-PDE-Net, especially for $7 \times 7$ filters (see Figure 3);
|
| 288 |
+
|
| 289 |
+
• The PDE-Net with $7 \times 7$ filters significantly outperforms the PDE-Net with $5 \times 5$ filters in terms of the length of reliable predictions (see Figure 3 and 4). To reach an $O ( 1 )$ error, the length of prediction for the PDE-Net with $7 \times 7$ filters is about 10 times of that for the PDE-Net with $5 \times 5$ filters.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 3: Prediction errors of the PDE-Net (orange) and Frozen-PDE-Net (blue) with $5 \times 5$ (first row) and $7 \times 7$ (second row) filters. In each plot, the horizontal axis indicates the time of prediction in the interval $( 0 , 6 0 \times \delta t ] = ( 0 , 0 . 6 ]$ , and the vertical axis shows the normalized errors. The banded curves indicate the $2 5 \%$ & $7 5 \%$ percentile of the normalized errors among 560 test samples.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 4: Long-time prediction for the PDE-Net with $7 \times 7$ filters. The horizontal axis ranges in $( 0 , 5 ]$ . Time step $\delta t = 0 . 0 1$ .
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 5: Images of the true dynamics and the predicted dynamics. The first row shows the images of the true dynamics. The second row shows the images of the predicted dynamics using the PDE-Net having $3 \delta t$ -blocks with $5 \times 5$ and $7 \times 7$ filters. Time step $\delta t = 0 . 0 1$ .
|
| 299 |
+
|
| 300 |
+
# DISCOVERING THE HIDDEN EQUATION
|
| 301 |
+
|
| 302 |
+
For the linear problem, identifying the PDE amounts to finding the coefficients $\{ c _ { i j } : i + j \leq 4 \}$ that approximate $\{ f _ { i j } : i + j \stackrel { . } { \le } 4 \bar \}$ . The coefficients $\{ c _ { i j } : i + j \leq 2 \}$ of the trained PDE-Net are shown in Figure 6. Note that $\{ f _ { 1 1 } \} \cup \{ f _ { i j } : 2 < i + j \leq 4 \}$ are absent from the PDE (8), and the corresponding coefficients learned by the PDE-Net are indeed close to zero. In order to have a more concise demonstration of the results, we only show the image of $\{ c _ { i j } : i + j \leq 2 \}$ in Figure 6.
|
| 303 |
+
|
| 304 |
+
Comparing the first three rows of Figure 6, the coefficients $\{ c _ { i j } \}$ learned by the PDE-Net are close to the true coefficients $\{ f _ { i j } \}$ except for some oscillations due to the presence of noise in the training data. Furthermore, the last row of Figure 6 indicates that having multiple $\delta t$ -blocks helps with estimation of the coefficients. However, having larger filters does not seem to improve the learning of the coefficients, though it helps tremendously in prolonging predictions of the PDE-Net.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 6: First row: the true coefficients of the equation. From the left to right are coefficients of $u$ , $u _ { x }$ , $u _ { y }$ , $u _ { x x }$ , $u _ { x y }$ and $u _ { y y }$ . Second row: the learned coefficients by the PDE-Net with $6 \delta t$ -blocks and $5 \times 5$ filters. Third row: the learned coefficients by the PDE-Net with 6 $\delta t$ -blocks and $7 \times 7$ filters. Last row: the errors between true and learned coefficients v.s. number of $\delta t$ -blocks $( 1 , 2 , \ldots , 1 3 )$ with different sizes of filters (blue for $5 \times 5$ and orange for $7 \times 7$ ).
|
| 308 |
+
|
| 309 |
+
# FURTHER EXPERIMENTS
|
| 310 |
+
|
| 311 |
+
To further demonstrate how well the learned PDE-Net generalizes, we generate initial values following (9) with highest frequency equal to 12, followed by adding noise (10). Note that the maximum allowable frequency in the training set is 9. The results of long-time prediction and the estimated dynamics are shown in Figure 7. Although oscillations are observed in the prediction, the estimated dynamic still captures the main pattern of the true dynamic.
|
| 312 |
+
|
| 313 |
+
The PDE (8) is of second order. In our previous experiments, we assumed that the PDE does not exceed the 4th order. If we know that the PDE is of second order, we will be able to have a more accurate estimation of the variable coefficients of the convection and diffusion terms. However, the prediction errors are slightly higher since we have fewer trainable parameters. Nonetheless, since we are using a more accurate prior knowledge on the unknown PDE, the variance of the prediction errors are smaller than before. These results are summarized in Figure 8 (green curves) and Figure 9.
|
| 314 |
+
|
| 315 |
+
To further demonstrate the importance of the moment constraints on the filters in the PDE-Net, we trained the network without any moment constraints and skipped any steps that utilize the knowledge of the relation between the filters and differential operators (i.e. we skipped warm-up and the initialization using finite difference filters). For simplicity, we call the PDE-Net train in this way as the Freed-PDE-Net. The prediction errors of the Freed-PDE-Net are shown as the red curves in Figure 8. Since without moment constraints, we do not know the correspondence of the filters with differential operators. Therefore, we cannot identify the correspondence of the learned variable coefficients either. We plot all the 15 variable coefficients (assuming the underlying PDE is of order $\leq 4$ ) in Figure 10. As one can see that the Freed-PDE-Net is better in prediction than the PDE-Net since it has more trainable parameters than the PDE-Net. However, we are unable to identify the PDE from the Free-PDE-Net.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 7: Testing with higher frequency initializations (linear convection-diffusion equation). First row: long-time prediction. Second row: estimated dynamics. Here, $\delta t = 0 . 0 1$ .
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 8: Prediction errors of the PDE-Net assuming the underlying PDE has order $\leq 4$ (orange), order $\leq 2$ (green) and Freed-PDE-Net (red) with $7 \times 7$ filters. In each plot, the horizontal axis indicates the time of prediction in the interval $( 0 , 8 0 \times \delta t ] = ( 0 , 0 . 8 ]$ , and the vertical axis shows the normalized errors. The banded curves indicate the $2 5 \%$ & $7 5 \%$ percentile of the normalized errors among 560 test samples.
|
| 322 |
+
|
| 323 |
+
# QUICK SUMMARY:
|
| 324 |
+
|
| 325 |
+
In summary, the numerical experiments show that the PDE-Net is able to conduct accurate prediction and identify the underlying PDE model at the same time, even in a noisy environment. Multiple $\delta t$ -blocks, i.e. deeper structure of the PDE-Net, makes the PDE-Net more stable and enables longer time prediction. Furthermore, using larger filters helps with stability and can prolong reliable predictions. Comparisons of the PDE-Net with the Frozen-PDE-Net and Freed-PDE-Net demonstrate the importance of using learnable and yet partially constrained filters, which is new to the literature.
|
| 326 |
+
|
| 327 |
+
# 4 NUMERICAL STUDIES: DIFFUSION EQUATIONS WITH NONLINEAR SOURCE
|
| 328 |
+
|
| 329 |
+
When modeling physical processes like particle transportation or energy transfer, in addition to convection and diffusion, we have to consider source/sink terms. In some problems, the source/sink plays an important role. For example, when convection-diffusion equations are used to describe the distribution and flow of pollutants in water or atmosphere, identifying the intensity of pollution source is equivalent to finding the source term, which is important for environmental pollution control problems.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 9: First row: the true coefficients of the equation. From the left to right are coefficients of $u$ , $u _ { x }$ , $u _ { y }$ , $u _ { x x }$ , $u _ { x y }$ and $u _ { y y }$ . Second row: the learned coefficients by the PDE-Net assuming the order of the PDE is $\leq 4$ (same as the third row of Figure 6). Third row: the learned coefficients by the PDE-Net assuming the order of the PDE is $\leq 2$ . Last row: the errors between true and learned coefficients v.s. number of $\delta t$ -blocks $( 1 , 2 , \ldots , 1 3 )$ for PDE-Net assuming the PDE is of order $\leq 4$ (orange) and $\leq 2$ (green).
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 10: The images of all the variable coefficients learned from the Freed-PDE-Net.
|
| 336 |
+
|
| 337 |
+
# 4.1 SIMULATED DATA, TRAINING AND TESTING
|
| 338 |
+
|
| 339 |
+
We consider a 2-dimensional linear diffusion equation with a nonlinear source on $\Omega = [ 0 , 2 \pi ] \times$ $[ 0 , 2 \pi ]$ ,
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\left\{ \begin{array} { l l } { \frac { \partial u } { \partial t } } & { = c \Delta u + f _ { s } ( u ) } \\ { u | _ { t = 0 } } & { = u _ { 0 } ( x , y ) , } \end{array} \right. \quad \mathrm { w i t h ~ } ( t , x , y ) \in [ 0 , 0 . 2 ] \times \Omega ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where $c = 0 . 3$ and $f _ { s } ( u ) = 1 5 \sin ( u )$ . The computation domain $\Omega$ is discretized using a $5 0 \times 5 0$ regular mesh. Data is generated by solving problem (11) using forward Euler for temporal discretization (with time step size $\delta t = 0 . 0 0 0 9 )$ and central differencing for spatial discretization on $1 0 0 \times 1 0 0$ mesh, and then restricted to the $5 0 \times 5 0$ mesh. We assume zero boundary condition and the initial value $u _ { 0 } ( x , y )$ is generated by $\begin{array} { r } { u _ { 0 } ( x , y ) = u _ { 0 } ^ { \prime } ( x , y ) \frac { x ( 2 \pi - x ) y ( 2 \pi - y ) } { ( 2 \pi ) ^ { 4 } } } \end{array}$ ) x(2π−x)y(2π−y)4 , where u0 is obtained from (9) with maximum allowable frequency $N = 6$ . Same as the numerical setting in Section 3, Gaussian noise is added to each sample sequence $u ( x , y , t ) , t \in [ 0 , 0 . 2 ]$ as described by (10).
|
| 346 |
+
|
| 347 |
+
Suppose we know a priori that the underlying PDE is a convection-diffusion equation of order no more than 2 with a nonlinear source depending on the variable $u$ . Then, the response function $F$ takes the following form
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
F = \sum _ { 1 \leq i + j \leq 2 } f _ { i j } ( x , y ) \frac { \partial ^ { i + j } u } { \partial x ^ { i } \partial y ^ { j } } + f _ { s } ( u ) .
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Each $\delta t$ -block of the PDE-Net can be written as
|
| 354 |
+
|
| 355 |
+
$\check { \iota } ( t _ { n + 1 } , \cdot ) = D _ { 0 } u ( t _ { n } , \cdot ) + \delta t \cdot \left( c _ { 0 1 } D _ { 0 1 } u + c _ { 1 0 } D _ { 1 0 } u + c _ { 1 1 } D _ { 1 1 } u + c _ { 2 0 } D _ { 2 0 } u + c _ { 0 2 } D _ { 0 2 } u \right) + \tilde { f } _ { s } ( u ) ,$ where $\{ D _ { 0 } , D _ { i j } : 1 \le i + j \le 2 \}$ are convolution operators and $\{ c _ { i j } : 1 \le i + j \le 2 \}$ are 2D arrays which approximate functions $f _ { i j } ( x , y )$ on $\Omega$ . The approximation is achieved using piecewise quadratic polynomial interpolation with smooth transitions at the boundaries of each piece. The approximation of $\tilde { f } _ { s }$ is obtained by piecewise 4th order polynomial approximation over a regular grid of the interval $[ - 3 0 , 3 0 ]$ with 40 grid points. The training and testing strategy is exactly the same as in Section 3. In our experiments, the size of the filters is $7 \times 7$ . The total number of trainable parameters for each $\delta t$ -block is approximately $1 . 2 \mathrm { k }$ .
|
| 356 |
+
|
| 357 |
+
# 4.2 RESULTS AND DISCUSSIONS
|
| 358 |
+
|
| 359 |
+
This section presents numerical results of the trained PDE-Net using the data set described in Section 4.1. We will observe how the trained PDE-Net performs in terms of prediction of dynamical behavior and identification of the underlying PDE model.
|
| 360 |
+
|
| 361 |
+
# PREDICTING LONG-TIME DYNAMICS
|
| 362 |
+
|
| 363 |
+
We demonstrate the ability of the trained PDE-Net in prediction, which in the language of machine learning is the ability to generalize. The testing method is exactly the same as the method described in Section 3. Comparisons between PDE-Net and Frozen-PDE-Net are shown in Figure 11, where we can clearly see the advantage of learning the filters. Long-time predictions of the PDE-Net is shown in Figure 12 and we visualize the predicted dynamics in Figure 13. To further demonstrate how well the learned PDE-Net generalizes, we generate initial values following (9) with highest frequency equal to 10, followed by adding noise (10). Note that the maximum allowable frequency in the training set is only 6. The results of long-time prediction and the estimated dynamics are shown in Figure 14. All these results show that the learned PDE-Net performs well in prediction.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 11: Prediction errors of the PDE-Net (orange) and Frozen-PDE-Net (blue) with $7 \times 7$ filters. In each plot, the horizontal axis indicates the time of prediction in the interval $( 0 , 0 . 6 ]$ , and the vertical axis shows the normalized errors. The banded curves indicate the $2 5 \%$ & $7 5 \%$ percentile of the normalized errors among 560 test samples.
|
| 367 |
+
|
| 368 |
+
# DISCOVERING THE HIDDEN EQUATION
|
| 369 |
+
|
| 370 |
+
For the PDE (11), identifying the PDE amounts to finding the coefficients $\{ c _ { i j } : 1 \le i + j \le 2 \}$ that approximate $\{ f _ { i j } : 1 \le i + j \le 2 \}$ , and $\tilde { f } _ { s }$ that approximates $f _ { s }$ . The computed coefficients $\{ c _ { i j } : 1 \le i + j \le 2 \}$ of the trained PDE-Net are shown in Figure 15, and the computed $\tilde { f } _ { s }$ is shown in Figure 16 (left). Note that the first order terms are absent from the PDE (11), and the corresponding coefficients learned by the PDE-Net are indeed close to zero. The approximation of $f _ { s }$ is more accurate near the center of the interval than near the boundary. This is because the value of $u$ in the data set is mostly distributed near the center (Figure 16(right)).
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 12: Long-time prediction for the PDE-Net with $7 \times 7$ filters in $( 0 , 2 ]$ .
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 13: Images of the true dynamics and the predicted dynamics. The first row shows the images of the true dynamics. The second row shows the images of the predicted dynamics using the PDENet having $3 \delta t$ -blocks with $7 \times 7$ filters. Here, $\delta t = 0 . 0 1$ .
|
| 377 |
+
|
| 378 |
+
# 5 CONCLUSION AND DISCUSSION
|
| 379 |
+
|
| 380 |
+
In this paper, we designed a deep feed-forward network, called the PDE-Net, to discover the hidden PDE model from the observed dynamics and to predict the dynamical behavior. The PDE-Net consists of two major components which are jointly trained: to approximate differential operations by convolutions with properly constrained filters, and to approximate the nonlinear response by deep neural networks or other machine learning methods. The PDE-Net is suitable for learning PDEs as general as in (1). However, if we have a prior knowledge on the form of the response function $F$ , we can easily adjust the network architecture by taking advantage of the additional information. This may simplify the training and improve the results. As an example, we considered a linear variable-coefficient convection-diffusion equation. The results show that the PDE-Net can uncover the hidden equation of the observed dynamics, and predict the dynamical behavior for a relatively long time, even in a noisy environment. Furthermore, having deep structure (i.e. multiple $\delta t$ -blocks) and larger learnable filters can improve the PDE-Net in terms of stability and can prolong reliable predictions. As part of the future work, we will try the proposed framework on real data sets. One of the important directions is to uncover hidden variables which cannot be measured by sensors directly, such as in data assimilation. Another interesting direction which is worth exploring is to learn stable and consistent numerical schemes for a given PDE model based on the architecture of the PDE-Net.
|
| 381 |
+
|
| 382 |
+
# REFERENCES
|
| 383 |
+
|
| 384 |
+
Josh Bongard and Hod Lipson. Automated reverse engineering of nonlinear dynamical systems. Proceedings of the National Academy of Sciences, 104(24):9943–9948, 2007.
|
| 385 |
+
|
| 386 |
+
Steven L Brunton, Joshua L Proctor, and J Nathan Kutz. Discovering governing equations from data by sparse identification of nonlinear dynamical systems. Proceedings of the National Academy of
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 14: Testing with higher frequency initializations (diffusion equation with a nonlinear source). First row: long-time prediction. Second row: estimated dynamics.Here, $\delta t = 0 . 0 1$ .
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 15: First row: the true coefficients $\{ f _ { i j } : 1 \le i + j \le 2 \}$ of the equation. Second row: the learned coefficients $\{ c _ { i j } : 1 \le i + j \le 2 \}$ by the PDE-Net with 3 $\delta t$ -blocks and $7 \times 7$ filters.
|
| 393 |
+
|
| 394 |
+
Sciences, 113(15):3932–3937, 2016.
|
| 395 |
+
|
| 396 |
+
Jian-Feng Cai, Bin Dong, Stanley Osher, and Zuowei Shen. Image restoration: total variation, wavelet frames, and beyond. Journal of the American Mathematical Society, 25(4):1033–1089, 2012.
|
| 397 |
+
|
| 398 |
+
Subrahmanyan Chandrasekhar. Stochastic problems in physics and astronomy. Reviews of modern physics, 15(1):1, 1943.
|
| 399 |
+
|
| 400 |
+
Yunjin Chen, Wei Yu, and Thomas Pock. On learning optimized reaction diffusion processes for effective image restoration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5261–5269, 2015.
|
| 401 |
+
|
| 402 |
+
Ingrid Daubechies. Ten lectures on wavelets. SIAM, 1992.
|
| 403 |
+
|
| 404 |
+
Bin Dong, Qingtang Jiang, and Zuowei Shen. Image restoration: wavelet frame shrinkage, nonlinear evolution pdes, and beyond. Multiscale Modeling & Simulation, 15(1):606–660, 2017.
|
| 405 |
+
|
| 406 |
+
Weinan E. A proposal on machine learning via dynamical systems. Communications in Mathematics and Statistics, 5(1):1–11, 2017.
|
| 407 |
+
|
| 408 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. MIT press, 2016.
|
| 409 |
+
|
| 410 |
+
Eldad Haber and Lars Ruthotto. Stable architectures for deep neural networks. arXiv preprint arXiv:1705.03341, 2017.
|
| 411 |
+
|
| 412 |
+
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, pp. 770–778, 2016a.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 16: Left: the true source function $f _ { s }$ and estimated source function $\tilde { f } _ { s }$ . Right: distribution of the values of $u$ during training.
|
| 416 |
+
|
| 417 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European Conference on Computer Vision, pp. 630–645. Springer, 2016b.
|
| 418 |
+
|
| 419 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. arXiv preprint arXiv:1312.4400, 2013.
|
| 420 |
+
|
| 421 |
+
Yiping Lu, Aoxiao Zhong, Quanzheng Li, and Bin Dong. Beyond finite layer neural networks: Bridging deep architectures and numerical differential equations. ArXiv preprint, 2017.
|
| 422 |
+
|
| 423 |
+
Stephane Mallat. ´ A wavelet tour of signal processing. Academic press, 1999.
|
| 424 |
+
|
| 425 |
+
Maziar Raissi and George Em Karniadakis. Hidden physics models: Machine learning of nonlinear partial differential equations. arXiv preprint arXiv:1708.00588, 2017.
|
| 426 |
+
|
| 427 |
+
Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part ii): Data-driven discovery of nonlinear partial differential equations. arXiv preprint arXiv:1711.10566, 2017.
|
| 428 |
+
|
| 429 |
+
Samuel H Rudy, Steven L Brunton, Joshua L Proctor, and J Nathan Kutz. Data-driven discovery of partial differential equations. Science Advances, 3(4):e1602614, 2017.
|
| 430 |
+
|
| 431 |
+
Hayden Schaeffer. Learning partial differential equations via data discovery and sparse optimization. In Proc. R. Soc. A, volume 473, pp. 20160446. The Royal Society, 2017.
|
| 432 |
+
|
| 433 |
+
Michael Schmidt and Hod Lipson. Distilling free-form natural laws from experimental data. science, 324(5923):81–85, 2009.
|
| 434 |
+
|
| 435 |
+
Sho Sonoda and Noboru Murata. Double continuum limit of deep neural networks. ICML Workshop on Principled Approaches to Deep Learning, Sydney, Australia, 2017.
|
| 436 |
+
|
| 437 |
+
Zongmin Wu and Ran Zhang. Learning physics by data for the motion of a sphere falling in a non-newtonian fluid non-newtonian fluid. preprint, 2017.
|
md/train/Uq_tGs7N54M/Uq_tGs7N54M.md
ADDED
|
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Robust Counterfactual Explanations on Graph Neural Networks
|
| 2 |
+
|
| 3 |
+
# Mohit Bajaj1\* Lingyang $\mathbf { C h u ^ { 2 * } }$ Zi Yu Xue1,3Jian Pei4 Lanjun Wang1Peter Cho-Ho Lam1Yong Zhang1
|
| 4 |
+
|
| 5 |
+
1Huawei Technologies Canada Co., Ltd. 2McMaster University 3 The University of British Columbia 4Simon Fraser University {mohit.bajaj1,zi.yu.xue,lanjun.wang,cho.ho.lam,yong.zhang3}@huawei.com chul9@mcmaster.ca,jpei@cs.sfu.ca
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Massive deployment of Graph Neural Networks (GNNs) in high-stake applications generates a strong demand for explanations that are robust to noise and align well with human intuition. Most existing methods generate explanations by identifying a subgraph of an input graph that has a strong correlation with the prediction. These explanations are not robust to noise because independently optimizing the correlation for a single input can easily overfit noise.Moreover, they are not counterfactual because removing an identified subgraph from an input graph does not necessarily change the prediction result. In this paper, we propose a novel method to generate robust counterfactual explanations on GNNs by explicitly modelling the common decision logic of GNNs on similar input graphs. Our explanations are naturally robust to noise because they are produced from the common decision boundaries of a GNN that govern the predictions of many similar input graphs. The explanations are also counterfactual because removing the set of edges identified by an explanation from the input graph changes the prediction significantly. Exhaustive experiments on many public datasets demonstrate the superior performance of our method.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Graph Neural Networks (GNNs) [22,37,50] have achieved great practical successes in many realworld applications,such as chemistry [31],molecular biology[17],social networks [3] and epidemic modelling [34]. For most of these applications, explaining predictions made by a GNN model is crucial for establishing trust with end-users,identifying the cause of a prediction,and even discovering potential deficiencies of a GNN model before massive deployment. Ideally,an explanation should be able to answer questions like “Would the prediction of the GNN model change if a certain part of an input molecule is removed?” in the context of predicting whether an artificial molecule is active for acertain type of proteins [19,41],“Would an item recommended stillbe recommended if a customer had not purchased some other items in the past?” for a GNN built for recommendation systems [9, 44].
|
| 14 |
+
|
| 15 |
+
Counterfactual explanations [28] in the form of “If X had not occurred, Y would not have occurred”[26] are the principled way to answer such questions and thus are highly desirable for GNNs. In the context of GNNs,a counterfactual explanation identifies a small subset of edges of the input graph instance such that removing those edges significantly changes the prediction made by the GNN. Counterfactual explanations are usually concise and easy to understand [28,36] because they align well with the human intuition to describe a causal situation [26]. To make explanations more trustworthy, the counterfactual explanation should be robust to noise,that is,some slight changes on an input graph do not change the explanation significantly. This idea aligns well with the notion of robustness discussed for DNN explanations in computer vision domain [11]. According to Ghorbani et al.[11] many interpretations on neural networks are fragile as it is easier to generate adversarial perturbations that produce perceptively indistinguishable inputs that are assigned the same predicted label,yet have very different interpretations.Here,the concepts of “fragile”“robustness”describe the same concept from opposite perspectives. An interpretation is said to be fragile if systematic perturbations can lead to dramatically different interpretations without changing the label. Otherwise, the interpretation is said to be robust.
|
| 16 |
+
|
| 17 |
+
How to produce robust counterfactual explanations on predictions made by general graph neural networks is a novel problem that has not been systematically studied before.As to be discussed in Section 2, most GNN explanation methods [45,25,46,37,32] are neither counterfactual nor robust. These methods mostly focus on identifying a subgraph of an input graph that achieves a high correlation with the prediction result. Such explanations are usually not counterfactual because, due to the high non-convexity of GNNs, removing a subgraph that achieves a high correlation does not necessarily change the prediction result. Moreover, many existing methods [45,25,37,32] are not robust to noise and may change significantly upon slight modifications on input graphs, because the explanation of every single input graph prediction is independently optimized to maximize the correlation with the prediction, thus an explanation can easily overfit the noise in the data.
|
| 18 |
+
|
| 19 |
+
In this paper², we develop RCExplainer, a novel method to produce robust counterfactual explanations on GNNs. The key idea is to first model the common decision logic of a GNN by set of decision regions where each decision region governs the predictions on a large number of graphs,and then extract robust counterfactual explanations by a deep neural network that explores the decision logic carried by the linear decision boundaries of the decision regions. We make the following contributions.
|
| 20 |
+
|
| 21 |
+
First, we model the decision logic of a GNN by a set of decision regions, where each decision region is induced by a set of linear decision boundaries of the GNN. We propose an unsupervised method to find decision regions for each class such that each decision region governs the prediction of multiple graph samples predicted to be the same class. The linear decision boundaries of the decision region capture the common decision logic on all the graph instances inside the decision region, thus do not easily overfit the noise of an individual graph instance. By exploring the common decision logic encoded in the linear boundaries, we are able to produce counterfactual explanations that are inherently robust to noise.
|
| 22 |
+
|
| 23 |
+
Second, based on the linear boundaries of the decision region,we propose a novel loss function to train a neural network that produces a robust counterfactual explanation as a small subset of edges of an input graph. The loss function is designed to directly optimize the explainability and counterfactual property of the subset of edges,such that: 1) the subgraph induced by the edges lies within the decision region,thus has a prediction consistent with the input graph; and 2) deleting the subset of edges from the input graph produces a remainder subgraph that lies outside the decision region, thus the prediction on the remainder subgraph changes significantly.
|
| 24 |
+
|
| 25 |
+
Last, we conduct comprehensive experimental study to compare our method with the state-of-the-art methods on fidelity, robustness,accuracy and efficiency. All the results solidly demonstrate the superior performance of our approach.
|
| 26 |
+
|
| 27 |
+
# 2Related work
|
| 28 |
+
|
| 29 |
+
The existing GNN explanation methods [46,37, 45,32, 25] generally fall into two categories: model level explanation [46] and instance level explanation [37,45,32, 25].
|
| 30 |
+
|
| 31 |
+
A model level explanation method [46] produces a high-level explanation about the general behaviors of a GNN independent from input examples. This may be achieved by synthesizing a set of artificial graph instances such that each artificial graph instance maximizes the prediction score on a certain class. The weakness of model level explanation methods is that an input graph instance may not contain an artificial graph instance,and removing an artificial graph from an input graph does not necessarily change the prediction. As a result, model level explanations are substantially different from counterfactual explanations, because the synthesized artificial graphs do not provide insights into how the GNN makes its prediction on a specific input graph instance.
|
| 32 |
+
|
| 33 |
+
The instance level explanation methods [37,45,32, 25] explain the prediction(s) made by a GNN on a specific input graph instance or multiple instances by identifying a subgraph of an input graph instance that achieves a high correlation with the prediction on the input graph. GNNExplainer [45] removes redundant edges from an input graph instance to produce an explanation that maximizes the mutual information between the distribution of subgraphs of the input graph and the GNN's prediction. Following the same idea by Ying et al. [45],PGExplainer [25] parameterizes the generation process of explanations by a deep neural network,and trains it to maximize a similar mutual information based loss used by GNNExplainer [45]. The trained deep neural network is then applied to generate explanations for a single input graph instance or a group of input graphs. MEG [30] incorporates strong domain knowledge in chemistry with a reinforcement learning framework to produce counterfactual explanations on GNNs specifically built for compound prediction, but the heavy reliance on domain knowledge largely limits its applicability on general GNNs. The recently proposed CF-GNNExplainer [24] independently optimizes the counterfactual property for each explanation but ignores the correlation between the prediction and the explanation.
|
| 34 |
+
|
| 35 |
+
Some studies [32,37] also adapt the existing explanation methods of image-oriented deep neural networks to produce instance level explanations for GNNs.Pope et al.[32] extend several gradient based methods [33,35,49] to explain predictions made by GNNs. The explanations are prone to gradient saturation[12] and may also be misleading [1] due to the heavy reliance on noisy gradients. Velickovic et al.[37] extend the atention mechanism[7,8] to identify the nodes in an input graph that contribute the most to the prediction.This method has to retrain the GNN with the altered architecture and the inserted attntion layers.Thus,the explanations may not be faithful to the original GNN.
|
| 36 |
+
|
| 37 |
+
Instance level explanations from most of the methods are usually not counterfactual because, due to the non-convexity of GNNs, removing an explanation subgraph from the input graph does not necessarily change the prediction result. Moreover, those methods [45,25,37,32, 24] are usually not robust to noise because the explanation of every single input graph prediction is independently optimized. Thus,an explanation can easily overfit the noise inside input graphs and may change significantly upon slight modifications on input graphs.
|
| 38 |
+
|
| 39 |
+
To tackle the weaknesses in the existing methods, in this paper, we directly optimize the counterfactual property of an explanation along with the correlation between the explanation and the prediction. Our explanations are also much more robust to modifications on input graphs,because they are produced from the common decision logic on a large group of similar input graphs, which do not easily overfit the noise of an individual graph sample.
|
| 40 |
+
|
| 41 |
+
Please note that our study is substantially different from adversarial attacks on GNNs.The adversarial attacking methods [51,53,42,43,20] use adversarial examples to change the predictions of GNNs but ignore the explainability of the generated adversarial examples [1O]. Thus, the adversarial examples generated by adversarial attcks may not explain the original prediction.
|
| 42 |
+
|
| 43 |
+
Our method is substantially different from the above works because we focus on explaining the prediction by directly optimizing the counterfactual property of an explanation along with correlation of the explanation with the prediction. We also require that the explanation is generally valid for a large set of similar graph instances by extracting it from the common linear decision boundaries of a large decision region.
|
| 44 |
+
|
| 45 |
+
# 3Problem Formulation
|
| 46 |
+
|
| 47 |
+
Denote by $G = \{ V , E \}$ a graph where $V = \{ v _ { 1 } , v _ { 2 } , \ldots , v _ { n } \}$ is the set of $n$ nodes and $E \subseteq V \times V$ is the set of edges. The edge structure of a graph $G$ is described by an adjacency matrix $\mathbf { A } \in \{ 0 , 1 \} ^ { n \times n }$ where ${ \bf A } _ { i j } = 1$ if there is an edge between node $v _ { i }$ and $v _ { j }$ ; and ${ \bf A } _ { i j } = 0$ otherwise.
|
| 48 |
+
|
| 49 |
+
Denote by $\phi$ a GNN model that maps a graph to a probability distribution over a set of classes denoted by $C$ . Let $D$ denote the set of graphs that are used to train the GNN model $\phi$ .We focus on GNNs that adopt piecewise linear activation functions,such as MaxOut[14] and the family of ReLU[13,15,29].
|
| 50 |
+
|
| 51 |
+
The robust counterfactual explanation problem is defined as follows.
|
| 52 |
+
|
| 53 |
+
Definition 1 (Robust Counterfactual Explanation Problem) Given a GNN model $\phi$ trained on a set of graphs $D$ , for an input graph $G = \{ V , E \}$ , our goal is to explain why $G$ is predicted by the GNN model as $\phi ( G )$ by identifying a small subset of edges $S \subseteq E$ ,such that $( l )$ removing the set of edges in $S$ from $G$ that causes the maximum drop in the confidence of the original prediction; and (2) $S$ is stable and doesn't change when the edges and the feature representations of the nodes of $G$ are perturbed by random noise.
|
| 54 |
+
|
| 55 |
+
In the definition,the first requirement requires that the explanation $S$ is counterfactual, and the second requirement requires that the explanation is robust to noisy changes on the edges and nodes of $G$ :
|
| 56 |
+
|
| 57 |
+
# 4Method
|
| 58 |
+
|
| 59 |
+
In this section, we first introduce how to extract the common decision logic of a GNN on a large set of graphs with the same predicted class. This is achieved by a decision region induced by a set of linear decision boundaries of the GNN.Then, based on the linear boundaries of the decision region, we propose a novel lossfunction to train a neural network that produces robust counterfactual explanations.Last, we discuss the time complexity of our method when generating explanations.
|
| 60 |
+
|
| 61 |
+
# 4.1Modelling Decision Regions
|
| 62 |
+
|
| 63 |
+
Following the routines of many deep neural network explanation methods [33, 48], we extract the decision region of a GNN in the $d$ -dimensional output space $\mathbb { O } ^ { d }$ of the last convolution layer of the GNN. The features generated by the last convolution layer are more conceptually meaningful and more robust to noise than those raw features of input graphs,such as vertices and edges [52, 2]. Denote by $\phi _ { g c }$ the mapping function realized by the graph convolution layers that maps an input graph $G$ to its graph embedding $\phi _ { g c } ( G ) \in \mathbb { O } ^ { d }$ ,and by $\phi _ { f c }$ the mapping function realized by the fully connected layers that maps the graph embedding $\phi _ { g c } ( G )$ to a predicted distribution over the classes in $C$ . The overall prediction $\phi ( { \bar { G } } )$ made by the GNN can be writtn as $\phi ( G ) = \phi _ { f c } ( \phi _ { g c } ( G ) )$
|
| 64 |
+
|
| 65 |
+
For the GNNs that adopt piecewise linear activation functions for the hidden neurons, such as MaxOut [14] and the family of ReLU [13,15,29], the decision logic of $\phi _ { f c }$ in the space $\mathbb { O } ^ { d }$ is characterized by a piecewise linear decision boundary formed by connected pieces of decision hyperplanes in $\mathbb { O } ^ { d }$ [1]. We call these hyperplanes linear decision boundaries (LDBs), and denote by $\mathcal { H }$ the set of LDBs induced by $\phi _ { f c }$ . The set of LDBs in $\mathcal { H }$ partitions the space $\mathbb { O } ^ { d }$ into a large number of convex polytopes. A convex polytope is formed by a subset of LDBs in $\mathcal { H }$ . All the graphs whose graph embeddings are contained in the same convex polytope are predicted as the same class [4]. Therefore, the LDBs of a convex polytope encode the common decision logic of $\phi _ { f c }$ on all the graphs whose graph embeddings lie within the convex polytope [4]. Here,a graph $G$ is covered by a convex polytope if the graph embedding $\phi _ { g c } ( G )$ is contained in the convex polytope.
|
| 66 |
+
|
| 67 |
+
Based on the above insight, we model the decision region for a set of graph instances as a convex polytope that satisfies the following two properties. First, the decision region should be induced by a subset of the LDBs in $\mathcal { H }$ .In this way, when we extract counterfactual explanations from the LDBs, the explanations are loyal to the real decision logic_of the GNN. Second, the decision region should cover many graph instances in the training dataset $D$ ,and all the covered graphs should be predicted as the same class. In this way, the LDBs of the decision region capture the common decision logic on all the graphs covered by the decision region. Here, the requirement of covering a larger number of graphs ensures that the common decision logic is general,and thus it is lesslikely to overfit the noise of an individual graph instance. As a result, the counterfactual explanations extracted from the LDBs of the decision region are insensitive to slight changes in the input graphs. Our method can be easily generalized to incorporate prediction confidence in the coverage measure,such as considering the count of graphs weighted by prediction confidence. To keep our discusson simple, we do not pursue this detail further in the paper.
|
| 68 |
+
|
| 69 |
+
Next, we illustrate how to extract a decision region satisfying the above two requirements. The key idea is to find a convex polytope covering a large set of graph instances in $D$ that are predicted as the same class $c \in C$ :
|
| 70 |
+
|
| 71 |
+
Denote by $D _ { c } \subseteq D$ the set of graphs in $D$ predicted as a class $c \in C$ ,by $\mathcal { P } \subseteq \mathcal { H }$ a set of LDBs that partition the space $\mathbb { O } ^ { d }$ into a set of convex polytopes, and by $r ( \mathcal { P } , c )$ the convex polytope induced by $\mathcal { P }$ that covers the largest number of graphs in $D _ { c }$ . Denote by $g ( \mathcal { P } , c )$ the number of graphs in $D _ { c }$ covered by $r ( \mathcal { P } , c )$ ,and by $h ( \mathcal { P } , c )$ the number of graphs in $D$ that are covered by $r ( \mathcal { P } , \bar { c } )$ but are not predicted as class $c$ . We extract a decision region covering a large set of graph instances in $D _ { c }$ by solving the following constrained optimization problem.
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\operatorname* { m a x } _ { \mathcal { P } \subseteq \mathcal { H } } g ( \mathcal { P } , c ) , \mathrm { ~ s . t . ~ } h ( \mathcal { P } , c ) = 0
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
This formulation realizes the two properties of decision regions because $\mathcal { P } \subseteq \mathcal { H }$ ensures that the decision region is induced by a subset of LDBs in $\mathcal { H }$ ,maximizing $g ( \mathcal { P } , c )$ requires that $r ( \mathcal { P } , c )$ covers
|
| 78 |
+
|
| 79 |
+
a large number of graphs in $D _ { c }$ , and the constraint $h ( \mathcal { P } , c ) = 0$ ensures that allthe graphs covered by $r ( \mathcal { P } , c )$ are predicted as the same class $c$ :
|
| 80 |
+
|
| 81 |
+
Once we find a solution $\mathcal { P }$ to the above problem, the decision region $r ( \mathcal { P } , c )$ can be easily obtained by first counting the number of graphs in $D _ { c }$ covered by each convex polytope induced by $\mathcal { P }$ ,and then select the convex polytope that covers the largest number of graphs in $D _ { c }$ :
|
| 82 |
+
|
| 83 |
+
# 4.2Extracting Decision Regions
|
| 84 |
+
|
| 85 |
+
The optimization problem in Equation (1) is intractable for standard GNNs, mainly because it is impractical to compute $\mathcal { H }$ , all the LDBs of a GNN. The number of LDBs in $\mathcal { H }$ of a GNN is exponential with respect to the number of neurons in the worst case [27].To address this challenge,we substitute $\mathcal { H }$ by a sample $\tilde { \mathcal { H } }$ of LDBs from $\tilde { \mathcal { H } }$ :
|
| 86 |
+
|
| 87 |
+
A LDB in the space $\mathbb { O } ^ { d }$ can be written as $\mathbf { w } ^ { \top } \mathbf { x } + b = 0$ ,where is $\mathbf { x } \in \mathbb { O } ^ { d }$ is a variable, w is the basis term, and $b$ corresponds to the bias.Following [4], for any input graph $G$ ,a linear boundary can be sampled from $\mathcal { H }$ by computing
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\mathbf { w } = \frac { \partial \left( \operatorname* { m a x } _ { 1 } ( \phi _ { f c } ( \alpha ) ) - \operatorname* { m a x } _ { 2 } ( \phi _ { f c } ( \alpha ) ) \right) } { \partial \alpha } | _ { \alpha = \phi _ { g c } ( G ) } ,
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
and
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
b = \mathrm { m a x } _ { 1 } ( \phi _ { f c } ( \alpha ) ) - \mathrm { m a x } _ { 2 } ( \phi _ { f c } ( \alpha ) ) - \mathbf { w } ^ { T } { \alpha } | _ { \alpha = \phi _ { g c } ( G ) } ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\operatorname* { m a x } _ { 1 } ( \phi _ { f c } ( \alpha ) ) )$ and $\operatorname* { m a x } _ { 2 } \bigl ( \phi _ { f c } ( \pmb { \alpha } ) \bigr )$ are the largest and the second largest values in the vector $\phi _ { f c } ( \alpha )$ ,respectively. Given an input graph $G$ ,Equations (2) and (3) identify one LDB from $\mathcal { H }$ .Thus, we can sample a subset of input graphs uniformly from $D$ ,and use Equations (2) and (3) to derive a sample of LDBs as $\tilde { \mathcal { H } } \subset \mathcal { H }$ :
|
| 100 |
+
|
| 101 |
+
Now, we substitute $\mathcal { H }$ in Equation (1) by $\tilde { \mathcal { H } }$ to produce the following problem.
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\operatorname* { m a x } _ { \mathcal { P } \subseteq \tilde { \mathcal { H } } } g ( \mathcal { P } , c ) , \mathrm { ~ s . t . ~ } h ( \mathcal { P } , c ) \leq \delta ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $\delta \geq 0$ is a tolerance parameter to keep this problem feasible. The parameter $\delta$ is required because substituting $\mathcal { H }$ by $\tilde { \mathcal { H } }$ ignores the LDBs in $\mathcal { H } \backslash \tilde { \mathcal { H } }$ . Thus, the convex polytope $r ( \mathcal { P } , c )$ induced by subset of boundaries in $\tilde { \mathcal { H } }$ may contain instances that are not predicted as class $c$ . We directly set $\boldsymbol { \delta } \dot { = } \boldsymbol { h } ( \tilde { \mathcal { H } } , \boldsymbol { c } )$ , which is the smallest value of $\delta$ that keeps the practical problem feasible.
|
| 108 |
+
|
| 109 |
+
The problem in Equation (4) can be proven to be a Submodular Cost Submodular Cover (SCSC) problem [18] (see Appendix $\mathbf { D }$ for proof) that is well known to be NP-hard [5]. We adopt a greedy boundary selection method to find a good solution to this problem [40]. Specifically, we initialize $\mathcal { P }$ as an empty set,and then iteratively select a new boundary $h$ from $\tilde { \mathcal { H } }$ by
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
h = \arg \operatorname* { m i n } _ { h \in \tilde { \mathcal { H } } \backslash \mathcal { P } } \frac { g ( \mathcal { P } , c ) - g ( \mathcal { P } \cup \{ h \} , c ) + \epsilon } { h ( \mathcal { P } , c ) - h ( \mathcal { P } \cup \{ h \} , c ) } ,
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $g ( \mathcal { P } , c ) - g ( \mathcal { P } \cup \{ h \} , c )$ is the decrease of $g ( \mathcal { P } , c )$ when adding $h$ into $\mathcal { P }$ ,and $h ( \mathcal { P } , c ) - h ( \mathcal { P } \cup$ $\{ h \} , c \bar { ) }$ is the decrease of $h ( \mathcal { P } , c )$ when adding $h$ into $\mathcal { P }$ .Both $g ( \mathcal { P } , c )$ and $h ( \mathcal { P } , c )$ are non-increasing when adding $h \in \tilde { \mathcal { H } }$ into $\mathcal { P }$ because adding a new boundary $h$ may only exclude some graphs from the convex polytope $r ( \mathcal { P } , c )$ :
|
| 116 |
+
|
| 117 |
+
Intuitively, in each iteration,Equation (5) selects a boundary $h \in \tilde { \mathcal { H } }$ such that adding $h$ into $\mathcal { P }$ reduces $g ( \mathcal { P } , c )$ the least and reduces $\bar { h } ( \mathcal { P } , c )$ the most. In this way,we can quickly reduce $h ( \mathcal { P } , c )$ to be smaller than $\delta$ without decreasing $g ( \mathcal { P } , c )$ too much, which produces a good feasible solution to the practical problem.We add a small constant $\epsilon$ to the numerator such that, when there are multiple candidates of $h$ that do not decrease $g ( \mathcal { P } , c )$ , we can still select the $h$ that reduces $h ( \mathcal { P } , c )$ the most.
|
| 118 |
+
|
| 119 |
+
We apply a peeling-off strategy to iteratively extract multiple decision regions.For each class $c \in C$ we first solve the practical problem once to find a decision region $r ( \mathcal { P } , c )$ , then we remove the graphs covered by $r ( \mathcal { P } , \bar { c } )$ from $D _ { c }$ . If there are remaining graphs predicted as the class $c$ , we continue finding the decision regions using the remaining graphs until all the graphs in $D _ { c }$ are removed. When all the graphs in $D _ { c }$ are removed for each class $c \in C$ , we stop the iteration and return the set of decision regions we found.
|
| 120 |
+
|
| 121 |
+
# 4.3Producing Explanations
|
| 122 |
+
|
| 123 |
+
In this section, we introduce how to use the LDBs of decision regions to train a neural network that produces a robust counterfactual explanation as a small subset of edges of an input graph. We form explanations as a subset of edges because GNNs make decisions by aggregating messages passed on edges. Using edges instead of vertices as explanations can provide beter insights on the decision logic of GNNs.
|
| 124 |
+
|
| 125 |
+
# 4.3.1The Neural Network Model
|
| 126 |
+
|
| 127 |
+
Denote by $f _ { \theta }$ the neural network to generate a subset of edges of an input graph $G$ as the robust counterfactual explanation on the prediction $\phi ( G )$ : $\theta$ represents the set of parameters of the neural network. For experiments, our explanation network $f$ consists of 2 fully connected layers with a ReLU activation and the hidden dimension of 64.
|
| 128 |
+
|
| 129 |
+
For any two connected vertices $v _ { i }$ and $v _ { j }$ of $G$ ,denote by $\mathbf { z } _ { i }$ and $\mathbf { z } _ { j }$ the embeddings produced by the last convolution layer of the GNN for the two vertices, respectively. The neural network $f _ { \theta }$ takes $\mathbf { z } _ { i }$ and $\mathbf { z } _ { j }$ as the input and outputs the probability for the edge between $v _ { i }$ and $v _ { j }$ to be part of the explanation. This can be written as
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\begin{array} { r } { { \bf M } _ { i j } = f _ { \theta } ( { \bf z } _ { i } , { \bf z } _ { j } ) , } \end{array}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where $\mathbf { M } _ { i j }$ denotes the probability that the edge between $v _ { i }$ and $v _ { j }$ is contained in the explanation. When there is no edge between $v _ { i }$ and $v _ { j }$ ,that is, ${ \bf A } _ { i j } = 0$ ,we set $\mathbf { \check { M } } _ { i j } = 0$
|
| 136 |
+
|
| 137 |
+
For an input graph $G = \{ V , E \}$ with $n$ vertices and a trained neural network $f _ { \boldsymbol { \theta } } , \mathbf { M }$ is an $n$ -by- $\mathbf { \nabla } \cdot n$ matrix that carries the complete information to generate a robust counterfactual explanation as a subset of edges, denoted by $S \subseteq E$ . Concretely,we obtain $S$ by selecting all the edges in $E$ whose corresponding entries in $\mathbf { M }$ are larger than O.5.
|
| 138 |
+
|
| 139 |
+
# 4.3.2Training Model $f _ { \theta }$
|
| 140 |
+
|
| 141 |
+
For an input graph $G = ( V , E )$ , denote by $S \subseteq E$ the subset of edges produced by $f _ { \theta }$ to explain the prediction $\phi ( G )$ ,our goal is to train a good model $f _ { \theta }$ such that the prediction on the subgraph $G _ { S }$ induced by $S$ from $G$ is consistent with $\phi ( G )$ ; and deleting the edges in $S$ from $G$ produces a remainder subgraph $G _ { E \backslash S }$ such that the prediction on $G _ { E \backslash S }$ changes significantly from ${ \bar { \phi } } ( G )$ :
|
| 142 |
+
|
| 143 |
+
Since producing $S$ by $f _ { \theta }$ is a discrete operation that is hard to incorporate in an end-to-end training process, we define two proxy graphs to approximate $G _ { S }$ and $G _ { E \backslash S }$ ,respectively,such that the proxy graphs are determined by $\theta$ through continuous functions that can be smoothly incorporated into an end-to-end training process.
|
| 144 |
+
|
| 145 |
+
The proxy graph of $G _ { S }$ , denoted by $G _ { \theta }$ , is defined by regarding $\mathbf { M }$ instead of $\mathbf { A }$ as the adjacency matrix. That is, $G _ { \theta }$ has exactly the same graph structure as $G$ , but the edge weights of $G _ { \theta }$ is given by the entries in $\mathbf { M }$ instead of $\mathbf { A }$ .Here,the subscript $\theta$ means $G _ { \theta }$ is determined by $\theta$
|
| 146 |
+
|
| 147 |
+
The proxy graph of $G _ { E \backslash S }$ , denoted by $G _ { \theta } ^ { \prime }$ , also have the same graph structure as $G$ , but the edge weight between each pair of vertices $v _ { i }$ and $v _ { j }$ is defined as
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\begin{array} { r } { \mathbf { M } _ { i j } ^ { \prime } = \left\{ { 1 - \mathbf { M } _ { i j } \quad \mathrm { ~ i f ~ } \mathbf { A } _ { i j } = 1 } \atop { 0 } \right. } \end{array}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
The edge weights of both $G _ { \theta }$ and $G _ { \theta } ^ { \prime }$ are determined by $\theta$ through continuous functions, thus we can smoothly incorporate $G _ { \theta }$ and $G _ { \theta } ^ { \prime }$ into an end-to-end training framework.
|
| 154 |
+
|
| 155 |
+
As discussed later in this section, we use a regularization term to force the value of each entry in $\mathbf { M } _ { i j }$ to be close to eitherOor 1,such that $G _ { \theta }$ and $\operatorname { \mathrm { \Sigma } } _ { G _ { \theta } ^ { \prime } } ^ { G \prime }$ better approximate $G _ { S }$ and $G _ { E \backslash S }$ respectively.
|
| 156 |
+
|
| 157 |
+
We formulate our loss function as
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\mathcal { L } ( \theta ) = \sum _ { G \in D } \left\{ \lambda \mathcal { L } _ { s a m e } ( \theta , G ) + ( 1 - \lambda ) \mathcal { L } _ { o p p } ( \theta , G ) + \beta \mathcal { R } _ { s p a r s e } ( \theta , G ) + \mu \mathcal { R } _ { d i s c r e t e } ( \theta , G ) \right\} ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
where $\lambda \in [ 0 , 1 ]$ $\beta \geq 0$ and $\mu \geq 0$ are the hyperparameters controlling the importance of each term. The influence of these parameters is discussed in Appendix $\mathbf { G }$ .The first term of our loss function requires that the prediction of the GNN on $G _ { \theta }$ is consistent with the prediction on $G$ . Intuitively, this means that the edges with larger weights in $G _ { \theta }$ dominate the prediction on $G$ .We formulate this term by requiring $G _ { \theta }$ to be covered by the same decision region covering $G$ :
|
| 164 |
+
|
| 165 |
+
Denote by $\mathcal { H } _ { G }$ the set of LDBs that induce the decision region covering $G$ ,and by $| \mathcal { H } _ { G } |$ the number of LDBs in $\mathcal { H } _ { G }$ . For the $i$ -th LDB $h _ { i } \in \mathcal { H } _ { G }$ , denote by $B _ { i } ( \mathbf { x } ) = \mathbf { w } _ { i } ^ { \top } \mathbf { x } + b _ { i }$ , where $\mathbf { w } _ { i }$ and $b _ { i }$ are the basis and bias of $h _ { i }$ , respectively, and $\mathbf { x } \in \mathbb { O } ^ { d }$ is a point in the space $\mathbb { O } ^ { d }$ . The sign of $B _ { i } ( { \bf x } )$ indicates whether a point $\mathbf { x }$ lies on the positive side or the negative side of $h _ { i }$ , and the absolute value $| B _ { i } ( { \bf x } ) |$ is proportional to the distance of a point $\mathbf { x }$ from $h _ { i }$ . Denote by $\sigma ( \cdot )$ the standard sigmoid function, we formulate the first term of our loss function as
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\mathcal { L } _ { s a m e } ( \theta , G ) = \frac { 1 } { | \mathcal { H } _ { G } | } \sum _ { h _ { i } \in \mathcal { H } _ { G } } \sigma \left( - \mathcal { B } _ { i } ( \phi _ { g c } ( G ) ) * \mathcal { B } _ { i } ( \phi _ { g c } ( G _ { \theta } ) ) \right) ,
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
such that minimizing $\mathcal { L } _ { s a m e } ( \theta , G )$ encourages the graph embeddings $\phi _ { g c } ( G )$ and $\phi _ { g c } ( G _ { \theta } )$ to lie on the same side of every LDB in $\mathcal { H } _ { G }$ . Thus, $G _ { \theta }$ is encouraged to be covered by the same decision region covering $G$ :
|
| 172 |
+
|
| 173 |
+
The second term of our loss function optimizes the counterfactual property of the explanations by requiring the prediction on $G _ { \theta } ^ { \prime }$ to be significantly different from the prediction on $G$ . Intuitively, this means that the set of edges with larger weights in $G _ { \theta }$ are good counterfactual explanations because reducing the weights of these edges significantly changes the prediction. Following the above intuition,we formulate the second term as
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\mathcal { L } _ { o p p } ( \theta , G ) = \operatorname* { m i n } _ { h _ { i } \in \mathcal { H } _ { G } } \sigma \left( \mathcal { B } _ { i } ( \phi _ { g c } ( G ) ) * \mathcal { B } _ { i } ( \phi _ { g c } ( G _ { \theta } ^ { \prime } ) ) \right) ,
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
such that minimizing $\mathcal { L } _ { o p p } ( \theta , G )$ encourages the graph embeddings $\phi _ { g c } ( G )$ and $\phi _ { g c } ( G _ { \theta } ^ { \prime } )$ to lie on the opposite sides of at least one LDB in $\mathcal { H } _ { G }$ . This further means that $G _ { \theta } ^ { \prime }$ is encouraged not to be covered by the decision region covering $G$ , thus the prediction on $G _ { \theta } ^ { \prime }$ can be changed significantly from the prediction on $G$ :
|
| 180 |
+
|
| 181 |
+
Similar to [45], we use a L1 regularization $\mathcal { R } _ { s p a r s e } ( \theta , G ) = \| \mathbf { M } \| _ { 1 }$ on the matrix $\mathbf { M }$ produced by $f _ { \theta }$ on an input graph $G$ to produce a sparse matrix M, such that only a small number of edges in $G$ are selected as the counterfactual explanation. We also follow [45] to use an entropy regularization
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\mathcal { R } _ { d i s c r e t e } ( \theta , G ) = - \frac { 1 } { | \mathbf { M } | } \sum _ { i , j } ( \mathbf { M } _ { i j } \log ( \mathbf { M } _ { i j } ) + ( 1 - \mathbf { M } _ { i j } ) \log ( 1 - \mathbf { M } _ { i j } ) )
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
to push the value of each entry in $\mathbf { M } _ { i j }$ to be close to either Oor 1,such that $G _ { \theta }$ and $G _ { \theta } ^ { \prime }$ approximate $G _ { S }$ and $G _ { E \backslash S }$ well, respectively.
|
| 188 |
+
|
| 189 |
+
Now we can use the graphs in $D$ and the extracted decision regions to train the neural network $f _ { \theta }$ in an end-to-end manner by minimizing $\mathcal { L } ( \boldsymbol { \theta } )$ over $\theta$ using back propagation. Once we finish training $f _ { \theta }$ , we can first apply $f _ { \theta }$ to produce the matrix $\mathbf { M }$ for an input graph $G = ( V , E )$ ,and then obtain the explanation $S$ by selecting all the edges in $E$ whose corresponding entries in $\mathbf { M }$ are larger than 0.5. We do not need the extracted boundaries for inference as the the decision logic of GNN is already distilled into the explanation network $f$ during the training.
|
| 190 |
+
|
| 191 |
+
As discussed in Appendix B,our method can be easily extended to generate robust counterfactual explanations for node classification tasks.
|
| 192 |
+
|
| 193 |
+
Our method is highly efficient with a time complexity $O ( | E | )$ for explaining the prediction on an input graph $G$ , where $| E |$ is the total number of edges in $G$ : Additionally, the neural network $f _ { \theta }$ can be directly used without retraining to predict explanations on unseen graphs. Thus our method is significantly faster than the other methods [45,32,47,38] that require retraining each time when generating explanations on a new input graph.
|
| 194 |
+
|
| 195 |
+
# 5Experiments
|
| 196 |
+
|
| 197 |
+
We conduct series of experiments to compare our method with the state-of-the-art methods including GNNExplainer [45],PGExplainer [25],PGM-Explainer [38], SubgraphX [47] and CFGNNExplainer [24]. For the methods that identify a set of vertices as an explanation, we use the set of vertices to induce a subgraph from the input graph,and then use the set of edges of the induced subgraph as the explanation. For the methods that identify a subgraph as an explanation, we directly use the set of edges of the identified subgraph as the explanation.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 1: Fidelity performance averaged across 10 runs for the datasets at different levels of sparsity.
|
| 201 |
+
|
| 202 |
+
To demonstrate the effectiveness of the decision regions,we derive another baseline method named RCExp-NoLDB that adopts the general framework of RCExplainer but does not use the LDBs of decision regions to generate explanations.Instead, RCExp-NoLDB directly maximizes the prediction confidence on class $c$ for $G _ { \theta }$ and minimizes the prediction confidence of class $c$ for $G _ { \theta } ^ { \prime }$ :
|
| 203 |
+
|
| 204 |
+
We evaluate the explanation performance on two typical tasks: the graph clasification task that uses a GNN to predict the class of an input graph,and the node classification task that uses a GNN to predict the class of a graph node. For the graph classification task, we use one synthetic dataset, BA-2motifs [25],and two real-world datasets,Mutagenicity [21] and NCI1 [39].For the node classification task, we use the same four synthetic datasets as used by GNNExplainer [45], namely, BA-SHAPES,BA-COMMUNITY,TREE-CYCLES and TREE-GRID.
|
| 205 |
+
|
| 206 |
+
Limited by space, we only report here the key results_on the graph classification task for fidelity, robustness and efficiency. Please refer to Appendix E for details on datasets, baselines and the experiment setups.Detailed experimental comparison on the node classification task willbe discussed in Appendix F where we show that our method produces extremely accurate explanations. The code3 is publicly available.
|
| 207 |
+
|
| 208 |
+
# 5.1Fidelity
|
| 209 |
+
|
| 210 |
+
Fidelity is measured by the decrease of prediction confidence after removing the explanation (i.e., a set of edges) from the input graph [32]. We use fidelity to evaluate how counterfactual the generated explanations are on the datasets Mutagenicity,NCI1 and BA-2motifs.A large fidelity score indicates stronger counterfactual characteristics. It is important to note that fidelity may be sensitive to sparsity of explanations. The sparsity of an explanation $S$ with respect to an input graph $G = ( \bar { V , } E )$ is $\begin{array} { r } { s p a r s i t y ( S , G ) = 1 - \frac { | S | } { | E | } } \end{array}$ ,thatis,tpeeefdgafrta from $G$ . We only compare explanations with the same level of sparsity.
|
| 211 |
+
|
| 212 |
+
Figure 1 shows the results about fidelity. Our approach achieves the best fidelity performance at all levels of sparsity. The results validate the effectiveness of our method in producing highly counterfactual explanations. RCExplainer also significantly outperforms RCExp-NoLDB. This confirms that using LDBs of decision regions extracted from GNNs produces more faithful counterfactual explanations.
|
| 213 |
+
|
| 214 |
+
CF-GNNExplainer performs the best among the rest of the methods.This is expected as it optimizes the counterfactual behavior of the explanations which results in higher fidelity for the explanations in comparison to those produced by other methods such as GNNExplainer and PGExplainer.
|
| 215 |
+
|
| 216 |
+
The fidelity performance of SubgraphX reported in [47] was obtained by seting the features of nodes that are part of the explanation to Obut not removing the explanation edges from the input graph. This does not remove the message passing roles of the explanation nodes from the input graph because the edges connected to those nodes still can pass messages. In our experiments, we directly block the messages that are passed on the edges in the explanation, which completely prevents the explanation nodes in the input graph to participate in the message passing. As a result, the performance of SubgraphX drops significantly.
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
Figure 2: Noise robustness (AUC) averaged across 10 runs for the datasets at diferent levels of noise.
|
| 220 |
+
|
| 221 |
+
# 5.2Robustness Performance
|
| 222 |
+
|
| 223 |
+
In this experiment, we evaluate the robustness of all methods by quantifying how much an explanation changes after adding noise to the input graph. For an input graph $G$ and the explanation $S$ ,we produce a perturbed graph $G ^ { \prime }$ by adding random noise to the node features and randomly adding or deleting some edges of the input graph such that the prediction on $G ^ { \prime }$ is consistent with the prediction on $G$ : Using the same method we obtain the explanation $S ^ { \prime }$ on $G ^ { \prime }$ . Considering top- $k$ edges of $S$ as the ground-truth and comparing $S ^ { \prime }$ against them, we compute a receiver operating characteristic (ROC) curve and evaluate the robustnessby the area under curve (AUC) of the ROC curve. We report results for $k = 8$ in Figure 2. Results for other values of $k$ are included in Appendix F where we observe similar trend.
|
| 224 |
+
|
| 225 |
+
Figure 2 shows the AUC of GNNExplainer, PGExplainer, RCExp-NoLDB and RCExplainer at different levels of noise. A higher AUC indicates better robustness. The percentage of noise shows the proportion of nodes and edges that are modified. Baselines such as PGM-Explainer and SubgraphX are not included in this experiment as they do not output the edge weights that are required for computing AUC.We present additional robustness experiments in Appendix F where we extend all the baselines to report node and edge level accuracy.
|
| 226 |
+
|
| 227 |
+
GNNExplainer performs the worst on most of the datasets,since it optimizes each graph independently without considering other graphs in the training set. Even when no noise is added,the AUC of GNNExplainer is significantly lower than 1 because different runs produce different explanations for the same graph prediction. PGExplainer is generally more robust than GNNExplainer because the neural network they trained to produce explanations implicitly considers all the graphs used for training. CF-GNNExplainer also performs worse than RCExplainer, which means it is more susceptible to the noise as compared to RCExplainer.
|
| 228 |
+
|
| 229 |
+
Our method achieves the best AUC on allthe datasets, because the common decision logic carried by the decision regions of a GNN is highly robust to noise. PGExplainer achieves a comparable performance as our method on the Mutagenicity dataset, because the samples of this dataset share a lot of common structures such as carbon rings, which makes it easier for the neural network trained by PGExplainer to identify these structures in presence of noise. However, for BA-2motifs and NCI1, this is harder as samples share very few structures and thus the AUC of PGExplainer drops significantly. RCExplainer also significantly outperforms RCExp-NoLDB on these datasets which highlights the role of decision boundaries in making our method highly robust.
|
| 230 |
+
|
| 231 |
+
Table 1: Average time cost for producing an explanation on a single graph sample.
|
| 232 |
+
|
| 233 |
+
<table><tr><td>Method</td><td>GNNExplainer</td><td>PGExplainer</td><td>PGM-Explainer</td><td>SubgraphX</td><td>CF-GNNExplainer</td><td>RCExplainer</td></tr><tr><td>Time</td><td>1.2s ± 0.2</td><td>0.01s ± 0.03</td><td>13.1s ± 3.9</td><td>77.8s ± 4.5</td><td>4.6s± 0.2</td><td>0.01s ± 0.02</td></tr></table>
|
| 234 |
+
|
| 235 |
+
Effciency. We evaluate efficiency by comparing the average computation time taken for inference on unseen graph samples. Table 1 shows the results on the Mutagenicity dataset. Since our method also can be directly used for unseen data without any retraining,it is as eficient as PGExplainer and significantly faster than GNNExplainer, PGM-Explainer, SubgraphX and CF-GNNExplainer.
|
| 236 |
+
|
| 237 |
+
# 6Conclusion
|
| 238 |
+
|
| 239 |
+
In this paper, we develop a novel method for producing counterfactual explanations on GNNs. We extract decision boundaries from the given GNN model to formulate an intuitive and effective counterfactual loss function. We optimize this loss to train a neural network to produce explanations with strong counterfactual characteristics. Since the decision boundaries are shared by multiple samples of the same predicted class, explanations produced by our method are robust and do not overfit the noise. Our experiments on synthetic and real-life benchmark datasets strongly validate the efficacy of our method. In this work,we focus on GNNs that belong to Piecewise Linear Neural Networks (PLNNs). Extending our method to other families of GNNs and tasks such as link prediction,remains an interesting future direction.
|
| 240 |
+
|
| 241 |
+
Our method will benefit multiple fields where GNNs are intensively used. By allowing the users to interpret the predictions of complex GNNs better, it will promote transparency, trust and fairness in the society. However, there also exist some inherent risks. A generated explanation may expose private information if our method is not coupled with an adequate privacy protection technique. Also, some of the ideas presented in this paper may be adopted and extended to improve adversarial attacks. Without appropriate defense mechanisms,the misuse of such attcks poses a risk of disruption in the functionality of GNNs deployed in the real world.That said, we firmly believe that these risks can be mitigated through increased awareness and proactive measures.
|
| 242 |
+
|
| 243 |
+
# Acknowledgments and Disclosure of Funding
|
| 244 |
+
|
| 245 |
+
Lingyang Chu's research is supported in part by the startup grant provided by the Department of Computing and Software of McMaster University. All opinions, findings,conclusions,and recommendations in this paper are those of the authors and do not necessarily reflect the views of the funding agencies.
|
| 246 |
+
|
| 247 |
+
# References
|
| 248 |
+
|
| 249 |
+
[1] J. Adebayo,J. Gilmer,M.Muelly,I. Goodfellow,M. Hardt,and B. Kim. Sanity checks for saliency maps. In Advances in Neural Information Processing Systems.
|
| 250 |
+
[2] A.Bojchevski and S. Gunnemann. Certifiable robustness to graph perturbations.arXiv preprint arXiv:1910.14356,2019.
|
| 251 |
+
[3]E. Cho,S.A. Myers,and J.Leskovec.Friendship and mobility: user movement in location-based social networks. In Proceedings of the 17th ACM SIGkDD international conference on Knowledge discovery and data mining,pages 1082-1090,2011.
|
| 252 |
+
[4]L.Chu, X. Hu,J. Hu,L. Wang,and J.Pei. Exact and consistent interpretation for piecewise linear neural networks: A closed form solution. In Proceedings of the 24th ACM SiGKDD International Conference on Knowledge Discovery & Data Mining,pages 1244-1253,2018.
|
| 253 |
+
[5]V. Crawford,A. Kuhnle,and M. Thai. Submodular cost submodular cover with an approximate oracle.In International Conference on Machine Learning, pages 1426-1435.PMLR,2019.
|
| 254 |
+
[6] A. K. Debnath, R.L.Lopez de Compadre, G. Debnath, A. J. Shusterman,and C. Hansch. Structure-activity relationship of mutagenic aromatic and heteroaromatic nitro compounds.correlation with molecular orbital energies and hydrophobicity. Journal of medicinal chemistry,34(2):786-797,1991.
|
| 255 |
+
[7]M.Denil,S.G.Colmenarejo,S. Cabi,D.Saxton,and N. de Freitas. Programmable agents. arXiv preprint arXiv:1706.06383,2017.
|
| 256 |
+
[8]Y. Duan, M. Andrychowicz,B.C. Stadie,J. Ho,J.Schneider,I.Sutskever,P.Abbeel,and W. Zaremba. One-shot imitation learning. arXiv preprint arXiv:1703.07326,2017.
|
| 257 |
+
[9]W.Fan,Y.Ma,Q.Li,Y. He,E. Zhao,J.Tang,and D.Yin. Graph neural networks for social recommendation. In The World Wide Web Conference,pages 417-426,2019.
|
| 258 |
+
[10]T.Freiesleben.Counterfactualexplanations &adversarialexamplescommongrounds,essntialdifferences, and potential transfers. arXiv preprint arXiv:2009.05487, 2020.
|
| 259 |
+
[11]A. Ghorbani,A. Abid,and J. Zou. Interpretation of neural networks is fragile. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3681-3688,2019.
|
| 260 |
+
[12] X. Glorot and Y. Bengio. Understanding the dificulty of training deep feedforward neural networks. InProceedingsofthethirteenth international conference onartificial intelligence and statistics,pages 249-256. JMLR Workshop and Conference Proceedings, 2010.
|
| 261 |
+
[13] X.Glorot,A.Bordes,and Y.Bengio.Deep sparse rectifier neural networks.In Proceedings ofthe fourteenth international conference on artificial intelligence and statistics, pages 315-323. JMLR Workshop and Conference Proceedings,2011.
|
| 262 |
+
[14] I. Goodfelow,D. Warde-Farley,M. Mirza,A. Courvile,and Y.Bengio. Maxout networks.In International conference on machine learning, pages 1319-1327.PMLR,2013.
|
| 263 |
+
[15]K. He, X. Zhang, S. Ren,and J. Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings ofthe IEEE international conferenceon computer vision, pages 1026-1034,2015.
|
| 264 |
+
[16] L.Holdijk,M. Boon,S.Henckens,and L.de Jong. [re] parameterized explainer for graph neural network. In ML Reproducibility Challenge 2020,2021.
|
| 265 |
+
[17] W. Huber, V.J. Carey,L.Long, S. Falcon,and R. Gentleman. Graphs in molecular biology. BMC bioinformatics,8(6):1-14,2007.
|
| 266 |
+
[18] R. K. Iyer and J. A. Bilmes. Submodular optimization with submodular cover and submodular knapsack constraints.In Advances in Neural Information Processing Systems.
|
| 267 |
+
[19]M. Jiang,Z. Li, S. Zhang,S. Wang,X. Wang, Q. Yuan,and Z. Wei. Drug-target affinity prediction using graph neural network and contact maps.RsC Advances,10(35):20701-20712, 2020.
|
| 268 |
+
[20] H. Jin and X. Zhang. Latent adversarial training of graph convolution networks. In ICML Workshop on Learning and Reasoning with Graph-Structured Representations,2019.
|
| 269 |
+
[21] J. Kazius,R. McGuire,and R. Bursi. Derivation and validation of toxicophores for mutagenicity prediction. Journal of medicinal chemistry,48(1):312-320,2005.
|
| 270 |
+
[22] T.N. Kipf and M. Welling. Semi-supervised classfication with graph convolutional networks. In 5th International Conference on Learning Representations,ICLR 2Ol7, Conference Track Proceedings.
|
| 271 |
+
[23]M. Liu, Y. Luo,L. Wang, Y. Xie, H. Yuan,S. Gui, H. Yu,Z. Xu, J. Zhang, Y. Liu, K. Yan, H. Liu, C. Fu, B. Oztekin,X. Zhang,and S.Ji. DIG: A turnkey library for diving into graph deep learning research. arXiv preprint arXiv:2103.12608,2021.
|
| 272 |
+
[24] A.Lucic,M.ter Hoeve,G. Tolomei,M.de Rijke,and F. Silvestri. Cf-gnnexplainer: Counterfactual explanations for graph neural networks.arXiv preprint arXiv:2102.03322,2021.
|
| 273 |
+
[25] D.Luo, W. Cheng,D. Xu, W. Yu, B. Zong, H. Chen,and X. Zhang. Parameterized explainer for graph neural network. In Advances in Neural Information Processing Systems.
|
| 274 |
+
[26] C. Molnar.Interpretable Machine Learning.2019.https://christophm.github.io/ interpretable-ml-book/.
|
| 275 |
+
[27] G.Montufar,R.Pascanu,K.Cho,and Y.Bengio.On the numberof linear regions of deep neural networks. arXiv preprint arXiv:1402.1869,2014.
|
| 276 |
+
[28]R.Moraffah,M. Karami,R.Guo,A. Raglin,and H.Liu.Causal interpretability for machine learningproblems,methods and evaluation. ACM SIGKDD Explorations Newsleter,22(1):18-33,2020.
|
| 277 |
+
[29] V.Nair and G.E.Hinton.Rectified linear units improve restricted boltzmann machines.In Icml,2010.
|
| 278 |
+
[30] D. Numeroso and D. Bacciu. Meg: Generating molecular counterfactual explanations for deep graph networks. arXiv preprint arXiv:2104.08060,2021.
|
| 279 |
+
[31] D.E. Pires,T. L. Blundel, and D. B. Ascher. pkcsm: predicting small-molecule pharmacokinetic and toxicity properties using graph-based signatures. Journal of medicinal chemistry,58(9):4066-4072,2015.
|
| 280 |
+
[32]P.E.Pope,S. Kolouri, M.Rostami, C.E. Martin,and H. Hoffmann.Explainability methods for graph convolutional neural networks.In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10772-10781,2019.
|
| 281 |
+
[33]R.R.Selvaraju,M.Cogswell,A.Das,R. Vedantam,D.Parikh,and D.Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE international conference on computer vision, pages 618-626, 2017.
|
| 282 |
+
[34] P.L. Simon, M.Taylor,and I. Z. Kiss. Exact epidemic models on graphs using graph-automorphism driven lumping. Journal of mathematical biology,62(4):479-508,2011.
|
| 283 |
+
[35] K. Simonyan, A. Vedaldi,and A. Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. ICLR,2014.
|
| 284 |
+
[36]K.Sokol and P.A.Flach. Counterfactual explanations of machine learning predictions: opportunities and challenges for ai safety. In SafeAI@ AAAI, 2019.
|
| 285 |
+
[37]P. Velickovic, G. Cucurul,A. Casanova,A. Romero,P.Lio,and Y. Bengio. Graph attention networks. In 6th International Conference on Learning Representations, ICLR 2O18, Conference Track Proceedings.
|
| 286 |
+
[38]M. Vu and M. T. Thai.Pgm-explainer: Probabilistic graphical model explanations for graph neural networks.In Advances in Neural Information Processing Systems.
|
| 287 |
+
[39] N. Wale and G. Karypis. Comparison of descriptor spaces for chemical compound retrieval and classification. In Sixth International Conference on Data Mining (ICDM'06),pages 678-689,2006.doi: 10.1109/ICDM.2006.39.
|
| 288 |
+
[40] L.A.Wolsey. An analysis of the greedy algorithm for the submodular setcovering problem. Combinatorica, 2(4):385-393,1982.
|
| 289 |
+
[41] J. Xiong,Z. Xiong, K. Chen,H. Jiang,and M. Zheng. Graph neural networks for automated de novo drug design. Drug Discovery Today,2021.
|
| 290 |
+
[42]H. Xu, Y. Ma, H.-C.Liu,D. Deb, H. Liu, J.-L. Tang,and A. K. Jain. Adversarial atacks and defenses in images, graphs and text: A review. International Journal of Automation and Computing,17(2):151-178, 2020.
|
| 291 |
+
[43] K. Xu, H. Chen,S.Liu,P.-Y. Chen, T.-W. Weng,M. Hong,and X. Lin. Topology attack and defense for graph neural networks: An optimization perspective. arXiv preprint arXiv:1906.04214, 2019.
|
| 292 |
+
[44] R. Yin,K.Li, G. Zhang,and J.Lu. A deeper graph neural network for recommender systems. KnowledgeBased Systems,185:105020,2019.
|
| 293 |
+
[45] Z. Ying,D. Bourgeois, J. You, M. Zitnik,and J.Leskovec. Gnnexplainer: Generating explanations for graph neural networks. In Advances in Neural Information Processing Systems, volume 32, 2019.
|
| 294 |
+
[46] H.Yuan,J.Tang,X.Hu,and S.Ji. Xgnn: Towards model-level explanations of graph neural networks.In Proceedings ofthe 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 430-438,2020.
|
| 295 |
+
[47] H. Yuan, H. Yu, J. Wang, K. Li, and S.Ji._On explainability of graph neural networks via subgraph explorations. arXiv preprint arXiv:2102.05152,2021.
|
| 296 |
+
[48] M.D. Zeiler and R.Fergus. Visualizing and understanding convolutional networks. In European conference on computer vision, pages 818-833. Springer,2014.
|
| 297 |
+
[49] J. Zhang,S.A. Bargal,Z.Lin,J.Brandt,X. Shen,and S.Sclarof. Top-down neural attention by excitation backprop. International Journal of Computer Vision,126(10):1084-1102,2018.
|
| 298 |
+
[50] M. Zhang and Y. Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems.
|
| 299 |
+
[51] D. Zugner and S. Gunnemann. Adversarial attacks on graph neural networks via meta learning. arXiv preprint arXiv:1902.08412, 2019.
|
| 300 |
+
[52] D.Zügner and S.Gunnemann.Certifable robustness and robust training for graph convolutional networks. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining,pages 246-256,2019.
|
| 301 |
+
[53] D. Zugner, A. Akbarnejad,and S. Gunnemann. Adversarial atacks on neural networks for graph data. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pages 2847-2856,2018.
|
md/train/Ut1vF_q_vC/Ut1vF_q_vC.md
ADDED
|
@@ -0,0 +1,429 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ARE NEURAL RANKERS STILL OUTPERFORMED BY GRADIENT BOOSTED DECISION TREES?
|
| 2 |
+
|
| 3 |
+
Zhen Qin, Le Yan, Honglei Zhuang, Yi Tay, Rama Kumar Pasumarthi,
|
| 4 |
+
Xuanhui Wang, Michael Bendersky, Marc Najork
|
| 5 |
+
Google Research
|
| 6 |
+
{zhenqin,lyyanle,hlz,yitay,ramakumar,xuanhui,bemike,najork}@google.com
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Despite the success of neural models on many major machine learning problems, their effectiveness on traditional Learning-to-Rank (LTR) problems is still not widely acknowledged. We first validate this concern by showing that most recent neural LTR models are, by a large margin, inferior to the best publicly available Gradient Boosted Decision Trees (GBDT) in terms of their reported ranking accuracy on benchmark datasets. This unfortunately was somehow overlooked in recent neural LTR papers. We then investigate why existing neural LTR models under-perform and identify several of their weaknesses. Furthermore, we propose a unified framework comprising of counter strategies to ameliorate the existing weaknesses of neural models. Our models are the first to be able to perform equally well, comparing with the best tree-based baseline, while outperforming recently published neural LTR models by a large margin. Our results can also serve as a benchmark to facilitate future improvement of neural LTR models.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Neural approaches have been dominating in many major machine learning domains, such as computer vision (He et al., 2015), natural language processing (Devlin et al., 2019), and speech recognition (Hannun et al., 2014). However, the effectiveness of neural approaches in traditional Learningto-Rank (LTR), the long-established inter-disciplinary research area at the intersection of machine learning and information retrieval (Liu, 2009), is not widely acknowledged (Yang et al., 2019), especially on benchmark datasets that have only numerical features.
|
| 15 |
+
|
| 16 |
+
Historically, a series of LTR models were developed by researchers at Microsoft, starting with RankNet (Burges et al., 2005) and LambdaRank (Burges et al., 2007), both based on neural networks, and culminating in LambdaMART (Wu et al., 2010), which is based on Gradient Boosted Decision Trees (GBDT); Burges (2010) provides an overview of this evolution. There are two publicly available implementations of LambdaMART: one provided by the RankLib1 library that is part of the Lemur Project (henceforth referred to as $\lambda \mathbf { M A R T } _ { R a n k L i b } ,$ ); and the LightGBM2 implementation provided by Microsoft (Ke et al., 2017) (henceforth referred to as $\lambda \mathbf { M A R T } _ { G B M }$ ). As we will show in Section 3, $\lambda \mathbf { M A R T } _ { G B M }$ substantially outperforms $\lambda \mathbf { M A R T } _ { R a n k L i b }$ .
|
| 17 |
+
|
| 18 |
+
There is strong and continuing interest in neural ranking models, with numerous papers published in the last few years alone. Most of these papers treat RankNet and LambdaRank as weak baselines (Pang et al., 2020; Bruch et al., 2019b) and LambdaMART as the “state-of-the-art” (Bruch et al., 2019b; Li et al., 2019; Zhu & Klabjan, 2020; Hu et al., 2019). However, when examining these papers, we note that they either acknowledge their under-performance to $\lambda \mathbf { M A R T } _ { G B M }$ or claim state-of-the-art performance by comparing to a weaker $\lambda \mathbf { M A R T } _ { R a n k L i b }$ implementation. The inconsistency of performance evaluation on benchmark datasets in this field has made it difficult to measure progress (Lipton & Steinhardt, 2018). It therefore remains an open question whether neural LTR models are as effective as they claim to be, and how to improve them if that is not the case.
|
| 19 |
+
|
| 20 |
+
In this paper, we first conduct a benchmark to show that $\lambda \mathbf { M A R T } _ { G B M }$ outperforms recently published neural models, as well as the $\lambda \mathbf { M A R T } _ { R a n k L i b }$ , by a large margin. While the neural paradigm is still appealing in a myriad of ways, such as being composable, flexible, and able to benefit from a plethora of new advances (Vaswani et al., 2017; Devlin et al., 2019), the research progress in neural ranking models could be hindered due to their inferior performance to tree models. It thus becomes critical to understand the pitfalls of building neural rankers and boost their performance on benchmark datasets.
|
| 21 |
+
|
| 22 |
+
Specifically, we investigate why neural LTR approaches under-perform on standard LTR datasets and identify three major weaknesses that are typically ignored by recent work. First, neural models are not as adept at performing effective feature transformations and scaling, which is one major benefit of using tree-based methods (Saberian et al., 2019). In ranking data which is typically longtailed, this can be a prohibitive property. Second, standard feed-forward networks are ineffective in generating higher-order features as noted by recent papers (Wang et al., 2017b; Beutel et al., 2018). More effective network architectures for neural LTR models are needed. Third, recent neural LTR work on benchmark datasets does not employ high-capacity networks, a key success factor of many neural models (Devlin et al., 2019), possibly due to a small scale of training data that causes overfitting. On the other hand, there are several potential benefits of neural approaches over LambdaMART for LTR, such as their flexibility to model listwise data and the existence of many techniques to mitigate data sparsity. To that end, we propose a new framework that ameliorates the weaknesses of existing neural LTR approaches and improves almost all major network components.
|
| 23 |
+
|
| 24 |
+
In the proposed framework, we make several technical contributions: (1) We demonstrate empirical evidence that a simple log1p transformation on the input features is very helpful. (2) We use data augmentation (DA) to make the most out of high-capacity neural models, which is surprisingly the first work in the LTR literature to do so. We show that adding a simple Gaussian noise helps, but only when the model capacity is appropriately augmented (which probably explains why there is no prior work on such a simple idea). (3) We use self-attention (SA) to model the listwise ranking data as context, and propose to use latent cross (LC) to effectively generate the interaction of each item and its listwise context.
|
| 25 |
+
|
| 26 |
+
We conduct experiments on three widely used public LTR datasets. Our neural models are trained with listwise ranking losses. On all datasets, our framework can outperform recent neural LTR methods by a large margin. When comparing with the strong LambdaMART implementation, $\lambda \mathbf { M A R T } _ { G B M }$ , we are able to achieve equally good results, if not better. Our work can also serve as a benchmark for neural ranking models, which we believe can lay a fertile ground for future neural LTR research, as rigorous benchmarks on datasets such as ImageNet (Russakovsky et al., 2015) and GLUE (Wang et al., 2018a) do in their respective fields.
|
| 27 |
+
|
| 28 |
+
# 2 BACKGROUND
|
| 29 |
+
|
| 30 |
+
We provide some background on LTR, including its formulation and common metrics. We review LambdaMART and highlight its two popular implementations which are causes of the inconsistency of evaluations in the recent literature.
|
| 31 |
+
|
| 32 |
+
# 2.1 LEARNING TO RANK
|
| 33 |
+
|
| 34 |
+
LTR methods are supervised techniques and the training data can be represented as a set $\Psi =$ $\{ ( \mathbf { x } , \mathbf { y } ) \in \chi ^ { n } \times \mathbb { R } ^ { n } ) \}$ , where $\mathbf { X }$ is a list of $n$ items $x _ { i } ~ \in ~ \chi$ and $\mathbf { y }$ is a list of $n$ relevance labels $y _ { i } \in \mathbb { R }$ for $1 \leq i \leq n$ . We use $\chi$ as the universe of all items. In traditional LTR problems, each $x _ { i }$ corresponds to a query-item pair and is represented as a feature vector in $\mathbb { R } ^ { k }$ where $k$ is the number of feature dimensions. With slightly abuse of notation, we also use $x _ { i }$ as the feature vector and say $\mathbf { x } \in \mathbb { R } ^ { n \times k }$ . The objective is to learn a function that produces an ordering of items in $\mathbf { X }$ so that the utility of the ordered list is maximized.
|
| 35 |
+
|
| 36 |
+
Most LTR algorithms formulate the problem as learning a ranking function to score and sort the items in a list. As such, the goal of LTR boils down to finding a parameterized ranking function $s ( \cdot ; \Theta ) : \chi ^ { n } \to \mathbb { R } ^ { n }$ , where $\Theta$ denotes the set of parameters, to minimize the empirical loss:
|
| 37 |
+
|
| 38 |
+
$$
|
| 39 |
+
\mathcal { L } ( s ) = \frac { 1 } { | \Psi | } \sum _ { ( \mathbf { x } , \mathbf { y } ) \in \Psi } l ( \mathbf { y } , s ( \mathbf { x } ) ) ,
|
| 40 |
+
$$
|
| 41 |
+
|
| 42 |
+
where $l ( \cdot )$ is the loss function on a single list. LTR algorithms differ primarily in how they parameterize $s$ and how they define $l$ .
|
| 43 |
+
|
| 44 |
+
There are many existing ranking metrics such as NDCG and MAP used in LTR problems. A common property of these metrics is that they are rank-dependent and place more emphasis on the top ranked items. For example, the commonly adopted NDCG metric is defined as
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
N D C G ( \pi _ { s } , \mathbf { y } ) = \frac { D C G ( \pi _ { s } , \mathbf { y } ) } { D C G ( \pi ^ { * } , \mathbf { y } ) } ,
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $\pi _ { s }$ is a ranked list induced by the ranking function $s$ on x, $\pi ^ { * }$ is the ideal list (where $\mathbf { X }$ is sorted by $\mathbf { y }$ ), and $D C G$ is defined as:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
D C G ( \pi , \mathbf { y } ) = \sum _ { i = 1 } ^ { n } { \frac { 2 ^ { y _ { i } } - 1 } { \log _ { 2 } ( 1 + \pi ( i ) ) } } = \sum _ { i = 1 } ^ { n } { \frac { G _ { i } } { D _ { i } } }
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
In practice, the truncated version that only considers the top- $\mathbf { \nabla } \cdot \mathbf { k }$ ranked items, denoted as ${ \mathrm { N D C G } } @ { \mathrm { k } }$ , is often used.
|
| 57 |
+
|
| 58 |
+
# 2.2 LAMBDAMART
|
| 59 |
+
|
| 60 |
+
LTR models have evolved from linear models (Joachims, 2002), to nerual networks (Burges et al., 2005), and then to decision trees (Burges, 2010) in the past two decades. LambdaMART, proposed about ten years ago (Wu et al., 2010; Burges, 2010), is still treated as the “state-of-the-art” for LTR problems in recent papers (Bruch et al., 2019b; Zhu & Klabjan, 2020). It is based on Gradient Boosted Decision Trees (GBDT). During each boosting step, the loss is dynamically adjusted based on the ranking metric in consideration. For example, $\Delta$ NDCG is defined as the absolute difference between the NDCG values when two documents $i$ and $j$ swap their positions in the ranked list sorted by the obtained ranking functions so far.
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\Delta N D C G ( i , j ) = | G _ { i } - G _ { j } | \cdot \Big | \frac { 1 } { D _ { i } } - \frac { 1 } { D _ { j } } \Big | .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Then LambdaMART uses a pairwise logistic loss and adapts the loss by re-weighting each item pair in each iteration, with $s ( \mathbf { x } ) | _ { i }$ being the score for item $i$ and $\alpha$ being a hyperparameter:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
l ( \mathbf { y } , s ( \mathbf { x } ) ) = \sum _ { y _ { i } > y _ { j } } \Delta N D C G ( i , j ) \log _ { 2 } ( 1 + e ^ { - \alpha ( s ( \mathbf { x } ) | _ { i } - s ( \mathbf { x } ) | _ { j } ) } )
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
There are two popular public implementations of LambdaMART, namely $\lambda \mathbf { M A R T } _ { G B M }$ and $\lambda \mathbf { M A R T } _ { R a n k L i b }$ . $\lambda \mathbf { M A R T } _ { G B M }$ is more recent than $\lambda \mathbf { M A R T } _ { R a n k L i b }$ and has more advanced features by leveraging novel data sampling and feature bundling techniques (Ke et al., 2017). However, recent neural LTR papers either use the weaker implementation of $\lambda \mathbf { M A R T } _ { R a n k L i b }$ (Pang et al., 2020; Wang et al., 2017a; Ai et al., 2018; 2019), or acknowledge the inferior performance of neural models when compared with $\lambda \mathbf { M A R T } _ { G B M }$ (Bruch et al., 2019b). Such an inconsistency makes it hard to determine whether neural models are indeed more effective than the tree-based models.
|
| 73 |
+
|
| 74 |
+
# 3 BENCHMARKING EXISTING METHODS
|
| 75 |
+
|
| 76 |
+
To resolve the inconsistency, we perform a benchmark on three popular LTR benchmark datasets to show that: 1) there is a large gap between the two implementations of tree-based LambdaMART $\lambda \mathbf { M A R T } _ { G B M }$ and $\lambda \mathbf { M A R T } _ { R a n k L i b }$ ; 2) Recent neural LTR methods are generally significantly worse than the stronger implementation. Then we discuss several weaknesses of recent neural LTR approaches, and point out promising directions, which lay the foundation of our proposed framework.
|
| 77 |
+
|
| 78 |
+
Table 1: The statistics of the three largest public benchmark datasets for LTR models.
|
| 79 |
+
|
| 80 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>#features</td><td rowspan=1 colspan=3>#queries</td><td rowspan=1 colspan=3>#docs</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>training</td><td rowspan=1 colspan=1>validation</td><td rowspan=1 colspan=1>test</td><td rowspan=1 colspan=1>training</td><td rowspan=1 colspan=1>validation</td><td rowspan=1 colspan=1>test</td></tr><tr><td rowspan=1 colspan=1>Web30K</td><td rowspan=1 colspan=1>136</td><td rowspan=1 colspan=1>18,919</td><td rowspan=1 colspan=1>6,306</td><td rowspan=1 colspan=1>6,306</td><td rowspan=1 colspan=1>2,270,296</td><td rowspan=1 colspan=1>747,218</td><td rowspan=1 colspan=1>753,611</td></tr><tr><td rowspan=1 colspan=1>Yahoo</td><td rowspan=1 colspan=1>700</td><td rowspan=1 colspan=1>19,944</td><td rowspan=1 colspan=1>2,994</td><td rowspan=1 colspan=1>6,983</td><td rowspan=1 colspan=1>473,134</td><td rowspan=1 colspan=1>71,083</td><td rowspan=1 colspan=1>165,660</td></tr><tr><td rowspan=1 colspan=1>Istella</td><td rowspan=1 colspan=1>220</td><td rowspan=1 colspan=1>20,901</td><td rowspan=1 colspan=1>2,318</td><td rowspan=1 colspan=1>9,799</td><td rowspan=1 colspan=1>6,587,822</td><td rowspan=1 colspan=1>737,803</td><td rowspan=1 colspan=1>3,129,004</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Table 2: All numbers are significantly worse than the corresponding number from $\lambda \mathbf { M A R T } _ { G B M }$ at the $p < 0 . 0 5$ level using a two-tailed $t$ -test. Best performing numbers are bold.
|
| 83 |
+
|
| 84 |
+
<table><tr><td rowspan=2 colspan=1>Models</td><td rowspan=2 colspan=1>Rerank</td><td rowspan=1 colspan=3>Web30KNDCG@k</td><td rowspan=1 colspan=3>Yahoo NDCG@k</td><td rowspan=1 colspan=3>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>XMARTRankLib</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>45.35</td><td rowspan=1 colspan=1>44.59</td><td rowspan=1 colspan=1>46.46</td><td rowspan=1 colspan=1>68.52</td><td rowspan=1 colspan=1>70.27</td><td rowspan=1 colspan=1>74.58</td><td rowspan=1 colspan=1>65.71</td><td rowspan=1 colspan=1>61.18</td><td rowspan=1 colspan=1>65.91</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>50.73</td><td rowspan=1 colspan=1>49.66</td><td rowspan=1 colspan=1>51.48</td><td rowspan=1 colspan=1>71.88</td><td rowspan=1 colspan=1>74.21</td><td rowspan=1 colspan=1>78.02</td><td rowspan=1 colspan=1>74.92</td><td rowspan=1 colspan=1>71.24</td><td rowspan=1 colspan=1>76.07</td></tr><tr><td rowspan=1 colspan=1>RankSVM</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>30.10</td><td rowspan=1 colspan=1>33.50</td><td rowspan=1 colspan=1>36.50</td><td rowspan=1 colspan=1>63.70</td><td rowspan=1 colspan=1>67.40</td><td rowspan=1 colspan=1>72.60</td><td rowspan=1 colspan=1>52.69</td><td rowspan=1 colspan=1>50.41</td><td rowspan=1 colspan=1>55.29</td></tr><tr><td rowspan=1 colspan=1>GSF</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>41.29</td><td rowspan=1 colspan=1>41.51</td><td rowspan=1 colspan=1>43.74</td><td rowspan=1 colspan=1>64.29</td><td rowspan=1 colspan=1>68.38</td><td rowspan=1 colspan=1>73.16</td><td rowspan=1 colspan=1>62.24</td><td rowspan=1 colspan=1>59.68</td><td rowspan=1 colspan=1>65.08</td></tr><tr><td rowspan=1 colspan=1>ApproxNDCG</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>46.64</td><td rowspan=1 colspan=1>45.38</td><td rowspan=1 colspan=1>47.31</td><td rowspan=1 colspan=1>69.63</td><td rowspan=1 colspan=1>72.32</td><td rowspan=1 colspan=1>76.77</td><td rowspan=1 colspan=1>65.81</td><td rowspan=1 colspan=1>62.32</td><td rowspan=1 colspan=1>67.09</td></tr><tr><td rowspan=1 colspan=1>DLCM</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>46.30</td><td rowspan=1 colspan=1>45.00</td><td rowspan=1 colspan=1>46.90</td><td rowspan=1 colspan=1>67.70</td><td rowspan=1 colspan=1>69.90</td><td rowspan=1 colspan=1>74.30</td><td rowspan=1 colspan=1>65.58</td><td rowspan=1 colspan=1>61.94</td><td rowspan=1 colspan=1>66.80</td></tr><tr><td rowspan=1 colspan=1>SetRank</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>42.90</td><td rowspan=1 colspan=1>42.20</td><td rowspan=1 colspan=1>44.28</td><td rowspan=1 colspan=1>67.11</td><td rowspan=1 colspan=1>69.60</td><td rowspan=1 colspan=1>73.98</td><td rowspan=1 colspan=1>67.33</td><td rowspan=1 colspan=1>62.78</td><td rowspan=1 colspan=1>67.37</td></tr><tr><td rowspan=1 colspan=1>SetRankTe</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>45.91</td><td rowspan=1 colspan=1>45.15</td><td rowspan=1 colspan=1>46.96</td><td rowspan=1 colspan=1>68.22</td><td rowspan=1 colspan=1>70.29</td><td rowspan=1 colspan=1>74.53</td><td rowspan=1 colspan=1>67.60</td><td rowspan=1 colspan=1>63.45</td><td rowspan=1 colspan=1>68.34</td></tr></table>
|
| 85 |
+
|
| 86 |
+
# 3.1 DATASETS
|
| 87 |
+
|
| 88 |
+
The three data sets we used in our experiments are public benchmark datasets widely adopted by the research community. They are the LETOR dataset from Microsoft (Qin & Liu, 2013), Set1 from the YAHOO LTR challenge (Chapelle & Chang, 2011), and Istella (Dato et al., 2016). We call them Web30K, Yahoo, and Istella respectively. All of them are data sets for web search ranking and the largest data sets publicly available for LTR algorithms. The relevance labels of documents for each query are rated by human in the form of multilevel graded relevance. See Qin & Liu (2013) for an example list of features, such as the number of URL clicks, or the BM25 scores of the different page sections. An overview of these three datasets is shown in Table 1.
|
| 89 |
+
|
| 90 |
+
# 3.2 COMPARISON
|
| 91 |
+
|
| 92 |
+
We compare a comprehensive list of methods in Table 2. λMARTGBM (Ke et al., 2017) and $\lambda \mathbf { M A R T } _ { R a n k L i b }$ are the two LambdaMART implementations. RankSVM (Joachims, 2006) is a classic pairwise learning-to-rank model built on SVM. GSF (Ai et al., 2019) is a neural model using groupwise scoring function and fully connected layers. ApproxNDCG (Bruch et al., 2019b) is a neural model with fully connected layers and a differeiable loss that approximates NDCG (Qin et al., 2010). DLCM (Ai et al., 2018) is an RNN based neural model that use list context information to rerank a list of documents based on $\lambda \mathbf { M A R T } _ { R a n k L i b }$ as in the original paper. SetRank (Pang et al., 2020) is a neural model using self-attention to encode the entire list and perform a joint scoring. SetRankre (Pang et al., 2020) is SetRank plus ordinal embeddings based on the initial document ranking generated by $\lambda \mathbf { M A R T } _ { R a n k L i b }$ as in the original paper.
|
| 93 |
+
|
| 94 |
+
We choose to compare these methods because they are either popular or recent. The neural models are already leveraging advanced neural techniques such as using neural methods to model the entire ranking list, which is difficult for tree-based models to achieve. We reproduced results for $\lambda \mathbf { M A R T } _ { R a n k L i b }$ , $\lambda \mathbf { M A R T } _ { G B M }$ , RankSVM, GSF, and ApproxNDCG with extensive hyperparameter tuning with more details in Appendix A. Results for the DLCM and SetRank methods are from their respective papers where the authors did their own tuning. Note that the test set is fixed for all datasets, thus the numbers are comparable.
|
| 95 |
+
|
| 96 |
+
From Table 2, we can see the following. 1) $\lambda \mathbf { M A R T } _ { G B M }$ is a more appropriate “state-of-the-art” LambdaMART baseline, as it significantly outperforms $\lambda \mathbf { M A R T } _ { R a n k L i b }$ . 2) Recent neural LTR methods, though sometimes outperform $\lambda \mathbf { M A R T } _ { R a n k L i b }$ , are inferior to $\lambda \mathbf { M A R T } _ { G B M }$ by a large margin, sometimes by as much as $15 \%$ , comparatively. These results show the inconsistency of existing methods and validate the concerns on the current practice of neural LTR models3.
|
| 97 |
+
|
| 98 |
+
# 4 NEURAL LTR MODELS
|
| 99 |
+
|
| 100 |
+
A natural question is: why do neural models under-perform on LTR benchmark datasets compared with LambdaMART, despite their success in many machine learning research areas? We first identify a few weaknesses of the neural LTR models and then propose our methods to address them.
|
| 101 |
+
|
| 102 |
+
# 4.1 WEAKNESSES
|
| 103 |
+
|
| 104 |
+
By reviewing recent papers and the strength of tree-based models, we give the following hypotheses:
|
| 105 |
+
|
| 106 |
+
Feature transformation. Neural networks are sensitive to input feature scales and transformations (Saberian et al., 2019). LTR datasets consist of features of diverse scales with long-tail distributions, such as the number of clicks of an item. Tree-based models are known to partition the feature space effectively, which is beneficial for datasets (such as LTR datasets) with only numeric features. Some recent work already shows the benefits of better input feature transformations than Gaussian normalization (Saberian et al., 2019; Zhuang et al., 2020). Unfortunately, neither the pioneering neural LTR papers (Burges et al., 2005; 2007) nor the most recent ones discuss the impact of feature transformation.
|
| 107 |
+
|
| 108 |
+
Network architecture. Unless the focus is the neural architecture, neural LTR papers typically use a standard feed-forward network that consists of a stack of fully connected layers. However, fully connected layers are known to be ineffective in generating higher-order feature interactions. The problem has been widely studied in areas such as ads prediction (Wang et al., 2017b) and recommender systems (Beutel et al., 2018), but has not received enough attention for LTR.
|
| 109 |
+
|
| 110 |
+
Data sparsity. Recent neural LTR models are small and do not employ high-capacity networks (Bruch et al., $2 0 1 9 \mathrm { b }$ ; Pang et al., 2020), possibly due to the overfitting issue. While large datasets are key factors to many recent successes of neural models in other domains (He et al., 2015; Devlin et al., 2019), the publicly available LTR datasets are comparatively small. Popular techniques such as data augmentation to mitigate overfitting in high-capacity networks are commonly used in other areas (Perez & Wang, 2017). But it is less intuitive on how to do data augmentation for LTR datasets, compared with, e.g., rotating a cat image in computer vision.
|
| 111 |
+
|
| 112 |
+
# 4.2 IMPROVEMENTS
|
| 113 |
+
|
| 114 |
+
We introduce our proposed neural LTR framework that tries to address the above mentioned concerns. Figure 1 summarizes our DASALC framework, which stands for Data Augmented SelfAttentive Latent Cross ranking network.
|
| 115 |
+
|
| 116 |
+
# 4.2.1 EXPLICIT FEATURE TRANSFORMATION AND DATA AUGMENTATION
|
| 117 |
+
|
| 118 |
+
Features in LTR datasets are diverse and can be of different scales. Out of the three datasets we consider, only the Yahoo dataset has been normalized (we leave it not-transformed). It is well known that neural networks are sensitive to input data scale, and we apply a simple “log1p” transformation to every element of $\mathbf { X }$ and empirically find it works well for the Web30K and Istella datasets:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathbf { x } = \log _ { e } ( 1 + | \mathbf { x } | ) \odot \mathrm { s i g n } ( \mathbf { x } ) .
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $\odot$ is the element-wise multiplication operator.
|
| 125 |
+
|
| 126 |
+
We use a very simple data augmentation technique on LTR datasets. We add a random Gaussian noise independently to every element of input vector $\mathbf { X }$ :
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\mathbf { x } = \mathbf { x } + \mathcal { N } ( \mathbf { 0 } , \sigma ^ { 2 } \mathbf { I } )
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 1: An illustration of the DASALC. FC is fully connected layer, ReLU is ReLU activation, and BN indicates batch normalization. Log1p Transform is applied when applicable. Softmax loss is short for softmax output with cross-entropy loss.
|
| 134 |
+
|
| 135 |
+
where $\sigma$ is a scalar hyperparameter. The random noise is added after the log1p transformation in an online fashion during training (i.e. different perturbations will be added to the same data point seen in different batches). A single scalar $\sigma$ for every feature is reasonable because the feature distributions are normalized by log1p. Also data augmentation is added after input Batch Normalization (BN) when applicable. Note that the random noise is added independently to every element so (later) BN will not cancel it away. We find such a simple data augmentation technique works well in our framework, but as shown in experiments, it only works when the capacity of the network is properly augmented as described in the next section.
|
| 136 |
+
|
| 137 |
+
For notation simplicity, we combine the log1p feature transformation and data augmentation into a single function $\bar { \mathbf { f } } : \mathbb { R } ^ { n \times k } \mathbb { R } ^ { n \times k }$ :
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\mathbf { f } = \log _ { e } ( 1 + | \mathbf { x } | ) \odot \mathrm { s i g n } ( \mathbf { x } ) + \mathcal { N } ( \mathbf { 0 } , \sigma ^ { 2 } \mathbf { I } )
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
# 4.2.2 LEVERAGING LISTWISE CONTEXT
|
| 144 |
+
|
| 145 |
+
For LTR problem, the list of documents can be leveraged in neural models. This is the key base to enhance the network architecture for LTR. We leverage the multi-head self-attention (MHSA) mechanism (Vaswani et al., 2017) to encode ranking list information. More specifically, we generate a contextual embedding ${ \bf a } _ { i }$ , for each item $i$ , considering the document similarity between document $i$ and every document in the list. For the multi-head self-attention mechanism, we have the input $\mathbf { f } \in \mathbb { R } ^ { n \times k }$ , and project f into a query (in the context of attention mechanism) matrix $Q = \mathbf { f } W ^ { Q }$ , a key matrix $K = \mathbf { f } \bar { W } ^ { K }$ , and a value matrix $V = \mathbf { f } W ^ { V }$ with trainable projection matrices $W ^ { Q } , W ^ { K }$ , and $W ^ { V } \in \mathbb { R } ^ { k \times z }$ , where $z$ is the attention head size. Then a self-attention (SA) head computes the weighted sum of the transformed values $V$ as,
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathrm { S A } ( \mathbf { f } ) = \mathrm { S o f t m a x } ( S ( \mathbf { f } ) ) V ,
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where similarity matrix between $Q$ and $K$ is defined as $\begin{array} { r } { S ( \mathbf { f } ) = \frac { Q K ^ { T } } { \sqrt { z } } } \end{array}$ . For each layer, the results from the $H$ heads are concatenated to form the output of multi-head self-attention by
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\mathrm { M H S A } ( \mathbf { f } ) = \mathrm { c o n c a t } _ { h \in [ H ] } [ \mathrm { S A } _ { h } ( \mathbf { f } ) ] W _ { \mathrm { o u t } } + b _ { \mathrm { o u t } } ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where $W _ { \mathrm { o u t } } \in \mathbb { R } ^ { H z \times z }$ and $b _ { \mathrm { o u t } } \in \mathbb { R } ^ { n \times z }$ are trainable parameters. We apply $L \geq 1$ layers of multihead self-attention followed by a layer normalization (Ba et al., 2016) similarly to (Vaswani et al., 2017).
|
| 158 |
+
|
| 159 |
+
By treating ${ \bf a } _ { i }$ as the listwise contextual embedding for item $i$ , we further leverage the simple latent cross idea (Beutel et al., 2018) to effectively generate feature interactions:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
h _ { i } ^ { \mathrm { c r o s s } } = ( 1 + \mathbf { a } _ { i } ) \odot h _ { \mathrm { o u t } } ( x _ { i } ) ,
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $\odot$ is the element-wise multiplication operator $\mathbf { a } _ { i }$ will go through a linear projection when the dimensions do not match, omitted in the equation), and $h _ { \mathrm { o u t } } ( x _ { i } )$ is the output of the final hidden layer of regular network.
|
| 166 |
+
|
| 167 |
+
Learning to rank can be seen as learning to induce order over set of items. One desirable property for ranking approaches that use listwise context is to be permutation equivariant: applying a permutation over input items leads to an equivalent permutation over output scores. DASALC satisfies such a permutation equivariance property.
|
| 168 |
+
|
| 169 |
+
Proposition 1. Let $\pi$ be a permutation of indices of $[ 1 , . . , n ]$ and $\pmb { x } \in \mathbb { R } ^ { n \times k }$ be the input item representation. DASALC is permutation equivariant for scores generated over input items , i.e, $s _ { D A S A L C } ( \pi ( \mathbf { x } ) ) = \pi ( s _ { D A S A L C } ( \mathbf { x } ) )$ . See proof at Appendix $C .$ .
|
| 170 |
+
|
| 171 |
+
# 4.3 REMARKS
|
| 172 |
+
|
| 173 |
+
We compared several popular pointwise, pairwise, and listwise ranking losses. We report all results based on the softmax cross entropy loss $\begin{array} { r } { \bar { l } ( \mathbf { y } , s ( \mathbf { x } ) ) = - \sum _ { i = 1 } ^ { n } y _ { i } \log _ { e } \bar { \frac { e ^ { s _ { i } } } { \sum _ { j } e ^ { s _ { j } } } } } \end{array}$ since it is simple and empirically robust in general, as demonstrated in Appendix B.2.
|
| 174 |
+
|
| 175 |
+
We provided a general framework that can enhance neural LTR models in many components. For each component, we purposefully use simple or well-known techniques for enhancement because the scope of the current research is to identify the possible reasons why neural LTR is under-performing when compared with the best traditional tree-based methods. Clearly, each component can use more advanced techniques, such as learning a more flexible data transformation (Zhuang et al., 2020) or using data augmentation policy (Cubuk et al., 2019), which we leave as future work.
|
| 176 |
+
|
| 177 |
+
# 5 EXPERIMENTS
|
| 178 |
+
|
| 179 |
+
We conduct experiments on the three LTR datasets (introduced in Sec 3.1) with our proposed framework and compare with some methods in Sec 3. For all our experiments using neural network approaches, we implemented them using the TF-Ranking (Pasumarthi et al., 2019) library.
|
| 180 |
+
|
| 181 |
+
We use two variants of our proposed approaches. DASALC is a model trained in our proposed framework. DASALC-ens is an ensemble of DASALC. By realizing LambdaMART is an ensemble method based on boosting, we leverage the randomness of neural model training and simply use the average score of 3-5 models (tuned on validation set) from different runs as the final score in DASALC-ens.
|
| 182 |
+
|
| 183 |
+
Main result. The results are summarized in Table 3. We focus on the comparison with λMARTGBM and also include SetRank to highlight the difference with recent neural LTR models. Readers can refer to Table 2 for more results. We tune hyperparameters on the validation sets, with more details in Appendix A. We have the following observations and discussions: (1) DASALC can sometimes achieve comparable or better results than $\lambda \mathbf { M A R T } _ { G B M }$ , and outperforms recent neural LTR methods by a large margin. (2) DASALC-ens, though simple, can achieve neutral or significantly better results than $\lambda \mathbf { M A R T } _ { G B M }$ on all datasets and metrics. (3) The results on Yahoo dataset are weaker than the other two datasets. One thing to note is Yahoo dataset is already normalized upon release. As we note the importance of input feature transformation, the provided normalization may not be ideal for neural models, thus it should be encouraged to release LTR datasets with raw feature values.
|
| 184 |
+
|
| 185 |
+
Table 3: Result on the Web30K, Yahoo, and Istella datasets. ↑ means significantly better result, performanced against $\lambda \mathbf { M A R T } _ { G B M }$ at the $p \ < \ 0 . 0 5$ level using a two-tailed $t$ -test. Last row is relative difference of DASALC-ens over $\lambda \mathbf { M A R T } _ { G B M }$ .
|
| 186 |
+
|
| 187 |
+
<table><tr><td rowspan=2 colspan=1>Models</td><td rowspan=1 colspan=3>Web30KNDCG@k</td><td rowspan=1 colspan=3>Yahoo NDCG@k</td><td rowspan=1 colspan=3>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM</td><td rowspan=1 colspan=1>50.73</td><td rowspan=1 colspan=1>49.66</td><td rowspan=1 colspan=1>51.48</td><td rowspan=1 colspan=1>71.88</td><td rowspan=1 colspan=1>74.21</td><td rowspan=1 colspan=1>78.02</td><td rowspan=1 colspan=1>74.92</td><td rowspan=1 colspan=1>71.24</td><td rowspan=1 colspan=1>76.07</td></tr><tr><td rowspan=1 colspan=1>SetRankre</td><td rowspan=1 colspan=1>45.91</td><td rowspan=1 colspan=1>45.15</td><td rowspan=1 colspan=1>46.96</td><td rowspan=1 colspan=1>68.22</td><td rowspan=1 colspan=1>70.29</td><td rowspan=1 colspan=1>74.53</td><td rowspan=1 colspan=1>67.60</td><td rowspan=1 colspan=1>63.45</td><td rowspan=1 colspan=1>68.34</td></tr><tr><td rowspan=1 colspan=1>DASALC</td><td rowspan=1 colspan=1>50.95</td><td rowspan=1 colspan=1>50.92↑</td><td rowspan=1 colspan=1>52.88↑</td><td rowspan=1 colspan=1>70.98</td><td rowspan=1 colspan=1>73.76</td><td rowspan=1 colspan=1>77.66</td><td rowspan=1 colspan=1>72.77</td><td rowspan=1 colspan=1>70.06</td><td rowspan=1 colspan=1>75.30</td></tr><tr><td rowspan=1 colspan=1>DASALC-ens(Relative diff)</td><td rowspan=1 colspan=1>51.89↑(+2.29%)</td><td rowspan=1 colspan=1>51.72↑(+4.15%)</td><td rowspan=1 colspan=1>53.73↑(+4.37%)</td><td rowspan=1 colspan=1>71.24(-0.89%)</td><td rowspan=1 colspan=1>74.07(-0.18%)</td><td rowspan=1 colspan=1>77.97(-0.06%)</td><td rowspan=1 colspan=1>74.40(-0.69%)</td><td rowspan=1 colspan=1>71.32(+0.11%)</td><td rowspan=1 colspan=1>76.44↑(+0.49%)</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 4: NDCG $\textcircled { \alpha } 5$ on Istella when different components are added.
|
| 190 |
+
|
| 191 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>DNN</td><td rowspan=1 colspan=1>+loglp</td><td rowspan=1 colspan=1>+SA</td><td rowspan=1 colspan=1>+LC</td><td rowspan=1 colspan=1>+DA</td><td rowspan=1 colspan=1>+ens</td></tr><tr><td rowspan=1 colspan=1>NDCG@5</td><td rowspan=1 colspan=1>64.72</td><td rowspan=1 colspan=1>67.09</td><td rowspan=1 colspan=1>68.32</td><td rowspan=1 colspan=1>68.80</td><td rowspan=1 colspan=1>70.06</td><td rowspan=1 colspan=1>71.32</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Ablation study. We provide some ablation study results in Table 4 to highlight the effectiveness of each component in our framework. Each component is added cumulatively from left to right in the table. We can see that each component helps and the best performance is achieved when all components are combined. More detailed ablation study is provided in Appendix B. Appendix B.1 gives more results on the effect of the log1p transformation. Appendix B.2 compares different loss functions and shows that listwise ranking loss performs better. Appendix B.3 shows the benefit of effective listwise context modeling. Appendix B.4 shows the effect of data augmentation in different model architectures.
|
| 194 |
+
|
| 195 |
+
# 6 RELATED WORK
|
| 196 |
+
|
| 197 |
+
We focus on traditional LTR problems when there are only numeric features and human ratings available. Some works (Mitra & Craswell, 2018; Nogueira et al., 2019; Han et al., 2020) on document matching and ranking leverage neural components such as word2vec and BERT when raw text is available, where the major benefit comes from semantic modeling of highly sparse input and tree-based methods become less relevant due to its limitation in handling sparse features.
|
| 198 |
+
|
| 199 |
+
The pioneering neural LTR models are RankNet (Burges et al., 2005) and LambdaRank (Burges et al., 2007). They use feed-forward networks on dense features as their scoring functions and became less favored than tree-based LambdaMART (Burges, 2010). Recent neural LTR models have explored new model architectures (Pang et al., 2020; Qin et al., 2020b), differetiable losses (Bruch et al., 2019b), and leveraging more auxiliary information (Ai et al., 2018). However, there is less work that specifically understands and addresses weaknesses for neural LTR, and a benchmark with strong tree-based baseline is missing. In this work, we show that relatively simple components that aim to address weaknesses of neural models can outperform recent methods significantly.
|
| 200 |
+
|
| 201 |
+
The idea of generating new data for LTR has been explored in few work recently, but their focus is to train more discriminative ranking models, not to mitigate the data sparsity problem for high-capacity neural models. For example, Yu & Lam (2019) uses a separate Autoencoder model to generate data and then feed them into tree-based models. This work can be treated as orthogonal to our data augmentation technique.
|
| 202 |
+
|
| 203 |
+
Several LTR papers have leveraged neural sequence modeling based on LSTM (Ai et al., 2018) or self-attention (Pang et al., 2020; Pasumarthi et al., 2020), which is not easy for tree-based approaches to model. We also leverage listwise context via self-attention to show neural LTR models are easily extendable. The combination of self-attention based listwise context and latent cross in our work to specifically mitigate the ineffectiveness of neural model to generate higher-order feature interactions has not been explored in the literature.
|
| 204 |
+
|
| 205 |
+
Our work is mostly orthogonal to another line of LTR research, namely unbiased learning to rank from implicit feedback data, such as clicks (Joachims et al., 2017; Hu et al., 2019; Qin et al., 2020a; Zhuang et al., 2021). There are also papers that try to reproduce tree models using neural architectures for tabular data (Saberian et al., 2019; Lee & Jaakkola, 2020). Our motivation is different in that our goal is to identify and mitigate weaknesses of neural approaches in general.
|
| 206 |
+
|
| 207 |
+
# 7 CONCLUSION AND DISCUSSION
|
| 208 |
+
|
| 209 |
+
In this paper, we first showed the inconsistency of performance comparison between neural rankers and GBDT models, and verified the inferior performance of neural models. We then identified the weaknesses when building neural rankers in multiple components and proposed methods to address them. Our proposed framework performs competitively well with the strong tree-based baselines. We believe our general framework and the rigorous benchmarking provides critical contribution to facilitate future neural LTR research. In particular, neural models are powerful in modeling complex relations (e.g, attention mechanism (Vaswani et al., 2017)) and raw text features (e.g., BERT (Devlin et al., 2019)). Also, the active research on neural networks in other domains continuously advances neural techniques (e.g., optimizers (Kingma & Ba, 2014)) All these can be studied in the LTR setting and our work pave ways to avoid pitfalls when leveraging these techniques.
|
| 210 |
+
|
| 211 |
+
# REFERENCES
|
| 212 |
+
|
| 213 |
+
Qingyao Ai, Keping Bi, Jiafeng Guo, and W Bruce Croft. Learning a deep listwise context model for ranking refinement. In Proceedings of the 41st International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 135–144, 2018.
|
| 214 |
+
|
| 215 |
+
Qingyao Ai, Xuanhui Wang, Sebastian Bruch, Nadav Golbandi, Michael Bendersky, and Marc Najork. Learning groupwise multivariate scoring functions using deep neural networks. In Proceedings of the 2019 ACM SIGIR International Conference on Theory of Information Retrieval, pp. 85–92, 2019.
|
| 216 |
+
|
| 217 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 218 |
+
|
| 219 |
+
Alex Beutel, Paul Covington, Sagar Jain, Can Xu, Jia Li, Vince Gatto, and Ed H Chi. Latent cross: Making use of context in recurrent recommender systems. In Proceedings of the Eleventh ACM International Conference on Web Search and Data Mining, pp. 46–54, 2018.
|
| 220 |
+
|
| 221 |
+
Sebastian Bruch, Xuanhui Wang, Michael Bendersky, and Marc Najork. An analysis of the softmax cross entropy loss for learning-to-rank with binary relevance. In Proceedings of the 2019 ACM SIGIR International Conference on Theory of Information Retrieval, pp. 75–78, 2019a.
|
| 222 |
+
|
| 223 |
+
Sebastian Bruch, Masrour Zoghi, Michael Bendersky, and Marc Najork. Revisiting approximate metric optimization in the age of deep neural networks. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 1241–1244, 2019b.
|
| 224 |
+
|
| 225 |
+
Sebastian Bruch, Shuguang Han, Michael Bendersky, and Marc Najork. A stochastic treatment of learning to rank scoring functions. In Proceedings of the 13th International Conference on Web Search and Data Mining, pp. 61–69, 2020.
|
| 226 |
+
|
| 227 |
+
Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hullender. Learning to rank using gradient descent. In Proceedings of the 22nd International Conference on Machine Learning, pp. 89–96, 2005.
|
| 228 |
+
|
| 229 |
+
Christopher J. Burges, Robert Ragno, and Quoc V. Le. Learning to rank with nonsmooth cost functions. In B. Scholkopf, J. C. Platt, and T. Hoffman (eds.), ¨ Advances in Neural Information Processing Systems 19, pp. 193–200. 2007.
|
| 230 |
+
|
| 231 |
+
Christopher JC Burges. From RankNet to LambdaRank to LambdaMART: An overview. Learning, 11(23-581):81, 2010.
|
| 232 |
+
|
| 233 |
+
Zhe Cao, Tao Qin, Tie-Yan Liu, Ming-Feng Tsai, and Hang Li. Learning to rank: from pairwise approach to listwise approach. In Proceedings of the 24th international conference on Machine learning, pp. 129–136, 2007.
|
| 234 |
+
|
| 235 |
+
Olivier Chapelle and Yi Chang. Yahoo! learning to rank challenge overview. In Proceedings of the Learning to Rank Challenge, pp. 1–24, 2011.
|
| 236 |
+
|
| 237 |
+
Ekin D. Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V. Le. Autoaugment: Learning augmentation strategies from data. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 113–123, 2019.
|
| 238 |
+
|
| 239 |
+
Domenico Dato, Claudio Lucchese, Franco Maria Nardini, Salvatore Orlando, Raffaele Perego, Nicola Tonellotto, and Rossano Venturini. Fast ranking with additive ensembles of oblivious and non-oblivious regression trees. ACM Trans. Inf. Syst., 2016.
|
| 240 |
+
|
| 241 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 4171–4186, 2019.
|
| 242 |
+
|
| 243 |
+
Aditya Grover, Eric Wang, Aaron Zweig, and Stefano Ermon. Stochastic optimization of sorting networks via continuous relaxations. arXiv preprint arXiv:1903.08850, 2019.
|
| 244 |
+
|
| 245 |
+
Shuguang Han, Xuanhui Wang, Mike Bendersky, and Marc Najork. Learning-to-rank with bert in tf-ranking. arXiv preprint arXiv:2004.08476, 2020.
|
| 246 |
+
|
| 247 |
+
Awni Hannun, Carl Case, Jared Casper, Bryan Catanzaro, Greg Diamos, Erich Elsen, Ryan Prenger, Sanjeev Satheesh, Shubho Sengupta, Adam Coates, and Andrew Y. Ng. Deep speech: Scaling up end-to-end speech recognition. arXiv preprint arXiv:1412.5567, 2014.
|
| 248 |
+
|
| 249 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 250 |
+
|
| 251 |
+
Ziniu Hu, Yang Wang, Qu Peng, and Hang Li. Unbiased lambdamart: An unbiased pairwise learning-to-rank algorithm. In The Web Conference, pp. 2830–2836, 2019.
|
| 252 |
+
|
| 253 |
+
Thorsten Joachims. Optimizing search engines using clickthrough data. In Proceedings of the Eighth ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 133–142, 2002.
|
| 254 |
+
|
| 255 |
+
Thorsten Joachims. Training linear svms in linear time. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 217–226, 2006.
|
| 256 |
+
|
| 257 |
+
Thorsten Joachims, Adith Swaminathan, and Tobias Schnabel. Unbiased learning-to-rank with biased feedback. In Proceedings of the Tenth ACM International Conference on Web Search and Data Mining, pp. 781–789, 2017.
|
| 258 |
+
|
| 259 |
+
Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and TieYan Liu. Lightgbm: A highly efficient gradient boosting decision tree. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 3149–3157, 2017.
|
| 260 |
+
|
| 261 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 262 |
+
|
| 263 |
+
Guang-He Lee and Tommi S. Jaakkola. Oblique decision trees from derivatives of relu networks. In 8th International Conference on Learning Representations, 2020.
|
| 264 |
+
|
| 265 |
+
Pan Li, Zhen Qin, Xuanhui Wang, and Donald Metzler. Combining decision trees and neural networks for learning-to-rank in personal search. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2032–2040, 2019.
|
| 266 |
+
|
| 267 |
+
Zachary C Lipton and Jacob Steinhardt. Troubling trends in machine learning scholarship. arXiv preprint arXiv:1807.03341, 2018.
|
| 268 |
+
|
| 269 |
+
Tie-Yan Liu. Learning to rank for information retrieval. Found. Trends Inf. Retr., 2009.
|
| 270 |
+
|
| 271 |
+
Bhaskar Mitra and Nick Craswell. An introduction to neural information retrieval. Foundations and Trends in Information Retrieval, 13(1):1–126, 2018.
|
| 272 |
+
|
| 273 |
+
Rodrigo Nogueira, Wei Yang, Kyunghyun Cho, and Jimmy Lin. Multi-stage document ranking with bert. arXiv preprint arXiv:1910.14424, 2019.
|
| 274 |
+
|
| 275 |
+
Liang Pang, Jun Xu, Qingyao Ai, Yanyan Lan, Xueqi Cheng, and Jirong Wen. Setrank: Learning a permutation-invariant ranking model for information retrieval. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 499–508, 2020.
|
| 276 |
+
|
| 277 |
+
Rama Kumar Pasumarthi, Sebastian Bruch, Xuanhui Wang, Cheng Li, Michael Bendersky, Marc Najork, Jan Pfeifer, Nadav Golbandi, Rohan Anil, and Stephan Wolf. TF-Ranking: Scalable tensorflow library for learning-to-rank. In Proceedings of the 25th ACM SIGKDD Interna-tional Conference on Knowledge Discovery & Data Mining, pp. 2970–2978, 2019.
|
| 278 |
+
|
| 279 |
+
Rama Kumar Pasumarthi, Honglei Zhuang, Xuanhui Wang, Michael Bendersky, and Marc Najork. Permutation equivariant document interaction network for neural learning to rank. In Proceedings of the 2020 ACM SIGIR on International Conference on Theory of Information Retrieval, pp. 145–148, 2020.
|
| 280 |
+
|
| 281 |
+
Luis Perez and Jason Wang. The effectiveness of data augmentation in image classification using deep learning. arXiv preprint arXiv:1712.04621, 2017.
|
| 282 |
+
|
| 283 |
+
Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, and Andrey Gulin. Catboost: unbiased boosting with categorical features. In Advances in neural information processing systems, pp. 6638–6648, 2018.
|
| 284 |
+
|
| 285 |
+
Tao Qin and Tie-Yan Liu. Introducing LETOR 4.0 datasets. CoRR, abs/1306.2597, 2013.
|
| 286 |
+
|
| 287 |
+
Tao Qin, Tie-Yan Liu, and Hang Li. A general approximation framework for direct optimization of information retrieval measures. Information retrieval, 13(4):375–397, 2010.
|
| 288 |
+
|
| 289 |
+
Zhen Qin, Suming J. Chen, Donald Metzler, Yongwoo Noh, Jingzheng Qin, and Xuanhui Wang. Attribute-based propensity for unbiased learning in recommender systems: Algorithm and case studies. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2359–2367, 2020a.
|
| 290 |
+
|
| 291 |
+
Zhen Qin, Zhongliang Li, Michael Bendersky, and Donald Metzler. Matching cross network for learning to rank in personal search. In The Web Conference, pp. 2835–2841, 2020b.
|
| 292 |
+
|
| 293 |
+
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.
|
| 294 |
+
|
| 295 |
+
Mohammad Saberian, Pablo Delgado, and Yves Raimond. Gradient boosted decision tree neural network. arXiv preprint arXiv:1910.09340, 2019.
|
| 296 |
+
|
| 297 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 298 |
+
|
| 299 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. Glue: A multi-task benchmark and analysis platform for natural language understanding. arXiv preprint arXiv:1804.07461, 2018a.
|
| 300 |
+
|
| 301 |
+
Jun Wang, Lantao Yu, Weinan Zhang, Yu Gong, Yinghui Xu, Benyou Wang, Peng Zhang, and Dell Zhang. Irgan: A minimax game for unifying generative and discriminative information retrieval models. In Proceedings of the 40th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 515–524, 2017a.
|
| 302 |
+
|
| 303 |
+
Ruoxi Wang, Bin Fu, Gang Fu, and Mingliang Wang. Deep & cross network for ad click predictions. In Proceedings of the ADKDD’17, pp. 1–7. 2017b.
|
| 304 |
+
|
| 305 |
+
Xuanhui Wang, Cheng Li, Nadav Golbandi, Michael Bendersky, and Marc Najork. The lambdaloss framework for ranking metric optimization. In Proceedings of the 27th ACM International Conference on Information and Knowledge Management, pp. 1313–1322, 2018b.
|
| 306 |
+
|
| 307 |
+
Qiang Wu, Christopher J. C. Burges, Krysta M. Svore, and Jianfeng Gao. Adapting boosting for information retrieval measures. Information Retrieval Journal, 13:254–270, 2010.
|
| 308 |
+
|
| 309 |
+
Wei Yang, Kuang Lu, Peilin Yang, and Jimmy Lin. Critically examining the ”neural hype”: Weak baselines and the additivity of effectiveness gains from neural ranking models. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 1129–1132, 2019.
|
| 310 |
+
|
| 311 |
+
Qian Yu and Wai Lam. Data augmentation based on adversarial autoencoder handling imbalance for learning to rank. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 411–418, 2019.
|
| 312 |
+
|
| 313 |
+
Xiaofeng Zhu and Diego Klabjan. Listwise learning to rank by exploring unique ratings. In Proceedings of the 13th International Conference on Web Search and Data Mining, 2020.
|
| 314 |
+
|
| 315 |
+
Honglei Zhuang, Xuanhui Wang, Michael Bendersky, and Marc Najork. Feature transformation for neural ranking models. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 1649–1652, 2020.
|
| 316 |
+
|
| 317 |
+
Honglei Zhuang, Zhen Qin, Xuanhui Wang, Mike Bendersky, Xinyu Qian, Po Hu, and Chary Chen. Cross-positional attention for debiasing clicks. In The Web Conference, 2021.
|
| 318 |
+
|
| 319 |
+
# APPENDIX
|
| 320 |
+
|
| 321 |
+
# A HYPERPARAMETER TUNING
|
| 322 |
+
|
| 323 |
+
For $\lambda \mathbf { M A R T } _ { G B M }$ , we do a grid search for number of trees $\in \{ 3 0 0 , 5 0 0 , 1 0 0 0 \}$ , number of leaves $\in \{ 2 0 0 , 5 0 0 , 1 0 0 0 \}$ , and learning rate $\in \{ 0 . 0 1 , 0 . 0 5 , 0 . 1 , 0 . 5 \}$ .
|
| 324 |
+
|
| 325 |
+
For our neural models the main hyperparameters are hidden layer size $\in$ $\{ 2 5 6 , 5 1 2 , 1 0 2 4 , 2 0 4 8 , 3 0 7 2 , 4 0 9 6 \}$ and number of layers $\in \quad \{ 3 , 4 , 5 , 6 \}$ for regular DNN, data augmentation noise $\in \ [ 0 , 5 . 0 ]$ using binary search with step 0.1, number of attention layers $\in \{ 3 , 4 , 5 , 6 \}$ , and number of attention heads $\in \{ 2 , 3 , 4 , 5 \}$ . The same parameter swept is enabled on the baselines we tried when applicable. One noticeable difference between our work and existing work is that we tried large hidden layer size up to 4096 and found that large models work better in general when data augmentation is enabled. We are in the process to release the code and trained models in an open-sourced software package.
|
| 326 |
+
|
| 327 |
+
# B ABLATION STUDIES AND ANALYSIS
|
| 328 |
+
|
| 329 |
+
# B.1 EFFECT OF LOG1P INPUT TRANSFORMATION
|
| 330 |
+
|
| 331 |
+
We first show that the simple log1p transform can improve performance on the Web30K and Istella datasets (Yahoo dataset has already been normalized). Results in Table 5 are based on regular DNN models using the softmax cross-entropy loss. The trends are similar for other configurations. We also noted the results are in general slightly better than Gaussian normalization due to the long-tail nature of LTR dataset features, which we omit here.
|
| 332 |
+
|
| 333 |
+
Table 5: Results on Web30K and Istella using log1p input transformation.
|
| 334 |
+
|
| 335 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=3>Web30KNDCG@k</td><td rowspan=1 colspan=3>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>Without log1p</td><td rowspan=1 colspan=1>44.60</td><td rowspan=1 colspan=1>44.99</td><td rowspan=1 colspan=1>47.22</td><td rowspan=1 colspan=1>67.19</td><td rowspan=1 colspan=1>64.72</td><td rowspan=1 colspan=1>70.12</td></tr><tr><td rowspan=1 colspan=1>With log1p</td><td rowspan=1 colspan=1>48.30</td><td rowspan=1 colspan=1>48.22</td><td rowspan=1 colspan=1>50.35</td><td rowspan=1 colspan=1>69.78</td><td rowspan=1 colspan=1>67.09</td><td rowspan=1 colspan=1>72.49</td></tr></table>
|
| 336 |
+
|
| 337 |
+
We can see that such simple transformation can bring meaningful gains. In all following sections, we use log1p transformation by default.
|
| 338 |
+
|
| 339 |
+
# B.2 RANKING LOSSES
|
| 340 |
+
|
| 341 |
+
Many recent progresses of neural LTR are on ranking losses, especially listwise ranking losses (Bruch et al., 2019b;a; 2020; Grover et al., 2019). For example, it is attractive to devise differentiable versions of ranking losses for end-to-end learning. Here we do a benchmark of different ranking losses on regular DNN models on different datasets to show that (1) Listwise ranking losses are superior choices to pointwise or pairwise losses that are normally used for non-neural LTR models; (2) Performances of state-of-the-art listwise ranking losses are comparable; (3) The softmax cross entropy loss is a simple but robust choice.
|
| 342 |
+
|
| 343 |
+
We consider the following ranking losses:
|
| 344 |
+
|
| 345 |
+
• SigmoidCrossEntropy: a widely used pointwise loss: $\begin{array} { r } { l ( \mathbf { y } , s ( \mathbf { x } ) ) = \sum _ { i = 1 } ^ { n } - y _ { i } s _ { i } + \log _ { e } ( 1 + } \end{array}$ $e ^ { s _ { i } }$ ).
|
| 346 |
+
• RankNet (Burges et al., 2005): a popular pairwise loss: $\begin{array} { r } { l ( \mathbf { y } , s ( \mathbf { x } ) ) = \sum _ { y _ { i } > y _ { j } } \log _ { e } ( 1 + } \end{array}$ $e ^ { s _ { j } - s _ { i } } )$ .
|
| 347 |
+
• LambdaRank (Burges et al., 2007; Wang et al., 2018b): the pairwise loss with ∆NDCG
|
| 348 |
+
weight, which is a direct implementation of the LambdaMART loss in Eq. (5).
|
| 349 |
+
• Softmax (Cao et al., 2007; Bruch et al., 2019a): a popular listwise loss: $l ( { \bf y } , s ( { \bf x } ) ) =$ − Pni=1 yi loge e P ij esj .
|
| 350 |
+
• ApproxNDCG (Qin et al., 2010; Bruch eentiable approximation of NDCG metric: l(y, s(x)) = − 1DCG(π∗,y) $\begin{array} { r } { l ( \mathbf { y } , s ( \mathbf { x } ) ) ~ = ~ - { \frac { 1 } { D C G ( \pi ^ { * } , \mathbf { y } ) } } \sum _ { i = 1 } ^ { n } { \frac { 2 ^ { y _ { i } } - 1 } { \log _ { 2 } ( 1 + \pi _ { s } ( i ) ) } } } \end{array}$ -, where $\begin{array} { r } { \pi _ { s } ( i ) = \frac { 1 } { 2 } + \sum _ { j } } \end{array}$ sigmoid $\frac { s _ { j } - s _ { i } } { T } \Big )$ with $T$ a smooth parameter.
|
| 351 |
+
• GumbelApproxNDCG (Bruch et al., 2019b; 2020): a listwise loss with a stochastic treatment on ApproxNDCG: scores $s$ in the above NDCG loss function will be substituted by $s _ { i } + g _ { i }$ , with a gumbel noise $g _ { i } = - \log _ { e } ( - \log _ { e } U _ { i } ) )$ from $U _ { i }$ uniformly sampled in $[ 0 , 1 ]$ .
|
| 352 |
+
• NeuralSortNDCG(Grover et al., 2019): a listwise loss that approximates NDCG metric
|
| 353 |
+
with the NeuralSort trick: l(y, s(x)) = − 1DCG(π∗,y) $\begin{array} { r } { l ( \mathbf { y } , s ( \mathbf { x } ) ) = - { \frac { 1 } { D C G ( \pi ^ { * } , \mathbf { y } ) } } \sum _ { i , r = 1 } ^ { n } { \frac { ( 2 ^ { y _ { i } } - 1 ) P _ { i r } ^ { s } } { \log _ { 2 } ( 1 + r ) } } } \end{array}$ , where $P _ { i r } ^ { s }$ is an
|
| 354 |
+
approximate permutation matrix, obtained by NeuralSort trick: $P _ { i r } ^ { \bar { s } } = \mathrm { s o f t m a x } [ ( ( n + 1 -$ $\begin{array} { r } { \bar { 2 i } \bar { ) } s _ { r } - \sum _ { j } \bar { | s _ { r } - s _ { j } | } ) / T ] } \end{array}$ , with $T$ a smooth parameter.
|
| 355 |
+
• GumbelNeuralSortNDCG: a listwise loss with a stochastic treatment of NeuralSortNDCG by replacing the score $s$ in neural sort permutation matrix by $s _ { i } + g _ { i }$ , where $g _ { i }$ is again sampled from the gumbel distribution. This is new in the literature but not the major focus of this work.
|
| 356 |
+
|
| 357 |
+
<table><tr><td rowspan=2 colspan=1>Ranking loss</td><td rowspan=1 colspan=3>Web30KNDCG@k</td><td rowspan=1 colspan=3>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>SigmoidCrossEntropy</td><td rowspan=1 colspan=1>47.65</td><td rowspan=1 colspan=1>46.85</td><td rowspan=1 colspan=1>48.47</td><td rowspan=1 colspan=1>67.62</td><td rowspan=1 colspan=1>64.46</td><td rowspan=1 colspan=1>69.51</td></tr><tr><td rowspan=1 colspan=1>RankNet</td><td rowspan=1 colspan=1>46.05</td><td rowspan=1 colspan=1>46.67</td><td rowspan=1 colspan=1>48.98</td><td rowspan=1 colspan=1>69.09</td><td rowspan=1 colspan=1>66.04</td><td rowspan=1 colspan=1>71.81</td></tr><tr><td rowspan=1 colspan=1>LambdaRank</td><td rowspan=1 colspan=1>45.87</td><td rowspan=1 colspan=1>46.55</td><td rowspan=1 colspan=1>48.85</td><td rowspan=1 colspan=1>68.18</td><td rowspan=1 colspan=1>65.22</td><td rowspan=1 colspan=1>70.88</td></tr><tr><td rowspan=1 colspan=1>Softmax</td><td rowspan=1 colspan=1>48.30</td><td rowspan=1 colspan=1>48.22</td><td rowspan=1 colspan=1>50.35</td><td rowspan=1 colspan=1>69.78</td><td rowspan=1 colspan=1>67.09</td><td rowspan=1 colspan=1>72.49</td></tr><tr><td rowspan=1 colspan=1>ApproxNDCG</td><td rowspan=1 colspan=1>49.31</td><td rowspan=1 colspan=1>47.87</td><td rowspan=1 colspan=1>49.49</td><td rowspan=1 colspan=1>70.05</td><td rowspan=1 colspan=1>66.08</td><td rowspan=1 colspan=1>70.76</td></tr><tr><td rowspan=1 colspan=1>GumbelApproxNDCG</td><td rowspan=1 colspan=1>49.53</td><td rowspan=1 colspan=1>48.07</td><td rowspan=1 colspan=1>49.75</td><td rowspan=1 colspan=1>71.78</td><td rowspan=1 colspan=1>67.33</td><td rowspan=1 colspan=1>71.79</td></tr><tr><td rowspan=1 colspan=1>NeuralSortNDCG</td><td rowspan=1 colspan=1>48.66</td><td rowspan=1 colspan=1>47.19</td><td rowspan=1 colspan=1>48.83</td><td rowspan=1 colspan=1>68.92</td><td rowspan=1 colspan=1>64.27</td><td rowspan=1 colspan=1>69.03</td></tr><tr><td rowspan=1 colspan=1>GumbelNeuralSortNDCG</td><td rowspan=1 colspan=1>49.74</td><td rowspan=1 colspan=1>48.40</td><td rowspan=1 colspan=1>50.22</td><td rowspan=1 colspan=1>70.96</td><td rowspan=1 colspan=1>67.26</td><td rowspan=1 colspan=1>71.92</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 6: Results on the Web30k and Istella datasets with standard feed-forward network architecture.
|
| 360 |
+
|
| 361 |
+
The results are summarized in Table 6. For different ranking losses, we make a grid search over different optimizers with different learning rates: for Adam optimizer, we scan learning rates $\in$ $\{ 1 0 ^ { - 4 } , 1 0 ^ { \dot { - } 3 } , 1 0 ^ { - 2 } \}$ ; for Adagrad optimizer, we scan learning rates $\in \{ 0 . 0 1 , 0 . 1 , 0 . 5 \}$ . When the smooth parameter $T$ is applicable, we also scan it $\in \{ 0 . 1 , 1 , 1 0 \}$ . We report the results based on best ${ \mathrm { N D C G } } @ 5$ for different losses.
|
| 362 |
+
|
| 363 |
+
As we have stated above, we find that: (1) The performance of models trained with listwise losses are significantly better than the models trained with pointwise or pairwise losses. (2) Different listwise losses are generally comparable, and we found that the softmax cross-entropy loss performs coherently well over different models and different datasets. It is thus used in our main results and following sections. (3) LambdaRank does not work well for neural models. On the other hand, previous work (Bruch et al., 2019a) shows that tree-based models with softmax loss are not as good as LambdaMART, demonstrating that tree-based models and neural LTR models have different behavior on different loss functions. This encourages future work to design neural LTR specific ranking losses.
|
| 364 |
+
|
| 365 |
+
# B.3 EFFECT OF LISTWISE CONTEXT
|
| 366 |
+
|
| 367 |
+
We study the effect of leveraging listwise context with self-attention, with and without latent cross (concatenation between item feature and context feature will be applied) (Pasumarthi et al., 2020) on the Web30K and Istella datasets. Results are shown in Table 7. We can see that using neural approach to model listwise context, which is difficult for tree-based models to do, is quite beneficial. Latent cross, though simple, can help leverage listwise context more effectively.
|
| 368 |
+
|
| 369 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=3>Web30KNDCG@k</td><td rowspan=1 colspan=1>Istel</td><td rowspan=1 colspan=2>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>DNN</td><td rowspan=1 colspan=1>48.30</td><td rowspan=1 colspan=1>48.22</td><td rowspan=1 colspan=1>50.35</td><td rowspan=1 colspan=1>69.78</td><td rowspan=1 colspan=1>67.09</td><td rowspan=1 colspan=1>72.49</td></tr><tr><td rowspan=1 colspan=1>Self-attention</td><td rowspan=1 colspan=1>49.89</td><td rowspan=1 colspan=1>50.15</td><td rowspan=1 colspan=1>52.18</td><td rowspan=1 colspan=1>71.77</td><td rowspan=1 colspan=1>68.32</td><td rowspan=1 colspan=1>73.72</td></tr><tr><td rowspan=1 colspan=1>Self-attention and LC</td><td rowspan=1 colspan=1>50.19</td><td rowspan=1 colspan=1>50.49</td><td rowspan=1 colspan=1>52.47</td><td rowspan=1 colspan=1>72.19</td><td rowspan=1 colspan=1>68.80</td><td rowspan=1 colspan=1>74.21</td></tr></table>
|
| 370 |
+
|
| 371 |
+
Table 7: Results on the Web30K and Istella datasets using self-attention and latent cross.
|
| 372 |
+
|
| 373 |
+
# B.4 EFFECT OF DATA AUGMENTATION
|
| 374 |
+
|
| 375 |
+
One of the technical findings in this work is that using a simple Gaussian noise as data augmentation can help neural LTR models. Below we add Gaussian noise with different strength $( \sigma )$ to both DNN model and the DASALC framework with results shown in Table 8. We can see that the performance
|
| 376 |
+
|
| 377 |
+
<table><tr><td rowspan=2 colspan=1>Method (σ)</td><td rowspan=1 colspan=3>Web30KNDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>DNN(0.0)</td><td rowspan=1 colspan=1>48.30</td><td rowspan=1 colspan=1>48.22</td><td rowspan=1 colspan=1>50.35</td></tr><tr><td rowspan=1 colspan=1>DNN(0.1)</td><td rowspan=1 colspan=1>48.10</td><td rowspan=1 colspan=1>48.01</td><td rowspan=1 colspan=1>50.14</td></tr><tr><td rowspan=1 colspan=1>DNN(1.0)</td><td rowspan=1 colspan=1>46.39</td><td rowspan=1 colspan=1>46.15</td><td rowspan=1 colspan=1>48.18</td></tr><tr><td rowspan=1 colspan=1>DASALC(0.0)</td><td rowspan=1 colspan=1>50.19</td><td rowspan=1 colspan=1>50.49</td><td rowspan=1 colspan=1>52.47</td></tr><tr><td rowspan=1 colspan=1>DASALC(0.1)</td><td rowspan=1 colspan=1>50.38</td><td rowspan=1 colspan=1>50.61</td><td rowspan=1 colspan=1>52.56</td></tr><tr><td rowspan=1 colspan=1>DASALC(1.5)</td><td rowspan=1 colspan=1>50.95</td><td rowspan=1 colspan=1>50.92</td><td rowspan=1 colspan=1>52.88</td></tr><tr><td rowspan=1 colspan=1>DASALC(2.0)</td><td rowspan=1 colspan=1>50.65</td><td rowspan=1 colspan=1>50.78</td><td rowspan=1 colspan=1>52.68</td></tr></table>
|
| 378 |
+
|
| 379 |
+
Table 8: Results on the Web30K datasets using different architecture and random noise strength.
|
| 380 |
+
|
| 381 |
+
of DNN starts to drop as soon as we start to add noise. However, for DASALC, data augmentation helps and the performance looks robust using different levels of noise. The performance peeks around $\sigma = 1 . 5$ . The optimal $\sigma$ needs tuning for different datasets but the general trends are similar for other datasets. We treat the study of the exact mechanism of how data augmentation works in DASALC and the application of more sophisticated data augmentation techniques as future work.
|
| 382 |
+
|
| 383 |
+
We also try to add noise to $\lambda \mathbf { M A R T } _ { G B M }$ and see similar results as DNN. The results on the YAHOO dataset is shown in Table 9, we can see that adding noise leads to worse accuracy.
|
| 384 |
+
|
| 385 |
+
<table><tr><td rowspan=2 colspan=1>Method (σ)</td><td rowspan=1 colspan=3>Yahoo NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM(0.0)</td><td rowspan=1 colspan=1>71.88</td><td rowspan=1 colspan=1>74.21</td><td rowspan=1 colspan=1>78.02</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM(0.1)</td><td rowspan=1 colspan=1>70.10</td><td rowspan=1 colspan=1>72.60</td><td rowspan=1 colspan=1>77.19</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM(1.0)</td><td rowspan=1 colspan=1>64.96</td><td rowspan=1 colspan=1>67.28</td><td rowspan=1 colspan=1>72.60</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM(1.5)</td><td rowspan=1 colspan=1>64.39</td><td rowspan=1 colspan=1>66.84</td><td rowspan=1 colspan=1>72.27</td></tr></table>
|
| 386 |
+
|
| 387 |
+
Table 9: Results on the Yahoo datasets using different architecture and random noise strength.
|
| 388 |
+
|
| 389 |
+
# B.5 PERFORMANCE ON CATBOOST
|
| 390 |
+
|
| 391 |
+
We mainly compared with $\lambda \mathbf { M A R T } _ { R a n k L i b }$ and $\lambda \mathbf { M A R T } _ { G B M }$ in the main content since they are the most popular baselines used in recent papers. There are other GBDT implementations that can also be used for the LTR task. Catboost (Prokhorenkova et al., 2018) is a recently popular GBDT implementation for various tasks. We also evaluate its performance on the three LTR datasets. Note that Catboost is not specific to ranking and does not have a standard LambdaMART implementation to the best of our knowledge. We try both the QueryRMSE loss and YetiRank loss, which are the best performing losses on most existing Catboost’s benchmarks. The results are reported in Table 10.
|
| 392 |
+
|
| 393 |
+
Table 10: Comparison of Catboost with other methods on the Web30K, Yahoo, and Istella datasets.
|
| 394 |
+
|
| 395 |
+
<table><tr><td rowspan=2 colspan=1>Models</td><td rowspan=1 colspan=3>Web30K NDCG@k</td><td rowspan=1 colspan=3>Yahoo NDCG@k</td><td rowspan=1 colspan=3>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>XMARTRankLib</td><td rowspan=1 colspan=1>45.35</td><td rowspan=1 colspan=1>44.59</td><td rowspan=1 colspan=1>46.46</td><td rowspan=1 colspan=1>68.52</td><td rowspan=1 colspan=1>70.27</td><td rowspan=1 colspan=1>74.58</td><td rowspan=1 colspan=1>67.71</td><td rowspan=1 colspan=1>61.18</td><td rowspan=1 colspan=1>65.91</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM</td><td rowspan=1 colspan=1>50.73</td><td rowspan=1 colspan=1>49.66</td><td rowspan=1 colspan=1>51.48</td><td rowspan=1 colspan=1>71.88</td><td rowspan=1 colspan=1>74.21</td><td rowspan=1 colspan=1>78.02</td><td rowspan=1 colspan=1>74.92</td><td rowspan=1 colspan=1>71.24</td><td rowspan=1 colspan=1>76.07</td></tr><tr><td rowspan=1 colspan=1>Catboost-QueryRMSE</td><td rowspan=1 colspan=1>50.07</td><td rowspan=1 colspan=1>50.04</td><td rowspan=1 colspan=1>51.97</td><td rowspan=1 colspan=1>70.50</td><td rowspan=1 colspan=1>74.25</td><td rowspan=1 colspan=1>78.31</td><td rowspan=1 colspan=1>69.91</td><td rowspan=1 colspan=1>67.73</td><td rowspan=1 colspan=1>72.18</td></tr><tr><td rowspan=1 colspan=1>Catboost-YetiRank</td><td rowspan=1 colspan=1>48.92</td><td rowspan=1 colspan=1>49.10</td><td rowspan=1 colspan=1>51.31</td><td rowspan=1 colspan=1>69.86</td><td rowspan=1 colspan=1>74.00</td><td rowspan=1 colspan=1>78.11</td><td rowspan=1 colspan=1>72.06</td><td rowspan=1 colspan=1>69.97</td><td rowspan=1 colspan=1>74.12</td></tr><tr><td rowspan=1 colspan=1>DASALC-ens</td><td rowspan=1 colspan=1>51.89</td><td rowspan=1 colspan=1>51.72</td><td rowspan=1 colspan=1>53.73</td><td rowspan=1 colspan=1>71.24</td><td rowspan=1 colspan=1>74.07</td><td rowspan=1 colspan=1>77.97</td><td rowspan=1 colspan=1>74.40</td><td rowspan=1 colspan=1>71.32</td><td rowspan=1 colspan=1>76.44</td></tr></table>
|
| 396 |
+
|
| 397 |
+
We can see that Catboost can produce very decent results, clearly outperforming $\lambda \mathbf { M A R T } _ { R a n k L i b }$ , but its comparison with $\lambda \mathbf { M A R T } _ { G B M }$ is mixed. We encourage researchers to also consider different implementations such as Catboost in future LTR work.
|
| 398 |
+
|
| 399 |
+
# B.6 LAMBDAMART ENSEMBLE
|
| 400 |
+
|
| 401 |
+
We showed that a simple ensemble of neural rankers can bring meaningful gains, leveraging the stochastic nature of neural network learning. On the other hand, LambdaMART itself is an ensemble algorithm using boosting, but it is still interesting to see the effect of ensembling multiple LambdaMART models. We conduct additional experiments on this front using $\lambda \mathbf { M A R T } _ { G B M }$ and have two major observations: 1) Running LambdaMART multiple times with the same configuration generates very similar results, and ensemble in this setting does not help, whereas neural rankers can benefit from such a simple setting; 2) In Table 11 we show ensembling LambdaMART with different configurations (e.g., different # trees, # leaves and learning rate) on the Istella dataset. We ensemble five LambdaMART models chosen on the validation set. The results on other datasets are similar.
|
| 402 |
+
|
| 403 |
+
Table 11: Results on the Istella datasets using LambdaMART ensembles.
|
| 404 |
+
|
| 405 |
+
<table><tr><td rowspan=2 colspan=1>Method</td><td rowspan=1 colspan=3>Istella NDCG@k</td></tr><tr><td rowspan=1 colspan=1>@1</td><td rowspan=1 colspan=1>@5</td><td rowspan=1 colspan=1>@10</td></tr><tr><td rowspan=1 colspan=1>入MARTGBM</td><td rowspan=1 colspan=1>74.92</td><td rowspan=1 colspan=1>71.24</td><td rowspan=1 colspan=1>76.07</td></tr><tr><td rowspan=1 colspan=1>XMARTGBM-ens</td><td rowspan=1 colspan=1>75.04</td><td rowspan=1 colspan=1>71.40</td><td rowspan=1 colspan=1>76.28</td></tr></table>
|
| 406 |
+
|
| 407 |
+
We can see that the improvement from ensembling LambdaMART is smaller than that in neural rankers (see Table 3). Our hypothesis is that model ensembles tend to be more effective for neural rankers with stronger stochastic nature, and exploring advanced model ensemble methods with neural rankers is an interesting future direction.
|
| 408 |
+
|
| 409 |
+
# C PERMUTATION EQUIVARIANCE ANALYSIS
|
| 410 |
+
|
| 411 |
+
For any general scoring function $s ( \mathbf { x } ) : \mathbb { R } ^ { n \times k } \to \mathbb { R } ^ { n }$ , and a permutation $\pi$ over indices $[ 1 , . . . , n ]$ , we call $s$ to be permutation equivariant iff
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
s ( \pi ( \mathbf { x } ) ) = \pi ( s ( \mathbf { x } ) )
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
The scoring function for proposed approach, DASALC, can be written as a combination of feature transformation and data augmentation function $\mathbf { f }$ , output of multi-headed self-attention ${ \textbf { a } } : =$
|
| 418 |
+
|
| 419 |
+
MHSAL(f) and output of final layer of regular network $h _ { o u t } ( \mathbf { x } )$ .
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
s _ { D A S A L C } ( \mathbf { x } ) = W _ { F C } ^ { T } R e L U ( ( 1 + \mathbf { a } ( \mathbf { x } ) ) \odot h _ { o u t } ( \mathbf { x } ) )
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Note that per-item transformations, which we refer to as univariate transformations, are trivially permutation equivariant. Also, composition of two permutation equivariant functions is also permutation equivariant, as the permutation operator and the permutation equivariant functions are commutative. Hence linear projection, ReLU activation and f (as a function of $\mathbf { x }$ ) are permutation equivariant. Multi-headed self-attention is shown to be permutation equivariant (Pang et al., 2020). Hence, on applying permutation $\pi$ to the proposed scoring function, we see that it satisfies the permutation equivariance property.
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\begin{array} { r l } { \pi \big ( s _ { D A S A L C } ( \mathbf { x } ) \big ) = \pi ( W _ { F C } ^ { T } R e L U ( ( 1 + \mathbf { a } ( \mathbf { x } ) ) \odot h _ { o u t } ( \mathbf { x } ) ) ) } & { } \\ { = W _ { F C } ^ { T } R e L U ( \pi ( ( 1 + \mathbf { a } ( \mathbf { x } ) ) \odot h _ { o u t } ( \mathbf { x } ) ) ) } & { } \\ { = W _ { F C } ^ { T } R e L U ( ( 1 + \pi ( \mathbf { a } ( \mathbf { x } ) ) \odot \pi ( h _ { o u t } ( \mathbf { x } ) ) ) } & { } \\ { = W _ { F C } ^ { T } R e L U ( ( ( 1 + \mathbf { a } ( \pi ( \mathbf { x } ) ) ) \odot h _ { o u t } ( \pi ( \mathbf { x } ) ) ) ) } & { } \\ { = s _ { D A S A L C } ( \pi ( \mathbf { x } ) ) } & { } \end{array}
|
| 429 |
+
$$
|
md/train/e_yvNqkJKAW/e_yvNqkJKAW.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Test-Time Classifier Adjustment Module for Model-Agnostic Domain Generalization
|
| 2 |
+
|
| 3 |
+
Yusuke Iwasawa
|
| 4 |
+
|
| 5 |
+
The University of Tokyo iwasawa@weblab.t.u-tokyo.ac.jp
|
| 6 |
+
|
| 7 |
+
Yutaka Matsuo The University of Tokyo matsuo@weblab.t.u-tokyo.ac.jp
|
| 8 |
+
|
| 9 |
+
# Abstract
|
| 10 |
+
|
| 11 |
+
This paper presents a new algorithm for domain generalization (DG), test-time template adjuster (T3A), aiming to robustify a model to unknown distribution shift. Unlike existing methods that focus on training phase, our method focuses test phase, i.e., correcting its prediction by itself during test time. Specifically, T3A adjusts a trained linear classifier (the last layer of deep neural networks) with the following procedure: (1) compute a pseudo-prototype representation for each class using online unlabeled data augmented by the base classifier trained in the source domains, (2) and then classify each sample based on its distance to the pseudoprototypes. T3A is back-propagation-free and modifies only the linear layer; therefore, the increase in computational cost during inference is negligible and avoids the catastrophic failure might caused by stochastic optimization. Despite its simplicity, T3A can leverage knowledge about the target domain by using off-the-shelf test-time data and improve performance. We tested our method on four domain generalization benchmarks, namely PACS, VLCS, OfficeHome, and TerraIncognita, along with various backbone networks including ResNet18, ResNet50, Big Transfer (BiT), Vision Transformers (ViT), and MLP-Mixer. The results show T3A stably improves performance on unseen domains across choices of backbone networks, and outperforms existing domain generalization methods.
|
| 12 |
+
|
| 13 |
+
# 1 Introduction
|
| 14 |
+
|
| 15 |
+
Deep neural networks often fail to generalize to out-of-distribution samples. Accuracy suffers when the model performs under conditions different to those of training, such as variations in light [8], weather [51], object poses [2], textures [16], or object backgrounds [5]. Nevertheless, the model may be deployed to different conditions in practical situations; thus, some countermeasures are needed.
|
| 16 |
+
|
| 17 |
+
Over the past decade, various studies have focused on training a generalizable model to unseen domains given a dataset consisting of several source domains. This setting is usually denoted as domain generalization $( D G )$ [6, 61]. Domain generalization operates under the assumption that one can improve robustness to domain shift by incorporating the structure common to multiple domains. For example, domain-invariant feature learning constrains the representation to be invariant to domain shifts [14, 45, 29]. Other methods use meta-learning [19] to learn how to regularize the model to improve the robustness [28, 4, 31]. However, despite significant work on this front, machine learning systems are still vulnerable to domain shifts even after using the above methods during training. Notably, recent large-scale benchmarks [17] show that many approaches do not provide significant improvement compared to simple supervised learning, i.e., empirical risk minimization (ERM), with a proper and practical experimental setup. It suggests that the setup in its current state may be too difficult, and a different approach might be needed.
|
| 18 |
+
|
| 19 |
+
This paper proposes a method of using additional off-the-shelf data in the DG setup, the unsupervised data available at the test-time. Since no data about the target domain is available during training in a DG setup, the existing domain generalization algorithms focus on how to use labeled data from multiple-source domains. However, at test-time the model always has access to test data from the target domain. Although the available data is constrained to be (1) unlabeled and (2) only available online (models can not know all test cases in advance), this data provides clue about the target distribution that is not available during training. It is natural to ask the question: How can we use the off-the-shelf unlabeled data available at test-time to increase performance on the target domain?
|
| 20 |
+
|
| 21 |
+
It is worth emphasizing that our setting is different from the transductive setting [49, 22, 57] where all test cases are known in advance, even though we use test data for adjustment. When testing, the model is usually deployed in some environment, and must work well on various samples that will appear continuously. Similarly, the deployed model usually needs to make correct predictions at that moment; there is no point in going back in time and correcting the predictions. Therefore, it is desirable that adjustment and inference be performed at the same time, not offline after a large amount of data has been accumulated. Looking beyond domain generalization, some recent studies suggest optimizing the model during test time using objective function defined only by unsupervised data (e.g, prediction entropy) [34, 52]. However, updating parameters using stochastic gradient descent (SGD) increases computational costs and harm inference throughput. In addition, data available at test time is limited, and stochastic optimization can lead to catastrophic failure.
|
| 22 |
+
|
| 23 |
+
To this end, we present test-time templates adjuster (T3A), which adjusts the linear classifier (the last layer of deep neural networks) at test-time. T3A adjusts the weights of the linear classifier as the following optimization-free procedure: (1) create a pseudo-prototype for each class using online unlabeled data and the classifier trained in the source domains, (2) and then classify each sample based on its distance to the pseudo-prototype. This procedure makes the adjusted decision boundary avoid the high-data density region on the target domain and reduce the ambiguity (entropy) of predictions, which is known to be connected to classification error [52]. Since T3A does not alter the training phase, it can be used together with existing DG algorithms. Moreover, it can be used together with any classification model since it only adjusts the linear classifier on top of the representations. Some readers may wonder how effective it is to modify only the linear classifier while freezing the representation itself. Later in this paper (Section 3.2), we empirically demonstrate that this modification is indeed beneficial.
|
| 24 |
+
|
| 25 |
+
We evaluate our method on multiple standard domain generalization benchmarks, namely VLCS [12], PACS [27], OfficeHome [50], and TerraIncognita [5]. We compare our method with (1) various DG algorithms reported in [17] and (2) Tent [52] that minimizes the prediction entropy at test time using SGD. With the standard ResNet50 backbone [18], T3A improves ERM by 1.5 points on average accuracy over four dataset, and outperforms most existing DG algorithms. Furthermore, we evaluated our method with 10 different backbone networks, including residual networks (resnet18 and resnet50), big transfer (BiT-M-R50x3, BiT-M-R101x3, and BiT-M-R152x2 [24]), vision transformers (ViT-B16, ViT-L16, Hybrid ViT [9], DeiT [48]), and MLP-Mixer (Mixer-L16) [47]. The results show that T3A gives a statistically significant performance gain against ERM on all backbone networks.
|
| 26 |
+
|
| 27 |
+
# 2 Preliminary and Related Work
|
| 28 |
+
|
| 29 |
+
# 2.1 Domain Generalization
|
| 30 |
+
|
| 31 |
+
Problem setup Following [6], we assume multiple datasets $D ^ { d } = \{ ( \boldsymbol { x } _ { i } ^ { d } , \boldsymbol { y } _ { i } ^ { d } ) \} _ { i = 1 } ^ { n _ { d } }$ collected from several different domains $d \in \{ 1 , \cdots , d _ { t r } \}$ . The dataset $D ^ { d }$ from domain $d$ contains identically and independently distributed samples characterized by some probability distribution $P ^ { d } ( X , Y )$ , where $X$ and $Y$ are random variables of input and target, respectively. Then, our goal is to develop a predictor $f ( X )$ that performs well on some unseen test domain, which is characterized by a different probability distribution $P ( X , Y ) \neq P ^ { d } ( X , Y )$ for all $d \in \{ 1 , \cdots , d _ { t r } \}$ . Note that one can not assume the target distribution during training, e.g., no data about the target distribution is available at the time. Therefore, the predictor is usually trained on datasets from several source domains. For example, the predictor can be trained by minimizing the empirical risk:
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\underset { \phi } { \arg \operatorname* { m i n } } \frac { 1 } { d } \sum _ { d = 1 } ^ { d _ { t r } } \frac { 1 } { n _ { d } } \sum _ { i = 1 } ^ { n _ { d } } \ell ( f ( \pmb { x } _ { i } ^ { d } ) , y _ { i } ^ { d } ) ,
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where $\phi$ is the set of the parameters of the function, and $\ell$ is a loss function measuring prediction error. In the rest of this paper, optimizing the predictor with eq. 1 is called ERM. In a real application, the model will be deployed after training and expected to classify the data in an online manner. For benchmarking the algorithm, given a dataset containing $n _ { d }$ domains, we usually use the leaveone-domain-out procedure, which uses a single domain as a test domain and the others as training domains. The procedure is repeated $n _ { d }$ times, changing the test domain every time.
|
| 38 |
+
|
| 39 |
+
Algorithms A central branch of DG algorithm is domain-invariant feature learning, which explicitly reduces the domain gaps on a space of latent representations. For example, [14] proposed domainadversarial networks (DANN) which measure the domain gaps via an external domain classifier. CORAL [45] align the second-order statistics of representations among different domains. [29] uses maximum mean discrepancy (MMD) to measure the domain gap. Many extension have been proposed [33, 1, 21], but they are all the same in that they enhance domain invariance. Another branch are meta-learning-based methods [28, 4, 31], which divide the available domains into meta-train-domains and meta-test-domain and regulate the model trained in meta-train-domains to be useful for the meta-test-domain. Invariant risks minimization [3] regularizes ERM with a gradient normalization penalty over a dummy classifier. Several studies propose to augment the data using mixup [59] between two source domains, which implicitly enhances invariance to domain shifts [56, 58, 53].
|
| 40 |
+
|
| 41 |
+
Key differences As briefly mentioned above, existing domain generalization algorithms focus on the training phase; how to regularize the predictor using the knowledge from multiple source domains. Our work focuses on the test phase; how to adjust the model using online and unlabeled data, which can characterize the target distribution. Note that proposed method works fully online; It does not require access to offline unlabeled data, and therefore can be compared fairly with existing DG methods
|
| 42 |
+
|
| 43 |
+
# 2.2 Other Related Work
|
| 44 |
+
|
| 45 |
+
Unsupervised domain adaptation. Our work is related to unsupervised domain adaptation (UDA) [37, 38, 55] as both methods aim to adapt a model given unsupervised data. However, our work primarily differs from UDA in that UDA focuses on adapting during training, while we focus on adapting during testing. In other words, UDA assumes we can access labeled data from the source domain and (unlabeled) data from the target domain at the same time, which is not always possible.
|
| 46 |
+
|
| 47 |
+
Source-free domain adaptation. Among them, recent “source-free” setups are particularly similar to our setting [30, 25, 34]. In these setups, source data is not needed during the adaptation phase, and the model is adapted using the unlabeled data solely from the target domain. However, this adaptation is usually made in an offline manner, i.e., these source-free methods optimize offline with multiple losses for multiple epochs. Our method adjusts the classifier in an online-manner, and therefore is suitable for a domain generalization setup where the trained model is assumed to be deployed.
|
| 48 |
+
|
| 49 |
+
Test-time adaptation. Regarding the problem setup, our work is most closely related to testtime adaptation [52] or test-time training [46]. Notably, [52] proposes fully test-time adaptation, which modulates the BN parameter by minimizing the prediction entropy using stochastic gradient descent. The concept of test-time adaptation is very similar to our work and can be used in domain generalization, however, it has not been fully investigated under the domain generalization setup. Moreover, recent architectures do not employ batch normalization either on pre-training (mainly to avoid the large memory usage required by BN) or fine-tuning phase (for improving performance). Besides, minimizing the prediction entropy using SGD could lead to trivial solutions, such as being biased to predict only a particular class. In comparison, (1) our method can be used together with any classification models since it only adjusts the linear classifier on the top of the representations, (2) our method alleviates catastrophic forgetting due to not using SGD during test-time.
|
| 50 |
+
|
| 51 |
+
Prototypical networks. Before deep learning become popular, the prototype-based classifier is well-investigated in the context of semi-supervised learning [10], continual learning [35, 39], and few-shot learning [44]. Our work is most similar to prototypical networks [44], which combine prototypical classifier and deep neural networks as with our method. However, the use-cases mentioned above of prototypical networks assume access to a few labeled data from the same domain, which differs in our case. To handle the difference, we combine prototypical networks with pseudolabeling techniques, which are often used in domain transfer literature [42]. Besides, connection to entropy minimization is a new perspective introduced in this paper.
|
| 52 |
+
|
| 53 |
+
Algorithm 1 Algorithm of T3A for prediction.
|
| 54 |
+
|
| 55 |
+
Input: Feature extractor $f _ { \theta }$ , the batch of input $\mathbb { B }$ , and support sets $\mathbb { S } ^ { k }$ available at this point.
|
| 56 |
+
Output: Prediction for all $\pmb { x } \in \mathbb { B }$ , where $\mathbf { \boldsymbol { x } } \sim P ( \mathbf { \boldsymbol { X } } )$ . # Step1. Adjust the template for each class using the $\mathbb { B }$ . for $\pmb { x } \in \mathbb { B }$ do $\hat { y } = \arg \operatorname* { m a x } q _ { \omega } ( Y = y _ { k } | f _ { \pmb { \theta } } ( \pmb { x } ) ) ~ ( \mathbf { e }$ q. 2) $\begin{array} { r } { \mathbb { S } ^ { k } = \mathbb { S } ^ { k } \cup \{ \frac { f _ { \theta } ( \pmb { x } ) } { \lVert \pmb { f _ { \theta } ( \pmb { x } ) } \rVert } \} } \end{array}$ for $\boldsymbol { y } ^ { k } = \boldsymbol { \hat { y } }$ (eq. 3) end for Filter support sets with eq. 6 # Step2. Predict based on the distance between the adjusted template. return arg max $\gamma ( Y = y _ { k } | f _ { \pmb \theta } ( \pmb x ) )$ for all $\pmb { x } \in \mathbb { B }$ (eq. 4)
|
| 57 |
+
|
| 58 |
+
# 3 Proposal: Optimization-Free Test-Time Classifier Adjustment Module
|
| 59 |
+
|
| 60 |
+
We propose to replace the output layer of the predictor trained on source-domains (i.e., linear classifier) to a pseudo-prototypical classifier, whose prototype features are adjusted during test time while fixing the features already trained on the source domains. We call our method T3A, for Test-Time Templates Adjuster. We first explain the detailed algorithm (Section 3.1), and explain how and why it works (Section 3.2). Algorithm 1 outlines the procedure.
|
| 61 |
+
|
| 62 |
+
# 3.1 Algorithm
|
| 63 |
+
|
| 64 |
+
We assume the predictor is deep neural networks (DNN) obtained by some learning algorithm (e.g., ERM, DANN, CORAL, etc.) using data from source domains. For convenience, the entire DNN is divided into a linear classifier $q _ { \omega }$ for the last layer and a feature extractor $f _ { \theta }$ for the rest, where $\omega$ and $\pmb \theta$ are the parameters of neural networks. In usual domain generalization setup, $f _ { \theta }$ and $q _ { \omega }$ are used to predict data from the test domain. For new data $_ { \textbf { \em x } }$ , the prediction is given by taking the argmax over the following approximated probability distribution:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\operatorname * { a r g m a x } _ { y _ { k } } q _ { \omega } ( Y = y _ { k } | f _ { \pmb \theta } ( \pmb x ) ) = \frac { \exp ( \pmb z \cdot \pmb \omega ^ { k } ) } { \sum _ { j } \exp ( \pmb z \cdot \pmb \omega ^ { j } ) } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $z = f _ { \theta } ( \pmb { x } ) , \pmb { \omega } ^ { k } \in \mathbb { R } ^ { z _ { d i m } }$ is the $k$ -th element of the weights matrix in $\omega$ , and $z _ { d i m }$ is the dimension of $_ z$ , which depends on the feature extractor $f _ { \theta }$ . In this prediction, $\omega ^ { k }$ works as the template of representation for the class $k$ , and prediction is done by measuring the distance (dot product) between the template and the representation of the input data. Since this template was trained in the source domain, there is no guarantee that it will be a good template in the target domain.
|
| 71 |
+
|
| 72 |
+
T3A adjusts the templates during test-time. Assume we have (batch of) test-data $_ { \textbf { \em x } }$ at time $t$ drawn from target distribution $P ( \boldsymbol { X } ) \doteq P ^ { d } ( \boldsymbol { X } )$ for all $d \in \{ 1 , \cdots , d _ { t r } \}$ . As each prototype should be related to some class, we first augment the input data $_ { \textbf { \em x } }$ via pseudo label $\hat { y }$ , which is obtained via eq. 2. Then, we update a support set $\mathrm { \bar { S } } _ { t } ^ { k }$ as follows:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbb { S } _ { t } ^ { k } = \left\{ \begin{array} { l l } { \mathbb { S } _ { t - 1 } ^ { k } \cup \big \{ \frac { f _ { \theta } ( x ) } { \| f _ { \theta } ( x ) \| } \big \} } & { \mathrm { i f } \hat { y } = y ^ { k } } \\ { \mathbb { S } _ { t - 1 } ^ { k } } & { \mathrm { e l s e } , } \end{array} \right.
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where kak represents the L2 norm of the vector a and Sk0 = { ωkkωkk }. If the input data contains sample in the batch. Then, prediction is done by taking the argmax over the following adjusted probability distribution:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\underset { y _ { k } } { \arg \operatorname* { m a x } } \gamma _ { c } ( Y = y _ { k } | f _ { \pmb \theta } ( \pmb x ) ) = \frac { \exp ( z \cdot \pmb c ^ { k } ) } { \sum _ { j } \exp ( z \cdot \pmb c ^ { j } ) } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $c ^ { k }$ are the centroids of $\mathbb { S } ^ { k }$ :
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
c ^ { k } = \frac { 1 } { | \mathbb { S } ^ { k } | } \sum _ { z \in \mathbb { S } _ { t } ^ { k } } z .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 1: Pre-experimental results. (a) Comparing the entropy of predictions (with ResNet50) on the source domains and the target domain. The domain shift increases entropy. (b) T3A effectively reduces entropy. (c) Transferability of each components of the model trained by ERM in each dataset.
|
| 92 |
+
|
| 93 |
+
Note that, this procedure will be repeated each time new data arrives, without discarding the support sets, which may make infeasible to retain all past data as in eq. 3. Also, some pseudo-labels are assigned to the wrong class, and using this data is not desirable as it adds noise to the templates and may deteriorate performance. To avoid this issue, we use the prediction entropy $H _ { \omega } ( \hat { Y } | z ) =$ $\begin{array} { r } { - \sum _ { k } q _ { \omega } ( \hat { Y } = y ^ { k } | z ) \log q _ { \omega } ( \hat { Y } = y ^ { k } | z ) } \end{array}$ to filter unreliable pseudo-labeled data. Specifically, before making a prediction using eq. 4, only a part of the support set is restored as follows:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathbb { S } _ { t } ^ { k } = \{ z \mid z \in \mathbb { S } _ { t } ^ { k } , H _ { \omega } ( \hat { Y } | z ) \leq \alpha ^ { k } \} ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\alpha ^ { k }$ is the $M$ -th largest entropy of the support set $\mathbb { S } _ { t } ^ { k }$ $M$ is a hyperparameter).
|
| 100 |
+
|
| 101 |
+
# 3.2 Remarks
|
| 102 |
+
|
| 103 |
+
Remark 1: T3A implicitly reduces prediction entropy. As prior works suggest [52], the prediction entropy is often related to an error, as more confident predictions tend to be more correct. Figure 1-a shows that the prediction entropy also characterizes the difficulty in DG setup; entropy in the unseen domain tends to be greater than entropy in the seen domains. To be more specific, we first trained ResNet50 on the source domain by ERM. The training was done in leave-one-domain-out manner, and we conducted three experiments with a different seed each time. We used four standard datasets in domain generalization (VLCS [12], PACS [27], OfficeHome [50], and TerraIncognita [5]). We used the implementation of DomainBed [17], and used the default hyper-parameters for pre-training on source-domains and fine-tuning on a target domain: namely, we use Adam [23] with a learning rate of 5e-5 for optimization and use a batch size of 32 with no dropout or weight decay.
|
| 104 |
+
|
| 105 |
+
With this in mind, existing studies have modified the model parameters to explicitly reduce entropy. Although the proposed method does not explicitly reduce entropy, it has the effect of implicitly reducing it. This is because the proposed method uses a template updated with samples from the target distribution, which provides a decision boundary that avoids the dense parts of the target distribution. Figure 1-b compares the prediction entropy on the target domain among (a) ERM without test-time modulation, (b) T3A, (c) Tent-C, which updates the classifier to minimize entropy. The results show that T3A can effectively reduce entropy without using online optimization. Note that changing a hyper-parameter (such as learning rate) might change the results for Tent-C, but it may corrupt the entire classifier. See Section 4 for the hyperparameter selection.
|
| 106 |
+
|
| 107 |
+
Remark 2: T3A is computationally light. Unlike Tent, our method does not use SGD. Besides, the representations are fixed, and it is not necessary to repeat the forward propagation of the feature extractor. The only computational overhead is the cost of one forward propagation of the last linear layer, which is usually negligible compared to the forward and back propagation of feature extractors. Since it is not desirable to reduce throughput when considering online prediction, the proposed method is suitable in this respect as well.
|
| 108 |
+
|
| 109 |
+
Remark 3: Adjusting the linear classifier can significantly improve performance. Some readers may wonder how effective it is to modify only the linear classifier while freezing the representation. To answer this question, we compare the DG performance (None) before fine-tuning, (head) after fine-tuning only $q _ { \omega }$ , (body) after fine-tuning only $f _ { \theta }$ , and (all) after fine-tuning the entire network (Figure 1-c). Each block corresponds to a different dataset, and each color represents a different fine-tuning strategy. The results show that fine-tuning only the classifier often significantly improves performance. For example, in VLCS, the average performance score jumps from 72.5 to 82.9, which is close to the 84.7 obtained when the entire network is fine-tuned. The performance gain differs for each dataset, but the tendency is generally the same. In addition, this tendency was the same for other backbone networks including BiT, ViT, and Mixer (see Appendix B). These results indicate that adjusting only the linear classifier can significantly improve performance in various configurations. Note that the number of parameters of the linear layer is much smaller than those of the feature extractor in standard network architectures.
|
| 110 |
+
|
| 111 |
+
# 4 Experiment
|
| 112 |
+
|
| 113 |
+
We evaluate T3A on four standard domain generalization benchmarks, namely VLCS [12], PACS [27], OfficeHome [50], and TerraIncognita [5]. Our implementation uses the DomainBed library $[ 1 7 ] ^ { 1 }$ . We modify DomainBed (1) to use various backbone networks using the timm library $[ 5 4 ] ^ { \bar { 2 } }$ , and (2) to implement test-time adaptation algorithms (ours and Tent). For Tent, we used the original implementation3. We run our experiments mainly on cloud $\mathrm { V } 1 0 0 \mathrm { x } 4$ or $\mathbf { A } 1 0 0 \mathbf { x } 8$ instances, depending on the memory usage of the backbone networks. See Appendix A for more information, including licensing information and total amount of compute.
|
| 114 |
+
|
| 115 |
+
Datasets. VLCS [12] comprises four photographic datasets $d \in$ {Caltech101[13], LabelMe[40], SUN09[7], VOC2007[11]}, containing 10, 729 examples of 5 classes. PCAS [27] comprises four domains $d \in \{ \mathrm { a r t } $ , cartoons, photos, sketche $\}$ , containing 9, 991 examples of 7 classes. OfficeHome [50] includes domains $d \in \{$ {art, clipart, product, real}, containing 15, 588 examples and 65 classes. TerraIncognita [5] includes photo of wild animals taken by camera at different locations. Following [17], we used datasets of $d \in \{ \mathrm { L 1 0 0 , L 3 8 , L 4 3 , L 4 6 } \}$ , containing 24, 788 examples and 10 classes.
|
| 116 |
+
|
| 117 |
+
Backbone networks. For the main experiments, we use residual networks with 50 layers (ResNet50), which was the default setting of the prior studies. In addition, we tested our algorithms on 10 different pre-trained models: residual networks with different layers (ResNet18 and ResNet50), Big Transfer [24] with different layers (BiT-M-R50x3, BiT-M-R101x3, and BiT-M$\mathbf { R } 1 5 2 \mathbf { x } 2$ ), Vision Transformers [9] with variations (ViT-B16, ViT-L16, HViT, which uses ResNet50 as patch embedding of ViT, DeiT [48]), and MLP-Mixer (Mixer-L16) [47].
|
| 118 |
+
|
| 119 |
+
Baselines. We compare our method to domain generalization algorithms and test-time adaptation algorithms. For domain generalization algorithms, we mainly compared with the results reported in [17]. These results include the following algorithms: Empirical Risk Minimization (ERM), Group Distributionally Robust Optimization (GroupDRO) [41], Inter-domain Mixup (Mixup) [56, 58, 53], Meta-Learning for Domain Generalization (MLDG) [28], DomainAdversarial Neural Networks (DANN) [15], Class-conditional DANN (C-DANN) [32], Deep CORrelation ALignment (CORAL) [45], Maximum Mean Discrepancy (MMD) [29], Invariant Risk Minimization (IRM) [3], Adaptive Risk Minimization (ARM) [60], Marginal Transfer Learning (MTL) [6] Style-Agnostic Networks (SagNet) [36], and Representation Self Challenging (RSC) [20].
|
| 120 |
+
|
| 121 |
+
We also compared our method with existing test-time adaptation methods. Note that we can not simply use BN-based methods (including Tent [52], which is the most up-to-date method) on the DG setup because [17] omit the BN layer from pre-trained ResNet when fine-tuning on source domains. Besides, several backbone networks evaluated in our paper do not contain BN from the beginning. Therefore, we first tested two slightly modified versions of Tent on standard DG setup (Table 1, Table 2, and Figure 2). Specifically, Tent-C modulates the entire classifier to reduce prediction entropy. Tent-BN adds one BN layer just before the linear classifier and then modulates BN’s normalization and transformation parameters. We then compare T3A with other test-time adaptation methods (including SHOT [34], pseudo labeling (PL) [26], Tent-Full [52], BN-Norm [43]) using ResNet18 and ResNet50 without removing batch normalization layer (Table 3).
|
| 122 |
+
|
| 123 |
+
Table 1: Domain generalization accuracy for all datasets and algorithms. Bold type indicates performance improvement from the base model, and $^ *$ indicates statistical significance in one-sided paired t-test $^ { \ast \ast }$ indicates $p \leq 0 . 0 1$ , \* indicates $p \leq 0 . 0 5 )$ .
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Algorithm</td><td>VLCS</td><td>PACS</td><td>OfficeHome</td><td>Terra</td><td>Avg</td></tr><tr><td>ERM</td><td>77.5 ± 0.4</td><td>85.5 ± 0.2</td><td>66.5 ± 0.3</td><td>46.1 ± 1.8</td><td>69.0</td></tr><tr><td>IRM</td><td>78.5 ± 0.5</td><td>83.5 ± 0.8</td><td>64.3 ± 2.2</td><td>47.6 ± 0.8</td><td>68.5</td></tr><tr><td>GroupDRO</td><td>76.7 ± 0.6</td><td>84.4 ± 0.8</td><td>66.0 ± 0.7</td><td>43.2 ± 1.1</td><td>67.6</td></tr><tr><td>Mixup</td><td>77.4 ± 0.6</td><td>84.6 ± 0.6</td><td>68.1 ± 0.3</td><td>47.9 ± 0.8</td><td>69.5</td></tr><tr><td>MLDG</td><td>77.2 ± 0.4</td><td>84.9 ± 1.0</td><td>66.8 ± 0.6</td><td>47.7 ± 0.9</td><td>69.2</td></tr><tr><td>CORAL</td><td>78.8 ± 0.6</td><td>86.2 ± 0.3</td><td>68.7 ± 0.3</td><td>47.6 ± 1.0</td><td>70.3</td></tr><tr><td>MMD</td><td>77.5 ± 0.9</td><td>84.6 ± 0.5</td><td>66.3 ± 0.1</td><td>42.2 ± 1.6</td><td>67.7</td></tr><tr><td>DANN</td><td>78.6 ± 0.4</td><td>83.6 ± 0.4</td><td>65.9 ± 0.6</td><td>46.7 ± 0.5</td><td>68.7</td></tr><tr><td>CDANN</td><td>77.5 ± 0.1</td><td>82.6 ± 0.9</td><td>65.8 ± 1.3</td><td>45.8 ± 1.6</td><td>67.9</td></tr><tr><td>MTL</td><td>77.2 ± 0.4</td><td>84.6 ± 0.5</td><td>66.4 ± 0.5</td><td>45.6 ± 1.2</td><td>68.5</td></tr><tr><td>SagNet</td><td>77.8 ± 0.5</td><td>86.3 ± 0.2</td><td>68.1 ± 0.1</td><td>48.6 ±1.0</td><td>70.2</td></tr><tr><td>ARM</td><td>77.6 ± 0.3</td><td>85.1 ± 0.4</td><td>64.8 ± 0.3</td><td>45.5 ± 0.3</td><td>68.3</td></tr><tr><td>VREx</td><td>78.3 ± 0.2</td><td>84.9 ± 0.6</td><td>66.4 ± 0.6</td><td>46.4 ± 0.6</td><td>69.0</td></tr><tr><td>RSC</td><td>77.1 ± 0.5</td><td>85.2 ± 0.9</td><td>65.5 ± 0.9</td><td>46.6 ± 1.0</td><td>68.6</td></tr><tr><td>ERM†</td><td>77.7 ± 0.1</td><td>83.6 ± 0.9</td><td>66.4 ± 0.3</td><td>46.5 ± 0.3</td><td>68.6</td></tr><tr><td>+T3A (Ours)</td><td>80.0 ± 0.2</td><td>85.3 ± 0.6</td><td>68.3 ± 0.1</td><td>47.0 ± 0.6</td><td>70.1**</td></tr><tr><td>+Tent-BN</td><td>68.2 ± 0.2</td><td>84.8 ± 0.5</td><td>67.0 ± 0.4</td><td>44.7 ± 0.3</td><td>66.2</td></tr><tr><td>+Tent-C</td><td>77.0 ± 0.4</td><td>82.3 ± 1.2</td><td>65.7 ± 0.2</td><td>45.5 ± 0.4</td><td>67.6</td></tr><tr><td>CORAL+</td><td>78.6 ± 0.5</td><td>84.2 ± 0.3</td><td>68.3 ± 0.1</td><td></td><td>69.8</td></tr><tr><td>+T3A (Ours)</td><td>79.5 ± 0.5</td><td>85.6 ± 0.2</td><td>69.2 ± 0.2</td><td>48.1 ± 1.3 47.3 ± 0.7</td><td>70.4*</td></tr><tr><td>+Tent-BN</td><td>71.4 ± 0.7</td><td>85.6 ± 0.2</td><td>69.2 ± 0.2</td><td>46.5 ± 0.5</td><td>68.2</td></tr><tr><td>+Tent-C</td><td>78.1 ± 0.5</td><td>83.7 ± 0.4</td><td>68.2 ± 0.1</td><td>47.8 ± 1.1</td><td>69.5</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 126 |
+
|
| 127 |
+
Hyperparameters and model selection. As [17] claimed, model selection is not trivial in DG and significantly affects performance. We used standard training-domain validation for selecting hyperparameters, which uses the subset of each training domain to choose a model. As reported in [17], we split the data from each domain into $8 0 \%$ and $2 0 \%$ splits and use larger splits for training and smaller splits to select hyperparameters. Following [17], we conduct a random search of 20 trials over a joint distribution of all hyperparameters to train the base model (see Appendix A.4).
|
| 128 |
+
|
| 129 |
+
In addition, T3A has one hyperparameter $M$ for deciding the number of supports to restore, and Tent has two primary hyperparameters: $\beta$ for multiplying the base learning rate (used for the base model) and $\gamma$ for the number of iterations per adaptation. It is worth emphasizing that these parameters should be selected before the deployment, i.e., before accessing the test data. We simply selected these hyperparameters by the average accuracy in the training-domain validation data when using these adjustment modules. Specifically, we tested $M \in \{ 1 , 5 , \bar { 2 0 } , 5 0 , 1 0 0 , \mathrm { N / A } \}$ for T3A, where N/A means restoring all samples, and combination of $\beta \in \{ 0 . 1 , 1 . 0 , 1 0 . 0 \}$ and $\gamma \in \{ 1 , 3 \}$ for Tent.
|
| 130 |
+
|
| 131 |
+
# 4.1 Results
|
| 132 |
+
|
| 133 |
+
Table 1 summarizes the results when ResNet50 is used as the backbone network. The first block (from ERM to RSC) is the value taken from [17]. The lines labeled ERM† and CORAL† are the scores reproduced in our environments. The proposed method and Tent are based on this reproduced model. Figure 2 shows the distribution of performance improvement by the proposed method for models trained with different hyperparameters $2 0 \times 3$ for each test environment). In addition, Table 2 show the DG accuracy with 10 different backbones. Note that this experiment is conducted only on the default hyperparameter of ERM. Every number we report is a mean and standard error over three repetitions with different weight initialization, and dataset splits.
|
| 134 |
+
|
| 135 |
+
T3A stably improves the performance of the base model. The second block of Table 1 shows that T3A stably improves the performance of the ERM model. Specifically, the proposed method improves 2.3 points, 2.0 points, 1.9 points, and 0.5 points for each dataset respectively. The average improvement from ERM is 1.5 points. For clarification, paired t-test was performed using 48 paired data (4 datasets, 4 test domains, 3 different seeds). As a results, the difference is statistically significant $( p \leq 0 . 0 1 )$ . Note that, Tent-BN improves the performance in PACS and OfficeHome, but it is not stable may be due to the failure of the optimization. Tent-C never improve the performance.
|
| 136 |
+
|
| 137 |
+
Table 2: Domain generalization accuracy with different backbone networks. T3A increases the performance agnostic to backbone networks. Note that, this experiments is conducted only on the default hyperparameters of ERM. Bold type indicates performance improvement, and \* indicates statistical significance in paired t-test ( $^ { \ast \ast }$ indicates $p \leq 0 . 0 1$ , \* indicates $p \leq 0 . 0 5 )$ .
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Models</td><td>VLCS</td><td>PACS</td><td>OfficeHome</td><td>Terra</td><td>Avg</td></tr><tr><td>resnet18 +T3A</td><td>73.2 ± 0.9 76.5 ± 0.9</td><td>80.3 ± 0.4 81.7 ± 0.1</td><td>55.7±0.2 57.0 ± 0.4</td><td>40.7 ± 0.3 41.6 ± 0.5</td><td>62.5 64.2*</td></tr><tr><td>resnet50 +T3A</td><td>75.5± 0.1 78.3 ± 0.7</td><td>83.9 ± 0.2 84.5 ± 0.3</td><td>64.4 ± 0.2 66.5 ± 0.2</td><td>45.4 ± 1.2 45.9 ± 0.5</td><td>67.3 68.8*</td></tr><tr><td>BiT-M-R50x3 +T3A</td><td>76.7± 0.1 79.7 ± 0.3</td><td>84.4 ± 1.2 85.4 ± 0.9</td><td>69.2 ± 0.6 71.7 ± 0.6</td><td>52.5± 0.3 52.2 ± 0.6</td><td>70.7 72.3*</td></tr><tr><td>BiT-M-R101x3 +T3A</td><td>75.0 ± 0.6 78.6 ± 0.4</td><td>84.0 ± 0.7 85.4 ± 0.5</td><td>67.7± 0.5 69.9 ± 0.4</td><td>47.8 ± 0.8 48.1 ± 0.8</td><td>68.6 70.5*</td></tr><tr><td>BiT-M-R152x2 +T3A</td><td>76.7 ± 0.3 79.1 ± 0.4</td><td>85.2 ± 0.1 86.4 ± 0.1</td><td>71.3 ± 0.6 73.2 ± 0.5</td><td>51.4 ± 0.6 50.9 ± 0.7</td><td>71.1 72.4*</td></tr><tr><td>ViT-B16 +T3A</td><td>79.2 ± 0.3 80.2 ± 0.4</td><td>85.7 ± 0.1 86.0 ± 0.1</td><td>78.4± 0.3 78.9 ± 0.3</td><td>41.8 ± 0.6 42.5 ± 0.7</td><td>71.3 71.9*</td></tr><tr><td>ViT-L16 +T3A DeiT</td><td>78.2± 0.5 79.0 ± 0.6</td><td>84.6± 0.5 85.5 ± 0.6</td><td>78.0 ± 0.1 78.7 ± 0.2</td><td>42.7 ± 1.9 45.3 ± 0.4</td><td>70.9 72.1**</td></tr></table>
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
Figure 2: Distribution of performance improvements by the proposed method for models trained with different hyperparameters $2 0 \times 3$ for each test environment). Dashed line in each violin plot represents the quartile of the distribution.
|
| 143 |
+
|
| 144 |
+
In addition, Fig. 2 show that the third-quarter quantile of the improvement range is often more than 0, which means the proposed method is also robust to the hyperparameters of the base model. Furthermore, Table 2 shows that the proposed method can also improve the performance of more sophisticated backbone networks. For example, the proposed method improves performance by an average of 1.0 points for HViT, which achieved the best performance of all backbones. The improvement by the proposed method is statistically significant $( p \leq 0 . 0 5$ for ViT-L16, $p \leq 0 . 0 1$ for other backbones) with the one-side paired t-test.
|
| 145 |
+
|
| 146 |
+
T3A outperforms most existing DG algorithms. For example, in VLCS, the proposed method achieves $8 0 . 0 \%$ , which is significantly better than the prior best-reported score, $7 8 . 8 \%$ . Similarly, it is $8 5 . 3 \%$ for PACS, $6 8 . 3 \%$ (best) for OfficeHome and $4 7 . 0 \%$ for TerraIncognita, and $7 0 . 1 \%$ in average (third best). Note that the scores we reproduce are much worse than the reported scores in PACS, which reduces the average performance. In PACS, the improvement from ERM by the proposed method is 1.7 points, which is the most significant improvement from any reported value.
|
| 147 |
+
|
| 148 |
+
For a more accurate comparison, we also examined whether the proposed method would improve the performance of CORAL, which had achieved the best performance in existing reports. As shown in the third block of Table 1, the proposed method can also improve the performance of CORAL. The average improvement is 0.6 points. Average performance is $7 0 . 4 \%$ , which is the best among all algorithms. Note that, similar to ERM, the reproduced score and the reported score are slightly different (and the score in PACS is particularly low).
|
| 149 |
+
|
| 150 |
+
T3A outperforms existing test-time adaptation methods. We further compare T3A with other test-time adaptation methods when backbone networks employ the BN layer so that we can make a fair comparison with the prior BN-based methods [43, 52]. We used ResNet18 w/BN and ResNet50 w/BN as backbone networks. Note that the results of ResNet in Table 1 and Table 2 do not use the BN layer since it is the default option in [17]. Therefore, the results below are not directly comparable to the DG method shown in Table 1 and Table 2 of the current manuscript.
|
| 151 |
+
|
| 152 |
+
We tested the following six baselines in addition to T3A, Tent-BN, and Tent-C. (1) Tent-Full updates BN statistics and transformations, which is the same as the original proposal [52]. (2) BN-Norm update BN statistics but fixes transformations parameters [43]. (3) PL (Pseudo Label) [26] updates entire networks by minimizing the cross-entropy between prediction and the pseudo label. Following [52], we assign the pseudo label if the predictions are over a threshold (0.9 in our experiment). (4) PL-C updates the linear classifier by minimizing the above-mentioned pseudo-label loss. (5) SHOT [34] updates feature extractor to minimize entropy, diversity regularizer, and pseudo-label loss. While [34] originally proposed SHOT in the context of source-free domain adaptation (offline adaptation setup), the method itself can be transferred to our setup. Note that the original SHOT uses the label-smoothing when training on the source domain. However, we focus on the adaptation method, and therefore the source model is the same as the other baselines for the fair comparison. (6) SHOT-IM [34] updates the feature extractor to minimize entropy and the diversity regularizer.
|
| 153 |
+
|
| 154 |
+
In summary, (1) all baseline except BN-Norm and T3A use stochastic optimization during test-time, which is not desirable since it may cause catastrophic failure and must increase computational costs. (2) Tent-Full and BN-Norm are powerful yet constrained to be applicable only if the architecture uses BN.
|
| 155 |
+
|
| 156 |
+
Table 3 compares results under the training-domain model selection as with Table 1 and Table 2. For clarification, we also compare performance under the oracle model selection (28 in Appendix C ), where one can use the validation set on the target domain ( $20 \%$ of all data as described above). We can make the following observations. (1) The proposed method still outperformed all baselines in both backbone networks. Among baselines, only Tent-Full and PL-C perform better than None (w/o adaptation) on average. (2) When we select the hyper-parameters with a test-domain validation set, Tent-Full gives comparable performances with the proposed method. In addition, compared to T3A and PL-C, the T3A performs better under both model selection strategies. These results clarify the difficulty of model selection in optimization-based methods and the merit of the proposed optimization-free approach in this setup. (3) Updating feature extractor (or the large portion of the parameters) does not work well in general, while it is common in SFDA (offline) setup. The results suggest that we need different treatments on online and offline setup.
|
| 157 |
+
|
| 158 |
+
# 5 Discussion and Conclusion
|
| 159 |
+
|
| 160 |
+
This paper presents a new domain generalization algorithm, T3A, which adjusts its predictions during test-time by itself. We show that T3A reduces prediction entropy (Fig. 1-c), and more importantly, generalization error on unseen domain (Table 1). T3A can adapt different domain generalization algorithms for training-phase (the third block of Table 1), and different backbone networks (Table 2). Note that this property is important in practice because a better backbone network usually give significant performance gains. For example, Table 2 suggest a practitioner should try HViT, which outperforms ResNet50 by a large margin (7.8 points in average) if computational resources allow. T3A can boost HViT’s performance by 1.0 points. Unlike existing studies that update the model with SGD during testing, the proposed method is optimization-free. Therefore, the computational overhead is negligible, and the behavior is unlikely to become unstable, making T3A especially suitable for online settings where the model needs to (adapt and) predict online as with typical DG.
|
| 161 |
+
|
| 162 |
+
Table 3: Comparison of our method and existing test-time adaptation methods. Unlike Table 1 and Table 2, we used ResNet18 and ResNet50 without removing batch normalization layer as backbone networks. As with Table 2, this experiments is conducted only on the default hyperparameters of ERM. Bold type indicates performance improvement, and \* indicates statistical significance in paired t-test $^ *$ indicates $p \leq 0 . 0 5 )$ .
|
| 163 |
+
|
| 164 |
+
<table><tr><td>Models</td><td>VLCS</td><td>PACS</td><td>OfficeHome</td><td>Terra</td><td>Avg</td></tr><tr><td>resnet18 w/BN</td><td>73.0± 0.6</td><td>79.5 ± 0.4</td><td>61.8 ± 0.3</td><td>41.7 ± 0.9</td><td>64.0</td></tr><tr><td>SHOT-IM</td><td>61.6 ± 0.3</td><td>82.1 ± 0.3</td><td>62.5 ± 0.3</td><td>32.8 ± 0.4</td><td>59.8</td></tr><tr><td>SHOT</td><td>61.8 ± 0.3</td><td>82.3 ± 0.2</td><td>62.8 ± 0.2</td><td>32.7 ± 0.4</td><td>59.9</td></tr><tr><td>PL</td><td>67.0 ± 0.6</td><td>72.9 ± 1.0</td><td>56.3 ± 2.5</td><td>35.4 ± 1.7</td><td>57.9</td></tr><tr><td>PL-C</td><td>71.8 ± 1.3</td><td>78.9 ± 0.4</td><td>61.7 ± 0.3</td><td>43.1 ± 0.9</td><td>63.9</td></tr><tr><td>Tent-Full</td><td>72.3 ± 0.3</td><td>83.9 ± 0.3</td><td>62.7 ± 0.2</td><td>36.9 ± 0.3</td><td>64.0</td></tr><tr><td>BN-Norm</td><td>70.4 ± 1.0</td><td>82.7 ± 0.1</td><td>62.0 ± 0.1</td><td>36.4 ± 0.2</td><td>62.9</td></tr><tr><td>Tent-C</td><td>71.3 ± 1.5</td><td>74.6 ± 1.9</td><td>60.5 ± 0.4</td><td>40.9 ± 0.5</td><td>61.8</td></tr><tr><td>Tent-BN</td><td>64.7 ± 0.7</td><td>81.1 ± 0.2</td><td>62.5 ± 0.3</td><td>36.4 ± 0.9</td><td>61.2</td></tr><tr><td>T3A (Ours)</td><td>74.5 ± 0.9</td><td>81.4 ± 0.2</td><td>63.2 ± 0.4</td><td>39.5 ± 0.3</td><td>64.6*</td></tr><tr><td>resnet50 w/BN</td><td>74.3 ± 0.5</td><td>84.1 ± 0.1</td><td>66.9 ± 0.2</td><td>45.8 ± 1.8</td><td>67.8</td></tr><tr><td>SHOT-IM</td><td>61.5 ± 1.7</td><td>84.6 ± 0.3</td><td>68.0 ± 0.0</td><td>33.8 ± 0.3</td><td>62.0</td></tr><tr><td>SHOT</td><td>61.6 ± 1.8</td><td>84.8 ± 0.5</td><td>68.0 ± 0.0</td><td>34.6 ± 0.3</td><td>62.3</td></tr><tr><td>PL</td><td>63.4 ± 1.8</td><td>80.1 ± 3.5</td><td>61.3 ± 1.5</td><td>36.8 ± 4.4</td><td>60.4</td></tr><tr><td>PL-C</td><td>73.3 ± 0.8</td><td>84.7 ± 0.3</td><td>66.4 ± 0.3</td><td>47.0 ± 1.7</td><td>67.9</td></tr><tr><td>Tent-Full</td><td>75.4 ± 0.6</td><td>87.0 ± 0.2</td><td>66.9 ± 0.2</td><td>42.6 ± 0.8</td><td>68.0</td></tr><tr><td>BN-Norm</td><td>71.3 ± 0.4</td><td>85.8 ± 0.1</td><td>66.4 ± 0.1</td><td>42.3 ± 0.4</td><td>66.5</td></tr><tr><td>Tent-C</td><td>72.4 ± 1.5</td><td>84.4 ± 0.1</td><td>66.2 ± 0.2</td><td>42.4 ± 3.1</td><td>66.4</td></tr><tr><td>Tent-BN</td><td>65.6 ± 1.4</td><td>84.9 ± 0.0</td><td>67.7 ± 0.2</td><td>42.7 ± 0.5</td><td>65.2</td></tr><tr><td>T3A (Ours)</td><td>76.0 ± 0.3</td><td>85.1 ± 0.2</td><td>68.2 ± 0.1</td><td>44.6 ± 0.9</td><td>68.5*</td></tr></table>
|
| 165 |
+
|
| 166 |
+
One of the limitations of T3A is how to extend it beyond the classification problem. Since the proposed method creates a template online for each prediction class, it is not trivial to adapt it for continuous prediction. Note that Tent have the same problem, as prediction entropy is hard to compute in the regression case. It is a future task to apply this idea to a broader range of problem settings.
|
| 167 |
+
|
| 168 |
+
Another potential drawback of the proposed method is that the model can change at any time, making it difficult to thoroughly test its behavior in advance. This may raise ethical concerns in some sensitive applications, making it more difficult to sanitize the model and ensure it does not make unfair decisions. In such a situation, fully online adaptation might be difficult, and one may want to update the model offline. We encourage examination of each of these works on the frontier of test-time adaptation.
|
| 169 |
+
|
| 170 |
+
Although accuracy was greatly improved, there is massive room for improvement as the performance in the unknown domain is still significantly worse than performance in the known domain. From a probabilistic viewpoint, the templates of each class can be regarded as the statistics of the $P ( Z | Y )$ and our method adjusts it. As it is connected to the prediction $\begin{array} { r } { P ( Y | Z ) = \frac { P ( Z | Y ) P ( Y ) } { P ( Z ) } } \end{array}$ , adjusting it can correlates the prediction. From this perspective, using the average templates might be too restrictive, and one can use higher-order statistics to improve performance. Alternatively, one can retain all reliable samples, approximating $P ( Z | Y )$ as empirical distribution. We hope that the findings of this paper will lead to a better test-time adaptation method and lead to the development of machine learning systems that work well in unknown environments.
|
| 171 |
+
|
| 172 |
+
# Acknowledgements
|
| 173 |
+
|
| 174 |
+
This work has been supported by JSPS Grant-in-Aid for Early-Career Scientists Number JP18K18101 and the Mohammed bin Salman Center for Future Science and Technology for Saudi-Japan Vision 2030 at The University of Tokyo (MbSC2030). Computational resource of AI Bridging Cloud Infrastructure (ABCI) provided by National Institute of Advanced Industrial Science and Technology (AIST) was used.
|
| 175 |
+
|
| 176 |
+
# References
|
| 177 |
+
|
| 178 |
+
[1] K. Akuzawa, Yusuke Iwasawa, and Y. Matsuo. Adversarial invariant feature learning with accuracy constraint for domain generalization. In ECML/PKDD, 2019.
|
| 179 |
+
[2] Michael A. Alcorn, Qi Li, Zhitao Gong, Chengfei Wang, Long Mai, Wei-Shinn Ku, and Anh M Nguyen. Strike (with) a pose: Neural networks are easily fooled by strange poses of familiar objects. CVPR, pages 4840–4849, 2019.
|
| 180 |
+
[3] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
|
| 181 |
+
[4] Y. Balaji, S. Sankaranarayanan, and R. Chellappa. Metareg: Towards domain generalization using meta-regularization. In NeurIPS, 2018.
|
| 182 |
+
[5] Sara Beery, Grant Van Horn, and P. Perona. Recognition in terra incognita. In ECCV, 2018.
|
| 183 |
+
[6] Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. In NIPS, pages 2178–2186, 2011.
|
| 184 |
+
[7] M. J. Choi, Joseph J. Lim, A. Torralba, and A. Willsky. Exploiting hierarchical context on a large database of object categories. CVPR, pages 129–136, 2010.
|
| 185 |
+
[8] Dengxin Dai and L. Gool. Dark model adaptation: Semantic image segmentation from daytime to nighttime. ITSC, pages 3819–3824, 2018.
|
| 186 |
+
[9] A. Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, M. Dehghani, Matthias Minderer, G. Heigold, S. Gelly, Jakob Uszkoreit, and N. Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021.
|
| 187 |
+
[10] Kurt Driessens, Peter Reutemann, Bernhard Pfahringer, and Claire Leschi. Using weighted nearest neighbor to benefit from unlabeled data. In PAKDD, 2006.
|
| 188 |
+
[11] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn, and A. Zisserman. The PASCAL Visual Object Classes Challenge 2007 (VOC2007) Results. http://www.pascalnetwork.org/challenges/VOC/voc2007/workshop/index.html.
|
| 189 |
+
[12] Chen Fang, Ye Xu, and D. Rockmore. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. ICCV, pages 1657–1664, 2013.
|
| 190 |
+
[13] Li Fei-Fei, R. Fergus, and P. Perona. One-shot learning of object categories. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28:594–611, 2006.
|
| 191 |
+
[14] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, 2015.
|
| 192 |
+
[15] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. JMRL, 17(1):2096–2030, 2016.
|
| 193 |
+
[16] Robert Geirhos, Patricia Rubisch, Claudio Michaelis, M. Bethge, Felix Wichmann, and W. Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. ArXiv, abs/1811.12231, 2019.
|
| 194 |
+
[17] Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In ICLR, 2021.
|
| 195 |
+
[18] Kaiming He, X. Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CVPR, pages 770–778, 2016.
|
| 196 |
+
[19] Timothy M. Hospedales, Antreas Antoniou, P. Micaelli, and A. Storkey. Meta-learning in neural networks: A survey. IEEE transactions on pattern analysis and machine intelligence, PP, 2021.
|
| 197 |
+
[20] Zeyi Huang, Haohan Wang, E. Xing, and Dong Huang. Self-challenging improves cross-domain generalization. In ECCV, 2020.
|
| 198 |
+
[21] Yusuke Iwasawa, K. Akuzawa, and Y. Matsuo. Stabilizing adversarial invariance induction from divergence minimization perspective. In IJCAI, 2020.
|
| 199 |
+
[22] T. Joachims. Transductive inference for text classification using support vector machines. In ICML, 1999.
|
| 200 |
+
[23] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 201 |
+
[24] Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, J. Puigcerver, Jessica Yung, S. Gelly, and N. Houlsby. Big transfer (bit): General visual representation learning. In ECCV, 2020.
|
| 202 |
+
[25] Jogendra Nath Kundu, Naveen Venkat, V. RahulM., and R. Venkatesh Babu. Universal source-free domain adaptation. CVPR, pages 4543–4552, 2020.
|
| 203 |
+
[26] Dong-Hyun Lee. Pseudo-label $:$ The simple and efficient semi-supervised learning method for deep neural networks. 2013.
|
| 204 |
+
[27] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In ICCV, pages 5543–5551. IEEE, 2017.
|
| 205 |
+
[28] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Learning to generalize: Meta-learning for domain generalization. In AAAI, 2018.
|
| 206 |
+
[29] Haoliang Li, Sinno Jialin Pan, S. Wang, and A. Kot. Domain generalization with adversarial feature learning. CVPR, pages 5400–5409, 2018.
|
| 207 |
+
[30] Rui Li, Qianfen Jiao, Wenming Cao, H. Wong, and Si Wu. Model adaptation: Unsupervised domain adaptation without source data. CVPR, pages 9638–9647, 2020.
|
| 208 |
+
[31] Y. Li, Yongxin Yang, W. Zhou, and Timothy M. Hospedales. Feature-critic networks for heterogeneous domain generalization. In ICML, 2019.
|
| 209 |
+
[32] Ya Li, Mingming Gong, Xinmei Tian, Tongliang Liu, and Dacheng Tao. Domain generalization via conditional invariant representations. In AAAI, 2018.
|
| 210 |
+
[33] Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In ECCV, pages 624–639, 2018.
|
| 211 |
+
[34] Jian Liang, D. Hu, and Jiashi Feng. Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In ICML, 2020.
|
| 212 |
+
[35] Thomas Mensink, Jakob J. Verbeek, Florent Perronnin, and Gabriela Csurka. Distance-based image classification: Generalizing to new classes at near-zero cost. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35:2624–2637, 2013.
|
| 213 |
+
[36] H. Nam, Hyunjae Lee, Jongchan Park, W. Yoon, and Donggeun Yoo. Reducing domain gap via styleagnostic networks. ArXiv, abs/1910.11645, 2019.
|
| 214 |
+
[37] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on Knowledge and Data Engineering, 22:1345–1359, 2010.
|
| 215 |
+
[38] V. Patel, Raghuraman Gopalan, R. Li, and R. Chellappa. Visual domain adaptation: A survey of recent advances. IEEE Signal Processing Magazine, 32:53–69, 2015.
|
| 216 |
+
[39] Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, G. Sperl, and Christoph H. Lampert. icarl: Incremental classifier and representation learning. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5533–5542, 2017.
|
| 217 |
+
[40] Bryan C. Russell, A. Torralba, K. Murphy, and W. Freeman. Labelme: A database and web-based tool for image annotation. International Journal of Computer Vision, 77:157–173, 2007.
|
| 218 |
+
[41] Shiori Sagawa, Pang Wei Koh, T. Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. ArXiv, abs/1911.08731, 2019.
|
| 219 |
+
[42] K. Saito, Y. Ushiku, and T. Harada. Asymmetric tri-training for unsupervised domain adaptation. In ICML, 2017.
|
| 220 |
+
|
| 221 |
+
[43] Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. In NeurIPS, 2020.
|
| 222 |
+
|
| 223 |
+
[44] J. Snell, Kevin Swersky, and R. Zemel. Prototypical networks for few-shot learning. In NIPS, 2017.
|
| 224 |
+
[45] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In ECCV Workshops, 2016.
|
| 225 |
+
[46] Y. Sun, Xiaolong Wang, Zhuang Liu, J. Miller, Alexei A. Efros, and Moritz Hardt. Test-time training for out-of-distribution generalization. ArXiv, abs/1909.13231, 2019.
|
| 226 |
+
[47] I. Tolstikhin, N. Houlsby, Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Thomas Unterthiner, Jessica Yung, Daniel Keysers, Jakob Uszkoreit, Mario Lucic, and A. Dosovitskiy. Mlp-mixer: An all-mlp architecture for vision. ArXiv, abs/2105.01601, 2021.
|
| 227 |
+
[48] Hugo Touvron, M. Cord, M. Douze, Francisco Massa, Alexandre Sablayrolles, and Herv’e J’egou. Training data-efficient image transformers & distillation through attention. ArXiv, abs/2012.12877, 2020.
|
| 228 |
+
[49] V. Vapnik. Statistical learning theory. 1998.
|
| 229 |
+
[50] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and S. Panchanathan. Deep hashing network for unsupervised domain adaptation. CVPR, pages 5385–5394, 2017.
|
| 230 |
+
[51] G. Volk, S. Mueller, Alexander von Bernuth, Dennis Hospach, and O. Bringmann. Towards robust cnn-based object detection through augmentation with synthetic rain variations. ITSC, pages 285–292, 2019.
|
| 231 |
+
[52] Dequan Wang, Evan Shelhamer, Shaoteng Liu, B. Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. In ICLR, 2021.
|
| 232 |
+
[53] Yufei Wang, Haoliang Li, and A. Kot. Heterogeneous domain generalization via domain mixup. ICASSP, pages 3622–3626, 2020.
|
| 233 |
+
[54] Ross Wightman. Pytorch image models. https://github.com/rwightman/pytorch-image-models, 2019.
|
| 234 |
+
[55] Garrett Wilson and D. Cook. A survey of unsupervised deep domain adaptation. TIST, 11:1 – 46, 2020.
|
| 235 |
+
[56] Minghao Xu, Jia yu Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and W. Zhang. Adversarial domain adaptation with domain mixup. In AAAI, 2020.
|
| 236 |
+
[57] X. Xu, Timothy M. Hospedales, and S. Gong. Transductive zero-shot action recognition by word-vector embedding. International Journal of Computer Vision, 123:309–333, 2016.
|
| 237 |
+
[58] Shen Yan, Huan Song, Nanxiang Li, L. Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. ArXiv, abs/2001.00677, 2020.
|
| 238 |
+
[59] Hongyi Zhang, Moustapha Cissé, Yann Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. ArXiv, abs/1710.09412, 2018.
|
| 239 |
+
[60] Marvin Zhang, H. Marklund, Abhishek Gupta, Sergey Levine, and Chelsea Finn. Adaptive risk minimization: A meta-learning approach for tackling group shift. ArXiv, abs/2007.02931, 2020.
|
| 240 |
+
[61] K. Zhou, Z. Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. ArXiv, abs/2103.02503, 2021.
|
| 241 |
+
|
| 242 |
+
# Checklist
|
| 243 |
+
|
| 244 |
+
1. For all authors...
|
| 245 |
+
|
| 246 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] (b) Did you describe the limitations of your work? [Yes] See Section 5.1. (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5.1. (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 247 |
+
|
| 248 |
+
2. If you are including theoretical results...
|
| 249 |
+
|
| 250 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 251 |
+
|
| 252 |
+
3. If you ran experiments...
|
| 253 |
+
|
| 254 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental materials.
|
| 255 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4 and Appendix A.
|
| 256 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We repeated entire experiments three times as recommended by the prior works.
|
| 257 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 4 and Appendix A.
|
| 258 |
+
|
| 259 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 260 |
+
|
| 261 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 262 |
+
(b) Did you mention the license of the assets? [Yes] See Appendix A.
|
| 263 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 264 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes]
|
| 265 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes]
|
| 266 |
+
|
| 267 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 268 |
+
|
| 269 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 270 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 271 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/h7FqQ6hCK18/h7FqQ6hCK18.md
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Linear Convergence in Federated Learning: Tackling Client Heterogeneity and Sparse Gradients
|
| 2 |
+
|
| 3 |
+
Aritra Mitra Rayana Jaafar George J. Pappas Hamed Hassani Department of Electrical and Systems Engineering {amitra20,rayanaj,pappasg,hassani} $@$ seas.upenn.edu
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We consider a standard federated learning (FL) setup where a group of clients periodically coordinate with a central server to train a statistical model. We develop a general algorithmic framework called FedLin to tackle some of the key challenges intrinsic to FL, namely objective heterogeneity, systems heterogeneity, and infrequent and imprecise communication. Our framework is motivated by the observation that under these challenges, various existing FL algorithms suffer from a fundamental speed-accuracy conflict: they either guarantee linear convergence but to an incorrect point, or convergence to the global minimum but at a sub-linear rate, i.e., fast convergence comes at the expense of accuracy. In contrast, when the clients’ local loss functions are smooth and strongly convex, we show that FedLin guarantees linear convergence to the global minimum, despite arbitrary objective and systems heterogeneity. We then establish matching upper and lower bounds on the convergence rate of FedLin that highlight the effects of infrequent, periodic communication. Finally, we show that FedLin preserves linear convergence rates under aggressive gradient sparsification, and quantify the effect of the compression level on the convergence rate. Notably, our work is the first to provide tight linear convergence rate guarantees, and constitutes the first comprehensive analysis of gradient sparsification in FL.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
In a canonical federated learning (FL) architecture, a set $s$ of clients periodically communicate with a central server to find a global statistical model that solves the following problem [1–5]:
|
| 12 |
+
|
| 13 |
+
$$
|
| 14 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } f ( x ) , { \mathrm { ~ w h e r e ~ } } f ( x ) = { \frac { 1 } { m } } \sum _ { i = 1 } ^ { m } f _ { i } ( x ) .
|
| 15 |
+
$$
|
| 16 |
+
|
| 17 |
+
Here, $m$ is the number of clients, $f _ { i } : \mathbb { R } ^ { d } \mathbb { R }$ is the local objective (loss) function of client $i$ , and $f ( x )$ is the global objective function. Some of the core distinguishing tenets of the FL paradigm are as follows [1–5]. First, due to privacy considerations, clients cannot directly share their local training data with the server. Second, differences in the clients’ data-sets may cause the clients to have nonidentical loss functions with different minima - this is known as statistical or objective heterogeneity. Third, due to variability in hardware (CPU, memory) and power (battery level), i.e., due to systems or device heterogeneity, the client devices may have different computation speeds; in particular, this may lead to slow and straggling devices that affect convergence guarantees. Finally, communicationefficiency is a major concern, dictating the need to reduce the number of communication rounds, and also the size of the messages transmitted in each round. The above considerations pose unique technical challenges that we aim to address in this paper.
|
| 18 |
+
|
| 19 |
+
In a typical FL setting, to reduce the number of communication rounds, clients perform multiple local training steps in isolation before communicating with the server. Due to such local steps, the popular
|
| 20 |
+
|
| 21 |
+
FedAvg algorithm suffers from a “client-drift phenomenon" under objective heterogeneity [6–11]: the local iterates of each client drift-off towards the minimum of their own local loss function, leading to slow convergence rates. For analysis on FedAvg, we refer the reader to [6, 8, 12–21]. Recently, several new algorithms such as FedProx [22], SCAFFOLD [11], FedSplit [10], and FedNova [23] have been proposed as improvements to FedAvg. Despite these advances, there remain gaps in our understanding of the extent to which these algorithms match the guarantees of a centralized baseline.1
|
| 22 |
+
|
| 23 |
+
For instance, even for simple, deterministic settings, FedProx [22] and FedNova [23] exhibit a fundamental speed-accuracy conflict under objective heterogeneity; see [8, 9] and Section 2. Specifically, with constant step-sizes, these algorithms converge linearly, but potentially to an incorrect point. Thus, convergence to the minimum of the global loss function necessitates diminishing step-sizes, which, in turn, leads to sub-linear convergence. Thus, fast convergence comes at the expense of accuracy. Although SCAFFOLD [11] and FedSplit [10] employ variance-reduction and operatorsplitting techniques, respectively, to tackle objective heterogeneity, it is not known whether the rates in these papers are tight. More importantly, neither SCAFFOLD nor FedSplit account for the effects of systems heterogeneity or compression, both of which are key challenges in FL. Indeed, due to systems heterogeneity, the number of local steps may vary across clients, causing some clients to make much less progress than others in each round [23]. Moreover, while empirical studies [24, 25] have revealed significant benefits of biased sparsification, theoretical guarantees for such methods in a federated setting have remained elusive. In this context, our contributions are as follows.
|
| 24 |
+
|
| 25 |
+
• A New Algorithm: Motivated by the above concerns, we develop a general algorithmic framework called FedLin that simultaneously accounts for objective heterogeneity, systems heterogeneity, and gradient sparsification. The key components of FedLin include a gradient correction term in the local update rule that exploits memory; the use of client-specific learning rates; and error-feedback mechanisms at the clients and the server.
|
| 26 |
+
|
| 27 |
+
• Matching Centralized Rates: For smooth and strongly convex losses, we show that FedLin converges to the global minimum linearly in the deterministic setting, and with a $O ( 1 / T )$ rate for a general stochastic oracle model, thereby matching centralized rates (up to constants). We then present matching rates for smooth, convex and non-convex settings as well. Importantly, our results hold under arbitrary objective and systems heterogeneity. In contrast, the only other work in FL (as far as we are aware) that investigates both objective and systems heterogeneity [23] provides results only for the non-convex setting, under a bounded dissimilarity assumption. Moreover, the FedNova algorithm in [23] suffers from the speed-accuracy conflict, while FedLin does not.
|
| 28 |
+
|
| 29 |
+
• Quantifying the Price of Multiple Local Steps: We establish a lower bound for FedLin that matches the upper-bound we obtain for smooth, strongly convex losses. In doing so, we provide the first (as far as we are aware) tight linear convergence rate analysis. Our lower bound highlights the price paid for performing multiple local steps, i.e., the effect of infrequent communication on the convergence rate. In particular, our analysis reveals, perhaps surprisingly, that there exist simple instances (involving quadratic losses) for which performing multiple local steps does not improve the rate of convergence, indicating that even mild statistical heterogeneity can hurt. Our analysis also provides valuable insights into the limitations of gradient-tracking/variance-reduction techniques.
|
| 30 |
+
|
| 31 |
+
• Analyzing the Impacts of Gradient Sparsification at Server and at Clients: While several works explore the effect of unbiased random quantization in distributed settings [26–31], there are only a handful of papers [15, 32] that also consider the effect of local steps in FL. Different from all these works, we explore the impacts of sparsifying gradients using a biased TOP-k operator, both at the server side and at the clients. Our results in this context (i) constitute the first formal study of gradient sparsification in a federated setting; (ii) reveal key differences between up-link and down-link compression; and (iii) quantify the effect of the compression level on the convergence rate. Notably, FedLin preserves linear convergence rates despite aggressive gradient sparsification.
|
| 32 |
+
|
| 33 |
+
Basic Notation and Terminology: Referring to (1), let $\begin{array} { r } { x ^ { * } \ \in \ \operatorname { a r g m i n } _ { x \in \mathbb { R } ^ { d } } f ( x ) } \end{array}$ , and $x _ { i } ^ { * } \in$ $\mathrm { a r g m i n } _ { x \in \mathbb { R } ^ { d } }$ $f _ { i } ( x )$ . Every FL algorithm mentioned in this paper operates in rounds $t \in \{ 1 , \ldots , T \}$ In each round $t$ , every client performs a certain number of local steps in isolation, starting from a common global model $\bar { x } _ { t }$ . We will denote by $x _ { i , \ell } ^ { ( t ) }$ client $i$ ’s estimate of the model at the $\ell \cdot$ -th local step of round $t$ . In particular, $x _ { i , 0 } ^ { ( t ) } = \bar { x } _ { t } , \forall i \in \mathcal { S }$ .
|
| 34 |
+
|
| 35 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Linear Convergencetox*</td><td rowspan=1 colspan=1>Lower Bounds</td><td rowspan=1 colspan=1>Variable ClientSpeeds</td><td rowspan=1 colspan=1>Sparsification/Compression</td></tr><tr><td rowspan=1 colspan=1>FedAvg[2]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>Thm. I in [11]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>FedProx[22]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>FedNova[23]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>FedSplit[10]</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>SCAFFOLD[11]</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>FedLin (Sec.3)</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>Thm. 5</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td></tr></table>
|
| 36 |
+
|
| 37 |
+
Table 1: Comparison of our proposed algorithm FedLin with popular FL algorithms. We indicate whether or not each algorithm (i) guarantees linear convergence to $x ^ { * }$ for smooth, strongly convex losses in a deterministic setting under objective heterogeneity; (ii) comes with lower bounds; (iii) accounts for variable local steps across clients (systems heterogeneity); and (iv) performs compression.
|
| 38 |
+
|
| 39 |
+
# 2 Motivation: Speed-Accuracy Trade-Off
|
| 40 |
+
|
| 41 |
+
To motivate our work, we first show how some recently proposed FL algorithms, namely FedProx [22] and FedNova [23], exhibit a fundamental speed-accuracy trade-off even in simple, deterministic settings. Specifically, we show that these schemes do not, in general, guarantee convergence to the global minimum with constant step-sizes. This, in turn, necessitates diminishing step-sizes, leading to sub-linear convergence rates. Our analysis here is inspired by that in [8] for FedAvg. We consider a deterministic quadratic model where the local loss function of client $i$ is given by
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Simulations comparing FedProx, FedNova, and FedLin for two clients with $f _ { 1 } ( { x } ) ~ = ~ ( 1 / 2 ) ( x - 3 ) ^ { 2 }$ and $f _ { 2 } ( x ) \ = \ ( x - 5 0 ) ^ { 2 }$ . Left: Clients perform the same number of local steps, $H = 5 0$ . For FedProx, we set $\beta = 5$ . Right: Clients 1 and 2 perform 50 and 30 local steps, respectively.
|
| 45 |
+
|
| 46 |
+
$f _ { i } ( x ) = 1 / 2 \| A _ { i } ^ { 1 / 2 } ( x - c _ { i } ) \| ^ { 2 }$ , where $A _ { i }$ is a symmetric positive-definite matrix. We begin by assuming that all clients perform the same number of local steps $H$ . The following is the FedProx update rule where a proximal term is added to mitigate client-drift:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
x _ { i , \ell + 1 } ^ { ( t ) } = x _ { i , \ell } ^ { ( t ) } - \eta \bigg ( \nabla f _ { i } ( x _ { i , \ell } ^ { ( t ) } ) + \beta ( x _ { i , \ell } ^ { ( t ) } - \bar { x } _ { t } ) \bigg ) , \ell = 0 , \dots , H - 1 ; \bar { x } _ { t + 1 } = \frac { 1 } { m } \sum _ { i \in S } x _ { i , H } ^ { ( t ) } .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Proposition 1. For any step-size $\eta > 0$ , $T$ rounds of FedProx amount to performing $T$ rounds of parallel $G D$ on the surrogate optimization problem given by
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\operatorname* { m i n } _ { x } \frac { 1 } { m } \sum _ { i \in \mathcal { S } } \frac { 1 } { 2 } \bigg \| \bigg ( \sum _ { \ell = 0 } ^ { H - 1 } [ I - \eta ( A _ { i } + \beta I ) ] ^ { \ell } A _ { i } \bigg ) ^ { 1 / 2 } ( x - c _ { i } ) \bigg \| ^ { 2 } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Proposition 1 shows that even when clients perform the same number of local updates, FedProx minimizes a surrogate objective function (3) whose minimum may not, in general, coincide with the minimum of the original problem. When $\beta = 0$ , FedProx reduces to FedAvg, and our observations continue to hold. To capture systems heterogeneity as in [23], suppose now that client $i$ performs $\tau _ { i }$ local steps. Define $\tau _ { e f f } \triangleq 1 / m \sum _ { i \in \mathcal { S } } \tau _ { i }$ and $\alpha _ { i } \triangleq \tau _ { e f f } / \tau _ { i }$ , $\forall i \in S$ . The update rule of FedNova relies on normalized aggregation of cumulative local gradients, and is given by
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta \nabla f _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) ; ~ \bar { \boldsymbol { x } } _ { t + 1 } = \bar { \boldsymbol { x } } _ { t } - \frac { \eta } { m } \sum _ { i \in S } \alpha _ { i } \sum _ { \ell = 0 } ^ { \tau _ { i } - 1 } \nabla f _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\ell = 0 , \dots , \tau _ { i } - 1 , \ i \in \mathcal { S }$ . Although FedNova can accommodate any local solver whose accumulated gradients are expressible as a linear combination of local gradients, we choose gradient descent, a simple solver, to isolate the impact of normalized aggregation - the essence of FedNova.
|
| 65 |
+
|
| 66 |
+
# Algorithm 1 FedLin
|
| 67 |
+
|
| 68 |
+
1: Input: Client step-sizes $\eta _ { i } , i ~ \in ~ S$ , compression levels $\delta _ { c }$ and $\delta _ { s }$ , initial iterate $\overline { { \bar { x } _ { 1 } ~ \in ~ \mathbb { R } ^ { d } } }$
|
| 69 |
+
$\bar { g _ { 1 } = \nabla f ( \bar { x } _ { 1 } ) }$ , initial compression errors $\rho _ { i , 1 } = 0 , \forall i \in \mathcal { S }$ and $e _ { 1 } = 0$
|
| 70 |
+
2: for $t = 1 , \dots , T$ do
|
| 71 |
+
3: for $i = 1 , \ldots , m$ do
|
| 72 |
+
4: for $\ell = 0 , \ldots , \tau _ { i } - 1$ do
|
| 73 |
+
5: $x _ { i , \ell + 1 } ^ { ( t ) } \gets x _ { i , \ell } ^ { ( t ) } - \eta _ { i } ( \nabla f _ { i } ( x _ { i , \ell } ^ { ( t ) } ) - \nabla f _ { i } ( \bar { x } _ { t } ) + g _ { t } ) ; x _ { i , 0 } ^ { ( t ) } = \bar { x } _ { t }$
|
| 74 |
+
6: end for
|
| 75 |
+
7: Transmit x(t)i,τi to server
|
| 76 |
+
8: end for
|
| 77 |
+
9: Server transmits x¯t+1 = 1/m Pi∈S x(t)i,τi
|
| 78 |
+
10: for $i = 1 , \ldots , m$ do
|
| 79 |
+
11: Transmit $h _ { i , t + 1 } = \mathcal { C } _ { \delta _ { c } } ( \rho _ { i , t } + \nabla f _ { i } ( \bar { x } _ { t + 1 } ) )$ to server
|
| 80 |
+
12: $\rho _ { i , t + 1 } \rho _ { i , t } + \nabla f _ { i } ( \bar { x } _ { t + 1 } ) - h _ { i , t + 1 }$
|
| 81 |
+
13: end for
|
| 82 |
+
14: Server transmits $\begin{array} { r } { g _ { t + 1 } = \mathcal { C } _ { \delta _ { s } } ( e _ { t } + 1 / m \sum _ { i \in S } h _ { i , t + 1 } ) } \end{array}$
|
| 83 |
+
15: $e _ { t + 1 } e _ { t } + 1 / m \sum _ { i \in S } h _ { i , t + 1 } - g _ { t + 1 }$
|
| 84 |
+
16: end for
|
| 85 |
+
|
| 86 |
+
Proposition 2. For any step-size $\eta > 0$ , $T$ rounds of FedNova amount to performing $T$ rounds of parallel GD on the surrogate optimization problem given by
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\operatorname* { m i n } _ { x } \frac { 1 } { m } \sum _ { i \in S } \frac { 1 } { 2 } \bigg \| \bigg ( \sum _ { \ell = 0 } ^ { \tau _ { i } - 1 } [ I - \eta A _ { i } ] ^ { \ell } \alpha _ { i } A _ { i } \bigg ) ^ { 1 / 2 } ( x - c _ { i } ) \bigg \| ^ { 2 } .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
For the proofs of Propositions 1 and 2, see Appendix B. Proposition 2 shows that in the presence of both objective and systems heterogeneity, FedNova minimizes a surrogate loss function whose minimum may not coincide with $x ^ { * }$ .2 Observe from (3) and (5) that using a larger learning rate $\eta$ introduces more distortion to the original problem. In Figure 1, we see how FedProx and FedNova both converge to incorrect minimizers, even for simple instances with two clients and deterministic, quadratic losses. In contrast, FedLin, our proposed approach that we develop in the next section, guarantees linear convergence to the global minimum.
|
| 93 |
+
|
| 94 |
+
Main Takeaway: The main message we want to convey here is that even for deterministic settings, there are non-trivial challenges posed by objective and systems heterogeneity that only get amplified when one additionally considers biased compression. For such scenarios, it is not at all apparent whether (and to what extent) one can match even the basic centralized benchmark of achieving linear convergence for smooth, strongly convex loss functions. To focus on the above unresolved issues, we will primarily consider a deterministic model in this paper. Nonetheless, the general approach we develop applies to the stochastic setting as well, as aptly demonstrated by Theorem 4 in Section 4.
|
| 95 |
+
|
| 96 |
+
# 3 Proposed Algorithm: FedLin
|
| 97 |
+
|
| 98 |
+
In this section, we develop our proposed algorithm FedLin, formally described in Algorithm 1. FedLin is initialized from a common global iterate $\bar { x } _ { 1 } ~ \in ~ \mathbb { R } ^ { d }$ . For simplicity, we assume that $g _ { 1 } = \nabla f ( { \bar { x } } _ { 1 } )$ , i.e., every client has access to the true gradient of $f ( \cdot )$ initially; we can allow $g _ { 1 }$ to be arbitrary as well without affecting the convergence guarantees. FedLin proceeds in rounds: in each round $t$ , starting from a common global model $\bar { x } _ { t }$ , each client $i$ performs $\tau _ { i }$ local training steps in parallel, as per line 5 of Algorithm 1. The key features of our local update rule are as follows: exploiting past gradients to account for objective heterogeneity, using client-specific step-sizes to tackle systems heterogeneity, and employing error-feedback to account for gradient sparsification. We now discuss each of these features in detail.
|
| 99 |
+
|
| 100 |
+
To gain intuition regarding the local step in line 5, note that the ideal local update at client $i$ is $\boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta _ { i } \nabla f ( \boldsymbol { x } _ { i , \ell } ^ { ( \bar { t } ) } )$ . However, this requires client $i$ to have access to the gradients of all other clients - which it does not, since clients do not communicate between rounds. To get around this, client $i$ exploits memory, and uses the gradient of the global function $\nabla f ( { \bar { x } } _ { t } )$ from the beginning of round $t$ (when the clients last communicated) as a guiding direction in its update rule. However, since $\nabla f ( { \bar { x } } _ { t } )$ is evaluated at a stale point $x _ { i , 0 } ^ { ( t ) } = \bar { x } _ { t }$ , client $i$ subtracts off $\nabla f _ { i } ( \bar { x } _ { t } )$ from $\nabla f ( { \bar { x } } _ { t } )$ , and adds in the most recently evaluated gradient $\nabla f _ { i } ( x _ { i , \ell } ^ { ( t ) } )$ . This results in the update rule: $\boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta _ { i } ( \nabla f _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) - \nabla f _ { i } ( \bar { \boldsymbol { x } } _ { t } ) + \nabla f ( \bar { \boldsymbol { x } } _ { t } ) )$ . Our local update rule in line 5 is precisely of the above form, where $g _ { t }$ is an inexact version of $\nabla f ( { \bar { x } } _ { t } )$ to account for gradient sparsification.
|
| 101 |
+
|
| 102 |
+
When each client $i$ performs $\tau _ { i }$ local-steps, our analysis reveals that the bound on the drift-term $\| x _ { i , \ell } - \bar { x } _ { t } \|$ scales linearly in $\tau _ { i }$ (see Lemma 9 in Appendix F). Accordingly, to compensate for such drift at client $i$ , the step-size $\eta _ { i }$ needs to be chosen to vary inversely with the number of local steps $\tau _ { i }$ . In fact, the requirement that $\eta _ { i } \propto 1 / \tau _ { i }$ also turns out to be necessary (see Theorem 5), providing further motivation for the choice of client-specific learning rates in FedLin.
|
| 103 |
+
|
| 104 |
+
To explain the gradient sparsification module, let us denote by $\mathcal { C } _ { \delta } : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ the TOP- $\mathtt { . k }$ operator, where $\delta = d / k$ , and $k \in \bar { \{ 1 , \ldots , d \} }$ . Given any $x \in \mathbb { R } ^ { d }$ , let ${ \mathcal { E } } _ { \delta } ( x )$ be a set containing the indices of the $k$ largest-magnitude components of $x$ . Then, the TOP- ${ \bf \nabla } \cdot { \bf k }$ operator we consider is given by $( \mathcal { C } _ { \delta } ( x ) ) _ { j } = \mathsf { \bar { \Psi } } ( x ) _ { j }$ if $j \in \mathcal { E } _ { \delta } ( x )$ , and $\left( \boldsymbol { \mathcal { C } } _ { \delta } ( \boldsymbol { x } ) \right) _ { j } = 0$ otherwise. Here, we use $( x ) _ { j }$ to denote the $j$ -th component of a vector $x$ . Clearly, a larger $\delta$ implies more aggressive compression. We employ a standard error-feedback mechanism [33–35] at both the server and the clients to account for gradient sparsification. At client $i$ , $\rho _ { i , t }$ represents the accumulated error due to gradient sparsification. At the end of round $t$ , instead of just compressing $\nabla f _ { i } ( \bar { x } _ { t + 1 } )$ , client $i$ instead compresses $\nabla f _ { i } ( \bar { x } _ { t + 1 } ) + \rho _ { i , t }$ , to account for gradient coordinates not transmitted in the past. It then updates the aggregate error via line 12. An analogous description applies to the error-feedback scheme at the server, where $e _ { t }$ is the aggregate error at the beginning of round $t$ . The parameters of FedLin are the client step-sizes $\{ \eta _ { i } \} _ { i \in { \cal S } }$ , and the compression levels $\delta _ { c }$ and $\delta _ { s }$ at the clients and at the server, respectively. We now comment on some related algorithmic ideas.
|
| 105 |
+
|
| 106 |
+
Related Algorithmic Approaches: In the related but different setting of distributed optimization, we note that the idea of exploiting past gradients has been used to design gradient-tracking algorithms [36–40]. In the context of FL, this idea is also related to the variance-reduction technique employed in SCAFFOLD [11]. A major difference of FedLin with the above works is that none of them consider the effect of systems heterogeneity or biased compression. In particular, accounting for the inexact gradient term $g _ { t }$ in our update rule introduces new technical challenges that we address in this paper.
|
| 107 |
+
|
| 108 |
+
There are some additional basic differences between FedLin and SCAFFOLD. To see this, consider the update rule of FedLin without sparsification: $\boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta _ { i } ( \nabla f _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) - \nabla f _ { i } ( \bar { \boldsymbol { x } } _ { t } ) + \nabla f ( \bar { \boldsymbol { x } } _ { t } ) )$ Now suppose the global model $\hat { x } _ { t }$ at the beginning of round $t$ has already converged to $x ^ { * }$ . Since $x _ { i , 0 } ^ { ( t ) } = \bar { x } _ { t } , \forall i \in \mathcal { S }$ , and $\nabla f ( x ^ { * } ) = 0$ , it is easy to see that the iterates of the clients do not evolve any further, as one would ideally want. Thus, the global optimum $x ^ { * }$ can be viewed as a fixed-point of the FedLin update rule. Adapting to our notation, and considering the case when there is no noise in the gradients, the update rule of SCAFFOLD takes the form $\boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta ( \nabla f _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) - \boldsymbol { c } _ { i } + \boldsymbol { c } )$ , where $c _ { i }$ is a ‘control-variate’ maintained by client $i$ , and $c$ is the average of the $c _ { i }$ ’s. Importantly, the control variates $\{ c _ { i } \} _ { i \in { \mathcal { S } } }$ used in round $t$ of SCAFFOLD contain stale terms from round $t - 1$ . As a result, even if $\bar { x } _ { t } = x ^ { * }$ , it may very well be that $( \nabla f _ { i } ( { \bar { x } } _ { t } ) - c _ { i } + c ) \neq 0$ , causing the iterates of the clients to move away from $x ^ { * }$ , and requiring further rounds of communication to average out the imbalance. Thus, the fixed-point property we discussed for FedLin does not hold in general for SCAFFOLD. Our simulations in Section 7 reveal that FedLin converges much faster relative to SCAFFOLD on a simple linear regression model; we conjecture it is precisely due to the reason described above.
|
| 109 |
+
|
| 110 |
+
Keeping aside the differences due to systems heterogeneity and compression, the FedSVRG algorithm in [1] includes a similar gradient correction term as in FedLin, but makes use of certain additional diagonal scaling and pre-conditioning matrices. Although promising empirical results are reported for FedSVRG in [1], these results come with no supporting theoretical guarantees of convergence. In contrast, we will develop rigorous complexity guarantees for FedLin in the following sections. Specifically, we will show that FedLin guarantees linear convergence rates despite the challenges of objective heterogeneity, systems heterogeneity, and aggressive gradient sparsification.
|
| 111 |
+
|
| 112 |
+
# 4 Matching Centralized Rates under Objective and Systems Heterogeneity
|
| 113 |
+
|
| 114 |
+
In this section, we will analyze the performance of FedLin in the face of both objective and systems heterogeneity. To focus solely on the effects of client heterogeneity, we will assume throughout this section that there is no gradient sparsification, i.e., $\delta _ { c } = \delta _ { s } = 1$ . Accordingly, observe that $\rho _ { i , t } = 0 , e _ { t } = 0 , \forall i \in \mathcal { S } , \forall t \in \{ 1 , . . . , \bar { T } \}$ . Thus, the local update rule for FedLin simplifies to
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r } { \boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta _ { i } ( \nabla f _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) - \nabla f _ { i } ( \bar { \boldsymbol { x } } _ { t } ) + \nabla f ( \bar { \boldsymbol { x } } _ { t } ) ) . } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Let us denote by $\kappa = L / \mu$ the condition number of an $L$ -smooth and $\mu$ -strongly convex function. Also, let $\eta _ { i } = \bar { \eta } / \tau _ { i } , \forall i \in \mathcal { S }$ , where $\bar { \eta } \in ( 0 , 1 )$ is a flexible parameter that we will specify based on context. We are now ready to state the main results of this section.
|
| 121 |
+
|
| 122 |
+
Theorem 1. (Strongly convex case) Suppose each $f _ { i } ( x )$ is $L$ -smooth and $\mu$ -strongly convex. Moreover, suppose $\tau _ { i } \geq 1 , \forall i \in S$ , and $\delta _ { c } = \delta _ { s } = 1$ . Then, with $\begin{array} { r } { \eta _ { i } = \frac { 1 } { 6 L \tau _ { i } } , \forall i \dot { \in } \mathcal { S } } \end{array}$ , FedL $_ { i n }$ guarantees:
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
f ( \bar { x } _ { T + 1 } ) - f ( x ^ { * } ) \leq \left( 1 - \frac { 1 } { 6 \kappa } \right) ^ { T } ( f ( \bar { x } _ { 1 } ) - f ( x ^ { * } ) ) .
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
Theorem 2. (Convex case) Suppose each $f _ { i } ( x )$ is $L$ -smooth and convex. Moreover, suppose $\tau _ { i } \geq$ $1 , \forall i \in S$ , and $\delta _ { c } = \delta _ { s } = 1$ . Then, with $\begin{array} { r } { \eta _ { i } \stackrel { \cdot \cdot } { = } \frac { \mathrm { ~ i ~ } } { 1 0 L \tau _ { i } } , \forall i \in \mathcal { S } , } \end{array}$ , FedLin guarantees:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
f \left( \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \bar { x } _ { t } \right) - f ( x ^ { * } ) \leq \frac { 1 0 L } { T } \left( \Vert \bar { x } _ { 1 } - x ^ { * } \Vert ^ { 2 } - \Vert \bar { x } _ { T + 1 } - x ^ { * } \Vert ^ { 2 } \right) .
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
Theorem 3. (Non-convex case) Suppose each $f _ { i } ( x )$ is $L$ -smooth. Moreover, suppose $\tau _ { i } \geq 1 , \forall i \in S$ and $\delta _ { c } = \delta _ { s } = 1$ . Then, with $\begin{array} { r } { \eta _ { i } = \frac { 1 } { 2 6 L \tau _ { i } } , \forall i \in \mathcal { S } } \end{array}$ , FedLin guarantees:
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\operatorname* { m i n } _ { t \in \left[ T \right] } \left\| \nabla f ( \bar { x } _ { t } ) \right\| ^ { 2 } \leq \frac { 5 2 L } { T } ( f ( \bar { x } _ { 1 } ) - f ( \bar { x } _ { T + 1 } ) ) .
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
Noisy Case Analysis: We now analyze the performance of FedLin under a general stochastic oracle model. For each $i \in S$ and $x \in \mathbb { R } ^ { d }$ , let $q _ { i } ( \bar { x } )$ be an unbiased estimate of the gradient $\nabla f _ { i } ( x )$ with variance bounded above by σ2. We consider the update rule: x(t)i,\`+1 = x(t)i,\` $\boldsymbol { x } _ { i , \ell + 1 } ^ { ( t ) } = \boldsymbol { x } _ { i , \ell } ^ { ( t ) } - \eta _ { i } \big ( q _ { i } ( \boldsymbol { x } _ { i , \ell } ^ { ( t ) } ) - q _ { i } ( \bar { \boldsymbol { x } } _ { t } ) +$ $q ( \bar { x } _ { t } ) )$ , where $\begin{array} { r } { q ( x ) \triangleq 1 / m \sum _ { i \in S } q _ { i } ( x ) , \forall x \in \mathbb { R } ^ { d } } \end{array}$ . We then have the following result.
|
| 141 |
+
|
| 142 |
+
Theorem 4. (Strongly convex case with noise) Consider the above stochastic oracle model. Suppose each $f _ { i } ( x )$ is $L$ -smooth and -strongly convex. Moreover, suppose $\tau _ { i } \geq 1 , \forall i \in S$ , and $\delta _ { c } = \delta _ { s } = 1$ . For each $i \in S$ , let $\begin{array} { r } { \eta _ { i } = \frac { \bar { \eta } } { \tau _ { i } } } \end{array}$ , where $\bar { \eta } \in ( 0 , 1 )$ satisfies $\begin{array} { r } { \bar { \eta } < \frac { 1 } { 6 L } } \end{array}$ . Then, $\forall t \in [ T ]$ , FedLin guarantees:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathbb { E } [ \| \bar { x } _ { t + 1 } - x ^ { * } \| ^ { 2 } ] \leq \left( 1 - \frac { \bar { \eta } \mu } { 2 } \right) \mathbb { E } [ \| \bar { x } _ { t } - x ^ { * } \| ^ { 2 } ] + 2 5 \bar { \eta } ^ { 2 } \sigma ^ { 2 } .
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
The proofs of Theorems 1, 2, 3, and 4 are provided in Appendix F.
|
| 149 |
+
|
| 150 |
+
Main Takeaways: From Theorems 1, 2, and 3, we note that FedLin matches the convergence guarantees of centralized gradient descent (up to constants) for smooth, strongly convex, convex, and non-convex settings, respectively. As far as we are aware, this is the first work to provide such comprehensive guarantees under arbitrary objective and systems heterogeneity. In fact, all our results continue to hold even when the operating speeds of the client machines vary across rounds, i.e., $\tau _ { i }$ is allowed to be a function of $t$ . Each client $i$ can simply adjust its learning rate $\eta _ { i } \propto 1 / \tau _ { i } ( t )$ locally to account for such variations. The bound for the noisy case in Theorem 4 resembles that of centralized SGD [41]: with a time-varying parameter $\bar { \eta _ { t } } = \dot { O } ( 1 / t )$ , we get the standard $O ( 1 / T )$ rate after $T$ rounds (using the exact same arguments as in [41]). The key thing to note here is that despite arbitrary heterogeneity, the assumptions we make on the stochastic gradients are the same as those made in the analysis of centralized SGD: unbiased gradients with bounded variance, nothing more.
|
| 151 |
+
|
| 152 |
+
Comparison with Related Work: In the recent paper [10], the authors propose FedSplit, and analyze it in a deterministic setting. For strongly-convex and smooth loss functions, FedSplit guarantees linear convergence, but only to a non-vanishing neighborhood of $x ^ { * }$ . Thus, like FedAvg [2], FedProx [22], and FedNova [23], FedSplit fails to guarantee exact linear convergence to $x ^ { * }$ . Empirically, we observe that FedSplit diverges on certain instances; see Appendix J. Compared to these algorithms, we see from Theorem 1 that FedLin guarantees linear convergence to $x ^ { * }$ . Notably, the linear convergence rate we obtain in Theorem 1 under both objective and systems heterogeneity is the best rate we know of in $F L$ , and matches that of SCAFFOLD [11] where only objective heterogeneity is considered.3 The model of systems heterogeneity we study is taken from [23], where the authors provide guarantees only for the non-convex case under a bounded dissimilarity assumption. In contrast, our results cover all the three standard settings - strongly-convex, convex, and non-convex - without requiring any bounded dissimilarity assumption. For further related work on straggler-robust distributed learning algorithms (without objective heterogeneity or local steps), see [43–48].
|
| 153 |
+
|
| 154 |
+
# 4.1 The Price of Infrequent Communication
|
| 155 |
+
|
| 156 |
+
In this section, we take a closer look at the effect of performing multiple local steps on the convergence rate. To do so, we assume that all clients perform the same number of local steps $H$ , i.e., there is no communication for $H$ consecutive time-steps between two communication rounds. Now consider a centralized baseline where each client can communicate with every other client at all times (i.e., even between rounds). In this case, since each client can always access $\nabla f ( x )$ , gradient descent yields
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
f ( \bar { x } _ { T + 1 } ) - f ( x ^ { * } ) \leq \exp ( - \frac { 1 } { \kappa } T H ) ( f ( \bar { x } _ { 1 } ) - f ( x ^ { * } ) )
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
after $T$ rounds, with $H$ synchronized local iterations within each round. Based on Theorem 1, observe that we lose out by a factor of $H$ in the exponent relative to the centralized baseline. Notably, both in the centralized case, and in FedLin, each client queries the gradient of its local objective $H$ times in each round, thereby making $T H$ gradient queries over $T$ rounds. Thus, relative to a centralized baseline, FedLin incurs the same computational cost in terms of gradient queries, and reduces communication by a factor of $H$ , at the expense of a convergence rate that is slower by a factor of $H$ . We emphasize here that just as with FedLin, $H$ does not show up in the convergence rate (exponent) of algorithms like FedSplit [10] and SCAFFOLD [11] either.
|
| 163 |
+
|
| 164 |
+
The primary reason for the slower convergence rate (relative to a centralized baseline) stems from the need to set $\eta \propto 1 / H$ to mitigate client-drift under objective heterogeneity. At this stage, one may conjecture that the above requirement is simply an artifact of a conservative analysis of Algorithm 1, and that a more refined analysis will reveal the utility of performing more local steps even in the heterogeneous setting. Our next result suggests otherwise; for a proof, see Appendix $\mathrm { E }$ .
|
| 165 |
+
|
| 166 |
+
Theorem 5. (Lower bound for FedLin) Suppose $\delta _ { c } = \delta _ { s } = 1$ , and $\tau _ { i } = H , \eta _ { i } = \eta , \forall i \in S$ . Then, given any $L \ge 1 4$ and $H \geq 2$ , there exists an instance involving 2 clients where each $f _ { i } ( x ) , i \in \{ 1 , 2 \}$ , is 1-strongly convex and $L$ -smooth, and an initial condition $\scriptstyle { \bar { x } } _ { 1 }$ , such that FedLin initialized from $\scriptstyle { \bar { x } } _ { 1 }$ generates a sequence of iterates $\{ \bar { x } _ { t } \}$ satisfying the following for any $T \geq 1$ :
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\begin{array} { r } { \| \bar { x } _ { T + 1 } - x ^ { * } \| ^ { 2 } \geq \exp \left( - 4 T \right) \| \bar { x } _ { 1 } - x ^ { * } \| ^ { 2 } ; f ( \bar { x } _ { T + 1 } ) - f ( x ^ { * } ) \geq \exp ( - 4 T ) ( f ( \bar { x } _ { 1 } ) - f ( x ^ { * } ) ) . } \end{array}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
Main Takeaways: There are several key implications of Theorem 5. First, it complements Theorem 1 by providing a matching lower bound. We believe ours is the first work to provide a tight linear convergence rate analysis: [11] and [10] only provide upper-bounds for SCAFFOLD and FedSplit, respectively. Second, our analysis of Theorem 5 in Appendix E indicates that there are problem instances where setting $\eta \propto 1 / H$ is in fact necessary to guarantee convergence to $x ^ { * }$ . As a result, for such problem instances, no matter how many local steps $H$ each client performs, the error at the end of $T$ rounds remains bounded below by an $H$ -independent quantity, as is apparent from (10). Perhaps surprisingly, we show in Appendix E that the lower bound in Theorem 5 even applies to simple instances with non-identical quadratic losses (across clients) where every $f _ { i } ( x )$ has the same minimum! This is particularly insightful since it highlights the limitations of exploiting stale gradient terms in the local update rule (as is done in both FedLin and SCAFFOLD), and suggests the need for more informed updating schemes that explicitly take into account the level of statistical heterogeneity.
|
| 173 |
+
|
| 174 |
+
Proof Idea for Theorem 5: To establish Theorem 5, we set up an instance involving two clients with quadratic loss functions. Our main idea is to relate the convergence of FedLin to the Schur stability of an appropriate discrete-time linear time-invariant (LTI) system. Based on this connection, we show that guaranteeing stability necessitates setting $\eta \propto 1 / H$ , which immediately leads to the lower bound. We believe that the same technique can be used to establish a similar lower bound for SCAFFOLD.
|
| 175 |
+
|
| 176 |
+
# 5 Gradient Sparsification at Server
|
| 177 |
+
|
| 178 |
+
In this section, our focus will be on addressing the following question: For strongly convex and smooth deterministic functions, and in the presence of both objective and systems heterogeneity, can we still hope for linear convergence to $x ^ { * }$ when gradients are sparsified at the server? Interestingly, we will show that not only is it possible to converge linearly to $x ^ { * }$ , it is possible to do so without any error-feedback. Moreover, this claim holds regardless of how aggressive the server is in its sparsification scheme: it may even transmit just a single component of the aggregated gradient vector.
|
| 179 |
+
|
| 180 |
+
To isolate the impact of server-level sparsification, we will assume throughout this section that gradients are not sparsified at the clients, i.e., $\delta _ { c } = 1$ . Consequently, $h _ { i , t + 1 } = \nabla f _ { i } ( \bar { x } _ { t + 1 } ) , \forall i \in$ $\mathcal { S } , \forall t \in \{ 1 , \ldots , T \}$ . We begin by considering a simpler variant of FedLin with no error-feedback at the server side, i.e., line 15 is skipped, and $g _ { t + 1 }$ in line 14 of Algo. 1 is instead updated as follows
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
g _ { t + 1 } = { \mathcal C } _ { \delta _ { s } } \left( \frac { 1 } { m } \sum _ { i \in \mathcal { S } } \nabla f _ { i } ( \bar { x } _ { t + 1 } ) \right) = { \mathcal C } _ { \delta _ { s } } \left( \nabla f ( \bar { x } _ { t + 1 } ) \right) .
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
Theorem 6. (Sparsification at server with no error-feedback) Suppose each $f _ { i } ( x )$ is $L$ -smooth and $\mu$ -strongly convex. Moreover, suppose $\tau _ { i } \geq 1 , \forall i \in S$ , and $\delta _ { c } = 1$ . Consider a variant of FedLin, where line $^ { I 4 }$ is replaced by equation (11), and line 15 is skipped, i.e., there is no error-feedback. Then, with ηi = 12(2+√δs)Lτi , , this variant of FedLin guarantees
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
f ( \bar { x } _ { T + 1 } ) - f ( x ^ { * } ) \leq \bigg ( 1 - \frac { 1 } { 2 \delta _ { s } \left( 2 + \sqrt { \delta _ { s } } \right) \kappa } \bigg ) ^ { T } ( f ( \bar { x } _ { 1 } ) - f ( x ^ { * } ) ) .
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
Main Takeaways: From Theorem 6, we see that even without error-feedback, it is possible to linearly converge to $x ^ { * }$ ; the rate of convergence, however, is inversely proportional to $\delta _ { s } ^ { \frac { 3 } { 2 } }$ . Thus, Theorem 6 quantifies the trade-off between the level of sparsification at the server, and the rate of convergence. When there is no gradient compression, i.e., when $\delta _ { s } = 1$ , we exactly recover Theorem 1.
|
| 193 |
+
|
| 194 |
+
One may ask: Is there any potential benefit to employing error-feedback when gradients are sparsified at the server? Our next result answers this question in the affirmative.
|
| 195 |
+
|
| 196 |
+
Theorem 7. (Sparsification at server with error-feedback) Suppose each $f _ { i } ( x )$ is $L$ -smooth and $\mu$ -strongly convex. Moreover, suppose $\tau _ { i } \geq 1 , \forall i \in S$ , and $\delta _ { c } = 1$ . Let the step-size for client i be chosen as $\begin{array} { r } { \eta _ { i } = \frac { 1 } { 7 2 L \delta _ { s } \tau _ { i } } } \end{array}$ . Then, FedLin guarantees:
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
f ( \bar { x } _ { T + 1 } ) - f ( x ^ { * } ) \leq 2 \kappa \bigg ( 1 - \frac { 1 } { 9 6 \delta _ { s } \kappa } \bigg ) ^ { T } \left( f ( \bar { x } _ { 1 } ) - f ( x ^ { * } ) \right) .
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+
For proofs of Theorems 6 and 7, see Appendix G and I.
|
| 203 |
+
|
| 204 |
+
Main Takeaways: Comparing the guarantee of Theorem 6 with that of Theorem 7, we note that the convergence rate is inversely proportional to $\delta _ { s } ^ { \frac { 3 } { 2 } }$ in the former, and inversely proportional to $\delta _ { s }$ in the latter. Thus, the main message here is that employing error-feedback leads to a faster convergence rate by improving the dependence of the rate on $\delta _ { s }$ .
|
| 205 |
+
|
| 206 |
+
# 6 Gradient Sparsification at Clients
|
| 207 |
+
|
| 208 |
+
In this section, we will turn our attention to the case when gradients are sparsified at the clients prior to being transmitted to the server. Throughout this section, we will assume that gradients are not compressed any further at the server side, i.e., $\delta _ { s } = 1$ . To proceed, we will need to make the following bounded gradient dissimilarity assumption.
|
| 209 |
+
|
| 210 |
+
Assumption 1. There exist constants $C \geq 1$ and $D \geq 0$ such that the following holds $\forall x \in \mathbb { R } ^ { d }$
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
{ \frac { 1 } { m } } \sum _ { i = 1 } ^ { m } \left\| \nabla f _ { i } ( x ) \right\| ^ { 2 } \leq C \left\| \nabla f ( x ) \right\| ^ { 2 } + D .
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
The following is the main result of this section; for a proof, see Appendix H.
|
| 217 |
+
|
| 218 |
+
Theorem 8. (Sparsification at clients with error-feedback) Suppose each $f _ { i } ( x )$ is $L$ -smooth and -strongly convex, and suppose Assumption 1 holds. Moreover, suppose $\tau _ { i } \geq 1 , \forall i \in S$ , and $\delta _ { s } = 1$ . Let the step-size for client i be chosen as $\begin{array} { r } { \eta _ { i } = \frac { \bar { \eta } } { \tau _ { i } } } \end{array}$ , where $\bar { \eta } \in ( 0 , 1 )$ satisfies $\begin{array} { r } { \bar { \eta } \le \frac { 1 } { 7 2 L \delta _ { c } C } } \end{array}$ . Then, FedLin guarantees:
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\left\| { \bar { x } } _ { T + 1 } - x ^ { * } \right\| ^ { 2 } \leq 2 { \left( 1 - \frac { 3 } { 4 } { \bar { \eta } } \mu \right) } ^ { T } \left\| { \bar { x } } _ { 1 } - x ^ { * } \right\| ^ { 2 } + \frac { 1 6 } { 3 } { \bar { \eta } } \left( \frac { 6 } { \delta _ { c } C } + \delta _ { c } \right) \frac { D } { \mu } .
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
Main Takeaways: Intuitively, one would expect that sparsifying gradients at each client prior to aggregation at the server would inject more errors than when gradients are first accurately aggregated at the server, and then the aggregated gradient vector is sparsified: Theorems 6 and 8 support this intuition. For the former, we neither required error-feedback nor Assumption 1 to guarantee linear convergence to the global minimum $x ^ { * }$ ; for the latter, even with error-feedback and the bounded gradient dissimilarity assumption, we can establish linear convergence to only a neighborhood of $x ^ { * }$ , in general. From (13), we note that the size of this neighborhood scales linearly with $D$ - a measure of objective heterogeneity. In particular, when $D = 0$ , the iterates $\bar { x } _ { t }$ converge exactly to $x ^ { * }$ .
|
| 225 |
+
|
| 226 |
+
Remark 1. To the best of our knowledge, our results in Sections 5 and 6 constitute the first formal analysis of biased gradient sparsification in FL. In particular, we significantly generalize the recent results in [49] for a single worker to a multi-client $F L$ setting with both objective and systems heterogeneity. To arrive at these results, we develop a new potential-function based proof technique in Appendix H. For more related work on compression in distributed learning, see Appendix A.
|
| 227 |
+
|
| 228 |
+
Extensions: We studied the effect of compressing information at the server and at the clients separately, with the goal of identifying the key differences between each of these mechanisms. The analysis techniques we developed in the process pave the way for studying various natural extensions: (i) combined sparsification at both the clients and the server; (ii) gradient sparsification in tandem with model parameter compression; and (iii) stochastic counterparts of Theorems 6, 7, and 8.
|
| 229 |
+
|
| 230 |
+
# 7 Experimental Results
|
| 231 |
+
|
| 232 |
+
In this section, we provide numerical results for FedLin on a least squares problem to validate our theory. In Appendix K, we also provide additional numerical results on a logistic regression problem.
|
| 233 |
+
|
| 234 |
+
For now, we consider the following least squares regression problem:
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } f ( x ) = \operatorname* { m i n } _ { x \in \mathbb { R } ^ { d } } \frac { 1 } { m } \sum _ { i = 1 } ^ { m } \frac { 1 } { 2 } \| A _ { i } x - b _ { i } \| ^ { 2 } ,
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
where $A _ { i } \in \mathbb { R } ^ { 5 0 0 \times 1 0 0 }$ is a design matrix and $b _ { i } \in \mathbb { R } ^ { 5 0 0 }$ is a response vector. The client objective functions, $f _ { i } ( x )$ are strongly convex. Assuming that all design matrices are full column rank, problem (14) admits a unique minimizer. To generate synthetic data, for each client $i \in \mathcal { S } = \{ 1 , . . . , \bar { 2 0 } \}$ , we generate $A _ { i }$ and $b _ { i }$ according to the model $b _ { i } = A _ { i } x _ { i } + \varepsilon _ { i }$ , where $x _ { i }$ is a weight vector and $\varepsilon _ { i } \in \mathrm { \mathbb { R } } ^ { 5 0 0 }$ is a disturbance. In particular, we generate $[ A _ { i } ] _ { j k } \stackrel { i . i . d . } { \sim } { \cal N } ( 0 , 1 )$ , and $\varepsilon _ { i } \sim \mathcal { N } ( 0 , 0 . 5 I _ { 5 0 0 } )$ , $\forall i \in S$ To capture statistical heterogeneity, the entries of the local true parameter of client $i$ are modeled as $[ x _ { i } ] _ { k } \overset { \vartriangle } { \sim } \mathcal { N } ( u _ { i } , 1 )$ , $k \in \{ 1 , \ldots , 1 0 0 \}$ , where $u _ { i } \sim \mathcal { N } ( 0 , \alpha )$ and $\alpha \geq 0$ . Hence, $\alpha$ controls the level of statistical heterogeneity. To model the effect of systems heterogeneity, for each client $i \in S$ , the number of local steps is drawn uniformly and independently from [2, 100]. We will primarily focus on a deterministic setting here for our experiments; in Appendix $\mathrm { L }$ , we evaluate FedLin on a standard stochastic oracle model. Our experiments in Appendix $\mathrm { L }$ reveal that under a noisy oracle, FedLin guarantees linear convergence to a ball around the true minimum, exactly as suggested by Thm. 4.
|
| 241 |
+
|
| 242 |
+
Gradient Sparsification at Server. We first consider a variant of FedLin where gradient sparsification is implemented only at the server side and without any error-feedback. In particular, we consider the cases where $\delta _ { s } \in \{ 2 , 4 \}$ , which correspond to the implementation of a TOP-50 and a TOP-25 operator, respectively. For comparison, we also plot the resulting performance when no gradient sparsification is implemented at the server. To examine the effect of statistical heterogeneity on the performance of FedLin, we generate two synthetic datasets corresponding to two different levels of heterogeneity in the clients’ local objectives, namely $\alpha = 1 0$ and $\alpha = 5 0$ . As illustrated in Fig. 2, irrespective of the level of gradient sparsification on the server side, FedLin achieves linear convergence to the true minimum in the presence of both objective and systems heterogeneity, confirming Theorem 6. Also, both the convergence speed and accuracy of FedLin remain unaffected as the level of heterogeneity in the clients’ objective functions increases.
|
| 243 |
+
|
| 244 |
+

|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure 2: Server-side sparsification results for FedLin. The constant $\bar { \eta }$ is fixed at $1 \dot { 0 } ^ { - 2 }$ . Left: $\alpha = 1 0$ . Right: $\alpha = 5 0$ .
|
| 248 |
+
|
| 249 |
+
Gradient Sparsification at Clients. Next, we implement gradient sparsification only at the clients’ side, i.e. $\delta _ { s } ~ = ~ 1$ . In particular, we consider the cases where $\delta _ { c } \in \{ 4 / 3 , 2 \}$ , which correspond to the implementation of a TOP-75 and a TOP-50 operator, respectively. Once again, we generate two synthetic datasets with different levels of objective heterogeneity, namely $\alpha = 1$ and $\alpha = 1 0$ . As illustrated in Fig. 3, unlike the server case, FedLin with sparsification at the clients’ side converges linearly, but with a non-vanishing error that increases as the value of $\delta _ { c }$ increases. This aligns with the conclusions of Theorem 8. Furthermore, the level of objective heterogeneity has a direct impact on the convergence error. In particular, for the same level of gradient sparsification, higher levels of objective heterogeneity result in larger values of the convergence error.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 3: Client-side sparsification results for FedLin. The constant $\bar { \eta }$ is fixed at $5 \times 1 0 ^ { - 4 }$ . Left: $\alpha = 1$ . Right: $\alpha = 1 0$ .
|
| 253 |
+
Figure 4: Comparison of FedLin with SCAFFOLD. (Left) Deterministic setting. (Right) General stochastic oracle model: unbiased gradients with variance $\sigma = 1 0 ^ { - 1 }$ .
|
| 254 |
+
|
| 255 |
+
Comparison with SCAFFOLD. We now compare FedLin with SCAFFOLD on the least squares regression setup described above. To make a fair comparison, we assume that there is no systems heterogeneity or gradient compression. For implementing SCAFFOLD, we use Option II in their paper [11] for updating the control variates. We set the number of local steps $H = 2 0$ , the statistical heterogeneity parameter $\alpha = 1 0$ , and use a step-size of $1 0 ^ { - 3 }$ for both algorithms (the step-size was tuned to get best results). For the deterministic setting, we note from Fig. 4 that FedLin con
|
| 256 |
+
|
| 257 |
+
verges much faster compared to SCAFFOLD. This trend persists when we perturb the gradients with zero-mean Gaussian noise with variance $\sigma = 1 0 ^ { - 1 }$ . We conjecture that the faster convergence of FedLin stems from the fact that it uses less stale gradient correction terms relative to the control variates of SCAFFOLD; see the discussion about the fixed point property of FedLin in Sec. 3.
|
| 258 |
+
|
| 259 |
+
# 8 Conclusion
|
| 260 |
+
|
| 261 |
+
We developed a novel algorithmic framework called FedLin to tackle some of the key challenges in FL, namely objective heterogeneity, systems heterogeneity, and imprecise communication. We showed that FedLin enjoys strong theoretical guarantees: (i) FedLin matches centralized rates, and, in particular, guarantees linear convergence to the global minimum under arbitrary objective and systems heterogeneity; and (ii) preserves linear convergence rates despite aggressive gradient sparsification. We also established a tight lower-bound for FedLin, highlighting that even mild statistical heterogeneity can end up hurting convergence rates - this is the first such result in FL. Our current approach requires two passes of communication between the clients and the server in each round. Moreover, our analysis does not account for partial client participation. As future work, we plan to address these limitations. We also plan to investigate other federated learning formulations (beyond supervised learning) where statistical heterogeneity can potentially help.
|
| 262 |
+
|
| 263 |
+
Acknowledgement: This work was supported by NSF Award 1837253, NSF CAREER award CIF 1943064, and the Air Force Office of Scientific Research Young Investigator Program (AFOSR-YIP) under award FA9550-20-1-0111.
|
| 264 |
+
|
| 265 |
+
References
|
| 266 |
+
[1] Jakub Konecnˇ y, H Brendan McMahan, Daniel Ramage, and Peter Richtárik. Federated optimiza-\` tion: Distributed machine learning for on-device intelligence. arXiv preprint arXiv:1610.02527, 2016.
|
| 267 |
+
[2] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. Communication-efficient learning of deep networks from decentralized data. In Artificial Intelligence and Statistics, pages 1273–1282. PMLR, 2017.
|
| 268 |
+
[3] Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloe Kiddon, Jakub Konecnˇ y, Stefano Mazzocchi, H Brendan McMahan, et al. \` Towards federated learning at scale: System design. arXiv preprint arXiv:1902.01046, 2019.
|
| 269 |
+
[4] Peter Kairouz, H Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Keith Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, et al. Advances and open problems in federated learning. arXiv preprint arXiv:1912.04977, 2019.
|
| 270 |
+
[5] Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. Federated learning: Challenges, methods, and future directions. IEEE Signal Processing Magazine, 37(3):50–60, 2020.
|
| 271 |
+
[6] Xiang Li, Kaixuan Huang, Wenhao Yang, Shusen Wang, and Zhihua Zhang. On the convergence of fedavg on non-iid data. arXiv preprint arXiv:1907.02189, 2019.
|
| 272 |
+
[7] Grigory Malinovskiy, Dmitry Kovalev, Elnur Gasanov, Laurent Condat, and Peter Richtarik. From local sgd to local fixed-point methods for federated learning. In International Conference on Machine Learning, pages 6692–6701. PMLR, 2020.
|
| 273 |
+
[8] Zachary Charles and Jakub Konecnˇ y. On the outsized importance of learning rates in local \` update methods. arXiv preprint arXiv:2007.00878, 2020.
|
| 274 |
+
[9] Zachary Charles and Jakub Konecnˇ y. Convergence and accuracy trade-offs in federated learning \` and meta-learning. In International Conference on Artificial Intelligence and Statistics, pages 2575–2583. PMLR, 2021.
|
| 275 |
+
[10] Reese Pathak and Martin J Wainwright. Fedsplit: An algorithmic framework for fast federated optimization. arXiv preprint arXiv:2005.05238, 2020.
|
| 276 |
+
[11] Sai Praneeth Karimireddy, Satyen Kale, Mehryar Mohri, Sashank Reddi, Sebastian Stich, and Ananda Theertha Suresh. Scaffold: Stochastic controlled averaging for federated learning. In International Conference on Machine Learning, pages 5132–5143. PMLR, 2020.
|
| 277 |
+
[12] Sebastian U Stich. Local sgd converges fast and communicates little. arXiv preprint arXiv:1805.09767, 2018.
|
| 278 |
+
[13] Jianyu Wang and Gauri Joshi. Cooperative sgd: A unified framework for the design and analysis of communication-efficient sgd algorithms. arXiv preprint arXiv:1808.07576, 2018.
|
| 279 |
+
[14] Artin Spiridonoff, Alex Olshevsky, and Ioannis Ch Paschalidis. Local sgd with a communication overhead depending only on the number of workers. arXiv preprint arXiv:2006.02582, 2020.
|
| 280 |
+
[15] Amirhossein Reisizadeh, Aryan Mokhtari, Hamed Hassani, Ali Jadbabaie, and Ramtin Pedarsani. Fedpaq: A communication-efficient federated learning method with periodic averaging and quantization. In International Conference on Artificial Intelligence and Statistics, pages 2021– 2031. PMLR, 2020.
|
| 281 |
+
[16] Farzin Haddadpour, Mohammad Mahdi Kamani, Mehrdad Mahdavi, and Viveck Cadambe. Local sgd with periodic averaging: Tighter analysis and adaptive synchronization. In Advances in Neural Information Processing Systems, pages 11082–11094, 2019.
|
| 282 |
+
[17] Blake Woodworth, Kumar Kshitij Patel, Sebastian U Stich, Zhen Dai, Brian Bullins, H Brendan McMahan, Ohad Shamir, and Nathan Srebro. Is local sgd better than minibatch sgd? arXiv preprint arXiv:2002.07839, 2020.
|
| 283 |
+
[18] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. First analysis of local gd on heterogeneous data. arXiv preprint arXiv:1909.04715, 2019.
|
| 284 |
+
[19] Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. Tighter theory for local sgd on identical and heterogeneous data. In International Conference on Artificial Intelligence and Statistics, pages 4519–4529. PMLR, 2020.
|
| 285 |
+
[20] Farzin Haddadpour and Mehrdad Mahdavi. On the convergence of local descent methods in federated learning. arXiv preprint arXiv:1910.14425, 2019.
|
| 286 |
+
[21] Anastasia Koloskova, Nicolas Loizou, Sadra Boreiri, Martin Jaggi, and Sebastian U Stich. A unified theory of decentralized sgd with changing topology and local updates. arXiv preprint arXiv:2003.10422, 2020.
|
| 287 |
+
[22] Anit Kumar Sahu, Tian Li, Maziar Sanjabi, Manzil Zaheer, Ameet Talwalkar, and Virginia Smith. On the convergence of federated optimization in heterogeneous networks. arXiv preprint arXiv:1812.06127, 3, 2018.
|
| 288 |
+
[23] Jianyu Wang, Qinghua Liu, Hao Liang, Gauri Joshi, and H Vincent Poor. Tackling the objective inconsistency problem in heterogeneous federated optimization. Advances in Neural Information Processing Systems, 33, 2020.
|
| 289 |
+
[24] Alham Fikri Aji and Kenneth Heafield. Sparse communication for distributed gradient descent. arXiv preprint arXiv:1704.05021, 2017.
|
| 290 |
+
[25] Yujun Lin, Song Han, Huizi Mao, Yu Wang, and William J Dally. Deep gradient compression: Reducing the communication bandwidth for distributed training. arXiv preprint arXiv:1712.01887, 2017.
|
| 291 |
+
[26] Dan Alistarh, Demjan Grubic, Jerry Li, Ryota Tomioka, and Milan Vojnovic. Qsgd: Communication-efficient sgd via gradient quantization and encoding. Advances in Neural Information Processing Systems, 30:1709–1720, 2017.
|
| 292 |
+
[27] Wei Wen, Cong Xu, Feng Yan, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Terngrad: Ternary gradients to reduce communication in distributed deep learning. In Advances in neural information processing systems, pages 1509–1519, 2017.
|
| 293 |
+
[28] Sarit Khirirat, Hamid Reza Feyzmahdavian, and Mikael Johansson. Distributed learning with compressed gradients. arXiv preprint arXiv:1806.06573, 2018.
|
| 294 |
+
[29] Konstantin Mishchenko, Eduard Gorbunov, Martin Takác, and Peter Richtárik. Distributed ˇ learning with compressed gradient differences. arXiv preprint arXiv:1901.09269, 2019.
|
| 295 |
+
[30] Zhize Li, Dmitry Kovalev, Xun Qian, and Peter Richtárik. Acceleration for compressed gradient descent in distributed and federated optimization. arXiv preprint arXiv:2002.11364, 2020.
|
| 296 |
+
[31] Samuel Horváth, Dmitry Kovalev, Konstantin Mishchenko, Sebastian Stich, and Peter Richtárik. Stochastic distributed learning with gradient quantization and variance reduction. arXiv preprint arXiv:1904.05115, 2019.
|
| 297 |
+
[32] Farzin Haddadpour, Mohammad Mahdi Kamani, Aryan Mokhtari, and Mehrdad Mahdavi. Federated learning with compression: Unified analysis and sharp guarantees. arXiv preprint arXiv:2007.01154, 2020.
|
| 298 |
+
[33] Frank Seide, Hao Fu, Jasha Droppo, Gang Li, and Dong Yu. 1-bit stochastic gradient descent and its application to data-parallel distributed training of speech dnns. In Fifteenth Annual Conference of the International Speech Communication Association, 2014.
|
| 299 |
+
[34] Sebastian U Stich, Jean-Baptiste Cordonnier, and Martin Jaggi. Sparsified sgd with memory. In Advances in Neural Information Processing Systems, pages 4447–4458, 2018.
|
| 300 |
+
[35] Dan Alistarh, Torsten Hoefler, Mikael Johansson, Nikola Konstantinov, Sarit Khirirat, and Cédric Renggli. The convergence of sparsified gradient methods. In Advances in Neural Information Processing Systems, pages 5973–5983, 2018.
|
| 301 |
+
[36] Guannan Qu and Na Li. Harnessing smoothness to accelerate distributed optimization. IEEE Transactions on Control of Network Systems, 5(3):1245–1260, 2017.
|
| 302 |
+
[37] Angelia Nedic, Alex Olshevsky, and Wei Shi. Achieving geometric convergence for distributed optimization over time-varying graphs. SIAM Journal on Optimization, 27(4):2597–2633, 2017.
|
| 303 |
+
[38] Chenguang Xi, Ran Xin, and Usman A Khan. Add-opt: Accelerated distributed directed optimization. IEEE Transactions on Automatic Control, 63(5):1329–1339, 2017.
|
| 304 |
+
[39] Shi Pu and Angelia Nedic. Distributed stochastic gradient tracking methods. ´ Mathematical Programming, pages 1–49, 2020.
|
| 305 |
+
[40] Ran Xin, Anit Kumar Sahu, Usman A Khan, and Soummya Kar. Distributed stochastic optimization with gradient tracking over strongly-connected networks. In Proc. of the 58th IEEE Conference on Decision and Control (CDC), pages 8353–8358, 2019.
|
| 306 |
+
[41] 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.
|
| 307 |
+
[42] Eduard Gorbunov, Filip Hanzely, and Peter Richtárik. Local sgd: Unified theory and new efficient methods. In International Conference on Artificial Intelligence and Statistics, pages 3556–3564. PMLR, 2021.
|
| 308 |
+
[43] Amirhossein Reisizadeh, Isidoros Tziotis, Hamed Hassani, Aryan Mokhtari, and Ramtin Pedarsani. Straggler-resilient federated learning: Leveraging the interplay between statistical accuracy and system heterogeneity. arXiv preprint arXiv:2012.14453, 2020.
|
| 309 |
+
[44] Sanghamitra Dutta, Jianyu Wang, and Gauri Joshi. Slow and stale gradients can win the race. arXiv preprint arXiv:2003.10579, 2020.
|
| 310 |
+
[45] Jianyu Wang and Gauri Joshi. Adaptive communication strategies to achieve the best errorruntime trade-off in local-update sgd. arXiv preprint arXiv:1810.08313, 2018.
|
| 311 |
+
[46] Rawad Bitar, Mary Wootters, and Salim El Rouayheb. Stochastic gradient coding for straggler mitigation in distributed learning. IEEE Journal on Selected Areas in Information Theory, 2020.
|
| 312 |
+
[47] Nuwan Ferdinand and Stark C Draper. Anytime stochastic gradient descent: A time to hear from all the workers. In 2018 56th Annual Allerton Conference on Communication, Control, and Computing (Allerton), pages 552–559. IEEE, 2018.
|
| 313 |
+
[48] Amirhossein Reisizadeh, Hossein Taheri, Aryan Mokhtari, Hamed Hassani, and Ramtin Pedarsani. Robust and communication-efficient collaborative learning. In Advances in Neural Information Processing Systems, pages 8388–8399, 2019.
|
| 314 |
+
[49] Aleksandr Beznosikov, Samuel Horváth, Peter Richtárik, and Mher Safaryan. On biased compression for distributed learning. arXiv preprint arXiv:2002.12410, 2020.
|
| 315 |
+
[50] Nikko Strom. Scalable distributed dnn training using commodity gpu cloud computing. In Sixteenth Annual Conference of the International Speech Communication Association, 2015.
|
| 316 |
+
[51] Sai Praneeth Karimireddy, Quentin Rebjock, Sebastian U Stich, and Martin Jaggi. Error feedback fixes signsgd and other gradient compression schemes. arXiv preprint arXiv:1901.09847, 2019.
|
| 317 |
+
[52] Sebastian U Stich and Sai Praneeth Karimireddy. The error-feedback framework: Better rates for sgd with delayed gradients and compressed communication. arXiv preprint arXiv:1909.05350, 2019.
|
| 318 |
+
[53] Eduard Gorbunov, Dmitry Kovalev, Dmitry Makarenko, and Peter Richtárik. Linearly converging error compensated sgd. Advances in Neural Information Processing Systems, 33, 2020.
|
| 319 |
+
[54] Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013.
|
| 320 |
+
[55] Sébastien Bubeck. Convex optimization: Algorithms and complexity. arXiv preprint arXiv:1405.4980, 2014.
|
| 321 |
+
[56] Horia Mania, Xinghao Pan, Dimitris Papailiopoulos, Benjamin Recht, Kannan Ramchandran, and Michael I Jordan. Perturbed iterate analysis for asynchronous stochastic optimization. SIAM Journal on Optimization, 27(4):2202–2229, 2017.
|
| 322 |
+
|
| 323 |
+
# Checklist
|
| 324 |
+
|
| 325 |
+
1. For all authors...
|
| 326 |
+
|
| 327 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 328 |
+
(b) Did you describe the limitations of your work? [Yes] We provide a lower bound for our algorithm in Theorem 5 of Section 4.1 that suggests the need for more informed local updating schemes.
|
| 329 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] We could not think of any potential negative societal impacts.
|
| 330 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 331 |
+
|
| 332 |
+
2. If you are including theoretical results...
|
| 333 |
+
|
| 334 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] We provide complete proofs of all our results in the supplemental material.
|
| 335 |
+
|
| 336 |
+
3. If you ran experiments...
|
| 337 |
+
|
| 338 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No]
|
| 339 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 340 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 341 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No]
|
| 342 |
+
|
| 343 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 344 |
+
|
| 345 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 346 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 347 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 348 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 349 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 350 |
+
|
| 351 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 352 |
+
|
| 353 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 354 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 355 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/kB8DkEKSDH/kB8DkEKSDH.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HELLINGER DISTANCE CONSTRAINED REGRESSION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper introduces an off-policy reinforcement learning method that uses Hellinger distance between sampling policy (from what samples were collected) and current policy (policy being optimized) as a constraint. Hellinger distance squared multiplied by two is greater than or equal to total variation distance squared and less than or equal to Kullback-Leibler divergence, therefore a lower bound for expected discounted return for the new policy is improved compared to the lower bound for training with KL. Also, Hellinger distance is less than or equal to 1, so there is a policy-independent lower bound for expected discounted return. HDCR is capable of training with Experience Replay, a common setting for distributed RL when collecting trajectories using different policies and learning from this data centralized. HDCR shows results comparable to or better than Advantage-weighted Behavior Model and Advantage-Weighted Regression on MuJoCo tasks using tiny offline datasets collected by random agents. On bigger datasets ( $1 0 0 \mathrm { k }$ timesteps) obtained by pretrained behavioral policy, HDCR outperforms ABM and AWR methods on 3 out of 4 tasks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Policy gradient algorithms are methods of model-free reinforcement learning that optimize policy through differentiating expected discounted return. Despite the simplicity, to converge, these methods should stay on-policy because of the first-order approximation of state visitation frequencies. This issue makes agents learn through trial-and-error, using data only once.
|
| 12 |
+
|
| 13 |
+
To make policy gradient updates more off-policy, we can add a constraint on the update to decrease the step size if the current policy is too far from the sampling policy. One of the first methods was to add total variation distance squared as a constraint for mixture policies. Later it was proven that there is a lower bound for new policy’s expected discounted return (Kakade & Langford, 2002). Recently it was proven that this lower bound exists for all types of updates (Schulman et al., 2015).
|
| 14 |
+
|
| 15 |
+
Next, total variation distance squared was replaced by Kullback-Leibler divergence that is greater than or equal to the previous one (Pinker’s inequality (Levin & Peres, 2017)), so that the lower bound was decreased (Schulman et al., 2015). Using Lagrangian, have been derived off-policy method called Advantage-Weighted Regression (Peng et al., 2019), which also used KL as a constraint.
|
| 16 |
+
|
| 17 |
+
This article proposes a new method whose lower bound of expected discounted return is greater than or equal to the bound with KL. We achieve this by replacing total variation distance by Hellinger distance, which decreases lower bound. Therefore strictness stays the same. Then we derive an offpolicy method called Hellinger Distance Constrained Regression using the new constraint. It can be used on discrete and continuous action spaces since derivation uses Lebesgue integrals rather than a summation or Riemann integrals.
|
| 18 |
+
|
| 19 |
+
# 2 PRELIMINARIES
|
| 20 |
+
|
| 21 |
+
To better present the problem, we start from basic definitions, go through the history of improvements, and then describe the disadvantages of using KL divergence as a constraint.
|
| 22 |
+
|
| 23 |
+
We consider an infinite-horizon discounted Markov decision process (MDP), defined by the tuple $( \mathcal { S } , \ \mathcal { A } , \ P , \ r , \ \rho _ { 0 } , \ \gamma )$ , where $s$ is a set of states (finite or infinite), $\mathcal { A }$ is a set of actions (finite or infinite), $P : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \to \mathbb { R }$ is the transition probability distribution, $r : \mathcal { S } \ \to \ \mathbb { R }$ is
|
| 24 |
+
|
| 25 |
+
the reward function, $\rho _ { 0 } : \mathcal { S } \ \to \ \mathbb { R }$ is the distribution of the initial state $s _ { 0 }$ , and $\gamma ~ \in ~ ( 0 , 1 )$ is the discount factor.
|
| 26 |
+
|
| 27 |
+
Let $\pi$ denote a stochastic policy $\pi : \mathcal { S } \times \mathcal { A } \to [ 0 , 1 ]$ , and then its expected discounted return is:
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\begin{array} { r l } & { \eta ( \pi ) = \mathbb { E } _ { s _ { 0 } , a _ { 0 } , \ldots } \left[ \displaystyle \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r ( s _ { t } ) \right] \mathrm { , ~ w h e r e } } \\ & { s _ { 0 } \sim \rho _ { 0 } ( \cdot ) \mathrm { , ~ } a _ { t } \sim \pi ( \cdot | s _ { t } ) \mathrm { , ~ } s _ { t + 1 } \sim P ( \cdot | s _ { t } , a _ { t } ) \mathrm { . } } \end{array}
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
This paper uses state-action value function $Q _ { \pi }$ , state value function $V _ { \pi }$ , and advantage function $A _ { \pi }$ with the following definitions:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { c l } { \displaystyle Q _ { \pi } ( s _ { t } , a _ { t } ) = \mathbb { E } _ { s _ { t + 1 } , a _ { t + 1 } , \dots } \left[ \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } r ( s _ { t + l } ) \right] } \\ { \displaystyle V _ { \pi } ( s _ { t } ) = \mathbb { E } _ { a _ { t } , s _ { t + 1 } , a _ { t + 1 } , \dots } \left[ \sum _ { l = 0 } ^ { \infty } \gamma ^ { l } r ( s _ { t + l } ) \right] } \\ { \displaystyle A _ { \pi } ( s _ { t } , a _ { t } ) = Q _ { \pi } ( s _ { t } , a _ { t } ) - V _ { \pi } ( s _ { t } ) . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Let $\rho _ { \pi } ( s )$ be unnormalized visitation frequencies of state $s$ where actions are chosen according to $\pi$ :
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\rho _ { \pi } ( s ) = \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } P ( s _ { t } = s ) .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Following identity expresses the expected return of another policy $\tilde { \pi }$ in terms of the advantage over $\pi$ accumulated over states (see Schulman et al. (2015) for proof):
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\eta ( \tilde { \pi } ) = \eta ( \pi ) + \int \rho _ { \tilde { \pi } } ( s ) \int \tilde { \pi } ( a | s ) A _ { \pi } ( s , a ) d a d s .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
In approximately optimal learning, we replace state visitation frequency $\rho _ { \tilde { \pi } }$ by $\rho _ { \pi }$ , since this drastically decrease optimization complexity:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
L _ { \pi } ( \tilde { \pi } ) = \eta ( \pi ) + \int \rho _ { \pi } ( s ) \int \tilde { \pi } ( a | s ) A _ { \pi } ( s , a ) d a d s .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Let $\pi _ { o l d }$ denote current policy, then the lower bound for the expected discounted return for the new policy $\pi _ { n e w }$ will be (see Schulman et al. (2015) for proof):
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\begin{array} { r l r } { { \eta ( \pi _ { n e w } ) \geq L _ { \pi _ { o l d } } ( \pi _ { n e w } ) - \frac { 4 \epsilon \gamma } { ( 1 - \gamma ) ^ { 2 } } \alpha ^ { 2 } } } \\ & { } & { \mathrm { w h e r e } \epsilon = \operatorname* { m a x } _ { s , a } \vert A _ { \pi } ( s , a ) \vert , } \\ & { } & { \alpha = \operatorname* { m a x } _ { s } D _ { T V } ( \pi _ { o l d } ( \cdot \vert s ) \vert \vert \pi _ { n e w } ( \cdot \vert s ) ) , } \\ & { } & { D _ { T V } ( \pi _ { o l d } ( \cdot \vert s ) \vert \vert \pi _ { n e w } ( \cdot \vert s ) ) = \displaystyle \frac { 1 } { 2 } \int \pi _ { o l d } ( a \vert s ) - \pi _ { n e w } ( a \vert s ) d a . } \end{array}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
Theoretical Trust-Region Policy Optimization algorithm relays on Pinsker’s inequality (see (Tsybakov, 2009) for proof):
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { c } { { \displaystyle D _ { K L } ( \pi _ { o l d } ( \cdot | s ) | | \pi _ { n e w } ( \cdot | s ) ) \geq D _ { T V } ( \pi _ { o l d } ( \cdot | s ) | | \pi _ { n e w } ( \cdot | s ) ) ^ { 2 } } } \\ { { \mathrm { w h e r e ~ } D _ { K L } ( \pi _ { o l d } ( \cdot | s ) | | \pi _ { n e w } ( \cdot | s ) ) = \displaystyle \int \pi _ { o l d } ( a | s ) \log \frac { \pi _ { o l d } ( a | s ) } { \pi _ { n e w } ( a | s ) } d a . } } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
To retain strictness and decrease calculation complexity, total variation distance squared was replaced with Kullback-Leibler divergence $D _ { K L } ( \pi _ { o l d } ( \cdot | s ) | | \pi _ { n e w } ( \cdot | s ) )$ :
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r l r } { { \eta ( \pi _ { n e w } ) \geq L _ { \pi _ { o l d } } ( \pi _ { n e w } ) - C D _ { K L } ^ { m a x } ( \pi _ { o l d } | | \pi _ { n e w } ) } } \\ & { } & { \mathrm { w h e r e } \ \epsilon = \operatorname* { m a x } _ { s , a } | A _ { \pi } ( s , a ) | , } \\ & { } & { C = \frac { 4 \epsilon \gamma } { ( 1 - \gamma ) ^ { 2 } } , } \\ & { } & { D _ { K L } ^ { m a x } ( \pi _ { o l d } | | \pi _ { n e w } ) = \operatorname* { m a x } _ { s } D _ { K L } ( \pi _ { o l d } ( \cdot | s ) | | \pi _ { n e w } ( \cdot | s ) ) . } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
However, this replacement greatly decreases the lower bound for the expected discounted return for the new policy. Moreover, Kullback-Leibler divergence has no upper bound. Therefore we have no policy-independent lower bound for this type of update.
|
| 76 |
+
|
| 77 |
+
# 3 HELLINGER DISTANCE IN POLICY OPTIMIZATION
|
| 78 |
+
|
| 79 |
+
We can improve lower bound (compared to KL) by replacing $D _ { T V } ( \pi _ { o l d } ( \cdot \mid s ) \mid \mid \pi _ { n e w } ( \cdot \mid s ) )$ with Hellinger distance $H ( \pi _ { o l d } ( \cdot | s ) \mid \mid \pi _ { n e w } ( \cdot \mid s ) )$ :
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
H ( \pi _ { o l d } ( \cdot | s ) \mid | \pi _ { n e w } ( \cdot | s ) ) ^ { 2 } = 1 - \int \sqrt { \pi _ { o l d } ( a | s ) \pi _ { n e w } ( a | s ) } d a
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Theorem 1 (see Appendix A or (Tsybakov, 2009, section 2.4) for proof) proves correctness and improvement (compared to KL) to the lower bound.
|
| 86 |
+
|
| 87 |
+
Let $p ( v )$ and $q ( v )$ be two probability density functions then:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
D _ { T V } ( p ( \cdot ) \mid \mid q ( \cdot ) ) ^ { 2 } \leq 2 H ( p ( \cdot ) \mid \mid q ( \cdot ) ) ^ { 2 } \leq D _ { K L } ( p ( \cdot ) \mid \mid q ( \cdot ) )
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Replacing $p ( v )$ and $q ( v )$ with $\pi _ { o l d } ( \cdot \mid s )$ and $\pi _ { n e w } ( \cdot \mid s )$ respectively, new lower bound follows:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\begin{array} { r l } & { \eta ( \pi _ { n e w } ) \geq L _ { \pi _ { o l d } } ( \pi _ { n e w } ) - \frac { 8 \epsilon \gamma } { ( 1 - \gamma ) ^ { 2 } } \alpha ^ { 2 } } \\ & { \mathrm { ~ w h e r e ~ } \epsilon = \displaystyle \operatorname* { m a x } _ { s , a } | A _ { \pi } ( s , a ) | , } \\ & { \quad \quad \quad \alpha = \displaystyle \operatorname* { m a x } _ { s } H ( \pi _ { o l d } ( \cdot | s ) | | \pi _ { n e w } ( \cdot | s ) ) } \end{array}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
It is worth to note that $H ( \pi _ { o l d } ( \cdot \mid s ) \mid \mid \pi _ { n e w } ( \cdot \mid s ) ) \leq 1 .$
|
| 100 |
+
|
| 101 |
+
# 4 HELLINGER DISTANCE CONSTRAINED REGRESSION (HDCR)
|
| 102 |
+
|
| 103 |
+
We could use presented lower bound as in TRPO, but instead, we derive an offline regression algorithm by introducing the following optimization problem where $\mu$ is the sampling policy:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r l } { { \arg \operatorname* { m a x } _ { \pi } \int \rho _ { \mu } ( s ) \int \pi ( a \vert s ) A _ { \mu } ( s , a ) d a d s } } \\ & { \quad \mathrm { s . t . } \int \rho _ { \mu } ( s ) H ( \pi ( \cdot \vert s ) \vert \vert \mu ( \cdot \vert s ) ) d s \leq \epsilon , } \\ & { \quad \quad \quad \int \pi ( a \vert s ) d a = 1 , \forall s \in \mathcal S . } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Constructing Lagrangian, differentiating it with respect to $\pi$ , and solving for $\pi$ gives us the following optimal policy (see Appendix $\mathbf { B }$ for derivation):
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\pi ^ { * } ( a | s ) = \mu ( a | s ) { \frac { \beta ^ { 2 } } { ( \beta - 2 A _ { \mu } ( s , a ) ) ^ { 2 } } } , { \mathrm { w h e r e ~ } } \beta { \mathrm { ~ i s ~ a ~ L a g r a n g i a n ~ m u l t i p l i e r . } }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
Constructing a regression problem of $\mathrm { K L }$ divergence between optimal policy $\pi ^ { * }$ and current policy $\pi$ and simplifying gives us the following supervised regression problem (see Appendix $\mathbf { B }$ for derivation):
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\underset { \pi } { \arg \operatorname* { m a x } } \mathbb { E } _ { s \sim \rho _ { \mu } ( \cdot ) } \mathbb { E } _ { a \sim \mu ( \cdot \vert s ) } \log \pi ( a \vert s ) \frac { 1 } { ( \beta - A _ { \mu } ( s , a ) ) ^ { 2 } }
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
Using notation of ABM paper (Siegel et al., 2020) ”advantage-weighting” function is f (A(s, a)) = 1(β−A(s,a))2 .
|
| 122 |
+
|
| 123 |
+
If we use HDCR with Experience Replay, in equation 14, we replace $\mu ( \cdot | s )$ in expectation $\mathbb { E } _ { a } \sim \mu ( \cdot \mid s )$ and advantage function $A _ { \mu } ( s , \ a )$ . Let $\begin{array} { r c l } { \Pi } & { = } & { \{ \pi _ { i } , \ \bar { \pi _ { i + 1 } } , \ \xrightarrow [ ] { } \ \pi _ { i + N } \} } \end{array}$ be a set of sampling policies from which actions were sampled, $w ( \pi _ { i } )$ probability of selecting policy $\pi _ { i }$ , then:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { c l l } { { } } & { { } } & { { \displaystyle \mu ( s , a ) = \int _ { \Pi } w ( \pi ) \rho _ { \pi } ( s ) \pi ( a | s ) ~ d \pi } } \\ { { } } & { { } } & { { \displaystyle A _ { \mu } ( s , a ) = \frac { \int _ { \Pi } w ( \pi ) \rho _ { \pi } ( s ) ~ ( Q _ { \pi } ( s , a ) - V _ { \pi } ( s ) ) ~ d \pi } { \int _ { \Pi } w ( \pi ) \rho _ { \pi } ( s ) ~ d \pi } } } \\ { { } } & { { } } & { { \displaystyle \overline { { { V } } } ( s ) = \frac { \int _ { \Pi } w ( \pi ) \rho _ { \pi } ( s ) V _ { \pi } ( s ) ~ d \pi } { \int _ { \Pi } w ( \pi ) \rho _ { \pi } ( s ) ~ d \pi } } } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
The proof will repeat the proof for AWR with Experience Replay (Peng et al., 2019).
|
| 130 |
+
|
| 131 |
+
Practically we simply sample uniformly from the replay buffer and using a value function estimator.
|
| 132 |
+
This type of sampling provides us an approximation of expectation and state value function.
|
| 133 |
+
|
| 134 |
+
Let $\mathcal { D }$ denote a set of stored trajectories (replay buffer), $A ( s , a ; \phi )$ is an advantage function parameterized by vector $\phi$ .
|
| 135 |
+
|
| 136 |
+
The most popular method to obtain $A ( s , a ; \phi )$ for offline learning is to use state-action function estimator $Q ( s , a ; \phi )$ parameterized by $\phi$ :
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
A ( s , a ; \phi ) = Q ( s , a ; \phi ) - \int \pi ( a ^ { \prime } | s ; \theta _ { k } ) Q ( s , a ^ { \prime } ; \phi _ { k } ) d a ^ { \prime }
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Despite $Q ( s , a ; \phi )$ being closer to the expectation of discounted return following policy $\pi$ (because of ”taking” the first action according to $\pi$ rather then $\mu$ ), we found Monte-Carlo return more efficient on tiny offline datasets. Greater performance using MC return can be explained by a lack of experience ”produced” by certain actions.
|
| 143 |
+
|
| 144 |
+
Monte-Carlo estimation of $A ( s , a ; \phi )$ can be described as follows where $\begin{array} { r } { \mathcal { R } _ { s _ { t } , a _ { t } } ^ { \mathcal { D } } ~ = ~ \sum _ { l = 0 } ^ { T } \gamma ^ { l } r _ { t + l } } \end{array}$ is a state value function estimator parameterized by vector
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
A ( s , a ; \phi ) = \mathcal { R } _ { s , a } ^ { \mathcal { D } } - V ( s ; \phi )
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Also, we can use Generalized Advantage Estimation (Schulman et al., 2016), where $\gamma \in \ [ 0 , 1 ]$ and $\delta _ { t } ^ { \phi _ { k } }$ is a one-step temporal difference for state $s _ { t }$ calculated using old vector $\phi _ { k }$ :
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\begin{array} { c } { { \delta _ { t } ^ { \phi _ { k } } = r _ { t } + \gamma V ( s _ { t + 1 } ; \phi _ { k } ) - V ( s _ { t } ; \phi _ { k } ) } } \\ { { { } } } \\ { { \displaystyle \hat { A } ( s _ { t } , a _ { t } ; \phi _ { k } ) = \sum _ { l = 0 } ^ { T } ( \gamma \lambda ) ^ { l } \delta _ { t + l } ^ { \phi _ { k } } } } \\ { { { } } } \\ { { { } A ( s _ { t } , a _ { t } ; \phi ) = \hat { A } ( s _ { t } , a _ { t } ; \phi _ { k } ) + V ( s _ { t } ; \phi _ { k } ) - V ( s _ { t } ; \phi ) } } \end{array}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
Finally, we propose the following reinforcement learning algorithm:
|
| 157 |
+
|
| 158 |
+
# Algorithm 1: Hellinger Distance Constrained Regression
|
| 159 |
+
|
| 160 |
+
<table><tr><td>0←randominitial weights D↑の</td></tr><tr><td>for iteration k = 1,..., kmax do add trajectories {Ti} sampled via π0k to D</td></tr><tr><td>Φk+1 ← arg minf Es,a~DA²(s,a;)</td></tr><tr><td>0k+1 ← arg maxθ Es,a~D [logTe(a|s)(β-A(s,a;Φx))] end</td></tr></table>
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 1: Learning curves of ABM, AWR, and HDCR averaged across results of learning from 10 different datasets of 10k timestamps (also 5 seeds used to generate each dataset).
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>ABM</td><td rowspan=1 colspan=1>AWR</td><td rowspan=1 colspan=1>HDCR (Ours)</td></tr><tr><td rowspan=1 colspan=1>Ant-v2</td><td rowspan=1 colspan=1>468±72</td><td rowspan=1 colspan=1>495 ± 84</td><td rowspan=1 colspan=1>569± 64</td></tr><tr><td rowspan=1 colspan=1>HalfCheetah-v2</td><td rowspan=1 colspan=1>-7±3</td><td rowspan=1 colspan=1>-7±4</td><td rowspan=1 colspan=1>-8±6</td></tr><tr><td rowspan=1 colspan=1>Hopper-v2</td><td rowspan=1 colspan=1>184 ± 72</td><td rowspan=1 colspan=1>209 ± 31</td><td rowspan=1 colspan=1>223±141</td></tr><tr><td rowspan=1 colspan=1>Walker2d-v2</td><td rowspan=1 colspan=1>132 ± 76</td><td rowspan=1 colspan=1>125 ± 92</td><td rowspan=1 colspan=1>145 ± 117</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 1: Final returns for different algorithms, with $\pm$ corresponding to one standard deviation of the average return across 10 datasets of 10k timestamps.
|
| 168 |
+
|
| 169 |
+
# 5 EXPERIMENTS
|
| 170 |
+
|
| 171 |
+
In our experiments, we evaluate the algorithm on MuJoCo (Todorov et al., 2012) tasks.
|
| 172 |
+
|
| 173 |
+
# 5.1 TINY DATASETS
|
| 174 |
+
|
| 175 |
+
For evaluating on extremely small datasets we use setting inspired by Behavioral Modelling Priors for Offline Reinforcement Learning paper (Siegel et al., 2020) but instead of using actions from a behaviorial policy we use random actions while generating buffer.
|
| 176 |
+
|
| 177 |
+
First, we collect 2048 timestamps or more, until episode termination (whichever occurred later), from each of 5 seeds using random actions. Then we load collected trajectories to a replay buffer for the agent training. Separate networks with the same architecture (except the last layer) represent the policy and value function and consist of 2 hidden layers of 256 ELU units. Each train iteration uses only old data obtained by random agents. Each iteration, the value function is updating with 5 gradient steps and policy with 50 steps using a uniformly sampled batches of 512 samples using all data from the replay buffer. Learning rates for Adam optimizer are $2 \times 1 0 ^ { - 3 }$ and $2 \times 1 \bar { 0 } ^ { - 4 }$ for critic and actor, respectively.
|
| 178 |
+
|
| 179 |
+
We compare 3 different ”advantage-weight” functions $f ( A ( s , a ) )$ :
|
| 180 |
+
|
| 181 |
+
• Hellinger Distance Constrained Regression, where f (A(s, a)) = 1(β−A(s,a))2 ; • Advantage-weighted Behavior Model, where $f ( A ( s , a ) ) = I _ { A ( s , a ) > 0 }$ , $I _ { x > 0 } = 1$ if $x > 0$ otherwise $I _ { x > 0 } = 0$ ; • Advantage-Weighted Regression, where $\begin{array} { r } { f ( A ( s , a ) ) = \exp ( \frac { 1 } { \beta } A ( s , a ) ) } \end{array}$ .
|
| 182 |
+
|
| 183 |
+
AWR method uses $\beta = 1 . 0$ as it is in implementation released by authors. HDCR uses $\beta = 1 . 0$ . For $\mathrm { T D } ( \lambda )$ we use $\lambda = 0 . 9 5$ .
|
| 184 |
+
|
| 185 |
+
On simple tasks as Hopper-v2, all methods are able to learn (Figure 1), and HDCR shows slightly better results (Table 1). While on difficult tasks as Ant-v2, all algorithms do not improve their results through iterations. Moreover, evaluation returns decrease.
|
| 186 |
+
|
| 187 |
+
# 5.2 LARGE DATASETS
|
| 188 |
+
|
| 189 |
+
Next, we perform tests using buffers with the size of 100k timesteps. Buffer is filled by running a pretrained behavioral policy. This setting replicates the setting from Off-Policy Deep Reinforce
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 2: Curves of BCQ, ABM, AWR, and HDCR evaluation results averaged across 3 seeds.
|
| 193 |
+
|
| 194 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>ABM</td><td rowspan=1 colspan=1>AWR</td><td rowspan=1 colspan=1>HDCR (Ours)</td></tr><tr><td rowspan=1 colspan=1>Ant-v2</td><td rowspan=1 colspan=1>179 ± 45</td><td rowspan=1 colspan=1>281± 25</td><td rowspan=1 colspan=1>217 ± 54</td></tr><tr><td rowspan=1 colspan=1>HalfCheetah-v2</td><td rowspan=1 colspan=1>3358 ± 76</td><td rowspan=1 colspan=1>3365 ± 193</td><td rowspan=1 colspan=1>3485± 205</td></tr><tr><td rowspan=1 colspan=1>Hopper-v2</td><td rowspan=1 colspan=1>495 ± 115</td><td rowspan=1 colspan=1>478±94</td><td rowspan=1 colspan=1>576± 123</td></tr><tr><td rowspan=1 colspan=1>Walker2d-v2</td><td rowspan=1 colspan=1>592 ± 139</td><td rowspan=1 colspan=1>762 ± 64</td><td rowspan=1 colspan=1>805± 62</td></tr></table>
|
| 195 |
+
|
| 196 |
+
Table 2: Final returns for different algorithms, with $\pm$ corresponding to one standard deviation of the average return across 3 seeds.
|
| 197 |
+
|
| 198 |
+
ment Learning without Exploration (Fujimoto et al., 2019) paper. Therefore we also provide results of BCQ method achieved by authors’ implementation trained from the same datasets. For calculating advantage we use equation 16 where we approximate integral by taking mean of $1 0 \ \mathrm { Q }$ -values obtained by 10 actions sampled from the policy.
|
| 199 |
+
|
| 200 |
+
While BCQ outperforms all the presented methods, it uses a gradient of Q-value function in actor training, which provides better generalization. This provides better results on evaluation but affects stability and performance. Against other methods that update the policy function directly, HDCR shows better results on 3 environments out of 4 (Figure 2 and Table 2).
|
| 201 |
+
|
| 202 |
+
# 6 DISCUSSION
|
| 203 |
+
|
| 204 |
+
We theoretically proved that Hellinger distance improves the lower bound of expected discounted return compared to Kullback-Leibler divergence and proposed a simple off-policy reinforcement learning method that uses Hellinger distance as a constraint. The expected discounted return for a new policy now has a policy-independent lower bound. This bound guarantees that return will not decrease in ”one” shot.
|
| 205 |
+
|
| 206 |
+
Experiments show that HDCR outperforms both ABM and AWR on tiny datasets obtained by random agents. This performance proves the efficiency of using Hellinger distance by allowing bigger step sizes, retaining lower bound.
|
| 207 |
+
|
| 208 |
+
On bigger datasets, HDCR shows comparable or better results than AWR and ABM.
|
| 209 |
+
|
| 210 |
+
# REFERENCES
|
| 211 |
+
|
| 212 |
+
Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration, 2019.
|
| 213 |
+
|
| 214 |
+
Sham Kakade and John Langford. Approximately optimal approximate reinforcement learning. In Proceedings of the Nineteenth International Conference on Machine Learning, ICML ’02, pp. 267–274, San Francisco, CA, USA, 2002. Morgan Kaufmann Publishers Inc. ISBN 1558608737.
|
| 215 |
+
|
| 216 |
+
David Levin and Yuval Peres. Markov Chains and Mixing Times. 2017. doi: 10.1090/mbk/107.
|
| 217 |
+
|
| 218 |
+
Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning, 2019.
|
| 219 |
+
|
| 220 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. volume 37 of Proceedings of Machine Learning Research, pp. 1889–1897,
|
| 221 |
+
|
| 222 |
+
Lille, France, 07–09 Jul 2015. PMLR. URL http://proceedings.mlr.press/v37/ schulman15.html.
|
| 223 |
+
|
| 224 |
+
John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. Highdimensional continuous control using generalized advantage estimation. In Proceedings of the International Conference on Learning Representations (ICLR), 2016.
|
| 225 |
+
|
| 226 |
+
Noah Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdolmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavior modelling priors for offline reinforcement learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $=$ rke7geHtwH.
|
| 227 |
+
|
| 228 |
+
E. Todorov, T. Erez, and Y. Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033, 2012.
|
| 229 |
+
|
| 230 |
+
Alexandre B. Tsybakov. Introduction to Nonparametric Estimation. Springer New York, 2009. doi: 10.1007/b13794. URL https://doi.org/10.1007%2Fb13794.
|
| 231 |
+
|
| 232 |
+
# A THEOREM 1 PROOF
|
| 233 |
+
|
| 234 |
+
Let $( \Omega , A )$ be a measurable space, $P$ and $Q$ be two probability measures on that space, $v$ be a $\sigma$ -finite measure on $( \Omega , A )$ such that $P \ll v ( P ( A ) = 0$ for any $A \in { \mathcal { A } }$ such that $\mu ( A ) = 0 ,$ ) and $Q \ll v$ . And let us denote Radon–Nikodym derivatives (in our derivations we can assume them as probability density functions) as follows:
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\begin{array} { c } { p = \displaystyle \frac { d P } { d v } } \\ { q = \displaystyle \frac { d Q } { d v } } \end{array}
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
So, $p$ and $q$ satisfy following conditions:
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\begin{array} { l } { { P ( A ) = \displaystyle \int _ { A } p ( v ) ~ d v ~ \forall A \in { \mathcal A } } } \\ { { Q ( A ) = \displaystyle \int _ { A } q ( v ) ~ d v ~ \forall A \in { \mathcal A } } } \end{array}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
Then we define distances between probability measures:
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
\begin{array} { l } { { \displaystyle D _ { T V } ( P \parallel Q ) = \operatorname* { s u p } _ { A \in \mathcal { A } } | P ( A ) - Q ( A ) | } } \\ { { \displaystyle H ( P \parallel Q ) ^ { 2 } = \frac { 1 } { 2 } \int ( \sqrt { p ( v ) } - \sqrt { q ( v ) } ) ^ { 2 } d v = 1 - \int \sqrt { p ( v ) q ( v ) } d v } } \\ { { \displaystyle D _ { K L } ( P \parallel Q ) = \int \log \frac { d P } { d Q } d P = \int p ( v ) \log \frac { p ( v ) } { q ( v ) } d v } } \end{array}
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
Following Lemmas will be used in Theorem 1 proof:
|
| 253 |
+
|
| 254 |
+
Lemma 1. Given two probability distributions $p$ and $q$ total variance divergence can be calculated as follows:
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
D _ { T V } ( P \parallel Q ) = \operatorname* { s u p } _ { A \in { \mathcal A } } \left| P ( A ) - Q ( A ) \right| = \frac 1 2 \int \left| p ( v ) - q ( v ) \right| d v
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { c } { { P ( A ) - Q ( A ) \leq P ( A \cap B ) - Q ( A \cap B ) \leq P ( B ) - Q ( B ) } } \\ { { P ( A ) - Q ( A ) \leq Q ( A \cap B ^ { c } ) - P ( A \cap B ^ { c } ) \leq Q ( B ^ { c } ) - P ( B ^ { c } ) } } \\ { { \displaystyle \operatorname* { s u p } _ { A \in { \cal A } } | P ( A ) - Q ( A ) | = P ( B ) - Q ( B ) = Q ( B ^ { c } ) - P ( B ^ { c } ) } } \\ { { \displaystyle D _ { T V } ( P \mid \mid Q ) = \frac { 1 } { 2 } [ P ( B ) - Q ( B ) + Q ( B ^ { c } ) - P ( B ^ { c } ) ] } } \\ { { \displaystyle \qquad = \frac { 1 } { 2 } \int \left| p ( v ) - q ( v ) \right| d v } } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
Lemma 2.
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
D _ { T V } ( P \mid | Q ) = 1 - \int \operatorname* { m i n } ( p ( v ) , q ( v ) ) \ d v
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
Proof.
|
| 271 |
+
|
| 272 |
+
$$
|
| 273 |
+
\begin{array} { l } { { \displaystyle D _ { T V } ( P \mid \mid Q ) = \frac { 1 } { 2 } \int \left. p ( v ) - q ( v ) \right. d v = \int _ { \{ v : p ( v ) > q ( v ) \} } [ p ( v ) - q ( v ) ] d v } } \\ { { \displaystyle \qquad = 1 - \int _ { \{ v : p ( v ) < q ( v ) \} } p ( v ) d v - \int _ { \{ v : p ( v ) > q ( v ) \} } q ( v ) d v } } \\ { { \displaystyle \qquad = 1 - \int \operatorname* { m i n } ( p ( v ) , q ( v ) ) d v } } \end{array}
|
| 274 |
+
$$
|
| 275 |
+
|
| 276 |
+
Lemma 3.
|
| 277 |
+
|
| 278 |
+
$$
|
| 279 |
+
\int \operatorname* { m a x } ( p ( v ) , q ( v ) ) d v + \int \operatorname* { m i n } ( p ( v ) , q ( v ) ) d v = 2
|
| 280 |
+
$$
|
| 281 |
+
|
| 282 |
+
Proof. Rewriting left part in 4 integrals over following sets $\begin{array} { r l r } { \{ \operatorname* { m a x } ( p ( v ) , q ( v ) ) } & { { } = { } } & { p ( v ) \} } \end{array}$ , $\{ \operatorname* { m a x } ( p ( v ) , q ( v ) ) ~ = ~ \bar { q } ( v ) \}$ , $\{ \operatorname* { m i n } ( \bar { p ( \boldsymbol { v } ) } , \boldsymbol { q } ( \boldsymbol { v } ) ) = q ( \boldsymbol { v } ) \bar \}$ and $\{ \operatorname* { m i n } ( p ( v ) , q ( v ) ) \ = \ q ( v ) \}$ and stacking integrals back gives us $P ( \Omega ) + Q ( \Omega ) = 2$ . □
|
| 283 |
+
|
| 284 |
+
Theorem 1. For any two probability density functions $p$ and $q$ , the following double inequality is true:
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
D _ { T V } ( p \vert \vert q ) ^ { 2 } \leq 2 H ( p \vert \vert q ) ^ { 2 } \leq D _ { K L } ( p \vert \vert q )
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
Proof. First inequality can be proved as follows:
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { r l } { ( 1 - H ( P | | Q | ^ { 2 } ) ^ { 2 } ) = \left[ \int \sqrt { p ( v ) q ( v ) } d v \right] ^ { 2 } } \\ & { = \left[ \int \sqrt { \operatorname* { m i n } ( p ( v ) , q ( v ) ) \operatorname* { m a x } ( p ( v ) , q ( v ) ) } d v \right] ^ { 2 } } \\ & { \leq \int \operatorname* { m i n } ( p ( v ) , q ( v ) ) d v \int \operatorname* { m a x } ( p ( v ) , q ( v ) ) d v } \\ & { = \int \operatorname* { m i n } ( p ( v ) , q ( v ) ) d v \left[ 2 - \int \operatorname* { m i n } ( p ( v ) , q ( v ) ) d v \right] } \\ & { = ( 1 - D _ { T V } ( P | | Q ) ) ( 1 + D _ { T V } ( P | | Q ) ) } \\ & { = 1 - D _ { T V } ( P | | Q ) ^ { 2 } } \\ { D v _ { T V } ( P | | Q ) ^ { 2 } \leq H ( P | | Q ) ^ { 2 } ( 2 - H ( P | | Q ) ^ { 2 } ) } \\ & { D _ { T V } ( P | | Q ) ^ { 2 } \leq 2 H ( P | | Q ) ^ { 2 } . } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
Proof of the second inequality:
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { r l } & { D _ { K L } ( P \parallel Q ) = \displaystyle \int p ( v ) \log \frac { p ( v ) } { q ( v ) } d v = 2 \int p ( v ) \log \sqrt { \frac { p ( v ) } { q ( v ) } } d v } \\ & { \qquad = - 2 \int p ( v ) \log \left( \left[ \sqrt { \frac { q ( v ) } { p ( v ) } } - 1 \right] + 1 \right) d v } \\ & { \qquad \geq - 2 \int p ( v ) \left[ \sqrt { \frac { q ( v ) } { p ( v ) } } - 1 \right] \ d v = - 2 \int \left[ \sqrt { q ( v ) p ( v ) } - 1 \right] \ d v } \\ & { \qquad = 2 \left[ 1 - \int \sqrt { p ( v ) q ( v ) } \ d v \right] = 2 H ( P \parallel Q ) ^ { 2 } } \\ & { D _ { K L } ( P \parallel Q ) \geq 2 H ( P \parallel Q ) ^ { 2 } } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
# B HDCR DERIVATION
|
| 303 |
+
|
| 304 |
+
Given optimization problem:
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\begin{array} { r l } { { \arg \operatorname* { m a x } _ { \pi } \int \rho _ { \mu } ( s ) \int \pi ( a \vert s ) A _ { \mu } ( s , a ) d a d s } } \\ & { \quad \mathrm { s . t . } \int \rho _ { \mu } ( s ) H ( \pi ( \cdot \vert s ) \vert \vert \mu ( \cdot \vert s ) ) d s \leq \epsilon , } \\ & { \quad \quad \quad \int \pi ( a \vert s ) d a = 1 , \forall s \in \mathcal S . } \end{array}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
Constructing Lagrangian where $\alpha : \mathcal { S } \ \to \ \mathbb { R }$ is a function for obtaining Lagrange multiplier for every state, $\beta$ is also a Lagrange multiplier:
|
| 311 |
+
|
| 312 |
+
$$
|
| 313 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( \pi , \beta , \alpha ) = \int _ { s } \rho _ { \mu } ( s ) \int _ { a } \pi ( a | s ) A _ { \mu } ( s , a ) d a d s } \\ { \displaystyle \qquad + \beta \left( \epsilon - \int _ { s } \rho _ { \mu } ( s ) \left[ 1 - \int \sqrt { \pi ( a | s ) \mu ( a | s ) } d a \right] d s \right) } \\ { \displaystyle \qquad + \int _ { s } \alpha _ { s } \left( 1 - \int _ { a } \pi ( a | s ) d a \right) d s } \end{array}
|
| 314 |
+
$$
|
| 315 |
+
|
| 316 |
+
Differentiating with respect to $\pi ( a | s )$ gives us following result:
|
| 317 |
+
|
| 318 |
+
$$
|
| 319 |
+
\frac { \partial \mathcal { L } } { \partial \pi ( a | s ) } = \rho _ { \mu } ( s ) A _ { \mu } ( s , a ) + \beta \rho _ { \mu } ( s ) \frac { \mu ( a | s ) } { 2 \sqrt { \pi ( a | s ) \mu ( a | s ) } } - \alpha _ { s } = 0
|
| 320 |
+
$$
|
| 321 |
+
|
| 322 |
+
Solving for $\pi ( a | s )$ :
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r l r } & { } & { \beta \rho _ { \mu } ( s ) \frac { \mu ( a | s ) } { 2 \sqrt { \pi ( a | s ) \mu ( a | s ) } } = \alpha _ { s } - \rho _ { \mu } ( s ) A _ { \mu } ( s , a ) } \\ & { } & { \frac { \sqrt { \mu ( a | s ) } } { \sqrt { \pi ( a | s ) } } = 2 \frac { \frac { \alpha _ { s } } { \rho _ { \mu } ( s ) } - A _ { \mu } ( s , a ) } { \beta } } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
Substituting $\pi ( a | s ) = \mu ( \cdot | s )$ and taking expectation over actions taken according to $\mu$ gives us expression for $\alpha _ { s }$ :
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { c } { { 1 = 2 \displaystyle \frac { \frac { \alpha _ { s } } { \rho _ { \mu } ( s ) } - A _ { \mu } ( s , a ) } { \beta } } } \\ { { { } } } \\ { { \mathbb { E } _ { a \sim \mu ( \cdot | s ) } \alpha _ { s } = \alpha _ { s } = \rho _ { \mu } ( s ) \mathbb { E } _ { a \sim \mu ( \cdot | s ) } \left[ \displaystyle \frac { 1 } { 2 } \beta + A _ { \mu } ( s , a ) \right] = \displaystyle \frac { 1 } { 2 } \beta \rho _ { \mu } ( s ) } } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Then optimal policy $\pi ^ { * } ( a | s )$ can be written as follows:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\pi ^ { * } ( a | s ) = \mu ( a | s ) { \frac { \beta ^ { 2 } } { ( \beta - 2 A _ { \mu } ( s , a ) ) ^ { 2 } } }
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
To obtain regression problem we construct Kullback–Leibler divergence between optimal policy $\pi ^ { * }$ and current policy $\pi$ :
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r l } & \begin{array} { r l } & { \mathrm { a r g } _ { \alpha } ^ { \mathrm { L i n } } \mathrm { i n } \mathbb { E } _ { s \sim p _ { \ell } ( s ) } \mathcal { D } _ { K L } ( \overline { { \mathbf { x } } } ^ { \star } ( \cdot | s ) | ) \pi ( \cdot | s ) } \\ & { = \mathrm { a r g } _ { \alpha } ^ { \mathrm { L i n } } \mathrm { i n } \mathbb { E } _ { s \sim p _ { \ell } ( s ) } \int \pi ^ { \star } ( a | s ) \log \frac { \pi ^ { \star } ( a | s ) } { \pi ( a | s ) } d a } \\ & { = \mathrm { a r g } _ { \alpha } ^ { \mathrm { n i n } } \mathrm { E } _ { s \sim p _ { \ell } ( s ) } \int \mu ( a | s ) \frac { \beta ^ { 2 } } { ( \beta - 2 A _ { \nu } ( s , a ) ) ^ { 2 } } \log \frac { \mu ( a | s ) \frac { \beta ^ { 2 } } { ( \beta - 2 A _ { \nu } ( s , a ) ) ^ { 2 } } } { \pi ( a | s ) } d a } \\ & { = \mathrm { a r g } _ { \alpha } ^ { \mathrm { n i n } } \mathrm { E } _ { s \sim p _ { \ell } ( s ) } \mathbb { E } _ { \alpha \sim p _ { \ell } ( s ) } \frac { 1 } { \mathrm { B a s } \pi ( s , a ) ( \beta - 2 A _ { \nu } ( s , a ) ) ^ { 2 } } \left[ \log \left( \mu ( a | s ) \frac { \beta ^ { 2 } } { ( \beta - 2 A _ { \nu } ( s , a ) ) ^ { 2 } } \right) - \log \pi ( a | s ) \right] } \\ & { = \mathrm { a r g } _ { \alpha } ^ { \mathrm { n i n } } \mathrm { E } _ { s \sim p _ { \ell } ( s ) } \mathbb { E } _ { \alpha \sim p _ { \ell } ( s ) } \log \pi ( a | s ) \frac { 1 } { ( \beta - 2 A _ { \nu } ( s , a ) ) ^ { 2 } } \left[ \log \left( \mu ( a | s ) \frac { \beta ^ { 2 } } { ( \beta - 2 A _ { \mu } ( s , a ) ) ^ { 2 } } \right) - \log \pi ( a | s ) \right] } \\ & { = \mathrm { a r g } _ { \alpha } ^ { \mathrm { n a x } } \mathbb { E } _ { s \sim p _ { \ell } ( s ) } \mathbb { E } _ { \alpha \sim p _ { \ell } ( s ) } \log \pi ( a | s ) \frac { 1 } { ( \beta - 2 A _ { \mu } ( s , a ) ) ^ { 2 } } } \\ & \end{array} \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Regression problem follows:
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\underset { \pi } { \arg \operatorname* { m a x } } \mathbb { E } _ { s \sim \rho _ { \mu } ( \cdot ) } \mathbb { E } _ { a \sim \mu ( \cdot \vert s ) } \log \pi ( a \vert s ) \frac { 1 } { ( \beta - A _ { \mu } ( s , a ) ) ^ { 2 } }
|
| 350 |
+
$$
|
md/train/pvjfA4wogD6/pvjfA4wogD6.md
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Video Instance Segmentation using Inter-Frame Communication Transformers
|
| 2 |
+
|
| 3 |
+
Sukjun Hwang1 Miran Heo1 Seoung Wug Oh2 Seon Joo Kim1 1Yonsei University 2Adobe Research {sj.hwang, miran, seonjookim}@yonsei.ac.kr seoh@adobe.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We propose a novel end-to-end solution for video instance segmentation (VIS) based on transformers. Recently, the per-clip pipeline shows superior performance over per-frame methods leveraging richer information from multiple frames. However, previous per-clip models require heavy computation and memory usage to achieve frame-to-frame communications, limiting practicality. In this work, we propose Inter-frame Communication Transformers (IFC), which significantly reduces the overhead for information-passing between frames by efficiently encoding the context within the input clip. Specifically, we propose to utilize concise memory tokens as a means of conveying information as well as summarizing each frame scene. The features of each frame are enriched and correlated with other frames through exchange of information between the precisely encoded memory tokens. We validate our method on the latest benchmark sets and achieved state-of-the-art performance (AP 42.6 on YouTube-VIS 2019 val set using the offline inference) while having a considerably fast runtime (89.4 FPS). Our method can also be applied to near-online inference for processing a video in real-time with only a small delay. The code is available at https://github.com/sukjunhwang/IFC.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
With the growing interest toward the video domain in computer vision, the task of video instance segmentation (VIS) is emerging [1]. Most of the current approaches [1, 2, 3, 4] extend image instance segmentation models [5, 6, 7, 8] and take frame-wise inputs. These per-frame methods extend the concept of temporal tracking by matching frame-wise predictions of high similarities. The models can be easily customized to real-world applications as they run in an online [9] fashion, but they show limitations in dealing with occlusions and motion blur that are common in videos.
|
| 12 |
+
|
| 13 |
+
On the contrary, per-clip models are designed to overcome such challenges by incorporating multiple frames while sacrificing the efficiency. Previous per-clip approaches [10, 11, 12] aggregate information within a clip to generate instance-specific features. As the features are generated per instance, the number of instances in addition to the number of frames has a significant impact on the overall computation. Recently proposed VisTR [11] adapted DETR [13] to the VIS task and reduced the inference time by inserting the entire video, not a clip, to its offline end-to-end network. However, its full self-attention transformers [14] over the space-time inputs involve explosive computations and memories. In this work, we raise the following question: can a per-clip method be efficient while attaining great accuracy?
|
| 14 |
+
|
| 15 |
+
To achieve our goal, we introduce Inter-frame Communication Transformers (IFC) to greatly reduce the computations of the full space-time transformers. Similar to recent works [15, 16, 17] that alleviate the explosive computational growth inherent in attention-based models [14, 18], IFC takes a decomposition strategy utilizing two transformers. The first transformer (Encode-Receive, $\mathcal { E }$ ) encodes each frame independently. To exchange the information between frames, the second transformer (Gather-Communicate, $\mathcal { G }$ ) executes attention between a small number of memory tokens that hold concise information of the clip. The memory tokens are utilized to store the overall context of the clip, for example “a hand over a lizard” in Fig. 1. The concise information assists detecting the lizard that is largely occluded by the hand in the first frame, without employing an expensive pixel-level attention over space and time. The memory tokens are only in charge of the communications between frames, and the features of each frame are enriched and correlated through the memory tokens.
|
| 16 |
+
|
| 17 |
+
We further reduce overheads while taking advantage of per-clip pipelines by concisely representing each instance with a unique convolutional weight [7]. Despite the changes of appearances at different frames, the instances of the same identity share commonalities because the frames originated from the same source video. Therefore, we can effectively capture instance-specific characteristics in a clip with dynamically generated convolutional weights. In companion with the segmentation, we track instances by uniformly applying the weights to all frames in a clip. Moreover, all executions of our spatial decoder are instance-agnostic except for the final layer which applies instance-specific weights. Accordingly, our model is highly efficient and also suitable for scenes with numerous instances.
|
| 18 |
+
|
| 19 |
+
In addition to the efficient modeling, we provide optimizations and an instance tracking algorithm that are designed to be VIS-centric. By the definition of $\mathsf { A P } ^ { \mathtt { V I S } }$ , the VIS task [1] aims to maximize the objective similarity: space-time mask IoU. Inspired by previous works [13, 19, 20], our model is optimized to maximize the similarity between bipartitely matched pairs of ground truth masks and predicted masks. Furthermore, we again adopt the similarity maximization for tracking instances of same identities, which effectively links predicted space-time masks using bipartite matching. As both of our training and inference algorithms are fundamentally designed to address the key challenge of VIS task, our method attains an outstanding accuracy.
|
| 20 |
+
|
| 21 |
+
From these improvements, IFC sets the new state-of-the-art: $4 2 . 6 \%$ AP and more surprisingly, in 89.4 fps. Furthermore, our model also shows great speed-accuracy balance under near-online settings, which leads to a huge practicality. We believe that our model can be a powerful baseline for video instance segmentation approaches that follow the per-clip execution.
|
| 22 |
+
|
| 23 |
+
# 2 Related Work
|
| 24 |
+
|
| 25 |
+
Video instance segmentation The VIS task [1] extends the concept of tracking to the image instance segmentation task. The early solutions [1, 2] follow the per-frame pipeline, which utilize additional tracking head to the models that are mainly designed to solve image instance segmentation. More advanced algorithms that are recently proposed [3, 4] take video characteristics into consideration, which result in improved performance.
|
| 26 |
+
|
| 27 |
+
Per-clip models [10, 11, 12] dedicate computations to extract information from multiple frames for higher accuracy. By exploiting multiple frames, per-clip models can effectively handle typical challenges in video, i.e., motion blurs and occlusions. Our model is designed to be highly efficient while following the per-clip pipeline, which leads to fast and accurate predictions.
|
| 28 |
+
|
| 29 |
+
Transformers Recently, transformers [14] are greatly impacting many tasks in computer vision. After the huge success of DETR [13], which has brought a new paradigm to the object detection task, numerous vision tasks are incorporating transformers [21, 22] in place of CNNs. For classification tasks in both NLP and computer vision, many adopt an extra classification token to the input of transformers [21, 23]. All the input tokens affect each other as the encoders are mainly composed of the self-attention, thus the classification token can be used to determine the class of the overall input. Similarly, DeiT [24] inserts an additional distillation token to transformers, and the novel usage leads to a higher data efficiency. MaX-DeepLab [20] adopted the concept of memory and proposed a novel dual-path transformer for the panoptic segmentation task [25]. By making use of numerous memory tokens to convey information, MaX-DeepLab integrates the transformer and the CNN by making both feedback itself and the other.
|
| 30 |
+
|
| 31 |
+
We further utilize the concept of the memory tokens to the videos. Using Inter-frame Communication Transformers, each frame runs independently while sharing their information with interim communications. The communications lead to higher accuracy while the execution independence between frames accelerates the inference.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Overview of IFC framework. Our transformer encoder block has two components: 1) Encode-Receive $( \mathcal { E } )$ simultaneously encodes frame tokens and memory tokens. 2) Only memory tokens pass Gather-Communicate $( { \mathcal { G } } )$ to perform communications between frames. The output from the stack of $N _ { E }$ encoder blocks goes into two modules, spatial decoder and transformer decoder, to generate segmentation masks.
|
| 35 |
+
|
| 36 |
+
# 3 Method
|
| 37 |
+
|
| 38 |
+
The proposed method follows a per-clip pipeline which takes a video clip as input and outputs clip-level results. We also introduce Inter-frame Communication Transformers, which can effectively share frame-wise information within a clip with a high efficiency.
|
| 39 |
+
|
| 40 |
+
# 3.1 Model architecture
|
| 41 |
+
|
| 42 |
+
Inspired by DETR [13], our network consists of a CNN backbone and transformer encoder-decoder layers (Fig. 1). The input clip is first independently embedded into a feature map through the backbone. Then, the embedded clip passes through our inter-frame communication encoder blocks that enrich the feature map by allowing information exchange between frames. Next, a set of transformer decoder layers that take the encoder outputs and object queries as inputs predict unique convolutional weights for each instance in the clip. Finally, the masks for each instance across the clip are computed in one shot by convolving the encoded feature map with the unique convolutional weight.
|
| 43 |
+
|
| 44 |
+
Backbone Given an input clip $\{ x _ { i } \} _ { i = 1 } ^ { T } \ \in \ \mathbb { R } ^ { T \times H _ { 0 } \times W _ { 0 } \times 3 }$ , composed of $T$ frames with 3 color channels, the CNN backbone processes the input clip frame-by-frame. As the result, the clip is encoded into a set of low-resolution features, $\bar { \{ f _ { i } ^ { 0 } \} _ { i = 1 } ^ { T } } \in \mathbb { R } ^ { T \times H \times W \times C }$ , where $C$ is the number of channels and $\begin{array} { r } { H , W = \frac { H _ { 0 } } { 3 2 } , \frac { W _ { 0 } } { 3 2 } } \end{array}$ .
|
| 45 |
+
|
| 46 |
+
Inter-Frame Communication Encoder Given an image, humans can effortlessly summarize the scene with only a few words. Also, frames from a same video share a lot of commonalities, the difference between them is sufficiently summarized and communicated even with a small bandwidth. Based on this hypothesis, we propose an inter-frame communication encoder to make the computation to be mostly frame-wise independent with some communications between frames. Specifically, we adopt memory tokens for both summarizing per-frame scenes and the means of communications.
|
| 47 |
+
|
| 48 |
+
Our encoder blocks are composed of two phases of separate transformers: Encode-Receive $( \mathcal { E } )$ and Gather-Communicate $( { \mathcal { G } } )$ . Both Encode-Receive and Gather-Communicate follow the typical transformer encoder architecture [14], which consists of an addition of fixed positional encoding, a multi-head self-attention module, and a feed forward network.
|
| 49 |
+
|
| 50 |
+
Encode-Receive operates in a per-frame manner, taking a frame-level feature map and corresponding memory tokens. Passing through Encode-Receive, we expect two functionalities: (1) image features encode per-frame information to the memory tokens, and (2) image features receive information of different frames that are gathered in the memory tokens. Gather-Communicate operates across frames to form a clip-level knowledge. It takes the memory tokens from each frame as inputs and performs communications between frames. Alternating two phases through multiple layers, the encoder can efficiently learn consensus representations across frames.
|
| 51 |
+
|
| 52 |
+
Table 1: Complexity comparison. Various transformer encoders for space-time input. As the overall FLOPs can vary by the number of detected instances, listed values are measured only at the encoders.
|
| 53 |
+
|
| 54 |
+
<table><tr><td rowspan="3">Communication Type</td><td rowspan="3">Complexity per Layer</td><td colspan="4">FLOPs (G)1</td></tr><tr><td></td><td>360 × 640</td><td></td><td>720×1280</td></tr><tr><td>T=5</td><td>T=36</td><td>T=5</td><td>T=36</td></tr><tr><td>No Comm</td><td>O(C²THW + CT(HW)2)</td><td>5.17</td><td>37.23</td><td>24.62</td><td>177.29</td></tr><tr><td>Full THW</td><td>O(C²THW + C(THW)2)</td><td>6.94</td><td>148.70</td><td>50.63</td><td>1815.38</td></tr><tr><td>Decompose T-HW</td><td>O(C²THW + CT(HW)² + CT²HW)</td><td>8.33</td><td>60.24</td><td>36.73</td><td>265.50</td></tr><tr><td>IFC (M = 8)</td><td>O(C²THW +CT(HW)2)</td><td>5.52</td><td>39.73</td><td>25.05</td><td>180.39</td></tr></table>
|
| 55 |
+
|
| 56 |
+
In more detail, given the frame embedding $\{ f _ { i } ^ { 0 } \} _ { i = 1 } ^ { T }$ , we spatially flatten each feature $\mathbb { R } ^ { H \times W \times C } $ $\mathbb { R } ^ { H W \times C }$ . The initial memory tokens $m ^ { 0 }$ of size $M$ are copied per frame and concatenated to each frame feature as follows:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
[ f _ { t } ^ { 0 } , m _ { t } ^ { 0 } ] \in \mathbb { R } ^ { ( H W + M ) \times C } , \qquad t \in \{ 1 , 2 , \cdots , T \} ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $[ \cdot , \cdot ]$ indicates a concatenation of two feature vectors. Note that the initial memory tokens $m ^ { 0 }$ are trainable parameters learnt during training.
|
| 63 |
+
|
| 64 |
+
The first phase of IFC is Encode-Receive, which processes frames individually as follows:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
[ f _ { t } ^ { l } , \widehat { m } _ { t } ^ { l } ] = \mathcal { E } ^ { l } ( [ f _ { t } ^ { l - 1 } , m _ { t } ^ { l - 1 } ] ) ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where ${ \mathcal { E } } ^ { l }$ denotes the $l$ -th Encode-Receive layer. With a self-attention computed over the frame pixel locations and the memory tokens, the information of each frame can be passed to the memory tokens and vise-versa.
|
| 71 |
+
|
| 72 |
+
The outputs of Encode-Receive are grouped by memory indices and formulate the inputs for GatherCommunicate layer. The grouping can be understood as a decomposition of memory tokens, and becomes computationally beneficial when the total size of gathered memory tokens increases.
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } & { [ m _ { 1 } ^ { l } ( i ) , m _ { 2 } ^ { l } ( i ) , \cdots , m _ { T } ^ { l } ( i ) ] = \mathcal { G } ^ { l } ( [ \widehat { m } _ { 1 } ^ { l } ( i ) , \widehat { m } _ { 2 } ^ { l } ( i ) , \cdots , \widehat { m } _ { T } ^ { l } ( i ) ] ) , \qquad i \in \{ 1 , 2 , \cdots , M \} , } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
where $\mathcal { G } ^ { l }$ denotes the $l$ -th Gather-Communicate layer. The processed outputs are redistributed to the originated frame and get concatenated as $m _ { t } \overset { \cdot } { = } \left[ m _ { t } ( 1 ) , \overset { \cdot } { m } _ { t } ( 2 ) , \cdot \cdot \cdot , \overset { \cdot } { m } _ { t } ( M ) \right]$ . Unlike EncodeReceive, Gather-Communicate utilizes the attention mechanism to convey the information from different frames over the input clip.
|
| 79 |
+
|
| 80 |
+
Defining the $l$ -th inter-frame encoder block $( \mathrm { I F C } ^ { l } )$ as ${ \mathcal { E } } ^ { l }$ followed by $\mathcal { G } ^ { l }$ , the stack of $N _ { E }$ encoder blocks can be inductively formulated as:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
[ f _ { t } ^ { l } , m _ { t } ^ { l } ] = \mathrm { I F C } ^ { l } ( [ f _ { t } ^ { l - 1 } , m _ { t } ^ { l - 1 } ] ) , \qquad 1 \leq l \leq N _ { E } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\left[ f _ { t } ^ { N _ { E } } , m _ { t } ^ { N _ { E } } \right]$ is the final result. The stacking of multiple encoder layers brings communications between frames, thus each frame can have coincidence to the other, specifying the identities of instances in a given clip.
|
| 87 |
+
|
| 88 |
+
Complexity comparison In Table 1, we analyze the computational complexity of transformer encoder variants applied for video input in terms of the Big-O complexity and FLOPs. The complexity of the original transformer encoder layer [14] is $\mathcal { O } ( C ^ { 2 } N ^ { ' } { + } C N ^ { 2 } )$ , where $N$ is the number of inputs. Without any communication between frames, No Comm, it shows the smallest amount of computation $( { \mathcal O } ( C ^ { 2 } T \dot { H W } + C T ( H W ) ^ { 2 } ) )$ ). As indicated as Full THW in Table 1, the complexity of VisTR [11] that performs a full space-time self-attention is $\mathcal { O } ( C ^ { 2 } ( T H W ) + C ( T H W ) ^ { 2 } )$ thus either a higher resolution or an increase of number of input frames leads to a massive increase in computations. VisTR bypasses the problem by highly reducing the input resolution and utilizing GPUs with tremendous memory capacity. However, as such solutions cannot resolve the fundamental issues, it is impractical to real-world videos. Moreover, VisTR remains as a complete offline strategy because it takes the entire video as an input.
|
| 89 |
+
|
| 90 |
+
An intriguing improvement for the naïve full self-attention would be the decomposition of the attention into space and time axis [16, 17, 26]. In Decompose T-HW, we decompose attention computation into spatial and temporal attention. The complexity of the separation of space-time leads to the sum of the two transformer encoder: $\mathcal { O } ( T ( C ^ { 2 } ( H \bar { W } ) + \bar { C } ( H W ) ^ { 2 } ) )$ and $\mathcal { O } ( H \bar { W } ( C ^ { 2 } T + C T ^ { 2 } ) )$ . In comparison to the full self-attention, the decomposition lowers the computational growth relative to the number of frames.
|
| 91 |
+
|
| 92 |
+
Our encoder, IFC, that communicates between frames using the memory tokens leads to a huge benefit to the total computations adding only a small amount of computation over No Comm while providing sufficient channels for communication. The complexity of each phase in our proposed encoder is: $\mathcal { O } ( C ^ { 2 } T ( H W + M ) + C T ( H W + M ) ^ { 2 } )$ for Encode-Receive and $\mathcal { O } ( C ^ { 2 } T M + \bar { C } \bar { T } ^ { 2 } M )$ for Gather-Communicate respectively. Assuming that $M$ is kept small (e.g., 8), the computation needed for Gather-Communicate can be neglected, while the complexity of Encode-Receive can be approximated to $\mathcal { O } ( C ^ { 2 } T H W + C T ( H W ) ^ { 2 } )$ as shown in Table 1. Finally, with respect to the number of frames of the input, we can expect approximate linear increase rather than the high increase of computation occurred in VisTR.
|
| 93 |
+
|
| 94 |
+
Decoders and output heads As depicted in Fig. 1, the transformer decoder of our model is stacked with $N _ { D }$ layers [14]. Contrary to VisTR, where the number of object queries increases proportionally to the number of frames, our model receives learnt encodings of fixed size $N _ { q }$ for object queries. Also, by utilizing these encodings throughout the entire frames, our model can effectively deal with clips of various lengths. A set of projection matrices are applied to $\{ f _ { t } ^ { N _ { E } } , m _ { t } ^ { N _ { E } } \} _ { t = 1 } ^ { T }$ for the generation of keys and values. The object queries turn into output embeddings by the transformer decoder, and the embeddings are eventually used as an input to the output heads.
|
| 95 |
+
|
| 96 |
+
There are two output heads on top of the transformer decoder, a class head and a segmentation head, each composed of two fully-connected layers. The output embeddings from the transformer decoder are independently inserted to the heads, resulting in $N _ { q }$ predictions per a clip. The class head outputs a class probability distribution of instances $\hat { p } ( c ) \in \mathbb { R } ^ { N _ { q } \times | \mathbb { C } | }$ . Note that the possible classes $\mathbb { C } \ni c$ include no object $\mathcal { D }$ class in addition to the given classes of a dataset.
|
| 97 |
+
|
| 98 |
+
The segmentation head generates $N _ { q }$ conditional convolutional weights $w \in \mathbb { R } ^ { N _ { q } \times C }$ in a manner similar to [7, 20]. For the conditional convolution, the output feature of the encoder reused by undoing the flatten operation. For the upsampling, the encoder feature pa $\{ f _ { t } ^ { N _ { E } } \} _ { t = 1 } ^ { T }$ isgh fpn-style [27] spatial decoder without temporal connections resulting in $T$ feature maps that are $1 / 8$ of the input resolution. Finally, the resulting feature maps $f ^ { \prime }$ are convolved with each convolutional weight to generate a segmentation mask as follows:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\hat { s } _ { i } = \{ f _ { t } ^ { \prime } \circ w _ { i } \} _ { t = 1 } ^ { T } ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $w _ { i }$ is $i$ -th convolutional weight, $\circ$ indicate $1 \times 1$ spatial convolution operation, and the result $\hat { s _ { i } }$ is a spatial-temporal object mask in shape of $\mathbb { R } ^ { T \times H ^ { \prime } \times W ^ { \prime } }$ where $\begin{array} { r } { H ^ { \prime } = \frac { H _ { 0 } } { 8 } } \end{array}$ , $\begin{array} { r } { W ^ { \prime } = \frac { W _ { 0 } } { 8 } } \\ { . } \end{array}$ . Note that, for an instance, a common weight is applied throughout the video clip. Our spatial decoder is an instanceagnostic design, which is much more efficient than instance-specific decoders [10, 11, 12, 13] as the number of detected instances increases. Meanwhile, thanks to our segmentation head which specifies and captures the characteristics of an instance, IFC can conduct both segmentation and tracking at once within a clip.
|
| 105 |
+
|
| 106 |
+
# 3.2 Instance matching and loss
|
| 107 |
+
|
| 108 |
+
To train our network, we first assign the ground truth for each instance estimation and then a set of loss function between each the ground truth and prediction pair. For a given input clip, our model generate a fixed-size set of class-labeled masks $\{ \hat { y } _ { i } \} _ { i = 1 } ^ { N _ { q } } = \{ ( \hat { p } _ { i } ( \boldsymbol { c } ) , \hat { s } _ { i } ) \} _ { i = 1 } ^ { N _ { q } }$ . The ground truth set of the clip can be represented as $y _ { i } = ( c _ { i } , s _ { i } )$ ; $c _ { i }$ is the target class label including $\mathcal { D }$ , and $s _ { i }$ is the target mask which is down-sampled to the size of the prediction masks for efficient similarity calculation. One-to-one bipartite matching between the prediction set $\{ \hat { y } _ { i } \} _ { i = 1 } ^ { N _ { q } }$ and the ground truth set $\{ y _ { i } \} _ { i = 1 } ^ { K }$ is performed to find the best assignment of a prediction to a ground truth. The objective can be formally
|
| 109 |
+
|
| 110 |
+
described as:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\hat { \sigma } = \underset { \sigma \in \mathfrak { S } _ { N _ { q } } } { \arg \operatorname* { m a x } } \sum _ { i = 1 } ^ { K } \sin ( y _ { i } , \hat { y } _ { \sigma ( i ) } ) ,
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
where $\sin ( y _ { i } , \hat { y } _ { \sigma ( i ) } )$ refers a pair-wise similarity over a permutation of $\underset { \_ w } { \sigma } \in \mathfrak { S } _ { N _ { g } }$ . Following prior work [13, 20, 28], the bipartite matching is efficiently computed using Hungarian algorithm [19]. We find that box-based similarity measurement as used in DETR [13] shows weaknesses in matching instances in video clip due to the case of occlusion and disappear-and-reappear. Therefore, we define $\sin ( y _ { i } , \hat { y } _ { \sigma ( i ) } )$ to be mask-based term as $\mathbb { 1 } _ { \{ c _ { i } \neq \infty \} } [ \hat { p } _ { \sigma ( i ) } ( c _ { i } ) + \bar { \lambda } _ { 0 } \mathrm { D I C E } ( s _ { i } , \bar { \hat { s } } _ { \sigma ( i ) } ^ { - } ) ]$ , where DICE denotes dice coefficients [29].
|
| 117 |
+
|
| 118 |
+
Given the optimal assignment $\hat { \sigma }$ , we refer to the $K$ matched predictions and $( N _ { q } - K )$ non-matched predictions as positive and negative pairs respectively. The positive pairs aim to predict the ground truth masks and classes while the negative pairs are optimized to predict the $\mathcal { D }$ class. The final loss is a sum of the losses from positive pairs and negative pairs where each can be computed as follows:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r l } & { \mathcal { L } _ { p o s } = \displaystyle \sum _ { i = 1 } ^ { K } [ \underbrace { - \log \hat { p } _ { \hat { \sigma } ( i ) } ( c _ { i } ) } _ { \mathrm { C r o s s - e n t r o p y ~ l o s s } } + \lambda _ { 1 } ( \underbrace { 1 - \operatorname { D I C E } \bigl ( s _ { i } , \hat { s } _ { \hat { \sigma } ( i ) } \bigr ) } _ { \mathrm { D i c e ~ l o s s ~ } [ 2 9 ] } ) + \lambda _ { 2 } \underbrace { \operatorname { F O C A L } \bigl ( s _ { i } , \hat { s } _ { \hat { \sigma } ( i ) } \bigr ) } _ { \mathrm { S i g m o i d - f o c a l ~ l o s s ~ } [ 3 0 ] } ] , } \\ & { \quad \quad \quad \quad \quad \quad \mathcal { L } _ { n e g } = \displaystyle \sum _ { i = k + 1 } ^ { N _ { q } } [ - \log \hat { p } _ { \hat { \sigma } ( i ) } ( \emptyset ) ] . } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
As $( N _ { q } - K )$ is likely to be much greater than $K$ , we down-weight $\mathcal { L } _ { n e g }$ by a factor of 10 to resolve the imbalance, following prior work [13]. The goal of video instance segmentation [1] is to maximize the space-time IoU between a prediction and a ground truth mask. Therefore, our mask-related losses (Dice loss and Sigmoid-focal loss) are spatio-temporally calculated over an entire clip, rather than averaging the losses that are accumulated frame-by-frame.
|
| 125 |
+
|
| 126 |
+
# 3.3 Clip-level instance tracking
|
| 127 |
+
|
| 128 |
+
To infer a video input that is longer than the clip length, we match instances using the predicted masks of overlapping frames. Let $\mathcal { V } _ { I }$ and ${ \mathcal { V } } _ { A }$ be the result sets of clip $I$ and $A$ excluding the $\mathcal { D }$ class. The goal is to perform matching of same identities between pre-collected instance set $\mathcal { V } _ { I }$ and $\mathcal { V } _ { A }$ . We first calculate the matching scores which are space-time soft IoU at intersecting frames between $\mathcal { V } _ { I }$ and $\mathcal { V } _ { A }$ . Then, we find optimal paired indices $\hat { \sigma } _ { S }$ using Hungarian algorithm [19] to the gathered matching score $\mathcal { S } \in [ 0 , \bar { 1 ] } ^ { | \mathcal { N } _ { I } | \times | \bar { \mathcal { V } } _ { A } | }$ . We update $\mathscr { D } _ { I } ( i )$ by concatenating $\mathcal { V } _ { A } ( \hat { \sigma } _ { S } ( i ) )$ if $\bar { \cal S } ( i , \bar { \sigma } s ( i ) )$ is above a certain threshold, and add non-matched prediction sets to $\mathcal { V } _ { I }$ as new instances. Note that a previous per-clip model (MaskProp [10]) also utilizes soft IoU for tracking instances, but the matching scores are computed per-frame and averaged for intersecting frames. Different from MaskProp, using space-time soft IoU leads to an accurate tracking as it can better represent the definition of mask similarities between clips which brings at most $2 \%$ AP increase. The overall tracking pipeline can be effectively implemented in a GPU-friendly manner.
|
| 129 |
+
|
| 130 |
+
# 4 Experiments
|
| 131 |
+
|
| 132 |
+
In this section, we evaluate the proposed method using YouTube-VIS 2019 and 2021 [1]. For every listed score, we report the mean of five runs as the results may vary by each run due to the insufficient number of training and testing set of YouTube-VIS dataset. We demonstrate the effectiveness of our model regarding both accuracy and speed. We further examine how different settings affect the overall performance and efficiency of IFC encoder. Unless specified, all models for measurements used $\bar { N _ { E } } = 3 , \bar { N _ { D } } = 3$ , stride of 1, and ResNet-50.
|
| 133 |
+
|
| 134 |
+
# 4.1 Implementation Details
|
| 135 |
+
|
| 136 |
+
We used detectron2 [33] for our code basis, and hyper-parameters mostly follow the settings of DETR [13] unless specified. We used AdamW [34] optimizer with initial learning rate of $1 0 ^ { - 4 }$ for transformers, and $1 \bar { 0 } ^ { - 5 }$ for backbone. We first pre-train the model for image instance segmentation on COCO [35] by setting our model to $T = 1$ . The pre-train procedure follows the shortened training schedule of DETR [13], which runs 300 epochs with a decay of the learning rate by a factor of 10 at 200 epochs. Using the pre-trained weights, the models are trained on a targeted dataset using the batch size of 16, each clip composed of $T = 5$ frames downscaled to either $3 6 0 \mathrm { p }$ or $4 8 0 \mathrm { p }$ . For the sampling of each clip, a reference frame index $t$ is randomly chosen. The remaining $T - 1$ frame indices are then sampled within an interval of 20. The models are trained for 8 epochs, and decays the learning rate by 10 at 5th epoch.
|
| 137 |
+
|
| 138 |
+
Table 2: Evaluations on various settings.
|
| 139 |
+
(a) AP and FPS on YouTube-VIS 2019 val set. For fairness, FPS is measured on a same machine, using a single RTX 2080Ti GPU. We used the official codes and checkpoints provided by the authors for the measurements. We report the clip settings of [10, 11]. T : window size.
|
| 140 |
+
(b) Accuracy on YTVIS 2021 val set
|
| 141 |
+
(d) Effect of strides
|
| 142 |
+
|
| 143 |
+
<table><tr><td colspan="3">Method (Settings)</td><td>Backbone [31]</td><td>FPS²</td><td>AP</td><td>AP50</td><td>AP75</td><td>AR1</td><td>AR10</td></tr><tr><td rowspan="9">prij.ite</td><td colspan="2">MaskTrack R-CNN[1]</td><td>ResNet-50</td><td>26.1</td><td>30.3</td><td>51.1</td><td>32.6</td><td>31.0</td><td>35.5</td></tr><tr><td colspan="2">MaskTrack R-CNN[1]</td><td>ResNet-101</td><td>=</td><td>31.8</td><td>53.0</td><td>33.6</td><td>33.2</td><td>37.6</td></tr><tr><td colspan="2">SipMask [2]</td><td>ResNet-50</td><td>35.5</td><td>33.7</td><td>54.1</td><td>35.8</td><td>35.4</td><td>40.1</td></tr><tr><td colspan="2">SG-Net [4]</td><td>ResNet-50</td><td>1</td><td>34.8</td><td>56.1</td><td>36.8</td><td>35.8</td><td>40.8</td></tr><tr><td colspan="2">SG-Net [4]</td><td>ResNet-101</td><td>1</td><td>36.3</td><td>57.1</td><td>39.6</td><td>35.9</td><td>43.0</td></tr><tr><td colspan="2">Cross VIS [3]</td><td>ResNet-50</td><td>=</td><td>36.3</td><td>56.8</td><td>38.9</td><td>35.6</td><td>40.7</td></tr><tr><td colspan="2">Cross VIS [3]</td><td>ResNet-101</td><td>1</td><td>36.6</td><td>57.3</td><td>39.7</td><td>36.0</td><td>42.0</td></tr><tr><td colspan="2">STEm-Seg [32]</td><td>ResNet-101</td><td>3.0</td><td>34.6</td><td>55.8</td><td>37.9</td><td>34.4</td><td>41.6</td></tr><tr><td rowspan="7">VisTR[11]</td><td>VisTR[11]</td><td>(T=36)</td><td>ResNet-50</td><td>51.1</td><td>35.6</td><td>56.8</td><td>37.0</td><td>35.2</td><td>40.2</td></tr><tr><td></td><td>(T=36)</td><td>ResNet-101</td><td>43.5</td><td>38.6</td><td>61.3</td><td>42.3</td><td>37.6</td><td>44.2</td></tr><tr><td>MaskProp[10]</td><td>(T=13)</td><td>ResNet-50</td><td>1</td><td>40.0</td><td>1</td><td>42.9</td><td>1</td><td>-</td></tr><tr><td>MaskProp [10]</td><td>(T=13)</td><td>ResNet-101</td><td>1</td><td>42.5</td><td>1</td><td>45.6</td><td>1</td><td>1</td></tr><tr><td>OurSnear-online</td><td>(T=5)</td><td>ResNet-50</td><td>46.5</td><td>39.0</td><td>60.4</td><td>42.7</td><td>41.7</td><td>51.6</td></tr><tr><td>OurSoffline</td><td>(T=36)</td><td>ResNet-50</td><td>107.1</td><td>41.2</td><td>65.1</td><td>44.6</td><td>42.3</td><td>49.6</td></tr><tr><td>OurSoffline</td><td>(T=36)</td><td>ResNet-101</td><td>89.4</td><td>42.6</td><td>66.6</td><td>46.3</td><td>43.5</td><td>51.4</td></tr></table>
|
| 144 |
+
|
| 145 |
+
(c) Bipartite matching
|
| 146 |
+
|
| 147 |
+
<table><tr><td></td><td>AP</td></tr><tr><td>Box-based</td><td>37.5</td></tr><tr><td>Mask-based</td><td>39.6</td></tr></table>
|
| 148 |
+
|
| 149 |
+
<table><tr><td></td><td>AP</td><td>AP50</td><td>AP75</td></tr><tr><td>MaskTrack-RCNN</td><td>28.6</td><td>48.9</td><td>29.6</td></tr><tr><td>SipMask</td><td>31.7</td><td>52.5</td><td>34.0</td></tr><tr><td>CrossVIS</td><td>34.2</td><td>54.4</td><td>37.9</td></tr><tr><td>Ours</td><td>35.2</td><td>57.2</td><td>37.5</td></tr></table>
|
| 150 |
+
|
| 151 |
+
<table><tr><td></td><td>AP</td><td>AP75</td><td>FPS</td></tr><tr><td>T=5</td><td>S=3 S=5</td><td>38.7 42.1</td><td>72.7</td></tr><tr><td>T=10</td><td>39.5</td><td>42.8</td><td>83.0</td></tr><tr><td>T=15 S=8</td><td>39.7</td><td>43.0</td><td>92.5</td></tr><tr><td>T=20 S=10</td><td>40.4</td><td>43.3</td><td>95.7</td></tr></table>
|
| 152 |
+
|
| 153 |
+
During inference, our model takes inputs as follows. Let an input video has $V$ frames, $T$ is the number of frames per clip and $S$ is the stride of clips. We start from inserting a clip of frame indices $[ 1 , T ]$ and sequentially insert clips of $[ 1 + S , T + \bar { S } ] , [ 1 + 2 S , T + 2 S ] , \therefore , [ 1 + n S , T + n S ]$ . It repeats until the end frame index $T + n S$ is equal to or greater than $V$ . If the end frame index of the last clip $T + n S$ is greater than $V$ , we change the frame indices of the last clip to $[ V - T + 1 , V ]$ . The resolution of input videos are downscaled to $3 6 0 \mathrm { p }$ , which follows MaskTrack R-CNN [1].
|
| 154 |
+
|
| 155 |
+
# 4.2 Main Results
|
| 156 |
+
|
| 157 |
+
YouTube-VIS 2019 evaluation results We compare our proposed IFC to the state-of-the-art models in the video instance segmentation task on YouTube-VIS $2 0 1 9 \ \mathtt { v a l }$ in Table 2 (a). We measure the accuracy by AP and our model sets the highest score among all online, near-online, and offline models while presenting the fastest runtime. As mentioned earlier, IFC is highly efficient during the inference thanks to three advantages: (1) memory token-based decomposition for transformer encoder (2) instance-agnostic spatial decoder (3) GPU-friendly instance matching. Moreover, our model does not make use of any heavy modules such as deformable convolutions [36] or cascading networks [37]. Thanks to these advantages, IFC achieves an outstanding runtime, which is faster speed than online models [1, 2].
|
| 158 |
+
|
| 159 |
+
During the inference, our method is able to freely adjust the length of the clip $( T )$ as needed. If the input clip length is set to contain entire video frames, our method becomes an offline method (like
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 2: Visualization of predictions from VisTR and our model. Instances with the same identity are displayed in the same color.
|
| 163 |
+
|
| 164 |
+
VisTR [11]) that processes the entire video in one shot. As the offline inference can skip matching between clips and maximize the GPU utilization, our method represents surprisingly fast runtime (107.1 FPS). On the other hand, if the application requires instant outputs given a video stream, we can reduce the clip length to make our method near-online. In the near-online scenario with $T = 5$ our system is still able to process a video in real-time (46.5 FPS) with only a small delay.
|
| 165 |
+
|
| 166 |
+
YouTube-VIS 2021 evaluation results The recently introduced dataset YouTube-VIS 2021 is an improved version of YouTube-VIS 2019. The newly added videos in the dataset include higher number of instances and frames. For the new dataset, we use 32 memory tokens. In Table 2 (b), we refer the results reported in [3], which evaluated [1, 2] using official implementations. Again, our model achieves the best performance.
|
| 167 |
+
|
| 168 |
+
Qualitative result comparison We compare some qualitative results predicted by our model and VisTR [11] in Fig. 2. In terms of both tracking accuracy and segmentation quality, IFC yields better results than VisTR.
|
| 169 |
+
|
| 170 |
+
# 4.3 Ablation Study
|
| 171 |
+
|
| 172 |
+
In this section, we provide ablation studies and discuss how different settings impact the overall performance. The experiments are conducted using YouTube-VIS 2019 val set.
|
| 173 |
+
|
| 174 |
+
Box-based and mask-based bipartite matching We observe how the different policies for bipartite matching affect the performance. As our model does is a box-free method, we adjust our model to predict bounding boxes similar to VisTR [11] and conduct bipartite matching [13, 19] using the predicted boxes. The change of optimization from mask-based to box-based brings a noticeable performance drop as shown in Table 2 (c). With the VIS-centric design, the mask-based optimization shows more robustness than box-based optimizations under typical video circumstances such as instances with heavy overlaps and partial occlusions.
|
| 175 |
+
|
| 176 |
+
Differing window strides In addition to the clip length $T$ , we further optimize our runtime placing a stride $S$ between clips, as shown in Table 2 (d). IFC can be used in a near-online manner, which takes clips that are consecutively extracted from a video. The placement of a larger stride reduces temporal intersections, which lessens computational overheads but also causes difficulty in matching instances. By enlarging the stride from $S = 1$ to $S = 3$ , IFC accomplishes approximately $150 \%$ speed improvement with only $0 . 1 \%$ AP drop. The tendency of high speed gain and low accuracy drop persists under various conditions. Therefore, our model can be applied to conditions where the enlargement of strides is necessary, i.e., using devices that are not powerful enough but has to maintain high inference speed.
|
| 177 |
+
|
| 178 |
+
Table 3: Encoder variations. We show how different encoders affect the overall performance.
|
| 179 |
+
(a) Various encoders taking clips of different lengths (see Table 1)
|
| 180 |
+
|
| 181 |
+
<table><tr><td></td><td colspan="3">T=5</td><td colspan="3">T=10</td><td colspan="3">T=15</td><td colspan="3">T=20</td></tr><tr><td></td><td>AP</td><td>AP75</td><td>FPS</td><td>AP</td><td>AP75</td><td>FPS</td><td>AP</td><td>AP75</td><td>FPS</td><td>AP</td><td>AP75</td><td>FPS</td></tr><tr><td>No Comm</td><td>37.4</td><td>39.9</td><td>38.1</td><td>38.8</td><td>41.6</td><td>40.8</td><td>39.3</td><td>41.7</td><td>46.7</td><td>39.6</td><td>41.9</td><td>52.9</td></tr><tr><td>Full THW</td><td>37.2</td><td>40.0</td><td>37.6</td><td>38.8</td><td>41.2</td><td>35.5</td><td>39.8</td><td>42.6</td><td>32.9</td><td>39.7</td><td>42.8</td><td>34.8</td></tr><tr><td>Decomp T-HW</td><td>37.2</td><td>39.8</td><td>35.7</td><td>38.3</td><td>40.9</td><td>37.9</td><td>38.5</td><td>41.5</td><td>42.6</td><td>39.0</td><td>41.9</td><td>49.4</td></tr><tr><td>IFC</td><td>39.0</td><td>42.7</td><td>36.3</td><td>39.6</td><td>43.0</td><td>38.9</td><td>39.8</td><td>43.0</td><td>43.7</td><td>40.4</td><td>43.4</td><td>50.2</td></tr></table>
|
| 182 |
+
|
| 183 |
+
(b) Image instance segmentation on COCO val set
|
| 184 |
+
(c) Number of memory tokens (AP)
|
| 185 |
+
(d) Index-wise memory decomposition
|
| 186 |
+
|
| 187 |
+
<table><tr><td></td><td>T=5</td><td>T=10</td><td>T=15</td><td>T=20</td></tr><tr><td>M=1</td><td>37.6</td><td>39.2</td><td>39.4</td><td>39.4</td></tr><tr><td>M=2</td><td>37.9</td><td>39.2</td><td>39.6</td><td>39.8</td></tr><tr><td>M=4</td><td>38.0</td><td>39.5</td><td>39.7</td><td>39.9</td></tr><tr><td>M=8</td><td>39.0</td><td>39.6</td><td>39.8</td><td>40.4</td></tr><tr><td>M=16</td><td>38.1</td><td>39.1</td><td>39.7</td><td>39.9</td></tr></table>
|
| 188 |
+
|
| 189 |
+
<table><tr><td></td><td>APCOcO</td><td>APOC</td></tr><tr><td>w/o mem</td><td>35.0</td><td>56.6</td></tr><tr><td>w/mem</td><td>35.1</td><td>56.5</td></tr></table>
|
| 190 |
+
|
| 191 |
+
<table><tr><td></td><td>T=5</td><td>T=10</td><td>T=15</td><td>T=20</td></tr><tr><td>Unified</td><td>38.1</td><td>38.9</td><td>39.7</td><td>39.9</td></tr><tr><td>Decomp</td><td>39.0</td><td>39.6</td><td>39.8</td><td>40.4</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Various decomposition strategies of encoders In Table 1, we observed the computational gaps derived from the decomposition of the encoder layers. Extending Table 1, we now investigate the how the decomposition strategies affect the accuracy in Table 3.
|
| 194 |
+
|
| 195 |
+
The models are evaluated with variety of window sizes $( T = 5 , 1 0 , 1 5 , 2 0 )$ as an increase of window size $T$ has pros and cons. When matching predictions from different clips, greater $T$ is advantageous due to an enlargement of temporal intersections between clips. On the contrary, frames in longer clips are likely to be composed of diverse appearances, which disrupt tracking and segmenting instances within a clip. Therefore, the key to the performance enhancement is to cope with the appearance changes by precisely encoding and correlating space-time inputs.
|
| 196 |
+
|
| 197 |
+
As shown in Table 3 (a), the full self-attention [11] surpasses the encoder without communications as the length of clips increase. However, the enlargement of the window size highly slows down the inference speed, and the improvements are marginal that the tremendous computation and memory usage cannot be compensated. The decomposition of space-time maintains comparable speed even if the window is large, but fails to achieve high accuracy.
|
| 198 |
+
|
| 199 |
+
Our model shows fast inference as the only additional computations of IFC are from utilizing a small number of memory tokens. Furthermore, by effectively encoding the space-time inputs with the communications between frames, IFC can take advantages of enlarging the window size, and surpasses other encoders.
|
| 200 |
+
|
| 201 |
+
Memory tokens We also study the effects of utilizing memory tokens. As mentioned, the motivation of using the memory tokens is to build communications between frames. Different from the video instance segmentation task, the image segmentation task is consisted of a single frame. Therefore, the use of the memory tokens does not lead to improvements to the image instance segmentation task as mutual communications cannot be solely made (see Table 3 (b)). Meanwhile, the utilization of the memory tokens achieves great improvements by effectively passing the information between frames. Results in Table 3 (a, c) demonstrate that the use of memory tokens achieves higher accuracy than the encoder without any communications (No comm), which emphasizes the importance of the communications. We evaluate how the size of the memory tokens affect the overall accuracy in Table 3 (c) and set the default size of the tokens $M$ to be 8.
|
| 202 |
+
|
| 203 |
+
In Section 3.1, we demonstrated the formulation of the inputs for Gather-Communicate layer, which groups the outputs of Encode-Receive by memory indices. As aforementioned, the formulation can be considered as a decomposition of memory tokens: insertion to the Gather-Communicate layer by separate $M$ groups each consisting of $T$ tokens. In Table 3 (d), we investigate the impact of inserting the unified $M T$ tokens as a whole. Compared to the unified insertion, the decomposition brings better accuracy as the memories of same indices have more correspondences, which ease the encoders to build attentions in between.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 3: Visualizations of results and attention maps of memory tokens.
|
| 207 |
+
|
| 208 |
+
We choose a memory index attending foreground instances and visualize the attention map in Fig. 3. As shown in the results of the upper clip, we find that the memory token has more interests to instances that are relatively difficult to detect; it more attends the heavily occluded car at the rear. The clip at the bottom is composed of frames with huge motion blurs and appearance changes. With the communications of memory tokens, IFC successfully tracks and segments the rabbit.
|
| 209 |
+
|
| 210 |
+
# 5 Conclusion
|
| 211 |
+
|
| 212 |
+
In this paper, we have proposed a novel video instance segmentation network using Inter-frame Communication Transformers (IFC), which alleviates full space-time attention and successfully builds communications between frames. Finally, our network presents a rapid inference and sets the new state-of-the-art on the YouTube-VIS dataset. For the future work, we plan to integrate temporal information, which indeed would take a step further to the human video understanding.
|
| 213 |
+
|
| 214 |
+
# Acknowledgments
|
| 215 |
+
|
| 216 |
+
This research was grant funded by the Artificial Intelligence Graduate School Program of Yonsei University, under Grant 2020-0-01361, Korea Evaluation Institute of Industrial Technology (KEIT) funded by the Ministry of Trade, Industry and Energy (10073129), and also supported by the Advanced Robotics Laboratory, part of the Future Technology Center at LG Electronics.
|
| 217 |
+
|
| 218 |
+
# References
|
| 219 |
+
|
| 220 |
+
[2] Cao, J., R. M. Anwer, H. Cholakkal, et al. Sipmask: Spatial information preservation for fast image and video instance segmentation. In ECCV. 2020.
|
| 221 |
+
[3] Yang, S., Y. Fang, X. Wang, et al. Crossover learning for fast online video instance segmentation. In ICCV. 2021.
|
| 222 |
+
[4] Liu, D., Y. Cui, W. Tan, et al. Sg-net: Spatial granularity network for one-stage video instance segmentation. In CVPR. 2021.
|
| 223 |
+
[5] He, K., G. Gkioxari, P. Dollar, et al. Mask r-cnn. In ICCV. 2017.
|
| 224 |
+
[6] Bolya, D., C. Zhou, F. Xiao, et al. Yolact: Real-time instance segmentation. In ICCV. 2019.
|
| 225 |
+
[7] Tian, Z., C. Shen, H. Chen. Conditional convolutions for instance segmentation. In ECCV. 2020.
|
| 226 |
+
[8] Chen, H., K. Sun, Z. Tian, et al. Blendmask: Top-down meets bottom-up for instance segmentation. In CVPR. 2020.
|
| 227 |
+
[9] Luo, W., J. Xing, A. Milan, et al. Multiple object tracking: A literature review. Artificial Intelligence, 2020.
|
| 228 |
+
[10] Bertasius, G., L. Torresani. Classifying, segmenting, and tracking object instances in video with mask propagation. In CVPR. 2020.
|
| 229 |
+
[11] Wang, Y., Z. Xu, X. Wang, et al. End-to-end video instance segmentation with transformers. In CVPR. 2020.
|
| 230 |
+
[12] Lin, H., R. Wu, S. Liu, et al. Video instance segmentation with a propose-reduce paradigm. In ICCV. 2021.
|
| 231 |
+
[13] Carion, N., F. Massa, G. Synnaeve, et al. End-to-end object detection with transformers. In ECCV. 2020.
|
| 232 |
+
[14] Vaswani, A., N. Shazeer, N. Parmar, et al. Attention is all you need. In NeurIPS. 2017.
|
| 233 |
+
[15] Wang, H., Y. Zhu, B. Green, et al. Axial-deeplab: Stand-alone axial-attention for panoptic segmentation. In ECCV. 2020.
|
| 234 |
+
[16] Bertasius, G., H. Wang, L. Torresani. Is space-time attention all you need for video understanding? In ICML. 2021.
|
| 235 |
+
[17] Arnab, A., M. Dehghani, G. Heigold, et al. Vivit: A video vision transformer. arXiv preprint arXiv:2103.15691, 2021.
|
| 236 |
+
[18] Wang, X., R. Girshick, A. Gupta, et al. Non-local neural networks. In CVPR. 2018.
|
| 237 |
+
[19] Kuhn, H. W. The hungarian method for the assignment problem. In Naval research logistics quarterly. 1955.
|
| 238 |
+
[20] Wang, H., Y. Zhu, H. Adam, et al. Max-deeplab: End-to-end panoptic segmentation with mask transformers. In CVPR. 2021.
|
| 239 |
+
[21] Dosovitskiy, A., L. Beyer, A. Kolesnikov, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR. 2021.
|
| 240 |
+
[22] Ranftl, R., A. Bochkovskiy, V. Koltun. Vision transformers for dense prediction. In ICCV. 2021.
|
| 241 |
+
[23] Devlin, J., M.-W. Chang, K. Lee, et al. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL. 2019.
|
| 242 |
+
[24] Touvron, H., M. Cord, M. Douze, et al. Training data-efficient image transformers & distillation through attention. In ICML. 2021.
|
| 243 |
+
[25] Kirillov, A., K. He, R. Girshick, et al. Panoptic segmentation. In CVPR. 2019.
|
| 244 |
+
[26] Tran, D., H. Wang, L. Torresani, et al. A closer look at spatiotemporal convolutions for action recognition. In CVPR. 2018.
|
| 245 |
+
[27] Lin, T.-Y., P. Dollar, R. Girshick, et al. Feature pyramid networks for object detection. In CVPR. 2017.
|
| 246 |
+
[28] Stewart, R., M. Andriluka, A. Y. Ng. End-to-end people detection in crowded scenes. In CVPR. 2016.
|
| 247 |
+
[29] Milletari, F., N. Navab, S.-A. Ahmadi. V-net: Fully convolutional neural networks for volumetric medical image segmentation. In 3DV. 2016.
|
| 248 |
+
[30] Lin, T.-Y., P. Goyal, R. Girshick, et al. Focal loss for dense object detection. In ICCV. 2017.
|
| 249 |
+
[31] He, K., X. Zhang, S. Ren, et al. Deep residual learning for image recognition. In CVPR. 2016.
|
| 250 |
+
[32] Athar, A., S. Mahadevan, A. Ošep, et al. Stem-seg: Spatio-temporal embeddings for instance segmentation in videos. In ECCV. 2020.
|
| 251 |
+
[33] Wu, Y., A. Kirillov, F. Massa, et al. Detectron2. https://github.com/facebookresearch/ detectron2, 2019.
|
| 252 |
+
[34] Loshchilov, I., F. Hutter. Decoupled weight decay regularization. In ICLR. 2019.
|
| 253 |
+
[35] Lin, T.-Y., M. Maire, S. Belongie, et al. Microsoft coco: Common objects in context. In ECCV. 2014.
|
| 254 |
+
[36] Dai, J., H. Qi, Y. Xiong, et al. Deformable convolutional networks. In ICCV. 2017.
|
| 255 |
+
[37] Cai, Z., N. Vasconcelos. Cascade r-cnn: Delving into high quality object detection. In CVPR. 2018.
|
md/train/rkpdnIqlx/rkpdnIqlx.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THE VARIATIONAL WALKBACK ALGORITHM
|
| 2 |
+
|
| 3 |
+
Anirudh Goyal∗, Nan Rosemary Ke†, Alex Lamb‡, Yoshua Bengio§
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
A recognized obstacle to training undirected graphical models with latent variables such as Boltzmann machines is that the maximum likelihood training procedure requires sampling from Monte-Carlo Markov chains which may not mix well, in the inner loop of training, for each example. We first propose the idea that it is sufficient to locally carve the energy function everywhere so that its gradient points in the “right” direction (i.e., towards generating the data). Following on previous work on contrastive divergence, denoising autoencoders, generative stochastic networks and unsupervised learning using non-equilibrium dynamics, we propose a variational bound on the marginal log-likelihood of the data which corresponds to a new learning procedure that first walks away from data points by following the model transition operator and then trains that operator to walk backwards for each of these steps, back towards the training example. The tightness of the variational bound relies on gradually increasing temperature as we walk away from the data, at each step providing a gradient on the parameters to maximize the probability that the transition operator returns to its previous state. Interestingly, this algorithm admits a variant where there is no explicit energy function, i.e., the parameters are used to directly define the transition operator. This also eliminates the explicit need for symmetric weights which previous Boltzmann machine or Hopfield net models require, and which makes these models less biologically plausible.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Although earlier research focused on generating data through Monte Carlo Markov chains (MCMCs), e.g. with various Boltzmann machines (Salakhutdinov & Hinton, 2009), most of the recent effort in designing deep generative models is based on single-step generation, e.g., with variational auto-encoders (VAEs) (Kingma & Welling, 2013; Rezende et al., 2014) and generative adversarial networks (GANs) (Goodfellow et al., 2014). However, generating a sample by going through a series of stochastic transformations that gradually improve the generated sample (or its latent representation) to make it more plausible could hold some advantages. A generative process can be seen as a mapping from simple noise variates (e.g., uniform, Gaussian) to samples from a very complicated distribution (maybe concentrated near a low-dimensional manifold) approximating the one which we are trying to learn from. If the data distribution is complex (e.g., the corresponding manifold is highly convoluted and non-linear), the generative process may involve a highly non-linear transformation which could be difficult to learn and optimize. Such highly non-linear transformations are probably best represented (and learned) by composing a large number of slightly non-linear transformations, either with a fixed-depth deep network, or with a variable depth recurrent computation, which is what the repeated application of a transition operator corresponds to.
|
| 12 |
+
|
| 13 |
+
# 1.1 MOTIVATIONS
|
| 14 |
+
|
| 15 |
+
The main motivation for the paper are the following.
|
| 16 |
+
|
| 17 |
+
• The main difference between feedforward generation and recurrent generation is twofold:(1) in the recurrent case, the same parameters are used for each step of the transition operator, and (2) by providing an interpretation of each of these steps as the application of a transition operator, we can design training procedures which do not require backpropagating through all the steps of the unfolded computation (from the raw noise samples to the generated output). This is a potential that clearly deserves to be explored further and motivates the learning framework introduced here.
|
| 18 |
+
|
| 19 |
+
• Another motivation for the Variational Walkback is the idea that we only need to carve the energy function in the right direction at each point in the space of the random variables of interest, which may sideskip the need to actually sample from the stationary distribution of a Markov chain in order to obtain the gradients of the training objective. The intuition is that if the model’s transition operator wants to move away from the data and into an area without data, this is a clue that the energy gradient is pointing in the wrong direction at that place. Consider a chain of samples following the model’s transition operator (or variants of it at different temperatures), starting at a data point. If the chain moves us away from data points, then we can use the previous state in the chain as a target for the operator when that operator is applied to the next next state, i.e., we want to teach the operator to walk back towards the data. This intuition was already exploited by Bengio et al. (2013c) but without a firm mathematical grounding. In Variational Walkback this is rigorously justified by a variational bound.
|
| 20 |
+
|
| 21 |
+
• Yet another motivation for the particular approach presented here is that it innovates in the rarely explored direction of parametrizing directly the generative model via a transition operator, rather than via an explicit probability function or energy function. This idea has already been discussed in the context Generative Stochastic Networks (GSNs) (Bengio et al., 2013b), a generalization of denoising auto-encoders (DAEs) (Vincent et al., 2008) which interprets the auto-encoder as estimating the gradient of an energy function (Alain & Bengio, 2014) or as a transition operator (Bengio et al., 2013c). An advantage of being able to parametrize directly the generator is seen with GANs and DAEs: we directly parametrize and learn the function which will be used to perform the task of interest (e.g. generating answers to some questions). Instead, the traditional approach is to parametrize a probability function or energy function (e.g., with a Boltzmann machine) and then then use another procedure (the MCMC method of your choice) to sample from it and do inference. Another important reason for exploring algorithms for directly learning a transition operator is that they put less constraint on the form of the transition operator, compared with a transition operator derived from an energy function. More specifically, neural net implementations of transition operators derived from an MCMC typically require the presence of symmetric weights (due to the symmetry of the second derivative of the energy with respect to a pair of units in the neural network), as discussed by Bengio et al. (2015). When we consider a biologically plausible implementation of these learning algorithms, the weight symmetry constraint $( W _ { i j } = W _ { j i } )$ ) is not reasonable as a hard constraint. Instead, if the transition operator (rather than the energy function) is the object being parametrized and learned, then there is no such hard constraint.
|
| 22 |
+
|
| 23 |
+
# 1.2 GENERAL THEORY
|
| 24 |
+
|
| 25 |
+
We introduce a novel variational bound which is an alternative to and improves upon the traditional reconstruction error as a training objective for DAEs and GSNs. Similar variational bounds have been used for VAEs as well as for the non-equilibrium thermodynamics generative models (SohlDickstein et al., 2015). A distribution $P$ over a chain of samples is defined, which corresponds to iteratively applying transition operators with shared parameters, starting from a pure noise initial state. We would like this process to produce training examples. An inverting flow $Q$ is defined starting from a training example (the “walk-away” trajectory), and following the transition operator of the model, i.e., estimating the posterior distribution of the generative chain produced by $P$ , given that it were landing at a training example. If the model does not match the data distribution, that chain $Q$ will tend to walk away from the training samples, and we want to inhibit that by training $P$ to “walk back”. Instead of using a completely different parametrization for the variational approximation of the posterior (the $Q$ distribution), like in VAEs and non-equilibrium dynamics, we propose to exploit the decomposition of $P$ as a series of stochastic transformations in order to parametrize $Q$ with the same parameters as $P$ , with the step-wise estimated posterior matching the correct one (from $P$ ) for all but the last step of the walk-away trajectory. To make the approximation in the last step of the chain of walk-away steps better (and thus the variational bound tighter) we introduce the idea of gradually increasing temperature at each step of the walk-away $Q$ chain of transitions (or gradually reducing temperature, at each step of the corresponding walkback trajectory under $P$ ). This also has the advantage that the training procedure will more easily converge to and eliminate spurious modes (those modes of the model where there is no nearby training data). This is because the walk-away $Q$ chain will be making large steps towards the dominant and most attractive modes when the temperature becomes large enough. Unless those modes are near data points, the walkback algorithm will thus “seek and destroy” these modes, these spurious modes.
|
| 26 |
+
|
| 27 |
+
We present a series of experimental results on several datasets illustrating the soundness of the proposed approach on the MNIST, CIFAR-10 and CelebA datasets.
|
| 28 |
+
|
| 29 |
+
# 2 MIXING-FREE TRAINING FRAMEWORK BASED ON THE WALKBACK IDEA
|
| 30 |
+
|
| 31 |
+
# 2.1 MAXIMUM LIKELIHOOD TRAINING OF UNDIRECTED GRAPHICAL MODELS
|
| 32 |
+
|
| 33 |
+
Let $\pmb { v }$ denote the vector of visible units and $^ { h }$ denote the vector of hidden random variables, with the full state of the model being $\pmb { s } = ( \pmb { v } , \pmb { h } )$ . Let $p _ { \theta }$ denote the model distribution, with joint energy function $E _ { \theta }$ and parameter vector $\pmb { \theta }$ :
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
p _ { \theta } ( s ) : = \frac { e ^ { - E _ { \theta } ( s ) } } { Z _ { \theta } } ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $Z _ { \theta }$ is the partition function
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
Z _ { \theta } : = \int e ^ { - E _ { \theta } ( s ) } d s .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Let $p _ { \mathcal { D } }$ be the training distribution, from which a sample $\mathcal { D }$ is typically drawn to obtain the training set. The maximum likelihood parameter gradient is
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\mathbb { E } _ { \boldsymbol { v } \sim p _ { \mathcal { D } } } \left[ - \frac { \partial \log p _ { \theta } ( \boldsymbol { v } ) } { \partial \theta } \right] = \mathbb { E } _ { \boldsymbol { v } \sim p _ { \mathcal { D } } , \boldsymbol { h } \sim p _ { \theta } ( \boldsymbol { h } \vert \boldsymbol { v } ) } \left[ \frac { \partial E _ { \theta } ( \boldsymbol { v } , \boldsymbol { h } ) } { \partial \theta } \right] - \mathbb { E } _ { \boldsymbol { s } \sim p _ { \theta } ( \boldsymbol { s } ) } \left[ \frac { \partial E _ { \theta } ( \boldsymbol { s } ) } { \partial \theta } \right]
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
which is zero when training has converged, with expected energy gradients in the positive phase (under $p _ { \mathcal { D } } ( \pmb { v } ) p _ { \pmb { \theta } } ( \pmb { h } | \pmb { v } ) )$ matching those under the negative phase (under $p _ { \pmb { \theta } } ( \pmb { s } ) _ { . }$ ). Note that in the (common) case of a log-linear model, the energy gradient (with respect to parameters) corresponds to the sufficient statistics of the model. Training thus consists in matching the shape of two distributions, as captured by the sufficient statistics: the positive phase distribution (influenced by the data, via the visible) and the negative phase distribution (where the model is free-running and generating configurations by itself).
|
| 52 |
+
|
| 53 |
+
# 2.2 MIXING-FREE TRAINING FRAMEWORK FOR UNDIRECTED GRAPHICAL MODELS
|
| 54 |
+
|
| 55 |
+
The basic idea of the proposed mixing-free training framework for undirected graphical models is the following. Instead of trying to match the whole positive phase and negative phase distributions (each of which require a difficult sampling operation, generally with an MCMC that may take very long time to mix between well separated modes), we propose to only match the shape of the energy function locally, around well-chosen points $\mathbf { \boldsymbol { s } } _ { t }$ . Another way to think about this is that instead of trying to directly maximize the likelihood of $p _ { \theta }$ which requires expensive inference (ideally an MCMC) in the inner loop of training (for each example $v \sim p _ { D } ,$ ), we would like to learn a transition operator $p _ { T } ( s _ { t + 1 } | s _ { t } )$ such that following it at temperature $T = 1$ would gradually move the state $\mathbf { \boldsymbol { s } } _ { t }$ towards the data generating distribution.
|
| 56 |
+
|
| 57 |
+
For this purpose, we propose to use a walkback strategy similar to the one introduced by Bengio et al. (2013c), illustrated in Algorithm 1. The idea is to start from a configuration of $\pmb { s }$ which is compatible with the observed data $_ { \textbf { \em x } }$ , let the state evolve according to our transition operator, and then punish it for these moves, making it more likely to make backwards transitions on this trajectory. If learning was completed, the only moves that would remain are those between highly probable configurations under the data generating distribution. The other ones would be “punished”, like a child walking away from its designated task and forced to walk back (towards the data)1. Following the model’s inclination in order to generate this random trajectory is more efficient than simply adding noise (like in the denoising auto-encoder (Vincent et al., 2008) or the non-equilibrium dynamics (Sohl-Dickstein et al., 2015) algorithms) because it makes the learning procedure focus its computation on state configurations corresponding to spurious modes to be eliminated. To make sure these spurious modes are approached efficiently, the proposed algorithm also includes the idea of gradually increasing temperature (i.e., the amount of noise) along this walk-away trajectory. At high temperature, the transition operator mixes very easily and quickly reaches the areas corresponding to large spurious modes.
|
| 58 |
+
|
| 59 |
+
Interestingly, all this comes out naturally of the variational bound presented below, rather than as something imposed in addition to the training objective.
|
| 60 |
+
|
| 61 |
+
# Algorithm 1 VariationalWalkback $( \pmb \theta )$
|
| 62 |
+
|
| 63 |
+
Train a generative model associated with a transition operator $p _ { T } ( s | s ^ { \prime } )$ at temperature $T$ (temperature 1 for sampling from the actual model). This transition operator injects noise of variance $T \sigma ^ { 2 }$ at each step, where $\bar { \sigma } ^ { 2 }$ is the noise level at temperature 1.
|
| 64 |
+
|
| 65 |
+
Require: Transition operator $p _ { T } ( s | s ^ { \prime } )$ from which one can both sample and compute the gradient of $\log p _ { T } ( s | s ^ { \prime } )$ with respect to parameters $\theta$ , given $\pmb { s }$ and $s ^ { \prime }$ .
|
| 66 |
+
|
| 67 |
+
Require: Precomputed $\sigma _ { \mathrm { d a t a } } ^ { \bar { 2 } }$ , the overall variance (or squared diameter) of the data. repeat
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } & { \dot { T } _ { \mathrm { m a x } } \frac { \sigma _ { \mathrm { d a t a } } ^ { 2 } } { \sigma ^ { 2 } } } \\ & { K \log _ { 2 } T _ { \mathrm { m a x } } } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
# 3 VARIATIONAL LOWER BOUND ON THE LOG-LIKELIHOOD
|
| 74 |
+
|
| 75 |
+
Let us first consider a way in which our model could approximately generate samples according to our model and the associated transition operator $p _ { T } ( s | s ^ { \prime } )$ . That process would start by sampling a state $s _ { K }$ inside a volume that contains all the data, e.g., with a broad Gaussian $p ^ { * } ( s _ { K } )$ whose variances are set according to the training data. Then we would sample $s _ { K - 1 }$ from $p _ { T _ { \mathrm { m a x } } } ( s | s ^ { \prime } =$ $s _ { K } )$ ), where $T _ { \mathrm { m a x } }$ is a high enough temperature so that the noise dominates the signal and is strong enough to move the state across the whole domain of the data on the visible portion of the state. If $\sigma _ { \mathrm { { d a t a } } } ^ { 2 } $ is the maximum variance of the data (corresponding to the visible dimensions of the state) and $\sigma ^ { 2 }$ is the amount noise injected by the transition operator on the visible units at temperature 1, then we could pick
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
T _ { \mathrm { m a x } } = { \frac { \sigma _ { \mathrm { d a t a } } ^ { 2 } } { \sigma ^ { 2 } } }
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
to achieve that goal. From that point on we are going to continue sampling the “previous” state $s _ { t }$ according to $p _ { T } \mathbf { \bar { ( } } s | s ^ { \prime } = s _ { t + 1 } )$ while gradually cooling the temperature, e.g. by dividing it by 2 after each step. In that case we would need
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
K = \log _ { 2 } T _ { \mathrm { m a x } }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
steps to reach a temperature of 1. Finally, we would look at the visible portion of $\scriptstyle { \pmb { s } } _ { 0 }$ to obtain the sampled $_ { \textbf { \em x } }$ . In practice, we would expect that a slower annealing schedule would yield samples more in agreement with the stationary distribution of $p _ { 1 } ( \pmb { s } | \pmb { s } ^ { \prime } )$ , but we explored this aggressive annealing schedule in order to obtain faster training.
|
| 88 |
+
|
| 89 |
+
The marginal probability of ${ \pmb v } = { \pmb x }$ at the end of the above $K$ -step process is thus $\begin{array} { r } { \mathsf { p } ( { \pmb x } ) = \int _ { { \pmb x } _ { 1 } ^ { K } } p _ { T _ { 0 } } ( { \pmb s } _ { 0 } = { \pmb x } | { \pmb s } _ { 1 } ) \left( \prod _ { t = 2 } ^ { K } p _ { T _ { t } } \big ( { \pmb s } _ { t - 1 } | { \pmb s } _ { t } \big ) \right) p ^ { * } ( { \pmb s } _ { K } ) d { \pmb s } _ { 1 } ^ { K } ( 6 ) \mathrm { w h e r e } T _ { t } \mathrm { \ i } } \end{array}$ s an annealing schedvariance ule with $\sigma _ { \mathrm { d a t a } } ^ { 2 }$ $T _ { 0 } ~ = ~ 1$ K max . We can rewrite this as follows by taking the log and multiplying and dividing by an and $T _ { K } = \dot { T } _ { \mathrm { m a x } }$ and $p ^ { * }$ is the “starting distribution”, such as the Gaussian of arbitrary distribution $q ( s _ { 1 } , \ldots , s _ { K } )$ decomposed into conditionals $q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } )$ :
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\begin{array} { r l r } { \log p ( \pmb { x } ) = \log \displaystyle \int _ { s _ { 1 } ^ { K } } q _ { T _ { 0 } } ( \pmb { x } ) q _ { T _ { 1 } } \big ( \pmb { s } _ { 1 } | \pmb { s } _ { 0 } ( \pmb { x } , \pmb { \cdot } ) \big ) \left( \displaystyle \prod _ { t = 2 } ^ { K } q _ { T _ { t } } ( \pmb { s } _ { t } | \pmb { s } _ { t - 1 } ) \right) } & { } & \\ { \frac { p _ { T _ { 0 } } \big ( \pmb { s } _ { 0 } = \pmb { x } | \pmb { s } _ { 1 } \big ) \left( \displaystyle \prod _ { t = 2 } ^ { K } p _ { T _ { t } } \big ( \pmb { s } _ { t - 1 } | \pmb { s } _ { t } \big ) \right) p ^ { \ast } ( \pmb { s } _ { K } ) } { q _ { T _ { 0 } } ( \pmb { x } ) q _ { T _ { 1 } } \big ( \pmb { s } _ { 1 } | \pmb { s } _ { 0 } = \pmb { x } \big ) \left( \displaystyle \prod _ { t = 2 } ^ { K } q _ { T _ { t } } \big ( \pmb { s } _ { t } | \pmb { s } _ { t - 1 } \big ) \right) } d s _ { 1 } ^ { K } } \end{array}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where we understand that $\scriptstyle { \pmb { s } } _ { 0 } \ = \ { \pmb { x } }$ . Now we can apply Jensen’s inequality as usual to obtain the variational bound
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { r l r } { \log p ( x ) \geq \mathcal { L } } \\ & { } & \\ & { \quad \quad = \int _ { s _ { 1 } ^ { K } } \qquad q _ { T _ { 0 } } ( x ) q _ { T _ { 1 } } ( s _ { 1 } | s _ { 0 } = x ) \left( \displaystyle \prod _ { t = 2 } ^ { K } q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } ) \right) } \\ & { } & { \log \frac { p _ { T _ { 0 } } ( s _ { 0 } = x | s _ { 1 } ) \left( \displaystyle \prod _ { t = 2 } ^ { K } p _ { T _ { t } } ( s _ { t - 1 } | s _ { t } ) \right) p ^ { * } ( s _ { K } ) } { q _ { T _ { 0 } } x q _ { T _ { 1 } } ( s _ { 1 } | s _ { 0 } = x ) \left( \displaystyle \prod _ { t = 2 } ^ { K } q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } ) \right) } d s _ { 1 } ^ { K } . } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
This bound is valid for any $q$ but will be tight when $\begin{array} { r l } { q ( s _ { K } , s _ { K - 1 } , \ldots , s _ { 1 } | s _ { 0 } ) } & { { } = } \end{array}$ $p ( s _ { K } , s _ { K - 1 } , \ldots , s _ { 1 } \vert s _ { 0 } )$ , and otherwise can be used to obtain a variational training objective. Note that both $q$ and $p$ can be decomposed as a product of one-step conditionals. Here, we can make most of the $q _ { T _ { t } }$ transition probabilities match their corresponding $p _ { T _ { t } }$ transition probabilities exactly, i.e., for $1 \leq t < K$ we use
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
q _ { T _ { t } } ( s | s ^ { \prime } ) = p _ { T _ { t } } ( s | s ^ { \prime } ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
The only approximations will be on both ends of the sequence:
|
| 108 |
+
|
| 109 |
+
• Sampling exactly from the model’s $p ( \pmb { v } = \pmb { x } )$ is typically not feasible exactly (it involves the usual posterior inference, e.g., as used in VAEs) but as explained below we will exploit properties of the algorithm to approximate this efficiently. We call the chosen approximation $q _ { 1 } ( \pmb { v } )$ .
|
| 110 |
+
At the last step, the optimal $q _ { T _ { K } } ( \pmb { s } _ { K } | \pmb { s } _ { K - 1 } )$ is not simply the model’s transition operator at temperature $T _ { K }$ , because this conditional also involves the marginal “starting distribution” $p ^ { * } ( s _ { K } )$ . However, because we have picked $T _ { K }$ large enough to make samples from $q _ { T _ { m a x } } \bigl ( \pmb { s } _ { K } \big | \pmb { s } _ { K - 1 } \bigr )$ dominated by noise of the same variance as that of $p ^ { * }$ , we expect the approximation to be good too.
|
| 111 |
+
|
| 112 |
+
# 3.1 ESTIMATING THE LOG-LIKELIHOOD USING IMPORTANCE SAMPLING
|
| 113 |
+
|
| 114 |
+
In practice we cannot compute $\mathcal { L }$ exactly (nor its gradient), but we can easily obtain an unbiased estimator of $\mathcal { L }$ (or of its gradient) by sampling $s _ { 1 } ^ { K }$ from the $q$ distributions, i.e., approximate the $\mathcal { L }$ integral by a single Monte-Carlo sample. This is what is done by the training procedure outlined in Algorithm 1, which thus performs stochastic gradient ascent on the variational bound $\mathcal { L }$ , and this will tend to also push up the log-likelihood $\log p ( { \pmb x } )$ of training examples $_ { \textbf { \em x } }$ . Note that such variational bounds have been used successfully in many learning algorithms in the past (Kingma & Welling, 2013; Lamb et al., 2016).
|
| 115 |
+
|
| 116 |
+
We derive an estimate of the negative log-likelihood by the following procedure. For each training example $x$ , we sample a large number of diffusion paths. We then use the following formulation to estimate the negative log-likelihood.
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { r } { \log p ( \pmb { x } ) = \log \mathbb { E } _ { \pmb { x } \sim p _ { \mathcal { D } } , q _ { T _ { 0 } } ( \pmb { x } ) q _ { T _ { 1 } } ( \pmb { s } _ { 1 } | \pmb { s } _ { 0 } ( \pmb { x } , ) ) \left( \prod _ { t = 2 } ^ { K } q _ { T _ { t } } ( \pmb { s } _ { t } | \pmb { s } _ { t - 1 } ) \right) } } \\ { \left[ \frac { p _ { T _ { 0 } } ( \pmb { s } _ { 0 } = \pmb { x } | \pmb { s } _ { 1 } ) \left( \prod _ { t = 2 } ^ { K } p _ { T _ { t } } ( \pmb { s } _ { t - 1 } | \pmb { s } _ { t } ) \right) p ^ { \ast } ( \pmb { s } _ { K } ) } { q _ { T _ { 0 } } ( \pmb { x } ) q _ { T _ { 1 } } ( \pmb { s } _ { 1 } | \pmb { s } _ { 0 } = \pmb { x } ) \left( \prod _ { t = 2 } ^ { K } q _ { T _ { t } } ( \pmb { s } _ { t } | \pmb { s } _ { t - 1 } ) \right) } \right] } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
# 4 TRANSITION OPERATORS FOR VARIATIONAL WALKBACK
|
| 123 |
+
|
| 124 |
+
Up to now we have not specified what the form of the transition operators should be. Two main variants are possible here. Either we directly parametrize the transition operator, like with denoising auto-encoders or generative stochastic networks, or we obtain our transition operator implicitly from some energy function, for example by applying some form of Gibbs sampling or Langevin MCMC to derive a transition operator associated with the energy function.
|
| 125 |
+
|
| 126 |
+
An advantage of the direct parametrization is that it eliminates the constraint to have symmetric weights, which is interesting from the point of view of biological plausibility of such algorithms. An advantage of the energy-based parametrization is that at the end of the day we get an energy function which could be used to compute the unnormalized joint probability of visible and latent variables. However, note that in both cases we can easily get an estimator of the log-likelihood by simply using our lower bound $\mathcal { L }$ , possibly improved by doing more expensive inference for $p _ { T _ { K } } ( \bar { s _ { K } } | s _ { K - 1 } )$ .
|
| 127 |
+
|
| 128 |
+
# 4.1 PARAMETRIC TRANSITION OPERATOR
|
| 129 |
+
|
| 130 |
+
In our experiments we considered Bernoulli and isotropic Gaussian transition operators for binary and real-valued data respectively.
|
| 131 |
+
|
| 132 |
+
When we sample from the transition operator we do not attempt to pass gradients through the sampling operation. Accordingly, backpropagation is performed locally on each step of the walk-back, and there is no flow of gradient between multiple walk-back steps.
|
| 133 |
+
|
| 134 |
+
Additionally, we use a “conservative” transition operator that averages its input image together with the sample from the learned distribution (or takes a weighted average with a fixed $\alpha$ weighting) for the transition operator. Just after parameter initialization, the distribution learned by the transition operator’s output is essentially random, so it is very difficult for the network to learn to reconstruct the value at the previous step.
|
| 135 |
+
|
| 136 |
+
# Bernoulli Transition Operator
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\rho = s i g m o i d ( \frac { ( 1 - \alpha ) * x _ { t - 1 } + \alpha * F _ { \rho } ( x _ { t - 1 } ) } { T _ { t } } )
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
# Gaussian Transition Operator
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\begin{array} { r } { \mu = ( 1 - \alpha ) * x _ { t - 1 } + \alpha * F _ { \mu } ( x _ { t - 1 } ) } \\ { } \\ \\ { \sigma = s i g m o i d ( T _ { t } \log ( 1 + e ^ { F _ { \sigma } ( x _ { t - 1 } ) } ) ) } \end{array}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$F _ { \rho } , F _ { \mu } , F _ { \sigma }$ are functions (in our case neural networks) which take the previous $\mathbf { X }$ value from the walkback chain and return estimates of the value of $\mu$ and $\sigma$ respectively. $T$ is the temperature which is dependent on the walkback step $t$ . $x _ { t - 1 }$ is the previous value in the walkback chain.
|
| 149 |
+
|
| 150 |
+
# 5 RELATED WORK
|
| 151 |
+
|
| 152 |
+
# Contrastive Divergence
|
| 153 |
+
|
| 154 |
+
This algorithm is clearly related to the contrastive divergence algorithm with $k = T$ steps (CD$k$ ). The CD- $k$ algorithm approximates the log-likelihood gradient by trying to match the sufficient statistics with the data clamped to the sufficient statistics after $k$ steps of the transition operator. The parameter update is the difference of these sufficient statistics, which also corresponds to pushing down the energy of the data-clamped configuration while pushing up the energy of the random variables after $k$ steps of the transition operator.
|
| 155 |
+
|
| 156 |
+
Two important differences are that, because the temperature is increasing in the variational walkback procedure,
|
| 157 |
+
|
| 158 |
+
1. the energy gradients $\frac { \partial E ( s ) } { \partial s }$ do not cancel each other telescopically along the chain from $s _ { 0 }$ to $s _ { T }$ , 2. as $t$ increases we move more and more randomly rather than following the energy of the model, allowing to hunt more effectively the areas near spurious modes.
|
| 159 |
+
|
| 160 |
+
A third difference is that the learning procedure is expressed in terms of the transition operator rather than directly in terms of the energy function. This allows one to thus train a transition operator directly, rather than indirectly via an energy function.
|
| 161 |
+
|
| 162 |
+
# Generative Stochastic Networks
|
| 163 |
+
|
| 164 |
+
The Generative Stochastic Networks (GSN) algorithm proposed by Bengio et al. (2013b) learns a transition operator by iteratively injecting noise and minimizing the reconstruction error after a number of transition operator steps starting at a data point, and back-propagating through all these steps. One thing in common is the idea of using the walkback intuition instead of isotropic noise in order to converge more efficiently. A major difference is that the algorithm proposed for GSNs involves the minimization of overall reconstruction error (from the input data point $x$ to the sampled reconstruction many steps later). This will tend to blur the learned distribution. Instead, the variational walk-back algorithm minimizes reconstruction error one step at a time along the walk-away trajectory.
|
| 165 |
+
|
| 166 |
+
In addition, the variational walkback GSNs require back-propagating through all the iterated steps, like the DRAW algorithm (Gregor et al., 2015). Instead the variational walk-back algorithm only requires back-propagating through a single step at a time of the transition operator. This should make it easier to train because we avoid having to optimize a highly non-linear transformation obtained by the composition of many transition operator steps.
|
| 167 |
+
|
| 168 |
+
# Non-Equilibrium Thermodynamics
|
| 169 |
+
|
| 170 |
+
There are two main differences between the Variational Walkback algorithm and the NonEquilibrium Thermodynamics:
|
| 171 |
+
|
| 172 |
+
1. Instead of isotropic noise to move away from the data manifold, we propose to use the model’s own transition operator, with the idea that it will “seek and destroy” the spurious modes much more efficiently than random moves.
|
| 173 |
+
2. Instead of injecting a fixed amount of noise per time step, we increase the noise as it moves away from the data manifold, and anneal the noise when we are close to the data manifold. This way, we can quickly reach the noise prior without loosing the details of the data. Our model takes significantly fewer steps to walk away and back to the manifold, as compared to the 1000 steps used for Non-Equilibrium Thermodynamics.
|
| 174 |
+
|
| 175 |
+
# Annealed Importance Sampling (AIS)
|
| 176 |
+
|
| 177 |
+
Annealed Importance Sampling is a sampling procedure. Like variational walkback, it uses an annealing schedule corresponding to a range of temperature from infinity to 1. It is used to estimate a partition function. Unlike Annealed Importance Sampling, variational walkback is meant to provide a good variational lower bound for training a transition operator.
|
| 178 |
+
|
| 179 |
+
# Reverse Annealed Importance Sampling Estimator (RAISE)
|
| 180 |
+
|
| 181 |
+
RAISE is a reverse AIS, as it starts from a data point and then increases the temperature. In this way it is similar to the Q-chain in variational walkback. The advantage of RAISE over AIS is that it yields an estimator of the log-likelihood that tends to be pessimistic rather than optimistic, which makes it better as an evaluation criteria.
|
| 182 |
+
|
| 183 |
+
Like AIS, RAISE estimates the log-likelihood using a form of importance sampling, based on a product (over the chain) of the ratios of consecutive probabilities (not conditional probabilities from the model). Variational walkback does not work with estimates of the model’s unconditional probability, and instead works directly with a conditional probability defined by the transition operator. It is for this reason that variational walkback does not need to have an explicit energy function).
|
| 184 |
+
|
| 185 |
+
# 6 EXPERIMENTS
|
| 186 |
+
|
| 187 |
+
We evaluated the variational walkback on three datasets: MNIST, CIFAR (Krizhevsky & Hinton, 2009), and CelebA (Liu et al., 2015). The MNIST and CIFAR datasets were used as is, but the aligned and cropped version of the CelebA dataset was scaled from $2 1 8 \times 1 7 8$ pixels to $7 8 \mathrm { ~ x ~ } 6 4$ pixels and center-cropped at $6 4 \mathrm { ~ x ~ } 6 4$ pixels (Liu et al., 2015). For all of our experiments we used the Adam optimizer (Kingma & Ba, 2014) and the Theano framework (Al-Rfou et al., 2016). The training procedure and architecture are detailed in appendix A.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 1: Samples on MNIST using a Bernoulli likelihood in the transition operator, 8 walkback steps during training, and 13 walkback steps during sampling. On right. Diffusion process for sampling MNIST digits starting from bernoiulli noise. This shows how the variational walkback iteratively generates images starting from a noise prior. For intermediate steps we display samples and for the final step (right) we display the transition operator’s mean.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Figure 2: Variational Walkback Inpainting MNIST the left half of digits conditioned on the right half. The goal is to fill in the left half of an MNIST digit given an observed right half of an image (drawn from validation set).
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 3: Original Images from CelebA (left), Variational Walkback Reconstructions (middle) and Samples (right).
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 4: Variational Walkback Samples on CIFAR10 (left and right).
|
| 200 |
+
|
| 201 |
+
We reported samples on CIFAR, MNIST, CelebA and inpainting results on MNIST. Our inpainting results on MNIST are competitive with generative stochastic networks and show somewhat higher consistency between the given part of the image and the generated portion (Bengio et al., 2013c). However, we note that our samples on CIFAR and CelebA show the same “blurring effect” that has been observed with autoencoder-based generative models trained to minimize reconstruction loss (Lamb et al., 2016).
|
| 202 |
+
|
| 203 |
+
# 7 CONCLUSION AND FUTURE WORK
|
| 204 |
+
|
| 205 |
+
We have introduced a new form of walk-back and a new algorithm for learning transition operators or undirected graphical models. Our algorithm learns a transition operator by allowing the model to walk-away from the data towards the noise prior and then teaching it to actually to have its transitions trained to go backwards each of these walk-away steps, i.e., towards the data manifold. Variational walk-back increases the temperature along the chain as it is moving further away from the data manifold, and inversely, anneals the temperature at generation time, as it gets closer to the estimated manifold. This allows the training procedure to quickly find and remove dominant spurious modes. Learning a transition operator also allows our model to learn only a conditional distribution at each step. This is much easier to learn, since it only needs to capture a few modes per step. The model also only locally carves the energy function, which means that it does not have to learn the entire joint probability distribution, but rather steps towards the right direction, making sure that everywhere it puts probability mass as well as around the data, the energy gradient is pointing towards the data.
|
| 206 |
+
|
| 207 |
+
Our experimental results have confirmed that the model can walk towards the data manifold in a few steps, even when the modes are sharp.
|
| 208 |
+
|
| 209 |
+
Future work should extend this algorithm and experiments in order to incorporate latent variables. The state would now include both the visible $\vec { x }$ and some latent $\vec { h }$ . Essentially the same procedure can be run, except for the need to initialize the chain with a state $\vec { s } = ( \vec { x } , \vec { h } )$ where $\vec { h }$ would ideally be an estimate of the posterior distribution of $\vec { h }$ given the observed data point $\vec { x }$ . Another interesting direction to expand this work is to replace the log-likelihood objective at each step by a GANlike objective, thus avoiding the need to inject noise independently on each of the pixels, during one application of the transition operator, and allowing the latent variable sampling to inject all the required high-level decisions associated with the transition. Based on the earlier results from Bengio et al. (2013a), sampling in the latent space rather than in the pixel space should allow for better generative models and even better mixing between modes.Bengio et al. (2013b)
|
| 210 |
+
|
| 211 |
+
# ACKNOWLEDGMENTS
|
| 212 |
+
|
| 213 |
+
The authors would like to thank Benjamin Scellier and Aaron Courville for their helpful feedback and discussions, as well as NSERC, CIFAR, Google, Samsung, Nuance, IBM and Canada Research Chairs for funding, and Compute Canada for computing resources.
|
| 214 |
+
|
| 215 |
+
# REFERENCES
|
| 216 |
+
|
| 217 |
+
Rami Al-Rfou, Guillaume Alain, Amjad Almahairi, and et al. Theano: A python framework for fast computation of mathematical expressions. CoRR, abs/1605.02688, 2016. URL http:// arxiv.org/abs/1605.02688.
|
| 218 |
+
|
| 219 |
+
Guillaume Alain and Yoshua Bengio. What regularized auto-encoders learn from the data-generating distribution. Journal of Machine Learning Research, 15(1):3563–3593, 2014.
|
| 220 |
+
|
| 221 |
+
Yoshua Bengio, Gregoire Mesnil, Yann Dauphin, and Salah Rifai. Better mixing via deep represen- ´ tations. 2013a.
|
| 222 |
+
|
| 223 |
+
Yoshua Bengio, Eric Thibodeau-Laufer, Guillaume Alain, and Jason Yosinski. Deep generative stochastic networks trainable by backprop. arXiv preprint arXiv:1306.1091, 2013b.
|
| 224 |
+
|
| 225 |
+
Yoshua Bengio, Li Yao, Guillaume Alain, and Pascal Vincent. Generalized denoising auto-encoders as generative models. CoRR, abs/1305.6663, 2013c. URL http://arxiv.org/abs/1305. 6663.
|
| 226 |
+
|
| 227 |
+
Yoshua Bengio, Dong-Hyun Lee, Jorg Bornschein, and Zhouhan Lin. Towards biologically plau- ¨ sible deep learning. CoRR, abs/1502.04156, 2015. URL http://arxiv.org/abs/1502. 04156.
|
| 228 |
+
|
| 229 |
+
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, pp. 2672–2680, 2014.
|
| 230 |
+
|
| 231 |
+
Karol Gregor, Ivo Danihelka, Alex Graves, and Daan Wierstra. Draw: A recurrent neural network for image generation. arXiv preprint arXiv:1502.04623, 2015.
|
| 232 |
+
|
| 233 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. CoRR, abs/1412.6980, 2014. URL http://arxiv.org/abs/1412.6980.
|
| 234 |
+
|
| 235 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 236 |
+
|
| 237 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images, 2009.
|
| 238 |
+
|
| 239 |
+
Alex Lamb, Vincent Dumoulin, and Aaron Courville. Discriminative regularization for generative models. arXiv preprint arXiv:1602.03220, 2016.
|
| 240 |
+
|
| 241 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of the IEEE International Conference on Computer Vision, pp. 3730–3738, 2015.
|
| 242 |
+
|
| 243 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv preprint arXiv:1511.06434, 2015.
|
| 244 |
+
|
| 245 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. arXiv preprint arXiv:1401.4082, 2014.
|
| 246 |
+
|
| 247 |
+
Ruslan Salakhutdinov and Geoffrey Hinton. Deep boltzmann machines. In Artificial Intelligence and Statistics, 2009.
|
| 248 |
+
|
| 249 |
+
Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. CoRR, abs/1503.03585, 2015. URL http://arxiv.org/abs/1503.03585.
|
| 250 |
+
|
| 251 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and composing robust features with denoising autoencoders. In Proceedings of the 25th international conference on Machine learning, pp. 1096–1103. ACM, 2008.
|
| 252 |
+
|
| 253 |
+
# A ARCHITECTURE DETAILS
|
| 254 |
+
|
| 255 |
+
The architecture that was used for the CelebA and CIFAR dataset was similar to the architecture used by Lamb et al. (2016), with a convolutional encoder followed by two fully connected hidden layers, followed by a decoder with strided convolutions (Radford et al., 2015). Batch norm was applied in all layers except for the last layer. For all layers except for the last we used the tanh activation function. Surprisingly, we were unable to obtain good results using the RELU or Leaky RELU activation .
|
| 256 |
+
|
| 257 |
+
On the binarized MNIST dataset we used a transition operator with Bernoulli outputs. A feedforward neural network was used to estimate the parameters (per-pixel probabilities) for the Bernoulli outputs. This neural network consisted of a single hidden layer with 4096 hidden units and the tanh activation function.
|
| 258 |
+
|
| 259 |
+
# B WALKBACK PROCEDURE DETAILS
|
| 260 |
+
|
| 261 |
+
The variational walkback algorithm has three unique hyperparameters. One is the number of walkback steps performed during training. Another is the number of walkback steps performed when sampling from the model. Still another is the temperature schedule used during training, reconstruction, or sampling.
|
| 262 |
+
|
| 263 |
+
The most conservative hyperparameter setting would involve using a large number of walkback steps during training and slowly increasing the temperature. However, this could make training slow, and if too few steps are used, the end of the walkback chain will not match the noise prior, leading to low quality samples.
|
| 264 |
+
|
| 265 |
+
A dynamic approach to setting the number of walkback steps and temperature schedule may be possible, but in this work we set these hyperparameters empirically. We found that during training√ using a temperature schedule of $T = T _ { 0 } { \sqrt { 2 ^ { t } } }$ produced good results, where $T _ { 0 } = 1 . 0$ is the initial temperature and $t$ is the step index. During sampling, we found good results using the reverse schedule: $\begin{array} { r } { T = \frac { \sqrt { 2 ^ { N } } } { \sqrt { 2 ^ { t } } } } \end{array}$ , where $t$ is the step index and $N$ is the total number of sampling steps.
|
| 266 |
+
|
| 267 |
+
For MNIST, we achieved our results using 8 training steps of walkback. For CIFAR, we used 15 training steps and 20 sampling steps. For CelebA, we used 30 training steps and 35 sampling steps. In general, we found that we could achieve higher quality results by using more steps during sampling then we used during training. We found that more difficult datasets, like CIFAR and CelebA, required longer walkback chains. Finally, our model is able to achieve results competitive with Non-Equilibrium Thermodynamics (Sohl-Dickstein et al., 2015), despite that method requiring chains with far more steps (1000 steps for MNIST).
|
| 268 |
+
|
| 269 |
+
# C ALTERNATIVE FORMULATION OF VARIATIONAL BOUND
|
| 270 |
+
|
| 271 |
+
The marginal probability of ${ \pmb v } = { \pmb x }$ at the end of the above $K$ -step process is thus
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
p ( \pmb { x } ) = \int _ { s _ { 1 } ^ { K } } \left( \prod _ { t = 1 } ^ { K } p _ { T _ { t } } ( s _ { t - 1 } | \pmb { s } _ { t } ) \right) p ^ { * } ( \pmb { s } _ { K } ) d \pmb { s } _ { 1 } ^ { K }
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
where tion”, $T _ { t }$ is an annealing schedule with as the Gaussian of variance $T _ { 0 } = 1$ and e ca $T _ { K } = T _ { \operatorname* { m a x } }$ and as fo $p ^ { * }$ is the “starting distribu-ws by taking the log and $\sigma _ { \mathrm { d a t a } } ^ { 2 }$
|
| 278 |
+
multiplying and dividing by an arbitrary distribution $q ( s _ { 1 } , \ldots , s _ { K } )$ decomposed into conditionals
|
| 279 |
+
$q _ { T _ { t } } \bigl ( \pmb { s } _ { t } | \pmb { s } _ { t - 1 } \bigr )$ :
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
q ( \pmb { s } _ { 0 } , \pmb { s } _ { 1 } , . . . , \pmb { s } _ { k } ) = \left( \prod _ { t = 1 } ^ { K } q _ { T _ { t } } ( \pmb { s } _ { t } | \pmb { s } _ { t - 1 } ) \right) q ( \pmb { s } _ { K } )
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
giving us:
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\log p ( \pmb { x } ) = \log \int _ { s _ { 1 } ^ { K } } q _ { T _ { 0 } } ( \pmb { x } ) \left( \prod _ { t = 1 } ^ { K } q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } ) \right) \frac { \left( \prod _ { t = 1 } ^ { K } p _ { T _ { t } } ( s _ { t - 1 } | s _ { t } ) \right) p ^ { * } ( s _ { K } ) } { q _ { T _ { 0 } } ( \pmb { x } ) \left( \prod _ { t = 1 } ^ { K } q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } ) \right) } d s _ { 1 } ^ { K }
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
where we understand that $\scriptstyle { \pmb { s } } _ { 0 } \ = \ { \pmb { x } }$ . Now we can apply Jensen’s inequality as usual to obtain the variational bound
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\begin{array} { r l } { \log p ( x ) \ge \mathcal { L } } & { = \displaystyle \int _ { s _ { 1 } ^ { K } } q _ { T _ { 0 } } ( x ) \left( \prod _ { t = 1 } ^ { K } q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } ) \right) \log \frac { \left( \prod _ { t = 1 } ^ { K } p _ { T _ { t } } ( s _ { t - 1 } | s _ { t } ) \right) p ^ { * } ( s _ { K } ) } { q _ { T _ { 0 } } ( x ) \left( \prod _ { t = 1 } ^ { K } q _ { T _ { t } } ( s _ { t } | s _ { t - 1 } ) \right) } d s _ { 1 } ^ { K } . } \end{array}
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
# D TIGHTNESS OF THE VARIATIONAL BOUND
|
| 298 |
+
|
| 299 |
+
We present an argument that running the walkback chain for a sufficient number of steps will cause the variational bound to become tight.
|
| 300 |
+
|
| 301 |
+
Consider a sequence $s _ { t } , ~ . . . , ~ s _ { 1 }$ generated in that order by our model p through a sequence of applications of the transition operator $\mathrm { T } ,$ i.e., $p ( s _ { 1 } , . . . , s _ { t } ) \ = \ p ( s _ { t } ) T ( s _ { t - 1 } | s _ { t } ) . . . T ( s _ { 1 } | s _ { 2 } )$ , i.e. $\bar { p ( s _ { n - 1 } | s _ { n } ) } = T ( s _ { n - 1 } | s _ { n } )$ , but note that $p ( s _ { n } | s _ { n - 1 } ) \neq p ( s _ { n - 1 } | s _ { n } )$ .
|
| 302 |
+
|
| 303 |
+
Let $p _ { i } ( s )$ denote the stationary distribution associated with T. Note that $\mathrm { T }$ and $p _ { i }$ and related by the detailed balance equation, i.e., $T ( s | s ^ { \prime } ) p _ { i } ( s ^ { \prime } ) = T ( s ^ { \prime } | s ) p _ { i } ( s )$ .
|
| 304 |
+
|
| 305 |
+
We want to approximate the posterior
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { r } { p ( s _ { t } , s _ { t - 1 } , . . . , s _ { 2 } | s _ { 1 } ) = \prod _ { n = 2 } ^ { t } p ( s _ { n } | s _ { n - 1 } ) } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
now by Bayes rule
|
| 312 |
+
|
| 313 |
+
So our approximation error in the posterior is the factor $\frac { p ( s _ { t } ) } { p _ { i } ( s _ { t } ) } \frac { p _ { i } ( s _ { 1 } ) } { p ( s _ { 1 } ) }$ .
|
| 314 |
+
|
| 315 |
+
If t is large enough, then $s _ { 1 }$ (being at the end of the generative sequence) has pretty much converged, i.e., $p ( s _ { 1 } ) \approx p _ { i } ( \bar { s } _ { 1 } )$ .
|
| 316 |
+
|
| 317 |
+
If we throw in temperature annealing along the way (now the notation would have to be changed to put an index n on both p and T), with the initial temperature being very high, then we can hope that the initial Gaussian $p ( s _ { t } )$ is very similar to the stationary distribution at high temperature $p _ { i } ( s _ { t } )$ .
|
| 318 |
+
|
| 319 |
+
These arguments suggest that as we make t larger and the final (initial) temperature larger as well, the approximation becomes better.
|
md/train/ryeNPi0qKX/ryeNPi0qKX.md
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LANGUAGE MODELING TEACHES YOU MORE SYNTAX THAN TRANSLATION DOES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Recent work using auxiliary prediction task classifiers to investigate the properties of LSTM representations has begun to shed light on why pretrained representations, like ELMo (Peters et al., 2018) and CoVe (McCann et al., 2017), are so beneficial for neural language understanding models. We still, though, do not yet have a clear understanding of how the choice of pretraining objective affects the type of linguistic information that models learn. With this in mind, we compare four objectives—language modeling, translation, skip-thought, and autoencoding—on their ability to induce syntactic and part-of-speech information. We make a fair comparison between the tasks by holding constant the quantity and genre of the training data, as well as the LSTM architecture. We find that representations from language models consistently perform best on our syntactic auxiliary prediction tasks, even when trained on relatively small amounts of data. These results suggest that language modeling may be the best data-rich pretraining task for transfer learning applications requiring syntactic information. We also find that the representations from randomly-initialized, frozen LSTMs perform strikingly well on our syntactic auxiliary tasks, but this effect disappears when the amount of training data for the auxiliary tasks is reduced.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Representation learning with deep recurrent neural networks has revolutionized natural language processing and replaced many of the expert-designed, linguistic features used previously. Recently, researchers have begun to investigate the properties of learned representations by training auxiliary classifiers that use the hidden states of frozen, pretrained models to perform other tasks. These investigations have shown that when deep LSTMs (Hochreiter & Schmidhuber, 1997) are trained on tasks like translation, they learn substantial syntactic and semantic information about their input sentences, including part-of-speech (Shi et al., 2016; Belinkov et al., 2017a;b; Blevins et al., 2018).
|
| 12 |
+
|
| 13 |
+
These intriguing findings lead us to ask the following questions:
|
| 14 |
+
|
| 15 |
+
1. How does the training task affect how well models learn syntactic properties? Which tasks are better at inducing these properties?
|
| 16 |
+
2. How does the amount of data the model is trained on affect these results? When does training on more data help?
|
| 17 |
+
|
| 18 |
+
We investigate these questions by holding the data source and model architecture constant, while varying both the training task and the amount of training data. Specifically, we examine models trained on English-German (En-De) translation, language modeling, skip-thought (Kiros et al., 2015), and autoencoding, and also compare to an untrained LSTM model as a baseline. We control for the data domain by exclusively training on datasets from the 2016 Conference on Machine Translation (WMT; Bojar et al., 2016). We train models on all tasks using the parallel En-De corpus, which allows us to make fair comparisons across tasks. We also train models on a subset of the this corpus to examine the effect of training data volume on learned representations. Additionally, we augment the parallel dataset with a large monolingual corpus from WMT to examine how the performance of the unsupervised tasks (all but translation) scale with more data.
|
| 19 |
+
|
| 20 |
+
Throughout our work, we focus on the syntactic evaluation tasks of part-of-speech (POS) tagging and Combinatorial Categorical Grammar (CCG) supertagging. Supertagging is considered a building block for parsing as these tags constrain the ways in which words can compose, largely determining the parse of the sentence. CCG supertagging thus allows us to measure the degree to which models learn syntactic structure above the word. We focus our analysis on representations learned by language models and by the encoders of sequence-to-sequence models, as translation encoders have been found to learn richer representations of POS and morphological information than translation decoders (Belinkov et al., 2017a).
|
| 21 |
+
|
| 22 |
+
We find that for POS and CCG tagging, bidirectional language models (BiLMs)—created by separately training forward and backward language models, and concatenating their hidden states— outperform models trained on all other tasks. Even BiLMs trained on relatively small amounts of data (1 million sentences) outperform translation and skip-thought models trained on larger datasets (5 million and 63 million sentences respectively).
|
| 23 |
+
|
| 24 |
+
Our inclusion of an untrained LSTM baseline allows us to study the effect of training on hidden state representations of LSTMs. We find, surprisingly, that when we use all of the available labeled tag data to train our auxiliary task classifiers, our best trained models (BiLMs) only outperform the randomly initialized, untrained LSTMs by a few percentage points. When we reduce the amount of classifier training data though, the performance of the randomly initialized LSTM model drops far below those of trained models. We hypothesize that this occurs because training the classifiers on large amounts of auxiliary task data allows them to memorize configurations of words seen in the training set and their associated tags. We test this hypothesis by training classifiers to predict the identity of neighboring words from a given hidden state, and find that randomly initialized models outperform all trained models on this task. Our findings demonstrate that our best trained models do well on the tagging tasks because they are truly learning representations that conform to our notions of POS and CCG tagging, and not simply because the classifiers we train are able to recover neighboring word identity information.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Evaluating Learned Representations Adi et al. (2016) introduce the idea of examining sentence vector representations by training auxiliary classifiers to take sentence encodings and predict attributes like word order. Belinkov et al. (2017a) build on this work by examining the hidden states of LSTMs trained on translation and find that they learn substantial POS and morphological information without direct supervision for these linguistic properties. Beyond translation, Blevins et al. (2018) find that deep LSTMs learn hierarchical syntax when trained on a variety of tasks—including semantic role labeling, language modeling, and dependency parsing. However, the models examined by Blevins et al. (2018) were also trained on different datasets, so it’s unclear if the differences in syntactic task performance are due to the training objectives or simply differences in the training data. By controlling for model size and the quantity and genre of the training data, we we are able to make direct comparisons between tasks on their ability to induce syntactic information.
|
| 29 |
+
|
| 30 |
+
Transfer Learning of Representations Much of the work on sentence-level pretraining has focused on sentence-to-vector models and evaluating learned representations on how well they can be used to perform sentence-level classification tasks. A prominent early success in this area with unlabeled data is skip-thought (Kiros et al., 2015), the technique of training a sequence-to-sequence model to predict the sentence preceding and following each sentence in a running text. InferSent (Conneau et al., 2017)—the technique of pretraining encoders on natural language inference data— yields strikingly better performance when such labeled data is available.
|
| 31 |
+
|
| 32 |
+
Work in transfer learning of representations has recently moved beyond strict sentence-to-vector mappings. Newer models that incorporate LSTMs or Transformer networks pretrained on datarich tasks, like translation and language modeling, have achieved state-of-the-art results on many tasks—including semantic role labeling, natural language inference, and coreference resolution (Peters et al., 2018; McCann et al., 2017; Howard & Ruder, 2018; Radford et al., 2018). Although comparisons have previously been made between translation and language modeling as pretraining tasks (Peters et al., 2018; Wang et al., 2018), we investigate this issue more thoroughly by controlling for the quantity and content of the training data.
|
| 33 |
+
|
| 34 |
+
Table 1: Perplexity of trained models by number of training sentences. All but the language models are 1000D BiLSTMs (500D per direction). The 500D forward and backward language models are combined into a single bidirectional language model for analysis experiments.
|
| 35 |
+
|
| 36 |
+
<table><tr><td>Task</td><td>Layer Size</td><td>Attn.</td><td>1 Million</td><td>5 Million</td><td>15 Million</td><td>63 Million</td></tr><tr><td>Translation</td><td>2×500D</td><td>Y</td><td>13.2 (17.6 BLEU)</td><td>9.1 (21.4 BLEU)</td><td>1</td><td>1</td></tr><tr><td>Translation</td><td>2×500D</td><td>N</td><td>25.2 (6.8 BLEU)</td><td>13.0 (12.3 BLEU)</td><td></td><td></td></tr><tr><td>LMForward</td><td>1×500D</td><td>1</td><td>104.8</td><td>81.2</td><td>82.3</td><td>76.9</td></tr><tr><td>LMBackward</td><td>1×500D</td><td>1</td><td>103.2</td><td>80.8</td><td>81.1</td><td>77.3</td></tr><tr><td>LMForward</td><td>1×1000D</td><td></td><td>103.8</td><td>73.6</td><td>69.2</td><td>66.5</td></tr><tr><td>Skip-Thought</td><td>2×500D</td><td>Y</td><td>99.0</td><td>69.2</td><td>68.7</td><td>67.9</td></tr><tr><td>Skip-Thought</td><td>2×500D</td><td>N</td><td>104.1</td><td>72.0</td><td>68.1</td><td>66.7</td></tr><tr><td>Autoencoder</td><td>2×500D</td><td>Y</td><td>1.0</td><td>1.0</td><td>1.0</td><td>1.0</td></tr><tr><td>Autoencoder</td><td>2×500D</td><td>N</td><td>1.0</td><td>1.1</td><td>1.2</td><td>1.1</td></tr></table>
|
| 37 |
+
|
| 38 |
+
Training Dataset Size The performance of neural models depends immensely on the amount of training data used. Koehn & Knowles (2017) find that when training machine translation models on corpora with fewer than 15 million words (English side), statistical machine translation approaches outperform neural ones. Similarly, Hestness et al. (2017) study the affect of training data volume on performance for several tasks—including translation and image classification. They find that for small amounts of data, neural models perform about as well as chance. After a certain threshold, model performance improves logarithmically with the amount of training data, but this eventually plateaus. With this in mind, we also vary the amount of training data to investigate the relationship between performance and data volume for each task.
|
| 39 |
+
|
| 40 |
+
Randomly Initialized Models Conneau et al. (2018) use randomly initialized LSTMs as a baseline when studying sentence-to-vector embedding models. They find that untrained models outperform many trained models on several auxiliary tasks, including predicting word content. Similarly in vision, untrained convolutional networks have been shown to capture many low-level image statistics and can be used for image denoising (Ulyanov et al., 2017). Our method of training auxiliary classifiers on randomly initialized RNNs builds on the tradition of reservoir computing, in which randomly initialized networks or “reservoirs” are fixed and only “read-out” classifier networks are trained (Lukosevi ˇ cius & Jaeger, 2009). Echo state networks—reservoir computing with recurrent ˇ models—have been used for tasks like speech recognition, language modeling, and time series prediction (Verstraeten et al., 2006; Tong et al., 2007; Sun et al., 2017).
|
| 41 |
+
|
| 42 |
+
# 3 METHODS
|
| 43 |
+
|
| 44 |
+
# 3.1 MAIN TRAINING DATA
|
| 45 |
+
|
| 46 |
+
We use the parallel English-German (En-De) dataset from the 2016 ACL Conference on Machine Translation (WMT) shared task on news translation (Bojar et al., 2016). This dataset contains 5 million ordered sentence translation pairs. We also use the 2015 English monolingual news discussion dataset from the same WMT shared task, which contains approximately 58 million ordered sentences. To examine how the volume of training data affects learned representations, we use four corpus sizes: 1, 5, 15, and 63 million sentences (translation is only trained on the smaller two sizes). We create the 1 million sentence corpora from the 5 million sentence dataset by sampling (i) sentence pairs for translation, (ii) English sentences for autoencoders, and (iii) ordered English sentence pairs for skip-thought and language models1. Similarly, we create the 15 million sentence corpora for the unsupervised tasks by sampling sentences from the entire corpus of 63 million sentences. We use word-level representations throughout and use the Moses package (Koehn et al., 2007) to tokenize and truecase our data. Finally, we limit both the English and German vocabularies to the $5 0 \mathrm { k }$ most frequent tokens in the training set.
|
| 47 |
+
|
| 48 |
+
Soon she was running the office RB PRP VBD VBG DT NN (a) POS tags
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 1: An annotated PTB example sentence.
|
| 52 |
+
|
| 53 |
+
(b) A CCG parse, with supertags shown immediately below the words.
|
| 54 |
+
|
| 55 |
+
# 3.2 MODEL ARCHITECTURE AND TRAINING
|
| 56 |
+
|
| 57 |
+
We train all our models using OpenNMT-py (Klein et al., 2017) and use the default options for model sizes, hyperparameters, and training procedure—except we increase the size of the LSTMs, make the encoders bidirectional, and use validation-based learning rate decay instead of a fixed schedule. Specifically, all our models (except language models) are 1000D, two-layer encoder-decoder LSTMs with bidirectional encoders (500D per direction) and 500D embeddings. We train models both with and without attention (Bahdanau et al., 2015). For language models, we train a 1000D forward language model and a bidirectional language model—two 500D language models (forward and backward) trained separately, whose hidden states are concatenated. All models, including our untrained baseline, are initialized from a uniform distribution $( - 0 . 1 , 0 . 1 )$ , the default in OpenNMT.
|
| 58 |
+
|
| 59 |
+
We use the same training procedure for all our models. We evaluate on the validation set every epoch when training on the 1 and 5 million sentence datasets, and evaluate approximately every 5 million sentences when training on the larger datasets. We use SGD with an initial learning rate of 1. Whenever a model’s validation loss increases relative to the previous evaluation, we halve the learning rate and stop training when the learning rate reaches $0 . 5 ^ { \mathbf { \hat { 1 } 5 } }$ . For each training task and dataset size, we select the model with the lowest validation perplexity to perform auxiliary task evaluations on. We report model performance in terms of perplexity and BLEU (Papineni et al., 2002) in Table 1. For translation we use beam search $\mathrm { B } = 5$ ) when decoding.
|
| 60 |
+
|
| 61 |
+
# 3.3 CLASSIFIER DATA AND ARCHITECTURE
|
| 62 |
+
|
| 63 |
+
POS and CCG For Part-of-Speech (POS) tagging evaluation, we use the Wall Street Journal (WSJ) portion of the Penn Treebank (PTB; Marcus et al., 1993) We follow the standard WSJ split (train 2-21; dev 22; test 23). The dataset contains approximately 50k sentences and 45 tag types.
|
| 64 |
+
|
| 65 |
+
For CCG supertagging, we use CCG Bank (Hockenmaier & Steedman, 2007), which is based on PTB WSJ. CCG supertagging provides fine-grained information about the role of each word in its larger syntactic context and is considered almost parsing, since sequences of tags map sentences to small subsets of possible parses. The entire dataset contains approximately $5 0 \mathrm { k }$ sentences and 1327 tag types. We display POS and CCG tags for an example sentence in Figure 1.
|
| 66 |
+
|
| 67 |
+
To study the impact of auxiliary task training data volume, for both datasets we create smaller classifier training sets by sampling $10 \%$ and $1 \%$ of the sentences. We truecase both datasets using the same truecase model trained on WMT and restrict the vocabularies to the $5 0 \mathrm { k }$ tokens used in pretraining our LSTM models. In addition to the untrained LSTM baseline, we also compare to the word-conditional most frequent class (WC-MFC)—the most frequently assigned tag class for each distinct word in the training set. For this baseline we restrict the vocabulary to that of our LSTM models and map all out-of-vocabulary words to a single UNK token. Note that while PTB and WMT are both drawn from news text, there is slight genre mismatch.
|
| 68 |
+
|
| 69 |
+
Word Identity For this task, the classifier takes a single LSTM hidden state as input and predicts the identity of the word at a different time step. For example, for the sentence “I love NLP” and a time step shift of -2, we would train the classifier to take the hidden state for “NLP” and predict the word “I”. We use the WSJ dataset for this task. Following Conneau et al. (2018), we take all words that occur between 100 and 1000 times (about 1000 words total) as the possible targets for neighboring word prediction.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
|
| 73 |
+
Figure 2: POS and CCG tagging accuracies for different amounts of LSTM encoder and classifier training data. We show results for the best performing layer of each model. Note, BiLMs are displayed with the attention models and forward LMs are displayed with the models without attention.
|
| 74 |
+
|
| 75 |
+
Classifier Training Procedure We train multi-layer perceptron (MLP) classifiers that take an LSTM hidden state (from one time step and one layer) and output a distribution over the possible labels (tags or word identities). The MLPs we train have a single 1000D hidden layer with a ReLU activation. For classifier training, we use the same training and learning rate decay procedure used for pretraining the LSTM encoders.
|
| 76 |
+
|
| 77 |
+
# 4 COMPARING PRETRAINING TASKS
|
| 78 |
+
|
| 79 |
+
In this section we discuss the main POS and CCG tagging results displayed in Figure 2. Overall, POS and CCG tagging accuracies tend to increase with the amount of data the LSTM encoders are trained on, but the marginal improvement decreases as the amount of training data increases.
|
| 80 |
+
|
| 81 |
+
Language Modeling and Translation For all pretraining dataset sizes, bidirectional language model (BiLM) and translation encoder representations perform best on both POS and CCG tagging. Translation encoders, however, slightly underperform BiLMs, even when both models are trained on the same amount of data. In fact, even BiLMs trained on the smallest amount of data (1 million sentences) outperform models trained on all other tasks and dataset sizes (up to 5 million sentences for translation, and 63 million sentences for skip-thought and autoencoding). Especially since BiLMs
|
| 82 |
+
|
| 83 |
+
(a) WC-MFC baselines for different amounts of PTB training data: $1 \%$ PTB: $8 1 . 8 \%$ ; $10 \%$ PTB: $8 8 . 6 \%$ ; $100 \%$ PTB: $8 9 . 9 \%$ .
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
(b) WC-MFC baselines for different amounts of CCG training data: $1 \%$ CCG: $6 2 . 3 \%$ ; $10 \%$ CCG: $6 8 . 3 \%$ ; $100 \%$ CCG: $7 1 . 6 \%$ .
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 3: POS and CCG tagging accuracies for different amounts of classifier training data in terms of percentage points over the word-conditional most frequent class (WC-MFC) baseline. We show results for the best performing layer and model for each task.
|
| 90 |
+
|
| 91 |
+
do not require aligned data to train, the superior performance of BiLM representations on these tasks suggests that BiLMs (like ELMo; Peters et al., 2018) are better than translation encoders (like CoVe; McCann et al., 2017) for transfer learning of syntactic information. One reason BiLMs perform relatively well on these syntactic tasks could be that in contrast to the encoders for the other tasks, LM encoders have a per-token loss. Note also that since our evaluation tasks also predict a single label for each token, this could be one reason that BiLMs perform so well on these tasks in particular.
|
| 92 |
+
|
| 93 |
+
For all amounts of training data, the BiLMs significantly outperform the 1000D forward-only language models. The gap in performance between bidirectional and forward language models is greater for CCG supertagging than for POS tagging. When using all available auxiliary training data, there is a 2 and 8 percentage point performance gap in POS and CCG tagging respectively. This difference in relative performance suggests that bidirectional context information is more important for identifying syntactic structure than for identifying part of speech.
|
| 94 |
+
|
| 95 |
+
Figure 2 illustrates how the best performing BiLMs and translation models tend to be more robust to decreases in classifier data than models trained on other tasks. Also, when training on less auxiliary task data, POS tagging performance tends to drop less than CCG supertagging performance. For the best model (BiLM trained on 63 million sentences), when using $1 \%$ rather than all of the auxiliary task training data, CCG accuracy drops 9 percentage points, while POS accuracy only drops 2 points. Further examinations of the effect of classifier data volume are displayed in Figure 3.
|
| 96 |
+
|
| 97 |
+
Skip-Thought Although skip-thought encoders consistently underperform both BiLMs and translation encoders in all data regimes we examine, skip-thought models improve the most when increasing the amount of pretraining data, and are the only models whose performance does not seem to have plateaued by 63 million training sentences. Since we train our language models on ordered sentences, as we do for skip-thought, our language models can be interpreted as a regularized versions of skip-thought, in which the weights of the encoder and decoder are shared. The increased model capacity of skip-thought, compared to language models, could explain the difference in learned representation quality—especially when these models are trained on smaller amounts of data.
|
| 98 |
+
|
| 99 |
+
Random Initialization For our randomly initialized, untrained LSTM encoders, we use the default weight initialization technique in OpenNMT-py, a uniform distribution between $- 0 . 1$ and 0.1; the only change we make is to set all biases to zero. We find that this baseline performs quite well when using all auxiliary data, and is only 3 and 8 percentage points behind the BiLM on POS and CCG tagging, respectively. We find that decreasing the amount of classifier data leads to a significantly greater drop in the untrained encoder performance compared to trained models. In the $1 \%$ classifier data regime, the performance of untrained encoders on both tasks drops below that of all trained models and below even the word-conditional most-frequent class baseline.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 4: POS and CCG tagging accuracies in terms of percentage points over the word-conditional most frequent class baseline. We display results for the best performing models for each task.
|
| 103 |
+
|
| 104 |
+
We hypothesize that the randomly initialized baseline is able to perform well on tagging tasks with large amounts of auxiliary task training data, because the classifier can learn the identity of neighboring words from a given time step’s hidden state, and simply memorize word configurations and their associated tags from the training data. We test this hypothesis directly in Section 6 and find that untrained LSTM representations are in fact better at capturing neighboring word identity information than any trained model.
|
| 105 |
+
|
| 106 |
+
Autoencoder Models trained on autoencoding are the only ones that do not consistently improve with the amount of training data, which is unsurprising as unregularized autoencoders are prone to learning identity mappings (Vincent et al., 2008). When training on $10 \%$ and $1 \%$ of the auxiliary task data, autoencoders outperform randomly initialized encoders and match the word-conditional most frequent class baseline. When training on all the auxiliary data though, untrained encoders outperform autoencoders. These results suggest that autoencoders learn some useful structure that is useful in the low auxiliary data regime. However, the representations autoencoders learn do not capture syntactically rich features, since random encoders outperform them in the high auxiliary data regime. This conclusion is further supported by the extremely poor performance of the second layer of an autoencoder without attention on POS tagging (almost 10 percentage points below the most frequent class baseline), as seen in Figure 4a.
|
| 107 |
+
|
| 108 |
+
# 5 COMPARING LAYERS
|
| 109 |
+
|
| 110 |
+
Embeddings (Layer 0) We find that randomly initialized embeddings consistently perform as well as the word-conditional most frequent class baseline on POS and CCG tagging, which serves as an upper bound on performance for the embedding layer. As these embeddings are untrained, the auxiliary classifiers are learning to memorize and classify the random vectors. When using all the auxiliary classifier data, there is no significant difference in the performance of trained and untrained embeddings on the tagging tasks. Only for smaller amounts of classifier data do trained embeddings consistently outperform randomly initialized ones.
|
| 111 |
+
|
| 112 |
+
Upper Layers Belinkov et al. (2017a) find that, for translation models, the first layer consistently outperforms the second on POS tagging. We find that this pattern holds for all our models, except in BiLMs, for which the first and second layers perform equivalently. The pattern holds even for untrained models, suggesting that POS information is stored on the lower layer, not necessarily because the training task encourages this, but because of properties of the deep LSTM architecture.
|
| 113 |
+
|
| 114 |
+
We also find that for CCG supertagging, the first layer also outperforms the second layer on untrained models. For the trained models though, the second layer performs better than the first in some cases. Which layer performs best appears to be independent of absolute performance on the supertagging task. Our layer analysis results are displayed in Figure 4.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 5: Performance of classifiers trained to predict the identity of the word a fixed number of timesteps away. Note, the forward LM has asymmetrical access to this information in its input.
|
| 118 |
+
|
| 119 |
+
# 6 WORD IDENTITY PREDICTION
|
| 120 |
+
|
| 121 |
+
Our results on word identity prediction are summarized in Figure 5 and given in more detail in Appendix A. While trained encoders outperform untrained ones on both POS and CCG tagging, we find that all trained LSTMs underperform untrained ones on word identity prediction. This finding confirms that trained encoders genuinely capture substantial syntactic features, beyond mere word identity, that the auxiliary classifiers can use.
|
| 122 |
+
|
| 123 |
+
We find that for both trained and untrained models, the first layer outperforms the second layer when predicting the identity of the immediate neighbors of a word. However, the second layer tends to outperform the first at predicting the identity of more distant neighboring words. This effect is especially apparent for the randomly initialized encoders. Our finding suggests that, as is the case for convolutional neural networks, depth in recurrent neural networks has the effect of increasing the receptive field and allows the upper layers to have representations that capture a larger context. These results reflect the findings of Blevins et al. (2018) that for trained models, upper levels of LSTMs encode more abstract syntactic information, since more abstract information generally requires larger context information.
|
| 124 |
+
|
| 125 |
+
# 7 CONCLUSION
|
| 126 |
+
|
| 127 |
+
By controlling for the genre and quantity of the training data, we make fair comparisons between several data-rich training tasks in their ability to induce syntactic information. We find that bidirectional language models (BiLMs) do better than translation and skip-thought encoders at extracting useful features for POS tagging and CCG supertagging. Moreover, this improvement holds even when the BiLMs are trained on substantially less data than competing models. Our results suggest that for transfer learning, BiLMs like ELMo (Peters et al., 2018) capture more useful features than translation encoders—and that this holds even on genres for which data is not abundant.
|
| 128 |
+
|
| 129 |
+
We also find that randomly initialized encoders extract usable features for POS and CCG tagging— at least when the auxiliary POS and CCG classifiers are themselves trained on reasonably large amounts of data. The performance of untrained models drops sharply relative to trained ones when using smaller amounts of the classifier data. We investigate further and find that untrained models outperform trained ones on the task of neighboring word identity prediction, which confirms that trained encoders do not perform well on tagging tasks because the classifiers are simply memorizing word identity information. We also find that both trained and untrained LSTMs store more local neighboring word identity information in lower layers and more distant word identity information in upper layers, which suggests that depth in LSTMs allow them to capture larger context information.
|
| 130 |
+
|
| 131 |
+
# REFERENCES
|
| 132 |
+
|
| 133 |
+
Yossi Adi, Einat Kermany, Yonatan Belinkov, Ofer Lavi, and Yoav Goldberg. Fine-grained Analysis of Sentence Embeddings Using Auxiliary Prediction Tasks. ICLR, 2016. URL http://arxiv. org/abs/1608.04207.
|
| 134 |
+
|
| 135 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural Machine Translation by Jointly Learning to Align and Translate. ICLR, 2015.
|
| 136 |
+
|
| 137 |
+
Yonatan Belinkov, Llu´ıs Marquez, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. \` Evaluating Layers of Representation in Neural Machine Translation on Part-of-Speech and Semantic Tagging Tasks. IJCNLP, 2017b. URL https://arxiv.org/abs/1801.07772.
|
| 138 |
+
|
| 139 |
+
Yonatan Belinkov, Nadir Durrani, Fahim Dalvi, Hassan Sajjad, and James R. Glass. What do Neural Machine Translation Models Learn about Morphology? ACL, 2017a. URL http://arxiv. org/abs/1704.03471.
|
| 140 |
+
|
| 141 |
+
Terra Blevins, Omer Levy, and Luke Zettlemoyer. Deep RNNs Learn Hierarchical Syntax. ACL, 2018.
|
| 142 |
+
|
| 143 |
+
Ondrej Bojar, Rajen Chatterjee, Christian Federmann, Yvette Graham, Barry Haddow, Matthias Huck, Antonio Jimeno Yepes, Philipp Koehn, Varvara Logacheva, Christof Monz, Matteo Negri, Aurelie Neveol, Mariana Neves, Martin Popel, Matt Post, Raphael Rubino, Carolina Scarton, Lucia Specia, Marco Turchi, Karin Verspoor, and Marcos Zampieri. Findings of the 2016 Conference on Machine Translation (WMT16). ACL, 2016.
|
| 144 |
+
|
| 145 |
+
Alexis Conneau, Douwe Kiela, Holger Schwenk, Loic Barrault, and Antoine Bordes. Supervised Learning of Universal Sentence Representations from Natural Language Inference Data. ACL, 2017.
|
| 146 |
+
|
| 147 |
+
Alexis Conneau, German Kruszewski, Guillaume Lample, Lo \` ¨ı Barrault, and Marco Baroni. What you can cram into a single \$&!#\* vector: Probing sentence embeddings for linguistic properties. ACL, 2018.
|
| 148 |
+
|
| 149 |
+
Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory F. Diamos, Heewoo Jun, Hassan Kianinejad, Md. Mostofa Ali Patwary, Yang Yang, and Yanqi Zhou. Deep Learning Scaling is Predictable, Empirically. arXiv preprint 1712.00409, 2017. URL http://arxiv.org/abs/ 1712.00409.
|
| 150 |
+
|
| 151 |
+
Sepp Hochreiter and Juergen Schmidhuber. Long Short-Term Memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
|
| 152 |
+
|
| 153 |
+
Julia Hockenmaier and Mark Steedman. CCGbank: A Corpus of CCG Derivations and Dependency Structures Extracted from the Penn Treebank. Computational Linguistics, 2007. URL http: //www.aclweb.org/anthology/J07-3004.
|
| 154 |
+
|
| 155 |
+
Jeremy Howard and Sebastian Ruder. Universal Language Model Fine-tuning for Text Classification. ACL, 2018. URL http://arxiv.org/abs/1801.06146.
|
| 156 |
+
|
| 157 |
+
Ryan Kiros, Yukun Zhu, Ruslan Salakhutdinov, Richard S. Zemel, Antonio Torralba, Raquel Urtasun, and Sanja Fidler. Skip-Thought Vectors. NIPS, 2015. URL http://arxiv.org/abs/ 1506.06726.
|
| 158 |
+
|
| 159 |
+
Guillaume Klein, Yoon Kim, Yuntian Deng, Jean Senellart, and Alexander M. Rush. OpenNMT: Open-Source Toolkit for Neural Machine Translation. ACL, 2017. doi: 10.18653/v1/P17-4012. URL https://doi.org/10.18653/v1/P17-4012.
|
| 160 |
+
|
| 161 |
+
Philip Koehn and Rebecca Knowles. Six Challenges for Neural Machine Translation. ACL, 2017.
|
| 162 |
+
|
| 163 |
+
Philipp Koehn, Hieu Hoang, Alexandra Birch, Chris Callison-Burch, Marcello Federico, Nicola Bertoldi, Brooke Cowan, Wade Shen, Christine Moran, Richard Zens, Chris Dyer, Ondˇrej Bojar, Alexandra Constantin, and Evan Herbst. Moses: Open Source Toolkit for Statistical Machine Translation. ACL, 2007. URL http://www.statmt.org/moses/.
|
| 164 |
+
|
| 165 |
+
Mantas Lukosevi ˇ cius and Herbert Jaeger. Reservoir computing approaches to recurrent neural net- ˇ work training. In Computer Science Review, volume 3, pp. 127–149, 2009.
|
| 166 |
+
|
| 167 |
+
Mitchell P. Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a Large Annotated Corpus of English: The Penn Treebank. Computational Linguistics, 1993. URL http://dl. acm.org/citation.cfm?id $=$ 972470.972475.
|
| 168 |
+
|
| 169 |
+
Bryan McCann, James Bradbury, Caiming Xiong, and Richard Socher. Learned in Translation: Contextualized Word Vectors. NIPS, 2017.
|
| 170 |
+
|
| 171 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a Method for Automatic Evaluation of Machine Translation. ACL, 2002. URL http://www.aclweb.org/ anthology/P02-1040.pdf.
|
| 172 |
+
|
| 173 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. NAACL, 2018. URL http: //arxiv.org/abs/1802.05365.
|
| 174 |
+
|
| 175 |
+
Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving Language Understanding by Generative Pre-Training. 2018. URL http://openai-assets.s3. amazonaws.com/research-covers/language-unsupervised/language_ understanding_paper.pdf.
|
| 176 |
+
|
| 177 |
+
Xing Shi, Inkit Padhi, and Kevin Knight. Does String-Based Neural MT Learn Source Syntax? EMNLP, 2016. URL https://www.isi.edu/natural-language/mt/ emnlp16-nmt-grammar.pdf.
|
| 178 |
+
|
| 179 |
+
Xiaochuan Sun, Tao Li, Qun Li, Yue Huang, and Yingqi Li. Deep belief echo-state network and its application to time series prediction. Knowl.-Based Syst., 130:17–29, 2017.
|
| 180 |
+
|
| 181 |
+
Matthew H. Tong, Adam D. Bickett, Eric M. Christiansen, and Garrison W. Cottrell. Learning grammatical structure with echo state networks. Neural Networks, 20(3):424–432, 2007. doi: 10. 1016/j.neunet.2007.04.013. URL https://doi.org/10.1016/j.neunet.2007.04. 013.
|
| 182 |
+
|
| 183 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep Image Prior. NIPS, 2017.
|
| 184 |
+
|
| 185 |
+
David Verstraeten, Benjamin Schrauwen, and Dirk Stroobandt. Reservoir-based techniques for speech recognition. In The 2006 IEEE International Joint Conference on Neural Network Proceedings, pp. 1050–1053, July 2006. doi: 10.1109/IJCNN.2006.246804.
|
| 186 |
+
|
| 187 |
+
Pascal Vincent, Hugo Larochelle, Yoshua Bengio, and Pierre-Antoine Manzagol. Extracting and Composing Robust Features with Denoising Autoencoders. In Machine Learning, Proceedings of the Twenty-Fifth International Conference (ICML 2008), Helsinki, Finland, June 5-9, 2008, pp. 1096–1103, 2008.
|
| 188 |
+
|
| 189 |
+
Alex Wang, Amapreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding. 2018. URL https://arxiv.org/abs/1804.07461.
|
| 190 |
+
|
| 191 |
+
# A RANDOMLY INITIALIZED ENCODERS
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 6: Here we display results for the word identity prediction task with randomly initialized LSTM encoders with up to 4 layers. Lower layers have a more peaked shape and upper layers a more flat shape, meaning that the lower layers encode relatively more nearby neighboring word information, while upper layers encode relatively more distant neighboring word information.
|
| 195 |
+
|
| 196 |
+
# B POS AND CCG EVALUATION FULL RESULTS
|
| 197 |
+
|
| 198 |
+
B.1 TRAINING CLASSIFIERS ON ALL DATA
|
| 199 |
+
Table 2: Here we display results for training on all of auxiliary task data. Word-conditional most frequent class baselines for this amount of training data are $8 9 . 9 \%$ for POS tagging and $7 1 . 6 \%$ for CCG supertagging. For each task, we underline the best performance for each training dataset size and bold the best overall performance.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Training task</td><td>Data</td><td>Attention</td><td>POS L2</td><td>POS L1</td><td>POS LO</td><td>CCG L2</td><td>CCG L1</td><td>CCG LO</td></tr><tr><td>Random Init 1</td><td>None</td><td>N/A</td><td>90.5</td><td>93.7</td><td>90.2</td><td>83.5</td><td>85.4</td><td>71.6</td></tr><tr><td>Random Init 2</td><td>None</td><td>N/A</td><td>90.3</td><td>93.8</td><td>90.1</td><td>83.3</td><td>85.3</td><td>71.5</td></tr><tr><td>Translation</td><td>1M</td><td>Yes</td><td>95.6</td><td>95.7</td><td>90.0</td><td>91.4</td><td>91.2</td><td>71.5</td></tr><tr><td>Translation</td><td>1M</td><td>No</td><td>92.5</td><td>95.0</td><td>90.0</td><td>88.2</td><td>90.1</td><td>71.3</td></tr><tr><td>LM (Bidir)</td><td>1M</td><td>No</td><td>96.4</td><td>96.1</td><td>90.2</td><td>92.5</td><td>92.0</td><td>71.6</td></tr><tr><td>LM (Forward)</td><td>1M</td><td>No</td><td>94.3</td><td>94.5</td><td>90.1</td><td>83.5</td><td>83.1</td><td>71.5</td></tr><tr><td>Skip-thought</td><td>1M</td><td>Yes</td><td>44.3</td><td>88.6</td><td>89.9</td><td>45.3</td><td>81.0</td><td>71.1</td></tr><tr><td>Skip-thought</td><td>1M</td><td>No</td><td>78.1</td><td>90.8</td><td>89.9</td><td>74.5</td><td>84.4</td><td>71.1</td></tr><tr><td>Autoencoder</td><td>1M</td><td>Yes</td><td>80.8</td><td>92.4</td><td>89.6</td><td>73.6</td><td>83.7</td><td>71.2</td></tr><tr><td>Autoencoder</td><td>1M</td><td>No</td><td>79.8</td><td>90.8</td><td>89.9</td><td>79.2</td><td>84.0</td><td>71.1</td></tr><tr><td>Translation</td><td>5M</td><td>Yes</td><td>96.0</td><td>95.9</td><td>90.2</td><td>92.2</td><td>91.6</td><td>71.5</td></tr><tr><td>Translation</td><td>5M</td><td>No</td><td>92.9</td><td>95.8</td><td>90.2</td><td>89.6</td><td>91.2</td><td>71.5</td></tr><tr><td>LM(Bidir)</td><td>5M</td><td>No</td><td>96.6</td><td>96.2</td><td>90.3</td><td>92.6</td><td>92.4</td><td>71.6</td></tr><tr><td>LM (Forward)</td><td>5M</td><td>No</td><td>94.6</td><td>94.7</td><td>90.2</td><td>84.0</td><td>83.5</td><td>71.5</td></tr><tr><td>Skip-thought</td><td>5M</td><td>Yes</td><td>76.4</td><td>92.2</td><td>90.0</td><td>68.4</td><td>86.4</td><td>71.1</td></tr><tr><td>Skip-thought</td><td>5M</td><td>No</td><td>86.1</td><td>94.3</td><td>90.0</td><td>81.2</td><td>88.6</td><td>71.2</td></tr><tr><td>Autoencoder</td><td>5M</td><td>Yes</td><td>88.1</td><td>91.8</td><td>89.6</td><td>76.5</td><td>82.5</td><td>70.8</td></tr><tr><td>Autoencoder</td><td>5M</td><td>No</td><td>70.7</td><td>92.1</td><td>89.8</td><td>72.7</td><td>83.7</td><td>71.0</td></tr><tr><td>LM (Bidir)</td><td>15M</td><td>No</td><td>97.0</td><td>96.8</td><td>90.6</td><td>93.1</td><td>92.9</td><td>72.0</td></tr><tr><td>LM (Forward)</td><td>15M</td><td>No</td><td>95.3</td><td>95.3</td><td>90.6</td><td>84.9</td><td>84.5</td><td>72.0</td></tr><tr><td>Skip-thought</td><td>15M</td><td>Yes</td><td>82.3</td><td>93.8</td><td>90.2</td><td>70.4</td><td>87.6</td><td>71.6</td></tr><tr><td>Skip-thought</td><td>15M</td><td>No</td><td>90.1</td><td>95.1</td><td>90.3</td><td>85.8</td><td>89.8</td><td>71.5</td></tr><tr><td>Autoencoder</td><td>15M</td><td>Yes</td><td>91.9</td><td>93.1</td><td>90.1</td><td>82.6</td><td>84.5</td><td>71.4</td></tr><tr><td>Autoencoder</td><td>15M</td><td>No</td><td>71.6</td><td>92.0</td><td>89.8</td><td>71.0</td><td>83.7</td><td>71.2</td></tr><tr><td>LM (Bidir)</td><td>63M</td><td>No</td><td>96.9</td><td>96.7</td><td>90.6</td><td>93.1</td><td>93.0</td><td>72.0</td></tr><tr><td>LM (Forward)</td><td>63M</td><td>No</td><td>95.3</td><td>95.4</td><td>90.6</td><td>84.9</td><td>84.5</td><td>72.0</td></tr><tr><td>Skip-thought</td><td>63M</td><td>Yes</td><td>90.6</td><td>95.5</td><td>90.3</td><td>80.9</td><td>90.1</td><td>71.6</td></tr><tr><td>Skip-thought</td><td>63M</td><td>No</td><td>91.6</td><td>95.6</td><td>90.3</td><td>86.8</td><td>90.3</td><td>71.6</td></tr><tr><td>Autoencoder</td><td>63M</td><td>Yes</td><td>89.4</td><td>91.8</td><td>89.6</td><td>78.4</td><td>83.2</td><td>71.2</td></tr><tr><td>Autoencoder</td><td>63M</td><td>No</td><td>70.2</td><td>91.7</td><td>89.9</td><td>70.5</td><td>83.1</td><td>71.3</td></tr></table>
|
| 202 |
+
|
| 203 |
+
B.2 TRAINING CLASSIFIERS ON $10 \%$ OF DATA
|
| 204 |
+
Table 3: Here we display results for training on $10 \%$ of auxiliary task data. Word-conditional most frequent class baselines for this amount of training data are $8 8 . 6 \%$ for POS tagging and $6 8 . 3 \%$ for CCG supertagging. For each task, we underline the best performance for each training dataset size and bold the best overall performance.
|
| 205 |
+
|
| 206 |
+
<table><tr><td>Training task</td><td>Data</td><td>Attention</td><td>POS L2</td><td>POS L1</td><td>POS LO</td><td>CCG L2</td><td>CCG L1</td><td>CCG L0</td></tr><tr><td>Random Init 1</td><td>None</td><td>N/A</td><td>85.0</td><td>90.5</td><td>88.3</td><td>71.8</td><td>77.0</td><td>68.3</td></tr><tr><td>Random Init 2</td><td>None</td><td>N/A</td><td>84.9</td><td>90.6</td><td>88.3</td><td>72.7</td><td>77.0</td><td>68.3</td></tr><tr><td>Translation</td><td>1M</td><td>Yes</td><td>93.4</td><td>94.3</td><td>89.1</td><td>88.4</td><td>87.6</td><td>69.5</td></tr><tr><td>Translation</td><td>1M</td><td>No</td><td>89.9</td><td>93.4</td><td>89.0</td><td>82.9</td><td>86.0</td><td>69.5</td></tr><tr><td>LM (Bidir)</td><td>1M</td><td>No</td><td>95.5</td><td>95.2</td><td>89.7</td><td>89.4</td><td>88.6</td><td>70.1</td></tr><tr><td>LMForward</td><td>1M</td><td>No</td><td>93.2</td><td>93.5</td><td>89.5</td><td>80.8</td><td>80.2</td><td>69.9</td></tr><tr><td>Skip-thought</td><td>1M</td><td>Yes</td><td>34.3</td><td>84.1</td><td>88.2</td><td>36.7</td><td>74.0</td><td>68.3</td></tr><tr><td>Skip-thought</td><td>1M</td><td>No</td><td>71.3</td><td>86.9</td><td>88.2</td><td>64.9</td><td>78.0</td><td>68.1</td></tr><tr><td>Autoencoder</td><td>1M</td><td>Yes</td><td>77.9</td><td>89.6</td><td>87.7</td><td>71.5</td><td>77.4</td><td>68.3</td></tr><tr><td>Autoencoder</td><td>1M</td><td>No</td><td>71.2</td><td>87.9</td><td>88.6</td><td>71.8</td><td>78.1</td><td>68.8</td></tr><tr><td>Translation</td><td>5M</td><td>Yes</td><td>94.1</td><td>94.8</td><td>89.5</td><td>88.9</td><td>88.2</td><td>69.8</td></tr><tr><td>Translation</td><td>5M</td><td>No</td><td>89.2</td><td>94.4</td><td>89.5</td><td>85.4</td><td>87.6</td><td>69.9</td></tr><tr><td>LM (Bidir)</td><td>5M</td><td>No</td><td>95.7</td><td>95.3</td><td>89.8</td><td>89.6</td><td>88.9</td><td>70.2</td></tr><tr><td>LMForward</td><td>5M</td><td>No</td><td>93.3</td><td>93.7</td><td>89.7</td><td>81.4</td><td>80.6</td><td>70.1</td></tr><tr><td>Skip-thought</td><td>5M</td><td>Yes</td><td>66.8</td><td>89.6</td><td>88.7</td><td>60.8</td><td>81.0</td><td>68.7</td></tr><tr><td>Skip-thought</td><td>5M</td><td>No</td><td>81.2</td><td>92.1</td><td>88.7</td><td>73.4</td><td>83.7</td><td>68.7</td></tr><tr><td>Autoencoder</td><td>5M</td><td>Yes</td><td>84.9</td><td>89.0</td><td>87.6</td><td>71.8</td><td>76.1</td><td>67.9</td></tr><tr><td>Autoencoder</td><td>5M</td><td>No</td><td>65.6</td><td>89.6</td><td>88.4</td><td>65.8</td><td>77.9</td><td>68.3</td></tr><tr><td>LM (Bidir)</td><td>15M</td><td>No</td><td>96.1</td><td>95.9</td><td>90.2</td><td>89.7</td><td>89.9</td><td>70.6</td></tr><tr><td>LMForward</td><td>15M</td><td>No</td><td>94.1</td><td>94.5</td><td>90.1</td><td>82.1</td><td>81.8</td><td>70.6</td></tr><tr><td>Skip-thought</td><td>15M</td><td>Yes</td><td>72.8</td><td>91.4</td><td>89.0</td><td>63.2</td><td>82.6</td><td>68.9</td></tr><tr><td>Skip-thought</td><td>15M</td><td>No</td><td>84.6</td><td>93.2</td><td>89.0</td><td>79.8</td><td>85.5</td><td>69.1</td></tr><tr><td>Autoencoder</td><td>15M</td><td>Yes</td><td>88.3</td><td>90.3</td><td>88.4</td><td>76.6</td><td>78.9</td><td>68.7</td></tr><tr><td>Autoencoder</td><td>15M</td><td>No</td><td>68.5</td><td>89.2</td><td>88.3</td><td>68.6</td><td>78.1</td><td>68.6</td></tr><tr><td>LM (Bidir)</td><td>63M</td><td>No</td><td>96.1</td><td>96.0</td><td>90.2</td><td>90.0</td><td>90.1</td><td>70.7</td></tr><tr><td>LMForward</td><td>63M</td><td>No</td><td>94.3</td><td>94.4</td><td>90.2</td><td>82.3</td><td>81.8</td><td>70.6</td></tr><tr><td>Skip-thought</td><td>63M</td><td>Yes</td><td>85.0</td><td>94.0</td><td>89.2</td><td>73.9</td><td>86.0</td><td>69.4</td></tr><tr><td>Skip-thought</td><td>63M</td><td>No</td><td>88.0</td><td>94.0</td><td>89.3</td><td>81.6</td><td>86.1</td><td>69.3</td></tr><tr><td>Autoencoder</td><td>63M</td><td>Yes</td><td>82.8</td><td>88.9</td><td>87.4</td><td>72.7</td><td>77.3</td><td>68.4</td></tr><tr><td>Autoencoder</td><td>63M</td><td>No</td><td>67.2</td><td>89.5</td><td>88.5</td><td>66.1</td><td>77.2</td><td>68.5</td></tr></table>
|
| 207 |
+
|
| 208 |
+
B.3 TRAINING CLASSIFIERS ON $1 \%$ OF DATA
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Training task</td><td>Data</td><td>Attn.</td><td>POS L2</td><td>POS L1</td><td>POS LO</td><td>CCG L2</td><td>CCG L1</td><td>CCG L0</td></tr><tr><td>Random Init 1</td><td>None</td><td>N/A</td><td>68.7</td><td>74.5</td><td>79.1</td><td>54.4</td><td>60.9</td><td>59.3</td></tr><tr><td>Random Init 2</td><td>None</td><td>N/A</td><td>68.8</td><td>74.5</td><td>79.5</td><td>55.5</td><td>62.0</td><td>58.8</td></tr><tr><td>Translation</td><td>1M</td><td>Yes</td><td>90.8</td><td>91.7</td><td>87.2</td><td>79.1</td><td>81.0</td><td>65.4</td></tr><tr><td>Translation</td><td>1M</td><td>No</td><td>82.5</td><td>89.9</td><td>86.9</td><td>69.0</td><td>78.3</td><td>65.0</td></tr><tr><td>LM (Bidir)</td><td>1M</td><td>No</td><td>93.5</td><td>93.8</td><td>89.0</td><td>82.8</td><td>81.6</td><td>67.1</td></tr><tr><td>LMForward</td><td>1M</td><td>No</td><td>90.8</td><td>91.8</td><td>88.5</td><td>74.3</td><td>74.1</td><td>66.5</td></tr><tr><td>Skip-thought</td><td>1M</td><td>Yes</td><td>27.2</td><td>73.2</td><td>81.4</td><td>28.7</td><td>63.3</td><td>60.7</td></tr><tr><td>Skip-thought</td><td>1M</td><td>No</td><td>57.8</td><td>77.5</td><td>81.3</td><td>47.4</td><td>67.9</td><td>61.0</td></tr><tr><td>Autoencoder</td><td>1M</td><td>Yes</td><td>71.2</td><td>81.4</td><td>81.8</td><td>59.0</td><td>67.4</td><td>61.9</td></tr><tr><td>Autoencoder</td><td>1M</td><td>No</td><td>62.2</td><td>78.7</td><td>84.2</td><td>60.2</td><td>69.4</td><td>63.5</td></tr><tr><td>Translation</td><td>5M</td><td>Yes</td><td>92.1</td><td>92.9</td><td>88.2</td><td>77.3</td><td>81.2</td><td>65.7</td></tr><tr><td>Translation</td><td>5M</td><td>No</td><td>82.7</td><td>91.7</td><td>88.0</td><td>73.5</td><td>80.7</td><td>65.9</td></tr><tr><td>LM (Bidir)</td><td>5M</td><td>No</td><td>93.7</td><td>94.0</td><td>89.1</td><td>83.0</td><td>82.4</td><td>67.1</td></tr><tr><td>LMForward</td><td>5M</td><td>No</td><td>90.7</td><td>92.1</td><td>88.8</td><td>74.3</td><td>74.3</td><td>66.7</td></tr><tr><td>Skip-thought</td><td>5M</td><td>Yes</td><td>55.3</td><td>83.4</td><td>84.8</td><td>44.5</td><td>72.4</td><td>63.0</td></tr><tr><td>Skip-thought</td><td>5M</td><td>No</td><td>69.6</td><td>86.0</td><td>84.4</td><td>53.5</td><td>75.1</td><td>62.7</td></tr><tr><td>Autoencoder</td><td>5M</td><td>Yes</td><td>67.6</td><td>79.5</td><td>80.8</td><td>58.8</td><td>64.6</td><td>61.0</td></tr><tr><td>Autoencoder</td><td>5M</td><td>No</td><td>60.7</td><td>81.1</td><td>82.6</td><td>56.0</td><td>68.7</td><td>61.8</td></tr><tr><td>LM (Bidir)</td><td>15M</td><td>No</td><td>94.4</td><td>94.7</td><td>89.6</td><td>82.8</td><td>83.7</td><td>67.5</td></tr><tr><td>LMForward</td><td>15M</td><td>No</td><td>91.7</td><td>93.1</td><td>89.3</td><td>74.8</td><td>75.8</td><td>67.3</td></tr><tr><td>Skip-thought</td><td>15M</td><td>Yes</td><td>50.7</td><td>85.4</td><td>84.9</td><td>29.6</td><td>73.8</td><td>63.5</td></tr><tr><td>Skip-thought</td><td>15M</td><td>No</td><td>75.2</td><td>88.1</td><td>84.9</td><td>63.5</td><td>77.4</td><td>63.7</td></tr><tr><td>Autoencoder</td><td>15M</td><td>Yes</td><td>77.9</td><td>82.3</td><td>81.9</td><td>66.9</td><td>68.7</td><td>62.6</td></tr><tr><td>Autoencoder</td><td>15M</td><td>No</td><td>61.2</td><td>80.4</td><td>82.3</td><td>56.6</td><td>69.8</td><td>62.0</td></tr><tr><td>LM (Bidir)</td><td>63M</td><td>No</td><td>94.3</td><td>94.8</td><td>89.7</td><td>82.9</td><td>83.9</td><td>67.5</td></tr><tr><td>LMForward</td><td>63M</td><td>No</td><td>92.1</td><td>93.3</td><td>89.4</td><td>74.9</td><td>76.2</td><td>67.6</td></tr><tr><td>Skip-thought</td><td>63M</td><td>Yes</td><td>69.8</td><td>90.2</td><td>86.3</td><td>55.4</td><td>78.1</td><td>64.4</td></tr><tr><td>Skip-thought</td><td>63M</td><td>No</td><td>77.9</td><td>89.6</td><td>86.1</td><td>64.8</td><td>78.4</td><td>64.0</td></tr><tr><td>Autoencoder</td><td>63M</td><td>Yes</td><td>72.1</td><td>80.1</td><td>81.5</td><td>58.7</td><td>66.8</td><td>61.3</td></tr><tr><td>Autoencoder</td><td>63M</td><td>No</td><td>60.6</td><td>80.6</td><td>82.3</td><td>55.7</td><td>68.6</td><td>61.7</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 4: Here we display results for training on $1 \%$ of auxiliary task data. Word-conditional most frequent class baselines for this amount of training data are $8 1 . 8 \%$ for POS tagging and $6 2 . 3 \%$ for CCG supertagging. For each task, we underline the best performance for each training dataset size and bold the best overall performance.
|
md/train/ryepFJbA-/ryepFJbA-.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON CONVERGENCE AND STABILITY OF GANS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We propose studying GAN training dynamics as regret minimization, which is in contrast to the popular view that there is consistent minimization of a divergence between real and generated distributions. We analyze the convergence of GAN training from this new point of view to understand why mode collapse happens. We hypothesize the existence of undesirable local equilibria in this non-convex game to be responsible for mode collapse. We observe that these local equilibria often exhibit sharp gradients of the discriminator function around some real data points. We demonstrate that these degenerate local equilibria can be avoided with a gradient penalty scheme called DRAGAN. We show that DRAGAN enables faster training, achieves improved stability with fewer mode collapses, and leads to generator networks with better modeling performance across a variety of architectures and objective functions.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generative modeling involves taking a set of samples drawn from an unknown data generating distribution $P _ { r e a l }$ and finding an estimate $P _ { m o d e l }$ that closely resembles it. Generative adversarial networks (GAN) (Goodfellow et al., 2014) is a powerful framework used for fitting implicit generative models. The basic setup consists of two networks, the generator and the discriminator, playing against each other in a repeated zero-sum game setting. The goal here is to reach an equilibrium where $P _ { r e a l }$ , $P _ { m o d e l }$ are close, and the alternating gradient updates procedure (AGD) is used to achieve this. However, this process is highly unstable and often results in mode collapse (Goodfellow, 2017). This calls for an deeper investigation into training dynamics of GANs.
|
| 12 |
+
|
| 13 |
+
In this paper, we propose studying GAN training dynamics as a repeated game in which both the players are using no-regret algorithms (Cesa-Bianchi & Lugosi, 2006) and discuss how AGD 1 falls under this paradigm. In contrast, much of the theory (Goodfellow et al., 2014; Arjovsky & Bottou, 2017) and recent developments (Nowozin et al., 2016; Arjovsky et al., 2017; Gulrajani et al., 2017) are based on the unrealistic assumption that the discriminator is playing optimally (in the function space) at each step and as a result, there is consistent minimization of a divergence between real and generated distributions. This corresponds to at least one player using the best-response algorithm (in the function space), and the resulting game dynamics can be completely different in both these cases (Nisan et al., 2007). Thus, there is a clear disconnect between theoretical arguments used as motivation in recent literature and what actually happens in practice.
|
| 14 |
+
|
| 15 |
+
We would like to point out that the latter view can still be useful for reasoning about the asymptotic equilibrium situation but we argue that regret minimization is the more appropriate way to think about GAN training dynamics. So, we analyze the convergence of GAN training from this new point of view to understand why mode collapse happens. We start with a short analysis of the artificial convex-concave case of the GAN game in section 2.2. This setting has a unique solution and guaranteed convergence (of averaged iterates) using no-regret algorithms can be shown with standard arguments from game theory literature. Here, we make explicit, the critical (previously not widely known) connection between AGD used in GAN training and regret minimization. This immediately yields a novel proof for the asymptotic convergence of GAN training, in the non-parametric limit. Prior to our work, such a result (Goodfellow et al., 2014) required a strong assumption that the discriminator is optimal at each step.
|
| 16 |
+
|
| 17 |
+
However, these convergence results do not hold when the game objective function is non-convex, which is the practical case when deep neural networks are used. In non-convex games, global regret minimization and equilibrium computation are computationally hard in general. Recent gametheoretic literature indicates that AGD can end up cycling (Mertikopoulos et al., 2017) or converging to a (potentially bad) local equilibrium, under some conditions (Hazan et al., 2017). We hypothesize these to be the reasons for cycling and mode collapse observed during GAN training, respectively (section 2.3). In this work, we do not explore the cycling issue but focus our attention on the mode collapse problem. In contrast to our hypothesis, the prevalent view of mode collapse and instability (Arjovsky & Bottou, 2017) is that it results from attempting to minimize a strong divergence during training. However, as we argued earlier, GAN training with AGD does not consistently minimize a divergence and therefore, such a theory is not suitable to discuss convergence or to address the stability issue.
|
| 18 |
+
|
| 19 |
+
Next, if mode collapse is indeed the result of an undesirable local equilibrium, a natural question then is how we can avoid it? We make a simple observation that, in the GAN game, mode collapse situations are often accompanied by sharp gradients of the discriminator function around some real data points (section 2.4). Therefore, a simple strategy to mitigate mode collapse is to regularize the discriminator so as to constrain its gradients in the ambient data space. We demonstrate that this improves the stability using a toy experiment with one hidden layer neural networks. This gives rise to a new explanation for why WGAN and gradient penalties might be improving the stability of GAN training – they are mitigating the mode collapse problem by keeping the gradients of the discriminator function small in data space. From this motivation, we propose a training algorithm involving a novel gradient penalty scheme called DRAGAN (Deep Regret Analytic Generative Adversarial Networks) which enables faster training, achieves improved stability and modeling performance (over WGAN-GP (Gulrajani et al., 2017) which is the state-of-the-art stable training procedure) across a variety of architectures and objective functions.
|
| 20 |
+
|
| 21 |
+
Below, we provide a short literature review. Several recent works focus on stabilizing the training of GANs. While some solutions (Radford et al., 2015; Salimans et al., 2016) require the usage of specific architectures (or) modeling objectives, some (Che et al., 2016; Zhao et al., 2016) significantly deviate from the original GAN framework. Other promising works in this direction (Metz et al., 2016; Arjovsky et al., 2017; Qi, 2017; Gulrajani et al., 2017) impose a significant computational overhead. Thus, a fast and versatile method for consistent stable training of GANs is still missing in the literature. Our work is aimed at addressing this.
|
| 22 |
+
|
| 23 |
+
To summarize, our contributions are as follows:
|
| 24 |
+
|
| 25 |
+
• We propose a new way of reasoning about the GAN training dynamics - by viewing AGD as regret minimization.
|
| 26 |
+
• We provide a novel proof for the asymptotic convergence of GAN training in the nonparametric limit and it does not require the discriminator to be optimal at each step.
|
| 27 |
+
• We discuss how AGD can converge to a potentially bad local equilibrium in non-convex games and hypothesize this to be responsible for mode collapse during GAN training.
|
| 28 |
+
• We characterize mode collapse situations with sharp gradients of the discriminator function around some real data points.
|
| 29 |
+
• A novel gradient penalty scheme called DRAGAN is introduced based on this observation and we demonstrate that it mitigates the mode collapse issue.
|
| 30 |
+
|
| 31 |
+
# 2 THEORETICAL ANALYSIS OF GAN TRAINING DYNAMICS
|
| 32 |
+
|
| 33 |
+
We start with a brief description of the GAN framework (section 2.1). We discuss guaranteed convergence in the artificial convex-concave case using no-regret algorithms, and make a critical connection between GAN training process (AGD) and regret minimization (section 2.2). This immediately yields a novel proof for the asymptotic convergence of GAN training in the nonparametric limit. Then, we consider the practical non-convex case and discuss how AGD can converge to a potentially bad local equilibrium here (section 2.3). We characterize mode collapse situations with sharp gradients of the discriminator function around real samples and this provides an effective strategy to avoid them. This naturally leads to the introduction of our gradient penalty scheme DRAGAN (section 2.4). We end with a discussion and comparison with other gradient penalties in the literature (section 2.5).
|
| 34 |
+
|
| 35 |
+
# 2.1 BACKGROUND
|
| 36 |
+
|
| 37 |
+
The GAN framework can be viewed as a repeated zero-sum game, consisting of two players - the generator, which produces synthetic data given some noise source and the discriminator, which is trained to distinguish generator’s samples from the real data. The generator model G is parameterized by $\phi$ , takes a noise vector $\mathbf { z }$ as input, and produces a synthetic sample $G _ { \phi } ( \mathbf { z } )$ . The discriminator model $\mathrm { D }$ is parameterized by $\theta$ , takes a sample $\mathbf { x }$ as input and computes $D _ { \theta } ( \mathbf { x } )$ , which can be interpreted as the probability that $\mathbf { x }$ is real.
|
| 38 |
+
|
| 39 |
+
The models $\mathbf { G }$ , D can be selected from any arbitrary class of functions – in practice, GANs typical rely on deep networks for both. Their cost functions are defined as
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\begin{array} { r l } & { J ^ { ( D ) } ( \phi , \theta ) : = - \mathbb { E } _ { x \sim p _ { r e a l } } \log D _ { \theta } ( x ) - \mathbb { E } _ { \mathbf { z } } \log ( 1 - D _ { \theta } ( G _ { \phi } ( z ) ) ) , \mathrm { ~ a r ~ } } \\ & { J ^ { ( G ) } ( \phi , \theta ) : = - J ^ { ( D ) } ( \phi , \theta ) } \end{array}
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
And the complete game can be specified as -
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\underset { \phi } { \operatorname* { m i n } } \underset { \theta } { \operatorname* { m a x } } \left\{ J ( \phi , \theta ) = \mathbb { E } _ { x \sim p _ { r e a l } } \log D _ { \theta } ( x ) + \mathbb { E } _ { \mathbf { z } } \log ( 1 - D _ { \theta } ( G _ { \phi } ( z ) ) ) \right\}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The generator distribution $P _ { m o d e l }$ asymptotically converges to the real distribution $P _ { r e a l }$ if updates are made in the function space and the discriminator is optimal at each step (Goodfellow et al., 2014).
|
| 52 |
+
|
| 53 |
+
2.2 CONVEX-CONCAVE CASE AND NO-REGRET ALGORITHMS
|
| 54 |
+
|
| 55 |
+
According to Sion’s theorem (Sion, 1958), if $\Phi \subset \mathbb { R } ^ { m }$ , $\Theta \subset \mathbb { R } ^ { n }$ such that they are compact and convex sets, and the function $J : \Phi \times \Theta \mathbb { R }$ is convex in its first argument and concave in its second, then we have -
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\operatorname* { m i n } _ { \phi \in \Phi } \operatorname* { m a x } _ { \theta \in \Theta } J ( \phi , \theta ) = \operatorname* { m a x } _ { \theta \in \Theta } \operatorname* { m i n } _ { \phi \in \Phi } J ( \phi , \theta )
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
That is, an equilibrium is guaranteed to exist in this setting where players’ payoffs correspond to the unique value of the game (Neumann, 1928).
|
| 62 |
+
|
| 63 |
+
A natural question then is how we can find such an equilibrium. A simple procedure that players can use is best-response algorithms (BRD). In each round, best-responding players play their optimal strategy given their opponent’s current strategy. Despite its simplicity, BRD are often computationally intractable and they don’t lead to convergence even in simple games. In contrast, a technique that is both efficient and provably works is regret minimization. If both players update their parameters using no-regret algorithms, then it is easy to show that their averaged iterates will converge to an equilibrium pair (Nisan et al., 2007). Let us first define no-regret algorithms.
|
| 64 |
+
|
| 65 |
+
Definition 2.1 (No-regret algorithm). Given a sequence of convex loss functions $L _ { 1 } , L _ { 2 } , \dots :$ $K \mathbb { R }$ , an algorithm that selects a sequence of $k _ { t }$ ’s, each of which may only depend on previously observed $L _ { 1 } , \dots , L _ { t - 1 }$ , is said to have no regret if $\begin{array} { r } { \frac { R ( T ) } { T } = o ( 1 ) } \end{array}$ , where we define
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { r } { R ( T ) : = \sum _ { t = 1 } ^ { T } L _ { t } ( k _ { t } ) - \operatorname* { m i n } _ { k \in K } \sum _ { t = 1 } ^ { T } L _ { t } ( k ) } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
We can apply no-regret learning to our problem of equilibrium finding in the GAN game $J ( \cdot , \cdot )$ as follows. The generator imagines the function $J ( \cdot , \theta _ { t } )$ as its loss function on round $t$ , and similarly the discriminator imagines computes the average itera $- J ( \phi _ { t } , \cdot )$ unctiand $t$ $T$ oun. If f play, each playeris the equilibrium $\begin{array} { r } { \stackrel { \cdot } { \phi } _ { T } : = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \phi _ { \underline { { t } } } } \end{array}$ $\begin{array} { r } { \bar { \theta } _ { T } : = \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \theta _ { t } } \end{array}$ $V ^ { * }$ value of the game, and the players suffer regret $R _ { 1 } ( T )$ and $\bar { R _ { 2 } ( T ) }$ respectively, then one can show using standard arguments (Freund & Schapire, 1999) that -
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { V ^ { * } - \frac { R _ { 2 } ( T ) } { T } \le \operatorname* { m a x } _ { \theta \in \Theta } J \big ( \bar { \phi } _ { T } , \theta \big ) - \frac { R _ { 2 } ( T ) } { T } \le \operatorname* { m i n } _ { \phi \in \Phi } J \big ( \phi , \bar { \theta } _ { T } \big ) + \frac { R _ { 1 } ( T ) } { T } \le V ^ { * } + \frac { R _ { 1 } ( T ) } { T } . } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
In other words, $\bar { \theta } _ { T }$ and $\bar { \phi } _ { T }$ are "almost optimal" solutions to the game, where the "almost" approximation factor is given by the average regret terms R1(T )+R2(T ) . Under the no-regret condition, the former will vanish, and hence we can guarantee convergence in the limit. Next, we define a popular family of no-regret algorithms.
|
| 78 |
+
|
| 79 |
+
Definition 2.2 (Follow The Regularized Leader). FTRL (Hazan et al., 2016) selects $k _ { t }$ on round $t$ by solving for arg $\begin{array} { r } { \operatorname* { m i n } _ { k \in \boldsymbol { K } } \{ \bar { \sum } _ { s = 1 } ^ { t - 1 } L _ { s } ( k ) + \frac { 1 } { \eta } \Omega ( k ) \} } \end{array}$ , where $\Omega ( \cdot )$ is some convex regularization function and $\eta$ is a learning rate.
|
| 80 |
+
|
| 81 |
+
Remark: Roughly speaking, if you select the regularization as $\begin{array} { r } { \Omega ( \cdot ) = \frac { 1 } { 2 } \| \cdot \| ^ { 2 } } \end{array}$ , then FTRL becomes the well-known online gradient descent or OGD (Zinkevich, 2003). Ignoring the case of constraint violations, OGD can be written in a simple iterative form: $k _ { t } = k _ { t - 1 } - \eta \nabla L _ { t - 1 } ( k _ { t - 1 } )$ .
|
| 82 |
+
|
| 83 |
+
The typical GAN training procedure using alternating gradient updates (or simultaneous gradient updates) is almost this - both the players applying online gradient descent. Notice that the $\operatorname* { m i n } / \operatorname* { m a x }$ objective function in GANs involves a stochastic component, with two randomized inputs given on each round, $x$ and $z$ which are sampled from the data distribution and a standard multivariate normal, respectively. Let us write $J _ { x , z } ( \phi , \theta \bar ) : = \log { D _ { \theta } ( x ) } + \log ( 1 - D _ { \theta } ( G _ { \phi } ( z ) ) )$ . Taking expectations with respect to $\mathbf { x }$ and $\mathbf { z }$ , we define the full (non-stochastic) game as $J ( \phi , \theta ) = \mathbb { E } _ { \mathbf { x } , \mathbf { z } } \left[ J _ { x , z } ( \phi , \theta ) \right]$ . But the above online training procedure is still valid with stochastic inputs. That is, the equilibrium computation would proceed similarly, where on each round we sample $x _ { t }$ and $z _ { t }$ , and follow the updates
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\phi _ { t + 1 } \phi _ { t } - \eta \nabla _ { \phi } J _ { x _ { t } , z _ { t } } ( \phi _ { t } , \theta _ { t } ) . \quad \mathrm { a n d } \quad \theta _ { t + 1 } \theta _ { t } + \eta ^ { ' } \nabla _ { \theta } J _ { x _ { t } , z _ { t } } ( \phi _ { t } , \theta _ { t } )
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
On a side note, a benefit of this stochastic perspective is that we can get a generalization bound on the mean parameters $\bar { \phi } _ { T }$ after $T$ rounds of optimization. The celebrated "online-to-batch conversion" (Cesa-Bianchi et al., 2004) implies that $\mathbb { E } _ { \mathbf { x } , \mathbf { z } } \big [ J _ { x , z } ( \bar { \phi } _ { T } , \theta ) \big ]$ , for any $\theta$ , is no more than the optimal value $\mathbb { E } _ { \mathbf { x } , \mathbf { z } } [ J _ { x , z } ( \phi ^ { * } , \theta ) ]$ plus an "estimation error" bounded by $\mathbb { E } \left[ { \frac { R _ { 1 } ( T ) + R _ { 2 } ( T ) } { T } } \right]$ , where the expectation is taken with respect to the sequence of samples observed along the way, and any randomness in the algorithm. Analogously, this applies to $\bar { \theta } _ { T } ^ { \star }$ as well. A limitation of this result, however, is that it requires a fresh sample $x _ { t }$ to be used on every round.
|
| 90 |
+
|
| 91 |
+
To summarize, we discussed in this subsection about how the artificial convex-concave case is easy to solve through regret minimization. While this is a standard result in game theory and online learning literature, it is not widely known in the GAN literature. For instance, Salimans et al. (2016) and Goodfellow (2017) discuss a toy game which is convex-concave and show cycling behavior. But, the simple solution in that case is to just average the iterates. Further, we made explicit, the critical connection between regret minimization and alternating gradient updates procedure used for GAN training. Now, Goodfellow et al. (2014) argue that, if $G$ and $D$ have enough capacity (in the non-parametric limit) and updates are made in the function space, then the GAN game can be considered convex-concave. Thus, our analysis based on regret minimization immediately yields a novel proof for the asymptotic convergence of GANs, without requiring that the discriminator be optimal at each step.
|
| 92 |
+
|
| 93 |
+
Moreover, the connection between regret minimization and GAN training process gives a novel way to reason about its dynamics. In contrast, the popular view of GAN training as consistently minimizing a divergence arises if the discriminator uses BRD (in the function space) and thus, it has little to do with the actual training process of GANs. As a result, this calls into question the motivation behind many recent developments like WGAN and gradient penalties among others, which improve the training stability of GANs. In the next subsection, we discuss the practical non-convex case and why training instability arises. This provides the necessary ideas to investigate mode collapse from our new perspective.
|
| 94 |
+
|
| 95 |
+
# 2.3 NON-CONVEX CASE AND LOCAL EQUILIBRIA
|
| 96 |
+
|
| 97 |
+
In practice, we choose $G$ , $D$ to be deep neural networks and the function $J ( \phi , \theta )$ need not be convexconcave anymore. The nice properties we had in the convex-concave case like the existence of a unique solution and guaranteed convergence through regret minimization no longer hold. In fact, regret minimization and equilibrium computation are computationally hard in general non-convex settings. However, analogous to the case of non-convex optimization (also intractable) where we focus on finding local minima, we can look for tractable solution concepts in non-convex games.
|
| 98 |
+
|
| 99 |
+
Recent work by Hazan et al. (2017) introduces the notion of local regret and shows that if both the players use a smoothed variant of OGD to minimize this quantity, then the non-convex game converges to some form of local equilibrium, under mild assumptions. The usual training procedure of GANs (AGD) corresponds to using a window size of 1 in their formulation. Thus, GAN training will eventually converge (approximately) to a local equilibrium which is described below or the updates will cycle. We leave it to future works to explore the equally important cycling issue and focus here on the former case.
|
| 100 |
+
|
| 101 |
+
Definition 2.3 (Local Equilibrium). A pair $( \phi ^ { * } , \theta ^ { * } )$ is called an $\epsilon$ -approximate local equilibrium if it holds that
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { l } { { \forall \phi ^ { ' } , \vert \vert \phi ^ { ' } - \phi ^ { * } \vert \vert \le \eta : J ( \phi ^ { * } , \theta ^ { * } ) \le J ( \phi ^ { ' } , \theta ^ { * } ) + \epsilon } } \\ { { \forall \theta ^ { ' } , \vert \vert \theta ^ { ' } - \theta ^ { * } \vert \vert \le \eta : J ( \phi ^ { * } , \theta ^ { * } ) \ge J ( \phi ^ { * } , \theta ^ { ' } ) - \epsilon } } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
That is, in a local equilibrium, both the players do not have much of an incentive to switch to any other strategy within a small neighborhood of their current strategies. Now, we turn our attention to the mode collapse issue which poses a significant challenge to the GAN training process. The training is said to have resulted in mode collapse if the generator ends up mapping multiple z vectors to the same output $\mathbf { x }$ , which is assigned a high probability of being real by the discriminator (Goodfellow, 2017). We hypothesize this to be the result of the game converging to bad local equilibria.
|
| 108 |
+
|
| 109 |
+
The prevalent view of mode collapse and instability in GAN training (Arjovsky & Bottou, 2017) is that it is caused due to the supports of real and model distributions being disjoint or lying on low-dimensional manifolds. The argument is that this would result in strong distance measures like KL-divergence or JS-divergence getting maxed out, and the generator cannot get useful gradients to learn. In fact, this is the motivation for the introduction of WGAN (Arjovsky et al., 2017). But, as we argued earlier, GAN training does not consistently minimize a divergence as that would require using intractable best-response algorithms. Hence, such a theory is not suitable to discuss convergence or to address the instability of GAN training. Our new view of GAN training process as regret minimization is closer to what is used in practice and provides an alternate explanation for mode collapse - the existence of undesirable local equilibria. The natural question now is how we can avoid them?
|
| 110 |
+
|
| 111 |
+
# 2.4 MODE COLLAPSE AND GRADIENT PENALTIES
|
| 112 |
+
|
| 113 |
+
The problem of dealing with multiple equilibria in games and how to avoid undesirable ones is an important question in algorithmic game theory (Nisan et al., 2007). In this work, we constrain ourselves to the GAN game and aim to characterize the undesirable local equilibria (mode collapse) in an effort to avoid them. In this direction, after empirically studying multiple mode collapse cases, we found that it is often accompanied by the discriminator function having sharp gradients around some real data points (See Figure $1 ^ { 2 }$ ). This intuitively makes sense from the definition of mode collapse discussed earlier. Such sharp gradients encourage the generator to map multiple $z$ vectors to a single output $x$ and lead the game towards a degenerate equilibrium. Now, a simple strategy to mitigate this failure case would be to regularize the discriminator using the following penalty -
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\lambda \cdot \mathbb { E } _ { x \sim P _ { r e a l } , \delta \sim N _ { d } ( 0 , c I ) } \big [ \| \nabla _ { \mathbf { x } } D _ { \theta } ( x + \delta ) \| ^ { 2 } \big ]
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
This strategy indeed improves the stability of GAN training. We show the results of a toy experiment with one hidden layer neural networks in Figure 2 and Figure 3 to demonstrate this. This partly explains the success of WGAN and gradient penalties in the recent literature (Gulrajani et al., 2017; Qi, 2017), and why they improve the training stability of GANs, despite being motivated by reasoning based on unrealistic assumptions. However, we noticed that this scheme in its current form can be brittle and if over-penalized, the discriminator can end up assigning both a real point $x$ and noise $x + \delta$ , the same probability of being real. Thus, a better choice of penalty is -
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\lambda \cdot \mathbb { E } _ { x \sim P _ { r e a l } , \delta \sim N _ { d } ( 0 , c I ) } \big [ \operatorname* { m a x } \big ( 0 , \| \nabla _ { \mathbf { x } } D _ { \theta } ( x + \delta ) \| ^ { 2 } - k \big ) \big ]
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Finally, due to practical optimization considerations (this has also been observed in Gulrajani et al.
|
| 126 |
+
(2017)), we instead use the penalty shown below in all our experiments.
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
\lambda \cdot \mathbb { E } _ { x \sim P _ { r e a l } , \delta \sim N _ { d } ( 0 , c I ) } \big [ \| \nabla _ { \mathbf { x } } D _ { \theta } ( x + \delta ) \| - k \big ] ^ { 2 }
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 1: One hidden layer networks as $G$ and $D$ (MNIST). On the left, we plot inception score against time for vanilla GAN training and on the right, we plot the squared norm of discriminator’s gradients around real data points for the same experiment. Notice how this quantity changes before, during and after mode collapse events.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 2: One hidden layer networks as $G$ and $D$ (MNIST). On the left, losses for both the players are shown for vanilla GAN training and on the right, we added a regularization term to penalize the gradients of $D ( x )$ around real data points. Notice the improved stability.
|
| 137 |
+
|
| 138 |
+
This still works as long as small perturbations of real data, $x + \delta$ are likely to lie off the data-manifold, which is true in the case of image domain and some other settings. Because, in these cases, we do want our discriminator to assign different probabilities of being real to training data and noisy samples. We caution the practitioners to keep this important point in mind while making their choice of penalty. All of the above schemes have the same effect of constraining the norm of discriminator’s gradients around real points to be small and can therefore, mitigate the mode collapse situation. We refer to GAN training using these penalty schemes or heuristics as the DRAGAN algorithm.
|
| 139 |
+
|
| 140 |
+
Additional details:
|
| 141 |
+
|
| 142 |
+
• We use the vanilla GAN objective in our experiments, but our penalty improves stability using other objective functions as well. This is demonstrated in section 3.3.
|
| 143 |
+
• The penalty scheme used in our experiments is the one shown in equation 1.
|
| 144 |
+
• We use small pixel-level noise but it is possible to find better ways of imposing this penalty. However, this exploration is beyond the scope of our paper.
|
| 145 |
+
• The optimal configuration of the hyperparameters for DRAGAN depends on the architecture, dataset and data domain. We set them to be $\lambda \sim 1 0$ , $k = 1$ and $c \sim 1 0$ in most of our experiments.
|
| 146 |
+
|
| 147 |
+
# 2.5 COUPLED VS LOCAL PENALTIES
|
| 148 |
+
|
| 149 |
+
Several recent works have also proposed regularization schemes which constrain the discriminator’s gradients in the ambient data space, so as to improve the stability of GAN training. Despite being from different motivations, WGAN-GP and LS-GAN are closely related approaches to ours. First, we show that these two approaches are very similar, which is not widely known in the literature. Qi (2017) introduced LS-GAN with the idea of maintaining a margin between losses assigned to real and fake samples. Further, they also impose Lipschitz constraint on $D$ and the two conditions together result in a situation where the following holds for any real and fake sample pair (roughly) -
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: One hidden layer networks as $G$ and $D$ (MNIST). On the left, inception score plot is shown for vanilla GAN training and on the right, we added a regularization term to penalize the gradients of $D ( x )$ around real data points. Notice how mode collapse is mitigated.
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
D _ { \theta } ( x ) - D _ { \theta } ( G _ { \phi } ( z ) ) \approx | | x , G _ { \phi } ( z ) | |
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
The authors argue that the resulting discriminator function would have non-vanishing gradients almost everywhere between real and fake samples (section 6 of Qi (2017)). Next, Gulrajani et al. (2017) proposed an extension to address various shortcomings of the original WGAN and they impose the following condition on $D$ -
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
| | \nabla _ { x } D _ { \theta } ( \hat { x } ) | | \approx 1
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $\hat { x } = ( \epsilon ) x + ( 1 - \epsilon ) G _ { \phi } ( z )$ is some point on the line between a real and a fake sample, both chosen independently at random. This leads to $D$ having norm-1 gradients almost everywhere between real and fake samples. Notice that this behavior is very similar to that of LS-GAN’s discriminator function. Thus, WGAN-GP is a slight variation of the original LS-GAN algorithm and we refer to these methods as “coupled penalties”.
|
| 165 |
+
|
| 166 |
+
On a side note, we also want to point out that WGAN-GP’s penalty doesn’t actually follow from KR-duality as claimed in their paper. By Lemma 1 of Gulrajani et al. (2017), the optimal discriminator $D ^ { * }$ will have norm-1 gradients (almost everywhere) only between those $x$ and $G _ { \phi } ( z )$ pairs which are sampled from the optimal coupling or joint distribution $\pi ^ { * }$ . Therefore, there is no basis for WGAN-GP’s penalty (equation 3) where arbitrary pairs of real and fake samples are used. This fact adds more credence to our theory regarding why gradient penalties might be mitigating mode collapse.
|
| 167 |
+
|
| 168 |
+
The most important distinction between coupled penalties and our methods is that we only impose gradient constraints in local regions around real samples. We refer to these penalty schemes as “local penalties”. Coupled penalties impose gradient constraints between real and generated samples and we point out some potential issues that arise from this:
|
| 169 |
+
|
| 170 |
+
• With adversarial training finding applications beyond fitting implicit generative models, penalties which depend on generated samples can be prohibitive.
|
| 171 |
+
• The resulting class of functions when coupled penalties are used will be highly restricted compared to our method and this affects modeling performance. We refer the reader to Figure 4 and appendix section 5.2.2 to see this effect.
|
| 172 |
+
• Our algorithm works with AGD, while WGAN-GP needs multiple inner iterations to optimize D. This is because the generated samples can be anywhere in the data space and they change from one iteration to the next. In contrast, we consistently regularize $D _ { \theta } ( x )$ only along the real data manifold.
|
| 173 |
+
|
| 174 |
+
To conclude, appropriate constraining of the discriminator’s gradients can mitigate mode collapse but we should be careful so that it doesn’t have any negative effects. We pointed out some issues with coupled penalties and how local penalties can help. We refer the reader to section 3 for further experimental results.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 4: Swissroll experiment (different phases of training) - Vanilla GAN (top), WGAN-GP (middle), and DRAGAN (bottom). Real samples are marked orange and generated samples are green. Level sets of $D _ { \theta } ( x )$ are shown in the background where yellow is high and purple is low.
|
| 178 |
+
|
| 179 |
+
# 3 EXPERIMENTAL RESULTS
|
| 180 |
+
|
| 181 |
+
In section 3.1, we compare the modeling performance of our algorithm against vanilla GAN and WGAN variants in the standard DCGAN/CIFAR-10 setup. Section 3.2 demonstrates DRAGAN’s improved stability across a variety of architectures. In section 3.3, we show that our method also works with other objective functions. Appendix contains samples for inspection, some of the missing plots and additional results. Throughout, we use inception score (Salimans et al., 2016) which is a well-studied and reliable metric in the literature, and sample quality to measure the performance.
|
| 182 |
+
|
| 183 |
+
# 3.1 INCEPTION SCORES FOR CIFAR-10 USING DCGAN ARCHITECTURE
|
| 184 |
+
|
| 185 |
+
DCGAN is a family of architectures designed to perform well with the vanilla training procedure. They are ubiquitous in the GAN literature owing to the instability of vanilla GAN in general settings. We use this architecture to model CIFAR-10 and compare against vanilla GAN, WGAN and WGANGP. As WGANs need 5 discriminator iterations for every generator iteration, comparing the modeling performance can be tricky. To address this, we report two scores for vanilla GAN and DRAGAN - one using the same number of generator iterations as WGANs and one using the same number of discriminator iterations. The results are shown in Figure 5 and samples are included in the appendix (Figure 8). Notice that DRAGAN beats WGAN variants in both the configurations, while vanilla GAN is only slightly better. A key point to note here is that our algorithm is fast compared to WGANs, so in practice, the performance will be closer to the DRAGANd case. In the next section, we will show that if we move away from this specific architecture family, vanilla GAN training can become highly unstable and that DRAGAN penalty mitigates this issue.
|
| 186 |
+
|
| 187 |
+
# 3.2 MEASURING STABILITY AND PERFORMANCE ACROSS ARCHITECTURES
|
| 188 |
+
|
| 189 |
+
Ideally, we would want our training procedure to perform well in a stable fashion across a variety of architectures (other than DCGANs). Similar to Arjovsky et al. (2017) and Gulrajani et al. (2017), we remove the stabilizing components of DCGAN architecture and demonstrate improved stability $\&$ modeling performance compared to vanilla GAN training (see appendix section 5.2.3). However, this is a small set of architectures and it is not clear if there is an improvement in general.
|
| 190 |
+
|
| 191 |
+
To address this, we introduce a metric termed the BogoNet score to compare the stability & performance of different GAN training procedures. The basic idea is to choose random architectures for players $G$ and $D$ independently, and evaluate the performance of different algorithms in the resulting games. A good algorithm should achieve stable performance without failing to learn or resulting in mode collapse, despite the potentially imbalanced architectures. In our experiment, each player is assigned a network from a diverse pool of architectures belonging to three different families (MLP, ResNet, DCGAN).
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 5: Comparison of modeling performance on CIFAR10
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Algorithm</td><td>Score</td></tr><tr><td>WGAN</td><td>3.25</td></tr><tr><td>WGAN-GP</td><td>5.99</td></tr><tr><td>DRAGAN9</td><td>6.11</td></tr><tr><td>DRAGANd</td><td>6.90</td></tr><tr><td>Vanilla GANg</td><td>6.3</td></tr><tr><td>Vanilla GANd</td><td>6.99</td></tr></table>
|
| 197 |
+
|
| 198 |
+
(b) Inception scores
|
| 199 |
+
|
| 200 |
+
Table 1: Summary of inception score statistics across 100 architectures
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan=1 colspan=1>Algorithm</td><td rowspan=1 colspan=2>Final score</td><td rowspan=1 colspan=2>Area under curve</td><td rowspan=1 colspan=1>Qual. score</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Std</td><td rowspan=1 colspan=1>Mean</td><td rowspan=1 colspan=1>Std</td><td rowspan=1 colspan=1>Total</td></tr><tr><td rowspan=1 colspan=1>Vanilla GAN</td><td rowspan=1 colspan=1>2.91</td><td rowspan=1 colspan=1>1.44</td><td rowspan=1 colspan=1>277.72</td><td rowspan=1 colspan=1>126.09</td><td rowspan=1 colspan=1>92.5</td></tr><tr><td rowspan=1 colspan=1>DRAGAN</td><td rowspan=1 colspan=1>3.70</td><td rowspan=1 colspan=1>1.71</td><td rowspan=1 colspan=1>312.15</td><td rowspan=1 colspan=1>135.35</td><td rowspan=1 colspan=1>157.5</td></tr><tr><td rowspan=1 colspan=1>WGAN-GP</td><td rowspan=1 colspan=1>3.49</td><td rowspan=1 colspan=1>1.30</td><td rowspan=1 colspan=1>300.09</td><td rowspan=1 colspan=1>100.96</td><td rowspan=1 colspan=1>1</td></tr></table>
|
| 203 |
+
|
| 204 |
+
To demonstrate that our algorithm performs better compared to vanilla GAN training and WGAN-GP, we created 100 such instances of hard games. Each instance is trained using these algorithms on CIFAR-10 (under similar conditions for a fixed number of generator iterations, which gives a slight advantage to WGAN-GP) and we plot how inception score changes over time. For each algorithm, we calculated the average of final inception scores and area under the curve (AUC) over all 100 instances. The results are shown in Table 1. Notice that we beat the other algorithms in both metrics, which indicates some improvement in stability and modeling performance.
|
| 205 |
+
|
| 206 |
+
Further, we perform some qualitative analysis to verify that BogoNet score indeed captures the improvements in stability. We create another set of 50 hard architectures and compare DRAGAN against vanilla GAN training. Each instance is allotted 5 points and we split this bounty between the two algorithms depending on their performance. If both perform well or perform poorly, they get 2.5 points each, so that we nullify the effect of such non-differentiating architectures. However, if one algorithm achieves stable performance compared to the other (in terms of failure to learn or mode collapses), we assign it higher portions of the bounty. Results were judged by two of the authors in a blind manner: The curves were shown side-by-side with the choice of algorithm for each side being randomized and unlabeled. The vanilla GAN received an average score of 92.5 while our algorithm achieved an average score of 157.5 and this correlates with BogoNet score from earlier. See appendix section 5.3 for some additional details regarding this experiment.
|
| 207 |
+
|
| 208 |
+
# 3.3 STABILITY USING DIFFERENT OBJECTIVE FUNCTIONS
|
| 209 |
+
|
| 210 |
+
Our algorithm improves stability across a variety of objective functions and we demonstrate this using the following experiment. Nowozin et al. (2016) show that we can interpret GAN training as minimizing various $f$ -divergences when an appropriate game objective function is used. We show experiments using the objective functions developed for Forward KL, Reverse KL, Pearson $\chi ^ { 2 }$ , Squared Hellinger, and Total Variation divergence minimization. We use a hard architecture from the previous subsection to demonstrate the improvements in stability. Our algorithm is stable in all cases except for the total variation case, while the vanilla algorithm failed in all the cases (see Figure 6 for two examples and Figure 15 in appendix for all five). Thus, practitioners can now choose their game objective from a larger set of functions and use DRAGAN (unlike WGANs which requires a specific objective function).
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
Figure 6: Inception score plots for two divergence measures, demonstrating superior stability for our algorithm.
|
| 214 |
+
|
| 215 |
+
# 4 CONCLUSIONS
|
| 216 |
+
|
| 217 |
+
In this paper, we propose to study GAN training process as regret minimization, which is in contrast to the popular view that there is consistent minimization of a divergence between real and generated distributions. We analyze the convergence of GAN training from this new point of view and hypothesize that mode collapse occurs due to the existence of undesirable local equilibria. A simple observation is made about how the mode collapse situation often exhibits sharp gradients of the discriminator function around some real data points. This characterization partly explains the workings of previously proposed WGAN and gradient penalties, and motivates our novel penalty scheme. We show evidence of improved stability using DRAGAN and the resulting improvements in modeling performance across a variety of settings. We leave it to future works to explore our ideas in more depth and come up with improved training algorithms.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Martin Arjovsky and Léon Bottou. Towards principled methods for training generative adversarial networks. arXiv preprint arXiv:1701.04862, 2017.
|
| 222 |
+
Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein gan. arXiv preprint arXiv:1701.07875, 2017.
|
| 223 |
+
Nicolo Cesa-Bianchi and Gábor Lugosi. Prediction, learning, and games. Cambridge university press, 2006.
|
| 224 |
+
Nicolo Cesa-Bianchi, Alex Conconi, and Claudio Gentile. On the generalization ability of on-line learning algorithms. IEEE Transactions on Information Theory, 50(9):2050–2057, 2004.
|
| 225 |
+
Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016.
|
| 226 |
+
Yoav Freund and Robert E Schapire. Adaptive game playing using multiplicative weights. Games and Economic Behavior, 29(1-2):79–103, 1999.
|
| 227 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 27, pp. 2672–2680. Curran Associates, Inc., 2014. URL http://papers.nips. cc/paper/5423-generative-adversarial-nets.pdf.
|
| 228 |
+
Ian J. Goodfellow. NIPS 2016 tutorial: Generative adversarial networks. CoRR, abs/1701.00160, 2017. URL http://arxiv.org/abs/1701.00160.
|
| 229 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron Courville. Improved training of wasserstein gans. arXiv preprint arXiv:1704.00028, 2017.
|
| 230 |
+
Elad Hazan, Karan Singh, and Cyril Zhang. Efficient regret minimization in non-convex games. arXiv preprint arXiv:1708.00075, 2017.
|
| 231 |
+
Elad Hazan et al. Introduction to online convex optimization. Foundations and Trends® in Optimization, 2(3-4):157–325, 2016.
|
| 232 |
+
Panayotis Mertikopoulos, Christos Papadimitriou, and Georgios Piliouras. Cycles in adversarial regularized learning. arXiv preprint arXiv:1709.02738, 2017.
|
| 233 |
+
Luke Metz, Ben Poole, David Pfau, and Jascha Sohl-Dickstein. Unrolled generative adversarial networks. CoRR, abs/1611.02163, 2016. URL http://arxiv.org/abs/1611.02163.
|
| 234 |
+
J. von Neumann. Zur theorie der gesellschaftsspiele. Mathematische Annalen, 100:295–320, 1928. URL http://eudml.org/doc/159291.
|
| 235 |
+
Noam Nisan, Tim Roughgarden, Eva Tardos, and Vijay V Vazirani. Algorithmic game theory, volume 1. Cambridge University Press Cambridge, 2007.
|
| 236 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems, pp. 271–279, 2016.
|
| 237 |
+
Guo-Jun Qi. Loss-sensitive generative adversarial networks on lipschitz densities. CoRR, abs/1701.06264, 2017. URL http://arxiv.org/abs/1701.06264.
|
| 238 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised Representation Learning with Deep Convolutional Generative Adversarial Networks. arXiv:1511.06434 [cs], November 2015. URL http://arxiv.org/abs/1511.06434. arXiv: 1511.06434.
|
| 239 |
+
Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. CoRR, abs/1606.03498, 2016. URL http://arxiv. org/abs/1606.03498.
|
| 240 |
+
Maurice Sion. On general minimax theorems. Pacific J. Math, 8(1):171–176, 1958.
|
| 241 |
+
Junbo Zhao, Michael Mathieu, and Yann LeCun. Energy-based generative adversarial network. arXiv preprint arXiv:1609.03126, 2016.
|
| 242 |
+
Martin Zinkevich. Online convex programming and generalized infinitesimal gradient ascent. In Proceedings of the 20th International Conference on Machine Learning (ICML-03), pp. 928–936, 2003.
|
| 243 |
+
|
| 244 |
+
# 5 APPENDIX
|
| 245 |
+
|
| 246 |
+
# 5.1 SAMPLES AND LATENT SPACE WALKS
|
| 247 |
+
|
| 248 |
+
In this section, we provide samples from an additional experiment run on CelebA dataset (Figure 7). The samples from the experiment in section 3.1 are shown in Figure 8. Further, Radford et al. (2015) suggest that walking on the manifold learned by the generator can expose signs of memorization. We use DCGAN architecture to model MNIST and CelebA datasets using DRAGAN penalty, and the latent space walks of the learned models are shown in Figure 9 and Figure 10. The results demonstrate that the generator is indeed learning smooth transitions between different images, when our algorithm is used.
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
Figure 7: Modeling CelebA with DRAGAN using DCGAN architecture.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 8: Modeling CIFAR-10 using DCGAN architecture.
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
Figure 9: Latent space walk of the model learned on MNIST using DRAGAN
|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 10: Latent space walk of the model learned on CelebA using DRAGAN
|
| 261 |
+
|
| 262 |
+
# 5.2 ADDITIONAL EXPERIMENTS
|
| 263 |
+
|
| 264 |
+
# 5.2.1 ONE HIDDEN LAYER NETWORK TO MODEL MNIST
|
| 265 |
+
|
| 266 |
+
We design a simple experiment where $G$ and $D$ are both fully connected networks with just one hidden layer. Vanilla GAN performs poorly even in this simple case and we observe severe mode collapses. In contrast, our algorithm is stable throughout and obtains decent quality samples despite the constrained setup.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 11: One hidden layer network to model MNIST - Inception score plots
|
| 270 |
+
|
| 271 |
+

|
| 272 |
+
Figure 12: One hidden layer network to model MNIST - Samples
|
| 273 |
+
|
| 274 |
+
# 5.2.2 8-GAUSSIANS EXPERIMENT
|
| 275 |
+
|
| 276 |
+
We analyze the performance of WGAN-GP and DRAGAN on the 8-Gaussians dataset. As it can be seen in Figure 13, both of them approximately converge to the real distribution but notice that in the case of WGAN-GP, $D _ { \theta } ( x )$ seems overly constrained in the data space. In contrast, DRAGAN’s discriminator is more flexible.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
|
| 280 |
+
Figure 13: Comparing the performance of WGAN-GP and DRAGAN on the 8-Gaussians dataset. Orange is real samples, green is generated samples. The level sets of $D _ { \theta } ( x )$ are shown in the background, with yellow as high and purple as low.
|
| 281 |
+
|
| 282 |
+
# 5.2.3 STABILITY ACROSS DCGAN ARCHITECTURE VARIATIONS
|
| 283 |
+
|
| 284 |
+
DCGAN architecture has been designed following specific guidelines to make it stable (Radford et al., 2015). We restate the suggested rules here.
|
| 285 |
+
|
| 286 |
+
1. Use all-convolutional networks which learn their own spatial downsampling (discriminator)
|
| 287 |
+
or upsampling (generator)
|
| 288 |
+
2. Remove fully connected hidden layers for deeper architectures
|
| 289 |
+
3. Use batch normalization in both the generator and the discriminator
|
| 290 |
+
4. Use ReLU activation in the generator for all layers except the output layer, which uses tanh
|
| 291 |
+
5. Use LeakyReLU activation in the discriminator for all layers
|
| 292 |
+
|
| 293 |
+
We show below that such constraints can be relaxed when using our algorithm and still maintain training stability. Below, we present a series of experiments in which we remove different stabilizing components from the DCGAN architecture and analyze the performance of our algorithm. Specifically, we choose the following four architectures which are difficult to train (in each case, we start with base DCGAN architecture and apply the changes) -
|
| 294 |
+
|
| 295 |
+
• No BN and a constant number of filters in the generator • 4-layer 512-dim ReLU MLP generator • tanh nonlinearities everywhere • tanh nonlinearity in the generator and 4-layer 512-dim L
|
| 296 |
+
|
| 297 |
+
Notice that, in each case, our algorithm is stable while the vanilla GAN training fails. A similar approach is used to demonstrate the stability of training procedures in Arjovsky et al. (2017) and Gulrajani et al. (2017).
|
| 298 |
+
|
| 299 |
+

|
| 300 |
+
(a) tanh activation
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
(b) FC generator
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 14: Comparing performance of DRAGAN and Vanilla GAN training in the hard variations of DCGAN architecture.
|
| 307 |
+
|
| 308 |
+
# 5.2.4 STABILITY ACROSS OBJECTIVE FUNCTIONS
|
| 309 |
+
|
| 310 |
+
Due to space limitations, we only showed plots for two cases in section 3.3. Below we show the results for all five cases.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 15: Comparing performance of DRAGAN and Vanilla GAN training using different objective functions.
|
| 316 |
+
|
| 317 |
+
# 5.3 BOGONET DETAILS
|
| 318 |
+
|
| 319 |
+
We used three families of architectures with probabilities - DCGAN (0.6), ResNet (0.2), MLP (0.2). Next, we further parameterized each family to create additional variation. For instance, the DCGAN family can result in networks with or without batch normalization, have LeakyReLU or Tanh nonlinearities. The number and width of filters, latent space dimensionality are some other possible variations in our experiment. Similarly, the number of layers and hidden units in each layer for MLP are chosen randomly. For ResNets, we chose their depth randomly. This creates a set of hard games which test the stability of a given training algorithm.
|
| 320 |
+
|
| 321 |
+
We showed qualitative analysis of the inception score plots in section 3.2 to verify that BogoNet score indeed captures the improvements in stability. Below, we show some examples of how the bounty splits were done. The plots in Figure 14 were scored as (averages are shown in DRAGAN, Vanilla GAN order):
|
| 322 |
+
|
| 323 |
+
A - (5, 0), B - (3.5, 1.5), C – (2.25, 2.75), D – (2, 3)
|
md/train/rylNH20qFQ/rylNH20qFQ.md
ADDED
|
@@ -0,0 +1,331 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO INFER AND EXECUTE 3D SHAPE PROGRAMS
|
| 2 |
+
|
| 3 |
+
Yonglong Tian†, Andrew Luo†, Xingyuan $\mathbf { S u n } ^ { \ddagger }$ , Kevin Ellis†, William T. Freeman†∗, Joshua B. Tenenbaum† & Jiajun Wu†
|
| 4 |
+
|
| 5 |
+
†Massachusetts Institute of Technology
|
| 6 |
+
‡Princeton University
|
| 7 |
+
∗Google Research
|
| 8 |
+
{yonglong,aluo,ellisk,billf,jbt,jiajunwu}@mit.edu
|
| 9 |
+
xs5@princeton.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Human perception of 3D shapes goes beyond reconstructing them as a set of points or a composition of geometric primitives: we also effortlessly understand higherlevel shape structure such as the repetition and reflective symmetry of object parts. In contrast, recent advances in 3D shape sensing focus more on low-level geometry but less on these higher-level relationships. In this paper, we propose $3 D$ shape programs, integrating bottom-up recognition systems with top-down, symbolic program structure to capture both low-level geometry and high-level structural priors for 3D shapes. Because there are no annotations of shape programs for real shapes, we develop neural modules that not only learn to infer 3D shape programs from raw, unannotated shapes, but also to execute these programs for shape reconstruction. After initial bootstrapping, our end-to-end differentiable model learns 3D shape programs by reconstructing shapes in a self-supervised manner. Experiments demonstrate that our model accurately infers and executes 3D shape programs for highly complex shapes from various categories. It can also be integrated with an image-to-shape module to infer 3D shape programs directly from an RGB image, leading to 3D shape reconstructions that are both more accurate and more physically plausible.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Given the table in Figure 1, humans are able to instantly recognize its parts and regularities: there exist sharp edges, smooth surfaces, a table top that is a perfect circle, and two lower, square layers. Beyond these basic components, we also perceive higher-level, abstract concepts: the shape is bilateral symmetric; the legs are all of equal length and laid out on the opposite positions of a 2D grid. Knowledge like this is crucial for visual recognition and reasoning (Koffka, 2013; Dilks et al., 2011).
|
| 18 |
+
|
| 19 |
+
Recent AI systems for 3D shape understanding have made impressive progress on shape classification, parsing, reconstruction, and completion (Qi et al., 2017; Tulsiani et al., 2017), many making use of large shape repositories like ShapeNet (Chang et al., 2015). Popular shape representations include voxels (Wu et al., 2015), point clouds (Qi et al., 2017), and meshes (Wang et al., 2018). While each has its own advantages, these methods fall short on capturing the strong shape priors we just described, such as sharp edges and smooth surfaces.
|
| 20 |
+
|
| 21 |
+
A few recent papers have studied modeling 3D shapes as a collection of primitives (Tulsiani et al., 2017), with simple operations such as addition and subtraction (Sharma et al., 2018). These representations have demonstrated success in explaining complex 3D shapes. In this paper, we go beyond them to capture the high-level regularity within a 3D shape, such as symmetry and repetition.
|
| 22 |
+
|
| 23 |
+
In this paper, we propose to represent 3D shapes as shape programs. We define a domain-specific language (DSL) for shapes, containing both basic shape primitives for parts with their geometric and semantic attributes, as well as statements such as loops to enforce higher-level structural priors.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: A 3D shape can be represented by a program via a program generator. This program can be executed by a neural program executor to produce the corresponding 3D shape.
|
| 27 |
+
|
| 28 |
+
Because 3D shape programs are a new shape representation, there exist no annotations of shape programs for 3D shapes. The lack of annotations makes it difficult to train an inference model with full supervision. To overcome this obstacle, we propose to learn a shape program executor that reconstructs a 3D shape from a shape program. After initial bootstrapping, our model can then learn in a self-supervised way, by attempting to explain and reconstruct unlabeled 3D shapes with 3D shape programs. This design minimizes the amount of supervision needed to get our model off the ground.
|
| 29 |
+
|
| 30 |
+
With the learned neural program executor, our model learns to explain input shapes without ground truth program annotations. Experiments on ShapeNet show that our model infers accurate 3D shape programs for highly complex shapes from various categories. We further extend our model by integrating with an image-to-shape reconstruction module, so it directly infers a 3D shape program from a color image. This leads to 3D shape reconstructions that are both more accurate and more physically plausible.
|
| 31 |
+
|
| 32 |
+
Our contributions are three-fold. First, we propose 3D shape programs: a new representation for shapes, building on classic findings in cognitive science and computer graphics. Second, we propose to infer 3D shape programs by explaining the input shape, making use of a neural shape program executor. Third, we demonstrate that the inference model, the executor, and the programs they recover all achieve good performance on ShapeNet, learning to explain and reconstruct complex shapes. We further show that an extension of the model can infer shape programs and reconstruct 3D shapes directly from images.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Inverse procedural graphics. The problem of inferring programs from voxels is closely related to inverse procedural graphics, where a procedural graphics program is inferred from an image or declarative specification (Ritchie et al., 2016; St’ava et al. ˇ , 2010). Where the systems have been most successful, however, are when they leverage a large shape–component library (Chaudhuri et al., 2011; Schulz et al., 2017) or are applied to a sparse solution space (van den Hengel et al., 2015). Kulkarni et al. (2015a) approached the problem of inverse graphics as inference in a probabilistic program for generating 2D images, or image contours, from an underlying 3D model. They demonstrated results on several different applications using parametric generative models for faces, bodies, and simple multi-part objects based on generalized cylinders. In this work, we extend the idea of inverse procedural graphics to 3-D voxel representations, and show how this idea can apply to large data sets like ShapeNet. We furthermore do not have to match components to a library of possible shapes, instead using a neural network to directly infer shapes and their parameters.
|
| 37 |
+
|
| 38 |
+
A few recent papers have explored the use of simple geometric primitives to describe shapes (Tulsiani et al., 2017; Zou et al., 2017; Liu et al., 2018), putting the classic idea of generalized cylinders (Roberts, 1963; Binford, 1971) or geons (Biederman, 1987) in the modern context of deep learning. In particular, Sharma et al. (2018) extended these papers and addressed the problem of inferring 3-D CAD programs from perceptual input. We find this work inspiring, but also feel that a key goal of 3-D program inference is to reconstruct a program in terms of semantically meaningful parts and their spatial regularity, which we address here. Some other graphics papers also explore regularity, but without using programs (Mitra et al., 2013; Zhu et al., 2018; Nishida et al., 2018; Li et al., 2017).
|
| 39 |
+
|
| 40 |
+
Work in the HCI community has also addressed the problem of inferring parametric graphics primitives from perceptual input. For example, Nishida et al. (2016) proposed to learn to instantiate procedural primitives for an interactive modeling system. In our work, we instead learn to instantiate multiple procedural graphics primitives simultaneously, without assistance from a human user.
|
| 41 |
+
|
| 42 |
+
Table 1: The domain specific language (DSL) for 3D shapes. Semantics depends on the types of objects that are modeled, i.e., semantics for vehicle and furniture should be different. For details of DSL in our experimental setting, please refer to supplementary.
|
| 43 |
+
|
| 44 |
+
<table><tr><td>Program</td><td>→</td></tr><tr><td>Statement</td><td>Draw(Semantics,Shape,Position_Params,Geometry Params)</td></tr><tr><td>Statement</td><td>For(For_Params); Program; EndFor</td></tr><tr><td>Semantics</td><td>semantics 1|semantics 2|semantics 3|..</td></tr><tr><td>Shape</td><td>Cuboid|Cylinder丨Rectangle|Circle|Line</td></tr><tr><td>Position_Params</td><td>(x,y,z)</td></tr><tr><td>Geometry_Params</td><td>(g1,92,93,94,...)</td></tr><tr><td>For_Params</td><td>Translation_Params|Rotation_Params</td></tr><tr><td>Translation_Params</td><td>(times i, orientation u)</td></tr><tr><td>Rotation_Params</td><td>(times i,angle θ,axis a)</td></tr></table>
|
| 45 |
+
|
| 46 |
+
Program synthesis. In the AI literature, Ellis et al. (2018) leveraged symbolic program synthesis techniques to infer 2D graphics programs from images, extending their earlier work by using neural nets for faster inference of low-level cues such as strokes (Ellis et al., 2015). Here, we show how a purely end–to–end network can recover 3D graphics programs from voxels, conceptually relevant to RobustFill (Devlin et al., 2017), which presents a purely end-to-end neural program synthesizer for text editing. The very recent SPIRAL system (Ganin et al., 2018) also takes as its goal to learn structured program–like models from (2D) images. An important distinction from our work here is that SPIRAL explains an image in terms of paint-like “brush strokes”, whereas we explain 3D voxels in terms of high-level objects and semantically meaningful parts of objects, like legs or tops. Other tangential related work on program synthesis includes Balog et al. (2017); Devlin et al. (2017); Parisotto et al. (2017); Gaunt et al. (2016); Sun et al. (2018a); Liu et al. (2019).
|
| 47 |
+
|
| 48 |
+
Learning to execute programs. Neural Program Interpreters (NPI) have been extensively studied for programs that abstract and execute tasks such as sorting, shape manipulation, and grade-school arithmetic (Reed & De Freitas, 2016; Cai et al., 2017; Bosnjak et al. ˇ , 2017). In NPI (Reed & De Freitas, 2016), the key insight is that a program execution trace can be decomposed into predefined operations that are more primitive; and at each step, an NPI learns to predict what operation to take next depending on the general environment, domain specific state , and previous actions. Cai et al. (2017) improved the generalization of NPIs by adding recursion. Johnson et al. (2017) learned to execute programs for visual question and answering. In this paper, we also learn a 3D shape program executor that renders 3D shapes from programs as a component of our model.
|
| 49 |
+
|
| 50 |
+
# 3 3D SHAPE PROGRAMS
|
| 51 |
+
|
| 52 |
+
In this section, we define the domain-specific language for 3D shapes, as well as the problem of shape program synthesis.
|
| 53 |
+
|
| 54 |
+
Table 1 shows our DSL for 3D shape programs. Each shape program consists of a variable number of program statements. A program statement can be either Draw, which describes a shape primitive as well as its geometric and semantic attributes, or For, which contains a sub-program and parameters specifying how the subprogram should be repeatedly executed. The number of arguments for each program statement varies. We tokenize programs for the purpose of neural network prediction.
|
| 55 |
+
|
| 56 |
+
Each shape primitive models a semantically-meaningful part of an object. Its geometric attributes (Table 1: Geometry Params, Position Params) specify the position and orientation of the part. Its semantic attributes (Table 1: Semantics) specify its relative role within the whole shape (e.g., top, back, leg). They do not affect the geometry of the primitive; instead, they associate geometric parts with their semantic meanings conveying how parts can be shared across object categories semantically and functionally (e.g., a chair and a table may have similar legs).
|
| 57 |
+
|
| 58 |
+
Our For statement captures high-level regularity across parts. For example, the legs of a table can be symmetric with respect to particular rotation angles. The horizontal bars of a chair may lay out regularly with a fixed vertical gap. Each For statement can contain sub-programs, allowing recursive generation of shape programs.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: The core of our 3D shape program generator are two LSTMs. The Block LSTM emits features for each program block. The Step LSTM takes these features as input and outputs programs inside each block, which includes either a single drawing statement or compound statements.
|
| 62 |
+
|
| 63 |
+
The problem of inferring a 3D shape program is defined as follows: predicting a 3D shape program that reconstructs the input shape when the program is executed. In this paper, we use voxelized shapes as input with a resolution of $3 2 \times 3 2 \times 3 2$ .
|
| 64 |
+
|
| 65 |
+
# 4 INFERRING AND EXECUTING 3D SHAPE PROGRAMS
|
| 66 |
+
|
| 67 |
+
Our model, called Shape Programs, consists of a program generator and a neural program executor. The program generator takes a 3D shape as input and outputs a sequence of primitive programs that describe this 3D shape. The neural program executor takes these programs as input and generates the corresponding 3D shapes. This allows our model to learn in a self-supervised way by generating programs from input shapes, executing these programs, and back-propagating the difference between the generated shapes and the raw input.
|
| 68 |
+
|
| 69 |
+
# 4.1 PROGRAM GENERATOR
|
| 70 |
+
|
| 71 |
+
We model program generation as a sequential prediction problem. We partition full programs into two types of subprograms, which we call blocks: (1) a single drawing statement describing a semantic part, e.g. circle top; and (2) compound statements, which are a loop structure that interprets a set of translated or rotated parts, e.g. four symmetric legs. This part-based, symmetry-aware decomposition is inspired by human perception (Fleuret et al., 2011).
|
| 72 |
+
|
| 73 |
+
Our program generator is shown in Figure 2. The core of the program generator consists of two orthogonal LSTMs. The first one,the Block LSTM, connects sequential blocks. The second one, the Step LSTM, generates programs for each block. At each block, we first render the shape described by previous program blocks with a graphics engine. Then, the rendered shape and the raw shape are combined along the channel dimension and fed into a 3D ConvNet. The Block LSTM takes the features output by the 3D ConvNet and outputs features of the current block, which are further fed into the step LSTM to predict the block programs. The reason why we need the step LSTM is that each block might have a different length (e.g., loop bodies of different sizes).
|
| 74 |
+
|
| 75 |
+
Given block feature $h _ { b l k }$ , the Step LSTM predicts a sequence of program tokens, each consisting of a program id and an argument matrix. The $i$ -th row of the argument matrix serves for the $i$ -th primitive program. From the LSTM hidden state $h _ { t }$ , two decoders generate the output. The softmax classification probability over program sets is obtained by $f _ { \mathrm { p r o g } } : \mathbb { R } ^ { M } \to \mathbb { R } ^ { N }$ . The argument matrix is computed by $f _ { \mathrm { p a r a m } } : \mathbb { R } ^ { M } \to \mathbb { R } ^ { N \times K }$ , where $N$ is the total number of program primitives and $K$ is the maximum possible number of arguments. The feed-forward steps of the Step LSTM are summarized as
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } & { h _ { t } = f _ { \mathrm { l s t m } } ( x _ { t } , h _ { t - 1 } ) , } \\ & { p _ { t } = f _ { \mathrm { p r o g } } ( h _ { t } ) , ~ a _ { t } = f _ { \mathrm { p a r a m } } ( h _ { t } ) , } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where the $p _ { t }$ and $a _ { t }$ corresponds to the program probability distribution and argument matrix at time $t$ . After getting the program $\mathrm { I D }$ , we obtain its arguments by retrieving the corresponding row in the argument matrix. At each time step, the input of the Step LSTM $x _ { t }$ is the embedding of the output in the previous step. For the first step, the block feature $h _ { b l k }$ is used instead.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 3: The learned program executor consits of an LSTM, which encodes multiple steps of programs, and a subsequent 3D DeconvNet which decodes the features to a 3D shape.
|
| 85 |
+
|
| 86 |
+
We pretrain our program generator on a synthetic dataset with a few pre-defined simple program templates. The set of all templates for tables are shown in Section A1. These templates are much simpler than the actual shapes. The generator is trained to predict the program token and regress the corresponding arguments via the following loss $\begin{array} { r } { l _ { \mathrm { g e n } } = \sum _ { b , i } w _ { p } l _ { \mathrm { c l s } } ( p _ { b , i } , \hat { p _ { b , i } } ) ) + w _ { a } l _ { \mathrm { r e g } } ( a _ { b , i } , \hat { a } _ { b , i } ) } \end{array}$ , where $l _ { \mathrm { c l s } } ( p _ { b , i } , \hat { p } _ { b , i } ) )$ and $l _ { \mathrm { r e g } } ( a _ { b , i } , \hat { a } _ { b , i } )$ are the cross-entropy loss of program ID classification and the $\mathscr { L } \mathrm { - } 2$ loss of argument regression, in step $i$ of block $b$ , respectively. The weights $w _ { p }$ and $w _ { a }$ balance the losses between classification and regression.
|
| 87 |
+
|
| 88 |
+
# 4.2 NEURAL PROGRAM EXECUTOR
|
| 89 |
+
|
| 90 |
+
We propose to learn a neural program executor, an approximate but differentiable graphics engine, which generates a shape from a program. The program executor can then be used for training the program generator by back-propagating gradients. An alternative is to design a graphics engine that explicitly executes a symbolic program to produce a voxelized 3D shape. Certain high-level program commands, such as For statements, will make the executor non-differentiable. Our use of a neural, differentiable executor enables gradient-based fine-tuning of the program synthesizer on unannotated shapes, which allows the model to generalize effectively to novel shapes outside training categories.
|
| 91 |
+
|
| 92 |
+
Learning to execute a long sequence of programs is difficult, since an executor has to learn to interpret not only single statements but also complex combinations of multiple statements. We decompose the problem by learning an executor that executes programs at the block level, e.g., either a single drawing statement or a compound statements. Afterwards, we integrate these block-level shapes by max-pooling to form the shape corresponding to a long sequence of programs. Our neural program executor includes an LSTM followed by a deconv CNN, as shown in Figure 3. The LSTM aggregates the block-level program into a fixed-length representation. The following deconv CNN takes this representation and generates the desired shape.
|
| 93 |
+
|
| 94 |
+
To train the program executor, we synthesize large amounts of block-level programs and their corresponding shapes. During training, we minimize the sum of the weighted binary cross-entropy losses over all voxels via
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } = \sum _ { v \in V } - w _ { 1 } y _ { v } \log \hat { y } _ { v } - w _ { 0 } ( 1 - y _ { v } ) \log ( 1 - \hat { y } _ { v } ) ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $v$ is a single voxel of the whole voxel space $V$ , $y _ { v }$ and $\hat { y } _ { v }$ are the ground truth and prediction, respectively, while $w _ { 0 }$ and $w _ { 1 }$ balance the losses between vacant and occupied voxels. This training leverages only synthetic data, not annotated shape and program pairs, which is a blessing of our disentangled representation.
|
| 101 |
+
|
| 102 |
+
# 4.3 GUIDED ADAPTATION
|
| 103 |
+
|
| 104 |
+
A program generator trained only on a synthetic dataset does not generalize well to real-world datasets. With the learned differentiable neural program executor, we can adapt our model to other datasets such as ShapeNet, where program-level supervision is not available. We execute the predicted program by the learned neural program executor and compute the reconstruction loss between the generated shape and the input. Afterwards, the program generator is updated by the gradient back-propagated from the learned program executor, whose weights are frozen.
|
| 105 |
+
|
| 106 |
+
This adaptation is guided by the learned program executor and therefore called guided adaptation $( G A )$ , and is shown in Figure 4. Given an input shape, the program generator first outputs multiple block programs. Each block is interpreted as 3D shapes by the program executor. A max-pooling operation over these block-level shapes generates the reconstructed shape. The use of max-pooling also enables our executor to handle programs of variable length. Vacant tokens are also executed and pooled. Gradients can then propagate through vacant tokens and the model can learn to add new program primitives accordingly. Here, the loss for Guided Adaptation is the summation of the binary cross-entropy loss over all voxels.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 4: Given an input 3D shape, the neural program executor executes the generated programs. Errors between the rendered shape and the raw input are back-propagated.
|
| 110 |
+
|
| 111 |
+
# 5 EXPERIMENTS
|
| 112 |
+
|
| 113 |
+
We present program generation and shape reconstruction results on three datasets: our synthetic dataset, ShapeNet (Chang et al., 2015), and Pix3D (Sun et al., 2018b).
|
| 114 |
+
|
| 115 |
+
Setup. In our experiments, we use a single model to predict programs for multiple categories. Our model is first pretrained on the synthetic dataset and subsequently adapted to target dataset such as ShapeNet and Pix3D under the guidance of the neural program executor. All components of our model are trained with Adam (Kingma & Ba, 2015).
|
| 116 |
+
|
| 117 |
+
# 5.1 EVALUATION ON THE SYNTHETIC DATASET
|
| 118 |
+
|
| 119 |
+
Program generator. We first pre-train our program generator on our synthetic dataset with simple templates. The synthetic training set includes 100,000 chairs and 100,000 tables. The generator is evaluated on 5,000 chairs and tables. More than $9 9 . 9 \%$ of the programs are accurately predicted. The shapes rendered by the predicted programs have an average IoU of 0.991 with the input shapes. This high accuracy is due to the simplicity of the synthetic dataset.
|
| 120 |
+
|
| 121 |
+
Program executor. Our program executor is trained on 500,000 pairs of synthetic block programs and corresponding shapes, and tested on 30,000 pairs. The IoU between the shapes rendered by the executor and the ground truth is 0.93 for a single drawing statement and 0.88 for compound statements. This shows the neural program executor is a good approximation of the graphics engine.
|
| 122 |
+
|
| 123 |
+
# 5.2 GUIDED ADAPTATION ON SHAPENET
|
| 124 |
+
|
| 125 |
+
Setup. We validate the effectiveness of guided adaptation by testing our model on unseen examples from ShapeNet. For both tables and chairs, we randomly select 1,000 shapes for evaluation and all the remaining ones for guided adaptation.
|
| 126 |
+
|
| 127 |
+
Quantitative results. After our model generates programs from input shapes, we execute these programs with a graphics engine and measure the reconstruction quality. Evaluation metrics include IoU, Chamfer distance (CD) (Barrow et al., 1977), and Earth Mover’s distance (EMD) (Rubner et al., 2000). While the pre-trained model achieves 0.99 IoU on the synthetic dataset, the IoU drops below 0.5 on ShapeNet, showing the significant disparity between these two domains. As shown in Table 2, all evaluation metrics suggests improvement after guided adaptation. For example, the IoUs of table and chair increase by 0.104 and 0.094, respectively. We compare our method with Tulsiani et al. (2017), which describes shapes with a set of primitives; and CSGNet (Sharma et al., 2018), which learns to describe shapes by applying arithmetic over primitives. For CSGNet, we evaluate two variants: first, CSGNet-original, where we directly test the model released by the original authors;
|
| 128 |
+
|
| 129 |
+
Table 2: Shape reconstruction results on ShapeNet, evaluated in intersection over union (IoU, higher is better), Chamfer distance (CD, lower is better), and Earth Mover’s distance (EMD, lower is better). Our model outperforms the baselines.
|
| 130 |
+
|
| 131 |
+
<table><tr><td rowspan="2">Models</td><td colspan="2">IoU↑</td><td colspan="2">CD↓</td><td colspan="2">EMD↓</td></tr><tr><td>table</td><td>chair</td><td>table</td><td>chair</td><td>table</td><td>chair</td></tr><tr><td>CSGNet-original</td><td>0.111</td><td>0.154</td><td>0.216</td><td>0.175</td><td>0.205</td><td>0.177</td></tr><tr><td>Tulsiani et al. (2017)</td><td>0.357</td><td>0.406</td><td>0.083</td><td>0.079</td><td>0.073</td><td>0.072</td></tr><tr><td>CSGNet-augmented</td><td>0.406</td><td>0.365</td><td>0.072</td><td>0.077</td><td>0.069</td><td>0.076</td></tr><tr><td>Nearest Neighbour</td><td>0.445</td><td>0.389</td><td>0.083</td><td>0.084</td><td>0.084</td><td>0.084</td></tr><tr><td>Shape Programs w/o GA</td><td>0.487</td><td>0.422</td><td>0.067</td><td>0.072</td><td>0.063</td><td>0.072</td></tr><tr><td> Shape Programs</td><td>0.591</td><td>0.516</td><td>0.058</td><td>0.063</td><td>0.056</td><td>0.060</td></tr></table>
|
| 132 |
+
|
| 133 |
+
second, CSGNet-augmented, where we retrain CSGNet on our dataset with the additional shape primitives we introduced. We also introduce a nearest neighbor baseline, where we use Hamming distance to search for a nearest neighbour from the training set for each testing sample.
|
| 134 |
+
|
| 135 |
+
Our model without guided adaptation outperforms Tulsiani et al. (2017) and CSGNet by a margin, showing the benefit of capturing regularities such as symmetry and translation. The NN baseline suggests that simply memorizing the training set does not generalize well to test shapes. With the learned neural program executor, we try to directly train our program generator on ShapeNet without any pre-training. This trial failed, possibly because of the extremely huge and complicated combinatorial space of programs. However, the initial programs for pre-training can be very simple: e.g., 10 simple table templates (Fig. A1) are sufficient to initialize the model, which later achieves good performance under execution-guided adaptation.
|
| 136 |
+
|
| 137 |
+
Qualitative results. Figure 5 shows some program generation and shape reconstruction results for tables and chairs, respectively. The input shapes can be noisy and contain components that are not covered by templates in our synthetic dataset. After guided adaption, our model is able to extract more meaningful programs and reconstruct the input shape reasonably well.
|
| 138 |
+
|
| 139 |
+
Our model can be adapted to either add or delete programs, as shown in Figure 5. In (a), we observe an addition of translation describing the armrests. In (b) the “cylinder support” program is removed and a nested translation is added to describe four legs. In (c) and (d), the addition of “Horizontal bar” and “Rectangle layer” leads to more accurate representation. Improvements utilizing modifications to compound programs are not restricted to translations, but can also be observed in rotations, e.g., the times of rotation in (a) is increased from 4 to 5. We also notice new templates emerges after adaptation, e.g., tables in (c) and (d) are not in the synthetic dataset (check the synthetic templates for tables in supplementary). These changes are significant because it indicates the generator can map complex, non-linear relationships to the program space.
|
| 140 |
+
|
| 141 |
+
# 5.3 STABILITY AND CONNECTIVITY MEASUREMENT
|
| 142 |
+
|
| 143 |
+
Stability and connectivity are necessary for the functioning of many real-world shapes. This is difficult to capture using purely low-level primitives, but are better suited to our program representations.
|
| 144 |
+
|
| 145 |
+
We define a shape as stable if its center of mass falls within the convex hull of its ground contacts, and we define a shape as connected if all voxels form one connected component. In Table 3 we compare our model against Tulsiani et al. (2017) and observe significant improvements in the stability of shapes produced by our model when compared to this baseline. This is likely because our model is able to represent multiple identical objects by utilizing translations and rotations. Before GA, our model produces chairs with lower connectivity, but we observe significant improvements with GA. This can be explained by the significant diversity in the ShapeNet dataset under the “chair” class. However, the improvements with GA also demonstrate an ability for our model to generalize. Measured by the percentage of produced shapes that are stable and connected, our model gets significantly better results, and continues to improve with guided adaptation.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 5: The program generation for ShapeNet chairs and tables. For each shape, the first and second rows represent results before and after guided adaptation. Best viewed in color.
|
| 149 |
+
|
| 150 |
+
<table><tr><td rowspan="2">Models</td><td colspan="2">Stable (%)</td><td colspan="2">Conn. (%)</td><td colspan="2">Stable & Conn. (%)</td></tr><tr><td>table</td><td>chair</td><td>table</td><td>chair</td><td>table</td><td>chair</td></tr><tr><td>Tulsiani et al. (2017)</td><td>36.7</td><td>31.3</td><td>37.1</td><td>68.9</td><td>15.4</td><td>19.6</td></tr><tr><td> Shape Programs w/o GA</td><td>94.7</td><td>95.1</td><td>76.6</td><td>54.2</td><td>73.7</td><td>51.6</td></tr><tr><td>Shape Programs</td><td>97.0</td><td>96.5</td><td>78.4</td><td>68.5</td><td>77.0</td><td>66.0</td></tr><tr><td>Ground Truth</td><td>98.9</td><td>97.6</td><td>98.8</td><td>97.8</td><td>97.7</td><td>95.5</td></tr></table>
|
| 151 |
+
|
| 152 |
+
Table 3: Measurement of stability and connectivity. Our model is able to capture shape regularity such as symmetry. Therefore, shapes represented by our programs are more stable and better connected.
|
| 153 |
+
|
| 154 |
+
# 5.4 GENERALIZATION ON OTHER SHAPES
|
| 155 |
+
|
| 156 |
+
While our program generator is pre-trained only on synthetic chairs and tables, generalization on other shape categories is desirable. We further demonstrate that with guided adaptation, our program generator can be transferred to other unseen categories.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="3">Models</td><td colspan="4">IoU↑</td><td colspan="4">CD←</td></tr><tr><td>bed</td><td>sofa</td><td>cabinet</td><td>bench</td><td>bed</td><td>sofa</td><td>cabinet</td><td>bench</td></tr><tr><td>Shape Programs w/o GA</td><td>0.234</td><td>0.296</td><td>0.251</td><td>0.176</td><td>0.126</td><td>0.103</td><td>0.104</td><td>0.098</td></tr><tr><td>Shape Programs</td><td>0.367</td><td>0.597</td><td>0.478</td><td>0.418</td><td>0.096</td><td>0.067</td><td>0.092</td><td>0.059</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 4: Shape reconstruction results on unseen categories. Results with or without guided adaptation in intersection over union (IoU, higher is better) and Chamfer distance (CD, lower is better).
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 6: ShapeNet objects from unseen categories reconstructed with shape programs before and after guided adaptation. Shape Programs can learn to adapt and explain objects from novel classes.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 7: 3D reconstruction results on Pix3D dataset. MarrNet generates fragmentary shapes and our model further smooths and completes such shapes.
|
| 167 |
+
|
| 168 |
+
We consider Bed, Bench, Cabinet, and Sofa, which share similar semantics with table and chair but are unseen during pre-training. We split $80 \%$ shapes of each category for guided adaptation and the remaining for evaluation. Table 4 suggests the pre-trained model performs poorly for these unseen shapes but its performance improves with this unsupervised guided adaptation. The IoU of bed improves from 0.23 to 0.37, sofa from 0.30 to 0.60, cabinet from 0.25 to 0.48, and bench from 0.18 to 0.42. This clearly illustrates the generalization ability of our framework. Visualized examples are show in Figure 6.
|
| 169 |
+
|
| 170 |
+
# 5.5 SHAPE COMPLETION AND SMOOTHING BY PROGRAMS
|
| 171 |
+
|
| 172 |
+
One natural application of our model is to complete and smooth fragmentary shapes reconstructed from 2D images. We separately train a MarrNet (Wu et al., 2017) model for chairs and tables on ShapeNet, and then reconstruct 3D shapes from 2D images on the Pix3D dataset. As shown in Figure 7, MarrNet can generate fragmentary shapes, which are then fed into our model to generate programs. These programs are executed by the graphics engine to produce a smooth and complete shape. For instance, our model can complete the legs of chairs and tables, as shown in Figure 7.
|
| 173 |
+
|
| 174 |
+
While stacking our model on top of MarrNet does not change the IoU of 3D reconstruction, our model produces more visually appealing and human-perceptible results. A user study on AMT shows that $78 . 9 \%$ of the participant responses prefer our results rather than MarrNet’s.
|
| 175 |
+
|
| 176 |
+
# 6 DISCUSSION
|
| 177 |
+
|
| 178 |
+
We have introduced 3D shape programs as a new shape representation. We have also proposed a model for inferring shape programs, which combines a neural program synthesizer and a neural executor. Experiments on ShapeNet show that our model successfully explains shapes as programs and generalizes to shapes outside training categories. Further experiments on Pix3D show our model can be extended to infer shape programs and reconstruct 3D shapes directly from color images. We now discuss key design choices and future work.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 8: We visualize the effect of manipulating individual dimensions in the intermediate representation of neural program executor. For example, dimension 27 corresponds to the height of primitives, dimension 25 to the radius of primitives, and dimension 41 to the times of primitive repetition.
|
| 182 |
+
|
| 183 |
+
Analyzing the neural program executor. We look deep into the intermediate representation of the neural program executor, which is a 64-dimensional vector output by the LSTM (see Figure 3). We manipulate individual dimensions and visualize the generated voxels. Figure 8 shows that these dimensions capture interpretable geometric features (e.g., height, radius, and number of repetitions).
|
| 184 |
+
|
| 185 |
+
Design of the DSL. Our design of the DSL for shape programs makes certain semantic commitments. A DSL with these semantics has advantages and disadvantages: it naturally supports semantic correspondences across shapes and enables better in-class reconstructions; on the other hand, it may limit the ability to generalize to shapes outside training classes. Our current instantiation focuses on the semantics of furniture (a superclass, whose subclasses share similar semantics). Within this superclass, our model generalizes well: trained on chairs and tables, it generalizes to new furniture categories such as beds. In future work, we are interested in learning a library of shape primitives directly from data, which will allow our approach to adapt automatically to new superclasses or domains of shape.
|
| 186 |
+
|
| 187 |
+
Structure search vs. amortized inference. For our program synthesis task, we use neural nets for amortized inference rather than structure search, due to the large search space and our desire to return a shape interpretation nearly instantaneously, effectively trading neural net training time for fast inference at test time. Our model takes $5 \mathrm { m s }$ to infer a shape program with a Titan X GPU. We also considered various possible approaches for structured search over the space of shape programs, but decided that these would most likely be too our slow for our goals.
|
| 188 |
+
|
| 189 |
+
One approach to structured search is constraint solving. Ellis et al. (2015) used the performant Z3 SMT solver (De Moura & Bjørner, 2008) to infer 2D graphics programs, taking 5-20 minutes for problems arguably simpler than our 3D shape programs. Other approaches could be based on stochastic search, such as MCMC in the space of programs. For the related problem of inverse graphics from 2D images, MCMC, like constraint solving, takes too long for perception at a glance (Kulkarni et al., 2015b). Efficient integration of discrete search and amortized inference, however, is a promising future research direction.
|
| 190 |
+
|
| 191 |
+
Acknowledgments. We thank Keyulu Xu and Xiuming Zhang for insightful discussions and anonymous reviewers for their feedback. This work is supported by the Center for Brains, Minds and Machines (NSF #1231216), NSF #1447476, ONR MURI N00014-16-1-2007, and Facebook.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Matej Balog, Alexander L Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tarlow. Deepcoder: Learning to write programs. In ICLR, 2017. 3
|
| 196 |
+
|
| 197 |
+
Harry G Barrow, Jay M Tenenbaum, Robert C Bolles, and Helen C Wolf. Parametric correspondence and chamfer matching: Two new techniques for image matching. In IJCAI, 1977. 6
|
| 198 |
+
|
| 199 |
+
Irving Biederman. Recognition-by-components: a theory of human image understanding. Psychol. Rev., 94(2):115, 1987. 2
|
| 200 |
+
|
| 201 |
+
Thomas O Binford. Visual perception by computer. Invited talk at IEEE Conf. on Systems and Control, 1971. 2
|
| 202 |
+
|
| 203 |
+
Matko Bosnjak, Tim Rockt ˇ aschel, Jason Naradowsky, and Sebastian Riedel. Programming with a ¨ differentiable forth interpreter. In ICML, 2017. 3
|
| 204 |
+
|
| 205 |
+
Jonathon Cai, Richard Shin, and Dawn Song. Making neural programming architectures generalize via recursion. In ICLR, 2017. 3
|
| 206 |
+
|
| 207 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. Shapenet: An information-rich 3d model repository. arXiv:1512.03012, 2015. 1, 6
|
| 208 |
+
|
| 209 |
+
Siddhartha Chaudhuri, Evangelos Kalogerakis, Leonidas Guibas, and Vladlen Koltun. Probabilistic reasoning for assembly-based 3d modeling. ACM TOG, 30(4):35, 2011. 2
|
| 210 |
+
|
| 211 |
+
Leonardo De Moura and Nikolaj Bjørner. Z3: An efficient smt solver. In TACAS, 2008. 10
|
| 212 |
+
|
| 213 |
+
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. Robustfill: Neural program learning under noisy i/o. In ICML, 2017. 3
|
| 214 |
+
|
| 215 |
+
Daniel D Dilks, Joshua B Julian, Jonas Kubilius, Elizabeth S Spelke, and Nancy Kanwisher. Mirrorimage sensitivity and invariance in object and scene processing pathways. J. Neurosci., 31(31): 11305–11312, 2011. 1
|
| 216 |
+
|
| 217 |
+
Kevin Ellis, Armando Solar-Lezama, and Josh Tenenbaum. Unsupervised learning by program synthesis. In NeurIPS, 2015. 3, 10
|
| 218 |
+
|
| 219 |
+
Kevin Ellis, Daniel Ritchie, Armando Solar-Lezama, and Joshua B Tenenbaum. Learning to infer graphics programs from hand-drawn imatges. In NeurIPS, 2018. 3
|
| 220 |
+
|
| 221 |
+
Franc¸ois Fleuret, Ting Li, Charles Dubout, Emma K Wampler, Steven Yantis, and Donald Geman. Comparing machines and humans on a visual categorization test. PNAS, 108(43):17621–17625, 2011. 4
|
| 222 |
+
|
| 223 |
+
Yaroslav Ganin, Tejas Kulkarni, Igor Babuschkin, SM Eslami, and Oriol Vinyals. Synthesizing programs for images using reinforced adversarial learning. In ICML, 2018. 3
|
| 224 |
+
|
| 225 |
+
Alexander L Gaunt, Marc Brockschmidt, Rishabh Singh, Nate Kushman, Pushmeet Kohli, Jonathan Taylor, and Daniel Tarlow. Terpret: A probabilistic programming language for program induction. arXiv preprint arXiv:1608.04428, 2016. 3
|
| 226 |
+
|
| 227 |
+
Justin Johnson, Bharath Hariharan, Laurens van der Maaten, Judy Hoffman, Li Fei-Fei, C Lawrence Zitnick, and Ross Girshick. Inferring and executing programs for visual reasoning. In ICCV, 2017. 3
|
| 228 |
+
|
| 229 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 6
|
| 230 |
+
|
| 231 |
+
Kurt Koffka. Principles of Gestalt psychology. Routledge, 2013. 1
|
| 232 |
+
|
| 233 |
+
Tejas D Kulkarni, Pushmeet Kohli, Joshua B Tenenbaum, and Vikash Mansinghka. Picture: A probabilistic programming language for scene perception. In CVPR, 2015a. 2
|
| 234 |
+
|
| 235 |
+
Tejas D Kulkarni, William F Whitney, Pushmeet Kohli, and Josh Tenenbaum. Deep convolutional inverse graphics network. In NeurIPS, 2015b. 10
|
| 236 |
+
|
| 237 |
+
Jun Li, Kai Xu, Siddhartha Chaudhuri, Ersin Yumer, Hao Zhang, and Leonidas Guibas. Grass: Generative recursive autoencoders for shape structures. In SIGGRAPH, 2017. 2
|
| 238 |
+
|
| 239 |
+
Yunchao Liu, Zheng Wu, Daniel Ritchie, William T Freeman, Joshua B Tenenbaum, and Jiajun Wu. Learning to describe scenes with programs. In ICLR, 2019. 3
|
| 240 |
+
|
| 241 |
+
Zhijian Liu, William T Freeman, Joshua B Tenenbaum, and Jiajun Wu. Physical primitive decomposition. In ECCV, 2018. 2
|
| 242 |
+
|
| 243 |
+
Niloy Mitra, Michael Wand, Hao Richard Zhang, Daniel Cohen-Or, Vladimir Kim, and Qi-Xing Huang. Structure-aware shape processing. In SIGGRAPH Asia Courses, 2013. 2
|
| 244 |
+
|
| 245 |
+
Gen Nishida, Ignacio Garcia-Dorado, Daniel G Aliaga, Bedrich Benes, and Adrien Bousseau. Interactive sketching of urban procedural models. ACM TOG, 35(4):130, 2016. 2
|
| 246 |
+
|
| 247 |
+
Gen Nishida, Adrien Bousseau, and Daniel G Aliaga. Procedural modeling of a building from a single image. CGF, 37(2):415–429, 2018. 2
|
| 248 |
+
|
| 249 |
+
Emilio Parisotto, Abdel-rahman Mohamed, Rishabh Singh, Lihong Li, Dengyong Zhou, and Pushmeet Kohli. Neuro-symbolic program synthesis. In ICLR, 2017. 3
|
| 250 |
+
|
| 251 |
+
Charles R Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In NeurIPS, 2017. 1
|
| 252 |
+
|
| 253 |
+
Scott Reed and Nando De Freitas. Neural programmer-interpreters. In ICLR, 2016. 3
|
| 254 |
+
|
| 255 |
+
Daniel Ritchie, Anna Thomas, Pat Hanrahan, and Noah Goodman. Neurally-guided procedural models: Amortized inference for procedural graphics programs using neural networks. In NeurIPS, 2016. 2
|
| 256 |
+
|
| 257 |
+
Lawrence G Roberts. Machine perception of three-dimensional solids. PhD thesis, Massachusetts Institute of Technology, 1963. 2
|
| 258 |
+
|
| 259 |
+
Yossi Rubner, Carlo Tomasi, and Leonidas J Guibas. The earth mover’s distance as a metric for image retrieval. IJCV, 40(2):99–121, 2000. 6
|
| 260 |
+
|
| 261 |
+
Adriana Schulz, Ariel Shamir, Ilya Baran, David IW Levin, Pitchaya Sitthi-Amorn, and Wojciech Matusik. Retrieval on parametric shape collections. ACM TOG, 36(1):11, 2017. 2
|
| 262 |
+
|
| 263 |
+
Gopal Sharma, Rishabh Goyal, Difan Liu, Evangelos Kalogerakis, and Subhransu Maji. Csgnet: Neural shape parser for constructive solid geometry. In CVPR, 2018. 1, 2, 6
|
| 264 |
+
|
| 265 |
+
Ondrej St’ava, Bedrich Bene ˇ s, Radomir M ˇ ech, Daniel G Aliaga, and Peter Kri ˇ stof. Inverse procedural ˇ modeling by automatic generation of l-systems. CGF, 29(2):665–674, 2010. 2
|
| 266 |
+
|
| 267 |
+
Shao-Hua Sun, Hyeonwoo Noh, Sriram Somasundaram, and Joseph Lim. Neural program synthesis from diverse demonstration videos. In ICML, 2018a. 3
|
| 268 |
+
|
| 269 |
+
Xingyuan Sun, Jiajun Wu, Xiuming Zhang, Zhoutong Zhang, Chengkai Zhang, Tianfan Xue, Joshua B Tenenbaum, and William T Freeman. Pix3d: Dataset and methods for single-image 3d shape modeling. In CVPR, 2018b. 6
|
| 270 |
+
|
| 271 |
+
Shubham Tulsiani, Hao Su, Leonidas J Guibas, Alexei A Efros, and Jitendra Malik. Learning shape abstractions by assembling volumetric primitives. In CVPR, 2017. 1, 2, 6, 7, 8
|
| 272 |
+
|
| 273 |
+
Anton van den Hengel, Chris Russell, Anthony Dick, John Bastian, Daniel Pooley, Lachlan Fleming, and Lourdes Agapito. Part-based modelling of compound scenes from images. In CVPR, 2015. 2
|
| 274 |
+
|
| 275 |
+
Nanyang Wang, Yinda Zhang, Zhuwen Li, Yanwei Fu, Wei Liu, and Yu-Gang Jiang. Pixel2mesh: Generating 3d mesh models from single rgb images. In ECCV, 2018. 1
|
| 276 |
+
|
| 277 |
+
Jiajun Wu, Yifan Wang, Tianfan Xue, Xingyuan Sun, William T Freeman, and Joshua B Tenenbaum. MarrNet: 3D Shape Reconstruction via 2.5D Sketches. In NeurIPS, 2017. 9
|
| 278 |
+
|
| 279 |
+
Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In CVPR, 2015. 1
|
| 280 |
+
|
| 281 |
+
Chenyang Zhu, Kai Xu, Siddhartha Chaudhuri, Renjiao Yi, and Hao Zhang. Scores: Shape composition with recursive substructure priors. In SIGGRAPH Asia, 2018. 2
|
| 282 |
+
|
| 283 |
+
Chuhang Zou, Ersin Yumer, Jimei Yang, Duygu Ceylan, and Derek Hoiem. 3d-prnn: Generating shape primitives with recurrent neural networks. In ICCV, 2017. 2
|
| 284 |
+
|
| 285 |
+
# A.1 DEFINED PROGRAMS
|
| 286 |
+
|
| 287 |
+
The details of semantics and shape primitives in our experimental setting for furniture are shown in Table 5. Due to the semantic nature of objects, while a few semantics are category specific, e.g., “ChairBeam”, other semantics are shared across different shape categories, e.g., “Leg” and “Top”.
|
| 288 |
+
|
| 289 |
+
<table><tr><td rowspan="6"></td><td>Leg</td><td>Chair leg, table leg,etc. Usually long and used jointly for support</td></tr><tr><td>Top</td><td>Seat top, table top,etc.Usually a broad and flat surface</td></tr><tr><td>Layer</td><td>Shelf embedded in table,cabinet shelf etc.Usually a flat surface between other similar shapes</td></tr><tr><td>Support</td><td>Chair support, table support etc.A monolithic object used to raise things off the ground</td></tr><tr><td>Base</td><td>Base of an sofa, table etc. Usually a flat surface on the ground to help with stability</td></tr><tr><td>Sideboard</td><td>Sideboard of a cabinet, table etc.A vertical, flat surface on the</td></tr><tr><td>Semantics Horizontal Bar</td><td>bottom half of an object Horizontal bar of a chair etc.A thin bar used for structural</td></tr><tr><td>Vertical Board</td><td>integrity Vertical board of a arm rest etc.A vertical, flat surface used by</td></tr><tr><td>Locker</td><td>humans for arm support Table drawer etc. A boxy object used to put things in</td></tr><tr><td>Back</td><td>Chair back, Sofa back etc.A surface used for resting backs on</td></tr><tr><td>Back support</td><td>Office chair back support beam etc.A beam used to support a</td></tr><tr><td>ChairBeam</td><td>back rest Arm rest support beam in chairs,benches etc.A long object used</td></tr><tr><td rowspan="5"> Shapes</td><td>Cylinder (Cyl)</td><td>to support an arm rest P = (x,y,z),G = (t,r),draw a cylinder at (x,y,z) with sizes (t,r)</td></tr><tr><td>Cuboid (Cub)</td><td>P = (x,y,z),G = (t,r1,r2,[angl), draw a cuboid at (x,y,z) with sizes (t,r1,r2) and optional ang of tilt along front/back</td></tr><tr><td>Circle (Cir)</td><td>P = (x,y,z),G = (t,r), draw a circle at (x,y,z) with sizes (t,r),t is usually small</td></tr><tr><td>Square (Sqr)</td><td>P = (x,y,z),G = (t,r), draw a square at (x,y,z) with sizes (t,r),t is usually small</td></tr><tr><td>Rectangle (Rect)</td><td>P = (x,y,z),G= (t,r1,r2), draw a rectangle at (x,y,z) with sizes (t,r1,r2),t is usually small</td></tr><tr><td>Line (Line)</td><td></td><td>P = (𝑥1,y1,z1),G = (x2,y2, z2),draw a line from P to G</td></tr></table>
|
| 290 |
+
|
| 291 |
+
Table 5: The list of semantics and shapes, as well as associated parameters used by our model
|
| 292 |
+
|
| 293 |
+
# A.2 ARCHITECTURE DETAILS
|
| 294 |
+
|
| 295 |
+
Program Generator. The program executor contains a 3D ConvNet and two LSTMS. (1) 3D ConvNet. This 3D ConvNet is the first part of the program generator model. It consists of 8 3D convolutional layers. The kernel size of each layer is 3 except for the first one whose kernel size is 5. The number of output channels are (8,16,16,32,32,64,64,64), respectively. The output of the last layer is averaged over the spatial resolution, which gives a 64-dimension embedding. (2) Block LSTM and Step LSTM. These two LSTMs share similar structure. Both are one-layer LSTMs. The dimensions of the input and hidden state are both 64.
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure A1: (a) shows random samples from all of our 10 table templates for synthetic dataset (b) shows raw and reconstructed tables on ShapeNet
|
| 299 |
+
|
| 300 |
+
Program Executor. The program executor contains an LSTM and a 3D DeConvNet. (1) LSTM. This LSTM aggregates a block-level programs into a 64-dimensional vector. The dimension of the hidden state is also 64. The input of each time step is the concatenation of category distribution over programs and the corresponding parameters retrieved from the parameter matrix. (2) 3D DeConvNet. It consists of 7 layers. TransposedConv layer with kernel size 4 and Conv layer with kernel size 3 are alternating. The number of output channels are (64, 64, 16, 16, 4, 4, 2), respectively. The output of the last layer is fed into a sigmoid function to generate the 3D voxel shape.
|
| 301 |
+
|
| 302 |
+
End-to-end differentiability. The end-to-end differentiability is obtained via our design of the neural program executor. The output of the program inference model is actually continuous. A real execution engine (not the neural executor) actually contains two steps: (1) discretize such output, and (2) execute the discretized program to generate the voxel. Our neural executor is learned to jointly approximate both steps, thus the whole pipeline can be differentiable in an end-to-end manner.
|
| 303 |
+
|
| 304 |
+
# A.3 SYNTHETIC TEMPLATES V.S. SHAPENET
|
| 305 |
+
|
| 306 |
+
ShapeNet was proposed to be the ImageNet of shapes; it is therefore highly diverse and intrinsically challenging. Our synthetic dataset were designed to provide minimal, simple guidance to the network. In Figure A1, (a) shows sampled shapes from all of our 10 table templates, while (b) shows the ground truth and reconstructed tables in ShapeNet, which are siginificantly more complex. Such disparity of complexity explains why we saw a dramatic drop of IoU when we directly tested on ShapeNet with model only pretrained on synthetic dataset. Our guided adaptation further adapt the pre-trained model.
|
| 307 |
+
|
| 308 |
+
# A.4 ADDITIONAL RESULTS
|
| 309 |
+
|
| 310 |
+
In Figure A2 through Figure A8, we show the generated shape and programs using a network that is only pretrained jointly on synthetic “table” and “chair” objects, and a network that is pretrained then further enhanced by guided adaptation on ShapeNet data. Figure A2 and Figure A3 correspond to “chairs”, Figure A4 to “tables”, Figure A5 to “benches”, Figure A6 to “couches”, Figure A7 to “cabinets”, and Figure A8 to “beds”. In Figure A2, Figure A3, and Figure A4, even though “chair” and “table” have been seen in the synthetic dataset, we still note improvements in program inference and shape reconstruction on ShapeNet after guided adaptation. This is because our synthetic data is simpler than ShapeNet data. When directly using a model pretrained on synthetic “chairs” and “tables” to other classes, it is not surprised some shapes are interpreted as tables or chairs. However, such mispredictions dramatically drop after our guided adaptation.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure A2: (a) to (f) show the generated shapes and programs for ShapeNet chairs
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure A3: (a) to (f) show the generated shapes and programs for ShapeNet chairs
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure A4: (a) to (f) show the generated shapes and programs for ShapeNet tables
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure A5: (a) to (f) show the generated shapes and programs for ShapeNet benches
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure A6: (a) to (f) show the generated shapes and programs for ShapeNet couches
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure A7: (a) to (d) show the generated shapes and programs for ShapeNet cabinets
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure A8: (a) and (b) show the generated shapes and programs for ShapeNet beds
|
md/train/uUlGTEbBRL/uUlGTEbBRL.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pdf/train/bNdohBx9sPa.pdf
ADDED
|
Binary file (17.4 kB). View file
|
|
|