Datasets:
Add files using upload-large-folder tool
Browse files- parse/train/HJgLZR4KvH/HJgLZR4KvH.md +489 -0
- parse/train/HJgLZR4KvH/HJgLZR4KvH_content_list.json +0 -0
- parse/train/HJgLZR4KvH/HJgLZR4KvH_middle.json +0 -0
- parse/train/HJgLZR4KvH/HJgLZR4KvH_model.json +0 -0
- parse/train/HJxDugSFDB/HJxDugSFDB.md +415 -0
- parse/train/HJxDugSFDB/HJxDugSFDB_content_list.json +0 -0
- parse/train/HJxDugSFDB/HJxDugSFDB_middle.json +0 -0
- parse/train/HJxDugSFDB/HJxDugSFDB_model.json +0 -0
- parse/train/JbuYF437WB6/JbuYF437WB6.md +366 -0
- parse/train/JbuYF437WB6/JbuYF437WB6_content_list.json +0 -0
- parse/train/JbuYF437WB6/JbuYF437WB6_middle.json +0 -0
- parse/train/JbuYF437WB6/JbuYF437WB6_model.json +0 -0
- parse/train/Syxt5oC5YQ/Syxt5oC5YQ.md +566 -0
- parse/train/Syxt5oC5YQ/Syxt5oC5YQ_content_list.json +0 -0
- parse/train/Syxt5oC5YQ/Syxt5oC5YQ_middle.json +0 -0
- parse/train/Syxt5oC5YQ/Syxt5oC5YQ_model.json +0 -0
- parse/train/n6jl7fLxrP/n6jl7fLxrP.md +0 -0
- parse/train/n6jl7fLxrP/n6jl7fLxrP_content_list.json +0 -0
- parse/train/n6jl7fLxrP/n6jl7fLxrP_middle.json +0 -0
- parse/train/n6jl7fLxrP/n6jl7fLxrP_model.json +0 -0
parse/train/HJgLZR4KvH/HJgLZR4KvH.md
ADDED
|
@@ -0,0 +1,489 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DYNAMICS-AWARE UNSUPERVISED DISCOVERY OF SKILLS
|
| 2 |
+
|
| 3 |
+
Archit Sharma∗, Shixiang Gu, Sergey Levine, Vikash Kumar, Karol Hausman Google Brain {architsh,shanegu,slevine,vikashplus,karolhausman}@google.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Conventionally, model-based reinforcement learning (MBRL) aims to learn a global model for the dynamics of the environment. A good model can potentially enable planning algorithms to generate a large variety of behaviors and solve diverse tasks. However, learning an accurate model for complex dynamical systems is difficult, and even then, the model might not generalize well outside the distribution of states on which it was trained. In this work, we combine model-based learning with model-free learning of primitives that make modelbased planning easy. To that end, we aim to answer the question: how can we discover skills whose outcomes are easy to predict? We propose an unsupervised learning algorithm, Dynamics-Aware Discovery of Skills (DADS), which simultaneously discovers predictable behaviors and learns their dynamics. Our method can leverage continuous skill spaces, theoretically, allowing us to learn infinitely many behaviors even for high-dimensional state-spaces. We demonstrate that zero-shot planning in the learned latent space significantly outperforms standard MBRL and model-free goal-conditioned RL, can handle sparsereward tasks, and substantially improves over prior hierarchical RL methods for unsupervised skill discovery. We have open-sourced our implementation at: https://github.com/google-research/dads
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
Figure 1: A humanoid agent discovers diverse locomotion primitives without any reward using DADS. We show zero-shot generalization to downstream tasks by composing the learned primitives using model predictive control, enabling the agent to follow an online sequence of goals (green markers) without any additional training.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Deep reinforcement learning (RL) enables autonomous learning of diverse and complex tasks with rich sensory inputs, temporally extended goals, and challenging dynamics, such as discrete gameplaying domains (Mnih et al., 2013; Silver et al., 2016), and continuous control domains including locomotion (Schulman et al., 2015; Heess et al., 2017) and manipulation (Rajeswaran et al., 2017; Kalashnikov et al., 2018; Gu et al., 2017). Most of the deep RL approaches learn a Q-function or a policy that are directly optimized for the training task, which limits their generalization to new scenarios. In contrast, MBRL methods (Li & Todorov, 2004; Deisenroth & Rasmussen, 2011; Watter et al., 2015) can acquire dynamics models that may be utilized to perform unseen tasks at test time. While this capability has been demonstrated in some of the recent works (Levine et al., 2016; Nagabandi et al., 2018; Chua et al., 2018b; Kurutach et al., 2018; Ha & Schmidhuber,
|
| 15 |
+
|
| 16 |
+
2018), learning an accurate global model that works for all state-action pairs can be exceedingly challenging, especially for high-dimensional system with complex and discontinuous dynamics. The problem is further exacerbated as the learned global model has limited generalization outside of the state distribution it was trained on and exploring the whole state space is generally infeasible. Can we retain the flexibility of model-based RL, while using model-free RL to acquire proficient low-level behaviors under complex dynamics?
|
| 17 |
+
|
| 18 |
+
While learning a global dynamics model that captures all the different behaviors for the entire statespace can be extremely challenging, learning a model for a specific behavior that acts only in a small part of the state-space can be much easier. For example, consider learning a model for dynamics of all gaits of a quadruped versus a model which only works for a specific gait. If we can learn many such behaviors and their corresponding dynamics, we can leverage model-predictive control to plan in the behavior space, as opposed to planning in the action space. The question then becomes: how do we acquire such behaviors, considering that behaviors could be random and unpredictable? To this end, we propose Dynamics-Aware Discovery of Skills (DADS), an unsupervised RL framework for learning low-level skills using model-free RL with the explicit aim of making model-based control easy. Skills obtained using DADS are directly optimized for predictability, providing a better representation on top of which predictive models can be learned. Crucially, the skills do not require any supervision to learn, and are acquired entirely through autonomous exploration. This means that the repertoire of skills and their predictive model are learned before the agent has been tasked with any goal or reward function. When a task is provided at test-time, the agent utilizes the previously learned skills and model to immediately perform the task without any further training.
|
| 19 |
+
|
| 20 |
+
The key contribution of our work is an unsupervised reinforcement learning algorithm, DADS, grounded in mutual-information-based exploration. We demonstrate that our objective can embed learned primitives in continuous spaces, which allows us to learn a large, diverse set of skills. Crucially, our algorithm also learns to model the dynamics of the skills, which enables the use of model-based planning algorithms for downstream tasks. We adapt the conventional model predictive control algorithms to plan in the space of primitives, and demonstrate that we can compose the learned primitives to solve downstream tasks without any additional training.
|
| 21 |
+
|
| 22 |
+
# 2 PRELIMINARIES
|
| 23 |
+
|
| 24 |
+
Mutual information can been used as an objective to encourage exploration in reinforcement learning (Houthooft et al., 2016; Mohamed & Rezende, 2015). According to its definition, ${ \mathcal { T } } ( X ; Y ) ~ { \stackrel { } { = } } ~$ $\mathcal { H } ( X ) - \mathcal { H } ( X \mid Y )$ , maximizing mutual information $\mathcal { T }$ with respect to $Y$ amounts to maximizing the entropy $\mathcal { H }$ of $X$ while minimizing the conditional entropy $\mathcal { H } ( X \mid Y )$ . In the context of RL, $X$ is usually a function of the state and $Y$ a function of actions. Maximizing this objective encourages the state entropy to be high, making the underlying policy to be exploratory. Recently, multiple works (Eysenbach et al., 2018; Gregor et al., 2016; Achiam et al., 2018) apply this idea to learn diverse skills which maximally cover the state space.
|
| 25 |
+
|
| 26 |
+
To leverage planning-based control, MBRL estimates the true dynamics of the environment by learning a model $\hat { p } ( s ^ { \prime } \mid \bar { s } , a )$ . This allows it to predict a trajectory of states $\hat { \tau } _ { H } = ( s _ { t } , \hat { s } _ { t + 1 } , \dots \hat { s } _ { t + H } )$ resulting from a sequence of actions without any additional interaction with the environment. While model-based RL methods have been demonstrated to be sample efficient compared to their modelfree counterparts, learning an effective model for the whole state-space is challenging. An openproblem in model-based RL is to incorporate temporal abstraction in model-based control, to enable high-level planning and move-away from planning at the granular level of actions.
|
| 27 |
+
|
| 28 |
+
These seemingly unrelated ideas can be combined into a single optimization scheme, where we first discover skills (and their models) without any extrinsic reward and then compose these skills to optimize for the task defined at test time using model-based planning. At train time, we assume a Markov Decision Process (MDP) $\mathcal { M } _ { 1 } \equiv ( S , \mathcal { A } , p )$ . The state space $s$ and action space $\mathcal { A }$ are assumed to be continuous, and the $\mathcal { A }$ bounded. We assume the transition dynamics $p$ to be stochastic, such that $p : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \mapsto [ 0 , \infty )$ . We learn a skill-conditioned policy $\pi ( \boldsymbol { a } \mid s , z )$ , where the skills $z$ belongs to the space $\mathcal { Z }$ , detailed in Section 3. We assume that the skills are sampled from a prior $p ( z )$ over $\mathcal { Z }$ . We simultaneously learn a skill-conditioned transition function $q ( s ^ { \prime } \mid s , z )$ , coined as skill-dynamics, which predicts the transition to the next state $s ^ { \prime }$ from the current state $s$ for the skill $z$ under the given dynamics $p$ . At test time, we assume an MDP $\mathcal { M } _ { 2 } \equiv ( \mathcal { S } , \mathcal { A } , p , r )$ , where $s , A , p$ match those defined in $\mathcal { M } _ { 1 }$ , and the reward function $r : S \times A \mapsto ( - \infty , \infty )$ . We plan in $\mathcal { Z }$ using $q ( s ^ { \prime } \mid s , z )$ to compose the learned skills $z$ for optimizing $r$ in $\mathcal { M } _ { 2 }$ , which we detail in Section 4.
|
| 29 |
+
|
| 30 |
+
# 3 DYNAMICS-AWARE DISCOVERY OF SKILLS (DADS)
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: The agent $\pi$ interacts with the environment to produce a transition $s s ^ { \prime }$ . Intrinsic reward is computed by computing the transition probability under $q$ for the current skill $z$ , compared to random samples from the prior $p ( \bar { z } )$ . The agent maximizes the intrinsic reward computed for a batch of episodes, while $q$ maximizes the log-probability of the actual transitions of $( s , z ) \to s ^ { \prime }$ .
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
|
| 37 |
+
We use the information theoretic paradigm of mutual information to obtain our unsupervised skill discovery algorithm. In particular, we propose to maximize the mutual information between the next state $s ^ { \prime }$ and current skill $z$ conditioned on the current state $s$ .
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\begin{array} { r } { \begin{array} { r } { \mathcal { T } ( s ^ { \prime } ; z \mid s ) = \mathcal { H } ( z \mid s ) - \mathcal { H } ( z \mid s ^ { \prime } , s ) } \\ { = \mathcal { H } ( s ^ { \prime } \mid s ) - \mathcal { H } ( s ^ { \prime } \mid s , z ) } \end{array} } \end{array}
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
Mutual information in Equation 1 quantifies how much can be known about $s ^ { \prime }$ given $z$ and $s$ , or symmetrically, $z$ given the transition from $s s ^ { \prime }$ . From Equation 2, maximizing this objective corresponds to maximizing the diversity of transitions produced in the environment, that is denoted by the entropy $\mathcal { H } ( s ^ { \prime } \mid s )$ , while making $z$ informative about the next state $s ^ { \prime }$ by minimizing the entropy $\mathcal { H } ( s ^ { \prime } \mid s , z )$ . Intuitively, skills $z$ can be interpreted as abstracted action sequences which are identifiable by the transitions generated in the environment (and not just by the current state). Thus, optimizing this mutual information can be understood as encoding a diverse set of skills in the latent space $\mathcal { Z }$ , while making the transitions for a given $z \in { \mathcal { Z } }$ predictable. We use the entropydecomposition in Equation 2 to connect this objective with model-based control.
|
| 44 |
+
|
| 45 |
+
We want to optimize the our skill-conditioned controller $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ such that the latent space $z \sim p ( z )$ is maximally informative about the transitions $s s ^ { \prime }$ . Using the definition of conditional mutual information, we can rewrite Equation 2 as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
{ \mathcal { T } } ( s ^ { \prime } ; z \mid s ) = \int p ( z , s , s ^ { \prime } ) \log { \frac { p ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } } d s ^ { \prime } d s d z
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
We assume the following generative model: $p ( z , s , s ^ { \prime } ) = p ( z ) p ( s \mid z ) p ( s ^ { \prime } \mid s , z )$ , where $p ( z )$ is user specified prior over $\mathcal { Z }$ , $p ( s | z )$ denotes the stationary state-distribution induced by $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ for a skill $z$ and $p ( s ^ { \prime } \mid s , z )$ denotes the transition distribution under skill $z$ . Note, $p ( s ^ { \prime } \mid s , z ) =$ $\textstyle { \int p ( s ^ { \prime } \mid s , a ) \pi ( a \mid s , z ) d a }$ is intractable to compute because the underlying dynamics are unknown. However, we can variationally lower bound the objective as follows:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r l } & { \mathbb { Z } ( s ^ { \prime } ; z \mid s ) = \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \Big [ \log \frac { p ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } \Big ] } \\ & { \phantom { = } = \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \Big [ \log \frac { q \phi ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } \Big ] + \mathbb { E } _ { s , z \sim p } \Big [ \mathcal { D } _ { K L } \big ( p ( s ^ { \prime } \mid s , z ) \mid \mid q _ { \phi } ( s ^ { \prime } \mid s , z ) \big ) \Big ] } \\ & { \phantom { = } \geq \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \Big [ \log \frac { q \phi ( s ^ { \prime } \mid s , z ) } { p ( s ^ { \prime } \mid s ) } \Big ] } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where we have used the non-negativity of KL-divergence, that is $\mathcal { D } _ { K L } \ge 0$ . Note, skill-dynamics $q _ { \phi }$ represents the variational approximation for the transition function $p ( s ^ { \prime } \mid s , z )$ , which enables model-based control as described in Section 4. Equation 4 suggests an alternating optimization between $q _ { \phi }$ and $\pi$ , summarized in Algorithm 1. In every iteration:
|
| 58 |
+
|
| 59 |
+
(Tighten variational lower bound) We minimize $D _ { K L } \bar { ( } p ( s ^ { \prime } \mid s , z ) \parallel q _ { \phi } ( s ^ { \prime } \mid s , z ) )$ with respect to the parameters $\phi$ on $z , s \sim p$ to tighten the lower bound. For general function approximators like neural networks, we can write the gradient for $\phi$ as follows:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { \nabla _ { \phi } \mathbb { E } _ { s , z } [ \mathcal { D } _ { K L } ( p ( s ^ { \prime } \mid s , z ) \mid \mid q _ { \phi } ( s ^ { \prime } \mid s , z ) ) ] = \nabla _ { \phi } \mathbb { E } _ { z , s , s ^ { \prime } } \Big [ \log \frac { p ( s ^ { \prime } \mid s , z ) } { q _ { \phi } ( s ^ { \prime } \mid s , z ) } \Big ] } \\ { = - \mathbb { E } _ { z , s , s ^ { \prime } } \Big [ \nabla _ { \phi } \log q _ { \phi } ( s ^ { \prime } \mid s , z ) \Big ] } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
which corresponds to maximizing the likelihood of the samples from $p$ under $q _ { \phi }$ (Maximize approximate lower bound) After fitting $q _ { \phi }$ , we can optimize $\pi$ to maximize $\mathbb { E } _ { z , s , s ^ { \prime } } [ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log p ( s ^ { \prime } \mid s ) ]$ . Note, this is a reinforcement-learning style optimization with a reward function $\log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log p ( s ^ { \prime } \mid s )$ . However, $\log p ( s ^ { \prime } \mid s )$ is intractable to compute, so we approximate the reward function for $\pi$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
r _ { z } ( s , a , s ^ { \prime } ) = \log \frac { q _ { \phi } ( s ^ { \prime } \mid s , z ) } { \sum _ { i = 1 } ^ { L } q _ { \phi } ( s ^ { \prime } \mid s , z _ { i } ) } + \log L , \quad z _ { i } \sim p ( z ) .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
The approximation is motivated as follows: $\begin{array} { r } { p ( s ^ { \prime } \mid s ) = \int p ( s ^ { \prime } \mid s , z ) p ( z | s ) d z \approx \int q _ { \phi } ( s ^ { \prime } \mid } \end{array}$ $\begin{array} { r } { s , z ) p ( z ) d z \approx \frac { 1 } { L } \sum _ { i = 1 } ^ { L } q _ { \phi } ( s ^ { \prime } \mid s , z _ { i } ) } \end{array}$ for $z _ { i } \sim p ( z )$ , where $L$ denotes the number of samples from the prior. We are using the marginal of variational approximation $q _ { \phi }$ over the prior $p ( z )$ to approximate the marginal distribution of transitions. We discuss this approximation in Appendix C. Note, the final reward function $r _ { z }$ encourages the policy $\pi$ to produce transitions that are (a) predictable under $q _ { \phi }$ (predictability) and (b) different from the transitions produced under $z _ { i } \sim p ( z )$ (diversity).
|
| 72 |
+
|
| 73 |
+
To generate samples from $p ( z , s , s ^ { \prime } )$ , we use the rollouts from the current policy $\pi$ for multiple samples $z \sim p ( z )$ in an episodic setting for a fixed horizon $T$ . We also introduce entropy regularization for $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , z )$ , which encourages the policy to discover action-sequences with similar state-transitions and to be clustered under the same skill $z$ , making the policy robust besides encouraging exploration (Haarnoja et al., 2018a). The use of entropy regularization can be justified from an information bottleneck perspective as discussed for Information Maximization algorithm in (Mohamed $\&$ Rezende, 2015). This is even more extensively discussed from the graphical model perspective in Appendix B, which connects unsupervised skill discovery and information bottleneck literature, while also revealing the temporal nature of skills $z$ . Details corresponding to implementation and hyperparameters are discussed in Appendix A.
|
| 74 |
+
|
| 75 |
+
# 4 PLANNING USING SKILL DYNAMICS
|
| 76 |
+
|
| 77 |
+
Given the learned skills $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ and their respective skill-transition dynamics $q _ { \phi } ( s ^ { \prime } \mid s , z )$ , we can perform model-based planning in the latent space $\mathcal { Z }$ to optimize for a reward $r$ that is given to the agent at test time. Note, that this essentially allows us to perform zero-shot planning given the unsupervised pre-training procedure described in Section 3.
|
| 78 |
+
|
| 79 |
+
In order to perform planning, we employ the model-predictive-control (MPC) paradigm Garcia et al. (1989), which in a standard setting generates a set of action plans $P _ { k } = ( a _ { k , 1 } , \dots a _ { k , H } ) \sim P$ for a planning horizon $H$ . The MPC plans can be generated due to the fact that the planner is able to simulate the trajectory $\hat { \tau } _ { k } = \left( s _ { k , 1 } , a _ { k , 1 } \ldots s _ { k , H + 1 } \right)$ assuming access to the transition dynamics $\hat { p } ( s ^ { \prime } \mid s , a )$ . In addition, each plan computes the reward $r ( \hat { \tau } _ { k } )$ for its trajectory according to the reward function $r$ that is provided for the test-time task. Following the MPC principle, the planner selects the best plan according to the reward function $r$ and executes its first action $a _ { 1 }$ . The planning algorithm repeats this procedure for the next state iteratively until it achieves its goal.
|
| 80 |
+
|
| 81 |
+
We use a similar strategy to design an MPC planner to exploit previously-learned skill-transition dynamics $q _ { \phi } ( s ^ { \prime } \mid s , z )$ . Note that unlike conventional model-based RL, we generate a plan $P _ { k } =$ $\left( z _ { k , 1 } , \ldots z _ { k , { H _ { P } } } \right)$ in the latent space $\mathcal { Z }$ as opposed to the action space $\mathcal { A }$ that would be used by a standard planner. Since the primitives are temporally meaningful, it is beneficial to hold a primitive for a horizon $H _ { Z } > 1$ , unlike actions which are usually held for a single step. Thus, effectively, the planning horizon for our latent space planner is $H = H _ { P } \times H _ { Z }$ , enabling longer-horizon planning using fewer primitives. Similar to the standard MPC setting, the latent space planner simulates the trajectory $\hat { \tau } _ { k } = \left( s _ { k , 1 } , z _ { k , 1 } , a _ { k , 1 } , s _ { k , 2 } , z _ { k , 2 } , a _ { k , 2 } , \ldots s _ { k , H + 1 } \right)$ and computes the reward $r ( \hat { \tau } _ { k } )$ . After a small number of trajectory samples, the planner selects the first latent action $z _ { 1 }$ of the best plan, executes it for $H _ { Z }$ steps in the environment, and the repeats the process until goal completion.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 3: At test time, the planner executes simulates the transitions in environment using skill-dynamics $q$ , and updates the distribution of plans according to the computed reward on the simulated trajectories. After a few updates to the plan, the first primitive is executed in the environment using the learned agent $\pi$ .
|
| 85 |
+
|
| 86 |
+
The latent planner $P$ maintains a distribution of latent plans, each of length $H _ { P }$ . Each element in the sequence represents the distribution of the primitive to be executed at that time step. For continuous spaces, each element of the sequence can be modelled using a normal distribution, $\mathcal { N } ( \mu _ { 1 } , \Sigma ) , \dots \mathcal { N } ( \mu _ { H _ { P } } , \Sigma )$ . We refine the planning distributions for $R$ steps, using $K$ samples of latent plans $P _ { k }$ , and compute the $r _ { k }$ for the simulated trajectory $\hat { \tau } _ { k }$ . The update for the parameters follows that in Model Predictive Path Integral (MPPI) controller Williams et al. (2016):
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mu _ { i } = \sum _ { k = 1 } ^ { K } \frac { \exp ( \gamma r _ { k } ) } { \sum _ { p = 1 } ^ { K } \exp ( \gamma r _ { p } ) } z _ { k , i } \quad \forall i = 1 , \ldots H _ { P }
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
While we keep the covariance matrix of the distributions fixed, it is possible to update that as well as shown in Williams et al. (2016). We show an overview of the planning algorithm in Figure 3, and provide more implementation details in Appendix A.
|
| 93 |
+
|
| 94 |
+
# 5 RELATED WORK
|
| 95 |
+
|
| 96 |
+
Central to our method is the concept of skill discovery via mutual information maximization. This principle, proposed in prior work that utilized purely model-free unsupervised RL methods (Daniel et al., 2012; Florensa et al., 2017; Eysenbach et al., 2018; Gregor et al., 2016; Warde-Farley et al., 2018; Thomas et al., 2018), aims to learn diverse skills via a discriminability objective: a good set of skills is one where it is easy to distinguish the skills from each other, which means they perform distinct tasks and cover the space of possible behaviors. Building on this prior work, we distinguish our skills based on how they modify the original uncontrolled dynamics of the system. This simultaneously encourages the skills to be both diverse and predictable. We also demonstrate that constraining the skills to be predictable makes them more amenable for hierarchical composition and thus, more useful on downstream tasks.
|
| 97 |
+
|
| 98 |
+
Another line of work that is conceptually close to our method copes with intrinsic motivation (Oudeyer & Kaplan, 2009; Oudeyer et al., 2007; Schmidhuber, 2010) which is used to drive the agent’s exploration. Examples of such works include empowerment Klyubin et al. (2005); Mohamed & Rezende (2015), count-based exploration Bellemare et al. (2016); Oh et al. (2015); Tang et al. (2017); Fu et al. (2017), information gain about agent’s dynamics Stadie et al. (2015) and forward-inverse dynamics models Pathak et al. (2017). While our method uses an informationtheoretic objective that is similar to these approaches, it is used to learn a variety of skills that can be directly used for model-based planning, which is in contrast to learning a better exploration policy for a single skill.
|
| 99 |
+
|
| 100 |
+
The skills discovered using our approach can also provide extended actions and temporal abstraction, which enable more efficient exploration for the agent to solve various tasks, reminiscent of hierarchical RL (HRL) approaches. This ranges from the classic option-critic architecture (Sutton et al., 1999; Stolle & Precup, 2002; Perkins et al., 1999) to some of the more recent work (Bacon et al., 2017; Vezhnevets et al., 2017; Nachum et al., 2018; Hausman et al., 2018). However, in contrast to end-to-end HRL approaches (Heess et al., 2016; Peng et al., 2017), we can leverage a stable, two-phase learning setup. The primitives learned through our method provide action and temporal abstraction, while planning with skill-dynamics enables hierarchical composition of these primitives, bypassing many problems of end-to-end HRL.
|
| 101 |
+
|
| 102 |
+
In the second phase of our approach, we use the learned skill-transition dynamics models to perform model-based planning - an idea that has been explored numerous times in the literature. Model-based reinforcement learning has been traditionally approached with methods that are well-suited for lowdata regimes such as Gaussian Processes (Rasmussen, 2003) showing significant data-efficiency gains over model-free approaches (Deisenroth et al., 2013; Kamthe & Deisenroth, 2017; Kocijan et al., 2004; Ko et al., 2007). More recently, due to the challenges of applying these methods to highdimensional state spaces, MBRL approaches employs Bayesian deep neural networks (Nagabandi et al., 2018; Chua et al., 2018b; Gal et al., 2016; Fu et al., 2016; Lenz et al., 2015) to learn dynamics models. In our approach, we take advantage of the deep dynamics models that are conditioned on the skill being executed, simplifying the modelling problem. In addition, the skills themselves are being learned with the objective of being predictable, further assists with the learning of the dynamics model. There also have been multiple approaches addressing the planning component of MBRL including linear controllers for local models (Levine et al., 2016; Kumar et al., 2016; Chebotar et al., 2017), uncertainty-aware (Chua et al., 2018b; Gal et al., 2016) or deterministic planners (Nagabandi et al., 2018) and stochastic optimization methods (Williams et al., 2016). The main contribution of our work lies in discovering model-based skill primitives that can be further combined by a standard model-based planner, therefore we take advantage of an existing planning approach - Model Predictive Path Integral (Williams et al., 2016) that can leverage our pre-trained setting.
|
| 103 |
+
|
| 104 |
+
# 6 EXPERIMENTS
|
| 105 |
+
|
| 106 |
+
Through our experiments, we aim to demonstrate that: (a) DADS as a general purpose skill discovery algorithm can scale to high-dimensional problems; (b) discovered skills are amenable to hierarchical composition and; (c) not only is planning in the learned latent space feasible, but it is competitive to strong baselines. In Section 6.1, we provide visualizations and qualitative analysis of the skills learned using DADS. We demonstrate in Section 6.2 and Section 6.4 that optimizing the primitives for predictability renders skills more amenable to temporal composition that can be used for Hierarchical RL.We benchmark against state-of-the-art model-based RL baseline in Section 6.3, and against goal-conditioned RL in Section 6.5.
|
| 107 |
+
|
| 108 |
+
# 6.1 QUALITATIVE ANALYSIS
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 4: Skills learned on different MuJoCo environments in the OpenAI gym. DADS can discover diverse skills without any extrinsic rewards, even for problems with high-dimensional state and action spaces.
|
| 112 |
+
|
| 113 |
+
In this section, we provide a qualitative discussion of the unsupervised skills learned using DADS. We use the MuJoCo environments (Todorov et al., 2012) from the OpenAI gym as our test-bed (Brockman et al., 2016). We find that our proposed algorithm can learn diverse skills without any reward, even in problems with high-dimensional state and actuation, as illustrated in Figure 4. DADS can discover primitives for Half-Cheetah to run forward and backward with multiple different gaits, for Ant to navigate the environment using diverse locomotion primitives and for Humanoid to walk using stable locomotion primitives with diverse gaits and direction. The videos of the discovered primitives are available at: https://sites.google.com/view/dads-skill
|
| 114 |
+
|
| 115 |
+
Qualitatively, we find the skills discovered by DADS to be predictable and stable, in line with implicit constraints of the proposed objective. While the Half-Cheetah will learn to run in both backward and forward directions, DADS will disincentivize skills which make Half-Cheetah flip owing to the reduced predictability on landing. Similarly, skills discovered for Ant rarely flip over, and tend to provide stable navigation primitives in the environment. This also incentivizes the Humanoid, which is characteristically prone to collapsing and extremely unstable by design, to discover gaits which are stable for sustainable locomotion.
|
| 116 |
+
|
| 117 |
+
One of the significant advantages of the proposed objective is that it is compatible with continuous skill spaces, which has not been shown in prior work on skill discovery (Eysenbach et al., 2018). Not only does this allow us to embed a large and diverse set of skills into a compact latent space, but also the smoothness of the learned space allows us to interpolate between behaviors generated in the environment. We demonstrate this on the Ant environment (Figure 5), where we learn two-dimensional continuous skill space with a uniform prior over $( - 1 , 1 )$ in each dimension, and compare it to a discrete skill space with a uniform prior over 20 skills. Similar to Eysenbach et al. (2018), we restrict the observation space of the skill-dynamics $q$ to the cartesian coordinates $( x , y )$ . We hereby call this the $x$ -y prior, and discuss its role in Section 6.2.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 5: (Left, Centre) X-Y traces of Ant skills and (Right) Heatmap to visualize the learned continuous skill space. Traces demonstrate that the continuous space offers far greater diversity of skills, while the heatmap demonstrates that the learned space is smooth, as the orientation of the X-Y trace varies smoothly as a function of the skill.
|
| 121 |
+
|
| 122 |
+
In Figure 5, we project the trajectories of the learned Ant skills from both discrete and continuous spaces onto the Cartesian plane. From the traces of the skills, it is clear that the continuous latent space can generate more diverse trajectories. We demonstrate in Section 6.3, that continuous primitives are more amenable to hierarchical composition and generally perform better on downstream tasks. More importantly, we observe that the learned skill space is semantically meaningful. The heatmap in Figure 5 shows the orientation of the trajectory (with respect to the $x$ -axis) as a function of the skill $z \in { \mathcal { Z } }$ , which varies smoothly as $z$ is varied, with explicit interpolations shown in Appendix D.
|
| 123 |
+
|
| 124 |
+
# 6.2 SKILL VARIANCE ANALYSIS
|
| 125 |
+
|
| 126 |
+
In an unsupervised skill learning setup, it is important to optimize the primitives to be diverse. However, we argue that diversity is not sufficient for the learned primitives to be useful for downstream tasks. Primitives must exhibit low-variance behavior, which enables long-horizon composition of the learned skills in a hierarchical setup. We analyze the variance of the $x { - } y$ trajectories in the environment, where we also benchmark the variance of the primitives learned by DIAYN (Eysenbach et al., 2018). For DIAYN, we use the $x { - } y$ prior for the skill-discriminator, which biases the discovered skills to diversify in the x-y space. This step was necessary for that baseline to obtain a competitive set of navigation skills. Figure 6 (Top-Left) demonstrates that DADS, which optimizes the primitives for predictability and diversity, yields significantly lower-variance primitives when compared to DIAYN, which only optimizes for diversity. This is starkly demonstrated in the plots of X-Y traces of skills learned in different setups. Skills learned by DADS show significant control over the trajectories generated in the environment, while skills from DIAYN exhibit high variance in the environment, which limits their utility for hierarchical control. This is further demonstrated quantitatively in Section 6.4.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 6: (Top-Left) Standard deviation of Ant’s position as a function of steps in the environment, averaged over multiple skills and normalized by the norm of the position. (Top-Right to Bottom-Left Clockwise) X-Y traces of skills learned using DIAYN with $x { - } y$ prior, DADS with $x { - } y$ prior and DADS without x-y prior, where the same color represents trajectories resulting from the execution of the same skill $z$ in the environment. High variance skills from DIAYN offer limited utility for hierarchical control.
|
| 130 |
+
|
| 131 |
+
While optimizing for predictability already significantly reduces the variance of the trajectories generated by a primitive, we find that using the $x { - } y$ prior with DADS brings down the skill variance even further. For quantitative benchmarks in the next sections, we assume that the Ant skills are learned using an $x { - } y$ prior on the observation space, for both DADS and DIAYN.
|
| 132 |
+
|
| 133 |
+
# 6.3 MODEL-BASED REINFORCEMENT LEARNING
|
| 134 |
+
|
| 135 |
+
The key utility of learning a parametric model $q _ { \phi } \big ( s ^ { \prime } | s , z \big )$ is to take advantage of planning algorithms for downstream tasks, which can be extremely sample-efficient. In our setup, we can solve testtime tasks in zero-shot, that is without any learning on the downstream task. We compare with the state-of-the-art model-based RL method (Chua et al., 2018a), which learns a dynamics model parameterized as $p ( s ^ { \prime } | s , a )$ , on the task of the Ant navigating to a specified goal with a dense reward. Given a goal $g$ , reward at any position $u$ is given by $r ( \bar { u } ) = \bar { - } \| g - \bar { u } \| _ { 2 }$ . We benchmark our method against the following variants:
|
| 136 |
+
|
| 137 |
+
• Random-MBRL (rMBRL): We train the model $p ( s ^ { \prime } | s , a )$ on randomly collected trajectories, and test the zero-shot generalization of the model on a distribution of goals.
|
| 138 |
+
|
| 139 |
+
• Weak-oracle MBRL (WO-MBRL): We train the model $p ( s ^ { \prime } | s , a )$ on trajectories generated by the planner to navigate to a goal, randomly sampled in every episode. The distribution of goals during training matches the distribution at test time.
|
| 140 |
+
|
| 141 |
+
• Strong-oracle MBRL (SO-MBRL): We train the model $p ( s ^ { \prime } | s , a )$ on a trajectories generated by the planner to navigate to a specific goal, which is fixed for both training and test time.
|
| 142 |
+
|
| 143 |
+
Amongst the variants, only the rMBRL matches our assumptions of having an unsupervised taskagnostic training. Both WO-MBRL and SO-MBRL benefit from goal-directed exploration during training, a significant advantage over DADS, which only uses mutual-information-based exploration.
|
| 144 |
+
|
| 145 |
+
We use ∆ = PHt=1 −r(u)Hkgk2 a s the metric, which represents the distance to the goal $g$ averaged over the episode (with the same fixed horizon $H$ for all models and experiments), normalized by the initial distance to the goal $g$ . Therefore, lower $\Delta$ indicates better performance and $0 < \Delta \le 1$ (assuming the agent goes closer to the goal). The test set of goals is fixed for all the methods, sampled from $[ - 1 5 , 1 5 ] ^ { 2 }$ .
|
| 146 |
+
|
| 147 |
+
Figure 7 demonstrates that the zero-shot planning significantly outperforms all model-based RL baselines, despite the advantage of the baselines being trained on the test goal(s). For the experiment depicted in Figure 7 (Right), DADS has an unsupervised pre-training phase, unlike SO-MBRL which is training directly for the task. A comparison with Random-MBRL shows the significance of mutual-information-based exploration, especially with the right parameterization and priors. This experiment also demonstrates the advantage of learning a continuous space of primitives, which outperforms planning on discrete primitives.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 7: (Left) The results of the MPPI controller on skills learned using DADS-c (continuous primitives) and DADS-d (discrete primitives) significantly outperforms state-of-the-art model-based RL. (Right) Planning for a new task does not require any additional training and outperforms model-based RL being trained for the specific task.
|
| 151 |
+
|
| 152 |
+
# 6.4 HIERARCHICAL CONTROL WITH UNSUPERVISED PRIMITIVES
|
| 153 |
+
|
| 154 |
+
We benchmark hierarchical control for primitives learned without supervision, against our proposed scheme using an MPPI based planner on top of DADS-learned skills. We persist with the task of Ant-navigation as described in 6.3. We benchmark against Hierarchical DIAYN (Eysenbach et al., 2018), which learns the skills using the DIAYN objective, freezes the low-level policy and learns a meta-controller that outputs the skill to be executed for the next $H _ { Z }$ steps. We provide the x-y prior to the DIAYN’s disciminator while learning the skills for the Ant agent. The performance of the meta-controller is constrained by the low-level policy, however, this hierarchical scheme is agnostic to the algorithm used to learn the low-level policy. To contrast the quality of primitives learned by the DADS and DIAYN, we also benchmark against Hierarchical DADS, which learns a meta-controller the same way as Hierarchical DIAYN, but learns the skills using DADS.
|
| 155 |
+
|
| 156 |
+
From Figure 8 (Left) We find that the meta-controller is unable to compose the skills learned by DIAYN, while the same meta-controller can learn to compose skills by DADS to navigate the Ant to different goals. This result seems to confirm our intuition described in Section 6.2, that the high variance of the DIAYN skills limits their temporal compositionality. Interestingly, learning a RL meta-controller reaches similar performance to the MPPI controller, taking an additional 200, 000 samples per goal.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 8: (Left) A RL-trained meta-controller is unable to compose primitive learned by DIAYN to navigate Ant to a goal, while it succeeds to do so using the primitives learned by DADS. (Right) Goal-Conditioned RL (GCRL-dense/sparse) does not generalize outside its training distribution, while MPPI controller on learned skills (DADS-dense/sparse) experiences significantly smaller degrade in performance.
|
| 160 |
+
|
| 161 |
+
# 6.5 GOAL-CONDITIONED RL
|
| 162 |
+
|
| 163 |
+
To demonstrate the benefits of our approach over model-free RL, we benchmark against goalconditioned RL on two versions of Ant-navigation: (a) with a dense reward $r ( u )$ and (b) with a sparse reward $r ( u ) = 1$ if $\| u - g \| _ { 2 } \leq \epsilon$ , else 0. We train the goal-conditioned RL agent using soft actor-critic, where the state variable of the agent is augmented with $u - g$ , the position delta to the goal. The agent gets a randomly sampled goal from $[ - 1 0 , 1 0 ] ^ { 2 }$ at the beginning of the episode.
|
| 164 |
+
|
| 165 |
+
In Figure 8 (Right), we measure the average performance of the all the methods as a function of the initial distance of the goal, ranging from 5 to 30 metres. For dense reward navigation, we observe that while model-based planning on DADS-learned skills degrades smoothly as the initial distance to goal to increases, goal-conditioned RL experiences a sudden deterioration outside the goal distribution it was trained on. Even within the goal distribution observed during training of goal-conditioned RL model, skill-space planning performs competitively to it. With sparse reward navigation, goal-conditioned RL is unable to navigate, while MPPI demonstrates comparable performance to the dense reward up to about 20 metres. This highlights the utility of learning task-agnostic skills, which makes them more general while showing that latent space planning can be leveraged for tasks requiring long-horizon planning.
|
| 166 |
+
|
| 167 |
+
# 7 CONCLUSION
|
| 168 |
+
|
| 169 |
+
We have proposed a novel unsupervised skill learning algorithm that is amenable to model-based planning for hierarchical control on downstream tasks. We show that our skill learning method can scale to high-dimensional state-spaces, while discovering a diverse set of low-variance skills. In addition, we demonstrated that, without any training on the specified task, we can compose the learned skills to outperform competitive model-based baselines that were trained with the knowledge of the test tasks. We plan to extend the algorithm to work with off-policy data, potentially using relabelling tricks (Andrychowicz et al., 2017; Nachum et al., 2018) and explore more nuanced planning algorithms. We plan to apply the hereby-introduced method to different domains, such as manipulation and enable skill/model discovery directly from images.
|
| 170 |
+
|
| 171 |
+
# 8 ACKNOWLEDGEMENTS
|
| 172 |
+
|
| 173 |
+
We would like to thank Evan Liu, Ben Eysenbach, Anusha Nagabandi for their help in reproducing the baselines for this work. We are thankful to Ben Eysenbach for their comments and discussion on the initial drafts. We would also like to acknowledge Ofir Nachum, Alex Alemi, Daniel Freeman, Yiding Jiang, Allan Zhou and other colleagues at Google Brain for their helpful feedback and discussions at various stages of this work. We are also thankful to Michael Ahn and others in Adept team for their support, especially with the infrastructure setup and scaling up the experiments.
|
| 174 |
+
|
| 175 |
+
# REFERENCES
|
| 176 |
+
|
| 177 |
+
Mart´ın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S. Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Ian Goodfellow, Andrew Harp, Geoffrey Irving, Michael Isard, Yangqing Jia, Rafal Jozefowicz, Lukasz Kaiser, Manjunath Kudlur, Josh Levenberg, Dan Mane, Rajat Monga, Sherry Moore, Derek Murray, Chris Olah, ´ Mike Schuster, Jonathon Shlens, Benoit Steiner, Ilya Sutskever, Kunal Talwar, Paul Tucker, Vincent Vanhoucke, Vijay Vasudevan, Fernanda Viegas, Oriol Vinyals, Pete Warden, Martin Watten- ´ berg, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. TensorFlow: Large-scale machine learning on heterogeneous systems, 2015. URL http://tensorflow.org/. Software available from tensorflow.org.
|
| 178 |
+
|
| 179 |
+
Joshua Achiam, Harrison Edwards, Dario Amodei, and Pieter Abbeel. Variational option discovery algorithms. arXiv preprint arXiv:1807.10299, 2018.
|
| 180 |
+
|
| 181 |
+
David Barber Felix Agakov. The im algorithm: a variational approach to information maximization. Advances in Neural Information Processing Systems, 16:201, 2004.
|
| 182 |
+
|
| 183 |
+
Alexander A Alemi and Ian Fischer. Therml: Thermodynamics of machine learning. arXiv preprint arXiv:1807.04162, 2018.
|
| 184 |
+
|
| 185 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. CoRR, abs/1707.01495, 2017. URL http://arxiv.org/abs/1707.01495.
|
| 186 |
+
|
| 187 |
+
Pierre-Luc Bacon, Jean Harb, and Doina Precup. The option-critic architecture. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 188 |
+
|
| 189 |
+
Marc Bellemare, Sriram Srinivasan, Georg Ostrovski, Tom Schaul, David Saxton, and Remi Munos. Unifying count-based exploration and intrinsic motivation. In Advances in Neural Information Processing Systems, pp. 1471–1479, 2016.
|
| 190 |
+
|
| 191 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. CoRR, abs/1606.01540, 2016. URL http://arxiv.org/ abs/1606.01540.
|
| 192 |
+
|
| 193 |
+
Yevgen Chebotar, Karol Hausman, Marvin Zhang, Gaurav Sukhatme, Stefan Schaal, and Sergey Levine. Combining model-based and model-free updates for trajectory-centric reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 703–711. JMLR. org, 2017.
|
| 194 |
+
|
| 195 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. CoRR, abs/1805.12114, 2018a. URL http://arxiv.org/abs/1805.12114.
|
| 196 |
+
|
| 197 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Advances in Neural Information Processing Systems, pp. 4759–4770, 2018b.
|
| 198 |
+
|
| 199 |
+
Imre Csiszar and Frantisek Matus. Information projections revisited. ´ IEEE Transactions on Information Theory, 49(6):1474–1490, 2003.
|
| 200 |
+
|
| 201 |
+
Christian Daniel, Gerhard Neumann, and Jan Peters. Hierarchical relative entropy policy search. In Artificial Intelligence and Statistics, pp. 273–281, 2012.
|
| 202 |
+
|
| 203 |
+
Marc Deisenroth and Carl E Rasmussen. Pilco: A model-based and data-efficient approach to policy search. In Proceedings of the 28th International Conference on machine learning (ICML-11), pp. 465–472, 2011.
|
| 204 |
+
|
| 205 |
+
Marc Peter Deisenroth, Dieter Fox, and Carl Edward Rasmussen. Gaussian processes for dataefficient learning in robotics and control. IEEE transactions on pattern analysis and machine intelligence, 37(2):408–423, 2013.
|
| 206 |
+
|
| 207 |
+
Benjamin Eysenbach, Abhishek Gupta, Julian Ibarz, and Sergey Levine. Diversity is all you need: Learning skills without a reward function. arXiv preprint arXiv:1802.06070, 2018.
|
| 208 |
+
|
| 209 |
+
Carlos Florensa, Yan Duan, and Pieter Abbeel. Stochastic neural networks for hierarchical reinforcement learning. arXiv preprint arXiv:1704.03012, 2017.
|
| 210 |
+
|
| 211 |
+
Nir Friedman, Ori Mosenzon, Noam Slonim, and Naftali Tishby. Multivariate information bottleneck. In Proceedings of the Seventeenth conference on Uncertainty in artificial intelligence, pp. 152–161. Morgan Kaufmann Publishers Inc., 2001.
|
| 212 |
+
|
| 213 |
+
Justin Fu, Sergey Levine, and Pieter Abbeel. One-shot learning of manipulation skills with online dynamics adaptation and neural network priors. In 2016 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pp. 4019–4026. IEEE, 2016.
|
| 214 |
+
|
| 215 |
+
Justin Fu, John Co-Reyes, and Sergey Levine. Ex2: Exploration with exemplar models for deep reinforcement 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. 2577–2587. Curran Associates, Inc., 2017. URL http://papers.nips.cc/paper/ 6851-ex2-exploration-with-exemplar-models-for-deep-reinforcement-learning. pdf.
|
| 216 |
+
|
| 217 |
+
Yarin Gal, Rowan McAllister, and Carl Edward Rasmussen. Improving pilco with bayesian neural network dynamics models. In Data-Efficient Machine Learning workshop, ICML, volume 4, 2016.
|
| 218 |
+
|
| 219 |
+
Carlos E Garcia, David M Prett, and Manfred Morari. Model predictive control: theory and practice—a survey. Automatica, 25(3):335–348, 1989.
|
| 220 |
+
|
| 221 |
+
Karol Gregor, Danilo Jimenez Rezende, and Daan Wierstra. Variational intrinsic control. arXiv preprint arXiv:1611.07507, 2016.
|
| 222 |
+
|
| 223 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In 2017 IEEE International Conference on Robotics and Automation (ICRA), pp. 3389–3396. IEEE, 2017.
|
| 224 |
+
|
| 225 |
+
David Ha and Jurgen Schmidhuber. Recurrent world models facilitate policy evolution. In ¨ Advances in Neural Information Processing Systems, pp. 2455–2467, 2018.
|
| 226 |
+
|
| 227 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Offpolicy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018a.
|
| 228 |
+
|
| 229 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. CoRR, abs/1812.05905, 2018b. URL http://arxiv.org/abs/ 1812.05905.
|
| 230 |
+
|
| 231 |
+
Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an embedding space for transferable robot skills. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } }$ rk07ZXZRb.
|
| 232 |
+
|
| 233 |
+
Nicolas Heess, Greg Wayne, Yuval Tassa, Timothy Lillicrap, Martin Riedmiller, and David Silver. Learning and transfer of modulated locomotor controllers. arXiv preprint arXiv:1610.05182, 2016.
|
| 234 |
+
|
| 235 |
+
Nicolas Heess, Srinivasan Sriram, Jay Lemmon, Josh Merel, Greg Wayne, Yuval Tassa, Tom Erez, Ziyu Wang, SM Eslami, Martin Riedmiller, et al. Emergence of locomotion behaviours in rich environments. arXiv preprint arXiv:1707.02286, 2017.
|
| 236 |
+
|
| 237 |
+
Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Curiosity-driven exploration in deep reinforcement learning via bayesian neural networks. CoRR, abs/1605.09674, 2016. URL http://arxiv.org/abs/1605.09674.
|
| 238 |
+
|
| 239 |
+
Robert A Jacobs, Michael I Jordan, Steven J Nowlan, Geoffrey E Hinton, et al. Adaptive mixtures of local experts. Neural computation, 3(1):79–87, 1991.
|
| 240 |
+
|
| 241 |
+
Dmitry Kalashnikov, Alex Irpan, Peter Pastor, Julian Ibarz, Alexander Herzog, Eric Jang, Deirdre Quillen, Ethan Holly, Mrinal Kalakrishnan, Vincent Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for vision-based robotic manipulation. arXiv preprint arXiv:1806.10293, 2018.
|
| 242 |
+
|
| 243 |
+
Sanket Kamthe and Marc Peter Deisenroth. Data-efficient reinforcement learning with probabilistic model predictive control. arXiv preprint arXiv:1706.06491, 2017.
|
| 244 |
+
|
| 245 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 246 |
+
|
| 247 |
+
Alexander S Klyubin, Daniel Polani, and Chrystopher L Nehaniv. Empowerment: A universal agentcentric measure of control. In 2005 IEEE Congress on Evolutionary Computation, volume 1, pp. 128–135. IEEE, 2005.
|
| 248 |
+
|
| 249 |
+
Jonathan Ko, Daniel J Klein, Dieter Fox, and Dirk Haehnel. Gaussian processes and reinforcement learning for identification and control of an autonomous blimp. In Proceedings 2007 ieee international conference on robotics and automation, pp. 742–747. IEEE, 2007.
|
| 250 |
+
|
| 251 |
+
Jus Kocijan, Roderick Murray-Smith, Carl Edward Rasmussen, and Agathe Girard. Gaussian pro- ˇ cess model based predictive control. In Proceedings of the 2004 American Control Conference, volume 3, pp. 2214–2219. IEEE, 2004.
|
| 252 |
+
|
| 253 |
+
Vikash Kumar, Emanuel Todorov, and Sergey Levine. Optimal control with learned local models: Application to dexterous manipulation. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 378–383. IEEE, 2016.
|
| 254 |
+
|
| 255 |
+
Thanard Kurutach, Ignasi Clavera, Yan Duan, Aviv Tamar, and Pieter Abbeel. Model-ensemble trust-region policy optimization. arXiv preprint arXiv:1802.10592, 2018.
|
| 256 |
+
|
| 257 |
+
Ian Lenz, Ross A Knepper, and Ashutosh Saxena. Deepmpc: Learning deep latent features for model predictive control. In Robotics: Science and Systems. Rome, Italy, 2015.
|
| 258 |
+
|
| 259 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 260 |
+
|
| 261 |
+
Weiwei Li and Emanuel Todorov. Iterative linear quadratic regulator design for nonlinear biological movement systems. In ICINCO (1), pp. 222–229, 2004.
|
| 262 |
+
|
| 263 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 264 |
+
|
| 265 |
+
Shakir Mohamed and Danilo Jimenez Rezende. Variational information maximisation for intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pp. 2125–2133, 2015.
|
| 266 |
+
|
| 267 |
+
Ofir Nachum, Shixiang Shane Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, pp. 3307–3317, 2018.
|
| 268 |
+
|
| 269 |
+
Anusha Nagabandi, Gregory Kahn, Ronald S Fearing, and Sergey Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 7559–7566. IEEE, 2018.
|
| 270 |
+
|
| 271 |
+
Junhyuk Oh, Xiaoxiao Guo, Honglak Lee, Richard L Lewis, and Satinder Singh. Action-conditional video prediction using deep networks in atari games. In Advances in neural information processing systems, pp. 2863–2871, 2015.
|
| 272 |
+
|
| 273 |
+
Pierre-Yves Oudeyer and Frederic Kaplan. What is intrinsic motivation? a typology of computational approaches. Frontiers in neurorobotics, 1:6, 2009.
|
| 274 |
+
|
| 275 |
+
Pierre-Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for autonomous mental development. IEEE transactions on evolutionary computation, 11(2):265–286, 2007.
|
| 276 |
+
|
| 277 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A. Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In ICML, 2017.
|
| 278 |
+
|
| 279 |
+
Xue Bin Peng, Glen Berseth, KangKang Yin, and Michiel Van De Panne. Deeploco: Dynamic locomotion skills using hierarchical deep reinforcement learning. ACM Transactions on Graphics (TOG), 36(4):41, 2017.
|
| 280 |
+
|
| 281 |
+
Theodore J Perkins, Doina Precup, et al. Using options for knowledge transfer in reinforcement learning. University of Massachusetts, Amherst, MA, USA, Tech. Rep, 1999.
|
| 282 |
+
|
| 283 |
+
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.
|
| 284 |
+
|
| 285 |
+
Carl Edward Rasmussen. Gaussian processes in machine learning. In Summer School on Machine Learning, pp. 63–71. Springer, 2003.
|
| 286 |
+
|
| 287 |
+
Jurgen Schmidhuber. Formal theory of creativity, fun, and intrinsic motivation (1990–2010). ¨ IEEE Transactions on Autonomous Mental Development, 2(3):230–247, 2010.
|
| 288 |
+
|
| 289 |
+
John Schulman, Sergey Levine, Pieter Abbeel, Michael I Jordan, and Philipp Moritz. Trust region policy optimization. In Icml, volume 37, pp. 1889–1897, 2015.
|
| 290 |
+
|
| 291 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 292 |
+
|
| 293 |
+
Sergio Guadarrama, Anoop Korattikara, Oscar Ramirez, Pablo Castro, Ethan Holly, Sam Fishman, Ke Wang, Ekaterina Gonina, Chris Harris, Vincent Vanhoucke, Eugene Brevdo. TF-Agents: A library for reinforcement learning in tensorflow. https://github.com/tensorflow/ agents, 2018. URL https://github.com/tensorflow/agents. [Online; accessed 30-November-2018].
|
| 294 |
+
|
| 295 |
+
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, 2016.
|
| 296 |
+
|
| 297 |
+
Noam Slonim, Gurinder S Atwal, Gasper Tkacik, and William Bialek. Estimating mutual information and multi–information in large networks. arXiv preprint cs/0502017, 2005.
|
| 298 |
+
|
| 299 |
+
Bradly C. Stadie, Sergey Levine, and Pieter Abbeel. Incentivizing exploration in reinforcement learning with deep predictive models. CoRR, abs/1507.00814, 2015. URL http://arxiv. org/abs/1507.00814.
|
| 300 |
+
|
| 301 |
+
Martin Stolle and Doina Precup. Learning options in reinforcement learning. In International Symposium on abstraction, reformulation, and approximation, pp. 212–223. Springer, 2002.
|
| 302 |
+
|
| 303 |
+
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.
|
| 304 |
+
|
| 305 |
+
Haoran Tang, Rein Houthooft, Davis Foote, Adam Stooke, OpenAI Xi Chen, Yan Duan, John Schulman, Filip DeTurck, and Pieter Abbeel. # exploration: A study of count-based exploration for deep reinforcement learning. In Advances in neural information processing systems, pp. 2753– 2762, 2017.
|
| 306 |
+
|
| 307 |
+
Valentin Thomas, Emmanuel Bengio, William Fedus, Jules Pondard, Philippe Beaudoin, Hugo Larochelle, Joelle Pineau, Doina Precup, and Yoshua Bengio. Disentangling the independently controllable factors of variation by interacting with the world, 2018.
|
| 308 |
+
|
| 309 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In 2012 IEEE/RSJ International Conference on Intelligent Robots and Systems, pp. 5026–5033. IEEE, 2012.
|
| 310 |
+
|
| 311 |
+
Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3540– 3549. JMLR. org, 2017.
|
| 312 |
+
|
| 313 |
+
David Warde-Farley, Tom Van de Wiele, Tejas Kulkarni, Catalin Ionescu, Steven Hansen, and Volodymyr Mnih. Unsupervised control through non-parametric discriminative rewards. arXiv preprint arXiv:1811.11359, 2018.
|
| 314 |
+
|
| 315 |
+
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.
|
| 316 |
+
|
| 317 |
+
Grady Williams, Paul Drews, Brian Goldfain, James M Rehg, and Evangelos A Theodorou. Aggressive driving with model predictive path integral control. In 2016 IEEE International Conference on Robotics and Automation (ICRA), pp. 1433–1440. IEEE, 2016.
|
| 318 |
+
|
| 319 |
+
# A IMPLEMENTATION DETAILS
|
| 320 |
+
|
| 321 |
+
All of our models are written in the open source Tensorflow-Agents (Sergio Guadarrama, Anoop Korattikara, Oscar Ramirez, Pablo Castro, Ethan Holly, Sam Fishman, Ke Wang, Ekaterina Gonina, Chris Harris, Vincent Vanhoucke, Eugene Brevdo, 2018), based on Tensorflow (Abadi et al., 2015).
|
| 322 |
+
|
| 323 |
+
# A.1 SKILL SPACES
|
| 324 |
+
|
| 325 |
+
When using discrete spaces, we parameterize $\mathcal { Z }$ as one-hot vectors. These one-hot vectors are randomly sampled from the uniform prior $\begin{array} { r } { p ( z ) = \frac { 1 } { D } } \end{array}$ , where $D$ is the number of skills. We experiment with $D \leq 1 2 8$ . For discrete skills learnt for MuJoCo Ant in Section 6.3, we use $D = 2 0$ . For continuous spaces, we sample $z \sim \mathrm { U n i f o r m } ( - 1 , 1 ) ^ { D }$ . We experiment with $D = 2$ for Ant learnt with x-y prior, $D = 3$ for Ant learnt without x-y prior (that is full observation space), to $D = 5$ for Humanoid on full observation spaces. The skills are sampled once in the beginning of the episode and fixed for the rest of the episode. However, it is possible to resample the skill from the prior within the episode, which allows for every skill to experience a different distribution than the initialization distribution. This also encourages discovery of skills which can be composed temporally. However, this increases the hardness of problem, especially if the skills are re-sampled from the prior frequently.
|
| 326 |
+
|
| 327 |
+
# A.2 AGENT
|
| 328 |
+
|
| 329 |
+
We use SAC as the optimizer for our agent $\pi ( \boldsymbol { a } \ | \ \boldsymbol { s } , \boldsymbol { z } )$ , in particular, EC-SAC (Haarnoja et al., 2018b). The $s$ input to the policy generally excludes global co-ordinates $( x , y )$ of the centre-ofmass, available for a lot of enviroments in OpenAI gym, which helps produce skills agnostic to the location of the agent. We restrict to two hidden layers for our policy and critic networks. However, to improve the expressivity of skills, it is beneficial to increase the capacity of the networks. The hidden layer sizes can vary from (128, 128) for Half-Cheetah to (512, 512) for Ant and (1024, 1024) for Humanoid. The critic $Q ( s , a , z )$ is similarly parameterized. The target function for critic $Q$ is updated every iteration using a soft updates with co-efficient of 0.005. We use Adam (Kingma & Ba, 2014) optimizer with a fixed learning rate of $3 e \mathrm { ~ - ~ } 4$ , and a fixed initial entropy co-efficient $\beta = 0 . 1$ . While the policy is parameterized as a normal distribution $\mathcal { N } ( \mu ( s , z ) , \Sigma ( s , z ) )$ where $\Sigma$ is a diagonal covariance matrix, it undergoes through tanh transformation, to transform the output to the range $( - 1 , 1 )$ and constrain to the action bounds.
|
| 330 |
+
|
| 331 |
+
# A.3 SKILL-DYNAMICS
|
| 332 |
+
|
| 333 |
+
Skill-dynamics, denoted by $q ( s ^ { \prime } \mid s , z )$ , is parameterized by a deep neural network. A common trick in model-based RL is to predict the $\Delta s = s ^ { \prime } - s$ , rather than the full state $s ^ { \prime }$ . Hence, the prediction network is $q ( \Delta s \mid s , z )$ . Note, both parameterizations can represent the same set of functions. However, the latter will be easy to learn as $\Delta s$ will be centred around 0. We exclude the global coordinates from from the state input to $q$ . However, we can (and we still do) predict $\Delta _ { x } , \Delta _ { y }$ , because reward functions for goal-based navigation generally rely on the position prediction from the model. This represents another benefit of predicting state-deltas, as we can still predict changes in position without explicitly knowing the global position.
|
| 334 |
+
|
| 335 |
+
The output distribution is modelled as a Mixture-of-Experts (Jacobs et al., 1991). We fix the number of experts to be 4. We model each expert as a Gaussian distribution. The input $( s , z )$ goes through two hidden layers (the same capacity as that of policy and critic networks, for example (512, 512) for Ant). The output of the two hidden layers is used as an input to the mixture-of-experts, which is linearly transformed to output the parameters of the Gaussian distribution, and a discrete distribution over the experts using a softmax distribution. In practice, we fix the covariance matrix of the Gaussian experts to be an identity matrix, so we only need to output the means for the experts. We use batch-normalization for both input and the hidden layers. We normalize the output targets using their batch-average and batch-standard deviation, similar to batch-normalization.
|
| 336 |
+
|
| 337 |
+
# A.4 OTHER HYPERPARAMETERS
|
| 338 |
+
|
| 339 |
+
The episode horizon is generally kept shorter for stable agents like Ant (200), while longer for unstable agents like Humanoid (1000). For Ant, longer episodes do not add value, but Humanoid can benefit from longer episodes as it helps it filter skills which are unstable. The optimization scheme is on-policy, and we collect 2000 steps for Ant and 4000 steps for Humanoid in one iteration. The intuition is to experience trajectories generated by multiple skills (approximately 10) in a batch. Re-sampling skills can enable experiencing larger number of skills. Once a batch of episodes is collected, the skill-dynamics is updated using Adam optimizer with a fixed learning rate of $3 e - 4$ . The batch size is 128, and we carry out 32 steps of gradient descent. To compute the intrinsic reward, we need to resample the prior for computing the denominator. For continuous spaces, we set $L = 5 0 0$ . For discrete spaces, we can marginalize over all skills. After the intrinsic reward is computed, the policy and critic networks are updated for 128 steps with a batch size of 128. The intuition is to ensure that every sample in the batch is seen for policy and critic updates about $3 - 4$ times in expectation.
|
| 340 |
+
|
| 341 |
+
# A.5 PLANNING AND EVALUATION SETUPS
|
| 342 |
+
|
| 343 |
+
For evaluation, we fix the episode horizon to 200 for all models in all evaluation setups. Depending upon the size of the latent space and planning horizon, the number of samples from the planning distribution $P$ is varied between $1 0 - 2 0 0$ . For $H _ { P } = 1 , H _ { Z } = 1 0$ and a $2 D$ latent space, we use 50 samples from the planning distribution $P$ . The co-efficient $\gamma$ for MPPI is fixed to 10. We use a setting of $H _ { P } = 1$ and $H _ { Z } = 1 0$ for dense-reward navigation, in which case we set the number of refine steps $R = 1 0$ . However, for sparse reward navigation it is important to have a longer horizon planning, in which case we set $H _ { P } = 4 , H _ { Z } = 2 5$ with a higher number of samples from the planning distribution (200 from $P$ ). Also, when using longer planning horizons, we found that smoothing the sampled plans help. Thus, if the sampled plan is $z _ { 1 } , z _ { 2 } , z _ { 3 } , z _ { 4 } \ldots$ we smooth the plan to make $\bar { z _ { 2 } } = \beta z _ { 1 } \bar { + } ( 1 \bar { - } \beta ) z _ { 2 }$ and so on, with $\beta = 0 . 9$ .
|
| 344 |
+
|
| 345 |
+
For hierarchical controllers being learnt on top of low-level unsupervised primitives, we use PPO (Schulman et al., 2017) for discrete action skills, while we use SAC for continuous skills. We keep the number of steps after which the meta-action is decided as 10 (that is $H _ { Z } = 1 0$ ). The hidden layer sizes of the meta-controller are (128, 128). We use a learning rate of $1 e - 4$ for PPO and $3 e - 4$ for SAC.
|
| 346 |
+
|
| 347 |
+
For our model-based RL baseline PETS, we use an ensemble size of 3, with a fixed planning horizon of 20. For the model, we use a neural network with two hidden layers of size 400. In our experiments, we found that MPPI outperforms CEM, so we report the results using the MPPI as our controller.
|
| 348 |
+
|
| 349 |
+
# B GRAPHICAL MODELS, INFORMATION BOTTLENECK AND UNSUPERVISED SKILL LEARNING
|
| 350 |
+
|
| 351 |
+
We now present a novel perspective on unsupervised skill learning, motivated from the literature on information bottleneck. This section takes inspiration from (Alemi & Fischer, 2018), which helps us provide a rigorous justification for our objective proposed earlier. To obtain our unsupervised RL objective, we setup a graphical model $P$ as shown in Figure 9, which represents the distribution of trajectories generated by a given policy $\pi$ . The joint distribution is given by:
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
p ( s _ { 1 } , a _ { 1 } \ldots a _ { T - 1 } , s _ { T } , z ) = p ( z ) p ( s _ { 1 } ) \prod _ { t = 1 } ^ { T - 1 } \pi ( a _ { t } | s _ { t } , z ) p ( s _ { t + 1 } | s _ { t } , a _ { t } ) .
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 9: Graphical model for the world $P$ in which the trajectories are generated while interacting with the environment. Shaded nodes represent the distributions we optimize.
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 10: Graphical model for the world $N$ which is the desired representation of the world.
|
| 362 |
+
|
| 363 |
+
We setup another graphical model $N$ , which represents the desired model of the world. In particular, we are interested in approximating $p ( s ^ { \prime } | s , z )$ , which represents the transition function for a particular primitive. This abstraction helps us get away from knowing the exact actions, enabling model-based planning in behavior space (as discussed in the main paper). The joint distribution for $N$ shown in Figure 10 is given by:
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\eta ( s _ { 1 } , a _ { 1 } , \ldots s _ { T } , a _ { T } , z ) = \eta ( z ) \eta ( s _ { 1 } ) \prod _ { t = 1 } ^ { T - 1 } \eta ( a _ { t } ) \eta ( s _ { t + 1 } | s _ { t } , z ) .
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
The goal of our approach is to optimize the distribution $\pi ( a | s , z )$ in the graphical model $P$ to minimize the distance between the two distributions, when transforming to the representation of the graphical model $Z$ . In particular, we are interested in minimizing the KL divergence between $p$ and $\eta$ , that is $\mathcal { D } _ { K L } ( \boldsymbol { p } | | \boldsymbol { \eta } )$ . Note, if $N$ had the same structure as $P$ , the information lost in projection would be 0 for any valid $P$ . Interestingly, we can exploit the following result from in Friedman et al. (2001) to setup the objective for $\pi$ , without explicitly knowing $\eta$ :
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\operatorname* { m i n } _ { \eta } \mathcal { D } _ { K L } ( p | | \eta ) = \mathcal { I } _ { P } - \mathcal { I } _ { N } ,
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
where $\mathcal { T } _ { P }$ and $\mathcal { T } _ { N }$ represents the multi-information for distribution $P$ on the respective graphical models. Note, $\begin{array} { r } { \operatorname* { m i n } _ { \eta \in N } \mathcal { D } _ { K L } ( p | | \eta ) } \end{array}$ , which is the reverse information projection (Csiszar´ $\&$ Matus, 2003). The multi-information (Slonim et al., 2005) for a graphical model $G$ with nodes $g _ { i }$ is defined as:
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\mathcal { T } _ { G } = \sum _ { i } I ( g _ { i } ; P a ( g _ { i } ) ) ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
where $P a ( g _ { i } )$ denotes the nodes upon which $g _ { i }$ has direct conditional dependence in $G$ . Using this definition, we can compute the multi-information terms:
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\mathcal { Z } _ { P } = \sum _ { t = 1 } ^ { T } I ( a _ { t } ; \{ s _ { t } , z \} ) + \sum _ { t = 2 } ^ { T } I ( s _ { t } ; \{ s _ { t - 1 } , a _ { t - 1 } \} ) \quad \mathrm { a n d } \quad \mathcal { Z } _ { N } = \sum _ { t = 2 } ^ { T } I ( s _ { t } ; \{ s _ { t - 1 } , z \} ) .
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Following the Optimal Frontier argument in (Alemi & Fischer, 2018), we introduce Lagrange multipliers $\beta _ { t } \ge 0 , \delta _ { t } \ge 0$ for the information terms in $\mathcal { T } _ { P }$ to setup an objective $R ( \pi )$ to be maximized with respect to $\pi$ :
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
R ( \pi ) = \sum _ { t = 1 } ^ { T - 1 } I ( s _ { t + 1 } ; \{ s _ { t } , z \} ) - \beta _ { t } I ( a _ { t } ; \{ s _ { t } , z \} ) - \delta _ { t } \mathcal { Z } ( s _ { t + 1 } ; \{ s _ { t } , a _ { t } \} )
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
As the underlying dynamics are fixed and unknown, we simplify the optimization by setting $\delta _ { t } = $ 0 which intuitively corresponds to us neglecting the unchangeable information of the underlying dynamics. This gives us
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { l } { \displaystyle R ( \pi ) = \sum _ { t = 1 } ^ { T - 1 } I ( s _ { t + 1 } ; \{ s _ { t } , z \} ) - \beta _ { t } I ( a _ { t } ; \{ s _ { t } , z \} ) } \\ { \displaystyle \geq \sum _ { t = 1 } ^ { T - 1 } I ( s _ { t + 1 } ; z \mid s _ { t } ) - \beta _ { t } I ( a _ { t } ; \{ s _ { t } , z \} ) } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
Here, we have used the chain rule of mutual information: ${ \cal { T } } ( s _ { t + 1 } ; \{ s _ { t } , z \} ) ~ = ~ { \cal { T } } ( s _ { t + 1 } ; s _ { t } ) ~ + ~$ $\mathcal { T } ( s _ { t + 1 } ; z \mid s _ { t } ) \geq \mathcal { T } ( s _ { t + 1 } ; z \mid s _ { t } )$ , resulting from the non-negativity of mutual information. This yield us an information bottleneck style objective where we maximize the mutual information motivated in Section 3, while minimizing $\mathcal { T } ( a _ { t } ; \{ s _ { t } , z \} )$ . We can show that the minimization of the latter mutual information corresponds to entropy regularization of $\pi ( a _ { t } \mid s _ { t } , z )$ , as follows:
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } & { \mathcal { Z } ( a _ { t } ; \{ s _ { t } , z \} ) = \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } | s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \frac { \pi ( a _ { t } \mid s _ { t } , z ) } { \pi ( a _ { t } ) } \Big ] } \\ & { \quad \quad \quad \quad = \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } | s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \frac { \pi ( a _ { t } \mid s _ { t } , z ) } { p ( a _ { t } ) } \Big ] - \mathcal { D } _ { K L } \big ( \pi ( a _ { t } ) \mid | p ( a _ { t } ) \big ) } \\ & { \quad \quad \quad \quad \quad \leq \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } | s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \frac { \pi ( a _ { t } \mid s _ { t } , z ) } { p ( a _ { t } ) } \Big ] } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
for some arbitrary distribution $\log p ( a _ { t } )$ (for example uniform). Again, we have used the nonnegativity of $\mathcal { D } _ { K L }$ to get the inequality. We use Equation 19 in Equation 16 to get:
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
R ( \pi ) \geq \sum _ { t = 1 } ^ { T - 1 } \mathcal { Z } ( s _ { t + 1 } ; z \mid s _ { t } ) - \beta _ { t } \mathbb { E } _ { a _ { t } \sim \pi ( a _ { t } \mid s _ { t } , z ) , s _ { t } , z \sim p } \Big [ \log \pi ( a _ { t } \mid s _ { t } , z ) \Big ]
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
where we have ignored $p ( a _ { t } )$ as it is a constant with respect to optimization for $\pi$ . This motivates the use of entropy regularization. We can follow the arguments in Section 3 to obtain an approximate lower bound for $\mathcal { T } ( s _ { t + 1 } ; z \mid s _ { t } )$ . The above discussion shows how DADS can be motivated from a graphical modelling perspective, while justifying the use of entropy regularization from an information bottleneck perspective. This objective also explicates the temporally extended nature of $z$ , and how it corresponds to a sequence of actions producing a predictable sequence of transitions in the environment.
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
Figure 11: Graphical model for the world $P$ representing the stationary state, action distribution. Shaded nodes represent the distributions we optimize.
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure 12: Graphical model for the world $N$ using which we is the representation we are interested in.
|
| 418 |
+
|
| 419 |
+
We can carry out the exercise for the reward function in Eysenbach et al. (2018) (DIAYN) to provide a graphical model interpretation of the objective used in the paper. To conform with objective in the paper, we assume to be sampling to be state-action pairs from skill-conditioned stationary distributions in the world $P$ , rather than trajectories. The objective to be maximized is given by:
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { r l } & { R ( \pi ) = - \mathscr { T } _ { P } + \mathscr { T } _ { Q } } \\ & { \quad \quad = - I ( a ; \{ s , z \} ) + I ( z ; s ) } \\ & { \quad \quad = \mathbb { E } _ { \pi } [ \log \frac { p ( z | s ) } { p ( z ) } - \log \frac { \pi ( a | s , z ) } { \pi ( a ) } ] } \\ & { \quad \quad \geq \mathbb { E } _ { \pi } [ \log q _ { \phi } ( z | s ) - \log p ( z ) - \log \pi ( a | s , z ) ] = R ( \pi , q _ { \phi } ) } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
where we have used the variational inequalities to replace $p ( z | s )$ with $q _ { \phi } ( z | s )$ and $\pi ( a )$ with a uniform prior over bounded actions $p ( a )$ (which is ignored as a constant).
|
| 426 |
+
|
| 427 |
+
# C APPROXIMATING THE REWARD FUNCTION
|
| 428 |
+
|
| 429 |
+
We revisit Equation 4 and the resulting approximate reward function constructed in Equation 6. The maximization objective for policy was:
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
R ( \pi \mid q _ { \phi } ) = \mathbb { E } _ { z , s , s ^ { \prime } } \big [ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log p ( s ^ { \prime } \mid s ) \big ]
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
The computational problem arises from the intractability of $\begin{array} { r } { p ( s ^ { \prime } \mid s ) = \int p ( s ^ { \prime } \mid s , z ) p ( z \mid s ) d z } \end{array}$ , where both $p ( s ^ { \prime } \mid s , \bar { z } )$ and $p ( z \mid s ) \propto p ( s \mid z ) p ( z )$ are intractable. Unfortunately, any variational approximation results in an improper lower bound for the objective. To see that:
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\begin{array} { r l } & { R ( \pi \mid q _ { \phi } ) = \operatorname { \mathbb { E } } _ { z , s , s ^ { \prime } } \left[ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log q ( s ^ { \prime } \mid s ) \right] - \mathcal { D } _ { K L } ( p ( s ^ { \prime } \mid s ) \mid \mid q ( s ^ { \prime } \mid s ) ) } \\ & { \quad \quad \quad \leq \operatorname { \mathbb { E } } _ { z , s , s ^ { \prime } } \left[ \log q _ { \phi } ( s ^ { \prime } \mid s , z ) - \log q ( s ^ { \prime } \mid s ) \right] } \end{array}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
where the inequality goes the wrong way for any variational approximation $q ( s ^ { \prime } \mid s )$ . Our approximation can be seen as a special instantiation of $\begin{array} { r } { q ( s ^ { \prime } \mid s ) = \int q _ { \phi } ( s ^ { \prime } \mid \bar { s } , z ) p ( z ) d z } \end{array}$ . This approximation is simple to compute as generating samples from the prior $p ( z )$ is inexpensive and effectively requires only a forward pass through $q _ { \phi }$ . Reusing $q _ { \phi }$ to approximate $p ( s ^ { \prime } \bar { | } s )$ makes intuitive sense because we want $q _ { \phi }$ to reasonably approximate $p ( s ^ { \prime } \mid s , z )$ (which is why we collect large batches of data and take multiple steps of gradient descent for fitting $q _ { \phi } .$ ). While sampling from the prior $p ( z )$ is crude, sampling $p ( z \mid s )$ can be computationally prohibitive. For a certain class of problems, especially locomotion, sampling from $p ( z )$ is a reasonable approximation as well. We want our primitives/skills to be usable from any state, which is especially the case with locomotion. Empirically, we have found our current approximation provides satisfactory results. We also discuss some other potential solutions (and their limitations):
|
| 442 |
+
|
| 443 |
+
(a) One could potentially use another network $q _ { \beta } ( z \mid s )$ to approximate $p ( z \mid s )$ by minimizing $\mathbb { E } _ { s , z \sim p } \big [ D _ { K L } ( p ( z \mid s ) \mid \mid q _ { \beta } ( z \mid s ) ) \big ]$ . Note, the resulting approximation would still be an improper lower bound for $R ( \pi \mid q _ { \phi } )$ . However, sampling from this $q _ { \beta }$ might result in a better approximation than sampling from the prior $p ( z )$ for some problems.
|
| 444 |
+
|
| 445 |
+
(b) We can bypass the computational intractability of $p ( s ^ { \prime } \mid s )$ by exploiting the variational lower bounds from Agakov (2004). We use the following inequality, used in Hausman et al. (2018):
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\mathcal { H } ( x ) \geq \int p ( x , z ) \log \frac { q ( z | x ) } { p ( x , z ) } d x d z
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
where $q$ is a variational approximation to the posterior $p ( z | x )$ .
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\begin{array} { r l } & { I ( s ^ { \prime } ; z | s ) = - { \mathcal { H } } ( s ^ { \prime } | s , z ) + { \mathcal { H } } ( s ^ { \prime } | s ) } \\ & { \qquad \geq \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \left[ \log q _ { \phi } ( s ^ { \prime } | s , z ) \right] + \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \left[ \log q _ { \alpha } ( z | s ^ { \prime } , s ) \right] + { \mathcal { H } } ( s ^ { \prime } , z | s ) } \\ & { \qquad = \mathbb { E } _ { z , s , s ^ { \prime } \sim p } \left[ \log q _ { \phi } ( s ^ { \prime } | s , z ) + \log q _ { \alpha } ( z | s ^ { \prime } , s ) \right] + { \mathcal { H } } ( s ^ { \prime } , z | s ) } \end{array}
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
where we have used the inequality for $\mathcal { H } ( s ^ { \prime } | s )$ to introduce the variational posterior for skill inference $q _ { \alpha } ( z \mid s ^ { \prime } , s )$ besides the conventional variational lower bound to introduce $q ( s ^ { \prime } \mid s , z )$ . Further decomposing the leftover entropy:
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\mathcal { H } ( s ^ { \prime } , z | s ) = \mathcal { H } ( z | s ) + \mathcal { H } ( s ^ { \prime } | s , z )
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Reusing the variational lower bound for marginal entropy from Agakov (2004), we get:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\begin{array} { l } { \displaystyle \mathcal { H } ( s ^ { \prime } | s , z ) \geq \mathbb { E } _ { s , z } \Big [ \int p ( s ^ { \prime } , a | s , z ) \log \frac { q ( a | s ^ { \prime } , s , z ) } { p ( s ^ { \prime } , a | s , z ) } d s ^ { \prime } d a \Big ] } \\ { \displaystyle \qquad = - \log c + \mathcal { H } ( s ^ { \prime } , a | s , z ) } \\ { \displaystyle \qquad = - \log c + \mathcal { H } ( s ^ { \prime } | s , a , z ) + \mathcal { H } ( a | s , z ) } \end{array}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
Since, the choice of posterior is upon us, we can choose $q ( a | s ^ { \prime } , s , z ) = 1 / c$ to induce a uniform distribution for the bounded action space. For $\mathcal { H } ( s ^ { \prime } | s , a , z )$ , notice that the underlying dynamics $p ( s ^ { \prime } | s , a )$ are independent of $z$ , but the actions do depend upon $z$ . Therefore, this corresponds to entropy-regularized RL when the dynamics of the system are deterministic. Even for stochastic dynamics, the analogy might be a good approximation , assuming the underlying dynamics are not very entropic. The final objective (making this low-entropy dynamics assumption) can be written as:
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
I ( s ^ { \prime } ; z | s ) \geq \mathbb { E } _ { s } \mathbb { E } _ { p ( s ^ { \prime } , z | s ) } [ \log q _ { \phi } ( s ^ { \prime } | s , z ) + \log q _ { \alpha } ( z | s ^ { \prime } , s ) - \log p ( z | s ) ] + \mathcal { H } ( a | s , z )
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
While this does bypass the intractability of $p ( s ^ { \prime } \mid s )$ , it runs into the intractable $p ( z \mid s )$ , despite deploying significant mathematical machinery and additional assumptions. Any variational approximation for $\bar { p ( z \mid s ) }$ would again result in an improper lower bound for ${ \mathcal { T } } ( s ^ { \prime } ; z \mid s )$ .
|
| 476 |
+
|
| 477 |
+
(c) One way to a make our approximation $q ( s ^ { \prime } \mid s )$ to more closely resemble $p ( s ^ { \prime } \mid s )$ is to change our generative model $p ( z , s , s ^ { \prime } )$ . In particular, if we resample $z \sim p ( z )$ for every timestep of the rollout from $\pi$ , we can indeed write ${ \\\bar { p } } ( z \mid s ) = p ( z )$ . Note, $p ( s ^ { \prime } \mid s )$ is still intractable to compute, but marginalizing $q _ { \phi } ( s ^ { \prime } \mid s , z )$ over $p ( z )$ becomes a better approximation of $p ( s ^ { \prime } \mid s )$ . However, this severely dampens the interpretation of our latent space $\mathcal { Z }$ as temporally extended actions (or skills). It becomes better to interpret the latent space $\mathcal { Z }$ as dimensional reduction of action space. Empirically, we found that this significantly throttles the learning, not yielding useful or interpretable skills.
|
| 478 |
+
|
| 479 |
+
# D INTERPOLATION IN CONTINUOUS LATENT SPACE
|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
Figure 13: Interpolation in the continuous primitive space learned using DADS on the Ant environment corresponds to interpolation in the trajectory space. (Left) Interpolation from $z ~ = ~ [ 1 . 0 , 1 . 0 ]$ (solid blue) to $z \doteq [ - 1 . 0 , 1 . 0 ]$ (dotted cyan); (Middle) Interpolation from $z \overset { - } { = } \left[ 1 . 0 , 1 . 0 \right]$ (solid blue) to $z \dot { = } [ - 1 . 0 , - 1 . 0 ]$ (dotted cyan); (Right) Interpolation from $z = [ \bar { 1 } . 0 , 1 . 0 ]$ (solid blue) to $z = [ 1 . 0 , - 1 . 0 ]$ (dotted cyan).
|
| 483 |
+
|
| 484 |
+
# E MODEL PREDICTION
|
| 485 |
+
|
| 486 |
+
From Figure 14, we observe that skill-dynamics can provide robust state-predictions over long planning horizons. When learning skill-dynamics with $x - y$ prior, we observe that the error in prediction rises slower with horizon as compared to the norm of the actual position. This provides strong evidence of cooperation between the primitives and skill-dynamics learned using DADS with $x - y$ prior. As the error-growth for skill-dynamics learned on full-observation space is sub-exponential, similar argument can be made for DADS without $x - y$ prior as well (albeit to a weaker extent).
|
| 487 |
+
|
| 488 |
+

