V ARIATIONAL D ISCRIMINATOR B OTTLENECK : I MPROVING I MITATION L EARNING , I NVERSE RL, AND GAN S BY C ONSTRAINING I NFORMATION F LOW
A BSTRACT
Adversarial learning methods have been proposed for a wide range of applications, but the training of adversarial models can be notoriously unstable.
Effectively balancing the performance of the generator and discriminator is critical, since a discriminator that achieves very high accuracy will produce relatively uninformative gradients.
In this work, we propose a simple and general technique to constrain information ﬂow in the discriminator by means of an information bottleneck.
By enforcing a constraint on the mutual information between the observations and the discriminator’s internal representation, we can effectively modulate the discriminator’s accuracy and maintain useful and informative gradients.
We demonstrate that our proposed variational discriminator bottleneck (VDB) leads to signiﬁcant improvements across three distinct application areas for adversarial learning algorithms.
Our primary evaluation studies the applicability of the VDB to imitation learning of dynamic continuous control skills, such as running.
We show that our method can learn such skills directly from raw video demonstrations, substantially outperforming prior adversarial imitation learning methods.
The VDB can also be combined with adversarial inverse reinforcement learning to learn parsimonious reward functions that can be transferred and re-optimized in new settings.
Finally, we demonstrate that VDB can train GANs more effectively for image generation, improving upon a number of prior stabilization methods.
(Video 1 )
I NTRODUCTION
Adversarial learning methods provide a promising approach to modeling distributions over highdimensional data with complex internal correlation structures.
These methods generally use a discriminator to supervise the training of a generator in order to produce samples that are indistinguishable from the data.
A particular instantiation is generative adversarial networks, which can be used for high-ﬁdelity generation of images (Goodfellow et al., 2014;
Karras et al., 2017) and other highdimensional data (Vondrick et al., 2016; Xie et al., 2018; Donahue et al., 2018).
Adversarial methods can also be used to learn reward functions in the framework of inverse reinforcement learning (Finn et al., 2016a; Fu et al., 2017), or to directly imitate demonstrations (Ho & Ermon, 2016).
However, they suffer from major optimization challenges, one of which is balancing the performance of the generator and discriminator.
A discriminator that achieves very high accuracy can produce relatively uninformative gradients, but a weak discriminator can also hamper the generator’s ability to learn.
These challenges have led to widespread interest in a variety of stabilization methods for adversarial learning algorithms (Arjovsky et al., 2017; Kodali et al., 2017; Berthelot et al., 2017).
In this work, we propose a simple regularization technique for adversarial learning, which constrains the information ﬂow from the inputs to the discriminator using a variational approximation to the information bottleneck.
By enforcing a constraint on the mutual information between the input observations and the discriminator’s internal representation, we can encourage the discriminator to learn a representation that has heavy overlap between the data and the generator’s distribution, thereby effectively modulating the discriminator’s accuracy and maintaining useful and informative gradients for the generator.
Our approach to stabilizing adversarial learning can be viewed as an adaptive variant of instance noise (Salimans et al., 2016;
Sønderby et al., 2016; Arjovsky & Bottou, 2017).
However, we show that the adaptive nature of this method is critical.
Constraining the mutual information between the discriminator’s internal representation and the input allows the regularizer to directly limit the discriminator’s accuracy, which automates the choice of noise magnitude and applies this noise to a compressed representation of the input that is speciﬁcally optimized to model the most discerning differences between the generator and data distributions.
The main contribution of this work is the variational discriminator bottleneck (VDB), an adaptive stochastic regularization method for adversarial learning that substantially improves performance across a range of different application domains, examples of which are available in Figure 1.
Our method can be easily applied to a variety of tasks and architectures.
First, we evaluate our method on a suite of challenging imitation tasks, including learning highly acrobatic skills from mocap data with a simulated humanoid character.
Our method also enables characters to learn dynamic continuous control skills directly from raw video demonstrations, and drastically improves upon previous work that uses adversarial imitation learning.
We further evaluate the effectiveness of the technique for inverse reinforcement learning, which recovers a reward function from demonstrations in order to train future policies.
Finally, we apply our framework to image generation using generative adversarial networks, where employing VDB improves the performance in many cases.
R ELATED W ORK
Recent years have seen an explosion of adversarial learning techniques, spurred by the success of generative adversarial networks (GANs) (Goodfellow et al., 2014).
A GAN framework is commonly composed of a discriminator and a generator, where the discriminator’s objective is to classify samples as real or fake, while the generator’s objective is to produce samples that fool the discriminator.
Similar frameworks have also been proposed for inverse reinforcement learning (IRL)
(Finn et al., 2016b) and imitation learning (Ho & Ermon, 2016).
The training of adversarial models can be extremely unstable, with one of the most prevalent challenges being balancing the interplay between the discriminator and the generator (Berthelot et al., 2017).
The discriminator can often overpower the generator, easily differentiating between real and fake samples, thus providing the generator with uninformative gradients for improvement (Che et al., 2016).
Alternative loss functions have been proposed to mitigate this problem (Mao et al., 2016;
Zhao et al., 2016; Arjovsky et al., 2017).
Regularizers have been incorporated to improve stability and convergence, such as gradient penalties (Kodali et al., 2017; Gulrajani et al., 2017a; Mescheder et al., 2018), reconstruction loss (Che et al., 2016), and a myriad of other heuristics (Sønderby et al., 2016; Salimans et al., 2016; Arjovsky & Bottou, 2017; Berthelot et al., 2017).
Task-speciﬁc architectural designs can also substantially improve performance (Radford et al., 2015; Karras et al., 2017).
Similarly, our method also aims to regularize the discriminator in order to improve the feedback provided to the generator.
But instead of explicit regularization of gradients or architecture-speciﬁc constraints, we apply a general information bottleneck to the discriminator, which previous works have shown to encourage networks to ignore irrelevant cues (Achille & Soatto, 2017).
We hypothesize that this then allows the generator to focus on improving the most discerning differences between real and fake samples.
Adversarial techniques have also been applied to inverse reinforcement learning (Fu et al., 2017), where a reward function is recovered from demonstrations, which can then be used to train policies to reproduce a desired skill.
Finn et al.
(2016a) showed an equivalence between maximum entropy IRL and GANs.
Similar techniques have been developed for adversarial imitation learning (Ho & Ermon, 2016; Merel et al., 2017), where agents learn to imitate demonstrations without explicitly recovering a reward function.
One advantage of adversarial methods is that by leveraging a discriminator in place of a reward function, they can be applied to imitate skills where reward functions can be difﬁcult to engineer.
However, the performance of policies trained through adversarial methods still falls short of those produced by manually designed reward functions, when such reward functions are available (Rajeswaran et al., 2017; Peng et al., 2018).
We show that our method can signiﬁcantly improve upon previous works that use adversarial techniques, and produces results of comparable quality to those from state-of-the-art approaches that utilize manually engineered reward functions.
Our variational discriminator bottleneck is based on the information bottleneck (Tishby & Zaslavsky, 2015), a technique for regularizing internal representations to minimize the mutual information with the input.
Intuitively, a compressed representation can improve generalization by ignoring irrelevant distractors present in the original input.
The information bottleneck can be instantiated in practical deep models by leveraging a variational bound and the reparameterization trick, inspired by a similar approach in variational autoencoders (VAE) (Kingma & Welling, 2013).
The resulting variational information bottleneck approximates this compression effect in deep networks (Alemi et al., 2016; Achille & Soatto, 2017).
A similar bottleneck has also been applied to learn disentangled representations (Higgins et al., 2017).
Building on the success of VAEs and GANs, a number of efforts have been made to combine the two.
Makhzani et al.
(2016) used adversarial discriminators during the training of VAEs to encourage the marginal distribution of the latent encoding to be similar to the prior distribution, similar techniques include Mescheder et al.
(2017) and Chen et al.
Conversely, Larsen et al.
(2016) modeled the generator of a GAN using a VAE.
Zhao et al.
(2016) used an autoencoder instead of a VAE to model the discriminator, but does not enforce an information bottleneck on the encoding.
While instance noise is widely used in modern architectures (Salimans et al., 2016; Sønderby et al., 2016; Arjovsky & Bottou, 2017), we show that explicitly enforcing an information bottleneck leads to improved performance over simply adding noise for a variety of applications.
P RELIMINARIES
In this section, we provide a review of the variational information bottleneck proposed by Alemi et al.
in the context of supervised learning.
Our variational discriminator bottleneck is based on the same principle, and can be instantiated in the context of GANs, inverse RL, and imitation learning.
Given a dataset { x i , y i } , with features x i and labels y i , the standard maximum likelihood estimate q
( y i | x i ) can be determined according to
[Equation]
Unfortunately, this estimate is prone to overﬁtting, and the resulting model can often exploit idiosyncrasies in the data (Krizhevsky et al., 2012; Srivastava et al., 2014).
Alemi et al.
(2016) proposed regularizing the model using an information bottleneck to encourage the model to focus only on the most discriminative features.
The bottleneck can be incorporated by ﬁrst introducing an encoder
E ( z | x ) that maps the features x to a latent distribution over Z , and then enforcing an upper bound
I c on the mutual information between the encoding and the original features I ( X, Z ) .
This results in the following regularized objective J ( q, E )
[Equation]
Note that the model q ( y | z ) now maps samples from the latent distribution z to the label y .
The mutual information is deﬁned according to
[Equation]
where p ( x ) is the distribution given by the dataset.
Computing the marginal distribution p
[Equation]
z ) =
[Equation]
E ( z | x ) p ( x ) d x can be challenging.
Instead, a variational lower bound can be obtained by using an approximation r ( z ) of the marginal.
Since KL [ p ( z ) ||
r ( z )] ≥ 0 , (cid:82) p ( z ) log p ( z ) d z ≥ (cid:82) p ( z ) log r ( z ) d z , an upper bound on I ( X, Z ) can be obtained via the KL divergence,
[Equation]
This provides an upper bound on the regularized objective ˜ J ( q
[Equation]
E
[Equation]
≥ J ( q
[Equation]
To solve this problem, the constraint can be subsumed into the objective with a coefﬁcient β min q,E
[Equation]
Alemi et al.
(2016) evaluated the method on supervised learning tasks, and showed that models trained with a VIB can be less prone to overﬁtting and more robust to adversarial examples.
V ARIATIONAL D ISCRIMINATOR B OTTLENECK
To outline our method, we ﬁrst consider a standard GAN framework consisting of a discriminator
D and a generator G , where the goal of the discriminator is to distinguish between samples from the target distribution p ∗ ( x ) and samples from the generator G ( x ) ,
[Equation]
We incorporate a variational information bottleneck by introducing an encoder E into the discriminator that maps a sample x to a stochastic encoding z ∼ E ( z | x ) , and then apply a constraint I c on the mutual information
I ( X, Z ) between the original features and the encoding.
D is then trained to classify samples drawn from the encoder distribution.
A schematic illustration of the framework is available in Figure 2.
The regularized objective J ( D, E ) for the discriminator is given by
J
[Equation]
D, E ) =
[Equation]
D,E
[Equation]
with ˜ p
= 12 p ∗ + 12 G being a mixture of the target distribution and the generator.
We refer to this regularizer as the variational discriminator bottleneck (VDB).
To optimize this objective, we can introduce a Lagrange multiplier β ,
[Equation]
As we will discuss in Section 4.1 and demonstrate in our experiments, enforcing a speciﬁc mutual information budget between x and z is critical for good performance.
We therefore adaptively update β via dual gradient descent to enforce a speciﬁc constraint I c on the mutual information,
[Equation]
[Equation]
where L ( D, E, β ) is the Lagrangian
L
[Equation]
D
[Equation]
and α β is the stepsize for the dual variable in dual gradient descent (Boyd & Vandenberghe, 2004).
In practice, we perform only one gradient step on D and E , followed by an update to β .
We refer to a GAN that incorporates a VDB as a variational generative adversarial network (VGAN).
In our experiments, the prior r ( z ) = N (0 , I ) is modeled with a standard Gaussian.
The encoder
E ( z | x ) = N ( µ E ( x ) , Σ E ( x )) models a Gaussian distribution in the latent variables Z , with mean µ E ( x ) and diagonal covariance matrix Σ E ( x ) .
When computing the KL loss, each batch of data contains an equal number of samples from p ∗ ( x ) and G ( x ) .
We use a simpliﬁed objective for the generator,
[Equation]
) where the KL penalty is excluded from the generator’s objective.
Instead of computing the expectation over Z , we found that approximating the expectation by evaluating D at the mean µ E ( x ) of the encoder’s distribution was sufﬁcient for our tasks.
The discriminator is modeled with a single linear unit followed by a sigmoid D ( z ) =
σ ( w T D
z
+ b D ) , with weights w D and bias b D .
4. D ISCUSSION AND A NALYSIS
To interpret the effects of the VDB, we consider the results presented by Arjovsky & Bottou (2017), which show that for two distributions with disjoint support, the optimal discriminator can perfectly classify all samples and its gradients will be zero almost everywhere.
Thus, as the discriminator converges to the optimum, the gradients for the generator vanishes accordingly.
To address this issue,
Arjovsky & Bottou (2017) proposed applying continuous noise to the discriminator inputs, thereby ensuring that the distributions have continuous support everywhere.
In practice, if the original distributions are sufﬁciently distant from each other, the added noise will have negligible effects.
As shown by Mescheder et al.
(2017), the optimal choice for the variance of the noise to ensure convergence can be quite delicate.
In our method, by ﬁrst using a learned encoder to map the inputs to an embedding and then applying an information bottleneck on the embedding, we can dynamically adjust the variance of the noise such that the distributions not only share support in the embedding space, but also have signiﬁcant overlap.
Since the minimum amount of information required for binary classiﬁcation is 1 bit, by selecting an information constraint
I c < 1 , the discriminator is prevented from from perfectly differentiating between the distributions.
To illustrate the effects of the
VDB, we consider a simple task of training a discriminator to differentiate between two Gaussian distributions.
Figure 2 visualizes the decision boundaries learned with different bounds I c on the mutual information.
Without a VDB, the discriminator learns a sharp decision boundary, resulting in vanishing gradients for much of the space.
But as I c decreases and the bound tightens, the decision boundary is smoothed, providing more informative gradients that can be leveraged by the generator.
Taking this analysis further, we can extend Theorem 3.2 from Arjovsky & Bottou (2017) to analyze the VDB, and show that the gradient of the generator will be non-degenerate for a small enough constraint I c , under some additional simplifying assumptions.
The result in Arjovsky & Bottou (2017) states that the gradient consists of vectors that point toward samples on the data manifold, multiplied by coefﬁcients that depend on the noise.
However, these coefﬁcients may be arbitrarily small if the generated samples are far from real samples, and the noise is not large enough.
This can still cause the generator gradient to vanish.
In the case of the VDB, the constraint ensures that these coefﬁcients are always bounded below.
Due to space constraints, this result is presented in
Appendix A.
4. VAIL: V ARIATIONAL A DVERSARIAL I MITATION L EARNING
To extend the VDB to imitation learning, we start with the generative adversarial imitation learning (GAIL) framework (Ho & Ermon, 2016), where the discriminator’s objective is to differentiate between the state distribution induced by a target policy π ∗ ( s ) and the state distribution of the agent’s policy π ( s ) ,
[Equation]
[Figure]
The discriminator is trained to maximize the likelihood assigned to states from the target policy, while minimizing the likelihood assigned to states from the agent’s policy.
The discriminator also serves as the reward function for the agent, which encourages the policy to visit states that, to the discriminator, appear indistinguishable from the demonstrations.
Similar to the GAN framework, we can incorporate a VDB into the discriminator,
[Equation]
(12) where ˜ π = 12 π ∗ + 12 π represents a mixture of the target policy and the agent’s policy.
The reward for π is then speciﬁed by the discriminator r t = − log (1 − D ( µ E ( s ))) .
We refer to this method as variational adversarial imitation learning (VAIL).
4. VAIRL: V ARIATIONAL A DVERSARIAL I NVERSE R EINFORCEMENT L EARNING
The VDB can also be applied to adversarial inverse reinforcement learning (Fu et al., 2017) to yield a new algorithm which we call variational adversarial inverse reinforcement learning (VAIRL).
AIRL operates in a similar manner to GAIL, but with a discriminator of the form
[Equation]
where f ( s , a , s (cid:48) )
=
g ( s , a ) + γh ( s (cid:48) ) − h
( s ) , with g and h being learned functions.
Under certain restrictions on the environment, Fu et al.
show that if g ( s , a ) is deﬁned to depend only on the current state s , the optimal g ( s ) recovers the expert’s true reward function r ∗ ( s ) up to a constant g ∗ ( s ) =
r ∗ ( s ) + const.
In this case, the learned reward can be re-used to train policies in environments with different dynamics, and will yield the same policy as if the policy was trained under the expert’s true reward.
In contrast, GAIL’s discriminator typically cannot be re-optimized in this way (Fu et al., 2017).
In VAIRL, we introduce stochastic encoders
E g ( z g | s ) , E h ( z h | s ) , and g ( z g ) , h ( z h ) are modiﬁed to be functions of the encoding.
We can reformulate Equation 13 as
[Equation]
for z =
( z g , z h , z (cid:48) h ) and f ( z g , z h , z (cid:48) h )
=
D g
( z g )
+ γD h ( z (cid:48) h )
− D h
( z h ) .
We then obtain a modiﬁed objective of the form
[Equation]
where π ( s, s (cid:48) ) denotes the joint distribution of successive states from a policy, and E ( z | s , s (cid:48) )
=
E g ( z g | s ) · E h ( z h | s ) · E h ( z (cid:48)
h | s (cid:48) ) .
[Table]
E XPERIMENTS
We evaluate our method on adversarial learning problems in imitation learning, inverse reinforcement learning, and image generation.
In the case of imitation learning, we show that the VDB enables agents to learn complex motion skills from a single demonstration, including visual demonstrations provided in the form of video clips.
We also show that the VDB improves the performance of inverse RL methods.
Inverse RL aims to reconstruct a reward function from a set demonstrations, which can then used to perform the task in new environments, in contrast to imitation learning, which aims to recover a policy directly.
Our method is also not limited to control tasks, and we demonstrate its effectiveness for unconditional image generation.
5. VAIL: V ARIATIONAL A DVERSARIAL I MITATION L EARNING
The goal of the motion imitation tasks is to train a simulated character to mimic demonstrations provided by mocap clips recorded from human actors.
Each mocap clip provides a sequence of target states { s ∗ 0 , s ∗ 1 , ..., s ∗ T } that the character should track at each timestep.
We use a similar experimental setup as Peng et al.
(2018), with a 34 degrees-of-freedom humanoid character.
We found that the discriminator architecture can greatly affect the performance on complex skills.
The particular architecture we employ differs substantially from those used in prior work (Merel et al., 2017), details of which are available in Appendix C.
The encoding Z is 128 D and an information constraint of
I c = 0 .
5 is applied for all skills, with a dual stepsize of α β = 10 − 5 .
All policies are trained using
PPO (Schulman et al., 2017).
The motions learned by the policies are best seen in the supplementary video.
Snapshots of the character’s motions are shown in Figure 3.
Each skill is learned from a single demonstration.
VAIL is able to closely reproduce a variety of skills, including those that involve highly dynamics ﬂips and complex contacts.
We compare VAIL to a number of other techniques, including state-only GAIL (Ho & Ermon, 2016), GAIL with instance noise applied to the discriminator inputs (GAIL - noise),
GAIL with instance noise applied to the last hidden layer (GAIL - noise z), and GAIL with a gradient penalty applied to the discriminator (GAIL - GP) (Mescheder et al., 2018).
Since the VDB helps to prevent vanishing gradients, while GP mitigates exploding gradients, the two techniques can be seen as being complementary.
Therefore, we also train a model that combines both VAIL and GP (VAIL -
GP).
Implementation details for combining the VDB and GP are available in Appendix B. Learning curves for the various methods are shown in Figure 10 and Table 1 summarizes the performance of the ﬁnal policies.
Performance is measured in terms of the average joint rotation error between the simulated character and the reference motion.
We also include a reimplementation of the method described by Merel et al.
For the purpose of our experiments, GAIL denotes policies trained using our particular architecture but without a VDB, and Merel et al.
(2017) denotes policies trained using an architecture that closely mirror those from previous work.
Furthermore, we include comparisons to policies trained using the handcrafted reward from Peng et al.
(2018), as well as policies trained via behavioral cloning (BC).
Since mocap data does not provide expert actions, we use the policies from Peng et al.
(2018) as oracles to provide state-action demonstrations, which are then used to train the BC policies via supervised learning.
Each BC policy is trained with 10k samples from the oracle policies, while all other policies are trained from just a single demonstration, the equivalent of approximately 100 samples.
VAIL consistently outperforms previous adversarial methods, and VAIL - GP achieves the best performance overall.
Simply adding instance noise to the inputs (Salimans et al., 2016) or hidden layer without the KL constraint (Sønderby et al., 2016) leads to worse performance, since the network can learn a latent representation that renders the effects of the noise negligible.
Though training with the handcrafted reward still outperforms the adversarial methods, VAIL demonstrates comparable performance to the handcrafted reward without manual reward or feature engineering, and produces motions that closely resemble the original demonstrations.
The method from Merel et al.
(2017) was able to imitate simple skills such as running, but was unable to reproduce more acrobatic skills such as the backﬂip and spinkick.
In the case of running, our implementation produces more natural gaits than the results reported in Merel et al.
Behavioral cloning is unable to reproduce any of the skills, despite being provided with substantially more demonstration data than the other methods.
Video Imitation: While our method achieves substantially better results on motion imitation when compared to prior work, previous methods can still produce reasonable behaviors.
However, if the demonstrations are provided in terms of the raw pixels from video clips, instead of mocap data, the imitation task becomes substantially harder.
The goal of the agent is therefore to directly im-
[Table]
itate the skill depicted in the video.
This is also a setting where manually engineering rewards is impractical, since simple losses like pixel distance do not provide a semantically meaningful mea- of similarity.
Figure 6 compares learning curves of policies trained with VAIL, GAIL, and policies trained using a reward function deﬁned by the average pixel-wise difference between the frame M ∗ t from the video demonstration and a rendered image M t of the agent at each timestep t , r t = 1 −
[Equation]
Each frame is represented by a 64 × 64 RGB image.
Both GAIL and the pixel-loss are unable to learn the running gait.
VAIL is the only method that successfully learns to imitate the skill from the video demonstration.
Snapshots of the video demonstration and the simulated motion is available in Figure 5.
To further investigate the effects of the
VDB, we visualize the gradient of the discriminator with respect to images from the video demonstration and simulation.
Saliency maps for discriminators trained with VAIL and GAIL are available in Figure 5.
The VAIL discriminator learns to attend to spatially coherent image patches around the character, while the GAIL discriminator exhibits less structure.
The magnitude of the gradients from
VAIL also tend to be signiﬁcantly larger than those from GAIL, which may suggests that VAIL is able to mitigate the problem of vanishing gradients present in GAIL.
Adaptive Constraint: To evaluate the effects of the adaptive β updates, we compare policies trained with different ﬁxed values of β and policies where β is updated adaptively to enforce a desired information constraint I c = 0 .
Figure 6 illustrates the learning curves and the KL loss over the course of training.
When β is too small, performance reverts to that achieved by GAIL.
Large values of β help to smooth the discriminator landscape and improve learning speed during the early stages of training, but converges to a worse performance.
Policies trained using dual gradient descent to adaptively update β consistently achieves the best performance overall.
5. VAIRL: V ARIATIONAL A DVERSARIAL I NVERSE R EINFORCEMENT L EARNING
Next, we use VAIRL to recover reward functions from demonstrations.
Unlike the discriminator learned by VAIL, the reward function recovered by VAIRL can be re-optimized to train new policies from scratch in the same environment.
In some cases, it can also be used to transfer similar behaviour to different environments.
In Figure 7, we show the results of applying VAIRL to the C-maze from
Fu et al.
(2017), and a more complex S-maze; the simple 2D observation spaces of these tasks make it easy to interpret the recovered reward functions.
In both mazes, the expert is trained to navigate from a start position at the bottom of the maze to a ﬁxed target position at the top.
We use each method to obtain an imitation policy and to approximate the expert’s reward on the original maze.
The recovered reward is then used to train a new policy to solve a left–right ﬂipped version of the training maze.
On the C-maze, we found that plain AIRL—without a gradient penalty— would sometimes overﬁt and fail to transfer to the new environment, as evidenced by the reward visualization in Figure 7 (left) and the higher return variance in Figure 7 (right).
In contrast, by incorporating a VDB into AIRL, VAIRL learns a substantially smoother reward function that is more suitable for transfer.
Furthermore, we found that in the S-maze with two internal walls, AIRL was too unstable to acquire a meaningful reward function.
This was true even with the use of a gradient penalty.
In contrast, VAIRL was able to learn a reasonable reward in most cases without a
Method
FID
GAN 63.
Inst Noise 30.
SN 23.
GP 22.
WGAN-GP 19.
VGAN (ours) 24.
VGAN-SN (ours) 71.
VGAN-GP (ours) 18.
gradient penalty, and its performance improved even further with the addition of a gradient penalty.
To evaluate the effects of the VDB, we observe that the performance of VAIRL drops on both tasks when the KL constraint is disabled ( β = 0 ), suggesting that the improvements from the VDB cannot be attributed entirely to the noise introduced by the sampling process for z .
Further details of these experiments and illustrations of the recovered reward functions are available in Appendix D.
5. VGAN: V ARIATIONAL G ENERATIVE A DVERSARIAL N ETWORKS
Finally, we apply the VDB to image generation with generative adversarial networks, which we refer to as VGAN.
Experiment are conducted on CIFAR-10 (Krizhevsky et al.)
, CelebA (Liu et al.
(2015)), and CelebAHQ (Karras et al., 2018) datasets.
We compare our approach to recent stabilization techniques: WGAN-GP (Gulrajani et al., 2017b), instance noise (Sønderby et al., 2016;
Arjovsky & Bottou, 2017), spectral normalization (SN) (Miyato et al., 2018), and gradient penalty (GP) (Mescheder et al., 2018), as well as the original GAN (Goodfellow et al., 2014) on CIFAR10.
To measure performance, we report the Fr´echet Inception Distance (FID) (Heusel et al., 2017), which has been shown to be more consistent with human evaluation.
All methods are implemented using the same base model, built on the resnet architecture of Mescheder et al.
Aside from tuning the KL constraint I c for VGAN, no additional hyperparameter optimization was performed to modify the settings provided by Mescheder et al.
The performance of the various methods on CIFAR-10 are shown in Figure 8.
While vanilla GAN and instance noise are prone to diverging as training progresses, VGAN remains stable.
Note that instance noise can be seen as a non-adaptive version of VGAN without constraints on I c .
This experiment again highlights that there is a significant improvement from imposing the information bottleneck over simply adding instance noise.
Combining both VDB and gradient penalty (VGAN - GP) achieves the best performance overall with an FID of 18.1.
We also experimented with combining the VDB with SN, but this combination is prone to diverging.
See Figure 9 for samples of images generated with our approach.
Please refer to Appendix E for experimental details and more results.
C ONCLUSION
We present the variational discriminator bottleneck, a general regularization technique for adversarial learning.
Our experiments show that the VDB is broadly applicable to a variety of domains, and yields signiﬁcant improvements over previous techniques on a number of challenging tasks.
While our experiments have produced promising results for video imitation, the results have been primarily with videos of synthetic scenes.
We believe that extending the technique to imitating realworld videos is an exciting direction.
Another exciting direction for future work is a more in-depth theoretical analysis of the method, to derive convergence and stability results or conditions.
A CKNOWLEDGEMENTS
We would like to thank the anonymous reviewers for their helpful feedback and AWS and NVIDIA for providing computational resources.
This research was funded by an NSERC Postgraduate Scholarship, a Berkeley Fellowship for Graduate Study, BAIR, Huawei, and ONR PECASE
N
S UPPLEMENTARY M ATERIAL A A NALYSIS AND P ROOFS
In this appendix, we show that the gradient of the generator when the discriminator is augmented with the VDB is non-degenerate, under some mild additional assumptions.
First, we assume a pointwise constraint of the form KL[ E ( z | x ) (cid:107) r ( z )] ≤ I c for all x .
In reality, we use an average
KL constraint, since we found it to be more convenient to optimize, though a pointwise constraint is also possible to enforce by using the largest constraint violation to increment β .
We could likely also extend the analysis to the average constraint, though we leave this to future work.
The main theorem can then be stated as follows:
Theorem A.1.
Let g ( u ) denote the generator’s mapping from a noise vector u ∼ p ( u ) to a point in X .
Given the generator distribution G ( x ) and data distribution p ∗ ( x ) , a VDB with an encoder
E ( z | x ) = N ( µ E ( x ) , Σ) , and KL[ E ( z | x ) (cid:107) r ( z )] ≤ I c , the gradient passed to the generator has the form
[Equation]
where D ∗ ( z ) is the optimal discriminator, a ( x ) and b ( x ) are positive functions, and we always have
E ( µ E ( g ( u ))
| x ) > C ( I c ) , where C ( I c ) is a continuous monotonic function, and C ( I c ) → δ > 0 as
I c → 0 .
Analysis for an encoder with an input-dependent variance Σ( x ) is also possible, but more involved.
We’ll further assume below for notational simplicity that Σ is diagonal with diagonal values σ 2 .
This assumption is not required, but substantially simpliﬁes the linear algebra.
Analogously to
Theorem 3.2 from Arjovsky & Bottou (2017), this theorem states that the gradient of the generator points in the direction of points in the data distribution, and away from points in the generator distribution.
However, going beyond the theorem in Arjovsky & Bottou (2017), this result states that the coefﬁcients on these vectors, given by E ( µ E ( g ( u )) | x ) , are always bounded below by a value that approaches a positive constant δ as we decrease I c , meaning that the gradient does not vanish.
The proof of the ﬁrst part of this theorem is essentially identical to the proof presented by Arjovsky & Bottou (2017), but accounting for the fact that the noise is now injected into the latent space of the VDB, rather than being added directly to x .
This result assumes that E ( z | x ) has a learned but input-independent variance Σ
= σ 2 I , though the proof can be repeated for an input-dependent or non-diagonal Σ :
Proof.
Overloading p ∗ ( x ) and G ( x ) , let p ∗ ( z ) and G ( z ) be the distribution of embeddings
z under the real data and generator respectively.
p ∗ ( z ) is then given by
[Equation]
and similarly for G ( z )
[Equation]
From Arjovsky & Bottou (2017), the optimal discriminator between p ∗ ( z ) and G ( z ) is
[Equation]
The gradient passed to the generator then has the form
[Equation]
Let
[Equation]
We then have
[Equation]
Similar to the result from Arjovsky & Bottou (2017), the gradient of the generator drives the generator’s samples in the embedding space µ E ( g ( u )) towards embeddings of the points from the dataset µ E ( x ) weighted by their likelihood E ( µ E ( g ( u ))
| x ) under the real data.
For an arbitrary encoder E , real and fake samples in the embedding may be far apart.
As such, the coefﬁcients E ( µ E ( g ( u ))
| x ) can be arbitrarily small, thereby resulting in vanishing gradients for the generator.
The second part of the theorem states that C
( I c ) is a continuous monotonic function, and
C ( I c )
→ δ > 0 as I c → 0 .
This is the main result, and relies on the fact that KL[ E ( z | x ) || r ( z )] ≤ I c .
The intuition behind this result is that, for any two inputs x and y , their encoded distributions E ( z | x ) and E ( z | y ) have means that cannot be more than some distance apart, and that distance shrinks with
I c .
This allows us to bound E ( µ E ( y ))
| x ) below by C ( I c ) , which ensures that the coefﬁcients on the vectors in the theorem above are always at least as large as C ( I c ) .
Proof.
Let r ( z ) =
N (0 , I ) be the prior distribution and suppose the KL divergence for all x in the dataset and all g ( u ) generated by the generator are bounded by I c
[Equation]
From the deﬁnition of the KL-divergence we can bound the length of all embedding vectors,
[Equation]
and similarly for || µ E ( g ( u ))
|| 2 , with K denoting the dimension of Z .
A lower bound on
E ( µ E ( g ( u ))
| x ) , where u ∼ p ( u ) and x ∼ p ∗ ( x ) , can then be determined by
[Equation]
π
Since || µ E ( x ) || 2 , || µ E ( g ( u )) || 2 ≤ 2 I c −
[Equation]
2 + K + K log σ 2 ,
[Equation]
µ E
[Equation]
g
[Equation]
and it follows that −
[Equation]
The likelihood is therefore bounded below by
[Equation]
Since − σ − 2 − σ − 2 log σ − 2 ≥ − 1 ,
[Equation]
From the KL constraint
[Equation]
we can derive a lower bound (cid:96) ( I c ) and an upper bound U ( I c ) on σ 2 .
[Equation]
For the upper bound, since σ 2 − log σ 2 > 12 σ 2 ,
[Equation]
Substituting (cid:96) ( I c ) and U ( I c ) into Equation
[Equation]
we arrive at the following lower bound
[Equation]
B G RADIENT P ENALTY
To combine VDB with gradient penalty, we use the reparameterization trick to backprop through the encoder when computing the gradient of the discriminator with respect to the inputs.
[Equation]
The coefﬁcient w GP weights the gradient penalty in the objective, w GP = 10 for the image generation, w GP = 1 for motion imitation, and w GP = 0 .
1 (C-maze) or w GP = 0 .
01 (S-maze) for the IRL tasks.
The gradient penalty is applied only to real samples p ∗ ( x ) .
We have experimented with apply the penalty to both real and fake samples, but found that performance was worse than penalizing only gradients from real samples.
This is consistent with the GP implementation from
Mescheder et al.
C I MITATION L EARNING
Experimental Setup: The goal of the motion imitation tasks is to train a simulated agent to mimic a demonstration provided in the form of a mocap clip recorded from a human actor.
We use a similar experimental setup as Peng et al.
(2018), with a 34 degrees-of-freedom humanoid character.
The state s consists of features that represent the conﬁguration of the character’s body (link positions and velocities).
We also include a phase variable φ ∈ [0 , 1] among the state features, which records the character’s progress along the motion and helps to synchronize the character with the reference motion.
With 0 and 1 denoting the start and end of the motion respectively.
The action a sampled from the policy π ( a | s ) speciﬁes target poses for PD controller positioned at each joint.
Given a state, the policy speciﬁes a Gaussian distribution over the action space π ( a | s ) =
N ( µ ( s ) , Σ) , with a state-dependent mean µ ( s ) and ﬁxed diagonal covariance matrix Σ .
µ ( s ) is modeled using a 3layered fully-connected network with 1024 and 512 hidden units, followed by a linear output layer that speciﬁes the mean of the Gaussian.
ReLU activations are used for all hidden layers.
The value function is modeled with a similar architecture but with a single linear output unit.
The policy is queried at 30 Hz .
Physics simulation is performed at 1.2kHz using the Bullet physics engine Bullet (2015).
Given the rewards from the discriminator, PPO (Schulman et al., 2017) is used to train the policy, with a stepsize of 2 . 5 × 10 − 6 for the policy, a stepsize of 0 .
01 for the value function, and a stepsize of 10 − 5 for the discirminator.
Gradient descent with momentum 0.9 is used for all models.
The
PPO clipping threshold is set to 0 .
When evaluating the performance of the policies, each episode is simulated for a maximum horizon of 20 s .
Early termination is triggered whenever the character’s torso contacts the ground, leaving the policy is a maximum error of π radians for all remaining timesteps.
Phase-Functioned Discriminator: Unlike the policy and value function, which are modeled with standard fully-connected networks, the discriminator is modeled by a phase-functioned neural network (PFNN) to explicitly model the time-dependency of the reference motion (Holden et al., 2017).
While the parameters of a network are generally ﬁxed, the parameters of a PFNN are functions of the phase variable φ .
The parameters θ of the network for a given φ is determined by a weighted combination of a set of ﬁxed parameters { θ 0 , θ 1 , ..., θ k } ,
[Equation]
where w i ( φ ) is a phase-dependent weight for θ i .
In our implementation, we use k = 5 sets of parameters and w i ( φ ) is designed to linearly interpolate between two adjacent sets of parameters for each phase φ , where each set of parameters θ i corresponds to a discrete phase value φ i spaced uniformly between [0 , 1] .
For a given value of φ , the parameters of the discriminator are determined according to
[Equation]
where θ i and θ i +1 correspond to the phase values φ i ≤ φ < φ
i +1 that form the endpoints of the phase interval that contains φ .
A PFNN is used for all motion imitation experiments, both
VAIL and GAIL, except for those that use the approach proposed by Merel et al.
(2017), which use standard fully-connected networks for the discriminator.
Figure 11 compares the performance of
VAIL when the discriminator is modeled with a phase-functioned neural network (with PFNN) to discriminators modeled with standard fully-connected networks.
We increased the size of the layers of the fully-connected nets to have a similar number of parameters as a PFNN.
We evaluate the performance of fully-connected nets that receive the phase variable φ as part of the input (no PFNN), and fully-connected nets that do not receive φ as an input.
The phase-functioned discriminator leads to signiﬁcant performance improvements across all tasks evaluated.
Policies trained without a phase variable performs worst overall, suggesting that phase information is critical for performance.
All methods perform well on simpler skills, such as running, but the additional phase structure introduced by the PFNN proved to be vital for successful imitation of more complex skills, such as the dance and backﬂip.
Next we compare the accuracy of discriminators trained using different methods.
Figure 12 illustrates accuracy of the discriminators over the course of training.
Discriminators trained via GAIL quickly overpowers the policy, and learns to accurately differentiate between samples, even when instance noise is applied to the inputs.
VAIL without the KL constraint slows the discriminator’s progress, but nonetheless reaches near perfect accuracy with a larger number of samples.
Once the
KL constraint is enforced, the information bottleneck constrains the performance of the discriminator, converging to approximately 80% accuracy.
Figure 12 also visualizes the value of β over the course of training for motion imitation tasks, along with the loss of the KL term in the objective.
The dual gradient descent update effectively enforces the VDB constraint I c .
Video Imitation: In the video imitation tasks, we use a simpliﬁed 2D biped character in order to avoid issues that may arise due to depth ambiguity from monocular videos.
The biped character has a total of 12 degrees-of-freedom, with similar state and action parameters as the humanoid.
The video demonstrations are generated by rendering a reference motion into a sequence of video frames, which are then provided to the agent as a demonstration.
The goal of the agent is to imitate the motion depicted in the video, without access to the original reference motion, and the reference motion is used only to evaluate performance.
D I NVERSE R EINFORCEMENT L EARNING D. E XPERIMENTAL SETUP
Environments We evaluate on two maze tasks, as illustrated in Figure 13.
The C-maze is taken from Fu et al.
(2017): in this maze, the agent starts at a random point within a small ﬁxed distance of the mean start position.
The agent has a continuous, 2D action space which allows it to accelerate in the x or y directions, and is able to observe its x and y position, but not its velocity.
The ground truth reward is r t = − d t − 10 − 3 (cid:107) a t (cid:107) 2 , where d t is the agent’s distance to the goal, and a t is its action (this action penalty is assumed to be zero in Figure 13).
Episodes terminate after 100 steps; for evaluation, we report the undiscounted mean sum of rewards over each episode The S-maze is larger variant of the same environment with an extra wall between the agent and its goal.
To make the S-maze easier to solve for the expert, we added further reward shaping to encourage the agent to pass between the gaps between walls.
We also increased the maximum control forces relative to the
C-maze to enable more rapid exploration.
Environments will be released along with the rest of our
VAIRL implementations.
Hyperparameters Policy networks for all methods were two-layer ReLU MLPs with 32 hidden units per layer.
Reward and discriminator networks were similar, but with 32-unit mean and standard deviation layers inserted before the ﬁnal layer for VDB methods.
To generate expert demonstrations, we trained a TRPO (Schulman et al., 2015) agent on the ground truth reward for the training environment for 200 iterations, and saved 107 trajectories from each of the policies corresponding to the ﬁve ﬁnal iterations.
TRPO used a batch size of 10,000, a step size of 0.01, and entropy bonus with a coefﬁcient of 0.1 to increase diversity.
After generating demonstrations, we trained the IRL and imitation methods on a training maze for 200 iterations; again, our policy optimizer was TRPO with the same hyperparameters used to generate demonstrations.
Between each policy update, we did 100 discriminator updates using Adam with a learning rate of 5 × 10 − 5 and batch size of 32.
For the C-maze our VAIRL runs used a target KL of I C = 0 .
5 , while for the more complex S-maze we use a tighter target of I C = 0 . 05 .
For the test C-maze, we trained new policies against the recovered reward using TRPO with the hyperparameters described above; for the test S-maze, we modiﬁed these parameters to use a batch size of 50,000 and learning rate of 0.001 for 400 iterations.
D. R ECOVERED REWARD FUNCTIONS
Figure 14 and 15 show the reward functions recovered by each IRL baseline on the C-maze and
S-maze, respectively, along with sample trajectories for policies trained to optimize those rewards.
Notice that VAIRL tends to recover smoother reward functions that match the ground truth reward more closely than the baselines.
Addition of a gradient penalty enhances this effect for both AIRL and VAIRL.
This is especially true in S-maze, where combining a gradient penalty with a variational discriminator bottleneck leads to a smooth reward that gradually increases as the agent nears its goal position at the top of the maze.
E I MAGE G ENERATION
We provide further experiment on image generation and details of the experimental setup.
E. E XPERIMENTAL S ETUP :
We use the non-saturating objective of Goodfellow et al.
(2014) for all models except WGANGP.
Following (Lucic et al., 2017), we compute FID on samples of size 10000 2 .
We base our implementation on (Mescheder et al., 2018), where we do not use any batch normalization for both the generator and the discriminator.
We use RMSprop (Hinton et al.) and a ﬁxed learning rate for all experiments.
For convolutional GAN, variational discriminative bottleneck is implemented as a 1x1 convolution on the ﬁnal embedding space that outputs a Gaussian distribution over Z parametrized with a mean and a diagonal covariance matrix.
For all image experiments, we preserve the dimensionality of the latent space.
All experiments use adaptive β update with a dual stepsize of α β = 10 − 5 .
We will make our code public.
Similarly to VGAN, instance noise Sønderby et al.
; Arjovsky & Bottou (2017) is added to the ﬁnal embedding space of the discriminator right before applying the classiﬁer.
Instance noise can be interpreted as a non-adaptive VGAN without a information constraint.
Architecture:
For CIFAR-10, we use a resnet-based architecture adapted from (Mescheder et al., 2018) detailed in Tables 2, 3, and 4.
For CelebA and CelebAHQ, we use the same architecture used in (Mescheder et al., 2018).
[Table] [Table]
E. R ESULTS
CIFAR-10:
We compare our approach with recent stabilization techniques: WGAN-GP (Gulrajani et al., 2017b), instance noise (Sønderby et al., 2016; Arjovsky & Bottou, 2017), spectral normalization (Miyato et al., 2018), and gradient penalty (Mescheder et al., 2018).
We train report the networks at 750k iterations.
We use I c = 0 . 1 , and a coefﬁcient of w GP = 10 for the gradient penalty, which is the same as the value used by the implementation from Mescheder et al.
See Figure 16 for visual comparisons of randomly generated samples.
CelebA: On the CelebA (Liu et al., 2015) dataset, we generate images of size 128 × 128 with
I c = 0 .
On this dataset we do not see a big improvement upon the other baselines.
This is likely because the architecture has been effectively tuned for this task, reﬂected by the fact that even the vanilla GAN trains ﬁne on this dataset.
All GAN, GP, and VGAN-GP obtain a similar FID scores of 7.64, 7.76, 7.25 respectively.
See Figure 17 for more qualitative results with our approach.
CelebAHQ: VGAN can also be trained on on CelebAHQ Karras et al.
(2018) at 1024 byresolution directly, without progressive growing (Karras et al., 2018).
We use I c = 0 .
1 and train with VGAN-GP.
We train on a single Tesla V100, which ﬁts a batch size of 8 in our experiments.
Previous approaches (Karras et al., 2018; Mescheder et al., 2018) use a larger batch size and train over multiple GPUs.
The model was trained for 300k iterations.
[Table]