|
| 489 |
+
Figure 14: (Left) Prediction error in the Ant’s co-ordinates (normalized by the norm of the actual position) for skill-dynamics. (Right) X-Y traces of actual trajectories (colored) compared to trajectories predicted by skill-dynamics (dotted-black) for different skills.
|
parse/train/HJgLZR4KvH/HJgLZR4KvH_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/HJgLZR4KvH/HJgLZR4KvH_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/HJgLZR4KvH/HJgLZR4KvH_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/HJxDugSFDB/HJxDugSFDB.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC LATENT ACTOR-CRITIC: DEEP REINFORCEMENT LEARNING WITH A LATENT VARIABLE MODEL
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep reinforcement learning (RL) algorithms can use high-capacity deep networks to learn directly from image observations. However, these kinds of observation spaces present a number of challenges in practice, since the policy must now solve two problems: a representation learning problem, and a task learning problem. In this paper, we aim to explicitly learn representations that can accelerate reinforcement learning from images. We propose the stochastic latent actor-critic (SLAC) algorithm: a sample-efficient and high-performing RL algorithm for learning policies for complex continuous control tasks directly from high-dimensional image inputs. SLAC learns a compact latent representation space using a stochastic sequential latent variable model, and then learns a critic model within this latent space. By learning a critic within a compact state space, SLAC can learn much more efficiently than standard RL methods. The proposed model improves performance substantially over alternative representations as well, such as variational autoencoders. In fact, our experimental evaluation demonstrates that the sample efficiency of our resulting method is comparable to that of model-based RL methods that directly use a similar type of model for control. Furthermore, our method outperforms both model-free and model-based alternatives in terms of final performance and sample efficiency, on a range of difficult image-based control tasks. Our code and videos of our results are available at our website.1
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep reinforcement learning (RL) algorithms can automatically learn to solve certain tasks from raw, low-level observations such as images. However, these kinds of observation spaces present a number of challenges in practice: on one hand, it is difficult to directly learn from these high-dimensional inputs, but on the other hand, it is also difficult to tease out a compact representation of the underlying task-relevant information from which to learn instead. For these reasons, deep RL directly from low-level observations such as images remains a challenging problem. Particularly in continuous domains governed by complex dynamics, such as robotic control (Tassa et al., 2018; Brockman et al., 2016), standard approaches still require separate sensor setups to monitor details of interest in the environment, such as the joint positions of a robot or specific pose information of objects of interest. To instead be able to learn directly from the more general and rich modality of vision would greatly advance the current state of our learning systems, so we aim to study precisely this. Standard model-free deep RL aims to use direct end-to-end training to explicitly unify these tasks of representation learning and task learning. However, solving both problems together is difficult, since an effective policy requires an effective representation, but in order for an effective representation to emerge, the policy or value function must provide meaningful gradient information using only the model-free supervision signal (i.e., the reward function). In practice, learning directly from images with standard RL algorithms can be slow, sensitive to hyperparameters, and inefficient. In contrast to end-to-end learning with RL, predictive learning can benefit from a rich and informative supervision signal before the agent has even made progress on the task or received any rewards. This leads us to ask: can we explicitly learn a latent representation from raw low-level observations that makes deep RL easier, through learning a predictive latent variable model?
|
| 12 |
+
|
| 13 |
+
Predictive models are commonly used in model-based RL for the purpose of planning (Deisenroth & Rasmussen, 2011; Finn & Levine, 2017; Nagabandi et al., 2018; Chua et al., 2018; Zhang et al., 2019) or generating cheap synthetic experience for RL to reduce the required amount of interaction with the real environment (Sutton, 1991; Gu et al., 2016). However, in this work, we are primarily concerned with their potential to alleviate the representation learning challenge in RL. We devise a stochastic predictive model by modeling the high-dimensional observations as the consequence of a latent process, with a Gaussian prior and latent dynamics, as illustrated in Figure 1. A model with an entirely stochastic latent state has the appealing interpretation of being able to properly represent uncertainty about any of the state variables, given its past observations. We demonstrate in our work that fully stochastic state space models can in fact be learned effectively: With a well-designed stochastic network, such models outperform fully deterministic models, and contrary to the observations in prior work (Hafner et al., 2019; Buesing et al., 2018), are actually comparable to partially stochastic models. Finally, we note that this explicit representation learning, even on low-reward data, allows an agent with such a model to make progress on representation learning even before it makes progress on task learning.
|
| 14 |
+
|
| 15 |
+
Equipped with this model, we can then perform RL in the learned latent space of the predictive model. We posit—and confirm experimentally—that our latent variable model provides a useful representation for RL. Our model represents a partially observed Markov decision process (POMDP), and solving such a POMDP exactly would be computationally intractable (Astrom, 1965; Kaelbling et al., 1998; Igl et al., 2018). We instead propose a simple approximation that trains a Markovian critic on the (stochastic) latent state and trains an actor on a history of observations and actions. The resulting stochastic latent actor-critic (SLAC) algorithm loses some of the benefits of full POMDP solvers, but it is easy and stable to train. It also produces good results, in practice, on a range of challenging problems, making it an appealing alternative to more complex POMDP solution methods.
|
| 16 |
+
|
| 17 |
+
The main contributions of our SLAC algorithm are useful representations learned from our stochastic sequential latent variable model, as well as effective RL in this learned latent space. We show experimentally that our approach substantially improves on both model-free and model-based RL algorithms on a range of image-based continuous control benchmark tasks, attaining better final performance and learning more quickly than algorithms based on (a) end-to-end deep RL from images, (b) learning in a latent space produced by various alternative latent variable models, such as a variational autoencoder (VAE) (Kingma & Welling, 2014), and (c) model-based RL based on latent state-space models with partially stochastic variables (Hafner et al., 2019).
|
| 18 |
+
|
| 19 |
+
# 2 RELATED WORK
|
| 20 |
+
|
| 21 |
+
Representation learning in RL. End-to-end deep RL can in principle learn representations directly as part of the RL process (Mnih et al., 2013). However, prior work has observed that RL has a “representation learning bottleneck”: a considerable portion of the learning period must be spent acquiring good representations of the observation space (Shelhamer et al., 2016). This motivates the use of a distinct representation learning procedure to acquire these representations before the agent has even learned to solve the task. The use of auxiliary supervision in RL to learn such representations has been explored in a number of prior works (Lange & Riedmiller, 2010; Finn et al., 2016; Jaderberg et al., 2017; Higgins et al., 2017; Ha & Schmidhuber, 2018; Nair et al., 2018; Oord et al., 2018; Gelada et al., 2019; Dadashi et al., 2019). In contrast to this class of representation learning algorithms, we explicitly learn a latent variable model of the POMDP, in which the latent representation and latent-space dynamics are jointly learned. By modeling covariances between consecutive latent states, we make it feasible for our proposed algorithm to perform Bellman backups directly in the latent space of the learned model.
|
| 22 |
+
|
| 23 |
+
Partial observability in RL. Our work is also related to prior research on RL under partial observability. Prior work has studied exact and approximate solutions to POMDPs, but they require explicit models of the POMDP and are only practical for simpler domains (Kaelbling et al., 1998). Recent work has proposed end-to-end RL methods that use recurrent neural networks to process histories of observations and (sometimes) actions, but without constructing a model of the POMDP (Hausknecht & Stone, 2015; Foerster et al., 2016; Zhu et al., 2018). Other works, however, learn latent-space dynamical system models and then use them to solve the POMDP with model-based RL (Watter et al., 2015; Wahlström et al., 2015; Karl et al., 2017; Zhang et al., 2019; Hafner et al., 2019).
|
| 24 |
+
|
| 25 |
+
Although some of these works learn latent variable models that are similar to ours, these model-based methods are often limited by compounding model errors and finite horizon optimization. In contrast to these works, our approach does not use the model for prediction and performs infinite horizon policy optimization. Our approach benefits from the good asymptotic performance of model-free RL, while at the same time leveraging the improved latent space representation for sample efficiency. Other works have also trained latent variable models and used their representations as the inputs to model-free RL algorithms. They use representations encoded from latent states sampled from the forward model (Buesing et al., 2018), belief representations obtained from particle filtering (Igl et al., 2018), or belief representations obtained directly from a learned belief-space forward model (Gregor et al., 2019). Our approach is closely related to these prior methods, in that we also use model-free RL with a latent state representation that is learned via prediction. However, instead of using belief representations, our method learns a critic directly on latent states samples.
|
| 26 |
+
|
| 27 |
+
Sequential latent variable models. Several previous works have explored various modeling choices to learn stochastic sequential models (Krishnan et al., 2015; Archer et al., 2015; Karl et al., 2016; Fraccaro et al., 2016; 2017; Doerr et al., 2018a). In the context of using sequential models for RL, previous works have typically observed that partially stochastic state space models are more effective than fully stochastic ones (Buesing et al., 2018; Igl et al., 2018; Hafner et al., 2019). In these models, the state of the underlying MDP is modeled with the deterministic state of a recurrent network (e.g., LSTM (Hochreiter & Schmidhuber, 1997) or GRU (Cho et al., 2014)), and optionally with some stochastic random variables. As mentioned earlier, a model with a latent state that is entirely stochastic has the appealing interpretation of learning a representation that can properly represent uncertainty about any of the state variables, given past observations. We demonstrate in our work that fully stochastic state space models can in fact be learned effectively and, with a well-designed stochastic network, such models perform on par to partially stochastic models and outperform fully deterministic models.
|
| 28 |
+
|
| 29 |
+
# 3 REINFORCEMENT LEARNING AND MODELING
|
| 30 |
+
|
| 31 |
+
This work addresses the problem of learning maximum entropy policies from high-dimensional observations in POMDPs, by simultaneously learning a latent representation of the underlying MDP state using variational inference and learning the policy in a maximum entropy RL framework. In this section, we describe maximum entropy RL (Ziebart, 2010; Haarnoja et al., 2018a; Levine, 2018) in fully observable MDPs, as well as variational methods for training latent state space models for POMDPs.
|
| 32 |
+
|
| 33 |
+
# 3.1 MAXIMUM ENTROPY RL IN FULLY OBSERVABLE MDPS
|
| 34 |
+
|
| 35 |
+
In a Markov decision process (MDP), an agent at time $t$ takes an action $\mathbf { a } _ { t } \in \mathcal A$ from state $\mathbf { s } _ { t } \in \cal { S }$ and reaches the next state $\mathbf { s } _ { t + 1 } \in S$ according to some stochastic transition dynamics $p ( \mathbf { s } _ { t + 1 } | \mathbf { s } _ { t } , \mathbf { a } _ { t } )$ . The initial state ${ \bf s } _ { 1 }$ comes from a distribution $p ( \mathbf { s } _ { 1 } )$ , and the agent receives a reward $r _ { t }$ on each of the transitions. Standard RL aims to learn the parameters $\phi$ of some policy $\pi _ { \phi } ( \mathbf { a } _ { t } | \mathbf { s } _ { t } )$ such that the expected sum of rewards is maximized under the induced trajectory distribution $\rho _ { \pi }$ . This objective can be modified to incorporate an entropy term, such that the policy also aims to maximize the expected entropy $\mathcal { H } ( \pi _ { \phi } ( \cdot | \mathbf { s } _ { t } ) )$ under the induced trajectory distribution $\rho _ { \pi }$ . This formulation has a close connection to variational inference (Ziebart, 2010; Haarnoja et al., 2018a; Levine, 2018), and we build on this in our work. The resulting maximum entropy objective is
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\boldsymbol { \phi } ^ { * } = \arg \operatorname* { m a x } _ { \boldsymbol { \phi } } \sum _ { t = 1 } ^ { T } \underset { ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \sim \rho _ { \pi } } { \mathbb { E } } [ r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) + \alpha \mathcal { H } ( \pi _ { \boldsymbol { \phi } } ( \cdot | \mathbf { s } _ { t } ) ) ] ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $r$ is the reward function, and $\alpha$ is a temperature parameter that controls the trade-off between optimizing for the reward and for the entropy (i.e., stochasticity) of the policy. Soft actor-critic (SAC) (Haarnoja et al., 2018a) uses this maximum entropy RL framework to derive soft policy iteration, which alternates between policy evaluation and policy improvement within the described maximum entropy framework. SAC then extends this soft policy iteration to handle continuous action spaces by using parameterized function approximators to represent both the Q-function $Q _ { \theta }$ (critic) and the policy $\pi _ { \phi }$ (actor). The soft Q-function parameters $\theta$ are optimized to minimize the
|
| 42 |
+
|
| 43 |
+
soft Bellman residual,
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\begin{array} { r l } & { \quad J _ { Q } ( \theta ) = \underset { ( \mathbf { s } _ { t } , \mathbf { a } _ { t } , r _ { t } , \mathbf { s } _ { t + 1 } ) \sim \mathcal { D } } { \mathbb { E } } \left[ \frac { 1 } { 2 } \left( Q _ { \theta } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) - ( r _ { t } + \gamma V _ { \bar { \theta } } ( \mathbf { s } _ { t + 1 } ) ) \right) ^ { 2 } \right] , } \\ & { V _ { \bar { \theta } } ( \mathbf { s } _ { t + 1 } ) = \underset { \mathbf { a } _ { t + 1 } \sim \pi _ { \phi } } { \mathbb { E } } \left[ Q _ { \bar { \theta } } ( \mathbf { s } _ { t + 1 } , \mathbf { a } _ { t + 1 } ) - \alpha \log \pi _ { \phi } ( \mathbf { a } _ { t + 1 } | \mathbf { s } _ { t + 1 } ) \right] , } \end{array}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\mathcal { D }$ is the replay buffer, $\gamma$ is the discount factor, and $\bar { \theta }$ are delayed parameters. The policy parameters $\phi$ are optimized to update the policy towards the exponential of the soft Q-function,
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
J _ { \pi } ( \phi ) = \underset { \mathbf { s } _ { t } \sim \mathcal { D } } { \mathbb { E } } \left[ \underset { \mathbf { a } _ { t } \sim \pi _ { \phi } } { \mathbb { E } } \left[ \alpha \log ( \pi _ { \phi } ( \mathbf { a } _ { t } \vert \mathbf { s } _ { t } ) ) - Q _ { \theta } ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right] \right] .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Results of this stochastic, entropy maximizing RL framework demonstrate improved robustness and stability. SAC also shows the sample efficiency benefits of an off-policy learning algorithm, in conjunction with the high performance benefits of a long-horizon planning algorithm. Precisely for these reasons, we choose to extend the SAC algorithm in this work to formulate our SLAC algorithm.
|
| 56 |
+
|
| 57 |
+
3.2 SEQUENTIAL LATENT VARIABLE MODELS AND AMORTIZED VARIATIONAL INFERENCE IN POMDPS
|
| 58 |
+
|
| 59 |
+
To learn representations for RL, we use latent variable models trained with amortized variational inference. The learned model must be able to process a large number of pixels that are present in the entangled image $\mathbf { x }$ , and it must tease out the relevant information into a compact and disentangled representation $\mathbf { z }$ . To learn such a model, we can consider maximizing the probability of each observed datapoint $\mathbf { x }$ from some training set $\mathcal { D }$ under the entire generative process $\begin{array} { r } { p ( \mathbf { x } ) \stackrel { \mathbf { \theta } } { = } \int p ( \mathbf { x } | \mathbf { z } ) p ( \mathbf { z } ) \mathrm { d } \mathbf { z } } \end{array}$ . This objective is intractable to compute in general due to the marginalization of the latent variables $\mathbf { z }$ . In amortized variational inference, we utilize the following bound on the log-likelihood (Kingma $\&$ Welling, 2014),
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { E _ { \mathbf { x } \sim D } \left[ \log p ( \mathbf { x } ) \right] \geq E _ { \mathbf { x } \sim D } \left[ E _ { \mathbf { z } \sim q } \left[ \log p ( \mathbf { x } | \mathbf { z } ) \right] - \mathrm { D } _ { \mathrm { K L } } \left( q ( \mathbf { z } | \mathbf { x } ) \ \Vert \ p ( \mathbf { z } ) \right) \right] . } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
We can maximize the probability of the observed datapoints (i.e., the left hand side of Equation (5)) by learning an encoder $q ( \mathbf { z } | \mathbf { x } )$ and a decoder $p ( \mathbf { x } | \mathbf { z } )$ , and then directly performing gradient ascent on the right hand side of the equation. In this setup, the distributions of interest are the prior $p ( \mathbf { z } )$ , the observation model $p ( \mathbf { x } | \mathbf { z } )$ , and the posterior $q ( \mathbf { z } | \mathbf { x } )$ .
|
| 66 |
+
|
| 67 |
+
Although such generative models have been shown to successfully model various types of complex distributions (Kingma & Welling, 2014) by embedding knowledge of the distribution into an informative latent space, they do not have a built-in mechanism for the use of temporal information when performing inference. In the case of partially observable environments, as we discuss below, the representative latent state $\mathbf { z } _ { t }$ corresponding to a given non-Markovian observation $\mathbf { x } _ { t }$ needs to be informed by past observations.
|
| 68 |
+
|
| 69 |
+
Consider a partially observable MDP (POMDP), where an action $\mathbf { a } _ { t } \in \mathcal A$ from latent state $\mathbf { z } _ { t } \in { \mathcal { Z } }$ results in latent state $\mathbf { z } _ { t + 1 } \in \mathcal { Z }$ and emits a corresponding observation $\mathbf { x } _ { t + 1 } \in \mathcal { X }$ . We make an explicit distinction between an observation $\mathbf { x } _ { t }$ and the underlying latent state $\mathbf { z } _ { t }$ , to emphasize that the latter is unobserved and the distribution is not known a priori. Analogous to the fully observable MDP, the initial state distribution is $p ( \mathbf { z } _ { 1 } )$ , the transition probability distribution is $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , and the reward is $r _ { t }$ . In addition, the observation model is given by $\dot { p } ( { \mathbf x } _ { t } | { \mathbf z } _ { t } )$ .
|
| 70 |
+
|
| 71 |
+
As in the case for VAEs, a generative model of these observations $\mathbf { x } _ { t }$ can be learned by maximizing the log-likelihood. In the POMDP setting, however, we note that $\mathbf { x } _ { t }$ alone does not provide all necessary information to infer $\mathbf { z } _ { t }$ , and thus, prior temporal information must be taken into account. This brings us to the discussion of sequential latent variable models. The distributions of interest are the priors $p ( \mathbf { z } _ { 1 } )$ and $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , the observation model $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ , and the approximate posteriors $q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ and $q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ . The log-likehood of the observations can then be bounded, similarly to the VAE bound in Equation (5), as
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { l } { { \displaystyle \log p ( { \bf x } _ { 1 : \tau + 1 } | { \bf a } _ { 1 : \tau } ) \geq \sum _ { z _ { 1 : \tau + 1 } \sim q } \left[ \sum _ { t = 1 } ^ { \tau + 1 } \log p ( { \bf x } _ { t } | { \bf z } _ { t } ) - \mathrm { D } _ { \mathrm { K L } } \left( q ( { \bf z } _ { 1 } | { \bf x } _ { 1 } ) \parallel p ( { \bf z } _ { 1 } ) \right) \right. } \ ~ } \\ { { \displaystyle \left. - \sum _ { t = 1 } ^ { \tau } \mathrm { D } _ { \mathrm { K L } } \left( q ( { \bf z } _ { t + 1 } | { \bf x } _ { t + 1 } , { \bf z } _ { t } , { \bf a } _ { t } ) \parallel p ( { \bf z } _ { t + 1 } | { \bf z } _ { t } , { \bf a } _ { t } ) \right) \right] . } } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Prior work (Hafner et al., 2019; Buesing et al., 2018; Doerr et al., 2018b) has explored modeling such non-Markovian observation sequences, using methods such as recurrent neural networks with deterministic hidden state, as well as probabilistic state-space models. In this work, we enable the effective training of a fully stochastic sequential latent variable model, and bring it together with a maximum entropy actor-critic RL algorithm to create SLAC: a sample-efficient and highperforming RL algorithm for learning policies for complex continuous control tasks directly from high-dimensional image inputs.
|
| 78 |
+
|
| 79 |
+
# 4 JOINT MODELING AND CONTROL AS INFERENCE
|
| 80 |
+
|
| 81 |
+
Our method aims to learn maximum entropy policies from high-dimensional, non-Markovian observations in a POMDP, while also learning a model of that POMDP. The model alleviates the representation learning problem, which in turn helps with the policy learning problem. We formulate the control problem as inference in a probabilistic graphical model with latent variables, as shown in Figure 1.
|
| 82 |
+
|
| 83 |
+
For a fully observable MDP, the control problem can be embedded into a graphical model by introducing a binary random variable ${ \mathcal { O } } _ { t }$ , which indicates if time step $t$ is optimal. When its distribution is chosen to be $p ( \mathcal { O } _ { t } = 1 | \mathbf { s } _ { t } , \mathbf { a } _ { t } ) = \exp \left( r ( \mathbf { s } _ { t } , \mathbf { a } _ { t } ) \right)$ , then maximization of $p ( \mathcal { O } _ { 1 : T } )$ via approximate inference in that model yields the optimal policy for the maximum entropy objective (Levine, 2018).
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 1: Graphical model of POMDP with optimality variables for $t \geq \tau + 1$ .
|
| 87 |
+
|
| 88 |
+
In a POMDP setting, the distribution can analogously be given by $p ( \mathcal { O } _ { t } = 1 | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = \exp ( r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) )$ . Instead of maximizing the likelihood of the optimality variables alone, we jointly model the observations (including the observed rewards of the past time steps) and learn maximum entropy policies by maximizing the marginal likelihood $p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } )$ . This objective represents both the likelihood of the observed data from the past $\tau$ steps, as well as the optimality of the agent’s actions for future steps. We factorize our variational distribution into a product of recognition terms $q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ and $q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , dynamics terms $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , and policy terms $\pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } )$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } { { q ( \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } ) } \quad } & { } \\ & { = q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) \prod _ { t = 1 } ^ { \tau } q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) . } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
The variational distribution uses the dynamics for future time steps to prevent the agent from controlling the transitions and from choosing optimistic actions (Levine, 2018). The posterior over the actions represents the agent’s policy $\pi$ . Although this derivation uses a policy that is conditioned on the latent state, our algorithm, which will be described in the next section, learns a parametric policy that is directly conditioned on observations and actions. This approximation allows us to directly execute the policy without having to perform inference on the latent state at run time.
|
| 95 |
+
|
| 96 |
+
We use the posterior from Equation (7) to obtain the evidence lower bound (ELBO) of the marginal likelihood,
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \log p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } ) \geq \underset { ( \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } ) \sim q } { \mathbb { E } } \left[ \underset { t = 1 } { \overset { \tau + 1 } { \sum } } \log p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) \right. } \\ & { ~ \left. - \operatorname { D } _ { \mathrm { K L } } \left( q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) \parallel p ( \mathbf { z } _ { 1 } ) \right) - \underset { t = 1 } { \overset { \tau } { \sum } } \operatorname { D } _ { \mathrm { K L } } \left( q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \parallel p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \right) \right. } \\ & { ~ \left. ~ + \underset { t = \tau + 1 } { \overset { T } { \sum } } \left( r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) + \log p ( \mathbf { a } _ { t } ) - \log \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) \right) \right] , } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $p ( \mathbf { a } _ { t } )$ is the action prior. The full derivation of the ELBO is given in Appendix A. This derivation assumes that the reward function, which determines $p ( \mathcal { O } _ { t } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ , is known. However, in many RL problems, this is not the case. In that situation, we can simply append the reward to the observation, and learn the reward along with $p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ . This requires no modification to our method other than changing the observation space, and we use this approach in all of our experiments. We do this to learn latent representations that are more relevant to the task, but we do not use predictions from it. Instead, the RL objective uses rewards from the agent’s experience, as in model-free RL.
|
| 103 |
+
|
| 104 |
+
# 5 STOCHASTIC LATENT ACTOR CRITIC
|
| 105 |
+
|
| 106 |
+
We now describe our stochastic latent actor critic (SLAC) algorithm, which approximately maximizes the ELBO using function approximators to model the prior and posterior distributions. The ELBO objective in Equation (8) can be split into a model objective and a maximum entropy RL objective. The model objective can directly be optimized, while the maximum entropy RL objective can be solved via message passing. We can learn Q-functions for the messages, and then we can rewrite the RL objective to express it in terms of these messages. Additional details of the derivation of the SLAC objectives are given in Appendix A.
|
| 107 |
+
|
| 108 |
+
Latent Variable Model: The first part of the ELBO corresponds to training the latent variable model to maximize the likelihood of the observations, analogous to the ELBO in Equation (6) for the sequential latent variable model. The distributions of the latent variable model are diagonal Gaussian distributions, where the means and variances are outputs of neural networks. The distribution parameters $\psi$ of this model are optimized to maximize the first part of the ELBO. The model loss is
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { l } \displaystyle { J _ { M } ( \psi ) = \underset { ( \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } , r _ { 1 : \tau } ) \sim \mathcal { D } } { \mathbb { E } } [ \underset { \mathbf { z } _ { 1 : \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } [ \sum _ { t = 1 } ^ { \tau + 1 } \log p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) } \\ { \displaystyle - \mathrm { D } _ { \mathrm { K L } } ( q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) ) \| p _ { \psi } ( \mathbf { z } _ { 1 } ) ) - \sum _ { t = 1 } ^ { \tau } \mathrm { D } _ { \mathrm { K L } } ( q _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \parallel p _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) ) ] ] . } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
We use the reparameterization trick to sample from the filtering distribution $q _ { \psi } ( \mathbf { z } _ { 1 : \tau + 1 } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } )$
|
| 115 |
+
|
| 116 |
+
Critic and Actor: The second part of the ELBO corresponds to the maximum entropy RL objective. As in the fully observable case from Section 3.1 and as described by Levine (2018), this optimization can be solved via message passing of soft $\mathbf { Q }$ -values, except that we use the latent states $\mathbf { z }$ rather than the true states s. For continuous state and action spaces, this message passing is approximated by minimizing the soft Bellman residual, which we use to train our soft Q-function parameters $\theta$ ,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\begin{array} { r l } & { J _ { Q } ( \theta ) = \underset { ( \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } , r _ { \tau } ) \sim \mathcal { D } } { \mathbb { E } } \left[ \underset { \mathbf { z } _ { 1 : \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } \left[ \frac { 1 } { 2 } \left( Q _ { \theta } ( \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } ) \right. \right. \right. } \\ & { \left. \left. \left. - \left( r _ { \tau } + \gamma _ { \mathbf { a } _ { \tau + 1 } \sim \pi _ { \psi } } \mathbb { E } _ { \bar { \theta } } ( \mathbf { z } _ { \tau + 1 } , \mathbf { a } _ { \tau + 1 } ) - \alpha \log \pi _ { \phi } ( \mathbf { a } _ { \tau + 1 } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } ) \right] \right) \right) ^ { 2 } \right] , } \end{array}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $\bar { \theta }$ are delayed parameters, obtained as exponential moving averages of $\theta$ . Notice that the latents ${ \bf z } _ { \tau }$ and $\mathbf { z } _ { \tau + 1 }$ , which are used in the Bellman backup, are sampled from the same joint, i.e. $\mathbf { z } _ { \tau + 1 } \sim q _ { \psi } ( \mathbf { z } _ { \tau + 1 } | \mathbf { x } _ { \tau + 1 } , \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } )$ . The RL objective, which corresponds to the second part of the ELBO, can be rewritten in terms of the soft Q-function. The policy parameters $\phi$ are optimized to maximize this objective, analogously to soft actor-critic (Haarnoja et al., 2018a). The policy loss is then
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
J _ { \pi } ( \phi ) = \underset { ( \mathbf x _ { 1 : \tau + 1 } , \mathbf a _ { 1 : \tau } ) \sim \mathcal D } { \mathbb { E } } \left[ \underset { \mathbf z _ { 1 : \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } \left[ \underset { \mathbf a _ { \tau + 1 } \sim q _ { \psi } } { \mathbb { E } } \left[ \alpha \log \pi _ { \phi } ( \mathbf a _ { \tau + 1 } | \mathbf x _ { 1 : \tau + 1 } , \mathbf a _ { 1 : \tau } ) - Q _ { \theta } ( \mathbf z _ { \tau + 1 } , \mathbf a _ { \tau + 1 } ) \right] \right] \right] .
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
We assume a uniform action prior, so $p ( \mathbf { a } _ { t } )$ is a constant term that we omit from the policy loss. We use the reparameterization trick to sample from the policy, and the policy loss only uses the last sample $\mathbf { z } _ { \tau + 1 }$ of the sequence for the critic. Although the policy used in our derivation is conditioned in the latent state, our learned parametric policy is conditioned directly on the past observations and actions, so that the learned policy can be executed at run time without requiring inference of the latent state. Finally, we note that for the expectation over latent states in the Bellman residual in Equation (10), rather than sampling latent states $\mathbf { z } \sim \mathcal { Z }$ , we sample latent states from the filtering distribution $q _ { \psi } ( \mathbf { z } _ { 1 : \tau + 1 } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } )$ . This design choice allows us to minimize the critic loss for samples that are most relevant for $Q$ , while also allowing the critic loss to use the Q-function in the same way as implied by the policy loss in Equation (11).
|
| 129 |
+
|
| 130 |
+
SLAC is outlined in Algorithm 1. The actor-critic component follows prior work, with automatic tuning of the temperature $\alpha$ and two Q-functions to mitigate underestimation (Fujimoto et al., 2018; Haarnoja et al., 2018a;b). SLAC can be viewed as a variant of SAC (Haarnoja et al., 2018a) where the critic is trained on the stochastic latent state of our sequential latent variable model. The backup for the critic is performed on a tuple $\left( \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } , r _ { \tau } , \mathbf { z } _ { \tau + 1 } \right)$ , sampled from the posterior $q ( \mathbf { z } _ { \tau + 1 } , \mathbf { z } _ { \tau } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } )$ . The critic can, in principle, take advantage of the perfect knowledge of the state $\mathbf { z } _ { t }$ , which makes learning easier. However, the parametric policy does not have access to $\mathbf { z } _ { t }$ , and must make decisions based on a history of observations and actions. SLAC is not a model-based algorithm, in that in does not use the model for prediction, but we see in our experiments that SLAC can achieve similar sample efficiency as a model-based algorithm.
|
| 131 |
+
|
| 132 |
+
<table><tr><td colspan="2">Algorithm1StochasticLatentActor-Critic(SLAC) Require: E,γ,01,02,Φ</td></tr><tr><td>X1~Ereset() D↑(x1)</td><td>>Environment and initial parameters for model, actor, and critic > Sample initial observation from the environment >Initialize replay buffer with initial observation</td></tr><tr><td>for each iteration do</td><td></td></tr><tr><td>for each environment step do at ~ π(at|X1:t,a1:t-1)</td><td>> Sample action from the policy</td></tr><tr><td>rt,Xt+1 ~ Estep(at)</td><td>>Sample transition from the environment</td></tr><tr><td>D ← DU(at,rt,Xt+1)</td><td>> Store the transition in the replay buffer</td></tr><tr><td></td><td></td></tr><tr><td>for each gradient step do</td><td></td></tr><tr><td>←φ-λM∀JM(φ)</td><td>Update model weights</td></tr><tr><td>θ←0-入QVθJQ(0i) fori∈{1,2}</td><td>>Update the Q-function weights</td></tr><tr><td>Φ←Φ-λπ∀Jπ(Φ)</td><td>Update policy weights</td></tr><tr><td>θ←vi+(1-v)θ fori∈{1,2}</td><td>>Update target critic network weights</td></tr></table>
|
| 133 |
+
|
| 134 |
+
# 6 LATENT VARIABLE MODEL
|
| 135 |
+
|
| 136 |
+
We briefly summarize our full model architecture here, with full details in Appendix B. Motivated by the recent success of autoregressive latent variables in VAEs (Razavi et al., 2019; Maaloe et al., 2019), we factorize the latent variable $\mathbf { z } _ { t }$ into two stochastic layers, ${ \bf z } _ { t } ^ { 1 }$ and ${ \bf z } _ { t } ^ { 2 }$ , as shown in Figure 2. This factorization results in latent distributions that are more expressive, and it allows for some parts of the prior and posterior distributions to be shared. We found this design to produce high quality reconstructions and samples, and utilize it in all of our experiments. The generative model $p$ and the inference model $q$ are given by
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\begin{array} { r l } & { \quad p _ { \psi } ( { \bf z } _ { 1 } ) = p _ { \psi } ( { \bf z } _ { 1 } ^ { 2 } | { \bf z } _ { 1 } ^ { 1 } ) p ( { \bf z } _ { 1 } ^ { 1 } ) , } \\ & { \quad p _ { \psi } ( { \bf z } _ { t + 1 } | { \bf z } _ { t } , { \bf a } _ { t } ) = p _ { \psi } ( { \bf z } _ { t + 1 } ^ { 2 } | { \bf z } _ { t + 1 } ^ { 1 } , { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) p _ { \psi } ( { \bf z } _ { t + 1 } ^ { 1 } | { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) , } \\ & { \quad \quad q _ { \psi } ( { \bf z } _ { 1 } | { \bf x } _ { 1 } ) = p _ { \psi } ( { \bf z } _ { 1 } ^ { 2 } | { \bf z } _ { 1 } ^ { 1 } ) q _ { \psi } ( { \bf z } _ { 1 } ^ { 1 } | { \bf x } _ { 1 } ) , } \\ & { \quad q _ { \psi } ( { \bf z } _ { t + 1 } | { \bf x } _ { t + 1 } , { \bf z } _ { t } , { \bf a } _ { t } ) = p _ { \psi } ( { \bf z } _ { t + 1 } ^ { 2 } | { \bf z } _ { t + 1 } ^ { 1 } , { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) q _ { \psi } ( { \bf z } _ { t + 1 } ^ { 1 } | { \bf x } _ { t + 1 } , { \bf z } _ { t } ^ { 2 } , { \bf a } _ { t } ) . } \end{array}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Note that we choose the variational distribution $q$ over ${ \bf z } _ { t } ^ { 2 }$ to be the same as the model $p$ . Thus, the KL divergence in $J _ { M }$ simplifies to the divergence between $q$ and $p$ over ${ \bf z } _ { t } ^ { 1 }$ . We use a multivariate standard normal distribution for $p ( \mathbf { z } _ { 1 } ^ { 1 } )$ , since it is not conditioned on any variables, i.e. ${ \bf z } _ { 1 } ^ { 1 } \sim \mathcal { N } ( { \bf 0 } , I )$ . The conditional distributions of our model are diagonal Gaussian, with means and variances given by neural networks. Unlike models from prior work (Hafner et al., 2019; Buesing et al., 2018; Doerr et al., 2018b), which have deterministic and stochastic paths and use recurrent neural networks, ours is fully stochastic, i.e. our latent state is a Markovian latent random variable formed by the concatenation of ${ \bf z } _ { t } ^ { 1 }$ and $ { \mathbf { z } } _ { t } ^ { 2 }$ . Further details are discussed in Appendix B.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 2: Diagram of our full model. Solid arrows show the generative model, dashed arrows show the inference model. Rewards are not shown for clarity.
|
| 146 |
+
|
| 147 |
+
# 7 EXPERIMENTAL EVALUATION
|
| 148 |
+
|
| 149 |
+
We evaluate SLAC on numerous image-based continuous control tasks from both the DeepMind Control Suite (Tassa et al., 2018) and OpenAI Gym (Brockman et al., 2016), as illustrated in Figure 3. Full details of SLAC’s network architecture are described in Appendix B. Aside from the value of action repeats (i.e. control frequency) for the tasks, we kept all of SLAC’s hyperparameters constant across all tasks in all domains. Training and evaluation details are given in Appendix C, and image samples from our model for all tasks are shown in Appendix D. Additionally, visualizations of our results and code are available on the project website.2
|
| 150 |
+
|
| 151 |
+
# 7.1 COMPARATIVE EVALUATION ON CONTINUOUS CONTROL BENCHMARK TASKS
|
| 152 |
+
|
| 153 |
+
To provide a comparative evaluation against prior methods, we evaluate SLAC on four tasks (cheetah run, walker walk, ball-in-cup catch, finger spin) from the DeepMind Control Suite (Tassa et al., 2018), and four tasks (cheetah, walker, ant, hopper) from OpenAI Gym (Brockman et al., 2016). Note that the Gym tasks are typically used with low-dimensional state observations, while we evaluate on them with raw image observations. We compare our method to the following state-of-the-art model-based and model-free algorithms:
|
| 154 |
+
|
| 155 |
+
SAC (Haarnoja et al., 2018a): This is an off-policy actor-critic algorithm, which represents a comparison to state-of-the-art model-free learning. We include experiments showing the performance of SAC based on true state (as an upper bound on performance) as well as directly from raw images.
|
| 156 |
+
|
| 157 |
+
MPO (Abdolmaleki et al., 2018b;a): This is an off-policy actor-critic algorithm that performs an expectation maximization form of policy iteration, learning directly from raw images.
|
| 158 |
+
|
| 159 |
+
D4PG (Barth-Maron et al., 2018): This is also an off-policy actor-critic algorithm, learning directly from raw images. The results reported in the plots below are the performance after $1 0 ^ { 8 }$ training steps, as stated in the benchmarks from (Tassa et al., 2018).
|
| 160 |
+
|
| 161 |
+
PlaNet (Hafner et al., 2019): This is a model-based RL method for learning from images, which uses a partially stochastic sequential latent variable model, but without explicit policy learning. Instead, the model is used for planning with model predictive control (MPC), where each plan is optimized with the cross entropy method (CEM).
|
| 162 |
+
|
| 163 |
+
DVRL (Igl et al., 2018): This is an on-policy model-free RL algorithm that also trains a partially stochastic latent-variable POMDP model. DVRL uses the full belief over the latent state as input into both the actor and critic, as opposed to our method, which trains the critic with the latent state and the actor with a history of actions and observations.
|
| 164 |
+
|
| 165 |
+
Our experiments on the DeepMind Control Suite in Figure 4 show that the sample efficiency of SLAC is comparable or better than both model-based and model-free alternatives. This indicates that overcoming the representation learning bottleneck, coupled with efficient off-policy RL, provides for fast learning similar to model-based methods, while attaining final performance comparable to fully model-free techniques that learn from state. SLAC also substantially outperforms DVRL. This difference can be explained in part by the use of an efficient off-policy RL algorithm, which can better take advantage of the learned representation.
|
| 166 |
+
|
| 167 |
+
We also evaluate SLAC on continuous control benchmark tasks from OpenAI Gym in Figure 5. We notice that these tasks are much more challenging than the DeepMind Control Suite tasks, because the rewards are not as shaped and not bounded between 0 and 1, the dynamics are different, and the episodes terminate on failure (e.g., when the hopper or walker falls over). PlaNet is unable to solve the last three tasks, while for the cheetah task, it learns a suboptimal policy that involves flipping the cheetah over and pushing forward while on its back. To better understand the performance of fixed-horizon MPC on these tasks, we also evaluated with the ground truth dynamics (i.e., the true simulator), and found that even in this case, MPC did not achieve good final performance, suggesting that infinite horizon policy optimization, of the sort performed by SLAC and model-free algorithms, is important to attain good results on these tasks.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Example image observations for our continuous control benchmark tasks: DeepMind Control’s cheetah run, walker walk, ball-in-cup catch, and finger spin, and OpenAI Gym’s half cheetah, walker, hopper, and ant (left to right). Images are rendered at a resolution of $6 4 \times 6 4$ pixels.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 4: Experiments on the DeepMind Control Suite from images (unless otherwise labeled as "state"). SLAC (ours) converges to similar or better final performance than the other methods, while almost always achieving reward as high as the upper bound SAC baseline that learns from true state. Note that for these experiments, 1000 environments steps corresponds to 1 episode.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 5: Experiments on the OpenAI Gym benchmark tasks from images. SLAC (ours) converges to higher performance than both PlaNet and SAC on all four of these tasks. The number of environments steps in each episode is variable, depending on the termination.
|
| 177 |
+
|
| 178 |
+
Our experiments show that SLAC successfully learns complex continuous control benchmark tasks from raw image inputs. On the DeepMind Control Suite, SLAC exceeds the performance of PlaNet on three of the tasks, and matches its performance on the walker task. However, on the harder image-based OpenAI Gym tasks, SLAC outperforms PlaNet by a large margin. In both domains, SLAC substantially outperforms all prior model-free methods. We note that the prior methods that we tested generally performed poorly on the image-based OpenAI Gym tasks, despite considerable hyperparameter tuning.
|
| 179 |
+
|
| 180 |
+
# 7.2 EVALUATING THE LATENT VARIABLE MODEL
|
| 181 |
+
|
| 182 |
+
We next study the tradeoffs between different design choices for the latent variable model. We compare our fully stochastic model, as described in Section 6, to a standard non-sequential VAE model (Kingma & Welling, 2014), which has been used in multiple prior works for representation learning in RL (Higgins et al., 2017; Ha & Schmidhuber, 2018; Nair et al., 2018), the partially stochastic model used by PlaNet (Hafner et al., 2019), as well as three variants of our model: a simple filtering model that does not factorize the latent variable into two layers of stochastic units, a fully deterministic model that removes all stochasticity from the hidden state dynamics, and a partially stochastic model that has both deterministic and stochastic transitions, similar to the PlaNet model, but with our architecture. Both the fully deterministic and partially stochastic models use the same architecture as our fully stochastic model, including the same two-level factorization of the latent variable. In all cases, we use the RL framework of SLAC and only vary the choice of model for representation learning. As shown in the comparison in Figure 6, our fully stochastic model outperforms prior models as well as the deterministic and simple variants of our own model. The partially stochastic variant of our model matches the performance of our fully stochastic model but, contrary to the conclusions in prior work (Hafner et al., 2019; Buesing et al., 2018), the fully stochastic model performs on par, while retaining the appealing interpretation of a stochastic state space model. We hypothesize that these prior works benefit from the deterministic paths (realized as an LSTM or GRU) because they use multi-step samples from the prior. In contrast, our method uses samples from the posterior, which are conditioned on same-step observations, and thus these latent samples are less sensitive to the propagation of the latent states through time.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 6: Comparison of different design choices for the latent variable model.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 7: Example image sequence seen for the cheetah task (first row), corresponding posterior sample (reconstruction) from our model (second row), and generated prediction from the generative model (last two rows). The second to last row is conditioned on the first frame (i.e., the posterior model is used for the first time step while the prior model is used for all subsequent steps), whereas the last row is not conditioned on any ground truth images. Note that all of these sampled sequences are conditioned on the same action sequence, and that our model produces highly realistic samples, even when predicting via the generative model.
|
| 189 |
+
|
| 190 |
+
# 7.3 QUALITATIVE PREDICTIONS FROM THE LATENT VARIABLE MODEL
|
| 191 |
+
|
| 192 |
+
We show example image samples from our learned sequential latent variable model for the cheetah task in Figure 7, and we include the other tasks in Appendix D. Samples from the posterior show the images $\mathbf { x } _ { t }$ as constructed by the decoder $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ , using a sequence of latents $\mathbf { z } _ { t }$ that are encoded and sampled from the posteriors, $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ and $q _ { \psi } \big ( \mathbf { z } _ { t + 1 } \big | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } \big )$ . Samples from the prior, on the other hand, use a sequence of latents where $\mathbf { z } _ { 1 }$ is sampled from $p ( \mathbf { z } _ { 1 } )$ and all remaining latents $\mathbf { z } _ { t }$ are from the propagation of the previous latent state through the latent dynamics $p _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ . Note that these prior samples do not use any image frames as inputs, and thus they do not correspond to any ground truth sequence. We also show samples from the conditional prior, which is conditioned on the first image from the true sequence: for this, the sampling procedure is the same as the prior, except that $\mathbf { z } _ { 1 }$ is encoded and sampled from the posterior $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ , rather than being sampled from $p ( \mathbf { z } _ { 1 } )$ . We notice that the generated images samples can be sharper and more realistic by using a smaller variance for $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ when training the model, but at the expense of a representation that leads to lower returns. Finally, note that we do not actually use the samples from the prior for training.
|
| 193 |
+
|
| 194 |
+
# 8 DISCUSSION
|
| 195 |
+
|
| 196 |
+
We presented SLAC, an efficient RL algorithm for learning from high-dimensional image inputs that combines efficient off-policy model-free RL with representation learning via a sequential stochastic state space model. Through representation learning in conjunction with effective task learning in the learned latent space, our method achieves improved sample efficiency and final task performance as compared to both prior model-based and model-free RL methods.
|
| 197 |
+
|
| 198 |
+
While our current SLAC algorithm is fully model-free, in that predictions from the model are not utilized to speed up training, a natural extension of our approach would be to use the model predictions themselves to generate synthetic samples. Incorporating this additional synthetic modelbased data into a mixed model-based/model-free method could further improve sample efficiency and performance. More broadly, the use of explicit representation learning with RL has the potential to not only accelerate training time and increase the complexity of achievable tasks, but also enable reuse and transfer of our learned representation across tasks.
|
| 199 |
+
|
| 200 |
+
# REFERENCES
|
| 201 |
+
|
| 202 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Jonas Degrave, Steven Bohez, Yuval Tassa, Dan Belov, Nicolas Heess, and Martin A. Riedmiller. Relative entropy regularized policy iteration. arXiv preprint arXiv:1812.02256, 2018a.
|
| 203 |
+
|
| 204 |
+
Abbas Abdolmaleki, Jost Tobias Springenberg, Yuval Tassa, Rémi Munos, Nicolas Heess, and Martin A. Riedmiller. Maximum a posteriori policy optimisation. In International Conference on Learning Representations (ICLR), 2018b.
|
| 205 |
+
|
| 206 |
+
Evan Archer, Il Memming Park, Lars Buesing, John Cunningham, and Liam Paninski. Black box variational inference for state space models. arXiv preprint arXiv:1511.07367, 2015.
|
| 207 |
+
|
| 208 |
+
Karl J Astrom. Optimal control of markov processes with incomplete state information. Journal of mathematical analysis and applications, 1965.
|
| 209 |
+
|
| 210 |
+
Gabriel Barth-Maron, Matthew W Hoffman, David Budden, Will Dabney, Dan Horgan, Alistair Muldal, Nicolas Heess, and Timothy Lillicrap. Distributed distributional deterministic policy gradients. In International Conference on Learning Representations (ICLR), 2018.
|
| 211 |
+
|
| 212 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. OpenAI Gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 213 |
+
|
| 214 |
+
Lars Buesing, Theophane Weber, Sébastien Racanière, S. M. Ali Eslami, Danilo Jimenez Rezende, David P. Reichert, Fabio Viola, Frederic Besse, Karol Gregor, Demis Hassabis, and Daan Wierstra. Learning and querying fast generative models for reinforcement learning. arXiv preprint arXiv:1802.03006, 2018.
|
| 215 |
+
|
| 216 |
+
Kyunghyun Cho, Bart van Merriënboer, Çaglar Gülçehre, Dzmitry Bahdanau, Fethi Bougares, ˘ Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In Conference on Empirical Methods in Natural Language Processing (EMNLP), 2014.
|
| 217 |
+
|
| 218 |
+
Kurtland Chua, Roberto Calandra, Rowan McAllister, and Sergey Levine. Deep reinforcement learning in a handful of trials using probabilistic dynamics models. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 219 |
+
|
| 220 |
+
Robert Dadashi, Adrien Ali Taïga, Nicolas Le Roux, Dale Schuurmans, and Marc G Bellemare. The value function polytope in reinforcement learning. In International Conference on Machine Learning (ICML), 2019.
|
| 221 |
+
|
| 222 |
+
Marc Deisenroth and Carl E Rasmussen. PILCO: A model-based and data-efficient approach to policy search. In International Conference on Machine Learning (ICML), 2011.
|
| 223 |
+
|
| 224 |
+
Andreas Doerr, Christian Daniel, Martin Schiegg, Nguyen-Tuong Duy, Stefan Schaal, Marc Toussaint, and Trimpe Sebastian. Probabilistic recurrent state-space models. In International Conference on Machine Learning (ICML), 2018a.
|
| 225 |
+
|
| 226 |
+
Andreas Doerr, Christian Daniel, Martin Schiegg, Duy Nguyen-Tuong, Stefan Schaal, Marc Toussaint, and Sebastian Trimpe. Probabilistic recurrent state-space models. In International Conference on Machine Learning (ICML), 2018b.
|
| 227 |
+
|
| 228 |
+
Chelsea Finn and Sergey Levine. Deep visual foresight for planning robot motion. In International Conference on Robotics and Automation (ICRA), 2017.
|
| 229 |
+
|
| 230 |
+
Chelsea Finn, Xin Yu Tan, Yan Duan, Trevor Darrell, Sergey Levine, and Pieter Abbeel. Deep spatial autoencoders for visuomotor learning. In International Conference on Robotics and Automation (ICRA), 2016.
|
| 231 |
+
|
| 232 |
+
Jakob Foerster, Ioannis Alexandros Assael, Nando de Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Neural Information Processing Systems (NIPS), 2016.
|
| 233 |
+
|
| 234 |
+
Marco Fraccaro, Soren Kaae Sonderby, Ulrich Paquet, and Ole Winther. Sequential neural models with stochastic layers. In Neural Information Processing Systems (NIPS), 2016.
|
| 235 |
+
|
| 236 |
+
Marco Fraccaro, Simon Kamronn, Ulrich Paquet, and Ole Winther. A disentangled recognition and nonlinear dynamics model for unsupervised learning. In Neural Information Processing Systems (NIPS), 2017.
|
| 237 |
+
|
| 238 |
+
Scott Fujimoto, Herke Hoof, and David Meger. Addressing function approximation error in actorcritic methods. In International Conference on Machine Learning (ICML), 2018.
|
| 239 |
+
|
| 240 |
+
Carles Gelada, Saurabh Kumar, Jacob Buckman, Ofir Nachum, and Marc G Bellemare. Deepmdp: Learning continuous latent space models for representation learning. In International Conference on Machine Learning (ICML), 2019.
|
| 241 |
+
|
| 242 |
+
Karol Gregor, Danilo Jimenez Rezende, Frederic Besse, Yan Wu, Hamza Merzic, and Aaron van den Oord. Shaping belief states with generative environment models for rl. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 243 |
+
|
| 244 |
+
Shixiang Gu, Timothy Lillicrap, Ilya Sutskever, and Sergey Levine. Continuous deep q-learning with model-based acceleration. In International Conference on Machine Learning (ICML), 2016.
|
| 245 |
+
|
| 246 |
+
David Ha and Jürgen Schmidhuber. World models. arXiv preprint arXiv:1803.10122, 2018.
|
| 247 |
+
|
| 248 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. In International Conference on Machine Learning (ICML), 2018a.
|
| 249 |
+
|
| 250 |
+
Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, and Sergey Levine. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018b.
|
| 251 |
+
|
| 252 |
+
Danijar Hafner, Timothy Lillicrap, Ian Fischer, Ruben Villegas, David Ha, Honglak Lee, and James Davidson. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning (ICML), 2019.
|
| 253 |
+
|
| 254 |
+
Matthew Hausknecht and Peter Stone. Deep recurrent Q-learning for partially observable MDPs. In AAAI Fall Symposium on Sequential Decision Making for Intelligent Agents, 2015.
|
| 255 |
+
|
| 256 |
+
Irina Higgins, Arka Pal, Andrei Rusu, Loic Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. DARLA: Improving zero-shot transfer in reinforcement learning. In International Conference on Machine Learning (ICML), 2017.
|
| 257 |
+
|
| 258 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 1997.
|
| 259 |
+
|
| 260 |
+
Maximilian Igl, Luisa Zintgraf, Tuan Anh Le, Frank Wood, and Shimon Whiteson. Deep variational reinforcement learning for POMDPs. In International Conference on Machine Learning (ICML), 2018.
|
| 261 |
+
|
| 262 |
+
Max Jaderberg, Volodymyr Mnih, Wojciech Marian Czarnecki, Tom Schaul, Joel Z Leibo, David Silver, and Koray Kavukcuoglu. Reinforcement learning with unsupervised auxiliary tasks. In International Conference on Learning Representations (ICLR), 2017.
|
| 263 |
+
|
| 264 |
+
Leslie Pack Kaelbling, Michael L Littman, and Anthony R Cassandra. Planning and acting in partially observable stochastic domains. Artificial intelligence, 101(1-2):99–134, 1998.
|
| 265 |
+
|
| 266 |
+
Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick van der Smagt. Deep variational bayes filters: Unsupervised learning of state space models from raw data. In International Conference on Learning Representations (ICLR), 2016.
|
| 267 |
+
|
| 268 |
+
Maximilian Karl, Maximilian Soelch, Justin Bayer, and Patrick van der Smagt. Deep variational bayes filters: Unsupervised learning of state space models from raw data. In International Conference on Learning Representations (ICLR), 2017.
|
| 269 |
+
|
| 270 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations (ICLR), 2015.
|
| 271 |
+
|
| 272 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In International Conference on Learning Representations (ICLR), 2014.
|
| 273 |
+
|
| 274 |
+
Rahul G. Krishnan, Uri Shalit, and David Sontag. Deep kalman filters. arXiv preprint arXiv:1511.05121, 2015.
|
| 275 |
+
|
| 276 |
+
Sascha Lange and Martin Riedmiller. Deep auto-encoder neural networks in reinforcement learning. In International Joint Conference on Neural Networks (IJCNN), 2010.
|
| 277 |
+
|
| 278 |
+
Sergey Levine. Reinforcement learning and control as probabilistic inference: Tutorial and review. arXiv preprint arXiv:1805.00909, 2018.
|
| 279 |
+
|
| 280 |
+
Lars Maaloe, Marco Fraccaro, Valentin Liévin, and Ole Winther. Biva: A very deep hierarchy of latent variables for generative modeling. In Neural Information Processing Systems (NeurIPS), 2019.
|
| 281 |
+
|
| 282 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin A. Riedmiller. Playing Atari with deep reinforcement learning. In NIPS Deep Learning Workshop, 2013.
|
| 283 |
+
|
| 284 |
+
Anusha Nagabandi, Gregory Kahn, Ronald S Fearing, and Sergey Levine. Neural network dynamics for model-based deep reinforcement learning with model-free fine-tuning. In International Conference on Robotics and Automation (ICRA), 2018.
|
| 285 |
+
|
| 286 |
+
Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Neural Information Processing Systems (NeurIPS), 2018.
|
| 287 |
+
|
| 288 |
+
Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 289 |
+
|
| 290 |
+
Ali Razavi, Aaron van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. 2019.
|
| 291 |
+
|
| 292 |
+
Evan Shelhamer, Parsa Mahmoudieh, Max Argus, and Trevor Darrell. Loss is its own reward: Self-supervision for reinforcement learning. arXiv preprint arXiv:1612.07307, 2016.
|
| 293 |
+
|
| 294 |
+
Richard S Sutton. Dyna, an integrated architecture for learning, planning, and reacting. ACM SIGART Bulletin, 2(4):160–163, 1991.
|
| 295 |
+
|
| 296 |
+
Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, Timothy Lillicrap, and Martin Riedmiller. DeepMind control suite. arXiv preprint arXiv:1801.00690, 2018.
|
| 297 |
+
|
| 298 |
+
Niklas Wahlström, Thomas B Schön, and Marc Peter Deisenroth. From pixels to torques: Policy learning with deep dynamical models. arXiv preprint arXiv:1502.02251, 2015.
|
| 299 |
+
|
| 300 |
+
Manuel Watter, Jost Springenberg, Joschka Boedecker, and Martin Riedmiller. Embed to control: A locally linear latent dynamics model for control from raw images. In Neural Information Processing Systems (NIPS), 2015.
|
| 301 |
+
|
| 302 |
+
Marvin Zhang, Sharad Vikram, Laura Smith, Pieter Abbeel, Matthew J Johnson, and Sergey Levine. SOLAR: Deep structured latent representations for model-based reinforcement learning. In International Conference on Machine Learning (ICML), 2019.
|
| 303 |
+
|
| 304 |
+
Pengfei Zhu, Xin Li, Pascal Poupart, and Guanghui Miao. On improving deep reinforcement learning for POMDPs. arXiv preprint arXiv:1804.06309, 2018.
|
| 305 |
+
|
| 306 |
+
Brian D Ziebart. Modeling purposeful adaptive behavior with the principle of maximum causal entropy. 2010.
|
| 307 |
+
|
| 308 |
+
# A DERIVATION OF THE EVIDENCE LOWER BOUND AND SLAC OBJECTIVES
|
| 309 |
+
|
| 310 |
+
In this appendix, we discuss how the SLAC objectives can be derived from applying a variational inference scheme to the control as inference framework for reinforcement learning (Levine, 2018) . In this framework, the problem of finding the optimal policy is cast as an inference problem, conditioned on the evidence that the agent is behaving optimally. While Levine (2018) derives this in the fully observed case, we present a derivation in the POMDP setting.
|
| 311 |
+
|
| 312 |
+
We aim to maximize the marginal likelihood $p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } )$ , where $\tau$ is the number of steps that the agent has already taken. This likelihood reflects that the agent cannot modify the past $\tau$ actions and they might have not been optimal, but it can choose the future actions up to the end of the episode, such that the chosen future actions are optimal. Notice that unlike the standard control as inference framework, in this work we not only maximize the likelihood of the optimality variables but also the likelihood of the observations, which provides additional supervision for the latent representation. This does not come up in the MDP setting since the state representation is fixed and learning a dynamics model of the state would not change the model-free equations derived from the maximum entropy RL objective.
|
| 313 |
+
|
| 314 |
+
For reference, we restate the factorization of our variational distribution:
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
\begin{array} { r l } { q ( \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | \mathbf { x } _ { 1 : \tau + 1 } , \mathbf { a } _ { 1 : \tau } ) } & { } \\ { = q ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } ) \displaystyle \prod _ { t = 1 } ^ { \tau } q ( \mathbf { z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) . } \end{array}
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
As discussed by Levine (2018), the agent does not have control over the stochastic dynamics, so we use the dynamics $p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ for $t \geq \tau + 1$ in the variational distribution in order to prevent the agent from choosing optimistic actions.
|
| 321 |
+
|
| 322 |
+
The joint likelihood is
|
| 323 |
+
|
| 324 |
+
$$
|
| 325 |
+
\begin{array} { r l } & { p ( \mathbf { x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } , \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | \mathbf { a } _ { 1 : \tau } ) } \\ & { \qquad \quad \quad \quad \quad \tau - 1 } \\ & { \qquad = p ( \mathbf { z } _ { 1 } ) \displaystyle \prod _ { t = 1 } ^ { T - 1 } p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = 1 } ^ { \tau + 1 } p ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } p ( \mathcal { O } _ { t } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) \prod _ { t = \tau + 1 } ^ { T } p ( \mathbf { a } _ { t } ) . } \end{array}
|
| 326 |
+
$$
|
| 327 |
+
|
| 328 |
+
We use the posterior from Equation (12) and Jensen’s inequality to obtain the ELBO of the marginal likelihood,
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { r l } & { \log p ( { \mathbf x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } ) \mathbf { a } _ { 1 : \tau } ) } \\ & { \qquad = \log \displaystyle \int _ { z _ { 1 : T } \mathbf { a } _ { \star + 1 : T } } \int _ { \mathbf { \alpha } } p ( { \mathbf x } _ { 1 : \tau + 1 } , \mathcal { O } _ { \tau + 1 : T } , \mathbf { z } _ { 1 : T } , \mathbf { a } _ { \tau + 1 : T } | { \mathbf a } _ { 1 : \tau } ) \mathrm { d } \mathbf { z } _ { 1 : T } \mathrm { d } { \mathbf a } _ { \tau + 1 : T } } \\ & { \qquad \quad \stackrel { \mathrm { \scriptsize ~ \sum ~ } } { \geq } \displaystyle _ { ( \mathbf { \alpha } _ { 1 : T } , \mathbf { a } _ { \star + 1 : T } ) \times \tau } [ \displaystyle \sum _ { \ell = 1 } ^ { r + 1 } \log p ( { \mathbf x } _ { \ell } | \mathbf { z } _ { \ell } ) } \\ & { \qquad \quad - \mathrm { \textstyle ~ D e L } ( q ( { \mathbf z } _ { 1 } | \mathbf { x } _ { 1 } ) | | p ( { \mathbf z } _ { 1 } ) ) - \displaystyle \sum _ { \ell = 1 } ^ { T } \mathrm { D } _ { \mathrm { K L } } ( q ( { \mathbf z } _ { t + 1 } | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) | | p ( { \mathbf z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } ) ) } \\ & { \qquad \quad + \displaystyle \sum _ { \ell = r + 1 } ^ { T } ( r ( { \mathbf z } _ { t } , \mathbf { a } _ { t } ) + \log p ( { \mathbf a } _ { t } ) - \log \pi ( { \mathbf a } _ { t } | \mathbf { z } _ { t } ) ) ] . } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Notice that the dynamics terms $\log p ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ for $t \geq \tau + 1$ from the posterior and the prior cancel each other out in the ELBO.
|
| 335 |
+
|
| 336 |
+
The first part of the ELBO corresponds to the model objective. When using the parametric function approximators, the negative of it corresponds directly to the model loss in Equation (9).
|
| 337 |
+
|
| 338 |
+
The second part of the ELBO corresponds to the maximum entropy RL objective. We assume a uniform action prior, so the $\log p ( \mathbf { a } _ { t } )$ term is a constant term that can be omitted when optimizing
|
| 339 |
+
|
| 340 |
+
this objective. We use message passing to optimize this objective, with messages defined as
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r l } & { Q ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) + \underset { \mathbf { z } _ { t + 1 } \sim q ( \cdot | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) } { \mathbb { E } } \left[ V ( \mathbf { z } _ { t + 1 } ) \right] } \\ & { ~ V ( \mathbf { z } _ { t } ) = \log \int \exp ( Q ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) ) \mathrm { d } \mathbf { a } _ { t } . } \\ & { ~ \mathbf { a } _ { t } } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
Then, the maximum entropy RL objective can be expressed in terms of the messages as
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
\begin{array} { r l } & { \displaystyle \mathop { \mathbb { E } } _ { ( \mathbf { z } _ { \tau + 1 : T } , \mathbf { a } _ { \tau + 1 : T } ) \sim q } [ \displaystyle \sum _ { t = \tau + 1 } ^ { T } ( r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) - \log \pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) ) ] } \\ & { \displaystyle = \mathop { \mathbb { E } } _ { \mathbf { z } _ { \tau + 1 } \sim q ( \cdot | \mathbf { x } _ { \tau + 1 } , \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } ) } [ \mathbf { a } _ { \tau + 1 \sim \pi ( \cdot | \mathbf { z } _ { \tau + 1 } ) } [ Q ( \mathbf { z } _ { \tau + 1 } , \mathbf { a } _ { \tau + 1 } ) - \log \pi ( \mathbf { a } _ { \tau + 1 } | \mathbf { z } _ { \tau + 1 } ) ] ] } \\ & { \displaystyle = \mathop { \mathbb { E } } _ { \mathbf { z } _ { \tau + 1 } \sim q ( \cdot | \mathbf { x } _ { \tau + 1 } , \mathbf { z } _ { \tau } , \mathbf { a } _ { \tau } ) } [ - \mathrm { D } _ { \mathrm { K L } } ( \pi ( \mathbf { a } _ { \tau + 1 } | \mathbf { z } _ { \tau + 1 } ) \displaystyle \frac { \exp ( Q ( \mathbf { z } _ { \tau + 1 } , \mathbf { a } _ { \tau + 1 } ) ) } { \exp ( V ( \mathbf { z } _ { \tau + 1 } ) ) } ) + V ( \mathbf { z } _ { \tau + 1 } ) ] , } \end{array}
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
where the first equality is obtained from dynamic programming (see Levine (2018) for details), the second equality holds from the definition of KL divergence, and $\exp \left( V ( \mathbf { z } _ { t } ) \right)$ is the normalization factor for $\exp { ( Q ( { \bf z } _ { t } , { \bf a } _ { t } ) ) }$ with respect to $\mathbf { a } _ { t }$ . Since the KL divergence term is minimized when its two arguments represent the same distribution, the optimal policy is given by
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\pi ( \mathbf { a } _ { t } | \mathbf { z } _ { t } ) = \exp { ( Q ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) - V ( \mathbf { z } _ { t } ) ) } .
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Noting that the KL divergence term is zero for the optimal action, the equality from Equation (18) can be used in Equation (15) to obtain
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\mathcal { Q } ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) = r ( \mathbf { z } _ { t } , \mathbf { a } _ { t } ) + \mathop { \mathbb { E } } _ { \substack { \mathbf { z } _ { t + 1 } \sim \mathbf { q } ( \cdot | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } ) } } \left[ \mathop { \mathbb { E } } _ { \mathbf { a } _ { \tau + 1 } \sim \pi \left( \cdot | \mathbf { z } _ { \tau + 1 } \right) } \left[ Q ( \mathbf { z } _ { t + 1 } , \mathbf { a } _ { t + 1 } ) - \log \pi ( \mathbf { a } _ { t + 1 } | \mathbf { z } _ { t + 1 } ) \right] \right] .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
This equation corresponds to the standard Bellman backup with a soft maximization for the value function.
|
| 365 |
+
|
| 366 |
+
As mentioned in Section 5, our algorithm conditions the parametric policy in the history of observations and actions, which allows us to directly execute the policy without having to perform inference on the latent state at run time. When using the parametric function approximators, the negative of the maximum entropy RL objective, written as in Equation (17), corresponds to the policy loss in Equation (11). Lastly, the Bellman backup of Equation (20) corresponds to the Bellman residual in Equation (10) when approximated by a regression objective.
|
| 367 |
+
|
| 368 |
+
We showed that the SLAC objectives can be derived from applying variational inference in the control as inference framework in the POMDP setting. This leads to the joint likelihood of the past observations and future optimality variables, which we aim to optimize by maximizing the ELBO of the log-likelihood. We decompose the ELBO into the model objective and the maximum entropy RL objective. We express the latter in terms of messages of Q-functions, which in turn are learned by minimizing the Bellman residual. These objectives lead to the model, policy, and critic losses.
|
| 369 |
+
|
| 370 |
+
# B NETWORK ARCHITECTURES
|
| 371 |
+
|
| 372 |
+
Recall that our full sequential latent variable model has two layers of latent variables, which we denote ${ \bf z } _ { t } ^ { 1 }$ and ${ \bf z } _ { t } ^ { 2 }$ . We found this design to provide a good balance between ease of training and expressivity, producing good reconstructions and generations and, crucially, providing good representations for reinforcement learning. For reference, we reproduce the model diagram from the main paper in Figure 8. Note that this diagram represents the Bayes net corresponding to our full model. However, since all of the latent variables are stochastic, this visualization also presents the design of the computation graph. Inference over the latent variables is performed using amortized variational inference, with all training done via reparameterization. Hence, the computation graph can be deduced from the diagram by treating all solid arrows as part of the generative model and all dashed arrows as part of approximate posterior. The generative model consists of the following probability distributions, as described in the main paper:
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
Figure 8: Diagram of our full model, reproduced from the main paper. Solid arrows show the generative model, dashed arrows show the inference model. Rewards are not shown for clarity.
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r l } & { \mathbf { z } _ { 1 } ^ { 1 } \sim p ( \mathbf { z } _ { 1 } ^ { 1 } ) } \\ & { \quad \mathbf { z } _ { 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { 1 } ^ { 2 } | \mathbf { z } _ { 1 } ^ { 1 } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 1 } \sim p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 1 } | \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 2 } | \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) } \\ & { \quad \mathbf { x } _ { t } \sim p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } ) } \\ & { \quad \quad r _ { t } \sim p _ { \psi } ( r _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } , \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t + 1 } ^ { 2 } ) . } \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
The initial distribution $p ( \mathbf { z } _ { 1 } ^ { 1 } )$ is a multivariate standard normal distribution $\mathcal { N } ( \mathbf { 0 } , \pmb { I } )$ . All of the other distributions are conditional and parameterized by neural networks with parameters $\psi$ . The networks for $p _ { \psi } ( \mathbf { z } _ { 1 } ^ { 2 } | \mathbf { z } _ { 1 } ^ { 1 } )$ , $p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 1 } | \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } )$ , $\dot { p } _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 2 } | \mathbf { z } _ { t + 1 } ^ { 1 } , \dot { \mathbf { z } } _ { t } ^ { 2 } , \mathbf { a } _ { t } )$ , and $p _ { \psi } ( r _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { \hat { z } } _ { t } ^ { 2 } , \mathbf { a } _ { t } , \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t + 1 } ^ { 2 } )$ consist of two fully connected layers, each with 256 hidden units, and a Gaussian output layer. The Gaussian layer is defined such that it outputs a multivariate normal distribution with diagonal variance, where the mean is the output of a linear layer and the diagonal standard deviation is the output of a fully connected layer with softplus non-linearity. The observation model $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } )$ consists of 5 transposed convolutional layers $( 2 5 6 ~ 4 \times 4 , ~ 1 2 8 ~ 3 \times 3 , 6 4 ~ 3 \times 3 , 3 2 ~ 3 \times 3$ , and $3 \ 5 \times 5$ filters, respectively, stride 2 each, except for the first layer). The output variance for each image pixel is fixed to 0.1.
|
| 382 |
+
|
| 383 |
+
The variational distribution $q$ , also referred to as the inference model or the posterior, is represented by the following factorization:
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\begin{array} { r l } & { \mathbf { z } _ { 1 } ^ { 1 } \sim q _ { \psi } ( \mathbf { z } _ { 1 } ^ { 1 } \vert \mathbf { x } _ { 1 } ) } \\ & { \mathbf { z } _ { 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { 1 } ^ { 2 } \vert \mathbf { z } _ { 1 } ^ { 1 } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 1 } \sim q _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 1 } \vert \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) } \\ & { \mathbf { z } _ { t + 1 } ^ { 2 } \sim p _ { \psi } ( \mathbf { z } _ { t + 1 } ^ { 2 } \vert \mathbf { z } _ { t + 1 } ^ { 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } ) . } \end{array}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
Note that the variational distribution over $\mathbf { z } _ { 1 } ^ { 2 }$ and $\mathbf { z } _ { t + 1 } ^ { 2 }$ is intentionally chosen to exactly match the generative model $p$ , such that this term does not appear in the KL-divergence within the ELBO, and a separate variational distribution is only learned over $\mathbf { z } _ { 1 } ^ { 1 }$ and $\mathbf { z } _ { t + 1 } ^ { 1 }$ . This intentional design decision simplifies the inference process. The networks representing the distributions $q _ { \psi } ( \mathbf { z } _ { 1 } ^ { 1 } | \mathbf { x } _ { 1 } )$ and $q _ { \psi } \big ( \mathbf { z } _ { t + 1 } ^ { 1 } \big | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } ^ { 2 } , \mathbf { a } _ { t } \big )$ both consist of 5 convolutional layers $3 2 5 \times 5$ , $6 4 3 \times 3$ , $1 2 8 3 \times 3$ , $2 5 6 3 \times 3$ , and $2 5 6 4 \times 4$ filters, respectively, stride 2 each, except for the last layer), 2 fully connected layers (256 units each), and a Gaussian output layer. The parameters of the convolution layers are shared among both distributions.
|
| 390 |
+
|
| 391 |
+
The latent variables have 32 and 256 dimensions, respectively, i.e. $\mathbf { z } _ { t } ^ { 1 } \in \mathbb { R } ^ { 3 2 }$ and $\mathbf { z } _ { t } ^ { 2 } \in \mathbb { R } ^ { 2 5 6 }$ . For the image observations, $\mathbf { x } _ { t } \in [ 0 , 1 ] ^ { 6 4 \times 6 4 \times 3 }$ . All the layers, except for the output layers, use leaky ReLU non-linearities. Note that there are no deterministic recurrent connections in the network—all networks are feedforward, and the temporal dependencies all flow through the stochastic units ${ \bf z } _ { t } ^ { 1 }$ and ${ \bf z } _ { t } ^ { 2 }$
|
| 392 |
+
|
| 393 |
+
For the reinforcement learning process, we use a critic network $Q _ { \theta }$ consisting of 2 fully connected layers (256 units each) and a linear output layer. The actor network $\pi _ { \phi }$ consists of 5 convolutional layers, 2 fully connected layers (256 units each), a Gaussian layer, and a tanh bijector, which constrains the actions to be in the bounded action space of $[ - 1 , 1 ]$ . The convolutional layers are the same as the ones from the latent variable model, but the parameters of these layers are not updated by the actor objective. The same exact network architecture is used for every one of the experiments in the paper.
|
| 394 |
+
|
| 395 |
+
Table 1: Action repeats and the corresponding agent’s control time step used in our experiments.
|
| 396 |
+
|
| 397 |
+
<table><tr><td>Benchmark</td><td>Task</td><td>Action repeat</td><td>Original control time step</td><td>Effective control time step</td></tr><tr><td rowspan="4">DeepMind Control Suite</td><td>cheetah run</td><td>4</td><td>0.01</td><td>0.04</td></tr><tr><td>walker walk</td><td>2</td><td>0.025</td><td>0.05</td></tr><tr><td>ball-in-cup catch</td><td>4</td><td>0.02</td><td>0.08</td></tr><tr><td>finger spin</td><td>2</td><td>0.02</td><td>0.04</td></tr><tr><td rowspan="4">OpenAI Gym</td><td>HalfCheetah-v2</td><td>1</td><td>0.05</td><td>0.05</td></tr><tr><td>Walker2d-v2</td><td>4</td><td>0.008</td><td>0.032</td></tr><tr><td>Hopper-v2</td><td>2</td><td>0.008</td><td>0.016</td></tr><tr><td>Ant-v2</td><td>4</td><td>0.05</td><td>0.2</td></tr></table>
|
| 398 |
+
|
| 399 |
+
# C TRAINING AND EVALUATION DETAILS
|
| 400 |
+
|
| 401 |
+
The control portion of our algorithm uses the same hyperparameters as SAC (Haarnoja et al., 2018a), except for a smaller replay buffer size of 100000 environment steps (instead of a million) due to the high memory usage of image observations. All of the parameters are trained with the Adam optimizer (Kingma & Ba, 2015), and we perform one gradient step per environment step. The Q-function and policy parameters are trained with a learning rate of 0.0003 and a batch size of 256. The model parameters are trained with a learning rate of 0.0001 and a batch size of 32. We use sequences of length $\tau = 8$ for all the tasks. Note that the sequence length can be less than $\tau$ for the first $t$ steps $( t < \tau$ ) of each episode.
|
| 402 |
+
|
| 403 |
+
We use action repeats for all the methods, except for D4PG for which we use the reported results from prior work (Tassa et al., 2018). The number of environment steps reported in our plots correspond to the unmodified steps of the benchmarks. Note that the methods that use action repeats only use a fraction of the environment steps reported in our plots. For example, 3 million environment steps of the cheetah task correspond to 750000 samples when using an action repeat of 4. The action repeats used in our experiments are given in Table 1.
|
| 404 |
+
|
| 405 |
+
Unlike in prior work (Haarnoja et al., 2018a;b), we use the same stochastic policy as both the behavioral and evaluation policy since we found the deterministic greedy policy to be comparable or worse than the stochastic policy.
|
| 406 |
+
|
| 407 |
+
# D ADDITIONAL PREDICTIONS FROM THE LATENT VARIABLE MODEL
|
| 408 |
+
|
| 409 |
+
We show additional samples from our model in Figure 9 and Figure 10. Samples from the posterior show the images $\mathbf { x } _ { t }$ as constructed by the decoder $p _ { \psi } ( \mathbf { x } _ { t } | \mathbf { z } _ { t } )$ , using a sequence of latents $\mathbf { z } _ { t }$ that are encoded and sampled from the posteriors, $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { \dot { x } } _ { 1 } )$ and $q _ { \psi } \big ( \mathbf { z } _ { t + 1 } \big | \mathbf { x } _ { t + 1 } , \mathbf { z } _ { t } , \mathbf { a } _ { t } \big )$ . Samples from the prior, on the other hand, use a sequence of latents where $\mathbf { z } _ { 1 }$ is sampled from $p ( \mathbf { z } _ { 1 } )$ and all remaining latents $\mathbf { z } _ { t }$ are from the propagation of the previous latent state through the latent dynamics $p _ { \psi } ( \mathbf { z } _ { t + 1 } | \mathbf { z } _ { t } , \mathbf { a } _ { t } )$ . These samples do not use any image frames as inputs, and thus they do not correspond to any ground truth sequence. We also show samples from the conditional prior, which is conditioned on the first image from the true sequence: for this, the sampling procedure is the same as the prior, except that $\mathbf { z } _ { 1 }$ is encoded and sampled from the posterior $q _ { \psi } ( \mathbf { z } _ { 1 } | \mathbf { x } _ { 1 } )$ , rather than being sampled from $p ( \mathbf { z } _ { 1 } )$ .
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 9: Example image sequences, along with generated image samples, for three of the DM Control tasks that we used in our experiments. See Figure 7 for more details and for image samples from the cheetah task.
|
| 413 |
+
|
| 414 |
+

|
| 415 |
+
Figure 10: Example image sequences, along with generated image samples, for the four OpenAI Gym tasks that we used in our experiments.
|
parse/train/HJxDugSFDB/HJxDugSFDB_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/HJxDugSFDB/HJxDugSFDB_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/HJxDugSFDB/HJxDugSFDB_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/JbuYF437WB6/JbuYF437WB6.md
ADDED
|
@@ -0,0 +1,366 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIRECTED ACYCLIC GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Veronika Thost & Jie Chen∗
|
| 4 |
+
MIT-IBM Watson AI Lab, IBM Research
|
| 5 |
+
Veronika.Thost@ibm.com, chenjie@us.ibm.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Graph-structured data ubiquitously appears in science and engineering. Graph neural networks (GNNs) are designed to exploit the relational inductive bias exhibited in graphs; they have been shown to outperform other forms of neural networks in scenarios where structure information supplements node features. The most common GNN architecture aggregates information from neighborhoods based on message passing. Its generality has made it broadly applicable. In this paper, we focus on a special, yet widely used, type of graphs—DAGs—and inject a stronger inductive bias—partial ordering—into the neural network design. We propose the directed acyclic graph neural network, DAGNN, an architecture that processes information according to the flow defined by the partial order. DAGNN can be considered a framework that entails earlier works as special cases (e.g., models for trees and models updating node representations recurrently), but we identify several crucial components that prior architectures lack. We perform comprehensive experiments, including ablation studies, on representative DAG datasets (i.e., source code, neural architectures, and probabilistic graphical models) and demonstrate the superiority of DAGNN over simpler DAG architectures as well as general graph architectures.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Graph-structured data is ubiquitous across various disciplines (Gilmer et al., 2017; Zitnik et al., 2018; Sanchez-Gonzalez et al., 2020). Graph neural networks (GNNs) use both the graph structure and node features to produce a vectorial representation, which can be used for classification, regression (Hu et al., 2020), and graph decoding (Li et al., 2018; Zhang et al., 2019). Most popular GNNs update node representations through iterative message passing between neighboring nodes, followed by pooling (either flat or hierarchical (Lee et al., 2019; Ranjan et al., 2020)), to produce a graph representation (Li et al., 2016; Kipf & Welling, 2017; Gilmer et al., 2017; Velickovi ˇ c et al., ´ 2018; Xu et al., 2019). The relational inductive bias (Santoro et al., 2017; Battaglia et al., 2018; Xu et al., 2020)—neighborhood aggregation—empowers GNNs to outperform graph-agnostic neural networks. To facilitate subsequent discussions, we formalize a message-passing neural network (MPNN) architecture, which computes representations $h _ { v } ^ { \ell }$ for all nodes $v$ in a graph $\mathcal { G }$ in every layer $\ell$ and a final graph representation $h _ { \mathcal { G } }$ , as (Gilmer et al., 2017):
|
| 14 |
+
|
| 15 |
+
$$
|
| 16 |
+
\begin{array} { r l } & { h _ { v } ^ { \ell } = \mathrm { C O M B I N E } ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , \mathrm { A G G R E G A T E } ^ { \ell } \big ( \underbrace { \{ h _ { u } ^ { \ell - 1 } \mid u \in \mathcal { N } ( v ) \} } _ { \ell } \big ) \Big ) , \quad \ell = 1 , \dots , L , } \\ & { h _ { \mathcal { G } } = \mathrm { R E A D O U T } \Big ( \{ h _ { v } ^ { L } , v \in \mathcal { V } \} \Big ) , } \end{array}
|
| 17 |
+
$$
|
| 18 |
+
|
| 19 |
+
where $h _ { v } ^ { 0 }$ is the input feature of $v$ , $\mathcal { N } ( v )$ denotes a neighborhood of node $v$ (sometimes including $v$ itself), $\nu$ denotes the node set of $\mathcal { G }$ , $L$ is the number of layers, and AGGREGAT $\mathrm { E } ^ { \ell }$ , COMBINE\`, and READOUT are parameterized neural networks. For notational simplicity, we omit edge attributes; but they can be straightforwardly incorporated into the framework (1)–(2).
|
| 20 |
+
|
| 21 |
+
Directed acyclic graphs (DAGs) are a special type of graphs, yet broadly seen across domains. Examples include parsing results of source code (Allamanis et al., 2018), logical formulas (Crouse et al., 2019), and natural language sentences, as well as probabilistic graphical models (Zhang et al., 2019), neural architectures (Zhang et al., 2019), and automated planning problems (Ma et al., 2020).
|
| 22 |
+
|
| 23 |
+
A directed graph is a DAG if and only if the edges define a partial ordering over the nodes. The partial order is an additionally strong inductive bias one naturally desires to incorporate into the neural network. For example, a neural architecture seen as a DAG defines the acyclic dependency of computation, an important piece of information when comparing architectures and predicting their performance. Hence, this information should be incorporated into the architecture representation for higher predictive power.
|
| 24 |
+
|
| 25 |
+
In this work, we propose DAGNNs—directed acyclic graph neural networks—that produce a representation for a DAG driven by the partial order. In particular, the order allows for updating node representations based on those of all their predecessors sequentially, such that nodes without successors digest the information of the entire graph. Such a processing manner substantially differs from that of MPNNs where the information landed on a node is limited by a multi-hop local neighborhood and thus restricted by the depth $L$ of the network.
|
| 26 |
+
|
| 27 |
+
Modulo details to be elaborated in sections that follow, the DAGNN framework reads
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\begin{array} { r l } & { h _ { v } ^ { \ell } = F ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , G ^ { \ell } \big ( \underbrace { \{ h _ { u } ^ { \ell } \mid u \in \mathcal { P } ( v ) \} , h _ { v } ^ { \ell - 1 } } _ { h \mathcal { G } } \big ) \Big ) , \quad \ell = 1 , \dots , L , } \\ & { h _ { \mathcal { G } } = R \Big ( \{ h _ { v } ^ { \ell } , \ell = 0 , 1 , \dots , L , v \in \mathcal { T } \} \Big ) , } \end{array}
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $\mathcal { P } ( v )$ denotes the set of direct predecessors of $v , \tau$ denotes the set of nodes without (direct) successors, and $G ^ { \ell } , F ^ { \ell }$ , and $R$ are parameterized neural networks that play similar roles to AGGREGAT $\mathrm { E } ^ { \ell }$ , $\mathrm { C O M B I N E } ^ { \ell }$ , and READOUT, respectively.
|
| 34 |
+
|
| 35 |
+
A notable difference between (3)–(4) and (1)–(2) is that the superscript $\ell - 1$ inside the underlined part of (1) is advanced to $\ell$ in the counterpart in (3). In other words, MPNN aggregates neighborhood information from the past layer, whereas DAGNN uses the information in the current layer. An advantage is that DAGNN always uses more recent information to update node representations.
|
| 36 |
+
|
| 37 |
+
Equations (3)–(4) outline several other subtle but important differences between DAGNN and MPNNs, such as the use of only direct predecessors for aggregation and the pooling on only nodes without successors. All these differences are unique to the special structure a DAG enjoys. Exploiting this structure properly should yield a more favorable vectorial representation of the graph. In Section 2, we will elaborate the specifics of (3)–(4). The technical details include (i) attention for node aggregation, (ii) multiple layers for expressivity, and (iii) topological batching for efficient implementation, all of which yield an instantiation of the DAGNN framework that is state of the art.
|
| 38 |
+
|
| 39 |
+
For theoretical contributions, we study topological batching and justify that this technique yields maximal parallel concurrency in processing DAGs. Furthermore, we show that the mapping defined by DAGNN is invariant to node permutation and injective under mild assumptions. This result reassures that the graph representation extracted by DAGNN is discriminative.
|
| 40 |
+
|
| 41 |
+
Because DAGs appear in many different fields, neural architectures for DAGs (including, notably, D-VAE (Zhang et al., 2019)) or special cases (e.g., trees) are scattered around the literature over the years. Generally, they are less explored compared to MPNNs; and some are rather applicationspecific. In Section 3, we unify several representative architectures as special cases of the framework (3)–(4). We compare the proposed architecture to them and point out the differences that lead to its superior performance.
|
| 42 |
+
|
| 43 |
+
In Section 4, we detail our comprehensive, empirical evaluation on datasets from three domains: (i) source code parsed to DAGs (Hu et al., 2020); (ii) neural architecture search (Zhang et al., 2019), where each architecture is a DAG; and (iii) score-based Bayesian network learning (Zhang et al., 2019). We show that DAGNN outperforms many representative DAG architectures and MPNNs.
|
| 44 |
+
|
| 45 |
+
Overall, this work contributes a specialized graph neural network, a theoretical study of its properties, an analysis of a topological batching technique for enhancing parallel concurrency, a framework interpretation that encompasses prior DAG architectures, and comprehensive evaluations. Supported code is available at https://github.com/vthost/DAGNN.
|
| 46 |
+
|
| 47 |
+
# 2 THE DAGNN MODEL
|
| 48 |
+
|
| 49 |
+
A $D A G$ is a directed graph without cycles. Denote by $\mathcal { G } = ( \nu , \mathcal { E } )$ a DAG, where $\nu$ and $\mathcal { E } \subset \mathcal { V } \times \mathcal { V }$ are the node set and the edge set, respectively. A (strong) partial order over a set $S$ is a binary relation $\leq$ that is transitive and asymmetric. Some authors use reflexivity versus irreflexivity to distinguish weak partial order over strong partial order. To unify concepts, we forbid self-loops (which otherwise are considered cycles) in the DAG and mean strong partial order throughout. A set $S$ with partial order $\leq$ is called a poset and denoted by a tuple $( S , \leq )$ .
|
| 50 |
+
|
| 51 |
+

|
| 52 |
+
Figure 1: Processing of node $v \ = \ 3$ (orange). For each layer $\ell$ , we collect representations $h _ { v } ^ { \ell }$ for all nodes $v$ in a matrix $\mathcal { H } ^ { \ell }$ , where each row represents one node. The initial feature matrix is $\mathcal { X } = \mathcal { H } ^ { 0 }$ . In the first layer, the representations of the direct predecessors $\mathcal { P } ( v ) = \{ 0 , 1 , 2 \}$ (blue) have been computed; they are aggregated together with the past representation of $v$ (orange) to produce a message. The GRU treats the message as the hidden state and the past representation of $v$ as input and outputs an updated representation for $v$ (green). This new representation will be used by $v$ ’s direct successors $\{ 4 \}$ in the same layer and also as input to the next layer. Note that the figure illustrates the processing of only one node. In practice, a batch of nodes is processed; see Section 2.2.
|
| 53 |
+
|
| 54 |
+
A DAG $( \nu , \mathcal { E } )$ and a poset $( S , \leq )$ are closely related. For any DAG, one can define a unique partial order $\leq$ on the node set $\nu$ , such that for all pairs of elements $u , v \in \mathcal { V }$ , $u \leq v$ if and only if there is a directed path from $u$ to $v$ . On the other hand, for any poset $( S , \leq )$ , there exists (possibly more than) one DAG that uses $S$ as the node set and that admits a directed path from $u$ to $v$ whenever $u \leq v$ .
|
| 55 |
+
|
| 56 |
+
In a DAG, all nodes without (direct) predecessors are called sources and we collect them in the set $s$ . Similarly, all nodes without (direct) successors are called targets and we collect them in the set $\tau$ . Additionally, we let $\mathcal { X } = \{ h _ { v } ^ { 0 } , v \in \mathcal { V } \}$ be the set of input node features.
|
| 57 |
+
|
| 58 |
+
# 2.1 MODEL
|
| 59 |
+
|
| 60 |
+
The main idea of DAGNN is to process nodes according to the partial order defined by the DAG. Using the language of MPNN, at every node $v$ , we “aggregate” information from its neighbors and “combine” this aggregated information (the “message”) with $v$ ’s information to update the representation of $v$ . The main differences to MPNN are that (i) we use the current-layer, rather than the past-layer, information to compute the current-layer representation of $v$ and that (ii) we aggregate from the direct-predecessor set $\mathcal { P } ( v )$ only, rather than the entire (or randomly sampled) neighborhood $\mathcal { N } ( v )$ . They lead to a straightforward difference in the final “readout” also. In the following, we propose an instantiation of Equations (3)–(4). See Figure 1 for an illustration of the architecture.
|
| 61 |
+
|
| 62 |
+
One layer. We use the attention mechanism to instantiate the aggregate operator $G ^ { \ell }$ . For a node $v$ at the $\ell$ -th layer, the output message $m _ { v } ^ { \ell }$ computed by $G ^ { \ell }$ is a weighted combination of $h _ { u } ^ { \ell }$ for all nodes $u \in \mathcal { P } ( v )$ at the same layer $\ell$ :
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\underbrace { m _ { v } ^ { \ell } } _ { \mathrm { m e s s a g e } } : = G ^ { \ell } \Big ( \{ h _ { u } ^ { \ell } \mid u \in \mathcal { P } ( v ) \} , h _ { v } ^ { \ell - 1 } \Big ) = \sum _ { u \in \mathcal { P } ( v ) } \alpha _ { v u } ^ { \ell } \Big ( \underbrace { h _ { v } ^ { \ell - 1 } } _ { \mathrm { q u e r y } } , \underbrace { h _ { u } ^ { \ell } } _ { \mathrm { k e y } } \Big ) \underbrace { h _ { u } ^ { \ell } } _ { \mathrm { v a l u e } } .
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
The weighting coefficients $\alpha _ { v u } ^ { \ell }$ follow the query-key design in usual attention mechanisms, whereby the representation of $v$ in the past layer, $h _ { v } ^ { \ell - 1 }$ , serves as the query. Specifically, we define
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\alpha _ { v u } ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , h _ { u } ^ { \ell } \Big ) = \operatorname * { s o f t m a x } _ { u \in \mathcal { P } ( v ) } \Big ( { w _ { 1 } ^ { \ell } } ^ { \top } h _ { v } ^ { \ell - 1 } + { w _ { 2 } ^ { \ell } } ^ { \top } h _ { u } ^ { \ell } \Big ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $w _ { 1 } ^ { \ell }$ and $w _ { 2 } ^ { \ell }$ are model parameters. We use the additive form, as opposed to the usual dotproduct form,1 since it involves fewer parameters. An additional advantage is that it is straightforward to incorporate edge attributes into the model, as will be discussed soon.
|
| 75 |
+
|
| 76 |
+
The combine operator $F ^ { \ell }$ combines the message $m _ { v } ^ { \ell }$ with the previous representation of $v$ , $h _ { v } ^ { \ell - 1 }$ and produces an updated representation $h _ { v } ^ { \ell }$ . We employ a recurrent architecture, which is usually used for processing data in sequential order but similarly suits processing in partial order:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r } { \begin{array} { r } { h _ { v } ^ { \ell } = F ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , m _ { v } ^ { \ell } \Big ) = \mathrm { G R U } ^ { \ell } \Big ( \underbrace { h _ { v } ^ { \ell - 1 } } _ { \mathrm { i n p u t } } \overbrace { \underbrace { m _ { v } ^ { \ell } } _ { \mathrm { s t a t e } } } ^ { \widehat { m _ { v } ^ { \ell } } } \Big ) , } \end{array} } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $h _ { v } ^ { \ell - 1 }$ , $m _ { v } ^ { \ell }$ , and $h _ { v } ^ { \ell }$ are treated as the input, past state, and updated state/output of a GRU, respectively. This design differs from most MPNNs that use simple summation or concatenation to combine the representations. It further differs from GG-NN (Li et al., 2016) (which also employs a GRU), wherein the roles of the two arguments are switched. In GG-NN, the message is treated as the input and the node representation is treated as the state. In contrast, we start from node features and naturally use them as inputs. The message tracks the processed part of the graph and serves better the role of a hidden state, being recurrently updated.
|
| 83 |
+
|
| 84 |
+
By convention, we define $G ^ { \ell } ( \varnothing , \cdot ) = 0$ for the aggregator so that for nodes with an empty directpredecessor set, the message (or, equivalently, the initial state of the GRU) is zero.
|
| 85 |
+
|
| 86 |
+
Bidirectional processing. Just like in sequence models where a sequence may be processed by either the natural order or the reversed order, we optionally invert the directions of the edges in $\mathcal { G }$ to create a reverse $D A G { \tilde { \mathcal { G } } }$ . We will use the tilde notation for all terms related to the reverse DAG. For example, the representation of node $v$ in $\ddot { \mathcal { G } }$ at the $\ell$ -th layer is denoted by $\widetilde { h } _ { v } ^ { \ell }$ .
|
| 87 |
+
|
| 88 |
+
Readout. After $L$ layers of (bidirectional) processing, we use the computed node representations to produce the graph representation. We follow a common practice—concatenate the representations across layers, perform a max-pooling across nodes, and apply a fully-connected layer to produce the output. Different from the usual practice, however, we pull across only the target nodes and concatenate the pooling results from the two directions. Recall that the target nodes contain information of the entire graph following the partial order. Mathematically, the readout $R$ produces
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
h _ { \mathscr { G } } = \mathrm { F C } \Big ( \operatorname { M a x - P o o l } _ { v \in { \mathscr { T } } } \big ( \operatorname { \mu } _ { \ell = 0 } ^ { L } h _ { v } ^ { \ell } \big ) \mathbb { \mu } \operatorname { M a x - P o o l } _ { u \in { \mathscr { S } } } \big ( \operatorname { \mu } _ { \ell = 0 } ^ { L } \widetilde { h } _ { u } ^ { \ell } \big ) \Big ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Note that the target set $\widetilde { \tau }$ of $\widetilde { \mathcal G }$ is the same as the source set $s$ of $\mathcal { G }$ . If the processing is unidirectional, the right pooling in (8) is dropped.
|
| 95 |
+
|
| 96 |
+
Edge attributes. The instantiation of the framework so far has not considered edge attributes. It is in fact simple to incorporate them. Let $\tau ( u , v )$ be the type of an edge $( u , v )$ and let $y _ { \tau }$ be a representation of edges of type $\tau$ . We insert this information during message calculation in the aggregator. Specifically, we replace the attention weights $\alpha _ { v u } ^ { \ell }$ defined in (6) by
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\alpha _ { v u } ^ { \ell } \Big ( h _ { v } ^ { \ell - 1 } , h _ { u } ^ { \ell } \Big ) = \operatorname * { s o f t m a x } _ { u \in \mathcal { P } ( v ) } \Big ( \boldsymbol { w } _ { 1 } ^ { \ell } { } ^ { \top } h _ { v } ^ { \ell - 1 } + \boldsymbol { w } _ { 2 } ^ { \ell } { } ^ { \top } h _ { u } ^ { \ell } + \boldsymbol { w } _ { 3 } ^ { \ell } { } ^ { \top } \boldsymbol { y } _ { \tau ( u , v ) } \Big ) .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
In practice, we experiment with slightly fewer parameters by setting $w _ { 3 } ^ { \ell } = w _ { 1 } ^ { \ell }$ and find that the model performs equally well. The edge representations $y _ { \tau }$ are trainable embeddings of the model. Alternatively, if input edge features are provided, $y _ { \tau ( u , v ) }$ can be replaced by a neural networktransformed embedding for the edge $( u , v )$ .
|
| 103 |
+
|
| 104 |
+
# 2.2 TOPOLOGICAL BATCHING
|
| 105 |
+
|
| 106 |
+
A key difference to MPNN is that DAGNN processes nodes sequentially owing to the nature of the aggregator $G ^ { \ell }$ , obeying the partial order. Thus, for computational efficiency, it is important to maximally exploit concurrency so as to better leverage parallel computing resources (e.g., GPUs). One observation is that nodes without dependency may be grouped together and processed concurrently, if their predecessors have all been processed. See Figure 2 for an illustration.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 2: Topological batching. Left: for the original graph $\mathcal { G }$ ; right: for the reverse graph $\widetilde { \mathcal G }$ .
|
| 110 |
+
|
| 111 |
+
To materialize this idea, we consider topological batching, which partitions the node set $\nu$ into ordered batches $\{ B _ { i } \} _ { i \geq 0 }$ so that (i) the $B _ { i }$ ’s are disjoint and their union is $\nu$ ; (ii) for every pair of nodes $u , v \in B _ { i }$ for some $i$ , there is not a directed path from $u$ to $v$ or from $v$ to $u$ ; (iii) for every $i > 0$ , there exists one node in $B _ { i }$ such that it is the tail of an edge whose head is in $\boldsymbol { B } _ { i - 1 }$ . The concept was proposed by Crouse et al. (2019);2 in what follows, we derive several properties that legitimizes its use in our setting. First, topological batching produces the minimum number of sequential batches such that all nodes in each batch can be processed in parallel.
|
| 112 |
+
|
| 113 |
+
Theorem 1. The number of batches from a partitioning that satisfies (i)–(iii) described in the preceding paragraph is equal to the number of nodes in the longest path of the DAG. As a consequence, this partitioning produces the minimum number of ordered batches such that for all $u \leq v$ , if $u \in B _ { i }$ and $v \in B _ { j }$ , then $i < j$ . Note that the partial order $\leq$ is defined at the beginning of Section 2.
|
| 114 |
+
|
| 115 |
+
The partitioning procedure may be as follows. All nodes without direct predecessors, $s$ , form the initial batch. Iteratively, remove the batch just formed from the graph, as well as the edges emitting from these nodes. The nodes without direct predecessors in the remaining graph form the next batch. Remark 1. To satisfy Properties (i)–(iii), it is not necessary that $\boldsymbol { B _ { 0 } } = \boldsymbol { S }$ ; but the above procedure achieves so. Applying this procedure on the reverse DAG $\widetilde { \mathcal G }$ , we obtain $\widetilde { B } _ { 0 } = { \mathcal T }$ . Note that the last batch for $\mathcal { G }$ may not be the same as $\tau$ ; and the last batch for $\widetilde { \mathcal G }$ may not be the same as $s$ either.
|
| 116 |
+
|
| 117 |
+
Remark 2. Topological batching can be straightforwardly extended to multiple graphs for better parallel concurrency: one merges the $B _ { i }$ for the same $i$ across graphs into a single batch. This is equivalent to treating the multiple DAGs as a single (albeit disconnected) DAG and applying topological batching on it.
|
| 118 |
+
|
| 119 |
+
# 2.3 PROPERTIES
|
| 120 |
+
|
| 121 |
+
In the following, we summarize properties of the DAGNN model; they are consistent with the corresponding results for MPNNs. To formalize these results, we let $\mathcal { M } : \mathcal { V } \times \mathcal { E } \times \mathcal { X } \to h _ { \mathcal { G } }$ denote the mapping defined by Equations (3)–(4). For notational consistency, we omit bidirectional processing, and thus ignore the tilde term in (8). The first results state that DAGNN produces the same graph representation invariant to node permutation.
|
| 122 |
+
|
| 123 |
+
Theorem 2. The graph representation $h _ { \mathcal { G } }$ is invariant to node indexing if all $G ^ { \ell } , F ^ { \ell }$ , and $R$ are so.
|
| 124 |
+
|
| 125 |
+
Corollary 3. The functions $G ^ { \ell }$ , $F ^ { \ell }$ , and $R$ defined in (5)–(8) are invariant to node indexing. Hence, the resulting graph representation $h _ { \mathcal { G } }$ is, too.
|
| 126 |
+
|
| 127 |
+
The next result states that the framework will not produce the same graph representation for different graphs (i.e., non-isomorphic graphs), under a common condition.
|
| 128 |
+
|
| 129 |
+
Theorem 4. The mapping $\mathcal { M }$ is injective if $G ^ { \ell }$ , $F ^ { \ell }$ , and $R$ , considered as multiset functions, are so.
|
| 130 |
+
|
| 131 |
+
The condition required by Theorem 4 is not restrictive. There exist (infinitely many) injective multiset functions $G ^ { \ell }$ , $F ^ { \ell }$ , and $R$ , although the ones instantiated by (5)–(8) are not necessarily injective. The modification to injection can be done by using the $\epsilon$ -trick applied in GIN (Xu et al., 2019), but, similar to the referenced work, the $\epsilon$ that ensures injection is unknown. In practice, it is either set as zero or treated as a tunable hyperparameter.
|
| 132 |
+
|
| 133 |
+
# 3 COMPARISON TO RELATED MODELS
|
| 134 |
+
|
| 135 |
+
In this section, we compare to the most closely related architectures for DAGs, including trees. Natural language processing is a major source of these architectures, since semantic parsing forms a rooted tree or a DAG. Recently, D-VAE (Zhang et al., 2019) has been suggested as a generalpurpose autoencoder for DAGs. Its encoder architecture is the most similar one to ours, but we highlight notable differences that support the improvement DAGNN gains over the D-VAE encoder. All the models we compare with may be considered as restricted cases of the framework (3)–(4).
|
| 136 |
+
|
| 137 |
+
Rooted trees do usually not come with directed edges, because either direction (top-down or bottomup) is sensible. Hence, we use the terminology “parent” and “child” instead. Unified under our framework, recursive neural networks tailored to trees (Socher et al., 2011; 2012; 2013; Ebrahimi & Dou, 2015) are applied to a fixed number of children when the aggregator acts on a concatenation of the child representations. Moreover, they assume that internal nodes do not come with input representations and hence the combine operator misses the first argument.
|
| 138 |
+
|
| 139 |
+
Tree-LSTM (Tai et al., 2015; Zhu et al., 2015; Zhang et al., 2016; Kiperwasser & Goldberg, 2016) and DAG-RNN (Shuai et al., 2016), like DAGNN, employ a recurrent architecture as the combine operator, but the message (hidden state) therein is a naive sum or element-wise product of child representations. In a variant of Tree-LSTM, the naive sum is replaced by a sum of child representations multiplied by separate weight matrices. A limitation of this variant is that the number of children must be the same and the children must be ordered. Another limitation is that both architectures assume that there is a single terminal node (in which case a readout is not invoked).
|
| 140 |
+
|
| 141 |
+
The most similar architecture to DAGNN is the encoder of D-VAE. There are two notable differences. First, D-VAE uses the gated sum as aggregator but we use attention which leverages the information of not only the summands $( h _ { u } ^ { \ell } )$ but also that of the node under consideration $( h _ { v } ^ { \ell - 1 } )$ . This additional source of information enables attention driven by external factors and improves over self attention. Second, similar to all the aforementioned models, D-VAE does not come with a layer notion. On the contrary, we use multiple layers, which are more natural and powerful in the light of findings about general GNNs. Our empirical results described in the following section confirm so.
|
| 142 |
+
|
| 143 |
+
# 4 EVALUATION
|
| 144 |
+
|
| 145 |
+
In this section, we demonstrate the effectiveness of DAGNN on multiple datasets and tasks over a comprehensive list of baselines. We compare timing and show that the training cost of DAGNN is comparable with that of other DAG architectures. We also conduct ablation studies to verify the importance of its components, which prior DAG architectures lack.
|
| 146 |
+
|
| 147 |
+
# 4.1 DATASETS, TASKS, METRICS, AND BASELINES
|
| 148 |
+
|
| 149 |
+
The OGBG-CODE dataset (Hu et al., 2020) contains 452,741 Python functions parsed into DAGs. We consider the TOK task, predicting the tokens that form the function name; it is included in the Open Graph Benchmark (OGB). Additionally, we introduce the LP task, predicting the length of the longest path of the DAG. The metric for TOK is the F1 score and that for LP is accuracy. Because of the vast size, we also create a $15 \%$ training subset, OGBG-CODE-15, for similar experiments.
|
| 150 |
+
|
| 151 |
+
For this dataset, we consider three basic baselines and several GNN models for comparison. For the TOK task, the Node2Token baseline predicts tokens from the attributes of the second graph node, while the TargetInGraph baseline predicts tokens that appear in both the ground truth and in the attributes of some graph node. These baselines exploit the fact that the tokens form node attributes and that the second node’s attribute contains the function name if it is part of the vocabulary. For the LP task, the MajorityInValid baseline constantly predicts the majority length seen from the validation set. The considered GNN models include four from OGB: GCN (Kipf & Welling, 2017), GIN (Xu et al., 2019), GCN-VN, GIN-VN (where -VN means adding a virtual node connecting all existing nodes); two using attention/gated-sum mechanisms: GAT (Velickovi ˇ c et al., 2018), ´ GG-NN (Li et al., 2016); two hierarchical pooling approaches using attention: SAGPool (Lee et al., 2019), ASAP (Ranjan et al., 2020); and the D-VAE encoder.
|
| 152 |
+
|
| 153 |
+
Table 1: Prediction performance on the full dataset OGBG-CODE and a $15 \%$ subset OGBGCODE-15 for two tasks: TOK and LP. Best results are boldfaced and second best are underlined.
|
| 154 |
+
|
| 155 |
+
<table><tr><td rowspan="2">Model</td><td>TOK</td><td>TOK-15</td><td>LP</td><td>LP-15</td></tr><tr><td>F1↑</td><td>F1个</td><td>Acc ↑</td><td>Acc ↑</td></tr><tr><td>Node2Token</td><td>13.04±0.00</td><td>13.04±0.00</td><td>-</td><td>=</td></tr><tr><td>TargetInGraph</td><td>27.32±0.00</td><td>27.08±0.00</td><td></td><td>1</td></tr><tr><td>MajorityInValid</td><td>-</td><td>=</td><td>22.66±0.00</td><td>22.66±0.00</td></tr><tr><td>GCN</td><td>31.63±0.18</td><td>24.39±0.40</td><td>95.55±0.62</td><td>90.66±2.00</td></tr><tr><td>GCN-VN</td><td>32.63±0.13</td><td>24.44±0.25</td><td>96.62±0.44</td><td>92.87±1.19</td></tr><tr><td>GIN</td><td>31.63±0.20</td><td>21.49±0.61</td><td>98.36±0.32</td><td>92.53±2.30</td></tr><tr><td>GIN-VN</td><td>32.04±0.18</td><td>21.10±0.61</td><td>98.60±0.23</td><td>93.27±2.53</td></tr><tr><td>GAT</td><td>33.59±0.32</td><td>27.37±0.16</td><td>93.71±0.24</td><td>83.15±1.34</td></tr><tr><td>GG-NN</td><td>28.04±0.27</td><td>23.15±0.49</td><td>96.48±0.27</td><td>89.16±2.31</td></tr><tr><td>SAGPool</td><td>31.88±0.39</td><td>24.45±0.77</td><td>72.68±14.29</td><td>60.66±11.42</td></tr><tr><td>ASAP</td><td>28.30±0.72</td><td>25.06±0.37</td><td>87.84±2.77</td><td>71.56±3.76</td></tr><tr><td>D-VAE</td><td>32.64±0.17</td><td>27.08±0.39</td><td>99.90±0.02</td><td>99.78±0.01</td></tr><tr><td>DAGNN</td><td>34.41±0.38</td><td>29.11±0.44</td><td>99.93±0.01</td><td>99.86±0.04</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 2: Predictive performance of latent representations for datasets NA and BN.
|
| 158 |
+
|
| 159 |
+
<table><tr><td></td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>Model</td><td>RMSE↓</td><td>Pearson'sr↑</td><td>RMSE↓</td><td>Pearson'sr个</td></tr><tr><td>S-VAE</td><td>0.521±0.002</td><td>0.847±0.001</td><td>0.499±0.006</td><td>0.873±0.002</td></tr><tr><td>GraphRNN</td><td>0.579±0.002</td><td>0.807±0.001</td><td>0.779±0.007</td><td>0.634±0.002</td></tr><tr><td>GCN</td><td>0.482±0.003</td><td>0.871±0.001</td><td>0.599±0.006</td><td>0.809±0.002</td></tr><tr><td>DeepGMG</td><td>0.478±0.002</td><td>0.873±0.001</td><td>0.843±0.007</td><td>0.555±0.003</td></tr><tr><td>D-VAE</td><td>0.375±0.003</td><td>0.924±0.001</td><td>0.281±0.004</td><td>0.964±0.001</td></tr><tr><td>DAGNN</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr></table>
|
| 160 |
+
|
| 161 |
+
The NA dataset (Zhang et al., 2019) contains 19,020 neural architectures generated by the ENAS software. The task is to predict the architecture performance on CIFAR-10 under the weight-sharing scheme. Since it is a regression task, the metrics are RMSE and Pearson’s $r$ . To gauge performance with Zhang et al. (2019), we similarly train (unsupervised) autoencoders and use sparse Gaussian process regression on the latent representation to predict the architecture performance. DAGNN serves as the encoder and we pair it with an adaptation of the D-VAE decoder (see Appendix D). We compare to D-VAE and all the autoencoders compared therein: S-VAE (Bowman et al., 2016), GraphRNN (You et al., 2018), GCN (Zhang et al., 2019), and DeepGMG (Li et al., 2018).
|
| 162 |
+
|
| 163 |
+
The BN dataset (Zhang et al., 2019) contains 200,000 Bayesian networks generated by using the R package bnlearn. The task is to predict the BIC score that measures how well a BN fits the Asia dataset (Lauritzen & Spiegelhalter, 1988). We use the same metrics and baselines as for NA.
|
| 164 |
+
|
| 165 |
+
# 4.2 RESULTS AND DISCUSSION
|
| 166 |
+
|
| 167 |
+
Prediction performance, token prediction (TOK), Table 1. The general trend is the same across the full dataset and the $15 \%$ subset. DAGNN performs the best. GAT achieves the second best result, surprisingly outperforming D-VAE (the third best). Hence, using attention as aggregator during message passing benefits this task. On the $15 \%$ subset, only DAGNN, GAT, and D-VAE match or surpass the TargetInGraph baseline. Note that not all ground-truth tokens are in the vocabulary and thus the best achievable F1 is 90.99. Even so, all methods are far from reaching this ceiling performance. Furthermore, although most of the MPNN models (middle section of the table) use as many as five layers for message passing, the generally good performance of DAGNN and D-VAE indicates that DAG architectures not restricted by the network depth benefit from the inductive bias.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 3: Average training time per epoch, on logarithmic scale. Standard deviation is negligible.
|
| 171 |
+
|
| 172 |
+
Table 3: Ablation results.
|
| 173 |
+
|
| 174 |
+
<table><tr><td rowspan="3">Configuration</td><td>TOK-15</td><td>LP-15</td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>F1↑</td><td>Acc↑</td><td>RMSE↓</td><td>Pearson'sr个</td><td>RMSE↓</td><td>Pearson'sr个</td></tr><tr><td>DAGNN</td><td>29.11±0.44</td><td>99.86±0.04</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr><tr><td>Gated-sum aggr.</td><td>24.98±0.45</td><td>99.88±0.02</td><td>0.451±0.002</td><td>0.887±0.001</td><td>0.486±0.005</td><td>0.878±0.001</td></tr><tr><td>Single layer</td><td>28.39±0.80</td><td>99.74±0.10</td><td>0.277±0.003</td><td>0.960±0.001</td><td>0.324±0.008</td><td>0.950±0.001</td></tr><tr><td>FC layer</td><td>26.08±0.80</td><td>99.85±0.02</td><td>0.280±0.004</td><td>0.959±0.001</td><td>0.362±0.002</td><td>0.934±0.001</td></tr><tr><td>Pool all nodes</td><td>28.40±0.08</td><td>99.78±0.05</td><td>0.302±0.002</td><td>0.952±0.001</td><td>0.098±0.003</td><td>0.996±0.001</td></tr><tr><td>W/o edge attr.</td><td>28.85±0.24</td><td>99.82±0.03</td><td>-</td><td>-</td><td>1</td><td>-</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Prediction performance, length of longest path (LP), Table 1. This analytical task interestingly reveals that many of the findings for the TOK task do not directly carry over. DAGNN still performs the best, but the second place is achieved by D-VAE while GAT lags far behind. The unsatisfactory performance of GAT indicates that attention alone is insufficient for DAG representation learning. The hierarchical pooling methods also perform disappointingly, showing that ignoring nodes may modify important properties of the graph (in this case, the longest path). It is worth noting that DAGNN and D-VAE achieve nearly perfect accuracy. This result corroborates the theory of $\mathrm { X u }$ et al. (2020), who state that when the inductive bias is aligned with the reasoning algorithm (in this case, path tracing), the model learns to reason more easily and achieves better sample efficiency.
|
| 177 |
+
|
| 178 |
+
Prediction performance, scoring the DAG, Table 2. On NA and BN, DAGNN also outperforms D-VAE, which in turn outperforms the other four baselines (among them, DeepGMG works the best on NA and S-VAE works the best on BN, consistent with the findings of Zhang et al. (2019).) While D-VAE demonstrates the benefit of incorporating the DAG bias, DAGNN proves the superiority of its architectural components, as will be further verified in the subsequent ablation study.
|
| 179 |
+
|
| 180 |
+
Time cost, Figure 3. The added expressivity of DAGNN comes with a tradeoff: the sequential processing of the topological batches requires more time than does the concurrent processing of all graph nodes, as in MPNNs. Figure 3 shows that such a trade-off is innate to DAG architectures, including the D-VAE encoder. Moreover, the figure shows that, when used as a component of a larger architecture (autoencoder), the overhead of DAGNN may not be essential. For example, in this particular experiment, DeepGMG (paired with the S-VAE encoder) takes an order of magnitude more time than does DAGNN (paired with the D-VAE decoder). Most importantly, not reflected in the figure is that DAGNN learns better and faster at larger learning rates, leading to fewer learning epochs. For example, DAGNN reaches the best performance at epoch 45, while D-VAE at around 200.
|
| 181 |
+
|
| 182 |
+
Ablation study, Table 3. While the D-VAE encoder performs competitively owing similarly to the incorporation of the DAG bias, what distinguishes our proposal are several architecture components that gain further performance improvement. In Table 3, we summarize results under the following cases: replacing attention in the aggregator by gated sum; reducing the multiple layers to one; replacing the GRUs by fully connected layers; modifying the readout by pooling over all nodes; and removing the edge attributes. One observes that replacing attention generally leads to the highest degradation in performance, while modifying other components yields losses too. There are two exceptions. One occurs on LP-15, where gated-sum aggregation surprisingly outperforms attention by a tight margin, considering the standard deviation. The other occurs on the modification of the readout for the BN dataset. In this case, a Bayesian network factorizes the joint distribution of all variables (nodes) it includes. Even though the DAG structure characterizes the conditional independence of the variables, they play equal roles to the BIC score and thus it is possible that emphasis of the target nodes adversely affects the predictive performance. In this case, pooling over all nodes appears to correct the overemphasis.
|
| 183 |
+
|
| 184 |
+
Table 4: DAGNN results for different numbers of layers.
|
| 185 |
+
|
| 186 |
+
<table><tr><td rowspan="2">#Layers</td><td>TOK-15</td><td>LP-15</td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>F1个</td><td>Acc 个</td><td>RMSE↓</td><td>Pearson'sr个</td><td>RMSE↓</td><td>Pearson's r 个</td></tr><tr><td>1</td><td>28.39±0.80</td><td>99.74±0.10</td><td>0.277±0.003</td><td>0.960±0.001</td><td>0.324±0.008</td><td>0.950±0.001</td></tr><tr><td>2</td><td>29.11±0.44</td><td>99.86±0.04</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr><tr><td>3</td><td>28.96±0.27</td><td>99.81±0.06</td><td>0.260±0.004</td><td>0.965±0.001</td><td>0.129±0.011</td><td>0.993±0.001</td></tr><tr><td>4</td><td>28.91±0.43</td><td>99.78±0.04</td><td>0.265±0.004</td><td>0.963±0.001</td><td>0.129±0.014</td><td>0.993±0.002</td></tr></table>
|
| 187 |
+
|
| 188 |
+
Sensitivity analysis, Table 4 and Figure 4. It is well known that MPNNs often achieve best performance with a small number of layers, a curious behavior distinct from other neural networks. It is important to see if such a behavior extends to DAGNN. In Table 4, we list the results for up to four layers. One observes that indeed the best performance occurs at either two or three layers. In other words, one layer is insufficient (as already demonstrated in the ablation study) and more than three layers offer no advantage. We further extend the experimentation on TOK-15 with additional layers and plot the results in Figure 4. The trend corroborates that the most significant improvement occurs when going beyond a single layer. It is also interesting to see that a single layer yields the highest variance subject to randomization.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 4: Extending Table 4 with further layers on TOK-15.
|
| 192 |
+
|
| 193 |
+
Structure learning, Figure 5. For an application of DAGNN, we extend the use of the BN dataset to learn the Bayesian network for the Asia data. In particular, we take the Bayesian optimization approach and optimize the BIC score over the latent space of DAGs. We use the graphs in BN as pivots and encode every graph by using DAGNN. The optimization yields a DAG with BIC score −11107.29 (see Figure 5). This DAG is almost the same as the ground truth (see Figure 2 of Lauritzen & Spiegelhalter (1988)), except that it does not include the edge from “visit to Asia?” to “Tuberculosis?”. It is interesting to note that the identified DAG has a higher BIC score than that of the ground truth, −11109.74. Furthermore, the BIC score is also much higher than that found by using the D-VAE encoder, $- 1 1 1 2 5 . 7 5$ (Zhang et al., 2019). This encouraging result corroborates the superior encoding quality of DAGNN and the effective use of it in downstream tasks.
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 5: The Bayesian network identified by using Bayesian optimization over the latent space encoded by DAGNN.
|
| 197 |
+
|
| 198 |
+
# 5 CONCLUSIONS
|
| 199 |
+
|
| 200 |
+
We have developed DAGNN, a GNN model for a special yet widely used class of graphs—DAGs. It incorporates the partial ordering entailed by DAGs as a strong inductive bias towards representation learning. With the blessing of this inductive bias, we demonstrate that DAGNNs outperform MPNNs on several representative datasets and tasks. Through ablation studies, we also show that the DAGNN model is well designed, with several components serving as crucial contributors to the performance gain over other models that also incorporate the DAG bias, notably, D-VAE. Furthermore, we theoretically study a batching technique that yields maximal parallel concurrency in processing DAGs and prove that DAGNN is permutation invariant and injective.
|
| 201 |
+
|
| 202 |
+
# ACKNOWLEDGMENTS
|
| 203 |
+
|
| 204 |
+
This work is supported in part by DOE Award DE-OE0000910. Most experiments were conducted on the Satori cluster (satori.mit.edu).
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Miltiadis Allamanis, Earl T. Barr, Premkumar T. Devanbu, and Charles A. Sutton. A survey of machine learning for big code and naturalness. ACM Comput. Surv., 51(4):81:1–81:37, 2018.
|
| 209 |
+
|
| 210 |
+
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vin´ıcius Flores Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, C¸ aglar Gulc¸ehre, H. Francis Song, Andrew J. Ballard, Justin Gilmer, George E. Dahl, Ashish ¨ Vaswani, Kelsey R. Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matthew Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. CoRR, abs/1806.01261, 2018. URL http://arxiv.org/abs/1806.01261.
|
| 211 |
+
|
| 212 |
+
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Jozefowicz, and Samy ´ Bengio. Generating sentences from a continuous space. In Yoav Goldberg and Stefan Riezler (eds.), Proc. of Conference on Computational Natural Language Learning, CoNLL, pp. 10–21, 2016.
|
| 213 |
+
|
| 214 |
+
Maxwell Crouse, Ibrahim Abdelaziz, Cristina Cornelio, Veronika Thost, Lingfei Wu, Kenneth Forbus, and Achille Fokoue. Improving graph neural network representations of logical formulae with subgraph pooling, 2019.
|
| 215 |
+
|
| 216 |
+
Javid Ebrahimi and Dejing Dou. Chain based RNN for relation classification. In Proc. of Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL HLT, pp. 1244–1249, 2015.
|
| 217 |
+
|
| 218 |
+
Matthias Fey and Jan E. Lenssen. Fast graph representation learning with PyTorch Geometric. In Proc. of ICLR Workshop on Representation Learning on Graphs and Manifolds, 2019.
|
| 219 |
+
|
| 220 |
+
Justin Gilmer, Samuel S. Schoenholz, Patrick F. Riley, Oriol Vinyals, and George E. Dahl. Neural message passing for quantum chemistry. In Doina Precup and Yee Whye Teh (eds.), Proc. of International Conference on Machine Learning, ICML, volume 70 of Proceedings of Machine Learning Research, pp. 1263–1272. PMLR, 2017.
|
| 221 |
+
|
| 222 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. CoRR, abs/2005.00687, 2020. URL https://arxiv.org/abs/2005.00687.
|
| 223 |
+
|
| 224 |
+
Eliyahu Kiperwasser and Yoav Goldberg. Easy-first dependency parsing with hierarchical tree lstms. Trans. Assoc. Comput. Linguistics, 4:445–461, 2016. URL https://transacl.org/ojs/ index.php/tacl/article/view/798.
|
| 225 |
+
|
| 226 |
+
Thomas Kipf and Max Welling. Semi-supervised learning with graph convolutional neural networks. In Proc. of International Conference on Learning Representations, ICLR, 2017.
|
| 227 |
+
|
| 228 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 229 |
+
|
| 230 |
+
S. L. Lauritzen and D. J. Spiegelhalter. Local computations with probabilities on graphical structures and their application to expert systems. Journal of the Royal Statistical Society. Series B (Methodological), 50(2):157–224, 1988. ISSN 00359246.
|
| 231 |
+
|
| 232 |
+
Junhyun Lee, Inyeop Lee, and Jaewoo Kang. Self-attention graph pooling. In Proc. of International Conference on Machine Learning, ICML, volume 97 of Proceedings of Machine Learning Research, pp. 3734–3743. PMLR, 2019.
|
| 233 |
+
|
| 234 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard S. Zemel. Gated graph sequence neural networks. In Yoshua Bengio and Yann LeCun (eds.), Proc. of International Conference on Learning Representations, ICLR, 2016.
|
| 235 |
+
|
| 236 |
+
Yujia Li, Oriol Vinyals, Chris Dyer, Razvan Pascanu, and Peter W. Battaglia. Learning deep generative models of graphs. CoRR, abs/1803.03324, 2018.
|
| 237 |
+
|
| 238 |
+
Tengfei Ma, Patrick Ferber, Siyu Huo, Jie Chen, and Michael Katz. Online planner selection with graph neural networks and adaptive scheduling. In Proc. of Thirty-Fourth Conference on Artificial Intelligence, AAAI, 2020.
|
| 239 |
+
|
| 240 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary 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 Proc. of Advances in Neural Information Processing Systems, NeurIPS, pp. 8024–8035. 2019.
|
| 241 |
+
|
| 242 |
+
Hieu Pham, Melody Y. Guan, Barret Zoph, Quoc V. Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In Jennifer G. Dy and Andreas Krause (eds.), Proc. of International Conference on Machine Learning, ICML, volume 80 of Proceedings of Machine Learning Research, pp. 4092–4101. PMLR, 2018.
|
| 243 |
+
|
| 244 |
+
Ekagra Ranjan, Soumya Sanyal, and Partha P. Talukdar. ASAP: adaptive structure aware pooling for learning hierarchical graph representations. In Proc. of The Thirty-Fourth Conference on Artificial Intelligence, AAAI, pp. 5470–5477, 2020.
|
| 245 |
+
|
| 246 |
+
Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter W. Battaglia. Learning to simulate complex physics with graph networks. CoRR, abs/2002.09405, 2020. URL https://arxiv.org/abs/2002.09405.
|
| 247 |
+
|
| 248 |
+
Adam Santoro, David Raposo, David G. T. Barrett, Mateusz Malinowski, Razvan Pascanu, Peter W. Battaglia, and Tim Lillicrap. A simple neural network module for relational reasoning. pp. 4967– 4976, 2017.
|
| 249 |
+
|
| 250 |
+
Marco Scutari. Learning bayesian networks with the bnlearn r package. Journal of Statistical Software, Articles, 35(3):1–22, 2010. ISSN 1548-7660.
|
| 251 |
+
|
| 252 |
+
Bing Shuai, Zhen Zuo, Bing Wang, and Gang Wang. Dag-recurrent neural networks for scene labeling. In Proc. of Conference on Computer Vision and Pattern Recognition, CVPR, pp. 3620– 3629, 2016.
|
| 253 |
+
|
| 254 |
+
Edward Snelson and Zoubin Ghahramani. Sparse gaussian processes using pseudo-inputs. In Proc. Advances in Neural Information Processing, NIPS, pp. 1257–1264, 2005.
|
| 255 |
+
|
| 256 |
+
Richard Socher, Cliff Chiung-Yu Lin, Andrew Y. $\mathrm { N g }$ , and Christopher D. Manning. Parsing natural scenes and natural language with recursive neural networks. In Proc. of International Conference on Machine Learning, ICML, pp. 129–136, 2011.
|
| 257 |
+
|
| 258 |
+
Richard Socher, Brody Huval, Christopher D. Manning, and Andrew Y. Ng. Semantic compositionality through recursive matrix-vector spaces. In Proc. of Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning, EMNLPCoNLL, pp. 1201–1211, 2012.
|
| 259 |
+
|
| 260 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D. Manning, Andrew Y. $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proc. of Conference on Empirical Methods in Natural Language Processing, EMNLP, pp. 1631–1642, 2013.
|
| 261 |
+
|
| 262 |
+
Kai Sheng Tai, Richard Socher, and Christopher D. Manning. Improved semantic representations from tree-structured long short-term memory networks. In Proc. of Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing of the Asian Federation of Natural Language Processing, ACL, pp. 1556– 1566, 2015.
|
| 263 |
+
|
| 264 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. Proc. of International Conference on Learning Representations, ICLR, 2018.
|
| 265 |
+
|
| 266 |
+
Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In Proc. of International Conference on Learning Representations, ICLR, 2019.
|
| 267 |
+
|
| 268 |
+
Keyulu Xu, Jingling Li, Mozhi Zhang, Simon S. Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. What can neural networks reason about? In Proc. of International Conference on Learning Representations, ICLR, 2020.
|
| 269 |
+
|
| 270 |
+
Jiaxuan You, Rex Ying, Xiang Ren, William L. Hamilton, and Jure Leskovec. Graphrnn: Generating realistic graphs with deep auto-regressive models. In Jennifer G. Dy and Andreas Krause (eds.), Proc. of International Conference on Machine Learning, ICML, volume 80 of Proceedings of Machine Learning Research, pp. 5694–5703. PMLR, 2018.
|
| 271 |
+
|
| 272 |
+
Muhan Zhang, Shali Jiang, Zhicheng Cui, Roman Garnett, and Yixin Chen. D-VAE: A variational autoencoder for directed acyclic graphs. In Proc. of Annual Conference on Neural Information Processing Systems, NeurIPS, pp. 1586–1598, 2019.
|
| 273 |
+
|
| 274 |
+
Xingxing Zhang, Liang Lu, and Mirella Lapata. Top-down tree long short-term memory networks. In Kevin Knight, Ani Nenkova, and Owen Rambow (eds.), Proc. of Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL HLT, pp. 310–320, 2016.
|
| 275 |
+
|
| 276 |
+
Xiao-Dan Zhu, Parinaz Sobhani, and Hongyu Guo. Long short-term memory over recursive structures. In Proc. of International Conference on Machine Learning, ICML, volume 37 of JMLR Workshop and Conference Proceedings, pp. 1604–1612. JMLR.org, 2015.
|
| 277 |
+
|
| 278 |
+
Marinka Zitnik, Monica Agrawal, and Jure Leskovec. Modeling polypharmacy side effects with graph convolutional networks. Bioinform., 34(13):i457–i466, 2018.
|
| 279 |
+
|
| 280 |
+
# A PROOFS
|
| 281 |
+
|
| 282 |
+
Proof of Theorem $^ { l }$ . Let $( v _ { 1 } , v _ { 2 } , \ldots , v _ { d } )$ be a longest path of the DAG. The number of batches must be at least $d$ , because otherwise there exists a batch that contains at least two nodes on this path, violating Property (ii). On the other hand, given the partitioning, according to Property (iii), one may trace a directed path, one node from each batch, starting from the last one. The longest path must be at least that long. In other words, the number of batches must be at most the number of nodes on the longest path. Hence, these two numbers are equal. The consequence stated by the theorem straightforwardly follows. □
|
| 283 |
+
|
| 284 |
+
Proof of Theorem 2. We first show that $h _ { v } ^ { \ell }$ is invairant to the indexing of $v$ by double induction on $\ell$ and $v$ . The base case is $\ell = 1$ and $v \in B _ { 0 }$ . In this case, $m _ { v } ^ { 1 } = G ^ { 1 } \overline { { { ( \emptyset , h _ { v } ^ { 0 } ) } } } \doteq 0$ is invairant to the indexing of $v$ . Then, $h _ { v } ^ { 1 } = F ^ { 1 } ( h _ { v } ^ { 0 } , m _ { v } ^ { 1 } )$ is, too. In the induction, if for all $\ell ^ { \prime } < \ell$ and all $v ^ { \prime }$ , and for $\ell ^ { \prime } = \ell$ and $v ^ { \prime } \in B _ { 0 } \cup \dots \cup B _ { i - 1 }$ , $h _ { v ^ { \prime } } ^ { \ell ^ { \prime } }$ is invairant to the indexing of $v ^ { \prime }$ , then for $\ell ^ { \prime } = \ell$ and $v \in B _ { i }$ , $m _ { v } ^ { \ell } = G ^ { \ell } ( \{ h _ { u } ^ { \ell } \ | \ u \in \mathcal { P } ( v ) \} , h _ { v } ^ { \ell - 1 } )$ and $h _ { v } ^ { \ell } = F ^ { \ell } ( h _ { v } ^ { \ell } , m _ { v } ^ { \ell } )$ are both invairant to the indexing of $v$ . Thus, by induction, for all $\ell ^ { \prime } = \ell$ and all $v$ , $h _ { v } ^ { \ell ^ { \prime } }$ is invairant to the indexing of $v$ . Then, by an outer induction, for all $\ell$ and all $v$ , $h _ { v } ^ { \ell }$ is invairant to the indexing of $v$ .
|
| 285 |
+
|
| 286 |
+
Therefore, $h _ { \mathcal { G } } = R ( \{ h _ { v } ^ { \ell } , \ell = 0 , 1 , \ldots , L , v \in \mathcal { T } \} .$ ) is invairant to the indexing of the nodes in $\tau$ and thus of the entire node set. □
|
| 287 |
+
|
| 288 |
+
Proof of Corollary $^ 3$ . The function $G ^ { \ell }$ is invariant to node indexing because it is a weighted sum of the elements in its first argument, $\{ h _ { u } ^ { \ell } \}$ , whereas the weights are parameterized by using the same parameter $w _ { 2 } ^ { \ell }$ for these elements.
|
| 289 |
+
|
| 290 |
+
The function $F ^ { \ell }$ is invariant to node indexing because its two arguments are clearly distinguished.
|
| 291 |
+
|
| 292 |
+
The function $R$ is invariant to node indexing because the FC layer applies to the pooling result of $h _ { v } ^ { \ell }$ for a fixed set of $v$ . □
|
| 293 |
+
|
| 294 |
+
Proof of Theorem 4. Suppose two graphs $\mathcal { G }$ and $\mathcal { G } ^ { \prime }$ have the same representation $h _ { \mathcal { G } } = h _ { \mathcal { G } ^ { \prime } }$ . Then, from the function $R$ , they must have the same target set $\tau$ and same node representations $h _ { v } ^ { \ell }$ for all nodes $v \in \mathcal T$ and all layers $\ell$ . In particular, for the last layer $\ell = L$ , from the functions $F ^ { L }$ and $G ^ { L }$ , each of these nodes, $v$ , from the two graphs must have the same set of direct predecessors $\mathcal { P } ( v )$ , each element $u$ of which have the same representation $h _ { u } ^ { L }$ across graphs. By backward induction, the two graphs must have the same node set $\nu$ and edge set $\mathcal { E }$ . Moreover, for each node $v \in \mathcal V$ , the last-layer representation $h _ { v } ^ { L }$ must be the same.
|
| 295 |
+
|
| 296 |
+
Furthermore, from the injection property of $F ^ { \ell }$ , if a node $v$ shares the same node representation $h _ { v } ^ { \ell }$ across graphs, then its past-layer representation $h _ { v } ^ { \ell - 1 }$ must also be the same across graphs. A backward reduction traces back to the initial representation $h _ { v } ^ { 0 }$ , which concludes that the two graphs must have the same set of input node features $\mathcal { X }$ . □
|
| 297 |
+
|
| 298 |
+
# B DATASET DETAILS
|
| 299 |
+
|
| 300 |
+
OGBG-CODE. The OGBG-CODE dataset was recently included in the Open Graph Benchmark (OGB) (Hu et al., 2020, Section 6.3). It contains 452,741 Python method definitions extracted from thousands of popular Github repositories. The method definitions are represented as DAGs by augmenting the abstract syntax trees with edges connecting the sequence of source code tokens. Hence, there are two types of edges. The min/avg/max numbers of nodes in the graphs are 11/125/36123, respectively. We use the node features provided by the dataset, including node type, attributes, depth in the AST, and pre-order traversal index.
|
| 301 |
+
|
| 302 |
+
The task suggested by Hu et al. (2020) is to predict the sub-tokens forming the method name, also known as “code summarization”. The task is considered a proxy measure of how well a model captures the code semantics (Allamanis et al., 2018). We additionally consider the task of predicting the length of the longest path in the graph. We treat it as a 275-way classification because the maximum length is 275. The distribution of the lengths/classes is shown in Appendix E. To avoid triviality, for this task we remove the AST depth from the node feature set.
|
| 303 |
+
|
| 304 |
+
We adopt OGB’s project split, whose training set consists of Github projects not seen in the validation and test sets. We also experiment with a subset of the data, OGBG-CODE-15, which contains only randomly chosen $15 \%$ of the OGBG-CODE training data. Validation and test sets remain the same.
|
| 305 |
+
|
| 306 |
+
In addition to OGBG-CODE, we further experiment with two DAG datasets, NA and BN, used by Zhang et al. (2019) for evaluating their model D-VAE. To compare with the results reported in the referenced work, we focus on the predictive performance of the latent representations of the DAGs obtained from autoencoders. We adopt the given 90/10 splits.
|
| 307 |
+
|
| 308 |
+
Neural architectures (NA). This dataset is created in the context of neural architecture search. It contains 19,020 neural architectures generated from the ENAS software (Pham et al., 2018). Each neural architecture has 6 layers (i.e., nodes) sampled from 6 different types of components, plus an input and output layer. The input node vectors are one-hot encodings of the component types. The weight-sharing accuracy (Pham et al., 2018) (a proxy of the true accuracy) on CIFAR-10 (Krizhevsky, 2009) is taken as performance measure. Details about the generation process can be found in Zhang et al. (2019, Appendix H).
|
| 309 |
+
|
| 310 |
+
Bayesian networks (BN). This dataset contains 200,000 random 8-node Bayesian networks generated by using the R package bnlearn (Scutari, 2010). The Bayesian Information Criterion (BIC) score is used to measure how well the DAG structure fits the Asia dataset (Lauritzen & Spiegelhalter, 1988). The input node vectors are one-hot encodings of the node indices according to topological sort. See Zhang et al. (2019, Appendix I) for further details.
|
| 311 |
+
|
| 312 |
+
# C BASELINE DETAILS
|
| 313 |
+
|
| 314 |
+
Baselines for OGBG-CODE. We use three basic measures to set up baseline performance, two for token prediction and one for the longest path task. (1) Node2Token: This method uses the attribute of the second node of the graph as prediction. We observe that the second node either contains the function name, if the token occurs in the vocabulary (which is not always the case because some function names consist of multiple words), or contains “None”. (2) TargetInGraph: This method pretends that it knows the ground-truth tokens but predicts only those occurring in the graph. One would expect that a learning model may be able to outperform this method if it learns the associations of tokens outside the current graph. (3) MajorityInValid: This method always predicts the majority length seen in the validation set.
|
| 315 |
+
|
| 316 |
+
Additionally, we compare with multiple GNN models. Some of them are the GNN implementations offered by OGB: GCN, GIN, GCN-VN, and GIN-VN. The latter two are extensions of the first two by including a virtual node (i.e., an additional node that is connected to all nodes in the graph). Note that the implementations do not strictly follow the architectures described in the original papers (Kipf & Welling, 2017; Xu et al., 2019). In particular, edge types are incorporated and inverse edges are added for bidirectional message passing.
|
| 317 |
+
|
| 318 |
+
Since our model features attention mechanisms, we include GAT (Velickovi ˇ c et al., 2018) and ´ GGNN (Li et al., 2016) for comparison. We also include two representative hierarchical pooling approaches, which use attention to determine node pooling: SAGPool (Lee et al., 2019) and ASAP (Ranjan et al., 2020). Lastly, we compare with the encoder of D-VAE (Zhang et al., 2019, Appendix E, F).
|
| 319 |
+
|
| 320 |
+
Baselines for NA and BN. Over NA and BN, we consider D-VAE and the baselines in Zhang et al. (2019, Appendix J). S-VAE (Bowman et al., 2016) applies a standard GRU-based RNN variational autoencoder to the topologically sorted node sequence, with node features augmented by the information of incoming edges, and decodes the graph by generating an adjacency matrix. GraphRNN (You et al., 2018) by itself serves as a decoder; we pair it with S-VAE encoder. GCN uses a GCN encoder while takes the decoder of D-VAE. DeepGMG (Li et al., 2018) similarly uses a GNN-based encoder but employs its own decoder (which is similar to the one in D-VAE). Note that all these baselines are autoencoders and our objective is to compare the performance of the latent representations.
|
| 321 |
+
|
| 322 |
+
# D MODEL CONFIGURATIONS AND TRAINING
|
| 323 |
+
|
| 324 |
+
D.1 EXPERIMENT PROTOCOL AND HYPERPARAMETER TUNING
|
| 325 |
+
|
| 326 |
+
Our evaluation protocols and procedures closely follow those of Hu et al. (2020); Zhang et al. (2019). For OGBG-CODE, we only changed the following. We used 5-fold cross validation due to the size of the dataset and the number of baselines for comparison. Since we compared with vast kinds of models in addition to the OGB baselines, we swept over a large range of learning rates and, for each model, picked the best from the set {1e-4, 5e-4, 1e-3, 15e-4, 2e-3, 5e-3, 1e-2, 15e-3} based on performance on OGBG-CODE-15. We stopped training when the validation metric did not improve further under a patience of 20 epochs, for all models but D-VAE and DAGNN. For the latter two, we used a patience of 10. Moreover, for these two models we used gradient clipping (at 0.25) due to the recurrent layers and a batch size of 80. Note that OGB uses 10-fold cross validation with a fixed learning rate of 1e-3, a fixed epoch number 30, and a batch size 128.
|
| 327 |
+
|
| 328 |
+
For NA and BN, we followed the exact training settings of Zhang et al. (2019, Appendix K). For DAGNN, we started the learning rate scheduler at 1e-3 (instead of 1e-4) and stopped at a maximum number of epochs, 100 for NA and 50 for BN (instead of 300 and 100, respectively). We also trained a sparse Gaussian process (SGP) (Snelson & Ghahramani, 2005) as the predictive model, as described in Zhang et al. (2019, Appendix L), to evaluate the performance of the latent representations. The prediction results were averaged over 10 folds.
|
| 329 |
+
|
| 330 |
+
For the Bayesian network learning experiment we similarly took over the settings of Zhang et al.
|
| 331 |
+
(2019), running ten rounds of Bayesian optimization.
|
| 332 |
+
|
| 333 |
+
# D.2 BASELINE MODELS
|
| 334 |
+
|
| 335 |
+
All models were implemented in PyTorch (Paszke et al., 2019). For OGBG-CODE, we used the GCN and GIN models provided by the benchmark. We implemented a GAT model as described in Velickovi ˇ c et al. (2018) and GG-NN in Li et al. (2016). We used the SAGPool implementation of Lee ´ et al. (2019) and ASAP from the Pytorch Geometric Benchmark Suite https://github.com/ rusty1s/pytorch_geometric/tree/master/benchmark. All these models were implemented using PyTorch Geometric (Fey & Lenssen, 2019). We used the parameters suggested in OGB (e.g., 5 GNN layers, with embedding and hidden dimension 300), with the exception of ASAP where we used 3 instead of 5 layers due to memory constraints.
|
| 336 |
+
|
| 337 |
+
Since the D-VAE implementation does not support topological batching as we do, and also because of other miscellaneous restrictions (e.g., a single source node and target node), we reimplement D-VAE by using our DAGNN codebase. The reimplementation reproduces the results reported by Zhang et al. (2019). See Appendix F for more details.
|
| 338 |
+
|
| 339 |
+
# D.3 DAGNN IMPLEMENTATION
|
| 340 |
+
|
| 341 |
+
For DAGNN, we used hidden dimension 300. As suggested by OGB, we used independent linear classifiers to predict sub-tokens at each position of the sub-token sequence. Similarly, we used a linear classifier to predict the length of the longest path.
|
| 342 |
+
|
| 343 |
+
For the NA and BN datasets, we took the baseline implementations as well as training and evaluation procedures from Zhang et al. (2019). In particular, we used the corresponding configuration of DVAE for the BN dataset. For DAGNN, we used the same hidden dimension 501 and adapted the decoder of D-VAE (by replacing the use of D-VAE encoder in part of the decoding process with our encoder). Additionally, we used bidirectional processing for token prediction over OGBG-CODE and for the experiment over BN. Since it did not offer improvement in performance for the longest path length prediction and for the experiment over NA but consumed too much time, for these cases we used unidirectional processing.
|
| 344 |
+
|
| 345 |
+
# E DETAILS ON THE LONGEST PATH EXPERIMENT
|
| 346 |
+
|
| 347 |
+
We observe that for the MPNN baselines, the longest path results shown in Table 1 are much worse on the $15 \%$ subset than on the full dataset. We speculate whether the poorer performance is caused by purely the size of training data, or additionally by the discrepancy of data distributions. Figure 6 shows that the data distributions are rather similar. Hence, we conclude that the degrading performance of MPNNs on a smaller training set is due to their low sample efficiency, in contrast to DAG architectures (D-VAE and DAGNN) that perform similarly on both the full set and the subset.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 6: Distribution of the longest path lengths, for OGBG-CODE (left) and OGBG-CODE-15 (right). To improve readability, we ignored a tiny amount of graphs whose longest path length $> 3 0$ . There are 58 such graphs in OGBG-CODE and 21 in OGBG-CODE-15.
|
| 351 |
+
|
| 352 |
+
# F REIMPLEMENTATION OF D-VAE
|
| 353 |
+
|
| 354 |
+
The original D-VAE implementation processes nodes sequentially and thus is time consuming. Therefore, we reimplement D-VAE by using our DAGNN codebase, in particular supporting topological batching. Table 5 shows that our reimplementation reproduces closely the results obtained by the original D-VAE implementation.
|
| 355 |
+
|
| 356 |
+
Table 5: Predictive performance of latent DAG representations for NA and BN. Comparison of the original implementation and our reimplementation.
|
| 357 |
+
|
| 358 |
+
<table><tr><td></td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>Model</td><td>RMSE</td><td>Pearson's r</td><td>RMSE</td><td>Pearson's r</td></tr><tr><td>D-VAE (orig)</td><td>0.375±0.003</td><td>0.924±0.001</td><td>0.281±0.004</td><td>0.964±0.001</td></tr><tr><td>D-VAE (ours)</td><td>0.375±0.004</td><td>0.925±0.001</td><td>0.219±0.003</td><td>0.977±0.000</td></tr></table>
|
| 359 |
+
|
| 360 |
+
# G ADDITIONAL ABLATION RESULTS
|
| 361 |
+
|
| 362 |
+
As mentioend in the main text, bidirectional processing is optional; it does not necessarily improve over unidirectional. Indeed, Table 6 shows that bidirectional works better on TOK-15 and BN, but unidirectional works better on LP-15 and NA. However, either way, DAGNN outperforms all baselines reported in Table 1 and 2, with only one exception: on LP-15, D-VAE performs worse than unidirectional but better than bidirectional.
|
| 363 |
+
|
| 364 |
+
Table 6: Bidirectional vs. unidirectional processing.
|
| 365 |
+
|
| 366 |
+
<table><tr><td></td><td>TOK-15</td><td>LP-15</td><td colspan="2">NA</td><td colspan="2">BN</td></tr><tr><td>Bidirectional?</td><td>F1↑</td><td>Acc ↑</td><td>RMSE↓</td><td>Pearson's r↑</td><td>RMSE↓</td><td>Pearson's r 个</td></tr><tr><td>No</td><td>28.44±0.19</td><td>99.85±0.02</td><td>0.264±0.004</td><td>0.964±0.001</td><td>0.146±0.035</td><td>0.992±0.001</td></tr><tr><td>Yes</td><td>29.11±0.44</td><td>99.50±0.22</td><td>0.324±0.003</td><td>0.945±0.001</td><td>0.122±0.004</td><td>0.993±0.000</td></tr></table>
|
parse/train/JbuYF437WB6/JbuYF437WB6_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/JbuYF437WB6/JbuYF437WB6_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/JbuYF437WB6/JbuYF437WB6_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Syxt5oC5YQ/Syxt5oC5YQ.md
ADDED
|
@@ -0,0 +1,566 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AGGREGATED MOMENTUM: STABILITY THROUGH PASSIVE DAMPING
|
| 2 |
+
|
| 3 |
+
James Lucas, Shengyang Sun, Richard Zemel, Roger Grosse University of Toronto; Vector Institute {jlucas, ssy, zemel, rgrosse}@cs.toronto.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Momentum is a simple and widely used trick which allows gradient-based optimizers to pick up speed along low curvature directions. Its performance depends crucially on a damping coefficient $\beta$ . Large $\beta$ values can potentially deliver much larger speedups, but are prone to oscillations and instability; hence one typically resorts to small values such as 0.5 or 0.9. We propose Aggregated Momentum $( A g g M o )$ , a variant of momentum which combines multiple velocity vectors with different $\beta$ parameters. $\mathbf { A g g M o }$ is trivial to implement, but significantly dampens oscillations, enabling it to remain stable even for aggressive $\beta$ values such as 0.999. We reinterpret Nesterov’s accelerated gradient descent as a special case of AggMo and analyze rates of convergence for quadratic objectives. Empirically, we find that AggMo is a suitable drop-in replacement for other momentum methods, and frequently delivers faster convergence with little to no tuning.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
In spite of a wide range of modern optimization research, gradient descent with momentum and its variants remain the tool of choice in machine learning. Momentum methods can help the optimizer pick up speed along low curvature directions without becoming unstable in high-curvature directions. The simplest of these methods, classical momentum (Polyak, 1964), has an associated damping coefficient, $0 \leq \beta < 1$ , which controls how quickly the momentum vector decays. The choice of $\beta$ imposes a tradoff between speed and stability: in directions where the gradient is small but consistent, the terminal velocity is proportional to $1 / ( 1 - \beta )$ , suggesting that $\beta$ slightly less than 1 could deliver much improved optimization performance. However, large $\beta$ values are prone to oscillations and instability (O’Donoghue & Candes, 2015; Goh, 2017), requiring a smaller learning rate and hence slower convergence.
|
| 12 |
+
|
| 13 |
+
Finding a way to dampen the oscillations while preserving the high terminal velocity of large beta values could dramatically speed up optimization. Sutskever et al. (2013) found that Nesterov accelerated gradient descent (Nesterov, 1983), which they reinterpreted as a momentum method, was more stable than classical momentum for large $\beta$ values and gave substantial speedups for training neural networks. However, the reasons for the improved performance remain somewhat mysterious. O’Donoghue & Candes (2015) proposed to detect oscillations and eliminate them by resetting the velocity vector to zero. But in practice it is difficult to determine an appropriate restart condition.
|
| 14 |
+
|
| 15 |
+
In this work, we introduce Aggregated Momentum (AggMo), a variant of classical momentum which maintains several velocity vectors with different $\beta$ parameters. AggMo averages the velocity vectors when updating the parameters. We find that this combines the advantages of both small and large $\beta$ values: the large values allow significant buildup of velocity along low curvature directions, while the small values dampen the oscillations, hence stabilizing the algorithm. AggMo is trivial to implement and incurs almost no computational overhead.
|
| 16 |
+
|
| 17 |
+
We draw inspiration from the physics literature when we refer to our method as a form of passive damping. Resonance occurs when a system is driven at specific frequencies but may be prevented through careful design (Goldstein, 2011). Passive damping can address this in structures by making use of different materials with unique resonant frequencies. This prevents any single frequency from producing catastrophic resonance. By combining several momentum velocities together we achieve a similar effect — no single frequency is driving the system and so oscillation is prevented.
|
| 18 |
+
|
| 19 |
+
In this paper we analyze rates of convergence on quadratic functions. We also provide theoretical convergence analysis showing that AggMo achieves converging average regret in online convex programming (Zinkevich, 2003). To evaluate AggMo empirically we compare against other commonly used optimizers on a range of deep learning architectures: deep autoencoders, convolutional networks, and long-term short-term memory (LSTM).
|
| 20 |
+
|
| 21 |
+
In all of these cases, we find that AggMo works as a drop-in replacement for classical momentum, in the sense that it works at least as well for a given $\beta$ parameter. But due to its stability at higher $\beta$ values, it often delivers substantially faster convergence than both classical and Nesterov momentum when its maximum $\beta$ value is tuned.
|
| 22 |
+
|
| 23 |
+
# 2 Background: momentum-based optimization
|
| 24 |
+
|
| 25 |
+
Classical momentum We consider a function $f : \mathbb { R } ^ { d } \mathbb { R }$ to be minimized with respect to some variable $\pmb \theta$ . Classical momentum (CM) minimizes this function by taking some initial point $\pmb { \theta } _ { 0 }$ and running the following iterative scheme,
|
| 26 |
+
|
| 27 |
+
$$
|
| 28 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma _ { t } \mathbf { v } _ { t } , } \end{array}
|
| 29 |
+
$$
|
| 30 |
+
|
| 31 |
+
where $\gamma _ { t }$ denotes a learning rate schedule, $\beta$ is the damping coefficient and we set $\mathbf { v } _ { 0 } = 0$ . Momentum can speed up convergence but it is often difficult to choose the right damping coefficient, $\beta$ . Even with momentum, progress in a low curvature direction may be very slow. If the damping coefficient is increased to overcome this then high curvature directions may cause instability and oscillations.
|
| 32 |
+
|
| 33 |
+
Nesterov momentum Nesterov’s Accelerated Gradient (Nesterov, 1983; 2013) is a modified version of the gradient descent algorithm with improved convergence and stability. It can be written as a momentum-based method (Sutskever et al., 2013),
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } + \gamma _ { t - 1 } \beta \mathbf { v } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma _ { t } \mathbf { v } _ { t } . } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Nesterov momentum seeks to solve stability issues by correcting the error made after moving in the direction of the velocity, v. In fact, it can be shown that for a quadratic function Nesterov momentum adapts to the curvature by effectively rescaling the damping coefficients by the eigenvalues of the quadratic (Sutskever et al., 2013).
|
| 40 |
+
|
| 41 |
+
Quadratic convergence We begin by studying convergence on quadratic functions, which have been an important test case for analyzing convergence behavior (Sutskever et al., 2013; O’Donoghue & Candes, 2015; Goh, 2017), and which can be considered a proxy for optimization behavior near a local minimum (O’Donoghue & Candes, 2015).
|
| 42 |
+
|
| 43 |
+
We analyze the behavior of these optimizers along the eigenvectors of a quadratic function in Figure 1. In the legend, $\lambda$ denotes the corresponding eigenvalue. In (a) we use a low damping coefficient $\langle \beta = 0 . 9 )$ while (b) shows a high damping coefficient $\beta = 0 . 9 9 9 \mathrm { \Omega }$ ). When using a low damping coefficient it takes many iterations to find the optimal solution. On the other hand, increasing the damping coefficient from 0.9 to 0.999 causes oscillations which prevent convergence. When using CM in practice we seek the critical damping coefficient which allows us to rapidly approach the optimum without becoming unstable (Goh, 2017). On the other hand, Nesterov momentum with $\bar { \beta } = 0 . 9 9 9$ is able to converge more quickly within high curvature regions than CM but retains oscillations for the quadratics exhibiting lower curvature.
|
| 44 |
+
|
| 45 |
+
# 3 Passive damping through Aggregated Momentum
|
| 46 |
+
|
| 47 |
+
Aggregated Momentum We propose Aggregated Momentum (AggMo), a variant of gradient descent which aims to improve stability while providing the convergence benefits of larger damping coefficients. We modify the gradient descent algorithm by including several velocity vectors each with their own damping coefficient. At each optimization step these velocities are updated and then averaged to produce the final velocity used to update the parameters. This updated iterative procedure can be written as follows,
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: Minimizing a quadratic function. All optimizers use a fixed learning rate of 0.33. In the legend, $\lambda$ denotes the corresponding eigenvalues.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Breaking oscillations with passive damping. The arrows show the direction and relative amplitude of the velocities at various points in time. We discuss points (1) and (2) in Section 3.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l } & { { \mathbf { v } } _ { t } ^ { ( i ) } = \beta ^ { ( i ) } { \mathbf { v } } _ { t - 1 } ^ { ( i ) } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } ) , \mathrm { ~ f o r ~ a l l ~ } i , } \\ & { ~ \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \displaystyle \frac { \gamma _ { t } } { K } \sum _ { i = 1 } ^ { K } { \mathbf { v } } _ { t } ^ { ( i ) } , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\mathbf { v } _ { 0 } ^ { ( i ) } = 0$ for each $i$ . We refer to the vector $\beta = [ \beta ^ { ( 1 ) } , \dots , \beta ^ { ( K ) } ]$ as the damping vector.
|
| 60 |
+
|
| 61 |
+
By taking advantage of several damping coefficients, AggMo is able to optimize well over illconditioned curvature. Figure 1 (d) shows the optimization along the eigenvectors of a quadratic function using AggMo. AggMo dampens oscillations quickly for all eigenvalues and converges faster than CM and Nesterov in this case.
|
| 62 |
+
|
| 63 |
+
In Figure 2 we display the AggMo velocities during optimization. At point (1) the velocities are aligned towards the minima, with the $\beta = 0 . 9 9 9$ velocity contributing substantially more to each update. By point (2) the system has begun to oscillate. While the $\beta = 0 . 9 9 9$ velocity is still pointed away from the minima, the $\beta = 0 . 9$ velocity has changed direction and is damping the system. Combining the velocities allows AggMo to achieve fast convergence while reducing the impact of oscillations caused by large $\beta$ values.
|
| 64 |
+
|
| 65 |
+
# 3.1 Using AggMo
|
| 66 |
+
|
| 67 |
+
Choosing the damping vector Recall that in a direction with small but steady gradient, the terminal velocity is proportional to $1 / ( 1 - \beta )$ . We found that a good choice of damping vectors was therefore to space the terminal velocities exponentially. To do so, we specify an exponential scale-factor, $a$ and a count $K$ . The damping vector is then constructed as $\bar { \beta ^ { ( i ) } } = \bar { 1 } - a ^ { i - 1 }$ , for $i = 1 \dots K$ . We fix $a = 0 . 1$ throughout and vary only $K$ . A good default choice is $K = 3$ which corresponds to $\beta = [ 0 , 0 . 9 , 0 . 9 9 ]$ ]. We found this setting to be both stable and effective in all of our experiments.
|
| 68 |
+
|
| 69 |
+
Computational/Memory overhead There is very little additional computational overhead when using AggMo compared to CM, as it only requires a handful of extra addition and multipliciation operations on top of the single gradient evaluation. There is some memory overhead due to storing the $K$ velocity vectors, which are each the same size as the parameter vector. However, for most modern deep learning applications, the memory cost at training time is dominated by the activations rather than the parameters (Gomez et al., 2017; Chen et al., 2016; Werbos, 1990; Hochreiter & Schmidhuber, 1997), so the overhead will generally be small.
|
| 70 |
+
|
| 71 |
+
# 4 Recovering Nesterov momentum
|
| 72 |
+
|
| 73 |
+
In this section we show that we can recover Nesterov Momentum (Equation 2) using a simple generalization of Aggregated Momentum (Equation 3). We now introduce separate learning rates for each velocity, $\gamma ^ { ( i ) }$ , so that the iterate update step from Equation 3 is replaced with,
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\pmb \theta _ { t } = \pmb \theta _ { t - 1 } + \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \gamma _ { t } ^ { ( i ) } \mathbf v _ { t } ^ { ( i ) } ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
with eacase of $\beta = [ 0 , \beta ]$ updand $\gamma _ { t } ^ { ( 1 ) } = 2 \gamma$ , $\gamma _ { t } ^ { ( 2 ) } = 2 \beta \gamma$ o recover Nesterov momentum we consider the special. The AggMo update rule can now be written as,
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \boldsymbol { \theta } } f ( \pmb { \theta } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \cfrac { \gamma ^ { ( 2 ) } } { 2 } \mathbf { v } _ { t } - \cfrac { \gamma ^ { ( 1 ) } } { 2 } \nabla _ { \boldsymbol { \theta } } f ( \pmb { \theta } _ { t - 1 } ) , } \\ & { \quad \quad = \pmb { \theta } _ { t - 1 } + \gamma \beta ^ { 2 } \mathbf { v } _ { t - 1 } - ( 1 + \beta ) \gamma \nabla _ { \boldsymbol { \theta } } f ( \pmb { \theta } _ { t - 1 } ) . } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
Similarly, we may write the Nesterov momentum update with constant learning rate $\gamma _ { t } = \gamma$ as,
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = \beta \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } + \gamma \beta \mathbf { v } _ { t - 1 } ) , } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma \beta \mathbf { v } _ { t - 1 } - \gamma \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } + \gamma \beta \mathbf { v } _ { t - 1 } ) . } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Now we consider Equation 6 when using the reparameterization given by $\phi _ { t } = \pmb { \theta } _ { t } + \gamma \beta \mathbf { v } _ { t }$ ,
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r l } & { \phi _ { t } - \gamma \beta \mathbf { v } _ { t } = \phi _ { t - 1 } - \gamma \nabla _ { \theta } f ( \phi _ { t - 1 } ) , } \\ & { \qquad \Rightarrow \phi _ { t } = \phi _ { t - 1 } + \gamma \beta \mathbf { v } _ { t } - \gamma \nabla _ { \theta } f ( \phi _ { t - 1 } ) , } \\ & { \qquad = \phi _ { t - 1 } + \gamma \beta ^ { 2 } \mathbf { v } _ { t - 1 } - ( 1 + \beta ) \gamma \nabla _ { \theta } f ( \phi _ { t - 1 } ) . } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
It follows that the update to $\phi$ from Nesterov is identical to the $\mathbf { A g g M o }$ update to $\pmb \theta$ , and we have $\phi _ { 0 } = \pmb { \theta } _ { 0 }$ . We can think of the $\phi$ reparameterization as taking a half-step forward in the Nesterov optimization allowing us to directly compare the iterates at each time step. We note also that if $\gamma _ { t } ^ { ( 1 ) } = \gamma _ { t } ^ { ( 2 ) } = 2 \gamma$ γ(2)t = 2γ then the equivalence holds approximately when β is sufficiently close to 1. We demonstrate this equivalence empirically in Appendix B.
|
| 98 |
+
|
| 99 |
+
This formulation allows us to reinterpret Nesterov momentum as a weighted average of a gradient update and a momentum update. Moreover, by showing that AggMo recovers Nesterov momentum we gain access to the same theoretical convergence results that Nesterov momentum achieves.
|
| 100 |
+
|
| 101 |
+
# 5 Convergence analysis
|
| 102 |
+
|
| 103 |
+
# 5.1 Analyzing quadratic convergence
|
| 104 |
+
|
| 105 |
+
We can learn a great deal about optimizers by carefully reasoning about their convergence on quadratic functions. O’Donoghue & Candes (2015) point out that in practice we do not know the condition number of the function to be optimized and so we aim to design algorithms which work well over a
|
| 106 |
+
|
| 107 |
+
# Convergence Rates on Quadratics
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: Convergence on quadratics of varying condition number. AggMo interpolates between the convergence rates of CM at $\beta = 0 . 9$ and $\beta = 0 . 9 9$ .
|
| 111 |
+
|
| 112 |
+
large possible range. Sharing this motivation, we consider the convergence behaviour of momentum optimizers on quadratic functions with fixed hyperparameters over a range of condition numbers.
|
| 113 |
+
|
| 114 |
+
To compute the convergence rate, $| | \pmb { \theta } _ { t } - \pmb { \theta } ^ { * } | | ^ { 2 }$ , we model each optimizer as a linear dynamical systems as in Lessard et al. (2016). The convergence rate is then determined by the eigenvalues of this system. We leave details of this computation to appendix B.
|
| 115 |
+
|
| 116 |
+
Figure 3 displays the convergence rate of each optimizer for quadratics with condition numbers $( \kappa )$ from $1 0 ^ { 1 }$ to $1 0 ^ { 7 }$ . The blue dashed line displays the optimal convergence rate achievable by CM with knowledge of the condition number — an unrealistic scenario in practice. The two curves corresponding to CM (red and purple) each meet the optimal convergence rate when the condition number is such that $\beta$ is critical. On the left of this critical point, where the convergence rates for CM are flat, the system is ”under-damped” meaning there are complex eigenvalues corresponding to oscillations.
|
| 117 |
+
|
| 118 |
+
We observe that the convergence rate of AggMo interpolates smoothly between the convergence rates of CM with $\beta = 0 . 9$ and $\beta = 0 . 9 9$ as the condition number varies. AggMo’s ability to quickly kill oscillations leads to an approximately three-times faster convergence rate than Nesterov momentum in the under-damped regime without sacrificing performance on larger condition numbers.
|
| 119 |
+
|
| 120 |
+
# 5.2 Additional convergence analysis
|
| 121 |
+
|
| 122 |
+
We evaluate the convergence rate of AggMo in the setting of online convex programming, as proposed in Zinkevich (2003). This is an increasingly common setting to analyze optimization algorithms tailored to machine learning (Duchi et al., 2011; Kingma & Ba, 2014; Reddi et al., 2018). Notably, this is equivalent to analyzing the convergence rate in the setting of stochastic convex optimization.
|
| 123 |
+
|
| 124 |
+
We consider a sequence of unknown convex cost functions, $f _ { 1 } ( { \pmb \theta } ) , \dots , f _ { T } ( { \pmb \theta } )$ . At each time $t$ , our goal is to predict the parameter $\pmb { \theta } _ { t }$ which minimizes the regret,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
R ( T ) = \sum _ { t = 1 } ^ { T } \left[ f _ { t } ( \theta _ { t } ) - f _ { t } ( \theta ^ { * } ) \right] ,
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
where $\pmb { \theta } ^ { * }$ is the fixed point parameter minimizing √ $\textstyle \sum _ { t = 1 } ^ { T } f _ { t } ( \theta * )$ . We are able to show that AggMo has regret bounded by $O ( \sqrt { T } )$ - a result asymptotically comparable to the best known bound (Duchi et al., 2011). We adopt the following definitions from Duchi et al. (2011) to simplify the notation. We write $g _ { t } = \nabla f _ { t } ( \pmb { \theta } _ { t } )$ with $g _ { t , i }$ as the $\dot { \mathbf { \zeta } } _ { i } \mathbf { \mathit { h } }$ element of this vector. Additionally, we write $g _ { 1 : t , i } \in \mathbb { R } ^ { t }$ as the vector containing the $i ^ { t h }$ element of the gradient over the first $t$ iterations; $g _ { 1 : t , i } = [ g _ { 1 , i } , . . . , g _ { t , i } ]$ . Then the following theorem holds,
|
| 131 |
+
|
| 132 |
+
Theorem 1. Assume that $f _ { t }$ has bounded gradients, $| | \nabla f _ { t } ( \pmb { \theta } ) | | _ { 2 } < G , | | \nabla f _ { t } ( \pmb { \theta } ) | | _ { \infty } < G _ { \infty }$ , $\forall \pmb { \theta } \in \mathbb { R } ^ { d }$ Moreover, assume that each $\theta _ { t }$ generated by AggMo satisfies $| | \pmb { \theta } _ { n } - \pmb { \theta } _ { m } | | _ { 2 } \leq D , | | \pmb { \theta } _ { n } - \pmb { \theta } _ { m } | | _ { \infty } \leq D _ { \infty }$ for all $m , n \in \{ 1 , \ldots , T \}$ . Let $\gamma _ { t } = \frac { \gamma } { \sqrt { t } }$ and $\beta _ { t } ^ { ( i ) } = \beta ^ { ( i ) } \lambda ^ { t }$ , $\lambda \in ( 0 , 1 )$ . Then AggMo achieves the following regret bound, for all $T \geq 1$ .
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
R ( T ) \le \frac { D _ { \infty } ^ { 2 } \sqrt { T } } { \gamma } + \frac { \gamma \sqrt { 1 + \log ( T ) } } { 2 K } \sum _ { j = 1 } ^ { d } | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sum _ { i = 1 } ^ { K } \frac { 1 + \beta ^ { ( i ) } } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } } + \frac { D ^ { 2 } } { 2 K \gamma ( 1 - \lambda ) ^ { 2 } } \sum _ { i = 1 } ^ { K } \beta ^ { ( i ) } .
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
It immediately follows that the average regret of AggMo converges, i.e. that √ $R ( T ) / T \to 0$ , by observing that $| | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \leq G _ { \infty } ^ { 2 } \sqrt { T } , \forall j$ . The full proof is given in Appendix C alongside some open questions on the convergence of AggMo.
|
| 139 |
+
|
| 140 |
+
While the statement of Theorem 1 requires strict assumptions we note that this result is certainly non-trivial. Reddi et al. (2018) showed that the average regret of Adam (Kingma & Ba, 2014) is not guaranteed to converge under the same assumptions.
|
| 141 |
+
|
| 142 |
+
# 6 Related work
|
| 143 |
+
|
| 144 |
+
The convergence of momentum methods has been studied extensively, both theoretically and empirically (Wibisono & Wilson, 2015; Wibisono et al., 2016; Wilson et al., 2016; Kidambi et al., 2018). By analyzing the failure modes of existing methods these works motivate successful momentum schemes. Sutskever et al. (2013) explored the effect of momentum on the optimization of neural networks and introduced the momentum view of Nesterov’s accelerated gradient. They focused on producing good momentum schedules during optimization to adapt to ill-conditioned curvature. Despite strong evidence that this approach works well, practitioners today still typically opt for a fixed momentum schedule and vary the learning rate instead.
|
| 145 |
+
|
| 146 |
+
In Appendix C.1 we show that AggMo evolves as a $( \mathsf { K } { + } 1 )$ -th order finite difference equation, enabling AggMo to utilize greater expressiveness over the gradient history. Liang et al. (2016) also introduce dependence on a larger gradient history by adding lagged momentum terms. However, in doing so the authors introduce many new hyperparameters to be tuned.
|
| 147 |
+
|
| 148 |
+
Adaptive gradient methods have been introduced to deal with the ill-conditioned curvature that we often observe in deep learning (Duchi et al., 2011; Kingma & Ba, 2014; Zeiler, 2012; Tieleman & Hinton, 2012). These methods typically approximate the local curvature of the objective to adapt to the geometry of the data. Natural gradient descent (Amari, 1998) preconditions by the Fisher information matrix, which can be shown to approximate the Hessian under certain assumptions (Martens, 2014). Several methods have been proposed to reduce the computational and memory cost of this approach (Martens & Grosse, 2015; Martens, 2010) but these are difficult to implement and introduce additional hyperparameters and computational overhead compared to SGD.
|
| 149 |
+
|
| 150 |
+
Another line of adaptive methods seeks to detect when oscillations occur during optimization. O’Donoghue & Candes (2015) proposed using an adaptive restarting scheme to remove oscillations whenever they are detected. In its simplest form, this is achieved by setting the momentum velocity to zero whenever the loss increases. Further work has suggested using an adaptive momentum schedule instead of zeroing (Srinivasan et al., 2018). Although this technique works well for well-conditioned convex problems it is difficult to find an appropriate restart condition for stochastic optimization where we do not have an accurate computation of the loss. On the other hand, AggMo’s passive damping approach addresses the oscillation problem without the need to detect its occurrence.
|
| 151 |
+
|
| 152 |
+
# 7 Evaluation
|
| 153 |
+
|
| 154 |
+
We evaluated the AggMo optimizer on the following deep learning architectures; deep autoencoders, convolutional networks, and LSTMs. To do so we used four datasets: MNIST (LeCun et al., 1998), CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009) and Penn Treebank (Marcus et al., 1993). In each experiment we compared AggMo to classical momentum, Nesterov momentum, and Adam. These optimizers are by far the most commonly used and even today remain very difficult to outperform in a wide range of tasks. For each method, we performed a grid search over the learning rate and the damping coefficient. For AggMo, we keep the scale $a = 0 . 1$ fixed and vary $K$ as discussed in Section 3.1. Full details of the experimental set up for each task can be found in Appendix D with additional results given in Appendix E.
|
| 155 |
+
|
| 156 |
+
For each of the following experiments we choose to report the validation and test performance of the network in addition to the final training loss when it is meaningful to do so. We include these generalization results because recent work has shown that the choice of optimizer may have a significant effect on the generalization error of the network in practice (Wilson et al., 2017).
|
| 157 |
+
|
| 158 |
+
Table 1: MNIST Autoencoder We display the training MSE for the hyperparameter setting that achieved the best training loss. The validation and test errors are displayed for the hyperparameter setting that achieved the best validation MSE. In each case the average loss and standard deviation over 15 runs is displayed.
|
| 159 |
+
Training Loss Convergence For Increasing Damping Coefficients
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Optimizer</td><td>Train Optimal</td><td colspan="2">Validation Optimal</td></tr><tr><td>Train Loss</td><td>Val. Loss</td><td>Test Loss</td></tr><tr><td>CM</td><td>2.51 ±0.06</td><td>3.55 ± 0.15</td><td>3.45 ± 0.15</td></tr><tr><td>Nesterov</td><td>1.52 ± 0.02</td><td>3.20± 0.01</td><td>3.13 ±0.02</td></tr><tr><td>Adam</td><td>1.44 ± 0.02</td><td>3.80 ± 0.04</td><td>3.72 ± 0.05</td></tr><tr><td>AggMo</td><td>1.39 ± 0.02</td><td>3.05 ± 0.03</td><td>2.96 ± 0.03</td></tr></table>
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 4: Convergence of Autoencoders Training loss during the first 350 epochs of training with each optimizer. The shaded region corresponds to one standard deviation over 15 runs.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 5: Damping Coefficient Investigation Optimizing autoencoders on MNIST with varying damping coefficients and fixed learning rate. Nesterov is unstable with $\beta = 0 . 9 9 9$ .
|
| 168 |
+
|
| 169 |
+
# 7.1 Autoencoders
|
| 170 |
+
|
| 171 |
+
We trained fully-connected autoencoders on the MNIST dataset using a set-up similar to that of Sutskever et al. (2013). While their work focused on finding an optimal momentum schedule we instead kept the momentum fixed and applied a simple learning rate decay schedule. For CM and Nesterov we evaluated damping coefficients in the range: $\{ 0 . 0 , 0 . 9 , 0 . 9 \dot { 9 } , 0 . 9 9 9 \}$ . For Adam, it is standard to use $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ . Since $\beta _ { 1 }$ is analogous to the momentum damping parameter, we considered $\beta _ { 1 } \in \{ 0 . 9 , 0 . 9 9 , 0 . 9 9 9 \}$ and kept $\beta _ { 2 } = \mathsf { \bar { 0 } } . 9 9 9$ . For AggMo, we explored $K$ in $\{ 2 , 3 , 4 \}$ . Each model was trained for 1000 epochs.
|
| 172 |
+
|
| 173 |
+
We report the training, validation, and test errors in Table 1. Results are displayed for the hyperparameters that achieved the best training loss and also for those that achieved the best validation loss. While Adam is able to perform well on the training objective it is unable to match the performance of AggMo or Nesterov on the validation/test sets. AggMo achieves the best performance in all cases.
|
| 174 |
+
|
| 175 |
+
In these experiments the optimal damping coefficient for both CM and Nesterov was $\beta = 0 . 9 9$ while the optimal damping vector for AggMo was $\beta = [ 0 . 0 , 0 . 9 , 0 . 9 9 , 0 . 9 9 9 ]$ , given by $K = 4$ . In Figure 4 we compare the convergence of each of the optimizers under the optimal hyperparameters for the training loss.
|
| 176 |
+
|
| 177 |
+
Increasing damping coefficients During our experiments we observed that AggMo remains stable during optimization for learning rates an order of magnitude (or more) larger than is possible for CM and Nesterov with $\beta$ equal to the max damping coefficient used in AggMo.
|
| 178 |
+
|
| 179 |
+
We further investigated the effect of increasing the maximum damping coefficient of AggMo in Figure 5. The learning rate is fixed at 0.1 and we vary $K$ from 2 to 5. We compared to Nesterov with damping coefficients in the same range (max of 0.9999) and a fixed learning rate of 0.05 (to be consistent with our analysis in Section 4). We do not include the curves for which training is unstable: Nesterov with $\beta \in \{ 0 . { \dot { 9 } } 9 9 , 0 . 9 9 9 9 \}$ and AggMo with $K = 5$ . AggMo is able to take advantage of the larger damping coefficient of 0.999 and achieves the fastest overall convergence.
|
| 180 |
+
|
| 181 |
+
# 7.2 Classification
|
| 182 |
+
|
| 183 |
+
For the following experiments we evaluated AggMo using two network architectures: a neural network with 5 convolutional layers (CNN-5) and the ResNet-32 architecture (He et al., 2016). We use data augmentation and regularization only for the latter. Each model was trained for 400 epochs.
|
| 184 |
+
|
| 185 |
+
<table><tr><td rowspan="2">Optimizer</td><td colspan="2">CNN-5 (CIFAR-10)</td><td colspan="2">ResNet-32 (CIFAR-10)</td><td colspan="2">ResNet-32 (CIFAR-100)</td></tr><tr><td>Val. (%)</td><td>Test (%)</td><td>Val. (%)</td><td>Test (%)</td><td>Val. (%)</td><td>Test (%)</td></tr><tr><td>CM</td><td>64.1</td><td>63.43</td><td>94.20</td><td>93.16</td><td>70.38</td><td>70.21</td></tr><tr><td>Nesterov</td><td>65.14</td><td>64.32</td><td>94.16</td><td>93.18</td><td>70.34</td><td>70.08</td></tr><tr><td>Adam</td><td>63.67</td><td>62.86</td><td>92.36</td><td>90.94</td><td>67.20</td><td>68.08</td></tr><tr><td>AggMo</td><td>65.98</td><td>65.09</td><td>93.87</td><td>93.16</td><td>70.28</td><td>70.11</td></tr><tr><td>CM (β = 0.9)</td><td>64.1</td><td>63.43</td><td>94.10</td><td>93.36</td><td>70.38</td><td>70.21</td></tr><tr><td>Nesterov (β = 0.9)</td><td>64.13</td><td>63.04</td><td>94.16</td><td>93.18</td><td>70.34</td><td>70.08</td></tr><tr><td>AggMo (Default)</td><td>65.98</td><td>65.09</td><td>93.87</td><td>93.16</td><td>70.28</td><td>70.11</td></tr></table>
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Table 2: Classification accuracy on CIFAR-10 and CIFAR-100 We display results using the optimal hyperparameters for CM, Nesterov, Adam and AggMo on the validation set and also with default settings for CM, Nesterov and AggMo.
|
| 189 |
+
Figure 6: ResNet-32 Trained On CIFAR-100 The training loss and validation accuracy during training on CIFAR-100 for each optimizer.
|
| 190 |
+
|
| 191 |
+
For each optimizer we report the accuracy on a randomly held out validation set and the test set. All of the models achieve near-perfect accuracy on the training set and so we do not report this. The results are displayed in Table 2. On the small convolutional network without regularization, AggMo significantly out performed the other methods. For both of the ResNet-32 experiments we observed the best validation accuracy with CM. This is perhaps expected as the model architecture and hyperparameters were likely to have been tuned using CM. Despite this, we observed that AggMo performed consistently well and had the fastest overall convergence.
|
| 192 |
+
|
| 193 |
+
We found that our proposed default hyperparameters for AggMo $a = 0 . 1$ , $K = 3$ ) led to much faster convergence than CM and Nesterov with $\beta = 0 . 9$ , a common default choice. Figure 6 shows the training loss and validation accuracy during training for each optimizer used to train the ResNet32 model. The hyperparameters used for each plot are those which obtained the best validation accuracy. AggMo converged most quickly on the training objective without sacrificing final validation performance.
|
| 194 |
+
|
| 195 |
+
Surprisingly, we found that using AggMo we were also able to train the ResNet-32 architecture on CIFAR-100 without using batch normalization. With a limited search over learning rates we achieved $6 9 . 3 2 \%$ test error compared to a best value of $6 7 . 2 6 \%$ using CM. We also found that, with batch normalization removed, optimization with AggMo remained stable at larger learning rates than with CM.
|
| 196 |
+
|
| 197 |
+
We note that the additional network hyperparameters (e.g. weight decay) are defaults which were likely picked as they work well with classical momentum. This may disadvantage the other optimizers, including our own. Despite this, we found that we are able to outperform CM with the AggMo and Nesterov optimizers without additional tuning of any of these hyperparameters.
|
| 198 |
+
|
| 199 |
+
# 7.3 Language modeling
|
| 200 |
+
|
| 201 |
+
We trained LSTM Language Models on the Penn Treebank dataset. We followed the experimental setup of Merity et al. (2017) and made use of the code provided by the authors. We used the optimal hyperparameter settings described by the authors and vary only the learning rate, momentum and whether gradient clipping is used. The network hyperparameters were tuned using SGD and may not be optimal for the other optimizers we evaluate (including our own). We followed only the base model training used in Merity et al. (2017) and do not include the fine-tuning and continuous cache optimization steps. Each model was trained for 750 epochs.
|
| 202 |
+
|
| 203 |
+
As noted in Merity et al. (2017), it is typically observed that SGD without momentum performs better than momentum-based methods in language modeling tasks. However, in our experiments we observed all momentum-based optimizers but CM outperform SGD without momentum. Surprisingly, we found that Adam is well-suited to this task and achieves the best training, validation, and test performance. We believe that the heavy regularization used when training the network makes Adam a good choice. AggMo is very close in terms of final performance to Adam.
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 7: Convergence of LSTM The training and validation perplexity during training. For each model we use the hyperparameters that obtained the best validation loss. We found that there was very little difference when choosing hyperparameters based on training performance.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>Optimizer</td><td>Train Perplexity</td><td>Val. Perplexity</td><td>Test Perplexity</td></tr><tr><td>*SGD + ASGD</td><td>35.68</td><td>61.17</td><td>59.26</td></tr><tr><td>SGD</td><td>35.34</td><td>63.39</td><td>62.41</td></tr><tr><td>CM</td><td>50.34</td><td>70.37</td><td>68.21</td></tr><tr><td>Nesterov</td><td>34.91</td><td>60.84</td><td>58.44</td></tr><tr><td>Adam</td><td>32.88</td><td>60.25</td><td>57.83</td></tr><tr><td>AggMo</td><td>33.22</td><td>60.36</td><td>57.79</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table 3: Penn Treebank LSTM Perplexity across different optimizers. We display the train, validation, and test error for the optimization run that produced the best validation loss. \* uses ASGD (Polyak & Juditsky, 1992) and corresponds to the base model reported in Merity et al. (2017)
|
| 211 |
+
|
| 212 |
+
Table 3 contains the results for the hyperparameter settings which achieved the best validation error for each optimizer. The first row (denoted \*) uses the scheme suggested in Merity et al. (2017): once the validation loss plateaus we switch to the ASGD (Polyak & Juditsky, 1992) optimizer. The other rows instead decay the learning rate when the validation loss plateaus.
|
| 213 |
+
|
| 214 |
+
Figure 7 compares the convergence of the training and validation perplexity of each optimizer. While the momentum methods converge after 300 epochs, the momentum-free methods converged much more slowly. Surprisingly, we found that SGD worked best without any learning rate decay. Adam converged most quickly and achieved a validation perplexity which is comparable to that of AggMo. While gradient clipping is critical for SGD without momentum, which utilizes a large learning rate, we found that all of the momentum methods perform better without gradient clipping.
|
| 215 |
+
|
| 216 |
+
In short, while existing work encourages practitioners to avoid classical momentum we found that using other momentum methods may significantly improve convergence rates and final performance. AggMo worked especially well on this task over a large range of damping coefficients and learning rates.
|
| 217 |
+
|
| 218 |
+
# 8 Conclusion
|
| 219 |
+
|
| 220 |
+
Aggregated Momentum is a simple extension to classical momentum which is easy to implement and has negligible computational overhead on modern deep learning tasks. We showed empirically that AggMo is able to remain stable even with large damping coefficients and enjoys faster convergence rates as a consequence of this. Nesterov momentum can be viewed as a special case of AggMo. (Incidentally, we found that despite its lack of adoption by deep learning practitioners, Nesterov momentum also showed substantial advantages compared to classical momentum.) On the tasks we explored, AggMo could be used as a drop-in replacement for existing optimizers with little-to-no additional hyperparameter tuning. But due to its stability at higher $\beta$ values, it often delivered substantially faster convergence than both classical and Nesterov momentum.
|
| 221 |
+
|
| 222 |
+
# References
|
| 223 |
+
|
| 224 |
+
Shun-Ichi Amari. Natural gradient works efficiently in learning. Neural computation, 10(2):251–276, 1998.
|
| 225 |
+
|
| 226 |
+
Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. Training deep nets with sublinear memory cost. arXiv preprint arXiv:1604.06174, 2016.
|
| 227 |
+
|
| 228 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 229 |
+
|
| 230 |
+
Gabriel Goh. Why momentum really works. Distill, 2(4):e6, 2017.
|
| 231 |
+
|
| 232 |
+
Herbert Goldstein. Classical mechanics. Pearson Education India, 2011.
|
| 233 |
+
|
| 234 |
+
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. 2211–2221, 2017.
|
| 235 |
+
|
| 236 |
+
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.
|
| 237 |
+
|
| 238 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 239 |
+
|
| 240 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 241 |
+
|
| 242 |
+
Rahul Kidambi, Praneeth Netrapalli, Prateek Jain, and Sham M Kakade. On the insufficiency of existing momentum schemes for stochastic optimization. arXiv preprint arXiv:1803.05591, 2018.
|
| 243 |
+
|
| 244 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 245 |
+
|
| 246 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. 2009.
|
| 247 |
+
|
| 248 |
+
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.
|
| 249 |
+
|
| 250 |
+
Laurent Lessard, Benjamin Recht, and Andrew Packard. Analysis and design of optimization algorithms via integral quadratic constraints. SIAM Journal on Optimization, 26(1):57–95, 2016.
|
| 251 |
+
|
| 252 |
+
Jingwei Liang, Jalal Fadili, and Gabriel Peyre. A multi-step inertial forward-backward splitting ´ method for non-convex optimization. In Advances in Neural Information Processing Systems, pp. 4035–4043, 2016.
|
| 253 |
+
|
| 254 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 255 |
+
|
| 256 |
+
James Martens. Deep learning via hessian-free optimization. In ICML, volume 27, pp. 735–742, 2010.
|
| 257 |
+
|
| 258 |
+
James Martens. New insights and perspectives on the natural gradient method. arXiv preprint arXiv:1412.1193, 2014.
|
| 259 |
+
|
| 260 |
+
James Martens and Roger Grosse. Optimizing neural networks with kronecker-factored approximate curvature. In International conference on machine learning, pp. 2408–2417, 2015.
|
| 261 |
+
|
| 262 |
+
Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and optimizing lstm language models. arXiv preprint arXiv:1708.02182, 2017.
|
| 263 |
+
|
| 264 |
+
Yurii Nesterov. A method of solving a convex programming problem with convergence rate o (1/k2). volume 27, pp. 372–367, 1983.
|
| 265 |
+
|
| 266 |
+
Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013.
|
| 267 |
+
|
| 268 |
+
Brendan O’Donoghue and Emmanuel Candes. Adaptive restart for accelerated gradient schemes. Foundations of computational mathematics, 15(3):715–732, 2015.
|
| 269 |
+
|
| 270 |
+
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.
|
| 271 |
+
|
| 272 |
+
Boris T Polyak. Some methods of speeding up the convergence of iteration methods. USSR Computational Mathematics and Mathematical Physics, 4(5):1–17, 1964.
|
| 273 |
+
|
| 274 |
+
Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM Journal on Control and Optimization, 30(4):838–855, 1992.
|
| 275 |
+
|
| 276 |
+
Sashank J. Reddi, Satyen Kale, and Sanjiv Kumar. On the convergence of adam and beyond. In International Conference on Learning Representations, 2018. URL https://openreview. net/forum?id ${ . } = { }$ ryQu7f-RZ.
|
| 277 |
+
|
| 278 |
+
Vishwak Srinivasan, Adepu Ravi Sankar, and Vineeth N Balasubramanian. Adine: an adaptive momentum method for stochastic gradient descent. In Proceedings of the ACM India Joint International Conference on Data Science and Management of Data, pp. 249–256. ACM, 2018.
|
| 279 |
+
|
| 280 |
+
Weijie Su, Stephen Boyd, and Emmanuel Candes. A differential equation for modeling nesterovs accelerated gradient method: Theory and insights. In Advances in Neural Information Processing Systems, pp. 2510–2518, 2014.
|
| 281 |
+
|
| 282 |
+
Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pp. 1139–1147, 2013.
|
| 283 |
+
|
| 284 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural networks for machine learning, 4(2):26–31, 2012.
|
| 285 |
+
|
| 286 |
+
Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10):1550–1560, 1990.
|
| 287 |
+
|
| 288 |
+
Andre Wibisono and Ashia C Wilson. On accelerated methods in optimization. arXiv preprint arXiv:1509.03616, 2015.
|
| 289 |
+
|
| 290 |
+
Andre Wibisono, Ashia C Wilson, and Michael I Jordan. A variational perspective on accelerated methods in optimization. Proceedings of the National Academy of Sciences, 113(47):E7351–E7358, 2016.
|
| 291 |
+
|
| 292 |
+
Ashia C Wilson, Benjamin Recht, and Michael I Jordan. A lyapunov analysis of momentum methods in optimization. arXiv preprint arXiv:1611.02635, 2016.
|
| 293 |
+
|
| 294 |
+
Ashia C Wilson, Rebecca Roelofs, Mitchell Stern, Nati Srebro, and Benjamin Recht. The marginal value of adaptive gradient methods in machine learning. In Advances in Neural Information Processing Systems, pp. 4151–4161, 2017.
|
| 295 |
+
|
| 296 |
+
Matthew D Zeiler. Adadelta: an adaptive learning rate method. arXiv preprint arXiv:1212.5701, 2012.
|
| 297 |
+
|
| 298 |
+
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.
|
| 299 |
+
|
| 300 |
+
# Appendices
|
| 301 |
+
|
| 302 |
+
# A Nesterov Equivalence
|
| 303 |
+
|
| 304 |
+
In this section we demonstrate this equivalence on two toy problems. In each of the figures included here we take $\beta = 0 . 9 9 9$ .
|
| 305 |
+
|
| 306 |
+
We first consider a 2D quadratic function, $f ( \mathbf { x } ) = \mathbf { x } ^ { T } A \mathbf { x }$ , where $A$ has eigenvalues 1.0 and 0.001.The learning rates for each optimizer are set as described in Section 4. Each optimizer is initialized at the same position. Figure 8 shows both optimizers following the same optimization trajectories. In this setting, the two paths are also visually indistinguishable with $\gamma _ { t } ^ { ( 1 ) } = \dot { \gamma _ { t } } ^ { ( 2 ) } = 2 \gamma$ for $\mathbf { A g g M o }$ .
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
|
| 310 |
+
Figure 8: Equivalence of Nesterov and AggMo when $\beta = 0 . 9 9 9$ . The optimization plots for $f ( x ) = \mathbf { x } ^ { T } A \mathbf { x }$ are visibly identical (circles correspond to AggMo and squares to Nesterov - the markers are offset for readability).
|
| 311 |
+
|
| 312 |
+
We now optimize the Rosenbrock function, given by,
|
| 313 |
+
|
| 314 |
+
$$
|
| 315 |
+
f ( x , y ) = ( y - x ^ { 2 } ) ^ { 2 } + 1 0 0 ( x - 1 ) ^ { 2 }
|
| 316 |
+
$$
|
| 317 |
+
|
| 318 |
+
This function has a global minimum at $( x , y ) = 1$ . Once again the optimizers are initialized at the same point but for this example we take $\gamma _ { t } ^ { ( 1 ) } = \gamma _ { t } ^ { ( 2 ) } = 2 \gamma$ for $\mathbf { A g g M o }$ . Figure 9 shows the optimization trajectories of both algorithms. In this case we see that the updates are initially indistinguishable but begin to differ as the algorithms approach the origin.
|
| 319 |
+
|
| 320 |
+
# B Quadratic Convergence Analysis
|
| 321 |
+
|
| 322 |
+
In this section we present details of the convergence rate computations in Figure 3. We also present some additional supporting results.
|
| 323 |
+
|
| 324 |
+
We first note that for quadratic functions of the form $f ( \mathbf { x } ) = \frac { 1 } { 2 } \mathbf { x } ^ { T } A x + b ^ { T } \mathbf { x }$ xT Ax + bT x we can write the AggMo optimization procedure as a linear dynamical systems in $K \bar { + } 1$ variables:
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\left[ \begin{array} { c } { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \vdots } \\ { \mathbf { v } _ { t + 1 } ^ { ( K ) } } \\ { \mathbf { x } _ { t + 1 } - \mathbf { x } ^ { * } } \end{array} \right] = B \left[ \begin{array} { c } { \mathbf { v } _ { t } ^ { ( 1 ) } } \\ { \vdots } \\ { \mathbf { v } _ { t } ^ { ( K ) } } \\ { \mathbf { x } _ { t } - \mathbf { x } ^ { * } } \end{array} \right]
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 9: Approximate equivalence of Nesterov and AggMo when $\beta = 0 . 9 9 9$ . The optimization trajectories are initially visibly identical but begin to differ slightly after more iterations.
|
| 332 |
+
|
| 333 |
+
The spectral norm of the matrix $B$ determines the rate at which the linear dynamical system converges and thus bounds $| | \mathbf { x } _ { t } - \mathbf { x } ^ { * } | | ^ { 2 }$ (Lessard et al., 2016). We can write down the exact form of $B$ as follows,
|
| 334 |
+
|
| 335 |
+
$$
|
| 336 |
+
B = \left[ \begin{array} { c c c c c } { \beta ^ { ( 1 ) } I } & { 0 } & { \cdots } & { 0 } & { - A } \\ { 0 } & { \beta ^ { ( 2 ) } I } & { \ddots } & { \vdots } & { \vdots } \\ { \vdots } & { \ddots } & { \ddots } & { 0 } & { - A } \\ { 0 } & { \cdots } & { 0 } & { \beta ^ { ( K ) } I } & { - A } \\ { \frac { \gamma \beta ^ { ( 1 ) } } { K } I } & { \frac { \gamma \beta ^ { ( 2 ) } } { K } I } & { \cdots } & { \frac { \gamma \beta ^ { ( K ) } } { K } I } & { ( I - \gamma A ) } \end{array} \right]
|
| 337 |
+
$$
|
| 338 |
+
|
| 339 |
+
We note in particular that in the special case of $K = 1$ (CM) we recover the characteristic equation of O’Donoghue & Candes (2015):
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
u ^ { 2 } - ( 1 + \beta - \gamma \lambda _ { i } ) u + \beta = 0
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Which in turn yields the critical damping coefficient and optimal rate, with
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\beta ^ { * } = \left( \frac { \sqrt { \kappa } - 1 } { \sqrt { \kappa } + 1 } \right) ^ { 2 } .
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
When $\beta < \beta ^ { * }$ the system is over-damped and exhibits slow monotone convergence (Figure 1 (a)). When $\beta > \beta ^ { * }$ the system is under-damped and the characteristic equation yields imaginary solutions that correspond to oscillations (Figure 1 (b)) with convergence rate equal to $1 - | \beta |$ . At the critical damping coefficient the convergence is optimal at $1 . 0 - { \frac { { \sqrt { \kappa } } - 1 } { { \sqrt { \kappa } } + 1 } }$
|
| 352 |
+
|
| 353 |
+
We can combine this analysis with Theorem 2 from Sutskever et al. (2013) to recover similar convergence bounds for Nesterov momentum.
|
| 354 |
+
|
| 355 |
+
Producing Figure 3 To produce the curves in Figure 3 we compute the eigenvalues directly from the matrix $B$ for matrices $A$ with varying condition numbers. While we can find the optimal learning rate for CM and Nesterov momentum in closed form we have been unable to do so for AggMo. Therefore, we instead perform a fine-grained grid search to approximate the optimal learning rate for each condition number.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
Figure 10: Velocity during quadratic optimization with CM, Nesterov, and AggMo. (Best viewed in color) The shaded region shows the direction and relative magnitude of the velocities throughout optimization for each optimizer. $\mathbf { A g g M o }$ has multiple shaded regions corresponding to the different velocities.
|
| 359 |
+
|
| 360 |
+
Studying Velocity We now present a brief study illustrating how using multiple velocities can break oscillations during optimization.
|
| 361 |
+
|
| 362 |
+
Figure 10 shows the optimization of a 1-D quadratic function with CM, Nesterov, and AggMo. The shaded region around each curve represents the direction and relative magnitude of the velocities term during optimization. CM (a) has a single velocity and oscillates at a near-constant amplitude. For Nesterov momentum (b) we display the velocity and the ”error-correcting” term. AggMo (c) has shaded regions for each velocity. For AggMo, the velocity with $\beta = 0 . 9$ oscillates at a higher frequency and thus damps the whole system.
|
| 363 |
+
|
| 364 |
+
# C Convergence Proof
|
| 365 |
+
|
| 366 |
+
Here we present the proof of Theorem $^ { 5 1 }$ . We introduce some simplifying notation used in Duchi et al. (2011). We write $g _ { t } = \nabla f ( \theta _ { t } )$ , with $g _ { t , i }$ denoting the $i ^ { \mathrm { { t h } } }$ element of the vector $g _ { t }$ . We further write $g _ { 1 : t , i } \in \mathbb { R } ^ { t }$ for the $i ^ { \mathrm { { t h } } }$ dimension of gradients up to iteration $t$ .
|
| 367 |
+
|
| 368 |
+
We begin with the following lemma,
|
| 369 |
+
Lemma 1. We write $\mathbf { v } _ { t , j } ^ { i }$ to indicate the $j ^ { t h }$ element of the $i ^ { t h }$ velocity at time $t$ . Assume $g _ { t }$ is
|
| 370 |
+
bounded, then the following holds for all $j$ ,
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) } { } ^ { 2 } } { \sqrt { t } } \leq | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sqrt { 1 + \log ( T ) } \sum _ { i = 1 } ^ { K } \frac { 1 } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } }
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
Proof We begin by expanding the last term in the sum using the update equations,
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
\begin{array} { r l } & { \displaystyle \sum _ { t = 1 } ^ { T } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } = \sum _ { t = 1 } ^ { T - 1 } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } + \frac { 1 } { \sqrt { T } } \sum _ { i = 1 } ^ { K } \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } _ { h } ^ { ( i ) } ) ^ { T - h } g _ { h , j } \right) ^ { 2 } } \\ & { \qquad \leq \sum _ { t = 1 } ^ { T - 1 } \displaystyle \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } + \frac { 1 } { \sqrt { T } } \sum _ { i = 1 } ^ { K } \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } ^ { ( i ) } ) ^ { T - h } \right) \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } ^ { ( i ) } ) ^ { T - h } g _ { h , j } ^ { 2 } \right) } \\ & { \qquad \leq \displaystyle \sum _ { t = 1 } ^ { T - 1 } \sum _ { i = 1 } ^ { K } \frac { \mathbf { v } _ { t , j } ^ { ( i ) ^ { 2 } } } { \sqrt { t } } + \frac { 1 } { \sqrt { T } } \sum _ { i = 1 } ^ { K } \frac { 1 } { 1 - \boldsymbol { \beta } ^ { ( i ) } } \left( \sum _ { h = 1 } ^ { T } ( \boldsymbol { \beta } ^ { ( i ) } ) ^ { T - h } g _ { h , j } ^ { 2 } \right) } \end{array}
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
The first inequality is obtained via Cauchy-inequality follows directly from the fact chat $\beta _ { t } ^ { ( i ) } \le \beta$ for all . We $t$ . The secondn apply this $\begin{array} { r } { \sum _ { h = 1 } ^ { T } ( \beta ^ { ( i ) } ) ^ { T - h } < 1 / ( 1 - \beta ^ { ( i ) } ) } \end{array}$ $t$
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\begin{array} { r l } { \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { N } \frac { \partial _ { i } ^ { j } } { \partial t } } & { = \sum _ { j = 1 } ^ { N } \sum _ { i = 1 } ^ { N } \frac { 1 } { \sqrt { N } } , } \\ { \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } \frac { \partial _ { i } ^ { j } } { \partial t } } & { = \sum _ { j = 1 } ^ { N } \frac { 1 } { \sqrt { N } } , } \\ & { = \sum _ { i = 1 } ^ { N } \frac { 1 } { \sqrt { N } } , } \\ & { = \sum _ { j = 1 } ^ { N } \frac { 1 } { N } - 2 \beta \sum _ { i } ^ { j } \frac { 1 } { N } , } \\ & { = \sum _ { i = 1 } ^ { N } \frac { 1 } { N } - 2 \beta \sum _ { i } ^ { j } \frac { 1 } { N } , } \\ & { = \sum _ { j = 1 } ^ { N } \frac { 1 } { N } - 2 \beta \sum _ { i } ^ { j } \frac { 1 } { N } , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \\ & { \leq \frac { \beta } { N } - 1 1 , } \end{array}
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Under equality we swap the order of sums and collect terms under $g _ { t }$ . The third inequality follows from $\textstyle \sum _ { j = 1 } ^ { t } ( \beta ^ { ( i ) } ) ^ { j - t } < 1 / ( 1 - \beta )$ . The fourth inequality is an application of Cauchy-Schwarz. The final inequality is from the harmonic sum bound: $\textstyle \sum _ { t = 1 } ^ { T } 1 / t \leq 1 + \log ( T )$ . This completes the proof.
|
| 389 |
+
|
| 390 |
+
Proof of Theorem 1 From the update equations we may write,
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { c } { \displaystyle \pmb { \theta } _ { t + 1 } = \pmb { \theta } _ { t } + \frac { \gamma _ { t } } { K } \sum _ { i = 1 } ^ { K } \mathbf { v } _ { t } ^ { ( i ) } } \\ { = \displaystyle \pmb { \theta } _ { t } + \frac { \gamma _ { t } } { K } \sum _ { i = 1 } ^ { K } ( \beta _ { t } ^ { ( i ) } \mathbf { v } _ { t - 1 } ^ { ( i ) } - g _ { t } ) } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
We now shift focus to only the $j ^ { \mathrm { t h } }$ dimension. We subtract $\theta { * _ { j } }$ from both sides and square,
|
| 397 |
+
|
| 398 |
+
$$
|
| 399 |
+
( \pmb { \theta } _ { t + 1 , j } - \pmb { \theta } _ { j } ^ { * } ) ^ { 2 } = ( \pmb { \theta } _ { t , j } - \pmb { \theta } _ { j } ^ { * } ) ^ { 2 } + 2 \frac { \gamma _ { t } } { K } ( \pmb { \theta } _ { t , j } - \pmb { \theta } _ { j } ^ { * } ) \sum _ { i = 1 } ^ { K } ( \beta _ { t } ^ { ( i ) } \mathbf { v } _ { t - 1 , j } ^ { ( i ) } - g _ { t , j } ) + \frac { \gamma _ { t } ^ { 2 } } { K ^ { 2 } } ( \sum _ { i = 1 } ^ { K } \mathbf { v } _ { t , j } ^ { ( i ) } ) ^ { 2 }
|
| 400 |
+
$$
|
| 401 |
+
|
| 402 |
+
We can rearrange this expression and bound as follows,
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l } { \epsilon _ { 1 } ( \theta _ { 2 } - \theta _ { 3 } ^ { * } ) - \frac { 1 } { 2 \pi ^ { 2 } } \langle \theta _ { 3 } , - \theta _ { 2 } ^ { * } \rangle - \langle \theta _ { 1 } , \dots , \theta _ { 2 } ^ { * } \rangle \Big | + \langle \theta _ { 3 } , \dots , \theta _ { 3 } ^ { * } \rangle \frac { 1 } { \epsilon _ { 2 } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } } , \frac { 1 } { \beta } + \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { 2 \pi ^ { 2 } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } } , \frac { 1 } { \beta } + \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { 2 \pi ^ { 2 } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } } , } \\ { - \frac { 1 } { \sqrt { \pi ^ { 2 } } } \langle \theta _ { 3 } , - \theta _ { 2 } ^ { * } \rangle - \langle \theta _ { 1 } , \dots , \theta _ { 2 } ^ { * } \rangle \Big | + \frac { 1 } { \sqrt { \pi ^ { 2 } } } \sqrt { \langle \theta _ { 1 } , \dots , \theta _ { 3 } ^ { * } \rangle \langle \theta _ { 2 } ^ { * } , \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } , \frac { 1 } { \beta } + \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { 2 \pi ^ { 2 } } } } \\ - \frac { 1 } { 2 \pi ^ { 2 } } \frac { 1 } { \sqrt { \pi ^ { 2 } } } \langle \theta _ { 3 } , - \theta _ { 2 } ^ { * } \rangle - \langle \theta _ { 1 } , \dots , \theta _ { 2 } ^ { * } \rangle \Big | + \frac { 1 } { \sqrt { \pi ^ { 2 } } } \frac { \hat { \mathcal { S } } _ { \hat { \mathcal { S } } } ^ { ( 1 ) } } { \epsilon _ { 3 } \sqrt { \pi ^ { 2 } } } \\ - \frac { 1 } { 2 \pi ^ { 2 } } \frac { 1 } \sqrt \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
The first inequality is an application of Young’s inequality. For the second inequality we use the sum-of-squares inequality. We now make use of convexity, and take the sum over dimensions and time,
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\begin{array} { r l } { \displaystyle \sum _ { i = 1 } ^ { n } f ( \theta _ { i } ) - f ( \theta ^ { i } ) \in \sum _ { t = 1 } ^ { n } \sum _ { n = 1 } ^ { \infty } \partial _ { t } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle } \\ { \displaystyle } & { \le \sum _ { t = 1 } ^ { N } \frac { 1 } { 2 \pi ^ { 2 } \nu ^ { 2 } } \frac { 1 } { 2 \pi ^ { 3 } \nu } \Big [ ( \theta _ { i , t } \partial _ { t } g _ { t } ) ^ { 2 } - ( \theta _ { i } - \pi _ { i } - \theta _ { i } ^ { t } ) ^ { 2 } \Big ] + \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \frac { \partial _ { t } ^ { ( 2 ) } } { 2 \pi \beta _ { i - 1 } } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle ^ { 2 } } \\ & { \quad \quad \quad + \frac { 1 } { K } \frac { K } { \pi ^ { 2 } \nu ^ { 2 } } \frac { 1 } { 2 \pi ^ { 3 } } \partial _ { t } \langle \theta _ { i - 1 , t } ^ { t } \rangle ^ { 2 } + \frac { 1 } { 2 K } \frac { K } { \pi ^ { 2 } \nu ^ { 2 } } \langle \theta _ { i } , \theta _ { i } ^ { t } \rangle } \\ & { \le \displaystyle \sum _ { t = 1 } ^ { N } \frac { 1 } { 2 \pi ^ { 4 } } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle ^ { 2 } + \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \langle \theta _ { i } , - \theta _ { i } ^ { t } \rangle ^ { 2 } \frac { 1 } { K } \frac { 1 } { K } + \frac { 1 } { \pi ^ { 2 } \nu ^ { 2 } } \frac { 1 } { K } } \\ & { \quad \quad \quad + \frac { 1 } { K } \frac { K } { \pi ^ { 2 } K } \frac { \partial _ { t } ^ { ( 2 ) } } { 2 \pi ^ { 3 } } \frac { 1 } { K } \Big [ \theta _ { i , t } \partial _ { t } ^ { t } \Big ] \overset { ( 3 ) } { \le } \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \frac { \partial _ { t } ^ { ( 2 ) } } { 2 \pi ^ { 3 } } } \\ & \quad \quad \quad + \frac { 1 } { K } \frac { K } { \pi ^ { 2 } K } \frac \partial _ { t } ^ ( 2 \end{array}
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
We now make use of the bounding assumptions, $| | \pmb \theta _ { m } - \pmb \theta _ { n } | | _ { 2 } \leq D$ and $| | \pmb \theta _ { m } - \pmb \theta _ { n } | | _ { \infty } \leq D _ { \infty }$ ,
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
R ( T ) \le \frac { D _ { \infty } ^ { 2 } \sqrt { T } } { \gamma } + \frac { \gamma \sqrt { 1 + \log ( T ) } } { 2 K } \sum _ { j = 1 } ^ { d } | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sum _ { i = 1 } ^ { K } \frac { 1 + \beta ^ { ( i ) } } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } } + \frac { D ^ { 2 } } { 2 \gamma } \frac { 1 } { K } \sum _ { i = 1 } ^ { K } \sum _ { t = 1 } ^ { T } \beta ^ { ( i ) } \lambda ^ { t - 1 } \sqrt { t }
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
The first two terms are collapsed using a telescoping sum. Using $\textstyle \sum _ { t } \lambda ^ { t - 1 } { \sqrt { t } } \leq 1 / ( 1 - \lambda ) ^ { 2 }$ , we achieve the following bound,
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
R ( T ) \le \frac { D _ { \infty } ^ { 2 } \sqrt { T } } { \gamma } + \frac { \gamma \sqrt { 1 + \log ( T ) } } { 2 K } \sum _ { j = 1 } ^ { d } | | g _ { 1 : T , j } | | _ { 4 } ^ { 2 } \sum _ { i = 1 } ^ { K } \frac { 1 + \beta ^ { ( i ) } } { ( 1 - \beta ^ { ( i ) } ) ^ { 2 } } + \frac { D ^ { 2 } } { 2 K \gamma ( 1 - \lambda ) ^ { 2 } } \sum _ { i = 1 } ^ { K } \beta ^ { ( i ) }
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
# C.1 Open Questions on Convergence
|
| 427 |
+
|
| 428 |
+
While studying the convergence properties of AggMo we made several interesting observations which presented theoretical challenges. We present some of these observations here to shed light on key differences between AggMo and existing momentum methods. We hope that these will provoke further study.
|
| 429 |
+
|
| 430 |
+
Further reduction of $B$ In Appendix $\mathbf { B }$ we derived the matrix $B$ in order to get bounds on the convergence. We can further reduce $B$ to block diagonal form, where the $j ^ { t h }$ block takes the form,
|
| 431 |
+
|
| 432 |
+
$$
|
| 433 |
+
B _ { j } = \left[ \begin{array} { c c c c c } { \beta ^ { ( 1 ) } } & { 0 } & { \cdots } & { 0 } & { - \lambda _ { j } } \\ { 0 } & { \beta ^ { ( 2 ) } } & { \ddots } & { \vdots } & { \vdots } \\ { \vdots } & { \ddots } & { \ddots } & { 0 } & { - \lambda _ { j } } \\ { 0 } & { \cdots } & { 0 } & { \beta ^ { ( K ) } } & { - \lambda _ { j } } \\ { \frac { \gamma \beta ^ { ( 1 ) } } { K } } & { \frac { \gamma \beta ^ { ( 2 ) } } { K } } & { \cdots } & { \frac { \gamma \beta ^ { ( K ) } } { K } } & { ( 1 - \gamma \lambda _ { j } ) } \end{array} \right]
|
| 434 |
+
$$
|
| 435 |
+
|
| 436 |
+
From this relatively simple form we may be able to derive a closed-form solution for the eigenvalues which would allow us to reason theoretically about the quadratic convergence properties of $\mathbf { A g g M o }$ . An easier goal would be finding suitable conditions under which the eigenvalues are complex and the system is under-damped.
|
| 437 |
+
|
| 438 |
+
Finite Difference Equation In this section we demonstrate that the dynamics of AggMo can be written as a $( K + 1 )$ -th order finite difference equation. While most momentum methods can be viewed as the discretization of second order ODEs (Wilson et al., 2016) it seems that AggMo does not fall into this class of algorithms. As a consequence, it becomes difficult to apply existing convergence proof techniques to AggMo.
|
| 439 |
+
|
| 440 |
+
For simplicity, we assume a fixed learning rate $\gamma$ for all time steps. We will first tackle the special case $K = 2$ . From the AggMo update rule, we have
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\left[ \begin{array} { c } { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t - 1 } ^ { ( 2 ) } } \end{array} \right] = \left[ \begin{array} { c c c c c c } { 0 } & { 0 } & { \beta _ { 1 } } & { 0 } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { \beta _ { 2 } } & { 0 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { \beta _ { 1 } } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { 0 } & { \beta _ { 2 } } \\ { 0 } & { 0 } & { \frac { \gamma } { K } } & { \frac { \gamma } { K } } & { 1 } & { 0 } \\ { 0 } & { 0 } & { 0 } & { 0 } & { \frac { \gamma } { K } } & { 1 + \frac { \gamma } { K } } \end{array} \right] \left[ \begin{array} { c } { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t + 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t } ^ { ( 2 ) } } \\ { \mathbf { v } _ { t - 1 } ^ { ( 1 ) } } \\ { \mathbf { v } _ { t - 1 } ^ { ( 2 ) } } \end{array} \right] - \left[ \begin{array} { c } { \nabla _ { \theta } f ( \theta _ { t } ) } \\ { \nabla _ { \theta } f ( \theta _ { t } ) } \\ { \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \theta _ { t } - \theta _ { t - 1 } } \\ { \theta _ { t - 1 } - \theta _ { t - 2 } } \end{array} \right]
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
Denoting the matrices as symbols correspondingly, it becomes $\mathbf { v } = \mathbf { B } \mathbf { v } - \mathbf { g }$ , therefore
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\mathbf { v } = - ( \mathbf { I } - \mathbf { B } ) ^ { - 1 } \mathbf { g }
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Denote $\delta _ { t } = \theta _ { t } - \theta _ { \star }$ , then $\theta _ { t } - \theta _ { t - 1 } = \delta _ { t } - \delta _ { t - 1 }$ . Note that $\begin{array} { r } { \theta _ { t + 1 } = \theta _ { t } + \frac { \gamma _ { t + 1 } } { 2 } \big ( \mathbf { v } _ { t + 1 } ^ { ( 1 ) } + \mathbf { v } _ { t + 1 } ^ { ( 2 ) } \big ) } \end{array}$ , plugging Eq 10 into it, we have
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\delta _ { t + 1 } = \delta _ { t } - { \frac { \gamma } { 2 } } [ 1 , 1 , 0 , 0 , \cdots ] ^ { \top } ( \mathbf { I } - \mathbf { B } ) ^ { - 1 } \mathbf { g }
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
Which reduces to the following finite difference equation,
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\dot { \iota } _ { t + 1 } = ( 1 + \beta _ { 1 } + \beta _ { 2 } ) \delta _ { t } + ( \beta _ { 1 } + \beta _ { 2 } + \beta _ { 1 } \beta _ { 2 } ) \delta _ { t - 1 } - \beta _ { 1 } \beta _ { 2 } \delta _ { t - 2 } + \frac { \gamma } { 2 } ( 2 \nabla _ { \theta } f ( \theta _ { t } ) - ( \beta _ { 1 } + \beta _ { 2 } ) \nabla _ { \theta } f ( \theta _ { t - 1 } ) )
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
For $K \geq 2$ , we only need to change $\operatorname { E q } 9$ accordingly, follow the remaining derivations, and recover a $( K + 1 )$ -th order difference equation. We could also derive the same result using sequence elimination, made simpler with some sensible variable substitutions.
|
| 465 |
+
|
| 466 |
+
This result is of considerable importance. Existing momentum methods can generally be rewritten as a second order difference equation (Section 2 in O’Donoghue & Candes (2015)) which then induce a second order ODE (Su et al., 2014; Wibisono & Wilson, 2015). The momentum optimization procedure can then be thought of as a discretization of a Hamiltonian flow. On the other hand, AggMo does not obviously lend itself to the analytical tools developed in this setting - it is not obvious whether the form in AggMo is indeed a discretization of a Hamiltonian flow.
|
| 467 |
+
|
| 468 |
+
# D Experiments
|
| 469 |
+
|
| 470 |
+
All of our experiments are conducted using the pytorch library Paszke et al. (2017). In each experiment we make use of early stopping to determine the run with the best validation performance.
|
| 471 |
+
|
| 472 |
+
# D.1 Autoencoders
|
| 473 |
+
|
| 474 |
+
For the autoencoders we train fully connected networks with encoders using the following architecture: 784-1000-500-250-30. The decoder reverses this architecture. We use relu activations throughout the network. We train for a total of 1000 epochs using a multiplicative learning rate decay of 0.1 at 200, 400, and 800 epochs. We train using batch sizes of 200.
|
| 475 |
+
|
| 476 |
+
For these experiments the training set consists of $90 \%$ of the training data with the remaining $10 \%$ being used for validation.
|
| 477 |
+
|
| 478 |
+
For each optimizer we searched over the following range of learning rates: $\{ \ : 0 . 1 , 0 . 0 5 , 0 . 0 1 , 0 . 0 0 5 .$ 0.001, 0.0005, 0.0001, 0.00005, 0.00001}.
|
| 479 |
+
|
| 480 |
+
# D.2 Classification
|
| 481 |
+
|
| 482 |
+
For each of the classification tasks we train for a total of 400 epochs using batchsizes of 128. We make use of a multiplicative learning rate decay of 0.1 at 150 and 250 epochs. For each of these experiments we use $80 \%$ of the training data for training and use the remaining $20 \%$ as validation.
|
| 483 |
+
|
| 484 |
+
In these experiments we searched over the following learning rates for all optimizers: $\left\{ \ 0 . 1 , 0 . 0 5 \right.$ 0.01, 0.005, 0.001, 0.0005, 0.0001 $\}$ . We searched over the same damping coefficients as in the autoencoder experiments. Each model was trained for a total of 500 epochs.
|
| 485 |
+
|
| 486 |
+
When training without batch normalization we explored a smaller range of learning rates for both CM and AggMo: $\{ 0 . 1 , 0 . 0 5 , 0 . 0 1 , 0 . 0 0 5 \}$ .
|
| 487 |
+
|
| 488 |
+
CNN-5 The CNN-5 model uses relu activations throughout and 2x2 max pooling with stride 2. The first convolutional layer uses an 11x11 kernel with a stride of 4. This is followed by a max pooling layer. There is then a 5x5 convolutional kernel followed by max pooling. The network then uses three 3x3 convolutional layers and a final max pooling layer before feeding into a fully connected output layer. We do not use any regularization when training this model.
|
| 489 |
+
|
| 490 |
+
ResNet-32 We use the ResNet-32 architecture on both CIFAR-10 and CIFAR-100. We make use of a weight decay of 0.0005 and use batch normalization (Ioffe & Szegedy, 2015). We introduce data augmentation by using random crops with a padding of 4 and use random horizontal flips with probability 0.5.
|
| 491 |
+
|
| 492 |
+
# D.3 LSTM Language Modelling
|
| 493 |
+
|
| 494 |
+
We train LSTMs with 3-layers containing 1150 hidden units per layer, and a 400 embedding size. Within the network we use dropout on the layers with probability 0.4. The hidden layers use dropout with probability 0.3 and the input embedding layers use dropout with probability 0.65 while the embedding layer itself uses dropout with probability 0.1. We also apply the weight drop method proposed in Merity et al. (2017) with probability 0.5. L2 regularization is applied on the RNN activations with a scaling of 2.0, we also use temporal activation regularization (slowness regularization) with scaling 1.0. Finally, all weights receive a weight decay of $1 . 2 \mathrm { e } { \cdot } 6 .$ .
|
| 495 |
+
|
| 496 |
+
We train the model using variable sequence lengths and batch sizes of 80. We measure the validation loss during training and decrease the learning rate if the validation loss has not decreased for 15 epochs. We found that a learning rate decay of 0.5 worked best for all optimizers except for SGD which achieved best performance with a fixed learning rate.
|
| 497 |
+
|
| 498 |
+
For SGD, CM, AggMo and Nesterov we searched over learning rates in the range $\{ 5 0 , 3 0 , 1 0 , 5$ 2.5, 1, 0.1, 0.01}. We found that Adam required much smaller learning rates in this setting and so searched over values in the range $\{ 0 . 1 , 0 . 0 \dot { 5 } , 0 . 0 1 , 0 . 0 0 5 , 0 . 0 0 1 , 0 . 0 0 0 5 , 0 . 0 0 0 1 \}$ . We searched over the damping coefficients as in the previous experiments. Each model was trained for 750 epochs, as in Merity et al. (2017).
|
| 499 |
+
|
| 500 |
+
# E Additional Results
|
| 501 |
+
|
| 502 |
+
In this section we display some of the experimental results which we are unable to fit in the main paper.
|
| 503 |
+
|
| 504 |
+
# E.1 Toy Problem
|
| 505 |
+
|
| 506 |
+
To better understand how AggMo is able to help in non-convex settings we explore its effectiveness on a simple non-convex toy problem. The function we aim to optimize is defined as follows,
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\begin{array} { c } { { f ( x , y ) = \log ( e ^ { x } + e ^ { - x } ) + } } \\ { { b \log \left( e ^ { e ^ { x } ( y - \sin ( a x ) ) } + e ^ { - e ^ { x } ( y - \sin ( a x ) ) } \right) } } \end{array}
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+

|
| 513 |
+
Figure 11: Comparison of classical momentum and aggregated momentum on toy problem (13) with $a = 8 , b =$ 10. In each case the optimizer is initialized at $( x , y ) = ( - 2 , 0 )$
|
| 514 |
+
|
| 515 |
+
Table 4: MNIST Autoencoder with default settings We display the training MSE for the initial learning rate that achieved the best training loss. The validation and test errors are displayed for the initial learning rate that achieved the best validation MSE.
|
| 516 |
+
|
| 517 |
+
<table><tr><td rowspan="2">Optimizer</td><td>Train Optimal</td><td colspan="2">Validation Optimal</td></tr><tr><td>Train Loss</td><td>Val. Loss</td><td>Test Loss</td></tr><tr><td>CM β = 0.9</td><td>2.07</td><td>4.95</td><td>4.98</td></tr><tr><td>Nesterov β = 0.9</td><td>1.94</td><td>4.63</td><td>4.62</td></tr><tr><td>AggMo (Default)</td><td>1.60</td><td>3.14</td><td>3.04</td></tr></table>
|
| 518 |
+
|
| 519 |
+
where $a$ and $b$ are constants which may be varied. We choose this function because it features flat regions and a series of non-convex funnels with varied curvature. The optimizer must traverse the flat regions quickly whilst remaining stable within the funnels. This function has an optimal value at $( x , y ) { \overset { \vartriangle } { = } } ( 0 , { \dot { 0 } } )$ .
|
| 520 |
+
|
| 521 |
+
Figure 11 compares the performance of classical momentum and aggregated momentum when optimizing Equation 13 with $a = 8 , b = 1 0$ . We see that GD with $\beta = 0$ and $\beta = 0 . 9$ are unable to leave the flat region around $x < - 1$ . For GD with $\beta = 0 . 9 9 9$ the optimizer enters the funnels but frequently becomes unstable with oscillations and finally overshoots the optimum. Compared to GD, AggMo is able to quickly traverse both the flat region and the funnels while remaining stable. AggMo also successfully slows down quickly once reaching the optimum.
|
| 522 |
+
|
| 523 |
+
# E.2 Comparison at default damping settings
|
| 524 |
+
|
| 525 |
+
In this section we present results using the default damping coefficient settings for the autoencoder and LSTM experiments.
|
| 526 |
+
|
| 527 |
+
The default settings for CM, Nesterov, and AggMo are compared in Table 4. The default settings of AggMo outperform both CM and Nesterov significantly. Moreover, while the AggMo default settings perform similarly to the best results in Table 1 there is a large gap for the CM and Nesterov defaults. This suggests that for this task AggMo is less sensitive to hyperparameter tuning than the other methods.
|
| 528 |
+
|
| 529 |
+
For the LSTM experiments we found that all methods worked best with their default damping coefficients except for Nesterov momentum which used $\beta = 0 . 9 9$ . For Nesterov momentum with $\beta = 0 . 9$ the validation perplexity was 63.67 and the test perplexity was 61.45. AggMo with default settings achieved better training, validation and test perplexity than both the CM and Nesterov defaults.
|
| 530 |
+
|
| 531 |
+
# F Beta-Averaged Momentum
|
| 532 |
+
|
| 533 |
+
In this section we present a continuous analog of AggMo which provides additional insight into its effectiveness.
|
| 534 |
+
|
| 535 |
+
The AggMo update rule features the average of several velocities with some chosen damping coefficients, $\beta$ . A natural extension to this formulation instead considers a mapping from beta values to velocities with the space of velocities being integrated over instead of summed. Explicitly, we write this update rule as,
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\begin{array} { r l } & { \mathbf { v } _ { t } = b \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \pmb { \theta } _ { t - 1 } ) } \\ & { \pmb { \theta } _ { t } = \pmb { \theta } _ { t - 1 } + \gamma \displaystyle \int _ { 0 } ^ { 1 } \mathbf { v } _ { t } \pi ( b ) d b } \end{array}
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
Where $\pi ( b )$ is a probability density defined on $[ 0 , 1 ]$ . We can link this back to aggregated momentum in the following way. If we sampled $b ^ { ( i ) }$ under the density $\pi$ for $i = 1 : M$ then the procedure described by Equation 3 is approximating Equation 14 via Monte Carlo Integration.
|
| 542 |
+
|
| 543 |
+
Although this seems like a reasonable idea, it is not obvious whether we can compute this integral in closed form. We can understand this update rule by expanding $\mathbf { v } _ { t }$ recursively,
|
| 544 |
+
|
| 545 |
+
$$
|
| 546 |
+
\begin{array} { l } { \displaystyle \mathbf { v } _ { t } = b \mathbf { v } _ { t - 1 } - \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \displaystyle \quad = b ( b \mathbf { v } _ { t - 2 } - \nabla _ { \theta } f ( \theta _ { t - 2 } ) ) - \nabla _ { \theta } f ( \theta _ { t - 1 } ) } \\ { \displaystyle \quad = b ^ { t } \mathbf { v } _ { 0 } - \sum _ { i = 1 } ^ { t } b ^ { i - 1 } \nabla _ { \theta } f ( \theta _ { t - i } ) } \\ { \displaystyle \quad = - \sum _ { i = 1 } ^ { t } b ^ { i - 1 } \nabla _ { \theta } f ( \theta _ { t - i } ) = - \sum _ { i = 0 } ^ { t - 1 } b ^ { t - i - 1 } \nabla _ { \theta } f ( \theta _ { i } ) } \end{array}
|
| 547 |
+
$$
|
| 548 |
+
|
| 549 |
+
Thus we can write the update rule for $\mathbf { x } _ { t }$ as,
|
| 550 |
+
|
| 551 |
+
$$
|
| 552 |
+
\pmb \theta _ { t } = \pmb \theta _ { t - 1 } - \gamma \sum _ { i = 1 } ^ { t } \nabla _ { \pmb \theta } f ( \pmb \theta _ { t - i } ) \int _ { 0 } ^ { 1 } b ^ { i - 1 } \pi ( b ) d b
|
| 553 |
+
$$
|
| 554 |
+
|
| 555 |
+
Thus to compute the update rule we must compute the raw moments of $b$ . Fortunately, for the special case where $\pi$ is the density function of a Beta distribution then we have closed form solutions for the raw moments of $b \sim B e t a ( \alpha , \beta )$ (note that $\beta$ here is not referring to a damping coefficient) then these raw moments have a closed form:
|
| 556 |
+
|
| 557 |
+
$$
|
| 558 |
+
\mathbb { E } [ b ^ { k } ] = \prod _ { r = 0 } ^ { k - 1 } \frac { \alpha + r } { \alpha + \beta + r }
|
| 559 |
+
$$
|
| 560 |
+
|
| 561 |
+
This provides a closed form solution to compute $\theta _ { t }$ given $\pmb { \theta } _ { t - 1 }$ and the history of all previous gradients. We refer to this update scheme as Beta-Averaged Momentum. Unfortunately, each update requires the history of all previous gradients to be computed. We may find some reasonable approximation to the update rule. For example, we could keep only the $T$ most recently computed gradients.
|
| 562 |
+
|
| 563 |
+
Figure 12 shows the optimization of 1D quadratics using Beta-Averaged Momentum. The trajectories are similar to those achieved using the original AggMo formulation.
|
| 564 |
+
|
| 565 |
+

|
| 566 |
+
Figure 12: Beta-Averaged GD with a Beta prior on momentum $( \alpha = 1 0 0 , \beta = 1 )$ ).
|
parse/train/Syxt5oC5YQ/Syxt5oC5YQ_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Syxt5oC5YQ/Syxt5oC5YQ_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/Syxt5oC5YQ/Syxt5oC5YQ_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/n6jl7fLxrP/n6jl7fLxrP.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/n6jl7fLxrP/n6jl7fLxrP_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/n6jl7fLxrP/n6jl7fLxrP_middle.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
parse/train/n6jl7fLxrP/n6jl7fLxrP_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|